mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-26 22:38:00 +01:00
These ended up not being needed
This commit is contained in:
parent
0798fa88d3
commit
25e68bb2c4
5 changed files with 0 additions and 87 deletions
|
@ -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>, IPreArmorEventHandler {
|
|
||||||
|
|
||||||
private final List<IPreArmorEventHandler> handlers = new ArrayList<IPreArmorEventHandler>();
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IPreArmorEventHandler dispatcher() {
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addEventListener(IPreArmorEventHandler handler) {
|
|
||||||
if (handler == this) return;
|
|
||||||
|
|
||||||
handlers.add(handler);
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean cancel = false;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public <T extends ModelBiped & IModelArmor> 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 <T extends ModelBiped & IModelArmor> 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);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
package com.minelittlepony.api.events;
|
|
||||||
|
|
||||||
public interface EventBus<T> {
|
|
||||||
|
|
||||||
public static final EventBus<IPreArmorEventHandler> ARMOR = new Armor();
|
|
||||||
|
|
||||||
T dispatcher();
|
|
||||||
|
|
||||||
void addEventListener(T handler);
|
|
||||||
}
|
|
|
@ -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 {
|
|
||||||
<T extends ModelBiped & IModelArmor>
|
|
||||||
boolean preRenderPonyArmor(T armour, Entity entity, float move, float swing, float partialTicks, float ticks, float headYaw, float headPitch, float scale, EntityEquipmentSlot armourSlot);
|
|
||||||
|
|
||||||
<T extends ModelBiped & IModelArmor>
|
|
||||||
void postRenderPonyArmor(T armour, Entity entity, float move, float swing, float partialTicks, float ticks, float headYaw, float headPitch, float scale, EntityEquipmentSlot armourSlot);
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
@MethodsReturnNonnullByDefault
|
|
||||||
@ParametersAreNonnullByDefault
|
|
||||||
package com.minelittlepony.api.events;
|
|
||||||
|
|
||||||
import mcp.MethodsReturnNonnullByDefault;
|
|
||||||
|
|
||||||
import javax.annotation.ParametersAreNonnullByDefault;
|
|
|
@ -2,7 +2,6 @@ package com.minelittlepony.render.layer;
|
||||||
|
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import com.minelittlepony.ForgeProxy;
|
import com.minelittlepony.ForgeProxy;
|
||||||
import com.minelittlepony.api.events.EventBus;
|
|
||||||
import com.minelittlepony.model.ModelWrapper;
|
import com.minelittlepony.model.ModelWrapper;
|
||||||
import com.minelittlepony.model.armour.IEquestrianArmor;
|
import com.minelittlepony.model.armour.IEquestrianArmor;
|
||||||
import com.minelittlepony.model.armour.ModelPonyArmor;
|
import com.minelittlepony.model.armour.ModelPonyArmor;
|
||||||
|
@ -69,10 +68,6 @@ public class LayerPonyArmor<T extends EntityLivingBase> extends AbstractPonyLaye
|
||||||
|
|
||||||
getRenderer().bindTexture(armors.getFirst());
|
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) {
|
if (itemarmor.getArmorMaterial() == ArmorMaterial.LEATHER) {
|
||||||
Color.glColor(itemarmor.getColor(itemstack), 1);
|
Color.glColor(itemarmor.getColor(itemstack), 1);
|
||||||
armour.render(entity, move, swing, ticks, headYaw, headPitch, scale);
|
armour.render(entity, move, swing, ticks, headYaw, headPitch, scale);
|
||||||
|
@ -86,8 +81,6 @@ public class LayerPonyArmor<T extends EntityLivingBase> extends AbstractPonyLaye
|
||||||
if (itemstack.isItemEnchanted()) {
|
if (itemstack.isItemEnchanted()) {
|
||||||
LayerArmorBase.renderEnchantedGlint(getRenderer(), entity, armour, move, swing, partialTicks, ticks, headYaw, headPitch, scale);
|
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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue