ActuallyAdditions/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemShovelAA.java

60 lines
2.3 KiB
Java
Raw Normal View History

2016-03-19 11:36:17 +01:00
/*
2016-05-16 22:52:27 +02:00
* This file ("ItemShovelAA.java") is part of the Actually Additions mod for Minecraft.
2016-03-19 11:36:17 +01:00
* It is created and owned by Ellpeck and distributed
* under the Actually Additions License to be found at
2016-05-16 22:52:27 +02:00
* http://ellpeck.de/actaddlicense
2016-03-19 11:36:17 +01:00
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
*
2017-01-01 16:23:26 +01:00
* © 2015-2017 Ellpeck
2016-03-19 11:36:17 +01:00
*/
package de.ellpeck.actuallyadditions.mod.items;
import com.google.common.collect.Sets;
import de.ellpeck.actuallyadditions.mod.items.base.ItemToolAA;
2024-03-02 21:23:08 +01:00
import net.minecraft.tags.TagKey;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.Tier;
import net.minecraft.world.item.context.UseOnContext;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState;
2016-03-19 11:36:17 +01:00
2021-11-21 17:31:57 +01:00
import javax.annotation.Nonnull;
2021-02-26 22:15:48 +01:00
import java.util.Collections;
import java.util.Set;
2019-05-02 09:08:15 +02:00
public class ItemShovelAA extends ItemToolAA {
2016-03-19 11:36:17 +01:00
2024-03-04 20:21:48 +01:00
private static final Set<Block> EFFECTIVE_ON = Sets.newHashSet(Blocks.CLAY, Blocks.DIRT, Blocks.FARMLAND, Blocks.GRASS_BLOCK, Blocks.GRAVEL, Blocks.MYCELIUM, Blocks.SAND, Blocks.SNOW, Blocks.SNOW_BLOCK, Blocks.SOUL_SAND, Blocks.DIRT_PATH);
2016-03-19 11:36:17 +01:00
2024-03-02 21:23:08 +01:00
public ItemShovelAA(float p_i48512_1_, float p_i48512_2_, Tier p_i48512_3_, TagKey<Block> p_i48512_4_, Properties p_i48512_5_, String name, ItemStack repairItem, TagKey<Item> repairTag) {
2021-11-21 17:31:57 +01:00
super(p_i48512_1_, p_i48512_2_, p_i48512_3_, p_i48512_4_, p_i48512_5_, name, repairItem, repairTag);
2016-03-19 11:36:17 +01:00
}
2021-11-21 17:31:57 +01:00
// public ItemShovelAA(IItemTier material) {
//// super(1.5F, -3.0F, material, this.repairItem, unlocalizedName, this.rarity, EFFECTIVE_ON);
//// this.setHarvestLevel("shovel", material.getLevel());
// }
2016-05-02 17:09:23 +02:00
@Override
public boolean isCorrectToolForDrops(BlockState blockIn) {
2016-03-19 11:36:17 +01:00
Block block = blockIn.getBlock();
2021-11-21 17:31:57 +01:00
return block == Blocks.SNOW_BLOCK || block == Blocks.SNOW;
2016-03-19 11:36:17 +01:00
}
2021-11-21 17:31:57 +01:00
@Nonnull
2016-05-02 17:09:23 +02:00
@Override
2024-03-02 21:23:08 +01:00
public InteractionResult useOn(UseOnContext useContext) {
2021-11-21 17:31:57 +01:00
return Items.IRON_SHOVEL.useOn(useContext);
2016-03-19 11:36:17 +01:00
}
2021-11-21 17:31:57 +01:00
//@Override
2019-05-02 09:08:15 +02:00
public Set<String> getToolClasses(ItemStack stack) {
return Collections.singleton("shovel");
}
2016-03-19 11:36:17 +01:00
}