Files
BloodArsenal/src/main/java/com/arc/bloodarsenal/tileentity/TileOwned.java
T
Arcaratus 037379f3e9 1.1.0 Preperation
Big release with big changes
2014-11-22 12:22:02 -05:00

73 lines
1.5 KiB
Java

package com.arc.bloodarsenal.tileentity;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
public class TileOwned extends TileEntity
{
public String owner;
public TileOwned()
{
owner = "";
}
@Override
public boolean canUpdate()
{
return false;
}
public void setOwner(String owner)
{
this.owner = owner;
}
public String getOwner()
{
return owner;
}
@Override
public void readFromNBT(NBTTagCompound tag)
{
super.readFromNBT(tag);
this.owner = tag.getString("owner");
}
@Override
public void writeToNBT(NBTTagCompound tag)
{
super.writeToNBT(tag);
tag.setString("owner", owner);
}
public void readCustomNBT(NBTTagCompound tag)
{
}
public void writeCustomNBT(NBTTagCompound tag)
{
}
@Override
public Packet getDescriptionPacket()
{
NBTTagCompound nbttagcompound = new NBTTagCompound();
writeCustomNBT(nbttagcompound);
return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, -999, nbttagcompound);
}
@Override
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt)
{
super.onDataPacket(net, pkt);
readCustomNBT(pkt.func_148857_g());
}
}