Removed color provider

This commit is contained in:
paulevsGitch 2021-07-10 16:25:34 +03:00
parent 2c8862a37b
commit 4040597a6d
475 changed files with 5411 additions and 7521 deletions

View file

@ -19,58 +19,53 @@ import ru.betterend.interfaces.MultiModelItem;
import ru.betterend.registry.EndItems;
public class ArmoredElytra extends BaseArmorItem implements MultiModelItem, FallFlyingItem {
private final ResourceLocation wingTexture;
private final Item repairItem;
private final double movementFactor;
private final float toughness;
private final int defense;
public ArmoredElytra(String name, ArmorMaterial material, Item repairItem, int durability, double movementFactor, boolean fireproof) {
super(material, EquipmentSlot.CHEST, fireproof ?
EndItems.makeEndItemSettings().durability(durability).rarity(Rarity.EPIC).fireResistant() :
EndItems.makeEndItemSettings().durability(durability).rarity(Rarity.EPIC));
super(material, EquipmentSlot.CHEST, fireproof ? EndItems.makeEndItemSettings().durability(durability).rarity(Rarity.EPIC).fireResistant() : EndItems.makeEndItemSettings().durability(durability).rarity(Rarity.EPIC));
this.wingTexture = BetterEnd.makeID("textures/entity/" + name + ".png");
this.repairItem = repairItem;
this.movementFactor = movementFactor;
this.defense = (int) ((double) material.getDefenseForSlot(EquipmentSlot.CHEST) / 1.75);
this.toughness = material.getToughness() / 1.75F;
addAttributeModifier(Attributes.ARMOR, new AttributeModifier(ARMOR_MODIFIER_UUID_PER_SLOT[2],
"Armor modifier", defense, AttributeModifier.Operation.ADDITION));
addAttributeModifier(Attributes.ARMOR_TOUGHNESS, new AttributeModifier(ARMOR_MODIFIER_UUID_PER_SLOT[2],
"Armor toughness", toughness, AttributeModifier.Operation.ADDITION));
addAttributeModifier(Attributes.ARMOR, new AttributeModifier(ARMOR_MODIFIER_UUID_PER_SLOT[2], "Armor modifier", defense, AttributeModifier.Operation.ADDITION));
addAttributeModifier(Attributes.ARMOR_TOUGHNESS, new AttributeModifier(ARMOR_MODIFIER_UUID_PER_SLOT[2], "Armor toughness", toughness, AttributeModifier.Operation.ADDITION));
}
@Override
public double getMovementFactor() {
return movementFactor;
}
@Override
@Environment(EnvType.CLIENT)
public ResourceLocation getModelTexture() {
return wingTexture;
}
@Override
public boolean isValidRepairItem(ItemStack itemStack, ItemStack itemStack2) {
return super.isValidRepairItem(itemStack, itemStack2) || itemStack2.getItem() == repairItem;
}
@Override
public int getDefense() {
return defense;
}
@Override
public float getToughness() {
return toughness;
}
@Override
@Environment(EnvType.CLIENT)
public void registerModelPredicate() {
FabricModelPredicateProviderRegistry.register(this, new ResourceLocation("broken"),
(itemStack, clientLevel, livingEntity, id) -> ElytraItem.isFlyEnabled(itemStack) ? 0.0F : 1.0F);
FabricModelPredicateProviderRegistry.register(this, new ResourceLocation("broken"), (itemStack, clientLevel, livingEntity, id) -> ElytraItem.isFlyEnabled(itemStack) ? 0.0F : 1.0F);
}
}