mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-26 23:03:01 +00:00
Final build for 1.4.7. *Cleaned up imports. *Added javadocs and cleaned up code. *API improvements and fixes. *Changed around packages and finalized API. *Fixed auto-download feature. *Removed UE implementation of multiblock, added my own. *Better Obsidian TNT code. *Better Atomic Assembler efficiency modes. *Made gas storage tanks more CPU efficient. *Better version control. *Added RecipeHelper for reflective implementations of recipes. *Reduced Osmium generation. *Fixed upgrade bug. *Pressurized Tube doesn't function when receiving a redstone signal. *Better Advanced Solar Generator code. *HP information for hoes. *Lowered chance of mobs spawning with armor. *InfuseRegistry for adding new infuse objects. *GasTransmission for external gas transmission.
89 lines
1.8 KiB
Java
89 lines
1.8 KiB
Java
package mekanism.common;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import com.google.common.io.ByteArrayDataInput;
|
|
|
|
import mekanism.api.EnumGas;
|
|
import mekanism.api.ITileNetwork;
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
import net.minecraft.nbt.NBTTagCompound;
|
|
import net.minecraft.network.INetworkManager;
|
|
import net.minecraft.network.packet.Packet;
|
|
import net.minecraft.network.packet.Packet250CustomPayload;
|
|
import net.minecraft.tileentity.TileEntity;
|
|
import net.minecraft.world.World;
|
|
|
|
public class TileEntityBoundingBlock extends TileEntity implements ITileNetwork
|
|
{
|
|
public int mainX;
|
|
public int mainY;
|
|
public int mainZ;
|
|
|
|
public void setMainLocation(int x, int y, int z)
|
|
{
|
|
mainX = x;
|
|
mainY = y;
|
|
mainZ = z;
|
|
|
|
if(!worldObj.isRemote)
|
|
{
|
|
PacketHandler.sendTileEntityPacketToClients(this, 0, getNetworkedData(new ArrayList()));
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public boolean canUpdate()
|
|
{
|
|
return false;
|
|
}
|
|
|
|
@Override
|
|
public void validate()
|
|
{
|
|
super.validate();
|
|
|
|
if(worldObj.isRemote)
|
|
{
|
|
PacketHandler.sendDataRequest(this);
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void handlePacketData(ByteArrayDataInput dataStream)
|
|
{
|
|
mainX = dataStream.readInt();
|
|
mainY = dataStream.readInt();
|
|
mainZ = dataStream.readInt();
|
|
}
|
|
|
|
@Override
|
|
public void readFromNBT(NBTTagCompound nbtTags)
|
|
{
|
|
super.readFromNBT(nbtTags);
|
|
|
|
mainX = nbtTags.getInteger("mainX");
|
|
mainY = nbtTags.getInteger("mainX");
|
|
mainZ = nbtTags.getInteger("mainX");
|
|
}
|
|
|
|
@Override
|
|
public void writeToNBT(NBTTagCompound nbtTags)
|
|
{
|
|
super.writeToNBT(nbtTags);
|
|
|
|
nbtTags.setInteger("mainX", mainX);
|
|
nbtTags.setInteger("mainY", mainY);
|
|
nbtTags.setInteger("mainZ", mainZ);
|
|
}
|
|
|
|
@Override
|
|
public ArrayList getNetworkedData(ArrayList data)
|
|
{
|
|
data.add(mainX);
|
|
data.add(mainY);
|
|
data.add(mainZ);
|
|
return data;
|
|
}
|
|
}
|