aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/skytils/skytilsmod/mixins/MixinModelBlaze.java16
-rw-r--r--src/main/java/skytils/skytilsmod/mixins/MixinRenderBlaze.java42
-rw-r--r--src/main/resources/assets/skytils/blankblaze.pngbin3462 -> 0 bytes
-rw-r--r--src/main/resources/mixins.skytils.json1
4 files changed, 16 insertions, 43 deletions
diff --git a/src/main/java/skytils/skytilsmod/mixins/MixinModelBlaze.java b/src/main/java/skytils/skytilsmod/mixins/MixinModelBlaze.java
index 36517b95..2aa68629 100644
--- a/src/main/java/skytils/skytilsmod/mixins/MixinModelBlaze.java
+++ b/src/main/java/skytils/skytilsmod/mixins/MixinModelBlaze.java
@@ -22,11 +22,14 @@ import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelBlaze;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
+import org.lwjgl.opengl.GL11;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import skytils.skytilsmod.Skytils;
+import skytils.skytilsmod.utils.Utils;
import java.awt.*;
@@ -35,9 +38,14 @@ import static skytils.skytilsmod.features.impl.dungeons.solvers.BlazeSolver.orde
@Mixin(ModelBlaze.class)
public abstract class MixinModelBlaze extends ModelBase {
+
+ private boolean disabledTexture2D = false;
+
@Inject(method = "render", at = @At(value = "HEAD"))
private void changeBlazeColor(Entity entity, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale, CallbackInfo ci) {
if (orderedBlazes.size() == 0) return;
+ disabledTexture2D = GL11.glIsEnabled(GL11.GL_TEXTURE_2D);
+ GlStateManager.disableTexture2D();
if (blazeMode <= 0) {
if (entity.isEntityEqual(orderedBlazes.get(0).blaze)) {
Color color = Skytils.config.lowestBlazeColor;
@@ -57,4 +65,12 @@ public abstract class MixinModelBlaze extends ModelBase {
}
}
}
+
+ @Inject(method = "render", at = @At("RETURN"))
+ private void renderPost(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale, CallbackInfo ci) {
+ if (disabledTexture2D) {
+ disabledTexture2D = false;
+ GlStateManager.enableTexture2D();
+ }
+ }
}
diff --git a/src/main/java/skytils/skytilsmod/mixins/MixinRenderBlaze.java b/src/main/java/skytils/skytilsmod/mixins/MixinRenderBlaze.java
deleted file mode 100644
index 64b46e2e..00000000
--- a/src/main/java/skytils/skytilsmod/mixins/MixinRenderBlaze.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Skytils - Hypixel Skyblock Quality of Life Mod
- * Copyright (C) 2021 Skytils
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
- */
-
-package skytils.skytilsmod.mixins;
-
-import net.minecraft.client.renderer.entity.RenderBlaze;
-import net.minecraft.entity.monster.EntityBlaze;
-import net.minecraft.util.ResourceLocation;
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.injection.At;
-import org.spongepowered.asm.mixin.injection.Inject;
-import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
-import skytils.skytilsmod.Skytils;
-import skytils.skytilsmod.utils.Utils;
-
-@Mixin(RenderBlaze.class)
-public abstract class MixinRenderBlaze {
-
- private static final ResourceLocation BLANK_BLAZE_TEXTURE = new ResourceLocation("skytils", "blankblaze.png");
-
- @Inject(method = "getEntityTexture", at = @At("RETURN"), cancellable = true)
- private void setBlazeColor(EntityBlaze entity, CallbackInfoReturnable<ResourceLocation> cir) {
- if (Skytils.config.blazeSolver && Utils.inDungeons) {
- cir.setReturnValue(BLANK_BLAZE_TEXTURE);
- }
- }
-}
diff --git a/src/main/resources/assets/skytils/blankblaze.png b/src/main/resources/assets/skytils/blankblaze.png
deleted file mode 100644
index 79d129b6..00000000
--- a/src/main/resources/assets/skytils/blankblaze.png
+++ /dev/null
Binary files differ
diff --git a/src/main/resources/mixins.skytils.json b/src/main/resources/mixins.skytils.json
index 790372a0..b0eeeabe 100644
--- a/src/main/resources/mixins.skytils.json
+++ b/src/main/resources/mixins.skytils.json
@@ -31,7 +31,6 @@
"MixinPlayerControllerMP",
"MixinRender",
"MixinRenderBat",
- "MixinRenderBlaze",
"MixinRenderEntityItem",
"MixinRenderItem",
"MixinRenderLightningBolt",