diff options
author | alemi <me@alemi.dev> | 2024-01-17 01:46:47 +0100 |
---|---|---|
committer | alemi <me@alemi.dev> | 2024-01-17 01:46:47 +0100 |
commit | f1b284235745b2aeb1bb2890c2b5d2153bfe06ef (patch) | |
tree | 3e4dcf3d9468c6eb8c35a20cb6578edcc845a485 /src/main/java/ftbsc | |
parent | 57dd48049d4b4aeb83b9cf531d626777d7897bbb (diff) |
fix: multiblock updates show correctly
the callback blockpos is always the same, clone it to store it and it
now works as intended
Diffstat (limited to 'src/main/java/ftbsc')
-rw-r--r-- | src/main/java/ftbsc/bscv/modules/vision/UpdateESP.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main/java/ftbsc/bscv/modules/vision/UpdateESP.java b/src/main/java/ftbsc/bscv/modules/vision/UpdateESP.java index d541183..7abf4ff 100644 --- a/src/main/java/ftbsc/bscv/modules/vision/UpdateESP.java +++ b/src/main/java/ftbsc/bscv/modules/vision/UpdateESP.java @@ -9,7 +9,7 @@ import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.systems.RenderSystem; import ftbsc.bscv.api.ILoadable; -import ftbsc.bscv.modules.QuickModule; +import ftbsc.bscv.modules.AbstractModule; import ftbsc.bscv.patches.PacketPatch.PacketEvent; import ftbsc.bscv.tools.Setting; import net.minecraft.client.renderer.BufferBuilder; @@ -18,8 +18,10 @@ import net.minecraft.client.renderer.WorldRenderer; import net.minecraft.client.renderer.WorldVertexBufferUploader; import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.network.play.server.SChangeBlockPacket; +import net.minecraft.network.play.server.SChunkDataPacket; import net.minecraft.network.play.server.SMultiBlockChangePacket; import net.minecraft.util.Tuple; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.vector.Vector3d; import net.minecraft.util.math.vector.Vector3i; import net.minecraftforge.client.event.RenderWorldLastEvent; @@ -29,7 +31,7 @@ import net.minecraftforge.event.TickEvent.Phase; import net.minecraftforge.eventbus.api.SubscribeEvent; @AutoService(ILoadable.class) -public class UpdateESP extends QuickModule { +public class UpdateESP extends AbstractModule { public final ForgeConfigSpec.ConfigValue<Integer> duration; public final ForgeConfigSpec.ConfigValue<Double> alpha; @@ -142,7 +144,7 @@ public class UpdateESP extends QuickModule { if (event.packet instanceof SMultiBlockChangePacket) { SMultiBlockChangePacket packet = (SMultiBlockChangePacket) event.packet; - packet.runUpdates( (pos, state) -> this.updates.add(new Tuple<>(pos, System.currentTimeMillis())) ); + packet.runUpdates( (pos, state) -> this.updates.add(new Tuple<>(new BlockPos(pos), System.currentTimeMillis())) ); } } } |