mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-13 16:24:23 +01:00
Rename PonyArmors to be more obvious that it wraps ForgeHooks.
This commit is contained in:
parent
f626345e8c
commit
3b5b4bf011
6 changed files with 14 additions and 11 deletions
|
@ -1,18 +1,21 @@
|
||||||
package com.minelittlepony;
|
package com.minelittlepony;
|
||||||
|
|
||||||
import com.minelittlepony.forge.IPonyArmor;
|
import com.minelittlepony.forge.IForgeHooks;
|
||||||
import com.minelittlepony.forge.MLPCommonProxy;
|
import com.minelittlepony.forge.MLPCommonProxy;
|
||||||
|
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
public class ProxyContainer extends MLPCommonProxy {
|
public class ProxyContainer extends MLPCommonProxy {
|
||||||
|
|
||||||
private IPonyArmor ponyArmors;
|
private IForgeHooks ponyArmors;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setPonyArmors(IPonyArmor armors) {
|
public void setForgeHooks(IForgeHooks armors) {
|
||||||
this.ponyArmors = armors;
|
this.ponyArmors = armors;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IPonyArmor getPonyArmors() {
|
@Nullable
|
||||||
|
public IForgeHooks getHooks() {
|
||||||
return ponyArmors;
|
return ponyArmors;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraftforge.client.ForgeHooksClient;
|
import net.minecraftforge.client.ForgeHooksClient;
|
||||||
|
|
||||||
public class PonyArmors implements IPonyArmor {
|
public class ForgePonyHooks implements IForgeHooks {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getArmorTexture(EntityLivingBase entity, ItemStack armor, String def, int slot, String type) {
|
public String getArmorTexture(EntityLivingBase entity, ItemStack armor, String def, int slot, String type) {
|
|
@ -4,7 +4,7 @@ import net.minecraft.client.model.ModelBase;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
public interface IPonyArmor {
|
public interface IForgeHooks {
|
||||||
|
|
||||||
String getArmorTexture(EntityLivingBase e, ItemStack item, String def, int slot, String type);
|
String getArmorTexture(EntityLivingBase e, ItemStack item, String def, int slot, String type);
|
||||||
|
|
|
@ -12,5 +12,5 @@ public abstract class MLPCommonProxy {
|
||||||
instance = this;
|
instance = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract void setPonyArmors(IPonyArmor armors);
|
public abstract void setForgeHooks(IForgeHooks armors);
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,6 @@ public class MLPForge {
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void init(FMLPostInitializationEvent init) {
|
public void init(FMLPostInitializationEvent init) {
|
||||||
MLPCommonProxy.getInstance().setPonyArmors(new PonyArmors());
|
MLPCommonProxy.getInstance().setForgeHooks(new ForgePonyHooks());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ package com.minelittlepony.renderer.layer;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import com.minelittlepony.MineLittlePony;
|
import com.minelittlepony.MineLittlePony;
|
||||||
import com.minelittlepony.ducks.IRenderPony;
|
import com.minelittlepony.ducks.IRenderPony;
|
||||||
import com.minelittlepony.forge.IPonyArmor;
|
import com.minelittlepony.forge.IForgeHooks;
|
||||||
import com.minelittlepony.model.AbstractPonyModel;
|
import com.minelittlepony.model.AbstractPonyModel;
|
||||||
import com.minelittlepony.model.PlayerModel;
|
import com.minelittlepony.model.PlayerModel;
|
||||||
import com.minelittlepony.model.pony.ModelHumanPlayer;
|
import com.minelittlepony.model.pony.ModelHumanPlayer;
|
||||||
|
@ -205,7 +205,7 @@ public class LayerPonyArmor implements LayerRenderer<EntityLivingBase> {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String getArmorTexture(EntityLivingBase entity, ItemStack item, String def, int slot, String type) {
|
private static String getArmorTexture(EntityLivingBase entity, ItemStack item, String def, int slot, String type) {
|
||||||
IPonyArmor armor = MineLittlePony.getProxy().getPonyArmors();
|
IForgeHooks armor = MineLittlePony.getProxy().getHooks();
|
||||||
if (armor != null) {
|
if (armor != null) {
|
||||||
return armor.getArmorTexture(entity, item, def, slot, type);
|
return armor.getArmorTexture(entity, item, def, slot, type);
|
||||||
}
|
}
|
||||||
|
@ -213,7 +213,7 @@ public class LayerPonyArmor implements LayerRenderer<EntityLivingBase> {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static AbstractPonyModel getArmorModel(EntityLivingBase entity, ItemStack itemstack, int slot, AbstractPonyModel def) {
|
private static AbstractPonyModel getArmorModel(EntityLivingBase entity, ItemStack itemstack, int slot, AbstractPonyModel def) {
|
||||||
IPonyArmor armor = MineLittlePony.getProxy().getPonyArmors();
|
IForgeHooks armor = MineLittlePony.getProxy().getHooks();
|
||||||
if (armor != null) {
|
if (armor != null) {
|
||||||
ModelBase model = armor.getArmorModel(entity, itemstack, slot, def);
|
ModelBase model = armor.getArmorModel(entity, itemstack, slot, def);
|
||||||
if (model instanceof ModelPonyArmor) {
|
if (model instanceof ModelPonyArmor) {
|
||||||
|
|
Loading…
Reference in a new issue