Item model patterns
This commit is contained in:
parent
73a0cb890c
commit
d9a60fc7f2
15 changed files with 48 additions and 50 deletions
|
@ -9,8 +9,10 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ToolMaterial;
|
||||
import net.minecraft.tag.Tag;
|
||||
import ru.betterend.patterns.Patterned;
|
||||
import ru.betterend.patterns.Patterns;
|
||||
|
||||
public class EndAxe extends AxeItem implements DynamicAttributeTool {
|
||||
public class EndAxe extends AxeItem implements DynamicAttributeTool, Patterned {
|
||||
|
||||
public EndAxe(ToolMaterial material, float attackDamage, float attackSpeed, Settings settings) {
|
||||
super(material, attackDamage, attackSpeed, settings);
|
||||
|
@ -23,4 +25,9 @@ public class EndAxe extends AxeItem implements DynamicAttributeTool {
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModelPattern(String name) {
|
||||
return Patterns.createJson(Patterns.ITEM_HANDHELD, name);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,9 +26,11 @@ import net.minecraft.tag.Tag;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import ru.betterend.patterns.Patterned;
|
||||
import ru.betterend.patterns.Patterns;
|
||||
import ru.betterend.registry.EndTags;
|
||||
|
||||
public class EndHammer extends MiningToolItem implements DynamicAttributeTool {
|
||||
public class EndHammer extends MiningToolItem implements DynamicAttributeTool, Patterned {
|
||||
|
||||
public final static UUID ATTACK_KNOCKBACK_MODIFIER_ID = MathHelper.randomUuid(ThreadLocalRandom.current());
|
||||
|
||||
|
@ -132,4 +134,9 @@ public class EndHammer extends MiningToolItem implements DynamicAttributeTool {
|
|||
public Multimap<EntityAttribute, EntityAttributeModifier> getAttributeModifiers(EquipmentSlot slot) {
|
||||
return slot == EquipmentSlot.MAINHAND ? this.attributeModifiers : super.getAttributeModifiers(slot);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModelPattern(String name) {
|
||||
return Patterns.createJson(Patterns.ITEM_HANDHELD, name);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,10 +2,17 @@ package ru.betterend.item;
|
|||
|
||||
import net.minecraft.item.HoeItem;
|
||||
import net.minecraft.item.ToolMaterial;
|
||||
import ru.betterend.patterns.Patterned;
|
||||
import ru.betterend.patterns.Patterns;
|
||||
|
||||
public class EndHoe extends HoeItem {
|
||||
public class EndHoe extends HoeItem implements Patterned {
|
||||
|
||||
public EndHoe(ToolMaterial material, int attackDamage, float attackSpeed, Settings settings) {
|
||||
super(material, attackDamage, attackSpeed, settings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModelPattern(String name) {
|
||||
return Patterns.createJson(Patterns.ITEM_HANDHELD, name);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,8 +9,10 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.item.PickaxeItem;
|
||||
import net.minecraft.item.ToolMaterial;
|
||||
import net.minecraft.tag.Tag;
|
||||
import ru.betterend.patterns.Patterned;
|
||||
import ru.betterend.patterns.Patterns;
|
||||
|
||||
public class EndPickaxe extends PickaxeItem implements DynamicAttributeTool {
|
||||
public class EndPickaxe extends PickaxeItem implements DynamicAttributeTool, Patterned {
|
||||
|
||||
public EndPickaxe(ToolMaterial material, int attackDamage, float attackSpeed, Settings settings) {
|
||||
super(material, attackDamage, attackSpeed, settings);
|
||||
|
@ -23,4 +25,9 @@ public class EndPickaxe extends PickaxeItem implements DynamicAttributeTool {
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModelPattern(String name) {
|
||||
return Patterns.createJson(Patterns.ITEM_HANDHELD, name);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue