mirror of
https://github.com/GTNewHorizons/BloodArsenal.git
synced 2026-11-27 15:33:06 +00:00
73 lines
1.5 KiB
Java
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());
|
|
}
|
|
}
|