-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7bad363
commit c0182b9
Showing
30 changed files
with
297 additions
and
271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
package dev.dubhe.anvilcraft.item; | ||
|
||
import dev.dubhe.anvilcraft.init.ModEnchantments; | ||
import net.minecraft.world.item.AxeItem; | ||
import net.minecraft.world.item.HoeItem; | ||
import net.minecraft.world.item.ItemStack; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class AmethystHoeItem extends HoeItem { | ||
public AmethystHoeItem(Properties properties) { | ||
super(ModTiers.AMETHYST, -1, -2.0f, properties); | ||
super(ModTiers.AMETHYST, properties.attributes(AxeItem.createAttributes( | ||
ModTiers.AMETHYST, -1, -2.0f | ||
))); | ||
} | ||
|
||
@Override | ||
public @NotNull ItemStack getDefaultInstance() { | ||
ItemStack stack = super.getDefaultInstance(); | ||
stack.enchant(ModEnchantments.HARVEST, 1); | ||
stack.enchant(ModEnchantments.HARVEST.get(), 1); | ||
return stack; | ||
} | ||
} |
25 changes: 17 additions & 8 deletions
25
src/main/java/dev/dubhe/anvilcraft/item/AmethystPickaxeItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,48 @@ | ||
package dev.dubhe.anvilcraft.item; | ||
|
||
import net.minecraft.ChatFormatting; | ||
import net.minecraft.MethodsReturnNonnullByDefault; | ||
import net.minecraft.network.chat.Component; | ||
import net.minecraft.world.item.AxeItem; | ||
import net.minecraft.world.item.ItemStack; | ||
import net.minecraft.world.item.PickaxeItem; | ||
import net.minecraft.world.item.Tiers; | ||
import net.minecraft.world.item.TooltipFlag; | ||
import net.minecraft.world.item.enchantment.Enchantments; | ||
import net.minecraft.world.level.Level; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import javax.annotation.ParametersAreNonnullByDefault; | ||
import java.util.List; | ||
|
||
@ParametersAreNonnullByDefault | ||
@MethodsReturnNonnullByDefault | ||
public class AmethystPickaxeItem extends PickaxeItem { | ||
public AmethystPickaxeItem(Properties properties) { | ||
super(ModTiers.AMETHYST, 1, -2.8f, properties); | ||
super(ModTiers.AMETHYST, properties.attributes(AxeItem.createAttributes( | ||
ModTiers.AMETHYST, 1, -2.8f | ||
))); | ||
} | ||
|
||
@Override | ||
public void appendHoverText( | ||
@NotNull ItemStack stack, | ||
@Nullable Level level, | ||
@NotNull List<Component> tooltipComponents, | ||
@NotNull TooltipFlag isAdvanced | ||
ItemStack pStack, | ||
TooltipContext pContext, | ||
List<Component> pTooltipComponents, | ||
TooltipFlag pTooltipFlag | ||
) { | ||
super.appendHoverText(stack, level, tooltipComponents, isAdvanced); | ||
tooltipComponents | ||
super.appendHoverText(pStack, pContext, pTooltipComponents, pTooltipFlag); | ||
pTooltipComponents | ||
.add(Component.translatable("item.anvilcraft.amethyst_pickaxe.tooltip") | ||
.withStyle(ChatFormatting.GRAY)); | ||
} | ||
|
||
|
||
@Override | ||
public @NotNull ItemStack getDefaultInstance() { | ||
ItemStack stack = super.getDefaultInstance(); | ||
stack.enchant(Enchantments.BLOCK_FORTUNE, 3); | ||
stack.enchant(Enchantments.FORTUNE, 3); | ||
return stack; | ||
} | ||
} |
6 changes: 5 additions & 1 deletion
6
src/main/java/dev/dubhe/anvilcraft/item/AmethystShovelItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 5 additions & 1 deletion
6
src/main/java/dev/dubhe/anvilcraft/item/AmethystSwordItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.