finetuning

This commit is contained in:
Jörg Henke 2021-11-20 17:55:47 +01:00
parent 24f9abfb18
commit a11ed93048
6 changed files with 11 additions and 17 deletions

View File

@ -4,8 +4,8 @@ org.gradle.jvmargs=-Xmx1G
# Fabric Properties # Fabric Properties
# check these on https://fabricmc.net/versions.html # check these on https://fabricmc.net/versions.html
minecraft_version=1.17.1 minecraft_version=1.17.1
yarn_mappings=1.17.1+build.14 yarn_mappings=1.17.1+build.63
loader_version=0.11.6 loader_version=0.12.5
# Mod Properties # Mod Properties
mod_version = 1.17.1.5 mod_version = 1.17.1.5
@ -13,4 +13,4 @@ org.gradle.jvmargs=-Xmx1G
archives_base_name = quickiefabric archives_base_name = quickiefabric
# Dependencies # Dependencies
fabric_version=0.37.0+1.17 fabric_version=0.42.1+1.17

View File

@ -33,7 +33,7 @@ public class ToolRangeableAxe extends AxeItem implements ToolRangeable {
@Override @Override
public float getMiningSpeedMultiplier(ItemStack stack, BlockState state) { public float getMiningSpeedMultiplier(ItemStack stack, BlockState state) {
return getBlockList(state.getBlock()) != null ? this.miningSpeed : super.getMiningSpeedMultiplier(stack, state); return this.miningSpeed;
} }
@Override @Override
@ -59,6 +59,9 @@ public class ToolRangeableAxe extends AxeItem implements ToolRangeable {
if (block instanceof LeavesBlock) { if (block instanceof LeavesBlock) {
return Lists.newArrayList(block); return Lists.newArrayList(block);
} }
if (super.isSuitableFor(block.getDefaultState())) {
return Lists.newArrayList(block);
}
return null; return null;
} }
} }

View File

@ -63,7 +63,7 @@ public class ToolSpeedpowderHoe extends HoeItem implements ToolRangeable {
@Override @Override
public boolean canBreakNeighbors(BlockState blockState) { public boolean canBreakNeighbors(BlockState blockState) {
boolean result = HOE_EFFECTIVE_ON.contains(blockState.getBlock()) || checkExternalBlock(blockState.getBlock()); boolean result = super.isSuitableFor(blockState) || HOE_EFFECTIVE_ON.contains(blockState.getBlock()) || checkExternalBlock(blockState.getBlock());
if (!result) { if (!result) {
if (!blockState.isAir()) { if (!blockState.isAir()) {
LOGGER.debug("cannot break block {} with that speedpowder hoe", Registry.BLOCK.getId(blockState.getBlock())); LOGGER.debug("cannot break block {} with that speedpowder hoe", Registry.BLOCK.getId(blockState.getBlock()));

View File

@ -28,15 +28,6 @@ public class ToolSpeedpowderPickaxe extends PickaxeItem implements ToolRangeable
super(ToolMaterials.DIAMOND, 4, 2.0f, new Item.Settings().group(RegistryManager.QUICKIEFABRIC_GROUP)); super(ToolMaterials.DIAMOND, 4, 2.0f, new Item.Settings().group(RegistryManager.QUICKIEFABRIC_GROUP));
} }
/**
* seems not to work
*/
@Override
public boolean isSuitableFor(BlockState state) {
return PICKAXE_EFFECTIVE_ON.contains(state.getBlock()) || checkExternalBlock(state.getBlock())
|| super.isSuitableFor(state);
}
@Override @Override
public HarvestRange getRange(ItemStack stack) { public HarvestRange getRange(ItemStack stack) {
NbtCompound tag = stack.getNbt(); NbtCompound tag = stack.getNbt();
@ -50,7 +41,7 @@ public class ToolSpeedpowderPickaxe extends PickaxeItem implements ToolRangeable
@Override @Override
public boolean canBreakNeighbors(BlockState blockIn) { public boolean canBreakNeighbors(BlockState blockIn) {
return super.isSuitableFor(blockIn) || PICKAXE_EFFECTIVE_ON.contains(blockIn.getBlock()) return super.isSuitableFor(blockIn) || super.isSuitableFor(blockIn) || PICKAXE_EFFECTIVE_ON.contains(blockIn.getBlock())
|| checkExternalBlock(blockIn.getBlock()); || checkExternalBlock(blockIn.getBlock());
} }

View File

@ -80,7 +80,7 @@ public class ToolSpeedpowderShovel extends ShovelItem implements ToolRangeable {
@Override @Override
public boolean canBreakNeighbors(BlockState blockState) { public boolean canBreakNeighbors(BlockState blockState) {
boolean result = SHOVEL_EFFECTIVE_ON.contains(blockState.getBlock()) || checkExternalBlock(blockState.getBlock()); boolean result = super.isSuitableFor(blockState) || SHOVEL_EFFECTIVE_ON.contains(blockState.getBlock()) || checkExternalBlock(blockState.getBlock());
if (!result) { if (!result) {
if (!blockState.isAir()) { if (!blockState.isAir()) {
LOGGER.debug("cannot break block {} with that speedpowder shovel", Registry.BLOCK.getId(blockState.getBlock())); LOGGER.debug("cannot break block {} with that speedpowder shovel", Registry.BLOCK.getId(blockState.getBlock()));