Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
Wyvest committed Mar 5, 2022
1 parent 0e8ea01 commit e6bdd48
Show file tree
Hide file tree
Showing 14 changed files with 325 additions and 483 deletions.
11 changes: 3 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,10 @@ dependencies {
minecraft("com.mojang:minecraft:1.8.9")
mappings("de.oceanlabs.mcp:mcp_stable:22-1.8.9")
forge("net.minecraftforge:forge:1.8.9-11.15.1.2318-1.8.9")
shade ('gg.essential:loader-launchwrapper:1.1.3') {
transitive = false
}
compileOnly 'gg.essential:essential-1.8.9-forge:1788'
compileOnly 'gg.essential:essential-1.8.9-forge:1933'
compileOnly ('org.spongepowered:mixin:0.8.5-SNAPSHOT')
compileOnly 'cc.woverflow:onecore:1.2.2'
shade ('cc.woverflow:onecore-tweaker:1.1.1') {
compileOnly 'cc.woverflow:onecore:1.3.3'
shade ('cc.woverflow:onecore-tweaker:1.3.0') {
transitive = false
}
}
Expand All @@ -80,8 +77,6 @@ jar {
'ForceLoadAsMod': true,
'FMLAT': 'redaction_at.cfg'
)

enabled = false
}

/* This task simply replaces the `${version}` and `${mcversion}` properties in the mcmod.info with the data from Gradle. */
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ org.gradle.jvmargs=-Xmx2G

# Define project properties.
mod_name=REDACTION
mod_ver=1.1.0
mod_ver=1.2.1

loom.platform = forge
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
public class FontRendererMixin {
@ModifyVariable(method = "renderString", at = @At("HEAD"), argsOnly = true, ordinal = 0)
private String onStringRendered_modifyText(String original) {
return RedactionConfig.INSTANCE.getHighlightName() && original != null ? NameHighlight.highlightName(original) : original;
return (RedactionConfig.INSTANCE.getHighlightName() && original != null) ? NameHighlight.highlightName(original) : original;
}
}
15 changes: 13 additions & 2 deletions src/main/java/net/wyvest/redaction/mixin/RenderManagerMixin.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package net.wyvest.redaction.mixin;

import cc.woverflow.onecore.utils.ColorUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.RenderGlobal;
import net.minecraft.client.renderer.Tessellator;
Expand All @@ -9,7 +10,6 @@
import net.wyvest.redaction.features.hitbox.Entity;
import net.wyvest.redaction.features.hitbox.GeneralConfig;
import net.wyvest.redaction.gui.HitboxPreviewGUI;
import net.wyvest.redaction.utils.ColorUtils;
import org.lwjgl.opengl.GL11;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
Expand Down Expand Up @@ -59,12 +59,16 @@ private void initHitbox(net.minecraft.entity.Entity entityIn, double x, double y
crosshairColor = entity.getCrosshairColor();
eyeColor = entity.getEyeColor();
lineColor = entity.getLineColor();
if (GeneralConfig.getConfig().getDashedHitbox()) {
GL11.glEnable(GL11.GL_LINE_STIPPLE);
GL11.glLineStipple(GeneralConfig.getConfig().getDashedFactor(), (short) 0xAAAA);
}
GL11.glLineWidth(GeneralConfig.getConfig().getHitboxWidth());
return;
}
for (Entity entity : Entity.getSortedList()) {
if (entity.getCondition().invoke(entityIn)) {
if ((!entity.getHitboxEnabled() && !entity.getEyeLineEnabled() && !entity.getLineEnabled()) || (GeneralConfig.getConfig().getDisableForSelf() && "Self".equals(entity.getName()))) {
if ((!entity.getHitboxEnabled() && !entity.getEyeLineEnabled() && !entity.getLineEnabled())) {
ci.cancel();
return;
}
Expand All @@ -75,6 +79,10 @@ private void initHitbox(net.minecraft.entity.Entity entityIn, double x, double y
crosshairColor = entity.getCrosshairColor();
eyeColor = entity.getEyeColor();
lineColor = entity.getLineColor();
if (GeneralConfig.getConfig().getDashedHitbox()) {
GL11.glEnable(GL11.GL_LINE_STIPPLE);
GL11.glLineStipple(GeneralConfig.getConfig().getDashedFactor(), (short) 0xAAAA);
}
GL11.glLineWidth(GeneralConfig.getConfig().getHitboxWidth());
return;
}
Expand Down Expand Up @@ -116,5 +124,8 @@ private void modifyEyeLineColor(Args args) {
@Inject(method = "renderDebugBoundingBox", at = @At("RETURN"))
private void resetLineWidth(net.minecraft.entity.Entity entityIn, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo ci) {
GL11.glLineWidth(1);
if (GeneralConfig.getConfig().getDashedHitbox()) {
GL11.glDisable(GL11.GL_LINE_STIPPLE);
}
}
}
Loading

0 comments on commit e6bdd48

Please sign in to comment.