diff --git a/src/main/java/net/shadow/client/feature/module/impl/combat/Fling.java b/src/main/java/net/shadow/client/feature/module/impl/combat/Fling.java index baf6f7e..827a378 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/combat/Fling.java +++ b/src/main/java/net/shadow/client/feature/module/impl/combat/Fling.java @@ -22,9 +22,9 @@ import net.shadow.client.helper.util.Utils; public class Fling extends Module { - boolean not = false; final DoubleSetting delay = this.config.create(new DoubleSetting.Builder(250).min(1).max(500).precision(0).name("Delay").description("The delay before going back down").get()); final DoubleSetting updist = this.config.create(new DoubleSetting.Builder(3).min(1).max(3).precision(2).name("Power").description("The power of the fling").get()); + boolean not = false; public Fling() { @@ -63,10 +63,10 @@ public class Fling extends Module { @EventListener(type = EventType.PACKET_SEND) void sendPacket(PacketEvent event) { if (!this.isEnabled()) return; - if(!not) return; + if (!not) return; if (event.getPacket() instanceof PlayerInteractItemC2SPacket) { if (client.player.getInventory().getMainHandStack().getItem() == Items.FISHING_ROD && (client.player.fishHook != null)) { - if(client.player.fishHook.isRemoved()) return; + if (client.player.fishHook.isRemoved()) return; client.player.setVelocity(Vec3d.ZERO); event.setCancelled(true); new Thread(() -> { diff --git a/src/main/java/net/shadow/client/feature/module/impl/misc/SuperCrossbow.java b/src/main/java/net/shadow/client/feature/module/impl/misc/SuperCrossbow.java index d15e62a..81a3dba 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/misc/SuperCrossbow.java +++ b/src/main/java/net/shadow/client/feature/module/impl/misc/SuperCrossbow.java @@ -13,7 +13,6 @@ import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket; import net.minecraft.network.packet.c2s.play.PlayerInteractItemC2SPacket; import net.minecraft.util.Hand; import net.minecraft.util.Identifier; -import net.minecraft.util.Util; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.util.registry.Registry; diff --git a/src/main/java/net/shadow/client/helper/render/Renderer.java b/src/main/java/net/shadow/client/helper/render/Renderer.java index 4de3fa2..b9e0ae7 100644 --- a/src/main/java/net/shadow/client/helper/render/Renderer.java +++ b/src/main/java/net/shadow/client/helper/render/Renderer.java @@ -37,6 +37,11 @@ public class Renderer { RenderSystem.setShaderColor(1f, 1f, 1f, 1f); } + public static void endRender() { + RenderSystem.enableCull(); + RenderSystem.disableBlend(); + } + public static class R3D { static final MatrixStack empty = new MatrixStack(); @@ -101,6 +106,7 @@ public class Renderer { RenderSystem.enableTexture(); RenderSystem.disableBlend(); stack.pop(); + endRender(); } //you can call renderOutlineIntern multiple times to save performance @@ -161,6 +167,7 @@ public class Renderer { buffer.end(); BufferRenderer.draw(buffer); GL11.glDepthFunc(GL11.GL_LEQUAL); + endRender(); } public static void renderFilled(Vec3d start, Vec3d dimensions, Color color, MatrixStack stack) { @@ -269,6 +276,7 @@ public class Renderer { BufferRenderer.draw(buffer); GL11.glDepthFunc(GL11.GL_LEQUAL); + endRender(); } public static void renderFilled(Vec3d start, Vec3d dimensions, Color color, MatrixStack stack, int GLMODE) { @@ -327,6 +335,7 @@ public class Renderer { BufferRenderer.draw(buffer); GL11.glDepthFunc(GL11.GL_LEQUAL); + endRender(); } public static void renderShape(Vec3d start, VoxelShape shape, MatrixStack matrices, Color color) { @@ -357,6 +366,7 @@ public class Renderer { BufferRenderer.draw(buffer); GL11.glDepthFunc(GL11.GL_LEQUAL); + endRender(); } public static void renderLine(Vec3d start, Vec3d end, Color color, MatrixStack matrices) { @@ -389,6 +399,7 @@ public class Renderer { BufferRenderer.draw(buffer); GL11.glDepthFunc(GL11.GL_LEQUAL); + endRender(); } public static Vec3d getCrosshairVector() { @@ -493,7 +504,7 @@ public class Renderer { .color(color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f, color.getAlpha() / 255f).next(); } t.draw(); - + endRender(); return new Vec2f((float) roundStartX, (float) roundStartY); } @@ -586,6 +597,7 @@ public class Renderer { RenderSystem.setShader(GameRenderer::getPositionColorShader); renderRoundedShadowInternal(matrix, g, h, k, f, fromX, fromY, toX, toY, rad, samples, shadowWidth); + endRender(); } public static void renderBezierCurve(MatrixStack stack, Vec2f[] points, float r, float g, float b, float a, float laziness) { @@ -638,6 +650,7 @@ public class Renderer { bufferBuilder.end(); BufferRenderer.draw(bufferBuilder); stack.pop(); + endRender(); } private static void renderTexturedQuad(Matrix4f matrix, double x0, double x1, double y0, double y1, double z, float u0, float u1, float v0, float v1) { @@ -727,6 +740,7 @@ public class Renderer { bufferBuilder.vertex(matrix, (float) x1, (float) y1, 0.0F).color(g, h, k, f).next(); bufferBuilder.end(); BufferRenderer.draw(bufferBuilder); + endRender(); } public static void renderQuadGradient(MatrixStack matrices, Color c2, Color c1, double x1, double y1, double x2, double y2) { @@ -764,7 +778,7 @@ public class Renderer { bufferBuilder.vertex(matrix, (float) x2, (float) y1, 0.0F).color(r2, g2, b2, a2).next(); bufferBuilder.end(); BufferRenderer.draw(bufferBuilder); - + endRender(); } public static void renderRoundedQuadInternal(Matrix4f matrix, float cr, float cg, float cb, float ca, double fromX, double fromY, double toX, double toY, double rad, double samples) { @@ -802,6 +816,7 @@ public class Renderer { renderRoundedQuadInternal(matrix, g, h, k, f, fromX, fromY, toX, toY, rad, samples); renderRoundedShadow(matrices, new Color(10, 10, 10, 100), fromX, fromY, toX, toY, rad, samples, 3); + endRender(); } public static void renderRoundedQuad(MatrixStack matrices, Color c, double fromX, double fromY, double toX, double toY, double rad, double samples) { @@ -815,6 +830,7 @@ public class Renderer { RenderSystem.setShader(GameRenderer::getPositionColorShader); renderRoundedQuadInternal(matrix, g, h, k, f, fromX, fromY, toX, toY, rad, samples); + endRender(); } public static void renderLine(MatrixStack stack, Color c, double x, double y, double x1, double y1) { @@ -831,6 +847,7 @@ public class Renderer { bufferBuilder.vertex(m, (float) x1, (float) y1, 0f).color(g, h, k, f).next(); bufferBuilder.end(); BufferRenderer.draw(bufferBuilder); + endRender(); } } diff --git a/src/main/java/net/shadow/client/mixin/AInGameHudMixin.java b/src/main/java/net/shadow/client/mixin/AInGameHudMixin.java index 26a9b08..91f11b5 100644 --- a/src/main/java/net/shadow/client/mixin/AInGameHudMixin.java +++ b/src/main/java/net/shadow/client/mixin/AInGameHudMixin.java @@ -32,8 +32,9 @@ public abstract class AInGameHudMixin extends DrawableHelper { module.onHudRender(); } } - NotificationRenderer.render(); Utils.TickManager.render(); + NotificationRenderer.render(); + Events.fireEvent(EventType.HUD_RENDER, new NonCancellableEvent()); }); for (Module module : ModuleRegistry.getModules()) { diff --git a/src/main/java/net/shadow/client/mixin/ClientPlayerInteractionManagerMixin.java b/src/main/java/net/shadow/client/mixin/ClientPlayerInteractionManagerMixin.java index d97bab9..0a6ac03 100644 --- a/src/main/java/net/shadow/client/mixin/ClientPlayerInteractionManagerMixin.java +++ b/src/main/java/net/shadow/client/mixin/ClientPlayerInteractionManagerMixin.java @@ -12,11 +12,8 @@ import org.objectweb.asm.Opcodes; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Redirect; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.Redirect; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import java.util.Objects; @@ -36,7 +33,7 @@ public class ClientPlayerInteractionManagerMixin { @Inject(method = {"getReachDistance()F"}, at = {@At("HEAD")}, cancellable = true) private void onReachDistance(CallbackInfoReturnable cir) { if (ModuleRegistry.getByClass(Reach.class).isEnabled()) { - cir.setReturnValue((float)ModuleRegistry.getByClass(Reach.class).getReachDistance()); + cir.setReturnValue((float) ModuleRegistry.getByClass(Reach.class).getReachDistance()); } } diff --git a/src/main/java/net/shadow/client/mixin/FurnaceBlockEntityAccessor.java b/src/main/java/net/shadow/client/mixin/FurnaceBlockEntityAccessor.java new file mode 100644 index 0000000..ffc2d23 --- /dev/null +++ b/src/main/java/net/shadow/client/mixin/FurnaceBlockEntityAccessor.java @@ -0,0 +1,21 @@ +/* + * Copyright (c) Shadow client, 0x150, Saturn5VFive 2022. All rights reserved. + */ + +package net.shadow.client.mixin; + +import net.minecraft.block.entity.AbstractFurnaceBlockEntity; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Accessor; + +@Mixin(AbstractFurnaceBlockEntity.class) +public interface FurnaceBlockEntityAccessor { + @Accessor("burnTime") + int getBurnTime(); + + @Accessor("fuelTime") + int getFuelTime(); + + @Accessor("cookTime") + int getCookTime(); +} diff --git a/src/main/resources/shadow.mixins.json b/src/main/resources/shadow.mixins.json index 651adf6..67af5be 100644 --- a/src/main/resources/shadow.mixins.json +++ b/src/main/resources/shadow.mixins.json @@ -9,6 +9,7 @@ "AGenericContainerScreenMixin", "AInGameHudMixin", "AreaEffectCloudEntityMixin", + "BeaconScreenMixin", "BlockEntityRenderDispatcherMixin", "BlockMixin", "CameraMixin", @@ -24,6 +25,7 @@ "EntityRenderDispatcherMixin", "EntityRendererMixin", "EntryListWidgetMixin", + "FurnaceBlockEntityAccessor", "GameMenuMixin", "GameRendererMixin", "IClientPlayerInteractionManagerAccessor", @@ -58,13 +60,12 @@ "SelectWorldScreenMixin", "SessionAccessor", "SharedConstantsMixin", + "SignEditScreenMixin", "SliderWidgetAccessor", "SliderWidgetMixin", "TitleScreenMixin", "WorldRendererAccessor", - "WorldRendererMixin", - "BeaconScreenMixin", - "SignEditScreenMixin" + "WorldRendererMixin" ], "client": [], "server": [],