Skip to content

Commit

Permalink
fix: fix asm not applying in prod env
Browse files Browse the repository at this point in the history
  • Loading branch information
Wyvest committed Feb 10, 2022
1 parent d0edc9b commit 10c775f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ org.gradle.jvmargs=-Xmx2G

# Define project properties.
mod_name=REDACTION
mod_ver=1.1.0-pre1
mod_ver=1.1.0
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import org.spongepowered.asm.mixin.injection.invoke.arg.Args;

@Mixin(value = RenderManager.class, priority = Integer.MIN_VALUE)
@Mixin(value = RenderManager.class)
public class RenderManagerMixin {
private boolean box = true;
private boolean eye = true;
Expand Down Expand Up @@ -114,7 +114,7 @@ private void modifyEyeLineColor(Args args) {
}

@Inject(method = "renderDebugBoundingBox", at = @At("RETURN"))
private void resetEmulatedPlayerHitboxBypass(net.minecraft.entity.Entity entityIn, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo ci) {
private void resetLineWidth(net.minecraft.entity.Entity entityIn, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo ci) {
GL11.glLineWidth(1);
}
}
2 changes: 1 addition & 1 deletion src/main/kotlin/net/wyvest/redaction/Redaction.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ object Redaction {


const val NAME = "REDACTION"
const val VERSION = "1.1.0-beta2"
const val VERSION = "1.1.0"
const val ID = "redaction"
val mc: Minecraft
get() = Minecraft.getMinecraft()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class RedactionMixinPlugin : IMixinConfigPlugin {
if (!returned) {
if (targetClass != null && targetClassName == "net.minecraft.client.renderer.entity.RenderManager") {
for (method in targetClass.methods) {
if (method.name == "renderDebugBoundingBox") {
if (method.name == "renderDebugBoundingBox" || method.name == "func_85094_b") {
for (insn in method.instructions) {
if (insn.opcode == Opcodes.INVOKESPECIAL && (insn as MethodInsnNode).name.contains("cancelIfEmulatedPlayer")) {
val fieldinsn = FieldInsnNode(Opcodes.GETSTATIC, "net/wyvest/redaction/gui/HitboxPreviewGUI", "Companion", "Lnet/wyvest/redaction/gui/HitboxPreviewGUI\$Companion;")
Expand Down
7 changes: 0 additions & 7 deletions src/main/kotlin/net/wyvest/redaction/utils/MathUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,4 @@ object MathUtil {
if (value.toDouble() < 0.0) return 0.0f
return if (value.toDouble() > 1.0) 1f else value
}
/**
* Taken from Wynntils under GNU Affero General Public License v3.0
* https://github.com/Wynntils/Wynntils/blob/development/LICENSE
* @author Wynntils
* @return par0 cast as an int, and no greater than Integer.MAX_VALUE-1024
*/
fun fastFloor(value: Double) = (value + 1024.0).toInt() - 1024
}

0 comments on commit 10c775f

Please sign in to comment.