mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-20 04:09:40 +00:00
1.6.2 test - Finished liquids, added connected textures on glass
This commit is contained in:
1 parent
40c6f445a2
commit
a80fcbce86
704 files changed
+60909
No files matched your search
@@ -0,0 +1,65 @@
|
||||
package tconstruct.blocks.logic;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.INetworkManager;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.network.packet.Packet132TileEntityData;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class LiquidTextureLogic extends TileEntity
|
||||
{
|
||||
int texturePos;
|
||||
|
||||
public boolean canUpdate ()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setLiquidType (int tex)
|
||||
{
|
||||
texturePos = tex;
|
||||
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
|
||||
public int getLiquidType ()
|
||||
{
|
||||
return texturePos;
|
||||
}
|
||||
|
||||
public void readFromNBT (NBTTagCompound tags)
|
||||
{
|
||||
super.readFromNBT(tags);
|
||||
readCustomNBT(tags);
|
||||
}
|
||||
|
||||
public void readCustomNBT (NBTTagCompound tags)
|
||||
{
|
||||
texturePos = tags.getInteger("Texture");
|
||||
}
|
||||
|
||||
public void writeToNBT (NBTTagCompound tags)
|
||||
{
|
||||
super.writeToNBT(tags);
|
||||
writeCustomNBT(tags);
|
||||
}
|
||||
|
||||
public void writeCustomNBT (NBTTagCompound tags)
|
||||
{
|
||||
tags.setInteger("Texture", texturePos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket ()
|
||||
{
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
writeCustomNBT(tag);
|
||||
return new Packet132TileEntityData(xCoord, yCoord, zCoord, 1, tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket (INetworkManager net, Packet132TileEntityData packet)
|
||||
{
|
||||
readCustomNBT(packet.customParam1);
|
||||
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user