Java Code Examples for net.minecraft.network.play.server.SPacketUpdateTileEntity#getNbtCompound()

The following examples show how to use net.minecraft.network.play.server.SPacketUpdateTileEntity#getNbtCompound() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SyncedTileEntityBase.java    From GregTech with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) {
    NBTTagCompound updateTag = pkt.getNbtCompound();
    NBTTagList tagList = updateTag.getTagList("d", NBT.TAG_COMPOUND);
    for (int i = 0; i < tagList.tagCount(); i++) {
        NBTTagCompound entryTag = tagList.getCompoundTagAt(i);
        int discriminator = entryTag.getInteger("i");
        byte[] updateData = entryTag.getByteArray("d");
        ByteBuf backedBuffer = Unpooled.copiedBuffer(updateData);
        receiveCustomData(discriminator, new PacketBuffer(backedBuffer));
    }
}
 
Example 2
Source File: TileAtmosphereTerraformer.java    From AdvancedRocketry with MIT License 5 votes vote down vote up
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) {
	NBTTagCompound nbt = pkt.getNbtCompound();
	readFromNBT(nbt);
	setText();
	
}
 
Example 3
Source File: TileMicrowaveReciever.java    From AdvancedRocketry with MIT License 5 votes vote down vote up
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) {
	NBTTagCompound nbt = pkt.getNbtCompound();

	canRender = nbt.getBoolean("canRender");
	powerMadeLastTick = nbt.getInteger("amtPwr");
	readNetworkData(nbt);
}
 
Example 4
Source File: TileEntityBeaconPost.java    From Cyberware with MIT License 4 votes vote down vote up
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt)
{
	NBTTagCompound data = pkt.getNbtCompound();
	this.readFromNBT(data);
}
 
Example 5
Source File: TileEntityBlueprintArchive.java    From Cyberware with MIT License 4 votes vote down vote up
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt)
{
	NBTTagCompound data = pkt.getNbtCompound();
	this.readFromNBT(data);
}
 
Example 6
Source File: TileEntityEngineeringTable.java    From Cyberware with MIT License 4 votes vote down vote up
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt)
{
	NBTTagCompound data = pkt.getNbtCompound();
	this.readFromNBT(data);
}
 
Example 7
Source File: TileEntityScanner.java    From Cyberware with MIT License 4 votes vote down vote up
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt)
{
	NBTTagCompound data = pkt.getNbtCompound();
	this.readFromNBT(data);
}
 
Example 8
Source File: TileEntityComponentBox.java    From Cyberware with MIT License 4 votes vote down vote up
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt)
{
	NBTTagCompound data = pkt.getNbtCompound();
	this.readFromNBT(data);
}
 
Example 9
Source File: TileEntityCharger.java    From Cyberware with MIT License 4 votes vote down vote up
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt)
{
	NBTTagCompound data = pkt.getNbtCompound();
	this.readFromNBT(data);
}
 
Example 10
Source File: TileCrucible.java    From ExNihiloAdscensio with MIT License 4 votes vote down vote up
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt)
{
	NBTTagCompound tag = pkt.getNbtCompound();
	readFromNBT(tag);
}
 
Example 11
Source File: TileSieve.java    From ExNihiloAdscensio with MIT License 4 votes vote down vote up
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt)
{
	NBTTagCompound tag = pkt.getNbtCompound();
	readFromNBT(tag);
}
 
Example 12
Source File: TileBarrel.java    From ExNihiloAdscensio with MIT License 4 votes vote down vote up
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt)
{
	NBTTagCompound tag = pkt.getNbtCompound();
	readFromNBT(tag);
}