https://modrinth.com/mod/breakfree

feat: update to 26.1-snapshot-1

+35 -123
+6 -9
build.gradle
··· 1 1 plugins { 2 - id 'fabric-loom' version "${loom_version}" 2 + id 'net.fabricmc.fabric-loom' version "${loom_version}" 3 3 id 'maven-publish' 4 4 } 5 5 ··· 11 11 } 12 12 13 13 dependencies { 14 - // To change the versions see the gradle.properties file 15 14 minecraft "com.mojang:minecraft:${project.minecraft_version}" 16 - mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" 17 - modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" 15 + implementation "net.fabricmc:fabric-loader:${project.loader_version}" 18 16 } 19 17 20 18 processResources { 21 19 inputs.property "version", project.version 22 - inputs.property "minecraft_version", project.minecraft_version 23 20 24 21 filesMatching("fabric.mod.json") { 25 - expand "version": inputs.properties.version, "minecraft_version": inputs.properties.minecraft_version 22 + expand "version": inputs.properties.version 26 23 } 27 24 } 28 25 29 26 tasks.withType(JavaCompile).configureEach { 30 - it.options.release = 8 27 + it.options.release = 25 31 28 } 32 29 33 30 java { ··· 36 33 // If you remove this line, sources will not be generated. 37 34 withSourcesJar() 38 35 39 - sourceCompatibility = JavaVersion.VERSION_17 40 - targetCompatibility = JavaVersion.VERSION_17 36 + sourceCompatibility = JavaVersion.VERSION_25 37 + targetCompatibility = JavaVersion.VERSION_25 41 38 } 42 39 43 40 jar {
+4 -5
gradle.properties
··· 4 4 5 5 # Fabric Properties 6 6 # check these on https://fabricmc.net/versions.html 7 - minecraft_version=25w36b 8 - yarn_mappings=25w36b+build.2 9 - loader_version=0.17.2 10 - loom_version=1.11-SNAPSHOT 7 + minecraft_version=26.1-snapshot-1 8 + loader_version=0.18.3 9 + loom_version=1.14-SNAPSHOT 11 10 12 11 # Mod Properties 13 12 mod_version=1.4.0 14 - maven_group=io.github.justapotota 13 + maven_group=dev.potota 15 14 archives_base_name=breakfree
+1 -1
gradle/wrapper/gradle-wrapper.properties
··· 1 1 distributionBase=GRADLE_USER_HOME 2 2 distributionPath=wrapper/dists 3 - distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip 3 + distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip 4 4 networkTimeout=10000 5 5 validateDistributionUrl=true 6 6 zipStoreBase=GRADLE_USER_HOME
+15
src/main/java/dev/potota/breakfree/mixin/MultiPlayerGameModeMixin.java
··· 1 + package dev.potota.breakfree.mixin; 2 + 3 + import net.minecraft.client.multiplayer.MultiPlayerGameMode; 4 + import net.minecraft.world.item.ItemStack; 5 + import org.spongepowered.asm.mixin.Mixin; 6 + import org.spongepowered.asm.mixin.injection.At; 7 + import org.spongepowered.asm.mixin.injection.Redirect; 8 + 9 + @Mixin(MultiPlayerGameMode.class) 10 + public abstract class MultiPlayerGameModeMixin { 11 + @Redirect(method = "sameDestroyTarget", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/item/ItemStack;isSameItemSameComponents(Lnet/minecraft/world/item/ItemStack;Lnet/minecraft/world/item/ItemStack;)Z")) 12 + private boolean breakfree$forceSameItem(ItemStack a, ItemStack b) { 13 + return true; 14 + } 15 + }
-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 - }
-18
src/main/java/io/github/justapotota/breakfree/mixin/ClientPlayerInteractionManagerMixin120.java
··· 1 - package io.github.justapotota.breakfree.mixin; 2 - 3 - import net.minecraft.client.network.ClientPlayerInteractionManager; 4 - import net.minecraft.item.ItemStack; 5 - import org.spongepowered.asm.mixin.Mixin; 6 - import org.spongepowered.asm.mixin.Shadow; 7 - import org.spongepowered.asm.mixin.injection.At; 8 - import org.spongepowered.asm.mixin.injection.ModifyVariable; 9 - 10 - @Mixin(ClientPlayerInteractionManager.class) 11 - public class ClientPlayerInteractionManagerMixin120 { 12 - @Shadow private ItemStack selectedStack; 13 - 14 - @ModifyVariable(method = "isCurrentlyBreaking", at = @At("STORE")) 15 - private ItemStack stack(ItemStack stack) { 16 - return this.selectedStack; 17 - } 18 - }
-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 - }
+3 -5
src/main/resources/breakfree.mixins.json
··· 1 1 { 2 2 "required": true, 3 3 "minVersion": "0.8", 4 - "package": "io.github.justapotota.breakfree.mixin", 5 - "compatibilityLevel": "JAVA_8", 6 - "plugin": "io.github.justapotota.breakfree.mixin.ConfigPlugin", 4 + "package": "dev.potota.breakfree.mixin", 5 + "compatibilityLevel": "JAVA_21", 7 6 "client": [ 8 - "ClientPlayerInteractionManagerMixin119", 9 - "ClientPlayerInteractionManagerMixin120" 7 + "MultiPlayerGameModeMixin" 10 8 ], 11 9 "injectors": { 12 10 "defaultRequire": 1
+6 -5
src/main/resources/fabric.mod.json
··· 7 7 "authors": ["Potota"], 8 8 "contact": { 9 9 "homepage": "https://modrinth.com/mod/breakfree", 10 - "sources": "https://github.com/JustAPotota/fabric-breakfree", 11 - "issues": "https://github.com/JustAPotota/fabric-breakfree/issues" 10 + "sources": "https://tangled.org/potota54.bsky.social/minecraft-breakfree", 11 + "issues": "https://tangled.org/potota54.bsky.social/minecraft-breakfree/issues", 12 + "discord": "https://discord.gg/PKK2RkNhYd" 12 13 }, 13 14 "license": "unlicense", 14 15 "icon": "assets/breakfree/icon.png", ··· 19 20 "breakfree.mixins.json" 20 21 ], 21 22 "depends": { 22 - "fabricloader": ">=0.16.10", 23 - "minecraft": ">=1.14", 24 - "java": ">=8" 23 + "fabricloader": ">=0.18.0", 24 + "minecraft": ">=26.1-alpha.1", 25 + "java": ">=21" 25 26 } 26 27 }