-
Notifications
You must be signed in to change notification settings - Fork 756
/
MultilayerArmorItem.java
39 lines (34 loc) · 1.42 KB
/
MultilayerArmorItem.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package slimeknights.tconstruct.library.tools.item.armor;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.client.extensions.common.IClientItemExtensions;
import slimeknights.tconstruct.library.client.armor.ArmorModelManager.ArmorModelDispatcher;
import slimeknights.tconstruct.library.tools.definition.ModifiableArmorMaterial;
import slimeknights.tconstruct.library.tools.helper.ArmorUtil;
import slimeknights.tconstruct.tools.item.ArmorSlotType;
import javax.annotation.Nullable;
import java.util.function.Consumer;
/** Armor model that applies multiple texture layers in order */
public class MultilayerArmorItem extends ModifiableArmorItem {
private final ResourceLocation name;
public MultilayerArmorItem(ModifiableArmorMaterial material, ArmorSlotType slot, Properties properties) {
super(material, slot, properties);
this.name = material.getId();
}
@Nullable
@Override
public String getArmorTexture(ItemStack stack, Entity entity, EquipmentSlot slot, String type) {
return ArmorUtil.getDummyArmorTexture(slot);
}
@Override
public void initializeClient(Consumer<IClientItemExtensions> consumer) {
consumer.accept(new ArmorModelDispatcher() {
@Override
protected ResourceLocation getName() {
return name;
}
});
}
}