From 3a21617da54aea74276612552a0290314302935e Mon Sep 17 00:00:00 2001 From: Alexdoru <57050655+Alexdoru@users.noreply.github.com> Date: Wed, 25 Feb 2026 13:04:48 +0100 Subject: [PATCH 1/7] stop creating two RenderEventHandler --- src/main/java/makeo/gadomancy/client/ClientProxy.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/makeo/gadomancy/client/ClientProxy.java b/src/main/java/makeo/gadomancy/client/ClientProxy.java index ab21c70..a0f3399 100644 --- a/src/main/java/makeo/gadomancy/client/ClientProxy.java +++ b/src/main/java/makeo/gadomancy/client/ClientProxy.java @@ -227,15 +227,14 @@ public void initalize() { @Override public void postInitalize() { IResourceManager manager = Minecraft.getMinecraft().getResourceManager(); - if (manager instanceof SimpleReloadableResourceManager) { - SimpleReloadableResourceManager rm = (SimpleReloadableResourceManager) manager; + if (manager instanceof SimpleReloadableResourceManager rm) { rm.registerReloadListener(ResourceReloadListener.getInstance()); } MinecraftForge.EVENT_BUS.register(EffectHandler.getInstance()); - MinecraftForge.EVENT_BUS.register(new RenderEventHandler()); - FMLCommonHandler.instance().bus().register(new RenderEventHandler()); - + final RenderEventHandler renderHandler = new RenderEventHandler(); + MinecraftForge.EVENT_BUS.register(renderHandler); + FMLCommonHandler.instance().bus().register(renderHandler); FMLCommonHandler.instance().bus().register(new ClientHandler()); super.postInitalize(); From 5d8c12dbc79a0fe60dfcfb67884ad26c881782a1 Mon Sep 17 00:00:00 2001 From: Alexdoru <57050655+Alexdoru@users.noreply.github.com> Date: Wed, 25 Feb 2026 13:06:14 +0100 Subject: [PATCH 2/7] cleanup RenderEventHandler --- .../client/events/RenderEventHandler.java | 100 ++++++++---------- 1 file changed, 42 insertions(+), 58 deletions(-) diff --git a/src/main/java/makeo/gadomancy/client/events/RenderEventHandler.java b/src/main/java/makeo/gadomancy/client/events/RenderEventHandler.java index 2c91fd2..c531de2 100644 --- a/src/main/java/makeo/gadomancy/client/events/RenderEventHandler.java +++ b/src/main/java/makeo/gadomancy/client/events/RenderEventHandler.java @@ -1,6 +1,5 @@ package makeo.gadomancy.client.events; -import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.zip.GZIPInputStream; @@ -60,21 +59,39 @@ /** * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC * LICENSE for more read the LICENSE file - * + *
* Created by makeo @ 13.10.2015 16:11
*/
-public class RenderEventHandler {
+public final class RenderEventHandler {
- private static final REHWandHandler WAND_HANDLER = new REHWandHandler();
- private static final FakeArchitectItem ARCHITECT_ITEM = new FakeArchitectItem();
+ private static final IModelCustom obj;
+ private static final ResourceLocation texture = new ResourceLocation("gadomancy:textures/misc/texW.png");
+ static {
+ ResourceLocation resourceLocation = new ResourceLocation("gadomancy:textures/models/modelAssec.obj");
+ IModelCustom buf;
+ try {
+ buf = new WavefrontObject(
+ "gadomancy:wRender",
+ new GZIPInputStream(
+ Minecraft.getMinecraft().getResourceManager().getResource(resourceLocation)
+ .getInputStream()));
+ } catch (Exception exc) {
+ // shush.
+ buf = null;
+ }
+ obj = buf;
+ }
+
+ private final REHWandHandler WAND_HANDLER = new REHWandHandler();
+ private final FakeArchitectItem ARCHITECT_ITEM = new FakeArchitectItem();
private Object oldGolemblurb;
private int blurbId;
+ private int dList = -1;
@SubscribeEvent
public void on(GuiScreenEvent.DrawScreenEvent.Pre e) {
- if (e.gui instanceof GuiGolem) {
- GuiGolem gui = (GuiGolem) e.gui;
+ if (e.gui instanceof GuiGolem gui) {
EntityGolemBase golem = new Injector(gui, GuiGolem.class).getField("golem");
if (golem != null) {
AdditionalGolemCore core = GadomancyApi.getAdditionalGolemCore(golem);
@@ -103,13 +120,13 @@ public void on(DrawBlockHighlightEvent e) {
if (e.currentItem == null) return;
if (e.currentItem.getItem() instanceof ItemWandCasting) {
ItemFocusBasic focus = ((ItemWandCasting) e.currentItem.getItem()).getFocus(e.currentItem);
- if (focus == null || !(focus instanceof IArchitect)) {
+ if (!(focus instanceof IArchitect)) {
Block block = e.player.worldObj.getBlock(e.target.blockX, e.target.blockY, e.target.blockZ);
if (block != null && block == RegisteredBlocks.blockArcaneDropper) {
ForgeDirection dir = ForgeDirection.getOrientation(
e.player.worldObj.getBlockMetadata(e.target.blockX, e.target.blockY, e.target.blockZ) & 7);
- ArrayList
* Created by makeo @ 29.11.2014 14:15
*/
public class ClientProxy extends CommonProxy {
@@ -231,6 +232,7 @@ public void postInitalize() {
rm.registerReloadListener(ResourceReloadListener.getInstance());
}
+ MinecraftForge.EVENT_BUS.register(new EventHandlerTooltips());
MinecraftForge.EVENT_BUS.register(EffectHandler.getInstance());
final RenderEventHandler renderHandler = new RenderEventHandler();
MinecraftForge.EVENT_BUS.register(renderHandler);
diff --git a/src/main/java/makeo/gadomancy/common/events/EventHandlerGolem.java b/src/main/java/makeo/gadomancy/common/events/EventHandlerGolem.java
index b547a5a..271d882 100644
--- a/src/main/java/makeo/gadomancy/common/events/EventHandlerGolem.java
+++ b/src/main/java/makeo/gadomancy/common/events/EventHandlerGolem.java
@@ -9,7 +9,6 @@
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.StatCollector;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.EntityEvent;
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
@@ -17,7 +16,6 @@
import net.minecraftforge.event.entity.living.LivingHurtEvent;
import net.minecraftforge.event.entity.player.AttackEntityEvent;
import net.minecraftforge.event.entity.player.EntityInteractEvent;
-import net.minecraftforge.event.entity.player.ItemTooltipEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import cpw.mods.fml.common.eventhandler.EventPriority;
@@ -45,7 +43,7 @@
/**
* This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC
* LICENSE for more read the LICENSE file
- *
+ *
* Created by makeo @ 13.03.2015 13:56
*/
public class EventHandlerGolem {
@@ -54,19 +52,15 @@ public class EventHandlerGolem {
@SubscribeEvent(priority = EventPriority.LOWEST)
public void on(EntityEvent.EntityConstructing e) {
- if (e.entity instanceof EntityGolemBase) {
- EntityGolemBase golem = (EntityGolemBase) e.entity;
-
+ if (e.entity instanceof EntityGolemBase golem) {
golem.registerExtendedProperties(Gadomancy.MODID, new ExtendedGolemProperties(golem));
-
golem.getDataWatcher().addObject(ModConfig.golemDatawatcherId, "");
}
}
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void on(EntityEvent.EnteringChunk event) {
- if (event.entity instanceof EntityGolemBase) {
- EntityGolemBase golem = (EntityGolemBase) event.entity;
+ if (event.entity instanceof EntityGolemBase golem) {
if (GadomancyApi.isAdditionalGolemType(golem.getGolemType())) {
ExtendedGolemProperties props = (ExtendedGolemProperties) event.entity
.getExtendedProperties(Gadomancy.MODID);
@@ -80,18 +74,15 @@ public void on(EntityEvent.EnteringChunk event) {
@SubscribeEvent(priority = EventPriority.LOWEST, receiveCanceled = true)
public void on(EntityJoinWorldEvent event) {
- if (!event.entity.worldObj.isRemote && event.entity instanceof EntityGolemBase) {
- EntityGolemBase golem = (EntityGolemBase) event.entity;
+ if (!event.entity.worldObj.isRemote && event.entity instanceof EntityGolemBase golem) {
ExtendedGolemProperties props = (ExtendedGolemProperties) golem.getExtendedProperties(Gadomancy.MODID);
if (props != null) {
props.setWrapperIfNeeded();
}
}
- if (event.entity instanceof EntityItem) {
- EntityItem item = (EntityItem) event.entity;
+ if (event.entity instanceof EntityItem item) {
ItemStack stack = item.getEntityItem();
-
if (stack.getItem() == ConfigItems.itemGolemPlacer) {
AdditionalGolemType type = GadomancyApi
.getAdditionalGolemType(EnumGolemType.getType(stack.getItemDamage()));
@@ -124,8 +115,7 @@ public void on(PlayerInteractEvent e) {
.onItemUseFirst(itemInHand, e.entityPlayer, e.world, e.x, e.y, e.z, e.face, 0, 0, 0)) {
e.setCanceled(true);
Entity entity = e.world.getEntityByID(entityId);
- if (entity != null && entity instanceof EntityGolemBase) {
- EntityGolemBase golem = (EntityGolemBase) entity;
+ if (entity instanceof EntityGolemBase golem) {
// move persistent data to entity
golem.getEntityData().setTag(Gadomancy.MODID, NBTHelper.getPersistentData(itemInHand).copy());
@@ -151,11 +141,10 @@ public void on(PlayerInteractEvent e) {
@SubscribeEvent(priority = EventPriority.HIGHEST, receiveCanceled = true)
public void on(PlaySoundAtEntityEvent event) {
- if (!event.entity.worldObj.isRemote && event.entity instanceof EntityGolemBase
+ if (!event.entity.worldObj.isRemote && event.entity instanceof EntityGolemBase golem
&& event.name.equals("thaumcraft:zap")
&& event.volume == 0.5F
&& event.pitch == 1.0F) {
- EntityGolemBase golem = (EntityGolemBase) event.entity;
if (this.markedGolems.containsKey(golem)) {
EntityPlayer player = this.markedGolems.get(golem);
this.markedGolems.remove(golem);
@@ -210,8 +199,7 @@ public void on(AttackEntityEvent event) {
@SubscribeEvent(priority = EventPriority.NORMAL)
public void on(LivingHurtEvent event) {
if (!event.entity.worldObj.isRemote) {
- if (event.entity instanceof EntityGolemBase) {
- EntityGolemBase golem = (EntityGolemBase) event.entity;
+ if (event.entity instanceof EntityGolemBase golem) {
if (event.ammount > 0 && RegisteredGolemStuff.upgradeRunicShield.hasUpgrade(golem)) {
event.ammount = RegisteredGolemStuff.upgradeRunicShield.absorb(golem, event.ammount, event.source);
}
@@ -229,8 +217,7 @@ public void on(LivingHurtEvent event) {
@SubscribeEvent(priority = EventPriority.LOWEST)
public void on(EntityInteractEvent event) {
ItemStack heldItem = event.entityPlayer.getHeldItem();
- if (event.target instanceof EntityGolemBase) {
- EntityGolemBase golem = (EntityGolemBase) event.target;
+ if (event.target instanceof EntityGolemBase golem) {
if (golem.getCore() < 0) {
if (heldItem != null) {
@@ -275,36 +262,4 @@ public void on(EntityInteractEvent event) {
}
}
}
-
- @SubscribeEvent(priority = EventPriority.LOWEST)
- public void on(ItemTooltipEvent event) {
- if (event.itemStack != null) {
- if (event.itemStack.getItem() instanceof ItemGolemPlacer
- || event.itemStack.getItem() instanceof ItemAdditionalGolemPlacer) {
- if (RegisteredGolemStuff.upgradeRunicShield.hasUpgrade(event.itemStack)) {
- event.toolTip.add(
- "\u00a76" + StatCollector.translateToLocal("item.runic.charge")
- + " +"
- + RegisteredGolemStuff.upgradeRunicShield.getChargeLimit(event.itemStack));
- }
-
- AdditionalGolemCore core = GadomancyApi.getAdditionalGolemCore(event.itemStack);
- if (core != null) {
- String searchStr = StatCollector.translateToLocal("item.ItemGolemCore.name");
- for (int i = 0; i < event.toolTip.size(); i++) {
- String line = event.toolTip.get(i);
- if (line.contains(searchStr)) {
- int index = line.indexOf('\u00a7', searchStr.length()) + 2;
- event.toolTip.remove(i);
- event.toolTip.add(
- i,
- line.substring(0, index)
- + StatCollector.translateToLocal(core.getUnlocalizedName()));
- break;
- }
- }
- }
- }
- }
- }
}
diff --git a/src/main/java/makeo/gadomancy/common/events/EventHandlerTooltips.java b/src/main/java/makeo/gadomancy/common/events/EventHandlerTooltips.java
new file mode 100644
index 0000000..dc9e03b
--- /dev/null
+++ b/src/main/java/makeo/gadomancy/common/events/EventHandlerTooltips.java
@@ -0,0 +1,82 @@
+package makeo.gadomancy.common.events;
+
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTBase;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
+import net.minecraftforge.event.entity.player.ItemTooltipEvent;
+
+import cpw.mods.fml.common.eventhandler.EventPriority;
+import cpw.mods.fml.common.eventhandler.SubscribeEvent;
+import makeo.gadomancy.api.GadomancyApi;
+import makeo.gadomancy.api.golems.cores.AdditionalGolemCore;
+import makeo.gadomancy.common.entities.golems.ItemAdditionalGolemPlacer;
+import makeo.gadomancy.common.registration.RegisteredGolemStuff;
+import makeo.gadomancy.common.utils.NBTHelper;
+import thaumcraft.common.entities.golems.ItemGolemPlacer;
+
+public class EventHandlerTooltips {
+
+ @SubscribeEvent(priority = EventPriority.NORMAL)
+ public void on1(ItemTooltipEvent e) {
+ if (!e.toolTip.isEmpty() && e.itemStack.hasTagCompound()) {
+ if (e.itemStack.stackTagCompound.getBoolean("isStickyJar")) {
+ e.toolTip.add(1, EnumChatFormatting.GREEN + StatCollector.translateToLocal("gadomancy.lore.stickyjar"));
+ }
+ }
+
+ if (!e.toolTip.isEmpty() && NBTHelper.hasPersistentData(e.itemStack)) {
+ NBTTagCompound compound = NBTHelper.getPersistentData(e.itemStack);
+ if (compound.hasKey("disguise")) {
+ NBTBase base = compound.getTag("disguise");
+ String lore = null;
+ if (base instanceof NBTTagCompound) {
+ ItemStack stack = ItemStack.loadItemStackFromNBT((NBTTagCompound) base);
+ if (stack != null) {
+ lore = String.format(
+ StatCollector.translateToLocal("gadomancy.lore.disguise.item"),
+ EnumChatFormatting.getTextWithoutFormattingCodes(stack.getDisplayName()));
+ }
+ } else {
+ lore = StatCollector.translateToLocal("gadomancy.lore.disguise.none");
+ }
+ if (lore != null) {
+ e.toolTip.add(EnumChatFormatting.GREEN + lore);
+ }
+ }
+ }
+ }
+
+ @SubscribeEvent(priority = EventPriority.LOWEST)
+ public void on2(ItemTooltipEvent event) {
+ if (event.itemStack != null) {
+ if (event.itemStack.getItem() instanceof ItemGolemPlacer
+ || event.itemStack.getItem() instanceof ItemAdditionalGolemPlacer) {
+ if (RegisteredGolemStuff.upgradeRunicShield.hasUpgrade(event.itemStack)) {
+ event.toolTip.add(
+ "\u00a76" + StatCollector.translateToLocal("item.runic.charge")
+ + " +"
+ + RegisteredGolemStuff.upgradeRunicShield.getChargeLimit(event.itemStack));
+ }
+
+ AdditionalGolemCore core = GadomancyApi.getAdditionalGolemCore(event.itemStack);
+ if (core != null) {
+ String searchStr = StatCollector.translateToLocal("item.ItemGolemCore.name");
+ for (int i = 0; i < event.toolTip.size(); i++) {
+ String line = event.toolTip.get(i);
+ if (line.contains(searchStr)) {
+ int index = line.indexOf('\u00a7', searchStr.length()) + 2;
+ event.toolTip.remove(i);
+ event.toolTip.add(
+ i,
+ line.substring(0, index)
+ + StatCollector.translateToLocal(core.getUnlocalizedName()));
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/main/java/makeo/gadomancy/common/events/EventHandlerWorld.java b/src/main/java/makeo/gadomancy/common/events/EventHandlerWorld.java
index 7e4fd74..607c9e9 100644
--- a/src/main/java/makeo/gadomancy/common/events/EventHandlerWorld.java
+++ b/src/main/java/makeo/gadomancy/common/events/EventHandlerWorld.java
@@ -17,7 +17,6 @@
import net.minecraft.world.Explosion;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
-import net.minecraftforge.event.entity.player.ItemTooltipEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.event.world.BlockEvent;
import net.minecraftforge.event.world.ExplosionEvent;
@@ -271,30 +270,4 @@ private boolean isStickyJar(ItemStack stack) {
return RegisteredItems.isStickyableJar(stack) && stack.hasTagCompound()
&& stack.stackTagCompound.getBoolean("isStickyJar");
}
-
- @SubscribeEvent(priority = EventPriority.NORMAL)
- public void on(ItemTooltipEvent e) {
- if (!e.toolTip.isEmpty() && e.itemStack.hasTagCompound()) {
- if (e.itemStack.stackTagCompound.getBoolean("isStickyJar")) {
- e.toolTip.add(1, EnumChatFormatting.GREEN + StatCollector.translateToLocal("gadomancy.lore.stickyjar"));
- }
- }
-
- if (!e.toolTip.isEmpty() && NBTHelper.hasPersistentData(e.itemStack)) {
- NBTTagCompound compound = NBTHelper.getPersistentData(e.itemStack);
- if (compound.hasKey("disguise")) {
- NBTBase base = compound.getTag("disguise");
- String lore;
- if (base instanceof NBTTagCompound) {
- ItemStack stack = ItemStack.loadItemStackFromNBT((NBTTagCompound) base);
- lore = String.format(
- StatCollector.translateToLocal("gadomancy.lore.disguise.item"),
- EnumChatFormatting.getTextWithoutFormattingCodes(stack.getDisplayName()));
- } else {
- lore = StatCollector.translateToLocal("gadomancy.lore.disguise.none");
- }
- e.toolTip.add(EnumChatFormatting.GREEN + lore);
- }
- }
- }
}
From 4cc23e5ddca9fb5589d9dd4640f059f36682f267 Mon Sep 17 00:00:00 2001
From: Alexdoru <57050655+Alexdoru@users.noreply.github.com>
Date: Wed, 25 Feb 2026 15:36:30 +0100
Subject: [PATCH 4/7] always register the network event handler
---
src/main/java/makeo/gadomancy/common/CommonProxy.java | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/src/main/java/makeo/gadomancy/common/CommonProxy.java b/src/main/java/makeo/gadomancy/common/CommonProxy.java
index 1c88bba..750de1e 100644
--- a/src/main/java/makeo/gadomancy/common/CommonProxy.java
+++ b/src/main/java/makeo/gadomancy/common/CommonProxy.java
@@ -72,6 +72,7 @@ public void initalize() {
RegisteredEntities.init();
DimensionManager.registerProviderType(ModConfig.dimOuterId, WorldProviderTCEldrich.class, true);
DimensionManager.registerDimension(ModConfig.dimOuterId, ModConfig.dimOuterId);
+ FMLCommonHandler.instance().bus().register(new EventHandlerNetwork());
}
public void postInitalize() {
@@ -127,15 +128,12 @@ public Side getSide() {
}
public EventHandlerGolem EVENT_HANDLER_GOLEM;
- public EventHandlerNetwork EVENT_HANDLER_NETWORK;
public EventHandlerWorld EVENT_HANDLER_WORLD;
public EventHandlerEntity EVENT_HANDLER_ENTITY;
public void onServerAboutToStart(FMLServerAboutToStartEvent event) {
EVENT_HANDLER_GOLEM = new EventHandlerGolem();
MinecraftForge.EVENT_BUS.register(EVENT_HANDLER_GOLEM);
- EVENT_HANDLER_NETWORK = new EventHandlerNetwork();
- FMLCommonHandler.instance().bus().register(EVENT_HANDLER_NETWORK);
EVENT_HANDLER_WORLD = new EventHandlerWorld();
MinecraftForge.EVENT_BUS.register(EVENT_HANDLER_WORLD);
FMLCommonHandler.instance().bus().register(EVENT_HANDLER_WORLD);
@@ -146,8 +144,6 @@ public void onServerAboutToStart(FMLServerAboutToStartEvent event) {
public void onServerStopped(FMLServerStoppedEvent event) {
MinecraftForge.EVENT_BUS.unregister(EVENT_HANDLER_GOLEM);
EVENT_HANDLER_GOLEM = null;
- FMLCommonHandler.instance().bus().unregister(EVENT_HANDLER_NETWORK);
- EVENT_HANDLER_NETWORK = null;
MinecraftForge.EVENT_BUS.unregister(EVENT_HANDLER_WORLD);
FMLCommonHandler.instance().bus().unregister(EVENT_HANDLER_WORLD);
EVENT_HANDLER_WORLD = null;
From b5ff6f32478a02bcd51e42e8b842343c7726f14a Mon Sep 17 00:00:00 2001
From: Alexdoru <57050655+Alexdoru@users.noreply.github.com>
Date: Wed, 25 Feb 2026 15:38:55 +0100
Subject: [PATCH 5/7] split the EventHandlerGolem in two and create
EventHandlerGolemServer
---
.../makeo/gadomancy/common/CommonProxy.java | 14 +--
.../common/events/EventHandlerGolem.java | 68 ---------------
.../events/EventHandlerGolemServer.java | 86 +++++++++++++++++++
.../IntegrationThaumicHorizions.java | 2 +-
4 files changed, 95 insertions(+), 75 deletions(-)
create mode 100644 src/main/java/makeo/gadomancy/common/events/EventHandlerGolemServer.java
diff --git a/src/main/java/makeo/gadomancy/common/CommonProxy.java b/src/main/java/makeo/gadomancy/common/CommonProxy.java
index 750de1e..f54e818 100644
--- a/src/main/java/makeo/gadomancy/common/CommonProxy.java
+++ b/src/main/java/makeo/gadomancy/common/CommonProxy.java
@@ -24,6 +24,7 @@
import makeo.gadomancy.common.data.config.ModConfig;
import makeo.gadomancy.common.events.EventHandlerEntity;
import makeo.gadomancy.common.events.EventHandlerGolem;
+import makeo.gadomancy.common.events.EventHandlerGolemServer;
import makeo.gadomancy.common.events.EventHandlerNetwork;
import makeo.gadomancy.common.events.EventHandlerWorld;
import makeo.gadomancy.common.network.PacketHandler;
@@ -73,6 +74,7 @@ public void initalize() {
DimensionManager.registerProviderType(ModConfig.dimOuterId, WorldProviderTCEldrich.class, true);
DimensionManager.registerDimension(ModConfig.dimOuterId, ModConfig.dimOuterId);
FMLCommonHandler.instance().bus().register(new EventHandlerNetwork());
+ MinecraftForge.EVENT_BUS.register(new EventHandlerGolem());
}
public void postInitalize() {
@@ -127,13 +129,13 @@ public Side getSide() {
return Side.SERVER;
}
- public EventHandlerGolem EVENT_HANDLER_GOLEM;
- public EventHandlerWorld EVENT_HANDLER_WORLD;
+ public EventHandlerGolemServer handlerGolemServer;
+ private EventHandlerWorld EVENT_HANDLER_WORLD;
public EventHandlerEntity EVENT_HANDLER_ENTITY;
public void onServerAboutToStart(FMLServerAboutToStartEvent event) {
- EVENT_HANDLER_GOLEM = new EventHandlerGolem();
- MinecraftForge.EVENT_BUS.register(EVENT_HANDLER_GOLEM);
+ handlerGolemServer = new EventHandlerGolemServer();
+ MinecraftForge.EVENT_BUS.register(handlerGolemServer);
EVENT_HANDLER_WORLD = new EventHandlerWorld();
MinecraftForge.EVENT_BUS.register(EVENT_HANDLER_WORLD);
FMLCommonHandler.instance().bus().register(EVENT_HANDLER_WORLD);
@@ -142,8 +144,8 @@ public void onServerAboutToStart(FMLServerAboutToStartEvent event) {
}
public void onServerStopped(FMLServerStoppedEvent event) {
- MinecraftForge.EVENT_BUS.unregister(EVENT_HANDLER_GOLEM);
- EVENT_HANDLER_GOLEM = null;
+ MinecraftForge.EVENT_BUS.unregister(handlerGolemServer);
+ handlerGolemServer = null;
MinecraftForge.EVENT_BUS.unregister(EVENT_HANDLER_WORLD);
FMLCommonHandler.instance().bus().unregister(EVENT_HANDLER_WORLD);
EVENT_HANDLER_WORLD = null;
diff --git a/src/main/java/makeo/gadomancy/common/events/EventHandlerGolem.java b/src/main/java/makeo/gadomancy/common/events/EventHandlerGolem.java
index 271d882..7aa1e30 100644
--- a/src/main/java/makeo/gadomancy/common/events/EventHandlerGolem.java
+++ b/src/main/java/makeo/gadomancy/common/events/EventHandlerGolem.java
@@ -1,20 +1,13 @@
package makeo.gadomancy.common.events;
-import java.util.HashMap;
-import java.util.Map;
-
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
-import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.EntityEvent;
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
-import net.minecraftforge.event.entity.PlaySoundAtEntityEvent;
import net.minecraftforge.event.entity.living.LivingHurtEvent;
-import net.minecraftforge.event.entity.player.AttackEntityEvent;
import net.minecraftforge.event.entity.player.EntityInteractEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
@@ -23,7 +16,6 @@
import makeo.gadomancy.api.GadomancyApi;
import makeo.gadomancy.api.golems.AdditionalGolemType;
import makeo.gadomancy.api.golems.cores.AdditionalGolemCore;
-import makeo.gadomancy.api.golems.events.GolemDropPlacerEvent;
import makeo.gadomancy.api.golems.events.PlacerCreateGolemEvent;
import makeo.gadomancy.common.Gadomancy;
import makeo.gadomancy.common.data.DataAchromatic;
@@ -48,8 +40,6 @@
*/
public class EventHandlerGolem {
- private final Map