mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 16:27:47 +00:00
This commit is contained in:
1 parent
61a16066e5
commit
adf3c7164a
11 files changed
+278
-5
No files matched your search
@@ -75,6 +75,8 @@ import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.client.settings.GameSettings;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.passive.EntityHorse;
|
||||
import net.minecraft.entity.passive.HorseArmorType;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.EntityEquipmentSlot;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -754,4 +756,11 @@ public class ForgeHooksClient
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.post(new InputUpdateEvent(player, movementInput));
|
||||
}
|
||||
|
||||
public static String getHorseArmorTexture(EntityHorse horse, ItemStack armorStack)
|
||||
{
|
||||
String texture = armorStack.getItem().getHorseArmorTexture(horse, armorStack);
|
||||
if(texture == null) texture = horse.getHorseArmorType().getTextureName();
|
||||
return texture;
|
||||
}
|
||||
}
|
||||
@@ -34,6 +34,7 @@ import net.minecraft.enchantment.EnumEnchantmentType;
|
||||
import net.minecraft.entity.EnumCreatureAttribute;
|
||||
import net.minecraft.entity.EnumCreatureType;
|
||||
import net.minecraft.entity.item.EntityPainting.EnumArt;
|
||||
import net.minecraft.entity.passive.HorseArmorType;
|
||||
import net.minecraft.entity.player.EntityPlayer.SleepResult;
|
||||
import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
@@ -74,7 +75,8 @@ public class EnumHelper
|
||||
{EnumSkyBlock.class, int.class},
|
||||
{SleepResult.class},
|
||||
{ToolMaterial.class, int.class, int.class, float.class, float.class, int.class},
|
||||
{EnumRarity.class, TextFormatting.class, String.class}
|
||||
{EnumRarity.class, TextFormatting.class, String.class},
|
||||
{HorseArmorType.class, String.class, int.class}
|
||||
};
|
||||
|
||||
@Nullable
|
||||
@@ -143,6 +145,19 @@ public class EnumHelper
|
||||
return addEnum(EnumRarity.class, name, color, displayName);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param name the name of the new {@code HorseArmorType}
|
||||
* @param textureLocation the path to the texture for this armor type. It must follow the format domain:path and be relative to the assets folder.
|
||||
* @param armorStrength how much protection this armor type should give
|
||||
* @return the new {@code HorseArmorType}, or null if it could not be created
|
||||
*/
|
||||
@Nullable
|
||||
public static HorseArmorType addHorseArmor(String name, String textureLocation, int armorStrength)
|
||||
{
|
||||
return addEnum(HorseArmorType.class, name, textureLocation, armorStrength);
|
||||
}
|
||||
|
||||
private static void setup()
|
||||
{
|
||||
if (isSetup)
|
||||
|
||||
Reference in new issue
Block a user