mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-29 08:27:03 +01:00
Defensive coding to prevent client chunk loading
This commit is contained in:
parent
2e3100be9a
commit
6b34eb453d
3 changed files with 4 additions and 4 deletions
|
@ -53,10 +53,10 @@ public class ArmPlacementPacket extends SimplePacketBase {
|
||||||
if (player == null)
|
if (player == null)
|
||||||
return;
|
return;
|
||||||
World world = player.world;
|
World world = player.world;
|
||||||
if (world == null)
|
if (world == null || !world.isBlockPresent(pos))
|
||||||
return;
|
return;
|
||||||
TileEntity tileEntity = world.getTileEntity(pos);
|
TileEntity tileEntity = world.getTileEntity(pos);
|
||||||
if (tileEntity == null || !(tileEntity instanceof ArmTileEntity))
|
if (!(tileEntity instanceof ArmTileEntity))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ArmTileEntity arm = (ArmTileEntity) tileEntity;
|
ArmTileEntity arm = (ArmTileEntity) tileEntity;
|
||||||
|
|
|
@ -52,7 +52,7 @@ public class ConfigureSchematicannonPacket extends SimplePacketBase {
|
||||||
if (player == null)
|
if (player == null)
|
||||||
return;
|
return;
|
||||||
World world = player.world;
|
World world = player.world;
|
||||||
if (world == null)
|
if (world == null || !world.isBlockPresent(pos))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
TileEntity tileEntity = world.getTileEntity(pos);
|
TileEntity tileEntity = world.getTileEntity(pos);
|
||||||
|
|
|
@ -39,7 +39,7 @@ public abstract class TileEntityConfigurationPacket<TE extends SyncedTileEntity>
|
||||||
return;
|
return;
|
||||||
World world = player.world;
|
World world = player.world;
|
||||||
|
|
||||||
if (world == null || world.getTileEntity(pos) == null)
|
if (world == null || !world.isBlockPresent(pos))
|
||||||
return;
|
return;
|
||||||
TileEntity tileEntity = world.getTileEntity(pos);
|
TileEntity tileEntity = world.getTileEntity(pos);
|
||||||
if (tileEntity instanceof SyncedTileEntity) {
|
if (tileEntity instanceof SyncedTileEntity) {
|
||||||
|
|
Loading…
Reference in a new issue