https://modrinth.com/mod/breakfree

Update to 1.20.1

+15 -11
+4 -4
gradle.properties
··· 2 2 org.gradle.jvmargs=-Xmx1G 3 3 # Fabric Properties 4 4 # check these on https://fabricmc.net/versions.html 5 - minecraft_version=1.19 6 - yarn_mappings=1.19+build.2 7 - loader_version=0.14.7 5 + minecraft_version=1.20.1 6 + yarn_mappings=1.20.1+build.9 7 + loader_version=0.14.21 8 8 # Mod Properties 9 9 mod_version=1.1.0 10 10 maven_group=io.gtihub.justapotota 11 11 archives_base_name=breakfree 12 12 # Dependencies 13 13 # check this on https://fabricmc.net/versions.html 14 - fabric_version=0.55.3+1.19 14 + fabric_version=0.85.0+1.20.1
+7 -3
src/main/java/io/gtihub/justapotota/breakfree/mixin/ClientPlayerInteractionManagerMixin.java
··· 1 1 package io.gtihub.justapotota.breakfree.mixin; 2 2 3 3 import net.minecraft.client.network.ClientPlayerInteractionManager; 4 + import net.minecraft.item.ItemStack; 4 5 import org.spongepowered.asm.mixin.Mixin; 6 + import org.spongepowered.asm.mixin.Shadow; 5 7 import org.spongepowered.asm.mixin.injection.At; 6 8 import org.spongepowered.asm.mixin.injection.ModifyVariable; 7 9 8 10 @Mixin(ClientPlayerInteractionManager.class) 9 11 public class ClientPlayerInteractionManagerMixin { 10 - @ModifyVariable(method = "isCurrentlyBreaking(Lnet/minecraft/util/math/BlockPos;)Z", at = @At("STORE")) 11 - private boolean bl(boolean original) { 12 - return true; 12 + @Shadow private ItemStack selectedStack; 13 + 14 + @ModifyVariable(method = "isCurrentlyBreaking", at = @At("STORE")) 15 + private ItemStack stack(ItemStack stack) { 16 + return this.selectedStack; 13 17 } 14 18 }
+4 -4
src/main/resources/fabric.mod.json
··· 3 3 "id": "breakfree", 4 4 "version": "${version}", 5 5 "name": "Break Free", 6 - "description": "Allows you to continue breaking blocks when you switch items.", 7 - "authors": ["JustAPotota"], 6 + "description": "Allows you to keep breaking blocks when you switch tools.", 7 + "authors": ["Potota"], 8 8 "contact": { 9 9 "homepage": "https://modrinth.com/mod/breakfree", 10 10 "sources": "https://github.com/JustAPotota/fabric-breakfree", ··· 19 19 "breakfree.mixins.json" 20 20 ], 21 21 "depends": { 22 - "fabricloader": ">=0.11.3", 22 + "fabricloader": ">=0.14.21", 23 23 "fabric": "*", 24 - "minecraft": "1.19.x", 24 + "minecraft": "1.20.x", 25 25 "java": ">=17" 26 26 } 27 27 }