tangled
alpha
login
or
join now
potota54.bsky.social
/
minecraft-breakfree
0
fork
atom
https://modrinth.com/mod/breakfree
0
fork
atom
overview
issues
pulls
pipelines
the mega jar
JustAPotota
9 months ago
8b557ea9
de00bdb8
+93
-13
7 changed files
expand all
collapse all
unified
split
build.gradle
gradle.properties
src
main
java
io
github
justapotota
breakfree
mixin
ClientPlayerInteractionManagerMixin119.java
ClientPlayerInteractionManagerMixin120.java
ConfigPlugin.java
resources
breakfree.mixins.json
fabric.mod.json
+3
-3
build.gradle
···
27
27
}
28
28
29
29
tasks.withType(JavaCompile).configureEach {
30
30
-
it.options.release = 21
30
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
39
-
sourceCompatibility = JavaVersion.VERSION_21
40
40
-
targetCompatibility = JavaVersion.VERSION_21
39
39
+
sourceCompatibility = JavaVersion.VERSION_17
40
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
7
-
minecraft_version=1.21.6
8
8
-
yarn_mappings=1.21.6+build.1
7
7
+
minecraft_version=1.16
8
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
13
-
mod_version=1.3.0+1.21.6
13
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
11
-
public class ClientPlayerInteractionManagerMixin {
11
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
1
+
package io.github.justapotota.breakfree.mixin;
2
2
+
3
3
+
import net.minecraft.client.network.ClientPlayerInteractionManager;
4
4
+
import org.spongepowered.asm.mixin.Mixin;
5
5
+
import org.spongepowered.asm.mixin.injection.At;
6
6
+
import org.spongepowered.asm.mixin.injection.ModifyVariable;
7
7
+
8
8
+
@Mixin(ClientPlayerInteractionManager.class)
9
9
+
public class ClientPlayerInteractionManagerMixin119 {
10
10
+
@ModifyVariable(method = "isCurrentlyBreaking", at = @At("STORE"))
11
11
+
private boolean bl(boolean original) {
12
12
+
return true;
13
13
+
}
14
14
+
}
+66
src/main/java/io/github/justapotota/breakfree/mixin/ConfigPlugin.java
···
1
1
+
package io.github.justapotota.breakfree.mixin;
2
2
+
3
3
+
import net.fabricmc.loader.api.FabricLoader;
4
4
+
import net.fabricmc.loader.api.SemanticVersion;
5
5
+
import net.fabricmc.loader.api.Version;
6
6
+
import net.fabricmc.loader.api.VersionParsingException;
7
7
+
import org.objectweb.asm.tree.ClassNode;
8
8
+
import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin;
9
9
+
import org.spongepowered.asm.mixin.extensibility.IMixinInfo;
10
10
+
11
11
+
import java.util.Collections;
12
12
+
import java.util.List;
13
13
+
import java.util.Objects;
14
14
+
import java.util.Set;
15
15
+
16
16
+
public class ConfigPlugin implements IMixinConfigPlugin {
17
17
+
private SemanticVersion v1_20;
18
18
+
19
19
+
private Version minecraftVersion;
20
20
+
21
21
+
@Override
22
22
+
public void onLoad(String mixinPackage) {
23
23
+
try {
24
24
+
this.v1_20 = SemanticVersion.parse("1.20");
25
25
+
} catch (VersionParsingException e) {
26
26
+
throw new RuntimeException(e);
27
27
+
}
28
28
+
29
29
+
this.minecraftVersion = FabricLoader.getInstance().getModContainer("minecraft").get().getMetadata().getVersion();
30
30
+
}
31
31
+
32
32
+
@Override
33
33
+
public String getRefMapperConfig() {
34
34
+
return null;
35
35
+
}
36
36
+
37
37
+
@Override
38
38
+
public boolean shouldApplyMixin(String targetClassName, String mixinClassName) {
39
39
+
if (Objects.equals(mixinClassName, "io.github.justapotota.breakfree.mixin.ClientPlayerInteractionManagerMixin120")) {
40
40
+
return this.v1_20.compareTo(this.minecraftVersion) <= 0;
41
41
+
} else if (Objects.equals(mixinClassName, "io.github.justapotota.breakfree.mixin.ClientPlayerInteractionManagerMixin119")) {
42
42
+
return this.v1_20.compareTo(this.minecraftVersion) > 0;
43
43
+
}
44
44
+
return false;
45
45
+
}
46
46
+
47
47
+
@Override
48
48
+
public void acceptTargets(Set<String> myTargets, Set<String> otherTargets) {
49
49
+
50
50
+
}
51
51
+
52
52
+
@Override
53
53
+
public List<String> getMixins() {
54
54
+
return Collections.emptyList();
55
55
+
}
56
56
+
57
57
+
@Override
58
58
+
public void preApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) {
59
59
+
60
60
+
}
61
61
+
62
62
+
@Override
63
63
+
public void postApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) {
64
64
+
65
65
+
}
66
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
5
-
"compatibilityLevel": "JAVA_16",
6
6
-
"mixins": [
7
7
-
],
5
5
+
"compatibilityLevel": "JAVA_8",
6
6
+
"plugin": "io.github.justapotota.breakfree.mixin.ConfigPlugin",
8
7
"client": [
9
9
-
"ClientPlayerInteractionManagerMixin"
8
8
+
"ClientPlayerInteractionManagerMixin119",
9
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
23
-
"minecraft": "${minecraft_version}",
24
24
-
"java": ">=21"
23
23
+
"minecraft": ">=1.14",
24
24
+
"java": ">=8"
25
25
}
26
26
}