use of net.minecraft.world.ChunkPosition in project PneumaticCraft by MineMaarten.
the class ItemGPSTool method onUpdate.
@Override
public void onUpdate(ItemStack stack, World world, Entity entity, int slot, boolean heldItem) {
String var = getVariable(stack);
if (!var.equals("") && !world.isRemote) {
ChunkPosition pos = GlobalVariableManager.getInstance().getPos(var);
setGPSLocation(stack, pos.chunkPosX, pos.chunkPosY, pos.chunkPosZ);
}
}
use of net.minecraft.world.ChunkPosition in project PneumaticCraft by MineMaarten.
the class ItemAmadronTablet method getLiquidProvider.
public static IFluidHandler getLiquidProvider(ItemStack tablet) {
ChunkPosition pos = getLiquidProvidingLocation(tablet);
if (pos != null) {
int dimension = getLiquidProvidingDimension(tablet);
TileEntity te = PneumaticCraftUtils.getTileEntity(pos, dimension);
if (te instanceof IFluidHandler)
return (IFluidHandler) te;
}
return null;
}
use of net.minecraft.world.ChunkPosition in project PneumaticCraft by MineMaarten.
the class ItemAmadronTablet method getItemProvidingLocation.
public static ChunkPosition getItemProvidingLocation(ItemStack tablet) {
NBTTagCompound compound = tablet.getTagCompound();
if (compound != null) {
int x = compound.getInteger("itemX");
int y = compound.getInteger("itemY");
int z = compound.getInteger("itemZ");
if (x != 0 || y != 0 || z != 0) {
return new ChunkPosition(x, y, z);
} else {
return null;
}
} else {
return null;
}
}
use of net.minecraft.world.ChunkPosition in project PneumaticCraft by MineMaarten.
the class PacketSetGlobalVariable method fromBytes.
@Override
public void fromBytes(ByteBuf buf) {
varName = ByteBufUtils.readUTF8String(buf);
value = new ChunkPosition(buf.readInt(), buf.readInt(), buf.readInt());
}
use of net.minecraft.world.ChunkPosition in project PneumaticCraft by MineMaarten.
the class ContainerLogistics method getLogistics.
public static SemiBlockLogistics getLogistics(EntityPlayer player, ItemStack itemRequester) {
if (itemRequester != null && itemRequester.getItem() instanceof ItemLogisticsFrame) {
SemiBlockLogistics logistics = (SemiBlockLogistics) SemiBlockManager.getSemiBlockForKey(((ItemLogisticsFrame) itemRequester.getItem()).semiBlockId);
logistics.initialize(player.worldObj, new ChunkPosition(0, 0, 0));
logistics.onPlaced(player, itemRequester);
return logistics;
} else {
return null;
}
}
Aggregations