mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-12-22 19:39:24 +01:00
Fix drill mistake
This commit is contained in:
parent
4ef880aa15
commit
d9961a3926
1 changed files with 3 additions and 9 deletions
|
@ -59,7 +59,6 @@ import net.neoforged.neoforge.items.IItemHandler;
|
|||
import net.neoforged.neoforge.items.IItemHandlerModifiable;
|
||||
|
||||
public class DrillItem extends ItemEnergy {
|
||||
|
||||
public static final int HARVEST_LEVEL = 4;
|
||||
private static final int ENERGY_USE = 100;
|
||||
|
||||
|
@ -161,14 +160,12 @@ public class DrillItem extends ItemEnergy {
|
|||
* @return The Upgrade, if it's installed
|
||||
*/
|
||||
public ItemStack getHasUpgradeAsStack(ItemStack stack, ItemDrillUpgrade.UpgradeType upgrade) {
|
||||
CompoundTag compound = stack.getOrCreateTag();
|
||||
|
||||
ItemStackHandlerAA inv = new ItemStackHandlerAA(ContainerDrill.SLOT_AMOUNT);
|
||||
loadSlotsFromNBT(inv, stack);
|
||||
for (int i = 0; i < inv.getSlots(); i++) {
|
||||
ItemStack slotStack = inv.getStackInSlot(i);
|
||||
if (StackUtil.isValid(slotStack) && slotStack.getItem() instanceof ItemDrillUpgrade) {
|
||||
if (((ItemDrillUpgrade) slotStack.getItem()).type == upgrade) {
|
||||
if (StackUtil.isValid(slotStack) && slotStack.getItem() instanceof ItemDrillUpgrade drillUpgrade) {
|
||||
if (drillUpgrade.type == upgrade) {
|
||||
return slotStack;
|
||||
}
|
||||
}
|
||||
|
@ -213,11 +210,8 @@ public class DrillItem extends ItemEnergy {
|
|||
|
||||
@Override
|
||||
public float getDestroySpeed(ItemStack stack, BlockState state) {
|
||||
if(!state.is(ActuallyTags.Blocks.MINEABLE_WITH_DRILL))
|
||||
return 1.0F;
|
||||
|
||||
return this.getEnergyStored(stack) >= this.getEnergyUsePerBlock(stack)
|
||||
? (this.hasExtraWhitelist(state.getBlock()))
|
||||
? (this.hasExtraWhitelist(state.getBlock()) || state.is(ActuallyTags.Blocks.MINEABLE_WITH_DRILL))
|
||||
? this.getEfficiencyFromUpgrade(stack)
|
||||
: 1.0F
|
||||
: 0.1F;
|
||||
|
|
Loading…
Reference in a new issue