diff options
author | Jason Mitchell <mitchej@gmail.com> | 2024-03-04 02:20:48 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-04 11:20:48 +0100 |
commit | f3712d3b8dd556087b786a8918904792be231e16 (patch) | |
tree | d2d86517c3a8a137398e5fc56892200cbb4931b6 /src/main/java/gregtech/api/GregTech_API.java | |
parent | dc0eb86a4737b73b3bdbf39c6916c19c3aaa8af4 (diff) | |
download | GT5-Unofficial-f3712d3b8dd556087b786a8918904792be231e16.tar.gz GT5-Unofficial-f3712d3b8dd556087b786a8918904792be231e16.tar.bz2 GT5-Unofficial-f3712d3b8dd556087b786a8918904792be231e16.zip |
Maybe thread safe (#2523)
* Maybe thread safe
* While we're at it, let's reduce allocations by a few orders of magnitude. ~1gb -> 1mb in testing for similar time periods.
* use return value of add() again
* That's apparently not available on the server side
* Spotless apply for branch maybe-thread-safe for #2523 (#2524)
spotlessApply
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'src/main/java/gregtech/api/GregTech_API.java')
-rw-r--r-- | src/main/java/gregtech/api/GregTech_API.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/main/java/gregtech/api/GregTech_API.java b/src/main/java/gregtech/api/GregTech_API.java index 2e39cd2181..47c99403ab 100644 --- a/src/main/java/gregtech/api/GregTech_API.java +++ b/src/main/java/gregtech/api/GregTech_API.java @@ -31,7 +31,6 @@ import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; import com.google.common.collect.Multimap; @@ -408,7 +407,7 @@ public class GregTech_API { */ public static boolean causeMachineUpdate(World aWorld, int aX, int aY, int aZ) { if (aWorld != null && !aWorld.isRemote && !isDummyWorld(aWorld)) { // World might be null during World-gen - GT_Runnable_MachineBlockUpdate.setMachineUpdateValues(aWorld, new ChunkCoordinates(aX, aY, aZ)); + GT_Runnable_MachineBlockUpdate.setMachineUpdateValues(aWorld, aX, aY, aZ); return true; } return false; @@ -419,7 +418,7 @@ public class GregTech_API { if (aWorld == null || aWorld.isRemote || isDummyWorld(aWorld)) { return false; } // World might be null during World-gen - GT_Runnable_Cable_Update.setCableUpdateValues(aWorld, new ChunkCoordinates(aX, aY, aZ)); + GT_Runnable_Cable_Update.setCableUpdateValues(aWorld, aX, aY, aZ); return true; } |