From 25e68bb2c48646be44101212f8156d08d9ab2ad4 Mon Sep 17 00:00:00 2001 From: Sollace Date: Fri, 13 Jul 2018 20:03:01 +0200 Subject: [PATCH] These ended up not being needed --- .../com/minelittlepony/api/events/Armor.java | 48 ------------------- .../minelittlepony/api/events/EventBus.java | 10 ---- .../api/events/IPreArmorEventHandler.java | 15 ------ .../api/events/package-info.java | 7 --- .../render/layer/LayerPonyArmor.java | 7 --- 5 files changed, 87 deletions(-) delete mode 100644 src/main/java/com/minelittlepony/api/events/Armor.java delete mode 100644 src/main/java/com/minelittlepony/api/events/EventBus.java delete mode 100644 src/main/java/com/minelittlepony/api/events/IPreArmorEventHandler.java delete mode 100644 src/main/java/com/minelittlepony/api/events/package-info.java diff --git a/src/main/java/com/minelittlepony/api/events/Armor.java b/src/main/java/com/minelittlepony/api/events/Armor.java deleted file mode 100644 index 83035460..00000000 --- a/src/main/java/com/minelittlepony/api/events/Armor.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.minelittlepony.api.events; - -import java.util.ArrayList; -import java.util.List; - -import com.minelittlepony.model.capabilities.IModelArmor; - -import net.minecraft.client.model.ModelBiped; -import net.minecraft.entity.Entity; -import net.minecraft.inventory.EntityEquipmentSlot; - -class Armor implements EventBus, IPreArmorEventHandler { - - private final List handlers = new ArrayList(); - - @Override - public IPreArmorEventHandler dispatcher() { - return this; - } - - public void addEventListener(IPreArmorEventHandler handler) { - if (handler == this) return; - - handlers.add(handler); - } - - private boolean cancel = false; - - @Override - public boolean preRenderPonyArmor(T armour, Entity entity, float move, float swing, float partialTicks, float ticks, float headYaw, float headPitch, float scale, EntityEquipmentSlot armourSlot) { - if (handlers.size() == 0) return false; - - handlers.forEach(handler -> { - cancel |= handler.preRenderPonyArmor(armour, entity, move, swing, partialTicks, ticks, headYaw, headPitch, scale, armourSlot); - }); - - return cancel; - } - - @Override - public void postRenderPonyArmor(T armour, Entity entity, float move, float swing, float partialTicks, float ticks, float headYaw, float headPitch, float scale, EntityEquipmentSlot armourSlot) { - if (handlers.size() == 0) return; - - handlers.forEach(handler -> { - handler.postRenderPonyArmor(armour, entity, move, swing, partialTicks, ticks, headYaw, headPitch, scale, armourSlot); - }); - } -} diff --git a/src/main/java/com/minelittlepony/api/events/EventBus.java b/src/main/java/com/minelittlepony/api/events/EventBus.java deleted file mode 100644 index 8a4881cf..00000000 --- a/src/main/java/com/minelittlepony/api/events/EventBus.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.minelittlepony.api.events; - -public interface EventBus { - - public static final EventBus ARMOR = new Armor(); - - T dispatcher(); - - void addEventListener(T handler); -} diff --git a/src/main/java/com/minelittlepony/api/events/IPreArmorEventHandler.java b/src/main/java/com/minelittlepony/api/events/IPreArmorEventHandler.java deleted file mode 100644 index a3bb75e9..00000000 --- a/src/main/java/com/minelittlepony/api/events/IPreArmorEventHandler.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.minelittlepony.api.events; - -import com.minelittlepony.model.capabilities.IModelArmor; - -import net.minecraft.client.model.ModelBiped; -import net.minecraft.entity.Entity; -import net.minecraft.inventory.EntityEquipmentSlot; - -public interface IPreArmorEventHandler { - - boolean preRenderPonyArmor(T armour, Entity entity, float move, float swing, float partialTicks, float ticks, float headYaw, float headPitch, float scale, EntityEquipmentSlot armourSlot); - - - void postRenderPonyArmor(T armour, Entity entity, float move, float swing, float partialTicks, float ticks, float headYaw, float headPitch, float scale, EntityEquipmentSlot armourSlot); -} diff --git a/src/main/java/com/minelittlepony/api/events/package-info.java b/src/main/java/com/minelittlepony/api/events/package-info.java deleted file mode 100644 index c5b87a6c..00000000 --- a/src/main/java/com/minelittlepony/api/events/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@MethodsReturnNonnullByDefault -@ParametersAreNonnullByDefault -package com.minelittlepony.api.events; - -import mcp.MethodsReturnNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/src/main/java/com/minelittlepony/render/layer/LayerPonyArmor.java b/src/main/java/com/minelittlepony/render/layer/LayerPonyArmor.java index ba25e5fc..36760cef 100644 --- a/src/main/java/com/minelittlepony/render/layer/LayerPonyArmor.java +++ b/src/main/java/com/minelittlepony/render/layer/LayerPonyArmor.java @@ -2,7 +2,6 @@ package com.minelittlepony.render.layer; import com.google.common.collect.Maps; import com.minelittlepony.ForgeProxy; -import com.minelittlepony.api.events.EventBus; import com.minelittlepony.model.ModelWrapper; import com.minelittlepony.model.armour.IEquestrianArmor; import com.minelittlepony.model.armour.ModelPonyArmor; @@ -69,10 +68,6 @@ public class LayerPonyArmor extends AbstractPonyLaye getRenderer().bindTexture(armors.getFirst()); - if (EventBus.ARMOR.dispatcher().preRenderPonyArmor(armour, entity, move, swing, partialTicks, ticks, headYaw, headPitch, scale, armorSlot)) { - return; - } - if (itemarmor.getArmorMaterial() == ArmorMaterial.LEATHER) { Color.glColor(itemarmor.getColor(itemstack), 1); armour.render(entity, move, swing, ticks, headYaw, headPitch, scale); @@ -86,8 +81,6 @@ public class LayerPonyArmor extends AbstractPonyLaye if (itemstack.isItemEnchanted()) { LayerArmorBase.renderEnchantedGlint(getRenderer(), entity, armour, move, swing, partialTicks, ticks, headYaw, headPitch, scale); } - - EventBus.ARMOR.dispatcher().postRenderPonyArmor(armour, entity, move, swing, partialTicks, ticks, headYaw, headPitch, scale, armorSlot); } }