diff options
author | ingle <inglettronald@gmail.com> | 2022-09-23 05:01:47 -0500 |
---|---|---|
committer | ingle <inglettronald@gmail.com> | 2022-09-23 05:01:47 -0500 |
commit | add142c970d52d33e731fb3a30605a5ef1f128bd (patch) | |
tree | 5cad6bf99e2453481f3cbba220cbe6491b4ce625 /src/main | |
parent | 033de65a180b64fc645036d142589f57956ea263 (diff) | |
download | DulkirMod-add142c970d52d33e731fb3a30605a5ef1f128bd.tar.gz DulkirMod-add142c970d52d33e731fb3a30605a5ef1f128bd.tar.bz2 DulkirMod-add142c970d52d33e731fb3a30605a5ef1f128bd.zip |
Nothing works yet :+1:
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/com/dulkirmod/DulkirMod.java (renamed from src/main/java/com/example/ExampleMod.java) | 8 | ||||
-rw-r--r-- | src/main/java/com/dulkirmod/Settings.java (renamed from src/main/java/com/example/Settings.java) | 11 | ||||
-rw-r--r-- | src/main/java/com/dulkirmod/commands/ClientCommandBase.java (renamed from src/main/java/com/example/commands/ClientCommandBase.java) | 54 | ||||
-rw-r--r-- | src/main/java/com/dulkirmod/commands/Commands.java (renamed from src/main/java/com/example/commands/Commands.java) | 25 | ||||
-rw-r--r-- | src/main/java/com/dulkirmod/commands/EnchantRuneCommand.java (renamed from src/main/java/com/example/commands/EnchantRuneCommand.java) | 43 | ||||
-rw-r--r-- | src/main/java/com/dulkirmod/commands/FairyCommand.java | 22 | ||||
-rw-r--r-- | src/main/java/com/dulkirmod/commands/HelpCommand.java (renamed from src/main/java/com/example/commands/HelpCommand.java) | 45 | ||||
-rw-r--r-- | src/main/java/com/dulkirmod/mixin/MixinRendererManager.java (renamed from src/main/java/com/example/mixin/MixinRendererManager.java) | 99 | ||||
-rw-r--r-- | src/main/java/com/dulkirmod/mixin/MixinWorld.java (renamed from src/main/java/com/example/mixin/MixinWorld.java) | 5 | ||||
-rw-r--r-- | src/main/resources/mcmod.info | 8 | ||||
-rw-r--r-- | src/main/resources/mixins.dulkirmod.json (renamed from src/main/resources/mixins.examplemod.json) | 5 |
11 files changed, 174 insertions, 151 deletions
diff --git a/src/main/java/com/example/ExampleMod.java b/src/main/java/com/dulkirmod/DulkirMod.java index c43c2c5..07117c4 100644 --- a/src/main/java/com/example/ExampleMod.java +++ b/src/main/java/com/dulkirmod/DulkirMod.java @@ -1,13 +1,13 @@ -package com.example; +package com.dulkirmod; -import com.example.commands.Commands; +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 = "examplemod", version = "1.0.0") -public class ExampleMod { +@Mod(modid = "dulkirclient", version = "1.0.0") +public class DulkirMod { public Commands commands; @Mod.EventHandler diff --git a/src/main/java/com/example/Settings.java b/src/main/java/com/dulkirmod/Settings.java index e7576f4..316aa2f 100644 --- a/src/main/java/com/example/Settings.java +++ b/src/main/java/com/dulkirmod/Settings.java @@ -1,5 +1,6 @@ -package com.example;
-
-public class Settings {
- public static boolean EnchantRune = true;
-}
+package com.dulkirmod; + +public class Settings { + public static boolean EnchantRune = true; + public static boolean HealerFairy = true; +} diff --git a/src/main/java/com/example/commands/ClientCommandBase.java b/src/main/java/com/dulkirmod/commands/ClientCommandBase.java index 566fb6e..5f391f9 100644 --- a/src/main/java/com/example/commands/ClientCommandBase.java +++ b/src/main/java/com/dulkirmod/commands/ClientCommandBase.java @@ -1,27 +1,27 @@ -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;
- }
-}
+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/example/commands/Commands.java b/src/main/java/com/dulkirmod/commands/Commands.java index 4a3db44..b70ba4e 100644 --- a/src/main/java/com/example/commands/Commands.java +++ b/src/main/java/com/dulkirmod/commands/Commands.java @@ -1,14 +1,13 @@ -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());
- }
+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/example/commands/EnchantRuneCommand.java b/src/main/java/com/dulkirmod/commands/EnchantRuneCommand.java index 98296ae..3a38053 100644 --- a/src/main/java/com/example/commands/EnchantRuneCommand.java +++ b/src/main/java/com/dulkirmod/commands/EnchantRuneCommand.java @@ -1,23 +1,22 @@ -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;
- }
+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/example/commands/HelpCommand.java b/src/main/java/com/dulkirmod/commands/HelpCommand.java index 603fbdc..18dc399 100644 --- a/src/main/java/com/example/commands/HelpCommand.java +++ b/src/main/java/com/dulkirmod/commands/HelpCommand.java @@ -1,23 +1,24 @@ -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."));
- }
+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/example/mixin/MixinRendererManager.java b/src/main/java/com/dulkirmod/mixin/MixinRendererManager.java index eae11fa..359b67e 100644 --- a/src/main/java/com/example/mixin/MixinRendererManager.java +++ b/src/main/java/com/dulkirmod/mixin/MixinRendererManager.java @@ -1,49 +1,52 @@ -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<Boolean> 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();
- }
-
- }
-
- }
-
- }
- }
- }
+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<Boolean> 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/example/mixin/MixinWorld.java b/src/main/java/com/dulkirmod/mixin/MixinWorld.java index 9bacbcd..8ae76cd 100644 --- a/src/main/java/com/example/mixin/MixinWorld.java +++ b/src/main/java/com/dulkirmod/mixin/MixinWorld.java @@ -1,12 +1,11 @@ -package com.example.mixin; +package com.dulkirmod.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; +import com.dulkirmod.Settings; @Mixin(World.class) public class MixinWorld { diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 7b1a26b..074b24c 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -1,14 +1,14 @@ [ { - "modid": "examplemod", - "name": "Xample Mod", - "description": "A mod that is used as an example.", + "modid": "dulkirmod", + "name": "Dulkir Mod", + "description": "I steal nopo's code", "version": "1.0.0", "mcversion": "1.8.9", "url": "https://github.com/romangraef/Forge1.8.9Template/", "updateUrl": "", "authorList": [ - "You" + "Dulkir", "Nopo" ], "credits": "", "logoFile": "", diff --git a/src/main/resources/mixins.examplemod.json b/src/main/resources/mixins.dulkirmod.json index a5f085a..54215e8 100644 --- a/src/main/resources/mixins.examplemod.json +++ b/src/main/resources/mixins.dulkirmod.json @@ -1,13 +1,12 @@ { - "package": "com.example.mixin", - "refmap": "mixins.examplemod.refmap.json", + "package": "com.dulkirmod.mixin", + "refmap": "mixins.dulkirmod.refmap.json", "minVersion": "0.7", "compatibilityLevel": "JAVA_8", "mixins": [ "MixinWorld" ], "client": [ - "Mixinaa", "MixinRendererManager" ] } |