Here are the examples of the java api net.minecraft.network.play.server.SUpdateTileEntityPacket taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
55 Examples
19
Source : TileEntityPainted.java
with MIT License
from tom5454
with MIT License
from tom5454
@Override
public void onDataPacket(NetworkManager net, SUpdateTileEnreplacedyPacket packet) {
BlockState old = getPaintedBlockState();
CompoundNBT tagCompound = packet.getNbtCompound();
super.onDataPacket(net, packet);
read(world.getBlockState(pos), tagCompound);
if (world != null && world.isRemote) {
// If needed send a render update.
if (!getPaintedBlockState().equals(old)) {
world.markChunkDirty(getPos(), this.getTileEnreplacedy());
}
}
}
19
Source : BaseTile.java
with MIT License
from Snownee
with MIT License
from Snownee
@Override
public final void onDataPacket(NetworkManager manager, SUpdateTileEnreplacedyPacket packet) {
this.readPacketData(packet.getNbtCompound());
}
19
Source : TileEntityMachineBase.java
with MIT License
from SinoCraftProject
with MIT License
from SinoCraftProject
@Override
public void onDataPacket(NetworkManager net, SUpdateTileEnreplacedyPacket pkt) {
handleUpdateTag(getBlockState(), pkt.getNbtCompound());
}
19
Source : AbstractGeneratorTileEntity.java
with MIT License
from SilentChaos512
with MIT License
from SilentChaos512
@Override
public void onDataPacket(NetworkManager net, SUpdateTileEnreplacedyPacket packet) {
super.onDataPacket(net, packet);
CompoundNBT tags = packet.getNbtCompound();
this.burnTime = tags.getInt("BurnTime");
this.totalBurnTime = tags.getInt("TotalBurnTime");
}
19
Source : AbstractMachineBaseTileEntity.java
with MIT License
from SilentChaos512
with MIT License
from SilentChaos512
@Override
public void onDataPacket(NetworkManager net, SUpdateTileEnreplacedyPacket packet) {
super.onDataPacket(net, packet);
CompoundNBT tags = packet.getNbtCompound();
this.redstoneMode = EnumUtils.byOrdinal(tags.getByte("RedstoneMode"), RedstoneMode.IGNORED);
}
19
Source : AbstractEnergyInventoryTileEntity.java
with MIT License
from SilentChaos512
with MIT License
from SilentChaos512
@Override
public void onDataPacket(NetworkManager net, SUpdateTileEnreplacedyPacket packet) {
super.onDataPacket(net, packet);
SyncVariable.Helper.readSyncVars(this, packet.getNbtCompound());
readEnergy(packet.getNbtCompound());
}
19
Source : ApothSpawnerTile.java
with MIT License
from Shadows-of-Fire
with MIT License
from Shadows-of-Fire
@Override
public void onDataPacket(NetworkManager net, SUpdateTileEnreplacedyPacket pkt) {
read(Blocks.SPAWNER.getDefaultState(), pkt.getNbtCompound());
}
19
Source : CoreExtractorBaseTile.java
with MIT License
from mickelus
with MIT License
from mickelus
@Override
public void onDataPacket(NetworkManager net, SUpdateTileEnreplacedyPacket packet) {
this.read(packet.getNbtCompound());
// BlockState state = getBlockState();
// world.notifyBlockUpdate(pos, state, state,3);
}
19
Source : APacketTile.java
with GNU Lesser General Public License v3.0
from Kotori316
with GNU Lesser General Public License v3.0
from Kotori316
@Override
public void onDataPacket(NetworkManager net, SUpdateTileEnreplacedyPacket pkt) {
super.onDataPacket(net, pkt);
// read(pkt.getNbtCompound()); // how to get state?
}
19
Source : TileRecordPlayer.java
with GNU General Public License v3.0
from Hemogoblins
with GNU General Public License v3.0
from Hemogoblins
@Override
public void onDataPacket(NetworkManager net, SUpdateTileEnreplacedyPacket pkt) {
CompoundNBT tag = pkt.getNbtCompound();
}
19
Source : SyncedTileEntity.java
with MIT License
from Creators-of-Create
with MIT License
from Creators-of-Create
@Override
public void onDataPacket(NetworkManager net, SUpdateTileEnreplacedyPacket pkt) {
readClientUpdate(pkt.getNbtCompound());
}
19
Source : VanillaPacketHandler.java
with MIT License
from blay09
with MIT License
from blay09
public static void sendTileEnreplacedyUpdate(TileEnreplacedy tileEnreplacedy) {
World world = Objects.requireNonNull(tileEnreplacedy.getWorld());
if (world.isRemote) {
return;
}
SUpdateTileEnreplacedyPacket updatePacket = tileEnreplacedy.getUpdatePacket();
if (updatePacket != null) {
((ServerChunkProvider) world.getChunkProvider()).chunkManager.getTrackingPlayers(new ChunkPos(tileEnreplacedy.getPos()), false).forEach(player -> player.connection.sendPacket(updatePacket));
}
}
19
Source : ModTileEntity.java
with MIT License
from alcatrazEscapee
with MIT License
from alcatrazEscapee
@Override
public void onDataPacket(NetworkManager net, SUpdateTileEnreplacedyPacket pkt) {
load(getBlockState(), pkt.getTag());
}
18
Source : PacketCustom.java
with GNU Lesser General Public License v2.1
from TheCBProject
with GNU Lesser General Public License v2.1
from TheCBProject
@OnlyIn(Dist.CLIENT)
// Use methods on MCDataByteBuf
@Deprecated
public static PacketCustom fromTilePacket(SUpdateTileEnreplacedyPacket tilePacket) {
return fromNBTTag(tilePacket.getNbtCompound());
}
18
Source : MCDataByteBuf.java
with GNU Lesser General Public License v2.1
from TheCBProject
with GNU Lesser General Public License v2.1
from TheCBProject
@OnlyIn(Dist.CLIENT)
public static MCDataByteBuf fromTilePacket(SUpdateTileEnreplacedyPacket tilePacket) {
return fromTag(tilePacket.getNbtCompound().get("data"));
}
18
Source : TileEntityDroneInterface.java
with GNU General Public License v3.0
from TeamPneumatic
with GNU General Public License v3.0
from TeamPneumatic
@Override
public void onDataPacket(NetworkManager net, SUpdateTileEnreplacedyPacket pkt) {
// handleUpdateTag(pkt.getNbtCompound());
droneId = pkt.getNbtCompound().getInt("drone");
}
18
Source : FancyBlockTile.java
with MIT License
from McJty
with MIT License
from McJty
@Override
public void onDataPacket(NetworkManager net, SUpdateTileEnreplacedyPacket pkt) {
BlockState oldMimic = mimic;
CompoundNBT tag = pkt.getNbtCompound();
handleUpdateTag(getBlockState(), tag);
if (!Objects.equals(oldMimic, mimic)) {
ModelDataManager.requestModelDataRefresh(this);
world.notifyBlockUpdate(pos, getBlockState(), getBlockState(), Constants.BlockFlags.BLOCK_UPDATE + Constants.BlockFlags.NOTIFY_NEIGHBORS);
}
}
18
Source : TileEntityBotanyPot.java
with GNU Lesser General Public License v2.1
from Darkhax-Minecraft
with GNU Lesser General Public License v2.1
from Darkhax-Minecraft
@Override
public void onDataPacket(NetworkManager net, SUpdateTileEnreplacedyPacket packet) {
super.onDataPacket(net, packet);
this.world.getLightManager().checkBlock(this.pos);
}
18
Source : ModTileEntity.java
with MIT License
from alcatrazEscapee
with MIT License
from alcatrazEscapee
protected void sendVanillaUpdatePacket() {
SUpdateTileEnreplacedyPacket packet = getUpdatePacket();
BlockPos pos = getBlockPos();
if (packet != null && level instanceof ServerWorld) {
((ServerChunkProvider) level.getChunkSource()).chunkMap.getPlayers(new ChunkPos(pos), false).forEach(e -> e.connection.send(packet));
}
}
17
Source : StatueTile.java
with GNU Affero General Public License v3.0
from WhoCraft
with GNU Affero General Public License v3.0
from WhoCraft
@Override
public void onDataPacket(NetworkManager net, SUpdateTileEnreplacedyPacket pkt) {
super.onDataPacket(net, pkt);
handleUpdateTag(getBlockState(), pkt.getNbtCompound());
}
17
Source : JarTile.java
with GNU Affero General Public License v3.0
from WhoCraft
with GNU Affero General Public License v3.0
from WhoCraft
@Override
public void onDataPacket(NetworkManager net, SUpdateTileEnreplacedyPacket pkt) {
super.onDataPacket(net, pkt);
handleUpdateTag(getBlockState(), pkt.getTag());
}
17
Source : ElevatorTileEntity.java
with MIT License
from VsnGamer
with MIT License
from VsnGamer
@Override
public void onDataPacket(NetworkManager net, SUpdateTileEnreplacedyPacket pkt) {
handleUpdateTag(getBlockState(), pkt.getNbtCompound());
updateClient();
}
17
Source : StoveTileEntity.java
with MIT License
from vectorwing
with MIT License
from vectorwing
@Override
public void onDataPacket(NetworkManager net, SUpdateTileEnreplacedyPacket pkt) {
this.read(this.getBlockState(), pkt.getNbtCompound());
}
17
Source : TileFrequencyOwner.java
with MIT License
from TheCBProject
with MIT License
from TheCBProject
@Override
public void onDataPacket(NetworkManager net, SUpdateTileEnreplacedyPacket pkt) {
readFromPacket(PacketCustom.fromTilePacket(pkt));
}
17
Source : DryingRackTileEntity.java
with MIT License
from SilentChaos512
with MIT License
from SilentChaos512
@Override
public void onDataPacket(NetworkManager net, SUpdateTileEnreplacedyPacket pkt) {
if (pkt.getNbtCompound().contains("Item")) {
this.items.set(0, ItemStack.read(pkt.getNbtCompound().getCompound("Item")));
} else {
this.items.set(0, ItemStack.EMPTY);
}
}
17
Source : SeaAltarTile.java
with MIT License
from Shadows-of-Fire
with MIT License
from Shadows-of-Fire
@Override
public void onDataPacket(NetworkManager net, SUpdateTileEnreplacedyPacket pkt) {
handleUpdateTag(this.getBlockState(), pkt.getNbtCompound());
}
17
Source : WorkbenchTile.java
with MIT License
from mickelus
with MIT License
from mickelus
@Override
public void onDataPacket(NetworkManager net, SUpdateTileEnreplacedyPacket pkt) {
read(pkt.getNbtCompound());
}
17
Source : TransferUnitTile.java
with MIT License
from mickelus
with MIT License
from mickelus
@Override
public void onDataPacket(NetworkManager net, SUpdateTileEnreplacedyPacket packet) {
this.read(packet.getNbtCompound());
}
17
Source : HammerBaseTile.java
with MIT License
from mickelus
with MIT License
from mickelus
@Override
public void onDataPacket(NetworkManager net, SUpdateTileEnreplacedyPacket pkt) {
this.read(pkt.getNbtCompound());
}
17
Source : TileEntityRack.java
with GNU General Public License v3.0
from ldtteam
with GNU General Public License v3.0
from ldtteam
@Override
public void onDataPacket(final NetworkManager net, final SUpdateTileEnreplacedyPacket packet) {
this.read(getBlockState(), packet.getNbtCompound());
}
17
Source : JarTileEntity.java
with GNU General Public License v3.0
from JDKDigital
with GNU General Public License v3.0
from JDKDigital
@Override
public void onDataPacket(NetworkManager net, SUpdateTileEnreplacedyPacket pkt) {
handleUpdateTag(null, pkt.getNbtCompound());
}
17
Source : TileEntityImpl.java
with GNU General Public License v3.0
from Ellpeck
with GNU General Public License v3.0
from Ellpeck
@Override
public void onDataPacket(NetworkManager net, SUpdateTileEnreplacedyPacket packet) {
super.onDataPacket(net, packet);
this.readNBT(packet.getNbtCompound(), SaveType.SYNC);
}
17
Source : RenderBlockTileEntity.java
with MIT License
from Direwolf20-MC
with MIT License
from Direwolf20-MC
@Override
public void onDataPacket(NetworkManager net, SUpdateTileEnreplacedyPacket pkt) {
read(this.getBlockState(), pkt.getNbtCompound());
}
17
Source : EffectBlockTileEntity.java
with MIT License
from Direwolf20-MC
with MIT License
from Direwolf20-MC
@Override
public void onDataPacket(NetworkManager net, SUpdateTileEnreplacedyPacket pkt) {
deserializeNBT(pkt.getNbtCompound());
}
17
Source : ItemPedestalTileEntity.java
with Creative Commons Zero v1.0 Universal
from DaRealTurtyWurty
with Creative Commons Zero v1.0 Universal
from DaRealTurtyWurty
/*
* This method gets called on the client when it receives the packet that was
* sent in getUpdatePacket(). And here we just read the data from the packet
* that was recieved.
*/
@Override
public void onDataPacket(NetworkManager net, SUpdateTileEnreplacedyPacket pkt) {
this.read(pkt.getNbtCompound());
}
17
Source : HeatCollectorTileEntity.java
with GNU Lesser General Public License v3.0
from Cadiboo
with GNU Lesser General Public License v3.0
from Cadiboo
/**
* Handle a packet created in {@link #getUpdatePacket()}
*/
@Override
public void onDataPacket(final NetworkManager net, final SUpdateTileEnreplacedyPacket pkt) {
this.energy.setEnergy(pkt.getNbtCompound().getInt(ENERGY_TAG));
}
17
Source : FeedingTroughTileEntity.java
with MIT License
from blay09
with MIT License
from blay09
@Override
public void onDataPacket(NetworkManager net, SUpdateTileEnreplacedyPacket pkt) {
super.onDataPacket(net, pkt);
read(getBlockState(), pkt.getNbtCompound());
}
17
Source : ChiseledBlockTileEntity.java
with GNU Lesser General Public License v3.0
from Aeltumn
with GNU Lesser General Public License v3.0
from Aeltumn
@Override
public void onDataPacket(NetworkManager net, SUpdateTileEnreplacedyPacket pkt) {
super.onDataPacket(net, pkt);
read(pkt.getNbtCompound());
}
16
Source : StoneAltarTileEntity.java
with GNU Lesser General Public License v3.0
from TeamLapen
with GNU Lesser General Public License v3.0
from TeamLapen
@OnlyIn(Dist.CLIENT)
@Override
public void onDataPacket(NetworkManager net, SUpdateTileEnreplacedyPacket pkt) {
super.onDataPacket(net, pkt);
// TODO check
this.read(null, pkt.getNbtCompound());
}
16
Source : TileFluxDevice.java
with MIT License
from SonarSonic
with MIT License
from SonarSonic
@Override
public final void onDataPacket(NetworkManager net, @Nonnull SUpdateTileEnreplacedyPacket pkt) {
// Client side, read block update data
readCustomNBT(pkt.getNbtCompound(), FluxConstants.TYPE_TILE_UPDATE);
// update chunk render whether state changed or not
world.notifyBlockUpdate(pos, getBlockState(), getBlockState(), -1);
}
16
Source : AbstractMachineTileEntity.java
with MIT License
from SilentChaos512
with MIT License
from SilentChaos512
@Override
public void onDataPacket(NetworkManager net, SUpdateTileEnreplacedyPacket packet) {
super.onDataPacket(net, packet);
CompoundNBT tags = packet.getNbtCompound();
this.progress = tags.getInt("Progress");
this.processTime = tags.getInt("ProcessTime");
}
16
Source : CompounderTileEntity.java
with MIT License
from SilentChaos512
with MIT License
from SilentChaos512
@Override
public void onDataPacket(NetworkManager net, SUpdateTileEnreplacedyPacket packet) {
super.onDataPacket(net, packet);
CompoundNBT tags = packet.getNbtCompound();
SyncVariable.Helper.readSyncVars(this, tags);
}
16
Source : ApiaryBreederTileEntity.java
with GNU General Public License v3.0
from Resourceful-Bees
with GNU General Public License v3.0
from Resourceful-Bees
@Override
public void onDataPacket(NetworkManager net, SUpdateTileEnreplacedyPacket pkt) {
CompoundNBT nbt = pkt.getTag();
loadFromNBT(nbt);
}
16
Source : HoneyTankTileEntity.java
with GNU General Public License v3.0
from Resourceful-Bees
with GNU General Public License v3.0
from Resourceful-Bees
@Override
public void onDataPacket(NetworkManager net, SUpdateTileEnreplacedyPacket pkt) {
CompoundNBT nbt = pkt.getTag();
readNBT(nbt);
}
16
Source : TileEntityDecorationController.java
with GNU General Public License v3.0
from ldtteam
with GNU General Public License v3.0
from ldtteam
@Override
public void onDataPacket(final NetworkManager net, final SUpdateTileEnreplacedyPacket packet) {
final CompoundNBT compound = packet.getNbtCompound();
this.read(getBlockState(), compound);
}
16
Source : TileEntityBarrel.java
with GNU General Public License v3.0
from ldtteam
with GNU General Public License v3.0
from ldtteam
@Override
public void onDataPacket(final NetworkManager net, final SUpdateTileEnreplacedyPacket packet) {
final CompoundNBT compound = packet.getNbtCompound();
this.read(getBlockState(), compound);
markDirty();
}
16
Source : TileEntityColonyBuilding.java
with GNU General Public License v3.0
from ldtteam
with GNU General Public License v3.0
from ldtteam
@Override
public void onDataPacket(final NetworkManager net, final SUpdateTileEnreplacedyPacket packet) {
final CompoundNBT compound = packet.getNbtCompound();
colonyId = compound.getInt(TAG_COLONY);
super.onDataPacket(net, packet);
}
15
Source : GraderTileEntity.java
with MIT License
from SilentChaos512
with MIT License
from SilentChaos512
@Override
public void onDataPacket(NetworkManager net, SUpdateTileEnreplacedyPacket packet) {
super.onDataPacket(net, packet);
CompoundNBT tags = packet.getNbtCompound();
SyncVariable.Helper.readSyncVars(this, tags);
// this.progress = tags.getInt("progress");
if (tags.contains("input_item")) {
setInventorySlotContents(INPUT_SLOT, ItemStack.read(tags.getCompound("input_item")));
} else {
setInventorySlotContents(INPUT_SLOT, ItemStack.EMPTY);
}
}
15
Source : ScarecrowTileEntity.java
with GNU General Public License v3.0
from ldtteam
with GNU General Public License v3.0
from ldtteam
@Override
public void onDataPacket(final NetworkManager net, final SUpdateTileEnreplacedyPacket packet) {
final CompoundNBT compound = packet.getNbtCompound();
this.read(getBlockState(), compound);
if (compound.keySet().contains(TAG_COLONY_ID)) {
setOwner(ownerId, IColonyManager.getInstance().getColonyView(compound.getInt(TAG_COLONY_ID), world.getDimensionKey()));
}
}
15
Source : AdvancedBeehiveTileEntity.java
with GNU General Public License v3.0
from JDKDigital
with GNU General Public License v3.0
from JDKDigital
@Override
public void onDataPacket(NetworkManager net, SUpdateTileEnreplacedyPacket pkt) {
CompoundNBT tag = pkt.getNbtCompound();
if (tag.contains("bees")) {
getCapability(CapabilityBee.BEE).ifPresent(inhabitantHandler -> {
inhabitantHandler.setInhabitantsFromListNBT((ListNBT) tag.get("bees"));
});
}
}
See More Examples