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

91 lines
3.9 KiB
Java
Raw Normal View History

2016-03-19 11:36:17 +01:00
/*
2016-05-16 22:52:27 +02:00
* This file ("ItemPickaxeAA.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;
2024-03-02 21:23:08 +01:00
import net.minecraft.world.item.DiggerItem;
import net.minecraft.world.item.Tier;
2016-03-19 11:36:17 +01:00
2024-03-02 21:23:08 +01:00
public class ItemPickaxeAA extends DiggerItem {
private final Tier tier;
public ItemPickaxeAA(Tier tier) {
2021-11-21 21:18:00 +01:00
super(
4.0f,
-2f,
tier,
2024-03-02 21:23:08 +01:00
null, //Feed block tags here
new Properties()
// .addToolType(ToolType.AXE, tier.getLevel())
// .addToolType(ToolType.HOE, tier.getLevel())
// .addToolType(ToolType.SHOVEL, tier.getLevel())
// .addToolType(ToolType.PICKAXE, tier.getLevel())
2021-11-21 21:18:00 +01:00
.durability(tier.getUses() * 4)
2024-03-03 01:20:53 +01:00
2021-11-21 21:18:00 +01:00
);
2021-02-27 16:33:00 +01:00
2021-11-21 21:18:00 +01:00
this.tier = tier;
2021-11-21 21:05:27 +01:00
}
2016-03-19 11:36:17 +01:00
2021-11-21 21:05:27 +01:00
/*
2016-04-20 21:39:03 +02:00
private static final Set<Block> EFFECTIVE_ON = Sets.newHashSet(Blocks.ACTIVATOR_RAIL, Blocks.COAL_ORE, Blocks.COBBLESTONE, Blocks.DETECTOR_RAIL, Blocks.DIAMOND_BLOCK, Blocks.DIAMOND_ORE, Blocks.DOUBLE_STONE_SLAB, Blocks.GOLDEN_RAIL, Blocks.GOLD_BLOCK, Blocks.GOLD_ORE, Blocks.ICE, Blocks.IRON_BLOCK, Blocks.IRON_ORE, Blocks.LAPIS_BLOCK, Blocks.LAPIS_ORE, Blocks.LIT_REDSTONE_ORE, Blocks.MOSSY_COBBLESTONE, Blocks.NETHERRACK, Blocks.PACKED_ICE, Blocks.RAIL, Blocks.REDSTONE_ORE, Blocks.SANDSTONE, Blocks.RED_SANDSTONE, Blocks.STONE, Blocks.STONE_SLAB, Blocks.STONE_BUTTON, Blocks.STONE_PRESSURE_PLATE);
2016-03-19 11:36:17 +01:00
2021-02-27 21:24:26 +01:00
public ItemPickaxeAA(IItemTier material) {
super(1.0F, -2.8F, material, this.repairItem, unlocalizedName, this.rarity, EFFECTIVE_ON);
this.setHarvestLevel("pickaxe", material.getLevel());
2016-03-19 11:36:17 +01:00
}
2016-05-02 17:09:23 +02:00
@Override
public boolean isCorrectToolForDrops(BlockState blockIn) {
2016-04-20 21:39:03 +02:00
Block block = blockIn.getBlock();
2019-05-02 09:08:15 +02:00
if (block == Blocks.OBSIDIAN) {
2016-04-20 21:39:03 +02:00
return this.toolMaterial.getHarvestLevel() == 3;
2019-05-02 09:08:15 +02:00
} else if (block != Blocks.DIAMOND_BLOCK && block != Blocks.DIAMOND_ORE) {
if (block != Blocks.EMERALD_ORE && block != Blocks.EMERALD_BLOCK) {
if (block != Blocks.GOLD_BLOCK && block != Blocks.GOLD_ORE) {
if (block != Blocks.IRON_BLOCK && block != Blocks.IRON_ORE) {
if (block != Blocks.LAPIS_BLOCK && block != Blocks.LAPIS_ORE) {
2021-10-02 15:59:42 +02:00
if (block != Blocks.REDSTONE_ORE) {
2016-04-20 21:39:03 +02:00
Material material = blockIn.getMaterial();
return material == Material.STONE || material == Material.METAL || material == Material.HEAVY_METAL;
2019-05-02 09:08:15 +02:00
} else {
2016-04-20 21:39:03 +02:00
return this.toolMaterial.getHarvestLevel() >= 2;
}
2019-05-02 09:08:15 +02:00
} else {
2016-04-20 21:39:03 +02:00
return this.toolMaterial.getHarvestLevel() >= 1;
}
2019-05-02 09:08:15 +02:00
} else {
2016-04-20 21:39:03 +02:00
return this.toolMaterial.getHarvestLevel() >= 1;
}
2019-05-02 09:08:15 +02:00
} else {
2016-04-20 21:39:03 +02:00
return this.toolMaterial.getHarvestLevel() >= 2;
}
2019-05-02 09:08:15 +02:00
} else {
2016-04-20 21:39:03 +02:00
return this.toolMaterial.getHarvestLevel() >= 2;
}
2019-05-02 09:08:15 +02:00
} else {
2016-04-20 21:39:03 +02:00
return this.toolMaterial.getHarvestLevel() >= 2;
}
2016-03-19 11:36:17 +01:00
}
2016-05-02 17:09:23 +02:00
@Override
2021-02-26 22:15:48 +01:00
public float getDestroySpeed(ItemStack stack, BlockState state) {
2016-03-19 11:36:17 +01:00
Material material = state.getMaterial();
return material != Material.METAL && material != Material.HEAVY_METAL && material != Material.STONE
2021-02-27 16:33:00 +01:00
? super.getDestroySpeed(stack, state)
: this.speed;
2016-03-19 11:36:17 +01:00
}
@Override
2019-05-02 09:08:15 +02:00
public Set<String> getToolClasses(ItemStack stack) {
return Collections.singleton("pickaxe");
2021-11-21 21:05:27 +01:00
}*/
2016-03-19 11:36:17 +01:00
}