This commit is contained in:
Jottyfan 2022-03-12 21:48:02 +01:00
parent 2f117d21db
commit dea36b82e9
17 changed files with 82 additions and 90 deletions

View File

@ -1,5 +1,5 @@
plugins { plugins {
id 'fabric-loom' version '0.10-SNAPSHOT' id 'fabric-loom' version '0.11-SNAPSHOT'
id 'maven-publish' id 'maven-publish'
} }
@ -40,14 +40,10 @@ processResources {
} }
tasks.withType(JavaCompile).configureEach { tasks.withType(JavaCompile).configureEach {
// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
// If Javadoc is generated, this must be specified in that task too.
it.options.encoding = "UTF-8" it.options.encoding = "UTF-8"
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17. // Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
it.options.release = 17 it.options.release = 17
} }
java { java {
@ -67,13 +63,7 @@ jar {
publishing { publishing {
publications { publications {
mavenJava(MavenPublication) { mavenJava(MavenPublication) {
// add all the jars that should be included when publishing to maven from components.java
artifact(remapJar) {
builtBy remapJar
}
artifact(sourcesJar) {
builtBy remapSourcesJar
}
} }
} }

View File

@ -4,14 +4,14 @@
# Fabric Properties # Fabric Properties
# check these on https://fabricmc.net/versions.html # check these on https://fabricmc.net/versions.html
minecraft_version=1.18.1 minecraft_version=1.18.2
yarn_mappings=1.18.1+build.7 yarn_mappings=1.18.2+build.2
loader_version=0.12.12 loader_version=0.13.3
# Mod Properties # Mod Properties
mod_version = 1.18.1.7 mod_version = 1.18.2.0
maven_group = de.jottyfan.minecraft maven_group = de.jottyfan.minecraft
archives_base_name = quickiefabric archives_base_name = quickiefabric
# Dependencies # Dependencies
fabric_version=0.44.0+1.18 fabric_version=0.47.10+1.18.2

View File

@ -5,7 +5,6 @@ import java.util.List;
import de.jottyfan.minecraft.quickiefabric.items.QuickieItems; import de.jottyfan.minecraft.quickiefabric.items.QuickieItems;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.Material; import net.minecraft.block.Material;
import net.minecraft.block.OreBlock; import net.minecraft.block.OreBlock;
@ -13,14 +12,14 @@ import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootContext.Builder; import net.minecraft.loot.context.LootContext.Builder;
/** /**
* *
* @author jotty * @author jotty
* *
*/ */
public class BlockOreNetherSulphor extends OreBlock { public class BlockOreNetherSulphor extends OreBlock {
public BlockOreNetherSulphor() { public BlockOreNetherSulphor() {
super(FabricBlockSettings.of(Material.STONE).hardness(2.1f).requiresTool().breakByTool(FabricToolTags.PICKAXES)); super(FabricBlockSettings.of(Material.STONE).hardness(2.1f).requiresTool());
} }
@Override @Override

View File

@ -5,7 +5,6 @@ import java.util.List;
import de.jottyfan.minecraft.quickiefabric.items.QuickieItems; import de.jottyfan.minecraft.quickiefabric.items.QuickieItems;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.Material; import net.minecraft.block.Material;
import net.minecraft.block.OreBlock; import net.minecraft.block.OreBlock;
@ -13,14 +12,14 @@ import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootContext.Builder; import net.minecraft.loot.context.LootContext.Builder;
/** /**
* *
* @author jotty * @author jotty
* *
*/ */
public class BlockOreSalpeter extends OreBlock { public class BlockOreSalpeter extends OreBlock {
public BlockOreSalpeter() { public BlockOreSalpeter() {
super(FabricBlockSettings.of(Material.STONE).hardness(3.1f).requiresTool().breakByTool(FabricToolTags.PICKAXES)); super(FabricBlockSettings.of(Material.STONE).hardness(3.1f).requiresTool());
} }
@Override @Override

View File

@ -5,7 +5,6 @@ import java.util.List;
import de.jottyfan.minecraft.quickiefabric.items.QuickieItems; import de.jottyfan.minecraft.quickiefabric.items.QuickieItems;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks; import net.minecraft.block.Blocks;
import net.minecraft.block.Material; import net.minecraft.block.Material;
@ -14,14 +13,14 @@ import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootContext.Builder; import net.minecraft.loot.context.LootContext.Builder;
/** /**
* *
* @author jotty * @author jotty
* *
*/ */
public class BlockOreSandSalpeter extends OreBlock { public class BlockOreSandSalpeter extends OreBlock {
public BlockOreSandSalpeter() { public BlockOreSandSalpeter() {
super(FabricBlockSettings.of(Material.STONE).hardness(2.9f).requiresTool().breakByTool(FabricToolTags.PICKAXES)); super(FabricBlockSettings.of(Material.STONE).hardness(2.9f).requiresTool());
} }
@Override @Override

View File

@ -5,7 +5,6 @@ import java.util.List;
import de.jottyfan.minecraft.quickiefabric.items.QuickieItems; import de.jottyfan.minecraft.quickiefabric.items.QuickieItems;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.Material; import net.minecraft.block.Material;
import net.minecraft.block.OreBlock; import net.minecraft.block.OreBlock;
@ -13,14 +12,14 @@ import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootContext.Builder; import net.minecraft.loot.context.LootContext.Builder;
/** /**
* *
* @author jotty * @author jotty
* *
*/ */
public class BlockOreSulphor extends OreBlock { public class BlockOreSulphor extends OreBlock {
public BlockOreSulphor() { public BlockOreSulphor() {
super(FabricBlockSettings.of(Material.STONE).hardness(1.9f).requiresTool().breakByTool(FabricToolTags.PICKAXES)); super(FabricBlockSettings.of(Material.STONE).hardness(1.9f).requiresTool());
} }
@Override @Override

View File

@ -5,7 +5,6 @@ import java.util.List;
import de.jottyfan.minecraft.quickiefabric.items.QuickieItems; import de.jottyfan.minecraft.quickiefabric.items.QuickieItems;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks; import net.minecraft.block.Blocks;
import net.minecraft.block.GravelBlock; import net.minecraft.block.GravelBlock;
@ -14,14 +13,14 @@ import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootContext.Builder; import net.minecraft.loot.context.LootContext.Builder;
/** /**
* *
* @author jotty * @author jotty
* *
*/ */
public class BlockSandSalpeter extends GravelBlock { public class BlockSandSalpeter extends GravelBlock {
public BlockSandSalpeter() { public BlockSandSalpeter() {
super(FabricBlockSettings.of(Material.STONE).hardness(3.1f).requiresTool().breakByTool(FabricToolTags.SHOVELS)); super(FabricBlockSettings.of(Material.STONE).hardness(3.1f).requiresTool());
} }
@Override @Override

View File

@ -5,7 +5,6 @@ import java.util.List;
import de.jottyfan.minecraft.quickiefabric.items.QuickieItems; import de.jottyfan.minecraft.quickiefabric.items.QuickieItems;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.Material; import net.minecraft.block.Material;
@ -13,14 +12,14 @@ import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootContext.Builder; import net.minecraft.loot.context.LootContext.Builder;
/** /**
* *
* @author jotty * @author jotty
* *
*/ */
public class BlockSulphor extends Block { public class BlockSulphor extends Block {
public BlockSulphor() { public BlockSulphor() {
super(FabricBlockSettings.of(Material.WOOL).hardness(0.5f).requiresTool().breakByTool(FabricToolTags.PICKAXES)); super(FabricBlockSettings.of(Material.WOOL).hardness(0.5f).requiresTool());
} }
@Override @Override

View File

@ -18,7 +18,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
/** /**
* *
* @author jotty * @author jotty
* *
*/ */
@ -47,7 +47,7 @@ public class EventBlockBreak {
/** /**
* handle the rangeable tools break event * handle the rangeable tools break event
* *
* @param tool the tool that has been used * @param tool the tool that has been used
* @param itemStack the item stack * @param itemStack the item stack
* @param world the world * @param world the world
@ -79,7 +79,7 @@ public class EventBlockBreak {
/** /**
* break block recursively; * break block recursively;
* *
* @param visitedBlocks the positions of visited blocks * @param visitedBlocks the positions of visited blocks
* @param world the world * @param world the world
* @param validBlocks the blocks to break * @param validBlocks the blocks to break

View File

@ -1,5 +1,6 @@
package de.jottyfan.minecraft.quickiefabric.init; package de.jottyfan.minecraft.quickiefabric.init;
import java.util.Arrays;
import java.util.function.Predicate; import java.util.function.Predicate;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
@ -38,23 +39,23 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.screen.ScreenHandlerType; import net.minecraft.screen.ScreenHandlerType;
import net.minecraft.structure.rule.BlockMatchRuleTest;
import net.minecraft.structure.rule.TagMatchRuleTest;
import net.minecraft.tag.BlockTags;
import net.minecraft.util.ActionResult; import net.minecraft.util.ActionResult;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
import net.minecraft.util.registry.BuiltinRegistries; import net.minecraft.util.registry.BuiltinRegistries;
import net.minecraft.util.registry.Registry; import net.minecraft.util.registry.Registry;
import net.minecraft.util.registry.RegistryEntry;
import net.minecraft.util.registry.RegistryKey; import net.minecraft.util.registry.RegistryKey;
import net.minecraft.world.gen.GenerationStep; import net.minecraft.world.gen.GenerationStep;
import net.minecraft.world.gen.YOffset; import net.minecraft.world.gen.YOffset;
import net.minecraft.world.gen.decorator.CountPlacementModifier;
import net.minecraft.world.gen.decorator.HeightRangePlacementModifier;
import net.minecraft.world.gen.decorator.SquarePlacementModifier;
import net.minecraft.world.gen.feature.ConfiguredFeature; import net.minecraft.world.gen.feature.ConfiguredFeature;
import net.minecraft.world.gen.feature.EmeraldOreFeatureConfig;
import net.minecraft.world.gen.feature.Feature; import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.feature.OreConfiguredFeatures;
import net.minecraft.world.gen.feature.OreFeatureConfig; import net.minecraft.world.gen.feature.OreFeatureConfig;
import net.minecraft.world.gen.feature.PlacedFeature; import net.minecraft.world.gen.feature.PlacedFeature;
import net.minecraft.world.gen.placementmodifier.CountPlacementModifier;
import net.minecraft.world.gen.placementmodifier.HeightRangePlacementModifier;
import net.minecraft.world.gen.placementmodifier.SquarePlacementModifier;
/** /**
* *
@ -70,32 +71,44 @@ public class RegistryManager {
public static final ScreenHandlerType<BackpackScreenHandler> BACKPACK_SCREEN_HANDLER = ScreenHandlerRegistry public static final ScreenHandlerType<BackpackScreenHandler> BACKPACK_SCREEN_HANDLER = ScreenHandlerRegistry
.registerExtended(RegistryManager.BACKPACK_IDENTIFIER, BackpackScreenHandler::new); .registerExtended(RegistryManager.BACKPACK_IDENTIFIER, BackpackScreenHandler::new);
public static final ConfiguredFeature<?, ?> CF_ORESULPHOR = Feature.ORE.configure(new OreFeatureConfig( @SuppressWarnings("unchecked")
new TagMatchRuleTest(BlockTags.BASE_STONE_OVERWORLD), QuickieBlocks.ORE_SULPHOR.getDefaultState(), 20)); public static final ConfiguredFeature<?, ?> CF_ORESULPHOR = new ConfiguredFeature(Feature.ORE, new OreFeatureConfig(
public static final ConfiguredFeature<?, ?> CF_ORENETHERSULPHOR = Feature.ORE.configure(new OreFeatureConfig( OreConfiguredFeatures.STONE_ORE_REPLACEABLES, QuickieBlocks.ORE_SULPHOR.getDefaultState(), 20));
new TagMatchRuleTest(BlockTags.BASE_STONE_OVERWORLD), QuickieBlocks.ORE_NETHER_SULPHOR.getDefaultState(), 24)); @SuppressWarnings("unchecked")
public static final ConfiguredFeature<?, ?> CF_ORESALPETER = Feature.ORE.configure(new OreFeatureConfig( public static final ConfiguredFeature<?, ?> CF_ORENETHERSULPHOR = new ConfiguredFeature(Feature.ORE,
new TagMatchRuleTest(BlockTags.BASE_STONE_OVERWORLD), QuickieBlocks.ORE_SALPETER.getDefaultState(), 12)); new OreFeatureConfig(OreConfiguredFeatures.NETHERRACK, QuickieBlocks.ORE_NETHER_SULPHOR.getDefaultState(), 24));
public static final ConfiguredFeature<?, ?> CF_DIRTSALPETER = Feature.ORE.configure( @SuppressWarnings("unchecked")
new OreFeatureConfig(new BlockMatchRuleTest(Blocks.DIRT), QuickieBlocks.DIRT_SALPETER.getDefaultState(), 3)); public static final ConfiguredFeature<?, ?> CF_ORESALPETER = new ConfiguredFeature(Feature.ORE, new OreFeatureConfig(
public static final ConfiguredFeature<?, ?> CF_SANDSALPETER = Feature.ORE.configure( OreConfiguredFeatures.STONE_ORE_REPLACEABLES, QuickieBlocks.ORE_SALPETER.getDefaultState(), 12));
new OreFeatureConfig(new BlockMatchRuleTest(Blocks.SAND), QuickieBlocks.SAND_SALPETER.getDefaultState(), 3)); @SuppressWarnings("unchecked")
public static final ConfiguredFeature<?, ?> CF_ORESANDSALPETER = Feature.ORE.configure(new OreFeatureConfig( public static final ConfiguredFeature<?, ?> CF_DIRTSALPETER = new ConfiguredFeature(Feature.REPLACE_SINGLE_BLOCK,
new BlockMatchRuleTest(Blocks.SANDSTONE), QuickieBlocks.ORE_SAND_SALPETER.getDefaultState(), 3)); new EmeraldOreFeatureConfig(Blocks.DIRT.getDefaultState(), QuickieBlocks.DIRT_SALPETER.getDefaultState()));
@SuppressWarnings("unchecked")
public static final PlacedFeature PF_ORESULPHOR = CF_ORESULPHOR.withPlacement(CountPlacementModifier.of(7), public static final ConfiguredFeature<?, ?> CF_SANDSALPETER = new ConfiguredFeature(Feature.REPLACE_SINGLE_BLOCK,
SquarePlacementModifier.of(), HeightRangePlacementModifier.uniform(YOffset.aboveBottom(0), YOffset.belowTop(0))); new EmeraldOreFeatureConfig(Blocks.SAND.getDefaultState(), QuickieBlocks.SAND_SALPETER.getDefaultState()));
public static final PlacedFeature PF_ORENETHERSULPHOR = CF_ORENETHERSULPHOR.withPlacement( @SuppressWarnings("unchecked")
CountPlacementModifier.of(10), SquarePlacementModifier.of(), public static final ConfiguredFeature<?, ?> CF_ORESANDSALPETER = new ConfiguredFeature(Feature.REPLACE_SINGLE_BLOCK,
HeightRangePlacementModifier.uniform(YOffset.aboveBottom(0), YOffset.belowTop(0))); new EmeraldOreFeatureConfig(Blocks.SANDSTONE.getDefaultState(),
public static final PlacedFeature PF_ORESALPETER = CF_ORESALPETER.withPlacement(CountPlacementModifier.of(10), QuickieBlocks.ORE_SAND_SALPETER.getDefaultState()));
SquarePlacementModifier.of(), HeightRangePlacementModifier.uniform(YOffset.aboveBottom(0), YOffset.belowTop(0)));
public static final PlacedFeature PF_DIRTSALPETER = CF_DIRTSALPETER.withPlacement(CountPlacementModifier.of(4), public static final PlacedFeature PF_ORESULPHOR = new PlacedFeature(RegistryEntry.of(CF_ORESULPHOR),
SquarePlacementModifier.of(), HeightRangePlacementModifier.uniform(YOffset.aboveBottom(0), YOffset.belowTop(0))); Arrays.asList(CountPlacementModifier.of(7), SquarePlacementModifier.of(),
public static final PlacedFeature PF_SANDSALPETER = CF_SANDSALPETER.withPlacement(CountPlacementModifier.of(4), HeightRangePlacementModifier.uniform(YOffset.aboveBottom(0), YOffset.belowTop(0))));
SquarePlacementModifier.of(), HeightRangePlacementModifier.uniform(YOffset.aboveBottom(0), YOffset.belowTop(0))); public static final PlacedFeature PF_ORENETHERSULPHOR = new PlacedFeature(RegistryEntry.of(CF_ORENETHERSULPHOR),
public static final PlacedFeature PF_ORESANDSALPETER = CF_ORESANDSALPETER.withPlacement(CountPlacementModifier.of(4), Arrays.asList(CountPlacementModifier.of(10), SquarePlacementModifier.of(),
SquarePlacementModifier.of(), HeightRangePlacementModifier.uniform(YOffset.aboveBottom(0), YOffset.belowTop(0))); HeightRangePlacementModifier.uniform(YOffset.aboveBottom(0), YOffset.belowTop(0))));
public static final PlacedFeature PF_ORESALPETER = new PlacedFeature(RegistryEntry.of(CF_ORESALPETER),
Arrays.asList(CountPlacementModifier.of(10), SquarePlacementModifier.of(),
HeightRangePlacementModifier.uniform(YOffset.aboveBottom(0), YOffset.belowTop(0))));
public static final PlacedFeature PF_DIRTSALPETER = new PlacedFeature(RegistryEntry.of(CF_DIRTSALPETER),
Arrays.asList(CountPlacementModifier.of(4), SquarePlacementModifier.of(),
HeightRangePlacementModifier.uniform(YOffset.aboveBottom(0), YOffset.belowTop(0))));
public static final PlacedFeature PF_SANDSALPETER = new PlacedFeature(RegistryEntry.of(CF_SANDSALPETER),
Arrays.asList(CountPlacementModifier.of(4), SquarePlacementModifier.of(),
HeightRangePlacementModifier.uniform(YOffset.aboveBottom(0), YOffset.belowTop(0))));
public static final PlacedFeature PF_ORESANDSALPETER = new PlacedFeature(RegistryEntry.of(CF_ORESANDSALPETER),
Arrays.asList(CountPlacementModifier.of(4), SquarePlacementModifier.of(),
HeightRangePlacementModifier.uniform(YOffset.aboveBottom(0), YOffset.belowTop(0))));
public static final ItemGroup QUICKIEFABRIC_GROUP = FabricItemGroupBuilder public static final ItemGroup QUICKIEFABRIC_GROUP = FabricItemGroupBuilder
.create(new Identifier(QUICKIEFABRIC, "all")).icon(() -> new ItemStack(QuickieItems.SPEEDPOWDER)) .create(new Identifier(QUICKIEFABRIC, "all")).icon(() -> new ItemStack(QuickieItems.SPEEDPOWDER))

View File

@ -7,7 +7,7 @@ import net.minecraft.block.BlockState;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
/** /**
* *
* @author jotty * @author jotty
* *
*/ */
@ -22,7 +22,7 @@ public interface ToolRangeable {
/** /**
* check if this block state is one that affects the neighbor blocks to break * check if this block state is one that affects the neighbor blocks to break
* also if they are from the same type * also if they are from the same type
* *
* @param blockState the block state of the current block * @param blockState the block state of the current block
* @return true or false * @return true or false
*/ */
@ -30,7 +30,7 @@ public interface ToolRangeable {
/** /**
* get list of blocks that belong together (could be useful for stripped logs) * get list of blocks that belong together (could be useful for stripped logs)
* *
* @param block of the set * @param block of the set
* @return the list of blocks or null if not found * @return the list of blocks or null if not found
*/ */

View File

@ -4,7 +4,6 @@ import java.util.List;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import net.fabricmc.fabric.api.tool.attribute.v1.ToolManager;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.LeavesBlock; import net.minecraft.block.LeavesBlock;
@ -13,7 +12,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.item.ToolMaterial; import net.minecraft.item.ToolMaterial;
/** /**
* *
* @author jotty * @author jotty
* *
*/ */
@ -36,8 +35,7 @@ public class ToolRangeableAxe extends AxeItem implements ToolRangeable {
@Override @Override
public boolean canBreakNeighbors(BlockState blockIn) { public boolean canBreakNeighbors(BlockState blockIn) {
return ToolManager.handleIsEffectiveOn(blockIn, new ItemStack(this), null) return super.isSuitableFor(blockIn) || blockIn.getBlock() instanceof LeavesBlock;
|| blockIn.getBlock() instanceof LeavesBlock;
} }
@Override @Override

View File

@ -8,7 +8,6 @@ import org.apache.logging.log4j.Logger;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import de.jottyfan.minecraft.quickiefabric.init.RegistryManager; import de.jottyfan.minecraft.quickiefabric.init.RegistryManager;
import net.fabricmc.fabric.api.tool.attribute.v1.ToolManager;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks; import net.minecraft.block.Blocks;
@ -85,7 +84,7 @@ public class ToolSpeedpowderHoe extends HoeItem implements ToolRangeable {
@Override @Override
public boolean canBreakNeighbors(BlockState blockState) { public boolean canBreakNeighbors(BlockState blockState) {
return ToolManager.handleIsEffectiveOn(blockState, new ItemStack(this), null) return super.isSuitableFor(blockState)
|| Blocks.GRASS.equals(blockState.getBlock()) || Blocks.GRASS.equals(blockState.getBlock())
|| Blocks.FERN.equals(blockState.getBlock()) || Blocks.FERN.equals(blockState.getBlock())
|| Blocks.LARGE_FERN.equals(blockState.getBlock()); || Blocks.LARGE_FERN.equals(blockState.getBlock());

View File

@ -5,7 +5,6 @@ import java.util.List;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import de.jottyfan.minecraft.quickiefabric.init.RegistryManager; import de.jottyfan.minecraft.quickiefabric.init.RegistryManager;
import net.fabricmc.fabric.api.tool.attribute.v1.ToolManager;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.item.Item; import net.minecraft.item.Item;
@ -15,7 +14,7 @@ import net.minecraft.item.ToolMaterials;
import net.minecraft.nbt.NbtCompound; import net.minecraft.nbt.NbtCompound;
/** /**
* *
* @author jotty * @author jotty
* *
*/ */
@ -26,7 +25,7 @@ public class ToolSpeedpowderPickaxe extends PickaxeItem implements ToolRangeable
public ToolSpeedpowderPickaxe() { public ToolSpeedpowderPickaxe() {
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));
} }
@Override @Override
public HarvestRange getRange(ItemStack stack) { public HarvestRange getRange(ItemStack stack) {
NbtCompound tag = stack.getNbt(); NbtCompound tag = stack.getNbt();
@ -40,7 +39,7 @@ public class ToolSpeedpowderPickaxe extends PickaxeItem implements ToolRangeable
@Override @Override
public boolean canBreakNeighbors(BlockState blockIn) { public boolean canBreakNeighbors(BlockState blockIn) {
return ToolManager.handleIsEffectiveOn(blockIn, new ItemStack(this), null); return super.isSuitableFor(blockIn);
} }
@Override @Override

View File

@ -5,7 +5,6 @@ import java.util.List;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import de.jottyfan.minecraft.quickiefabric.init.RegistryManager; import de.jottyfan.minecraft.quickiefabric.init.RegistryManager;
import net.fabricmc.fabric.api.tool.attribute.v1.ToolManager;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.item.Item; import net.minecraft.item.Item;
@ -19,7 +18,7 @@ import net.minecraft.util.math.Direction;
import net.minecraft.world.World; import net.minecraft.world.World;
/** /**
* *
* @author jotty * @author jotty
* *
*/ */
@ -75,7 +74,7 @@ public class ToolSpeedpowderShovel extends ShovelItem implements ToolRangeable {
@Override @Override
public boolean canBreakNeighbors(BlockState blockState) { public boolean canBreakNeighbors(BlockState blockState) {
return ToolManager.handleIsEffectiveOn(blockState, new ItemStack(this), null); return super.isSuitableFor(blockState);
} }
@Override @Override

View File

@ -26,9 +26,9 @@
"quickiefabric.mixins.json" "quickiefabric.mixins.json"
], ],
"depends": { "depends": {
"fabricloader": ">=0.12.7", "fabricloader": ">=0.13.3",
"fabric": "*", "fabric": "*",
"minecraft": "1.18.1", "minecraft": "1.18.2",
"java": ">=17" "java": ">=17"
}, },
"suggests": { "suggests": {

View File

@ -2,7 +2,7 @@
"required": true, "required": true,
"minVersion": "0.8", "minVersion": "0.8",
"package": "de.jottyfan.minecraft.quickiefabric.mixin", "package": "de.jottyfan.minecraft.quickiefabric.mixin",
"compatibilityLevel": "JAVA_16", "compatibilityLevel": "JAVA_17",
"mixins": [ "mixins": [
"BlockBreakMixin" "BlockBreakMixin"
], ],