Package net.minecraftforge.common.ForgeChunkManager

Examples of net.minecraftforge.common.ForgeChunkManager.Ticket


    {
        if (map.containsKey(world.provider.dimensionId))
        {
            OutputHandler.debug(world.provider.dimensionId + " was already loaded. add 1 to count.");

            Ticket ticket = map.get(world.provider.dimensionId);
            ticket.getModData().setInteger("count", ticket.getModData().getInteger("count") + 1);
            return true;
        }
        else
        {
            Ticket ticket = ForgeChunkManager.requestTicket(ForgeEssentials.instance, world, ForgeChunkManager.Type.NORMAL);
            if (ticket == null)
            {
                OutputHandler.debug("Ticket was null ?");
                return false;
            }
            else
            {
                OutputHandler.debug("Force loaded " + world.provider.dimensionId);
                ForgeChunkManager.forceChunk(ticket, new ChunkCoordIntPair(0, 0));
                ticket.getModData().setInteger("count", 1);
                map.put(world.provider.dimensionId, ticket);
                return true;
            }
        }
    }
View Full Code Here


    public boolean unforceLoadWorld(World world)
    {
        if (map.containsKey(world.provider.dimensionId))
        {
            Ticket ticket = map.get(world.provider.dimensionId);
            ticket.getModData().setInteger("count", ticket.getModData().getInteger("count") - 1);
            if (ticket.getModData().getInteger("count") == 0)
            {
                OutputHandler.debug(world.provider.dimensionId + " was removed fron the force loaded list.");
                ForgeChunkManager.unforceChunk(ticket, new ChunkCoordIntPair(0, 0));
                ForgeChunkManager.releaseTicket(ticket);
                map.remove(world.provider.dimensionId);
                return true;
            }
            else
            {
                OutputHandler.debug(world.provider.dimensionId + " is still force loaded. " + ticket.getModData().getInteger("count") + " requests remain.");
                return false;
            }
        }
        else
        {
View Full Code Here

        setTicket(null);
    }

    protected void requestTicket() {
        if (meetsTicketRequirements()) {
            Ticket chunkTicket = getTicketFromForge();
            if (chunkTicket != null) {
                setTicketData(chunkTicket);
                forceChunkLoading(chunkTicket);
            }
        }
View Full Code Here

        setFlag(TICKET_FLAG, false);
    }

    private boolean requestTicket() {
        if (meetsTicketRequirements()) {
            Ticket chunkTicket = getTicketFromForge();
            if (chunkTicket != null) {
//                System.out.println("Request Ticket: " + worldObj.getClass().getSimpleName());
                chunkTicket.getModData();
                chunkTicket.setChunkListDepth(MAX_CHUNKS);
                chunkTicket.bindEntity(this);
                setChunkTicket(chunkTicket);
                return true;
            }
        }
        return false;
View Full Code Here

TOP

Related Classes of net.minecraftforge.common.ForgeChunkManager.Ticket

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.