Skip to content

Commit

Permalink
Revert "start on particles"
Browse files Browse the repository at this point in the history
This reverts commit 931f9cd.
  • Loading branch information
Wyvest committed May 15, 2022
1 parent 931f9cd commit 7ddf167
Show file tree
Hide file tree
Showing 16 changed files with 30 additions and 294 deletions.
10 changes: 0 additions & 10 deletions src/main/java/net/wyvest/redaction/hook/EntityBreakingFXHook.java

This file was deleted.

This file was deleted.

24 changes: 0 additions & 24 deletions src/main/java/net/wyvest/redaction/mixin/EffectRendererMixin.java

This file was deleted.

This file was deleted.

This file was deleted.

11 changes: 0 additions & 11 deletions src/main/java/net/wyvest/redaction/mixin/EntityFXAccessor.java

This file was deleted.

This file was deleted.

20 changes: 10 additions & 10 deletions src/main/java/net/wyvest/redaction/mixin/RenderManagerMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MovingObjectPosition;
import net.wyvest.redaction.features.hitbox.Entity;
import net.wyvest.redaction.features.hitbox.HitboxesConfig;
import net.wyvest.redaction.features.hitbox.GeneralConfig;
import net.wyvest.redaction.gui.HitboxPreviewGUI;
import org.lwjgl.opengl.GL11;
import org.spongepowered.asm.mixin.Mixin;
Expand All @@ -33,7 +33,7 @@ public class RenderManagerMixin {

@Inject(method = "doRenderEntity", at = @At(value = "HEAD"))
private void forceHitbox(net.minecraft.entity.Entity entity, double x, double y, double z, float entityYaw, float partialTicks, boolean hideDebugBox, CallbackInfoReturnable<Boolean> cir) {
if (HitboxesConfig.getConfig().getForceHitbox()) {
if (GeneralConfig.getConfig().getForceHitbox()) {
if (!Minecraft.getMinecraft().getRenderManager().isDebugBoundingBox())
Minecraft.getMinecraft().getRenderManager().setDebugBoundingBox(true);
return;
Expand All @@ -59,11 +59,11 @@ private void initHitbox(net.minecraft.entity.Entity entityIn, double x, double y
crosshairColor = entity.getCrosshairColor();
eyeColor = entity.getEyeColor();
lineColor = entity.getLineColor();
if (HitboxesConfig.getConfig().getDashedHitbox()) {
if (GeneralConfig.getConfig().getDashedHitbox()) {
GL11.glEnable(GL11.GL_LINE_STIPPLE);
GL11.glLineStipple(HitboxesConfig.getConfig().getDashedFactor(), (short) 0xAAAA);
GL11.glLineStipple(GeneralConfig.getConfig().getDashedFactor(), (short) 0xAAAA);
}
GL11.glLineWidth(HitboxesConfig.getConfig().getHitboxWidth());
GL11.glLineWidth(GeneralConfig.getConfig().getHitboxWidth());
return;
}
for (Entity entity : Entity.getSortedList()) {
Expand All @@ -79,11 +79,11 @@ private void initHitbox(net.minecraft.entity.Entity entityIn, double x, double y
crosshairColor = entity.getCrosshairColor();
eyeColor = entity.getEyeColor();
lineColor = entity.getLineColor();
if (HitboxesConfig.getConfig().getDashedHitbox()) {
if (GeneralConfig.getConfig().getDashedHitbox()) {
GL11.glEnable(GL11.GL_LINE_STIPPLE);
GL11.glLineStipple(HitboxesConfig.getConfig().getDashedFactor(), (short) 0xAAAA);
GL11.glLineStipple(GeneralConfig.getConfig().getDashedFactor(), (short) 0xAAAA);
}
GL11.glLineWidth(HitboxesConfig.getConfig().getHitboxWidth());
GL11.glLineWidth(GeneralConfig.getConfig().getHitboxWidth());
return;
}
}
Expand All @@ -93,7 +93,7 @@ private void initHitbox(net.minecraft.entity.Entity entityIn, double x, double y
private void shouldRenderHitbox(AxisAlignedBB boundingBox, int red, int green, int blue, int alpha, net.minecraft.entity.Entity entityIn, double x, double y, double z, float entityYaw, float partialTicks) {
if (box) {
int color = (Minecraft.getMinecraft().objectMouseOver != null && Minecraft.getMinecraft().objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && Minecraft.getMinecraft().objectMouseOver.entityHit.equals(entityIn)) || (HitboxPreviewGUI.Companion.getBypassHitbox() && HitboxPreviewGUI.Companion.getCursorOverEmulatedEntity()) ? crosshairColor : hitboxColor;
RenderGlobal.drawOutlinedBoundingBox((HitboxesConfig.getConfig().getAccurateHitbox() ? boundingBox.expand(entityIn.getCollisionBorderSize(), entityIn.getCollisionBorderSize(), entityIn.getCollisionBorderSize()) : boundingBox), ColorUtils.getRed(color), ColorUtils.getGreen(color), ColorUtils.getBlue(color), alpha);
RenderGlobal.drawOutlinedBoundingBox((GeneralConfig.getConfig().getAccurateHitbox() ? boundingBox.expand(entityIn.getCollisionBorderSize(), entityIn.getCollisionBorderSize(), entityIn.getCollisionBorderSize()) : boundingBox), ColorUtils.getRed(color), ColorUtils.getGreen(color), ColorUtils.getBlue(color), alpha);
}
}

Expand Down Expand Up @@ -124,7 +124,7 @@ 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 (HitboxesConfig.getConfig().getDashedHitbox()) {
if (GeneralConfig.getConfig().getDashedHitbox()) {
GL11.glDisable(GL11.GL_LINE_STIPPLE);
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/main/kotlin/net/wyvest/redaction/Redaction.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import net.wyvest.redaction.features.NameHighlight
import net.wyvest.redaction.features.ParticleManager
import net.wyvest.redaction.features.ServerManager
import net.wyvest.redaction.features.hitbox.Hitboxes
import net.wyvest.redaction.features.particles.Particles
import net.wyvest.redaction.gui.HitboxPreviewGUI
import java.io.File

Expand Down Expand Up @@ -61,7 +60,6 @@ object Redaction {
EVENT_BUS.register(ParticleManager)
EVENT_BUS.register(ServerManager)
Hitboxes.initialize()
Particles.initialize()
ServerManager.initialize()
NameHighlight.initialize()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ package net.wyvest.redaction.features.hitbox
import com.google.gson.annotations.SerializedName
import kotlin.properties.Delegates

data class HitboxesConfig(
data class GeneralConfig(
@SerializedName("hitbox_width") var hitboxWidth: Int = 1,
@SerializedName("force_hitbox") var forceHitbox: Boolean = false,
@SerializedName("accurate_hitbox") var accurateHitbox: Boolean = true,
@SerializedName("dashed_hitbox") var dashedHitbox: Boolean = false,
@SerializedName("dashed_factor") var dashedFactor: Int = 6
) {
companion object {
@JvmStatic var config by Delegates.notNull<HitboxesConfig>()
@JvmStatic var config by Delegates.notNull<GeneralConfig>()
internal set
}
}
14 changes: 7 additions & 7 deletions src/main/kotlin/net/wyvest/redaction/features/hitbox/Hitboxes.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ object Hitboxes {
}
}
if (!readJson.has("general")) {
readJson.add("general", PARSER.parse(GSON.toJson(HitboxesConfig(hitboxWidth = 1, forceHitbox = false, accurateHitbox = true))))
readJson.add("general", PARSER.parse(GSON.toJson(GeneralConfig(hitboxWidth = 1, forceHitbox = false, accurateHitbox = true))))
}
if (readJson["general"].asJsonObject.has("disable_for_self")) {
readJson["self"].asJsonObject.addProperty("hitbox_enabled", false)
Expand All @@ -53,7 +53,7 @@ object Hitboxes {
Entity.map[entity.key]?.lineColor = entityJson["line_color"].asInt
}
val generalJson = json["general"].asJsonObject
HitboxesConfig.config = HitboxesConfig(
GeneralConfig.config = GeneralConfig(
hitboxWidth = generalJson["hitbox_width"].asInt,
forceHitbox = generalJson["force_hitbox"].asBoolean,
accurateHitbox = generalJson["accurate_hitbox"].asBoolean,
Expand Down Expand Up @@ -83,11 +83,11 @@ object Hitboxes {
entityJson.addProperty("crosshair_color", thing.crosshairColor)
}
val generalJson = json["general"].asJsonObject
generalJson.addProperty("hitbox_width", HitboxesConfig.config.hitboxWidth)
generalJson.addProperty("force_hitbox", HitboxesConfig.config.forceHitbox)
generalJson.addProperty("accurate_hitbox", HitboxesConfig.config.accurateHitbox)
generalJson.addProperty("dashed_hitbox", HitboxesConfig.config.dashedHitbox)
generalJson.addProperty("dashed_factor", HitboxesConfig.config.dashedFactor)
generalJson.addProperty("hitbox_width", GeneralConfig.config.hitboxWidth)
generalJson.addProperty("force_hitbox", GeneralConfig.config.forceHitbox)
generalJson.addProperty("accurate_hitbox", GeneralConfig.config.accurateHitbox)
generalJson.addProperty("dashed_hitbox", GeneralConfig.config.dashedHitbox)
generalJson.addProperty("dashed_factor", GeneralConfig.config.dashedFactor)
file.writeText(GSON.toJson(json))
}

Expand Down
Loading

0 comments on commit 7ddf167

Please sign in to comment.