mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-16 18:44:42 +00:00
move constant computation out of the loop
This commit is contained in:
1 parent
e6b9d1a6c2
commit
6af0b04be1
1 file changed
+3
-3
@@ -74,6 +74,9 @@ public class WirelessMagnet {
|
||||
magnetRange);
|
||||
final boolean skipPlayerCheck = world.playerEntities.size() < 2;
|
||||
boolean playSound = false;
|
||||
// account for the server/client desync
|
||||
double playerEyesPos = player.posY
|
||||
+ (world.isRemote ? player.getEyeHeight() - player.getDefaultEyeHeight() : player.getEyeHeight());
|
||||
|
||||
for (EntityItem itemToGet : items) {
|
||||
if (itemToGet.getEntityItem() == null || itemToGet instanceof EntityFloatingItem) {
|
||||
@@ -92,9 +95,6 @@ public class WirelessMagnet {
|
||||
itemToGet.motionX = 0;
|
||||
itemToGet.motionY = 0;
|
||||
itemToGet.motionZ = 0;
|
||||
// account for the server/client desync
|
||||
double playerEyesPos = player.posY
|
||||
+ (world.isRemote ? player.getEyeHeight() - player.getDefaultEyeHeight() : player.getEyeHeight());
|
||||
itemToGet.setPosition(
|
||||
player.posX - 0.2 + (world.rand.nextDouble() * 0.4),
|
||||
playerEyesPos - 0.62,
|
||||
|
||||
Reference in new issue
Block a user