Fixed missing imports in items

This commit is contained in:
thedarkcolour 2026-04-06 19:59:06 -07:00
parent 2fc91263ee
commit 382e5c359a
3 changed files with 12 additions and 12 deletions

View File

@ -20,15 +20,18 @@ package thedarkcolour.exdeorum.item;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.component.Consumable;
import thedarkcolour.exdeorum.registry.ESounds;
public class CookedSilkwormItem extends Item {
public class CookedSilkwormItem extends Item implements Consumable.OverrideConsumeSound {
public CookedSilkwormItem(Properties properties) {
super(properties);
}
// Yummy silk worms :)
public SoundEvent getEatingSound() {
@Override
public SoundEvent getConsumeSound(ItemStack stack) {
return ESounds.SILK_WORM_EAT.get();
}
}

View File

@ -22,6 +22,7 @@ import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.ToolMaterial;
import net.minecraft.world.item.crafting.RecipeType;
import net.minecraft.world.level.block.entity.FuelValues;
import org.jetbrains.annotations.Nullable;
import thedarkcolour.exdeorum.registry.EItems;
import thedarkcolour.exdeorum.tag.EBlockTags;
@ -31,7 +32,8 @@ public class HammerItem extends Item {
super(material.applyToolProperties(properties, EBlockTags.MINEABLE_WITH_HAMMER, 1.5f, -2.8f, 0f));
}
public int getBurnTime(ItemStack stack, @Nullable RecipeType<?> recipeType) {
@Override
public int getBurnTime(ItemStack stack, @Nullable RecipeType<?> recipeType, FuelValues fuelValues) {
return (this == EItems.WOODEN_HAMMER.get() || this == EItems.COMPRESSED_WOODEN_HAMMER.get()) ? 200 : 0;
}
}

View File

@ -19,26 +19,21 @@
package thedarkcolour.exdeorum.item;
import net.minecraft.core.Holder;
import net.minecraft.core.component.DataComponents;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.enchantment.Enchantable;
import net.minecraft.world.item.enchantment.Enchantment;
import net.minecraft.world.item.enchantment.Enchantments;
public class MeshItem extends Item {
public MeshItem(Properties properties) {
super(properties);
super(properties.component(DataComponents.ENCHANTABLE, new Enchantable(10)));
}
@Override
public boolean isPrimaryItemFor(ItemStack stack, Holder<Enchantment> enchantment) {
var key = enchantment.getKey();
return key == Enchantments.EFFICIENCY || key == Enchantments.FORTUNE;
}
public boolean isEnchantable(ItemStack stack) {
return true;
}
public int getEnchantmentValue() {
return 10;
}
}