Skip to content

Commit

Permalink
试图修复鱼筋工具用一下就爆
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhuRuoLing committed Sep 29, 2024
1 parent e2c49bc commit bb36470
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
package dev.dubhe.anvilcraft.item;

import net.minecraft.core.component.DataComponents;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.component.Unbreakable;

public class EmberAnvilHammerItem extends AnvilHammerItem {
/**
* 初始化铁砧锤
*
* @param properties 物品属性
*/
public EmberAnvilHammerItem(Properties properties) {
super(properties.durability(0));
super(
properties.durability(0)
.component(DataComponents.UNBREAKABLE, new Unbreakable(true))
);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
package dev.dubhe.anvilcraft.item;

import net.minecraft.core.component.DataComponents;
import net.minecraft.world.item.AxeItem;
import net.minecraft.world.item.component.Unbreakable;

public class EmberMetalAxeItem extends AxeItem {
/**
*
*/
public EmberMetalAxeItem(Properties properties) {
super(
ModTiers.EMBER_METAL,
properties.durability(0).attributes(AxeItem.createAttributes(ModTiers.AMETHYST, 10, -3f)));
ModTiers.EMBER_METAL,
properties.durability(0)
.attributes(AxeItem.createAttributes(ModTiers.AMETHYST, 10, -3f))
.component(DataComponents.UNBREAKABLE, new Unbreakable(true))
);
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
package dev.dubhe.anvilcraft.item;

import net.minecraft.core.component.DataComponents;
import net.minecraft.world.item.AxeItem;
import net.minecraft.world.item.HoeItem;
import net.minecraft.world.item.component.Unbreakable;

public class EmberMetalHoeItem extends HoeItem {
/**
*
*/
public EmberMetalHoeItem(Properties properties) {
super(
ModTiers.EMBER_METAL,
properties.durability(0).attributes(AxeItem.createAttributes(ModTiers.EMBER_METAL, 1, 0)));
ModTiers.EMBER_METAL,
properties.durability(0)
.attributes(HoeItem.createAttributes(ModTiers.EMBER_METAL, 1, 0))
.component(DataComponents.UNBREAKABLE, new Unbreakable(true))
);
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
package dev.dubhe.anvilcraft.item;

import net.minecraft.core.component.DataComponents;
import net.minecraft.world.item.AxeItem;
import net.minecraft.world.item.PickaxeItem;
import net.minecraft.world.item.component.Unbreakable;

public class EmberMetalPickaxeItem extends PickaxeItem {
/**
*
*/
public EmberMetalPickaxeItem(Properties properties) {
super(
ModTiers.EMBER_METAL,
properties.durability(0).attributes(AxeItem.createAttributes(ModTiers.EMBER_METAL, 6, -2.8f)));
ModTiers.EMBER_METAL,
properties.durability(0)
.attributes(AxeItem.createAttributes(ModTiers.EMBER_METAL, 6, -2.8f))
.component(DataComponents.UNBREAKABLE, new Unbreakable(true))
);
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
package dev.dubhe.anvilcraft.item;

import net.minecraft.core.component.DataComponents;
import net.minecraft.world.item.AxeItem;
import net.minecraft.world.item.ShovelItem;
import net.minecraft.world.item.component.Unbreakable;

public class EmberMetalShovelItem extends ShovelItem {
/**
*
*/
public EmberMetalShovelItem(Properties properties) {
super(
ModTiers.EMBER_METAL,
properties.durability(0).attributes(AxeItem.createAttributes(ModTiers.EMBER_METAL, 6.5f, -3f)));
ModTiers.EMBER_METAL,
properties.durability(0)
.attributes(ShovelItem.createAttributes(ModTiers.EMBER_METAL, 6.5f, -3f))
.component(DataComponents.UNBREAKABLE, new Unbreakable(true))
);
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
package dev.dubhe.anvilcraft.item;

import net.minecraft.core.component.DataComponents;
import net.minecraft.world.item.AxeItem;
import net.minecraft.world.item.SwordItem;
import net.minecraft.world.item.component.Unbreakable;

public class EmberMetalSwordItem extends SwordItem {
/**
*
*/
public EmberMetalSwordItem(Properties properties) {
super(
ModTiers.EMBER_METAL,
properties.durability(0).attributes(AxeItem.createAttributes(ModTiers.EMBER_METAL, 8, -2.4f)));
ModTiers.EMBER_METAL,
properties.durability(0)
.attributes(AxeItem.createAttributes(ModTiers.EMBER_METAL, 8, -2.4f))
.component(DataComponents.UNBREAKABLE, new Unbreakable(true))
);
}
}

0 comments on commit bb36470

Please sign in to comment.