Skip to content

Commit 115f4c6

Browse files
committed
replace literal with a named constant
1 parent 8435452 commit 115f4c6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/gregtech/api/metatileentity/SyncedTileEntityBase.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
public abstract class SyncedTileEntityBase extends BlockStateTileEntity implements ISyncedTileEntity {
2828

29+
public static final int SIZE_THRESHOLD = 10;
2930
private final PacketDataList updates = new PacketDataList();
3031

3132
public @Nullable TileEntity getNeighbor(EnumFacing facing) {
@@ -65,7 +66,7 @@ private void notifyWorld() {
6566

6667
private boolean canNotifyWorld() {
6768
// short circuit with packet size to avoid too many hash lookups and instanceof casts
68-
if (updates.size() > 10 && getWorld() instanceof WorldServer server) {
69+
if (updates.size() > SIZE_THRESHOLD && getWorld() instanceof WorldServer server) {
6970
int x = getPos().getX() >> 4;
7071
int z = getPos().getZ() >> 4;
7172
if (server.getPlayerChunkMap().contains(x, z)) {

0 commit comments

Comments
 (0)