From add142c970d52d33e731fb3a30605a5ef1f128bd Mon Sep 17 00:00:00 2001 From: ingle Date: Fri, 23 Sep 2022 05:01:47 -0500 Subject: Nothing works yet :+1: --- src/main/java/com/dulkirmod/DulkirMod.java | 22 +++++++++ src/main/java/com/dulkirmod/Settings.java | 6 +++ .../com/dulkirmod/commands/ClientCommandBase.java | 27 +++++++++++ src/main/java/com/dulkirmod/commands/Commands.java | 13 ++++++ .../com/dulkirmod/commands/EnchantRuneCommand.java | 22 +++++++++ .../java/com/dulkirmod/commands/FairyCommand.java | 22 +++++++++ .../java/com/dulkirmod/commands/HelpCommand.java | 24 ++++++++++ .../com/dulkirmod/mixin/MixinRendererManager.java | 52 ++++++++++++++++++++++ src/main/java/com/dulkirmod/mixin/MixinWorld.java | 20 +++++++++ src/main/java/com/example/ExampleMod.java | 22 --------- src/main/java/com/example/Settings.java | 5 --- .../com/example/commands/ClientCommandBase.java | 27 ----------- src/main/java/com/example/commands/Commands.java | 14 ------ .../com/example/commands/EnchantRuneCommand.java | 23 ---------- .../java/com/example/commands/HelpCommand.java | 23 ---------- .../com/example/mixin/MixinRendererManager.java | 49 -------------------- src/main/java/com/example/mixin/MixinWorld.java | 21 --------- 17 files changed, 208 insertions(+), 184 deletions(-) create mode 100644 src/main/java/com/dulkirmod/DulkirMod.java create mode 100644 src/main/java/com/dulkirmod/Settings.java create mode 100644 src/main/java/com/dulkirmod/commands/ClientCommandBase.java create mode 100644 src/main/java/com/dulkirmod/commands/Commands.java create mode 100644 src/main/java/com/dulkirmod/commands/EnchantRuneCommand.java create mode 100644 src/main/java/com/dulkirmod/commands/FairyCommand.java create mode 100644 src/main/java/com/dulkirmod/commands/HelpCommand.java create mode 100644 src/main/java/com/dulkirmod/mixin/MixinRendererManager.java create mode 100644 src/main/java/com/dulkirmod/mixin/MixinWorld.java delete mode 100644 src/main/java/com/example/ExampleMod.java delete mode 100644 src/main/java/com/example/Settings.java delete mode 100644 src/main/java/com/example/commands/ClientCommandBase.java delete mode 100644 src/main/java/com/example/commands/Commands.java delete mode 100644 src/main/java/com/example/commands/EnchantRuneCommand.java delete mode 100644 src/main/java/com/example/commands/HelpCommand.java delete mode 100644 src/main/java/com/example/mixin/MixinRendererManager.java delete mode 100644 src/main/java/com/example/mixin/MixinWorld.java (limited to 'src/main/java/com') diff --git a/src/main/java/com/dulkirmod/DulkirMod.java b/src/main/java/com/dulkirmod/DulkirMod.java new file mode 100644 index 0000000..07117c4 --- /dev/null +++ b/src/main/java/com/dulkirmod/DulkirMod.java @@ -0,0 +1,22 @@ +package com.dulkirmod; + +import com.dulkirmod.commands.Commands; +import net.minecraft.init.Blocks; +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; + +@Mod(modid = "dulkirclient", version = "1.0.0") +public class DulkirMod { + public Commands commands; + + @Mod.EventHandler + public void init(FMLInitializationEvent event) { + System.out.println("Dirt: " + Blocks.dirt.getUnlocalizedName()); + } + + @Mod.EventHandler + public void preinit(FMLPreInitializationEvent event) { + this.commands = new Commands(); + } +} diff --git a/src/main/java/com/dulkirmod/Settings.java b/src/main/java/com/dulkirmod/Settings.java new file mode 100644 index 0000000..316aa2f --- /dev/null +++ b/src/main/java/com/dulkirmod/Settings.java @@ -0,0 +1,6 @@ +package com.dulkirmod; + +public class Settings { + public static boolean EnchantRune = true; + public static boolean HealerFairy = true; +} diff --git a/src/main/java/com/dulkirmod/commands/ClientCommandBase.java b/src/main/java/com/dulkirmod/commands/ClientCommandBase.java new file mode 100644 index 0000000..5f391f9 --- /dev/null +++ b/src/main/java/com/dulkirmod/commands/ClientCommandBase.java @@ -0,0 +1,27 @@ +package com.dulkirmod.commands; + +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; + +public abstract class ClientCommandBase extends CommandBase { + private final String name; + + protected ClientCommandBase(String name) { + this.name = name; + } + + @Override + public String getCommandName() { + return name; + } + + @Override + public String getCommandUsage(ICommandSender sender) { + return "/" + name; + } + + @Override + public boolean canCommandSenderUseCommand(ICommandSender sender) { + return true; + } +} diff --git a/src/main/java/com/dulkirmod/commands/Commands.java b/src/main/java/com/dulkirmod/commands/Commands.java new file mode 100644 index 0000000..b70ba4e --- /dev/null +++ b/src/main/java/com/dulkirmod/commands/Commands.java @@ -0,0 +1,13 @@ +package com.dulkirmod.commands; + +import net.minecraftforge.client.ClientCommandHandler; + +public class Commands { + public Commands() { + // Help Commands + ClientCommandHandler.instance.registerCommand(new HelpCommand()); + + // General + ClientCommandHandler.instance.registerCommand(new EnchantRuneCommand()); + } +} \ No newline at end of file diff --git a/src/main/java/com/dulkirmod/commands/EnchantRuneCommand.java b/src/main/java/com/dulkirmod/commands/EnchantRuneCommand.java new file mode 100644 index 0000000..3a38053 --- /dev/null +++ b/src/main/java/com/dulkirmod/commands/EnchantRuneCommand.java @@ -0,0 +1,22 @@ +package com.dulkirmod.commands; + +import com.dulkirmod.Settings; +import net.minecraft.client.Minecraft; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; + +public class EnchantRuneCommand extends ClientCommandBase { + + public EnchantRuneCommand() { + super("enchantrune"); + } + + @Override + public void processCommand(ICommandSender sender, String[] args) throws CommandException { + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText( + EnumChatFormatting.BLACK+ "" + EnumChatFormatting.BOLD + "TOGGLED.")); + Settings.EnchantRune = !Settings.EnchantRune; + } +} \ No newline at end of file diff --git a/src/main/java/com/dulkirmod/commands/FairyCommand.java b/src/main/java/com/dulkirmod/commands/FairyCommand.java new file mode 100644 index 0000000..0acc3a0 --- /dev/null +++ b/src/main/java/com/dulkirmod/commands/FairyCommand.java @@ -0,0 +1,22 @@ +package com.dulkirmod.commands; + +import com.dulkirmod.Settings; +import net.minecraft.client.Minecraft; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; + +public class FairyCommand extends ClientCommandBase { + + public FairyCommand() { + super("fairy"); + } + + @Override + public void processCommand(ICommandSender sender, String[] args) throws CommandException { + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText( + EnumChatFormatting.BLACK+ "" + EnumChatFormatting.BOLD + "TOGGLED.")); + Settings.HealerFairy = !Settings.HealerFairy; + } +} \ No newline at end of file diff --git a/src/main/java/com/dulkirmod/commands/HelpCommand.java b/src/main/java/com/dulkirmod/commands/HelpCommand.java new file mode 100644 index 0000000..18dc399 --- /dev/null +++ b/src/main/java/com/dulkirmod/commands/HelpCommand.java @@ -0,0 +1,24 @@ +package com.dulkirmod.commands; + +import net.minecraft.client.Minecraft; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; + +public class HelpCommand extends ClientCommandBase { + + public HelpCommand() { + super("dulkir"); + } + + @Override + public void processCommand(ICommandSender sender, String[] args) throws CommandException { + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText( + EnumChatFormatting.GOLD + "" + EnumChatFormatting.BOLD + " HI THIS IS DULKIRMOD!")); + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText( + EnumChatFormatting.GRAY + "/enchantrune - toggles enchant rune visibility.")); + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText( + EnumChatFormatting.GRAY + "/fairy - toggles healer fairy visibility.")); + } +} \ No newline at end of file diff --git a/src/main/java/com/dulkirmod/mixin/MixinRendererManager.java b/src/main/java/com/dulkirmod/mixin/MixinRendererManager.java new file mode 100644 index 0000000..359b67e --- /dev/null +++ b/src/main/java/com/dulkirmod/mixin/MixinRendererManager.java @@ -0,0 +1,52 @@ +package com.dulkirmod.mixin; + +import com.dulkirmod.Settings; +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; + +@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 cir + ) { + if(!Settings.HealerFairy) 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/com/dulkirmod/mixin/MixinWorld.java b/src/main/java/com/dulkirmod/mixin/MixinWorld.java new file mode 100644 index 0000000..8ae76cd --- /dev/null +++ b/src/main/java/com/dulkirmod/mixin/MixinWorld.java @@ -0,0 +1,20 @@ +package com.dulkirmod.mixin; + +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 com.dulkirmod.Settings; + +@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 && Settings.EnchantRune) { + ci.cancel(); + } + } +} diff --git a/src/main/java/com/example/ExampleMod.java b/src/main/java/com/example/ExampleMod.java deleted file mode 100644 index c43c2c5..0000000 --- a/src/main/java/com/example/ExampleMod.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.example; - -import com.example.commands.Commands; -import net.minecraft.init.Blocks; -import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.fml.common.event.FMLInitializationEvent; -import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; - -@Mod(modid = "examplemod", version = "1.0.0") -public class ExampleMod { - public Commands commands; - - @Mod.EventHandler - public void init(FMLInitializationEvent event) { - System.out.println("Dirt: " + Blocks.dirt.getUnlocalizedName()); - } - - @Mod.EventHandler - public void preinit(FMLPreInitializationEvent event) { - this.commands = new Commands(); - } -} diff --git a/src/main/java/com/example/Settings.java b/src/main/java/com/example/Settings.java deleted file mode 100644 index e7576f4..0000000 --- a/src/main/java/com/example/Settings.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.example; - -public class Settings { - public static boolean EnchantRune = true; -} diff --git a/src/main/java/com/example/commands/ClientCommandBase.java b/src/main/java/com/example/commands/ClientCommandBase.java deleted file mode 100644 index 566fb6e..0000000 --- a/src/main/java/com/example/commands/ClientCommandBase.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.example.commands; - -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; - -public abstract class ClientCommandBase extends CommandBase { - private final String name; - - protected ClientCommandBase(String name) { - this.name = name; - } - - @Override - public String getCommandName() { - return name; - } - - @Override - public String getCommandUsage(ICommandSender sender) { - return "/" + name; - } - - @Override - public boolean canCommandSenderUseCommand(ICommandSender sender) { - return true; - } -} diff --git a/src/main/java/com/example/commands/Commands.java b/src/main/java/com/example/commands/Commands.java deleted file mode 100644 index 4a3db44..0000000 --- a/src/main/java/com/example/commands/Commands.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.example.commands; - -import com.example.commands.HelpCommand; -import net.minecraftforge.client.ClientCommandHandler; - -public class Commands { - public Commands() { - // Help Commands - ClientCommandHandler.instance.registerCommand(new HelpCommand()); - - // General - ClientCommandHandler.instance.registerCommand(new EnchantRuneCommand()); - } -} \ No newline at end of file diff --git a/src/main/java/com/example/commands/EnchantRuneCommand.java b/src/main/java/com/example/commands/EnchantRuneCommand.java deleted file mode 100644 index 98296ae..0000000 --- a/src/main/java/com/example/commands/EnchantRuneCommand.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.example.commands; - -import com.example.Settings; -import com.example.commands.ClientCommandBase; -import net.minecraft.client.Minecraft; -import net.minecraft.command.CommandException; -import net.minecraft.command.ICommandSender; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.EnumChatFormatting; - -public class EnchantRuneCommand extends ClientCommandBase { - - public EnchantRuneCommand() { - super("enchantrune"); - } - - @Override - public void processCommand(ICommandSender sender, String[] args) throws CommandException { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText( - EnumChatFormatting.BLACK+ "" + EnumChatFormatting.BOLD + "TOGGLED.")); - Settings.EnchantRune = !Settings.EnchantRune; - } -} \ No newline at end of file diff --git a/src/main/java/com/example/commands/HelpCommand.java b/src/main/java/com/example/commands/HelpCommand.java deleted file mode 100644 index 603fbdc..0000000 --- a/src/main/java/com/example/commands/HelpCommand.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.example.commands; - -import com.example.commands.ClientCommandBase; -import net.minecraft.client.Minecraft; -import net.minecraft.command.CommandException; -import net.minecraft.command.ICommandSender; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.EnumChatFormatting; - -public class HelpCommand extends ClientCommandBase { - - public HelpCommand() { - super("dulkir"); - } - - @Override - public void processCommand(ICommandSender sender, String[] args) throws CommandException { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText( - EnumChatFormatting.GOLD + "HI THIS IS DULKIRMOD")); - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText( - EnumChatFormatting.GRAY + "/enchantrune - toggles enchant rune visibility.")); - } -} \ No newline at end of file diff --git a/src/main/java/com/example/mixin/MixinRendererManager.java b/src/main/java/com/example/mixin/MixinRendererManager.java deleted file mode 100644 index eae11fa..0000000 --- a/src/main/java/com/example/mixin/MixinRendererManager.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.example.mixin; - -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; - -@Mixin(RenderManager.class) -public class MixinRendererManager { - - @Inject(method = "doRenderEntity", at = @At("HEAD")) - public void doRender( - Entity entity, - double x, - double y, - double z, - float entityYaw, - float partialTicks, - boolean p_147939_10_, - CallbackInfoReturnable cir - ) { - - 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 ("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTZjM2UzMWNmYzY2NzMzMjc1YzQyZmNmYjVkOWE0NDM0MmQ2NDNiNTVjZDE0YzljNzdkMjczYTIzNTIifX19" - .equals(properties.getTagList("textures", 10).getCompoundTagAt(0).getString("Value"))) - cir.cancel(); - } - - } - - } - - } - } - } -} \ No newline at end of file diff --git a/src/main/java/com/example/mixin/MixinWorld.java b/src/main/java/com/example/mixin/MixinWorld.java deleted file mode 100644 index 9bacbcd..0000000 --- a/src/main/java/com/example/mixin/MixinWorld.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.example.mixin; - -import net.minecraft.client.gui.GuiMainMenu; -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 com.example.Settings; - -@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 && Settings.EnchantRune) { - ci.cancel(); - } - } -} -- cgit