https://modrinth.com/mod/breakfree

the mega jar

+93 -13
+3 -3
build.gradle
··· 27 27 } 28 28 29 29 tasks.withType(JavaCompile).configureEach { 30 - it.options.release = 21 30 + it.options.release = 8 31 31 } 32 32 33 33 java { ··· 36 36 // If you remove this line, sources will not be generated. 37 37 withSourcesJar() 38 38 39 - sourceCompatibility = JavaVersion.VERSION_21 40 - targetCompatibility = JavaVersion.VERSION_21 39 + sourceCompatibility = JavaVersion.VERSION_17 40 + targetCompatibility = JavaVersion.VERSION_17 41 41 } 42 42 43 43 jar {
+3 -3
gradle.properties
··· 4 4 5 5 # Fabric Properties 6 6 # check these on https://fabricmc.net/versions.html 7 - minecraft_version=1.21.6 8 - yarn_mappings=1.21.6+build.1 7 + minecraft_version=1.16 8 + yarn_mappings=1.16+build.4 9 9 loader_version=0.16.14 10 10 loom_version=1.10-SNAPSHOT 11 11 12 12 # Mod Properties 13 - mod_version=1.3.0+1.21.6 13 + mod_version=1.4.0 14 14 maven_group=io.github.justapotota 15 15 archives_base_name=breakfree
+1 -1
src/main/java/io/github/justapotota/breakfree/mixin/ClientPlayerInteractionManagerMixin.java src/main/java/io/github/justapotota/breakfree/mixin/ClientPlayerInteractionManagerMixin120.java
··· 8 8 import org.spongepowered.asm.mixin.injection.ModifyVariable; 9 9 10 10 @Mixin(ClientPlayerInteractionManager.class) 11 - public class ClientPlayerInteractionManagerMixin { 11 + public class ClientPlayerInteractionManagerMixin120 { 12 12 @Shadow private ItemStack selectedStack; 13 13 14 14 @ModifyVariable(method = "isCurrentlyBreaking", at = @At("STORE"))
+14
src/main/java/io/github/justapotota/breakfree/mixin/ClientPlayerInteractionManagerMixin119.java
··· 1 + package io.github.justapotota.breakfree.mixin; 2 + 3 + import net.minecraft.client.network.ClientPlayerInteractionManager; 4 + import org.spongepowered.asm.mixin.Mixin; 5 + import org.spongepowered.asm.mixin.injection.At; 6 + import org.spongepowered.asm.mixin.injection.ModifyVariable; 7 + 8 + @Mixin(ClientPlayerInteractionManager.class) 9 + public class ClientPlayerInteractionManagerMixin119 { 10 + @ModifyVariable(method = "isCurrentlyBreaking", at = @At("STORE")) 11 + private boolean bl(boolean original) { 12 + return true; 13 + } 14 + }
+66
src/main/java/io/github/justapotota/breakfree/mixin/ConfigPlugin.java
··· 1 + package io.github.justapotota.breakfree.mixin; 2 + 3 + import net.fabricmc.loader.api.FabricLoader; 4 + import net.fabricmc.loader.api.SemanticVersion; 5 + import net.fabricmc.loader.api.Version; 6 + import net.fabricmc.loader.api.VersionParsingException; 7 + import org.objectweb.asm.tree.ClassNode; 8 + import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin; 9 + import org.spongepowered.asm.mixin.extensibility.IMixinInfo; 10 + 11 + import java.util.Collections; 12 + import java.util.List; 13 + import java.util.Objects; 14 + import java.util.Set; 15 + 16 + public class ConfigPlugin implements IMixinConfigPlugin { 17 + private SemanticVersion v1_20; 18 + 19 + private Version minecraftVersion; 20 + 21 + @Override 22 + public void onLoad(String mixinPackage) { 23 + try { 24 + this.v1_20 = SemanticVersion.parse("1.20"); 25 + } catch (VersionParsingException e) { 26 + throw new RuntimeException(e); 27 + } 28 + 29 + this.minecraftVersion = FabricLoader.getInstance().getModContainer("minecraft").get().getMetadata().getVersion(); 30 + } 31 + 32 + @Override 33 + public String getRefMapperConfig() { 34 + return null; 35 + } 36 + 37 + @Override 38 + public boolean shouldApplyMixin(String targetClassName, String mixinClassName) { 39 + if (Objects.equals(mixinClassName, "io.github.justapotota.breakfree.mixin.ClientPlayerInteractionManagerMixin120")) { 40 + return this.v1_20.compareTo(this.minecraftVersion) <= 0; 41 + } else if (Objects.equals(mixinClassName, "io.github.justapotota.breakfree.mixin.ClientPlayerInteractionManagerMixin119")) { 42 + return this.v1_20.compareTo(this.minecraftVersion) > 0; 43 + } 44 + return false; 45 + } 46 + 47 + @Override 48 + public void acceptTargets(Set<String> myTargets, Set<String> otherTargets) { 49 + 50 + } 51 + 52 + @Override 53 + public List<String> getMixins() { 54 + return Collections.emptyList(); 55 + } 56 + 57 + @Override 58 + public void preApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { 59 + 60 + } 61 + 62 + @Override 63 + public void postApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { 64 + 65 + } 66 + }
+4 -4
src/main/resources/breakfree.mixins.json
··· 2 2 "required": true, 3 3 "minVersion": "0.8", 4 4 "package": "io.github.justapotota.breakfree.mixin", 5 - "compatibilityLevel": "JAVA_16", 6 - "mixins": [ 7 - ], 5 + "compatibilityLevel": "JAVA_8", 6 + "plugin": "io.github.justapotota.breakfree.mixin.ConfigPlugin", 8 7 "client": [ 9 - "ClientPlayerInteractionManagerMixin" 8 + "ClientPlayerInteractionManagerMixin119", 9 + "ClientPlayerInteractionManagerMixin120" 10 10 ], 11 11 "injectors": { 12 12 "defaultRequire": 1
+2 -2
src/main/resources/fabric.mod.json
··· 20 20 ], 21 21 "depends": { 22 22 "fabricloader": ">=0.16.10", 23 - "minecraft": "${minecraft_version}", 24 - "java": ">=21" 23 + "minecraft": ">=1.14", 24 + "java": ">=8" 25 25 } 26 26 }