Skip to content

Commit 1ef7c8e

Browse files
committed
Only send the packet to people within 64 blocks
This is equivalent to what vanilla Minecraft does
1 parent afec374 commit 1ef7c8e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/main/java/dan200/computercraft/shared/proxy/ComputerCraftProxyCommon.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,8 @@ public void playRecord( SoundEvent record, String recordInfo, World world, Block
159159
packet.m_dataInt = new int[] { pos.getX(), pos.getY(), pos.getZ() };
160160
}
161161

162-
ComputerCraft.sendToAllPlayers( packet );
162+
NetworkRegistry.TargetPoint point = new NetworkRegistry.TargetPoint( world.provider.getDimension(), pos.getX(), pos.getY(), pos.getZ(), 64 );
163+
ComputerCraft.sendToAllAround( packet, point );
163164
}
164165

165166
@Override

0 commit comments

Comments
 (0)