aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/dulkirmod
diff options
context:
space:
mode:
authoringle <inglettronald@gmail.com>2022-09-23 22:24:48 -0500
committeringle <inglettronald@gmail.com>2022-09-23 22:25:15 -0500
commit3cd5f5f32cd60c15e1c68862d28885f733473dad (patch)
treeb58f43d7a27cfab3246b7b32a84ff1b8518dd3b9 /src/main/java/dulkirmod
parent982f4e721ea20eaef3056050ad0b6a5058d24354 (diff)
downloadDulkirMod-3cd5f5f32cd60c15e1c68862d28885f733473dad.tar.gz
DulkirMod-3cd5f5f32cd60c15e1c68862d28885f733473dad.tar.bz2
DulkirMod-3cd5f5f32cd60c15e1c68862d28885f733473dad.zip
Some things work now
Diffstat (limited to 'src/main/java/dulkirmod')
-rw-r--r--src/main/java/dulkirmod/mixins/MixinRendererManager.java52
-rw-r--r--src/main/java/dulkirmod/mixins/MixinWorld.java23
2 files changed, 75 insertions, 0 deletions
diff --git a/src/main/java/dulkirmod/mixins/MixinRendererManager.java b/src/main/java/dulkirmod/mixins/MixinRendererManager.java
new file mode 100644
index 0000000..b545107
--- /dev/null
+++ b/src/main/java/dulkirmod/mixins/MixinRendererManager.java
@@ -0,0 +1,52 @@
+package dulkirmod.mixins;
+
+import net.minecraft.client.renderer.entity.RenderManager;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.item.EntityArmorStand;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+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 dulkirmod.DulkirMod;
+
+@Mixin(RenderManager.class)
+public class MixinRendererManager {
+
+ @Inject(method = "doRenderEntity", at = @At("HEAD"), cancellable = true)
+ public void doRender(
+ Entity entity,
+ double x,
+ double y,
+ double z,
+ float entityYaw,
+ float partialTicks,
+ boolean p_147939_10_,
+ CallbackInfoReturnable<Boolean> cir
+ ) {
+ if(!DulkirMod.Companion.getConfig().getHideHealerFairy()) return;
+ if (entity instanceof EntityArmorStand) {
+ if (((EntityArmorStand) entity).getHeldItem() != null && ((EntityArmorStand) entity).getHeldItem().getItem() == Items.skull) {
+ ItemStack stack = ((EntityArmorStand) entity).getHeldItem();
+ if (stack.hasTagCompound() && stack.getTagCompound().hasKey("SkullOwner")) {
+ NBTTagCompound skullOwner = stack.getTagCompound().getCompoundTag("SkullOwner");
+ if (skullOwner.hasKey("Properties")) {
+ NBTTagCompound properties = skullOwner.getCompoundTag("Properties");
+ if (properties.hasKey("textures")) {
+ //if (properties.getTagList("textures", 10).tagCount() >= 1) {
+ if ("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTZjM2UzMWNmYzY2NzMzMjc1YzQyZmNmYjVkOWE0NDM0MmQ2NDNiNTVjZDE0YzljNzdkMjczYTIzNTIifX19"
+ .equals(properties.getTagList("textures", 10).getCompoundTagAt(0).getString("Value")))
+ cir.cancel();
+ //}
+ }
+
+ }
+
+ }
+
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/src/main/java/dulkirmod/mixins/MixinWorld.java b/src/main/java/dulkirmod/mixins/MixinWorld.java
new file mode 100644
index 0000000..97133e1
--- /dev/null
+++ b/src/main/java/dulkirmod/mixins/MixinWorld.java
@@ -0,0 +1,23 @@
+package dulkirmod.mixins;
+
+import net.minecraft.world.World;
+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 dulkirmod.DulkirMod;
+
+@Mixin(World.class)
+public class MixinWorld {
+
+ @Inject(method = "spawnParticle(IZDDDDDD[I)V", at = @At("HEAD"), cancellable = true)
+ public void onInitGui(int particleID, boolean p_175720_2_, double xCood, double yCoord, double zCoord,
+ double xOffset, double yOffset, double zOffset, int[] p_175720_15_, CallbackInfo ci) {
+ if (particleID == 25 && DulkirMod.Companion.getConfig().getHideEnchantRune()) {
+ ci.cancel();
+ }
+ else if (particleID == 34 && DulkirMod.Companion.getConfig().getHideHeartParticles()) {
+ ci.cancel();
+ }
+ }
+}