From 2412eeaafd49c6859e333f8e2a2895442dcf4cf7 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 29 Jan 2024 21:28:53 -0500 Subject: [PATCH] Clean ups --- .../allomancy/modules/powers/client/PowersClientSetup.java | 4 +--- .../allomancy/modules/powers/client/util/Rendering.java | 1 + .../allomancy/modules/powers/client/util/Tracking.java | 1 + src/main/java/com/legobmw99/allomancy/util/SyncList.java | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/legobmw99/allomancy/modules/powers/client/PowersClientSetup.java b/src/main/java/com/legobmw99/allomancy/modules/powers/client/PowersClientSetup.java index a323441e..77339777 100644 --- a/src/main/java/com/legobmw99/allomancy/modules/powers/client/PowersClientSetup.java +++ b/src/main/java/com/legobmw99/allomancy/modules/powers/client/PowersClientSetup.java @@ -34,8 +34,6 @@ public static void registerParticle(final RegisterParticleProvidersEvent event) } public static void clientInit(final FMLClientSetupEvent e) { - e.enqueueWork(() -> { - NeoForge.EVENT_BUS.register(ClientEventHandler.class); - }); + e.enqueueWork(() -> NeoForge.EVENT_BUS.register(ClientEventHandler.class)); } } diff --git a/src/main/java/com/legobmw99/allomancy/modules/powers/client/util/Rendering.java b/src/main/java/com/legobmw99/allomancy/modules/powers/client/util/Rendering.java index b60b5d9d..85ebbe9b 100644 --- a/src/main/java/com/legobmw99/allomancy/modules/powers/client/util/Rendering.java +++ b/src/main/java/com/legobmw99/allomancy/modules/powers/client/util/Rendering.java @@ -55,6 +55,7 @@ public static PoseStack prepareToDrawLines(PoseStack start, float partialTicks) start.pushPose(); Vec3 view = Minecraft.getInstance().cameraEntity.getEyePosition(partialTicks); + // TODO figure out if I can cancel effect of view bobbing start.translate(-view.x, -view.y, -view.z); RenderSystem.applyModelViewMatrix(); return start; diff --git a/src/main/java/com/legobmw99/allomancy/modules/powers/client/util/Tracking.java b/src/main/java/com/legobmw99/allomancy/modules/powers/client/util/Tracking.java index 60ad2ba7..34ef42b8 100644 --- a/src/main/java/com/legobmw99/allomancy/modules/powers/client/util/Tracking.java +++ b/src/main/java/com/legobmw99/allomancy/modules/powers/client/util/Tracking.java @@ -60,6 +60,7 @@ public void tick() { // Add metal blobs to metal list if (this.blobFuture == null || this.blobFuture.isDone()) { + // TODO cache chunks? https://github.com/TelepathicGrunt/Bumblezone/blob/c8ca66e62e102d512393bec7186e3764e13434bf/common/src/main/java/com/telepathicgrunt/the_bumblezone/items/essence/LifeEssence.java#L150-L192 this.blobFuture = Util.backgroundExecutor().submit(() -> { this.seen.clear(); BlockPos diff --git a/src/main/java/com/legobmw99/allomancy/util/SyncList.java b/src/main/java/com/legobmw99/allomancy/util/SyncList.java index 6259be48..b2fd3262 100644 --- a/src/main/java/com/legobmw99/allomancy/util/SyncList.java +++ b/src/main/java/com/legobmw99/allomancy/util/SyncList.java @@ -52,7 +52,7 @@ public void forEach(Consumer f) { * a swapAndClearOld is completed. */ public void add(T t) { - if (this.AorB.get() % 2 == 1) { + if (this.AorB.get() % 2 != 0) { this.list_a.add(t); } else { this.list_b.add(t); @@ -68,7 +68,7 @@ public void swapAndClearOld() { this.swapLock.lock(); int newAB = this.AorB.incrementAndGet(); this.swapLock.unlock(); - if (newAB % 2 == 1) { + if (newAB % 2 != 0) { this.list_a.clear(); } else { this.list_b.clear();