diff options
-rw-r--r-- | README.md | 4 | ||||
-rw-r--r-- | build.gradle.kts | 12 | ||||
-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 |
13 files changed, 182 insertions, 159 deletions
@@ -2,10 +2,10 @@ **For a 1.12.2 template, checkout [`1.12`](https://github.com/romangraef/Forge1.8.9Template/tree/1.12/)** -To get started, clone this repository and replace all references to `examplemod` or `com.example` with your own names. +To get started, clone this repository and replace all references to `examplemod` or `com.dulkirmod` with your own names. If you don't want mixins (which allow for modifying vanilla code), then you can remove the references to mixins from -the `build.gradle.kts`, delete the `mixins.examplemod.json` and the `com.example.mixin` package. +the `build.gradle.kts`, delete the `mixins.examplemod.json` and the `com.dulkirmod.mixin` package. This project uses [DevAuth](https://github.com/DJtheRedstoner/DevAuth) per default, so you can log in using your real minecraft account. If you don't need that, you can remove it from the buildscript. diff --git a/build.gradle.kts b/build.gradle.kts index c63956b..e180849 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -23,17 +23,17 @@ loom { property("mixin.debug", "true") property("asmhelper.verbose", "true") arg("--tweakClass", "org.spongepowered.asm.launch.MixinTweaker") - arg("--mixin", "mixins.examplemod.json") + arg("--mixin", "mixins.dulkirmod.json") } } forge { pack200Provider.set(dev.architectury.pack200.java.Pack200Adapter()) // If you don't want mixins, remove this lines - mixinConfig("mixins.examplemod.json") + mixinConfig("mixins.dulkirmod.json") } // If you don't want mixins, remove these lines mixin { - defaultRefmapName.set("mixins.examplemod.refmap.json") + defaultRefmapName.set("mixins.dulkirmod.refmap.json") } } @@ -77,14 +77,14 @@ tasks.withType(JavaCompile::class) { } tasks.withType(Jar::class) { - archiveBaseName.set("examplemod") + archiveBaseName.set("dulkirmod") manifest.attributes.run { this["FMLCorePluginContainsFMLMod"] = "true" this["ForceLoadAsMod"] = "true" // If you don't want mixins, remove these lines this["TweakClass"] = "org.spongepowered.asm.launch.MixinTweaker" - this["MixinConfigs"] = "mixins.examplemod.json" + this["MixinConfigs"] = "mixins.dulkirmod.json" } } @@ -105,7 +105,7 @@ tasks.shadowJar { } // If you want to include other dependencies and shadow them, you can relocate them in here - fun relocate(name: String) = relocate(name, "com.examplemod.deps.$name") + fun relocate(name: String) = relocate(name, "com.dulkirmod.deps.$name") } tasks.assemble.get().dependsOn(tasks.remapJar) 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" ] } |