New sounds, registry rename

This commit is contained in:
paulevsGitch 2020-10-27 03:16:55 +03:00
parent c609f98ec2
commit 1c03ecb5e3
105 changed files with 1449 additions and 1447 deletions

View file

@ -1,88 +1,88 @@
package ru.betterend.item;
import java.util.function.Supplier;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.item.ArmorMaterial;
import net.minecraft.recipe.Ingredient;
import net.minecraft.sound.SoundEvent;
import net.minecraft.sound.SoundEvents;
import net.minecraft.util.Lazy;
import ru.betterend.registry.ItemRegistry;
public enum EndArmorMaterial implements ArmorMaterial {
TERMINITE("terminite", 26, new int[] { 3, 6, 7, 3 }, 14, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 1.0F, 0.05F, () -> {
return Ingredient.ofItems(ItemRegistry.TERMINITE_INGOT);
}),
AETERNIUM("aeternium", 40, new int[] { 4, 7, 9, 4 }, 18, SoundEvents.ITEM_ARMOR_EQUIP_NETHERITE, 3.5F, 0.2F, () -> {
return Ingredient.ofItems(ItemRegistry.AETERNIUM_INGOT);
});
private static final int[] BASE_DURABILITY = new int[] { 13, 15, 16, 11 };
private final String name;
private final int durabilityMultiplier;
private final int[] protectionAmounts;
private final int enchantability;
private final SoundEvent equipSound;
private final float toughness;
private final float knockbackResistance;
private final Lazy<Ingredient> repairIngredient;
private EndArmorMaterial(String name, int durabilityMultiplier, int[] protectionAmounts, int enchantability,
SoundEvent equipSound, float toughness, float knockbackResistance,
Supplier<Ingredient> repairIngredient) {
this.name = name;
this.durabilityMultiplier = durabilityMultiplier;
this.protectionAmounts = protectionAmounts;
this.enchantability = enchantability;
this.equipSound = equipSound;
this.toughness = toughness;
this.knockbackResistance = knockbackResistance;
this.repairIngredient = new Lazy<>(repairIngredient);
}
@Override
public int getDurability(EquipmentSlot slot) {
return BASE_DURABILITY[slot.getEntitySlotId()] * this.durabilityMultiplier;
}
@Override
public int getProtectionAmount(EquipmentSlot slot) {
return this.protectionAmounts[slot.getEntitySlotId()];
}
@Override
public int getEnchantability() {
return this.enchantability;
}
@Override
public SoundEvent getEquipSound() {
return this.equipSound;
}
@Override
public Ingredient getRepairIngredient() {
return this.repairIngredient.get();
}
@Override
@Environment(EnvType.CLIENT)
public String getName() {
return this.name;
}
@Override
public float getToughness() {
return this.toughness;
}
@Override
public float getKnockbackResistance() {
return this.knockbackResistance;
}
}
package ru.betterend.item;
import java.util.function.Supplier;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.item.ArmorMaterial;
import net.minecraft.recipe.Ingredient;
import net.minecraft.sound.SoundEvent;
import net.minecraft.sound.SoundEvents;
import net.minecraft.util.Lazy;
import ru.betterend.registry.EndItems;
public enum EndArmorMaterial implements ArmorMaterial {
TERMINITE("terminite", 26, new int[] { 3, 6, 7, 3 }, 14, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 1.0F, 0.05F, () -> {
return Ingredient.ofItems(EndItems.TERMINITE_INGOT);
}),
AETERNIUM("aeternium", 40, new int[] { 4, 7, 9, 4 }, 18, SoundEvents.ITEM_ARMOR_EQUIP_NETHERITE, 3.5F, 0.2F, () -> {
return Ingredient.ofItems(EndItems.AETERNIUM_INGOT);
});
private static final int[] BASE_DURABILITY = new int[] { 13, 15, 16, 11 };
private final String name;
private final int durabilityMultiplier;
private final int[] protectionAmounts;
private final int enchantability;
private final SoundEvent equipSound;
private final float toughness;
private final float knockbackResistance;
private final Lazy<Ingredient> repairIngredient;
private EndArmorMaterial(String name, int durabilityMultiplier, int[] protectionAmounts, int enchantability,
SoundEvent equipSound, float toughness, float knockbackResistance,
Supplier<Ingredient> repairIngredient) {
this.name = name;
this.durabilityMultiplier = durabilityMultiplier;
this.protectionAmounts = protectionAmounts;
this.enchantability = enchantability;
this.equipSound = equipSound;
this.toughness = toughness;
this.knockbackResistance = knockbackResistance;
this.repairIngredient = new Lazy<>(repairIngredient);
}
@Override
public int getDurability(EquipmentSlot slot) {
return BASE_DURABILITY[slot.getEntitySlotId()] * this.durabilityMultiplier;
}
@Override
public int getProtectionAmount(EquipmentSlot slot) {
return this.protectionAmounts[slot.getEntitySlotId()];
}
@Override
public int getEnchantability() {
return this.enchantability;
}
@Override
public SoundEvent getEquipSound() {
return this.equipSound;
}
@Override
public Ingredient getRepairIngredient() {
return this.repairIngredient.get();
}
@Override
@Environment(EnvType.CLIENT)
public String getName() {
return this.name;
}
@Override
public float getToughness() {
return this.toughness;
}
@Override
public float getKnockbackResistance() {
return this.knockbackResistance;
}
}

View file

@ -26,7 +26,7 @@ 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.registry.ItemTagRegistry;
import ru.betterend.registry.EndTags;
public class EndHammer extends MiningToolItem implements DynamicAttributeTool {
@ -93,7 +93,7 @@ public class EndHammer extends MiningToolItem implements DynamicAttributeTool {
@Override
public float getMiningSpeedMultiplier(Tag<Item> tag, BlockState state, ItemStack stack, LivingEntity user) {
if (tag.equals(ItemTagRegistry.HAMMERS)) {
if (tag.equals(EndTags.HAMMERS)) {
return this.getMiningSpeedMultiplier(stack, state);
}
return 1.0F;
@ -101,7 +101,7 @@ public class EndHammer extends MiningToolItem implements DynamicAttributeTool {
@Override
public int getMiningLevel(Tag<Item> tag, BlockState state, ItemStack stack, LivingEntity user) {
if (tag.equals(ItemTagRegistry.HAMMERS)) {
if (tag.equals(EndTags.HAMMERS)) {
return this.getMaterial().getMiningLevel();
}
return 0;

View file

@ -1,66 +1,66 @@
package ru.betterend.item;
import java.util.function.Supplier;
import net.minecraft.item.ToolMaterial;
import net.minecraft.recipe.Ingredient;
import net.minecraft.util.Lazy;
import ru.betterend.registry.ItemRegistry;
public enum EndToolMaterial implements ToolMaterial {
TERMINITE(3, 1230, 8.5F, 3.0F, 14, () -> {
return Ingredient.ofItems(ItemRegistry.TERMINITE_INGOT);
}),
AETERNIUM(5, 2196, 10.0F, 4.5F, 18, () -> {
return Ingredient.ofItems(ItemRegistry.AETERNIUM_INGOT);
});
private final int durability;
private final float miningSpeed;
private final float attackDamage;
private final int miningLevel;
private final int enchantability;
private final Lazy<Ingredient> repairIngredient;
private EndToolMaterial(int miningLevel, int durability, float miningSpeed, float attackDamage, int enchantability,
Supplier<Ingredient> repairIngredient) {
this.durability = durability;
this.miningSpeed = miningSpeed;
this.attackDamage = attackDamage;
this.miningLevel = miningLevel;
this.enchantability = enchantability;
this.repairIngredient = new Lazy<>(repairIngredient);
}
@Override
public int getDurability() {
return this.durability;
}
@Override
public float getMiningSpeedMultiplier() {
return this.miningSpeed;
}
@Override
public float getAttackDamage() {
return this.attackDamage;
}
@Override
public int getMiningLevel() {
return this.miningLevel;
}
@Override
public int getEnchantability() {
return this.enchantability;
}
@Override
public Ingredient getRepairIngredient() {
return this.repairIngredient.get();
}
}
package ru.betterend.item;
import java.util.function.Supplier;
import net.minecraft.item.ToolMaterial;
import net.minecraft.recipe.Ingredient;
import net.minecraft.util.Lazy;
import ru.betterend.registry.EndItems;
public enum EndToolMaterial implements ToolMaterial {
TERMINITE(3, 1230, 8.5F, 3.0F, 14, () -> {
return Ingredient.ofItems(EndItems.TERMINITE_INGOT);
}),
AETERNIUM(5, 2196, 10.0F, 4.5F, 18, () -> {
return Ingredient.ofItems(EndItems.AETERNIUM_INGOT);
});
private final int durability;
private final float miningSpeed;
private final float attackDamage;
private final int miningLevel;
private final int enchantability;
private final Lazy<Ingredient> repairIngredient;
private EndToolMaterial(int miningLevel, int durability, float miningSpeed, float attackDamage, int enchantability,
Supplier<Ingredient> repairIngredient) {
this.durability = durability;
this.miningSpeed = miningSpeed;
this.attackDamage = attackDamage;
this.miningLevel = miningLevel;
this.enchantability = enchantability;
this.repairIngredient = new Lazy<>(repairIngredient);
}
@Override
public int getDurability() {
return this.durability;
}
@Override
public float getMiningSpeedMultiplier() {
return this.miningSpeed;
}
@Override
public float getAttackDamage() {
return this.attackDamage;
}
@Override
public int getMiningLevel() {
return this.miningLevel;
}
@Override
public int getEnchantability() {
return this.enchantability;
}
@Override
public Ingredient getRepairIngredient() {
return this.repairIngredient.get();
}
}

View file

@ -10,14 +10,14 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import ru.betterend.blocks.EternalPedestal;
import ru.betterend.blocks.RunedFlavolite;
import ru.betterend.registry.ItemRegistry;
import ru.betterend.registry.EndItems;
import ru.betterend.util.BlocksHelper;
import ru.betterend.util.PortalFrameHelper;
public class EternalCrystal extends Item {
public EternalCrystal() {
super(ItemRegistry.makeSettings());
super(EndItems.makeSettings());
}
public ActionResult useOnBlock(ItemUsageContext context) {