Package mods.railcraft.api.core

Examples of mods.railcraft.api.core.WorldCoordinate


            rebuildDelay++;
            if (rebuildDelay >= REBUILD_DELAY.length)
                rebuildDelay = REBUILD_DELAY.length - 1;
            rebuildQueue();
        }
        WorldCoordinate index = getNextLavaBlock(true);

        if (index != null && coolLava(index.x, index.y, index.z)) {
            charge++;
            rebuildDelay = 0;
        }
View Full Code Here


    private WorldCoordinate getNextLavaBlock(boolean remove) {
        if (queue.isEmpty())
            return null;

        if (remove) {
            WorldCoordinate index = queue.pollFirst();
            return index;
        }
        return queue.peekFirst();
    }
View Full Code Here

        queueForFilling(x, y + 1, z);
        queueForFilling(x, y - 1, z);
    }

    public void queueForFilling(int x, int y, int z) {
        WorldCoordinate index = new WorldCoordinate(0, x, y, z);
        if (visitedBlocks.add(index)) {
            if ((x - xCoord) * (x - xCoord) + (z - zCoord) * (z - zCoord) > 64 * 64)
                return;

            Block block = WorldPlugin.getBlock(worldObj, x, y, z);
View Full Code Here

            NBTTagCompound nbt = data.getCompoundTag("last");
            int dim = nbt.getInteger("dim");
            int x = nbt.getInteger("x");
            int y = nbt.getInteger("y");
            int z = nbt.getInteger("z");
            lastMarker = new WorldCoordinate(dim, x, y, z);
        }
        colorSeed = data.getLong("seed");
        timestamp = data.getLong("time");
    }
View Full Code Here

        if (data.readBoolean()) {
            int dim = data.readInt();
            int x = data.readInt();
            int y = data.readInt();
            int z = data.readInt();
            lastMarker = new WorldCoordinate(dim, x, y, z);
        }
    }
View Full Code Here

            TileEntity tile = world.getTileEntity(x, y, z);
            if (tile instanceof TileHidden) {
                TileHidden hidden = (TileHidden) tile;
                hidden.timestamp = System.currentTimeMillis();
                hidden.colorSeed = Railcraft.proxy.getPlayerUsername(player).hashCode() * 50021L;
                WorldCoordinate last = lastPosition.get(player);
                if (last != null)
                    hidden.lastMarker = last;
                hidden.sendUpdateToClient();
                lastPosition.put(player, new WorldCoordinate(world.provider.dimensionId, x, y, z));
                return true;
            }
        }
        return block == BlockHidden.getBlock();
    }
View Full Code Here

    @Override
    public boolean onItemUse(ItemStack item, EntityPlayer player, World world, int i, int j, int k, int side, float par8, float par9, float par10) {
        TileEntity tile = world.getTileEntity(i, j, k);
        if (tile != null) {
            WorldCoordinate cPos = null;
            NBTTagCompound data = item.getTagCompound();
            if (data != null) {
                int cDim = data.getInteger("controllerDim");
                int cx = data.getInteger("controllerX");
                int cy = data.getInteger("controllerY");
                int cz = data.getInteger("controllerZ");
                cPos = new WorldCoordinate(cDim, cx, cy, cz);
            }
            if (tile instanceof IReceiverTile && cPos != null) {
                if (Game.isHost(world)) {
                    SignalReceiver receiver = ((IReceiverTile) tile).getReceiver();
                    if (i != cPos.x || j != cPos.y || k != cPos.z) {
View Full Code Here

    public static WorldCoordinate findBlock(World world, int x, int y, int z, int distance, Block block, int meta) {
        for (int yy = y - distance; yy < y + distance; yy++) {
            for (int xx = x - distance; xx < x + distance; xx++) {
                for (int zz = z - distance; zz < z + distance; zz++) {
                    if (block == getBlock(world, xx, yy, zz) && meta == getBlockMetadata(world, xx, yy, zz))
                        return new WorldCoordinate(world.provider.dimensionId, xx, yy, zz);
                }
            }
        }
        return null;
    }
View Full Code Here

    public boolean blockActivated(EntityPlayer player, int side) {
        ItemStack current = player.getCurrentEquippedItem();
        if (current != null && current.getItem() instanceof IToolCrowbar) {
            IToolCrowbar crowbar = (IToolCrowbar) current.getItem();
            if (crowbar.canWhack(player, current, xCoord, yCoord, zCoord)) {
                WorldCoordinate target = TileAnchorWorld.getTarget(player);
                if (target == null)
                    TileAnchorWorld.setTarget(this, player);
                else if (worldObj.provider.dimensionId != target.dimension)
                    ChatPlugin.sendLocalizedChatFromServer(player, "railcraft.gui.anchor.pair.fail.dimension", getName());
                else if (new WorldCoordinate(this).equals(target)) {
                    TileAnchorWorld.removeTarget(player);
                    ChatPlugin.sendLocalizedChatFromServer(player, "railcraft.gui.anchor.pair.cancel", getName());
                } else {
                    TileEntity tile = TileAnchorWorld.getTargetAt(player, this, target);
                    if (tile instanceof TileAnchorWorld)
                        ((TileAnchorWorld) tile).setSentinel(player, new WorldCoordinate(this));
                    else if (tile != null)
                        ChatPlugin.sendLocalizedChatFromServer(player, "railcraft.gui.anchor.pair.fail.invalid", getName());
                }
                crowbar.onWhack(player, current, xCoord, yCoord, zCoord);
                return true;
View Full Code Here

        ItemStack current = player.getCurrentEquippedItem();
        if (current != null && current.getItem() instanceof IToolCrowbar) {
            IToolCrowbar crowbar = (IToolCrowbar) current.getItem();
            if (crowbar.canWhack(player, current, xCoord, yCoord, zCoord)) {
                if (Game.isHost(worldObj)) {
                    WorldCoordinate target = sentinelPairingMap.get(player);
                    if (target == null)
                        setTarget(this, player);
                    else if (worldObj.provider.dimensionId != target.dimension)
                        ChatPlugin.sendLocalizedChatFromServer(player, "railcraft.gui.anchor.pair.fail.dimension", getName());
                    else if (new WorldCoordinate(this).equals(target)) {
                        removeTarget(player);
                        ChatPlugin.sendLocalizedChatFromServer(player, "railcraft.gui.anchor.pair.cancel", getName());
                    } else
                        setSentinel(player, target);
                    crowbar.onWhack(player, current, xCoord, yCoord, zCoord);
View Full Code Here

TOP

Related Classes of mods.railcraft.api.core.WorldCoordinate

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.