Skip to content

Commit 16acfbb

Browse files
committed
Initial port of everything to the unobfuscated builds
1 parent d0d8605 commit 16acfbb

63 files changed

Lines changed: 607 additions & 619 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

build.gradle

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ buildscript {
44
}
55
}
66
plugins {
7-
id 'java-library'
8-
id 'fabric-loom' version '1.13-SNAPSHOT'
7+
id "net.fabricmc.fabric-loom-no-remap" version "1.14.0-alpha.20"
98
id 'maven-publish'
109
id 'com.modrinth.minotaur' version '2.+'
1110
id 'org.ajoberstar.reckon' version '0.13.1'
@@ -23,13 +22,9 @@ group = project.group
2322
description = project.displayname
2423
archivesBaseName = project.name
2524

26-
loom {
27-
mixin.defaultRefmapName = 'presencefootsteps.mixin.refmap.json'
28-
}
29-
3025
reckon {
3126
scopeFromProp()
32-
stageFromProp('beta', 'rc', 'final')
27+
stageFromProp('beta', 'rc', 'final', 'unobf')
3328
}
3429

3530
outlet {
@@ -50,28 +45,25 @@ repositories {
5045

5146
dependencies {
5247
minecraft "com.mojang:minecraft:${project.minecraft_version}"
53-
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
54-
modApi "net.fabricmc:fabric-loader:${project.loader_version}"
55-
56-
modApi fabricApi.module("fabric-api-base", project.fabric_version)
57-
modApi fabricApi.module("fabric-lifecycle-events-v1", project.fabric_version)
58-
modApi fabricApi.module("fabric-key-binding-api-v1", project.fabric_version)
59-
modApi fabricApi.module("fabric-screen-api-v1", project.fabric_version)
60-
modApi fabricApi.module("fabric-resource-loader-v0", project.fabric_version)
61-
modApi fabricApi.module("fabric-block-api-v1", project.fabric_version)
62-
modImplementation fabricApi.module("fabric-transitive-access-wideners-v1", project.fabric_version)
63-
64-
modApi "com.minelittlepony:kirin:${project.kirin_version}"
48+
api "net.fabricmc:fabric-loader:${project.loader_version}"
49+
50+
api fabricApi.module("fabric-api-base", project.fabric_version)
51+
api fabricApi.module("fabric-lifecycle-events-v1", project.fabric_version)
52+
api fabricApi.module("fabric-key-binding-api-v1", project.fabric_version)
53+
api fabricApi.module("fabric-screen-api-v1", project.fabric_version)
54+
api fabricApi.module("fabric-resource-loader-v0", project.fabric_version)
55+
api fabricApi.module("fabric-block-api-v1", project.fabric_version)
56+
implementation fabricApi.module("fabric-transitive-access-wideners-v1", project.fabric_version)
57+
58+
api "com.minelittlepony:kirin:${project.kirin_version}"
6559
include "com.minelittlepony:kirin:${project.kirin_version}"
6660

6761
if (project.use_minelp == '1') {
68-
modCompileOnly "com.minelittlepony:minelittlepony:${project.minelp_version}"
62+
compileOnly "com.minelittlepony:minelittlepony:${project.minelp_version}"
6963
} else {
70-
modCompileOnly "com.minelittlepony:minelittlepony-dummy:${project.minelp_version}"
64+
compileOnly "com.minelittlepony:minelittlepony-dummy:${project.minelp_version}"
7165
}
72-
modCompileOnly("com.terraformersmc:modmenu:${project.modmenu_version}")
73-
74-
// modImplementation "com.github.Virtuoel:Pehkui:${project.pehkui_version}"
66+
//compileOnly("com.terraformersmc:modmenu:${project.modmenu_version}")
7567
}
7668

7769
processResources {
@@ -96,7 +88,7 @@ tasks.withType(JavaCompile) {
9688
tasks.modrinth {
9789
onlyIf {
9890
def stage = version.version.stage.value
99-
stage == null || stage.name != 'beta'
91+
(stage == null || (stage.name != 'beta' && stage != 'unobf')) && version.toString().indexOf("unobf") == -1
10092
}
10193
}
10294

@@ -108,7 +100,7 @@ modrinth {
108100
versionName = archivesBaseName + '-' + version
109101
changelog = "[Changelog](https://github.com/Sollace/Presence-Footsteps/releases/tag/${version.toString()})"
110102
loaders = ['fabric', 'quilt']
111-
uploadFile = remapJar
103+
uploadFile = jar
112104
outlet.mcVersions().each{ver ->
113105
gameVersions.add ver
114106
}

gradle.properties

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ org.gradle.daemon=false
33

44
# Fabric Properties
55
# check these on https://fabricmc.net/develop
6-
minecraft_version=1.21.11-pre1
7-
yarn_mappings=1.21.11-pre1+build.1
8-
loader_version=0.17.3
9-
fabric_version=0.139.1+1.21.11
6+
minecraft_version=1.21.11-pre1_unobfuscated
7+
loader_version=0.18.0
8+
fabric_version=0.138.3+1.21.11_unobfuscated
109

1110
# Mod Properties
1211
group=com.presencefootsteps
@@ -26,5 +25,4 @@ org.gradle.daemon=false
2625
# Dependencies
2726
modmenu_version=17.0.0-alpha.1
2827
minelp_version=4.15.0-beta.7+1.21.10
29-
kirin_version=1.21.4+1.21.11
30-
pehkui_version=3.7.2
28+
kirin_version=1.21.4+1.21.11-unobf

src/main/java/eu/ha3/mc/quick/update/TargettedVersion.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
package eu.ha3.mc.quick.update;
22

33
import com.google.gson.JsonObject;
4-
54
import net.fabricmc.loader.api.FabricLoader;
65
import net.fabricmc.loader.api.ModContainer;
76
import net.fabricmc.loader.api.Version;
87
import net.fabricmc.loader.api.VersionParsingException;
98
import net.fabricmc.loader.api.metadata.ModMetadata;
10-
import net.minecraft.util.JsonHelper;
9+
import net.minecraft.util.GsonHelper;
1110

1211
public record TargettedVersion (
1312
Version minecraft,
1413
Version version) {
1514

1615
public TargettedVersion(JsonObject json) throws VersionParsingException {
1716
this(
18-
Version.parse(JsonHelper.getString(json, "minecraft")),
19-
Version.parse(JsonHelper.getString(json, "version")));
17+
Version.parse(GsonHelper.getAsString(json, "minecraft")),
18+
Version.parse(GsonHelper.getAsString(json, "version")));
2019
}
2120

2221
public TargettedVersion(String modid) {

src/main/java/eu/ha3/mc/quick/update/UpdateChecker.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public CompletableFuture<Optional<Versions>> checkNow() {
7272
} catch (Exception e) {
7373
throw new RuntimeException(e);
7474
}
75-
}, Util.getIoWorkerExecutor()).exceptionally(e -> {
75+
}, Util.ioPool()).exceptionally(e -> {
7676
LOGGER.error("Error occured whilst checking for updates", e);
7777
return null;
7878
});

src/main/java/eu/ha3/mc/quick/update/Versions.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@
33
import com.google.gson.JsonObject;
44
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
55
import net.fabricmc.loader.api.VersionParsingException;
6-
import net.minecraft.util.JsonHelper;
7-
6+
import net.minecraft.util.GsonHelper;
87
import java.util.List;
98

109
public record Versions (
1110
TargettedVersion latest,
1211
List<TargettedVersion> previous) {
1312

1413
public Versions(JsonObject json) throws VersionParsingException {
15-
this(new TargettedVersion(JsonHelper.getObject(json, "latest")), new ObjectArrayList<>());
16-
for (var el : JsonHelper.getArray(json, "previous")) {
14+
this(new TargettedVersion(GsonHelper.getAsJsonObject(json, "latest")), new ObjectArrayList<>());
15+
for (var el : GsonHelper.getAsJsonArray(json, "previous")) {
1716
previous.add(new TargettedVersion(el.getAsJsonObject()));
1817
}
1918
}

src/main/java/eu/ha3/presencefootsteps/PFConfig.java

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@
1111
import eu.ha3.presencefootsteps.config.EntitySelector;
1212
import eu.ha3.presencefootsteps.config.VolumeOption;
1313
import eu.ha3.presencefootsteps.sound.generator.Locomotion;
14-
import net.minecraft.entity.EntityType;
15-
import net.minecraft.registry.Registries;
16-
import net.minecraft.util.Identifier;
17-
import net.minecraft.util.crash.CrashReportSection;
18-
import net.minecraft.util.math.MathHelper;
14+
import net.minecraft.CrashReportCategory;
15+
import net.minecraft.resources.Identifier;
16+
import net.minecraft.util.Mth;
17+
import net.minecraft.world.entity.EntityType;
1918

2019
public class PFConfig extends Config {
2120

@@ -81,9 +80,9 @@ public class PFConfig extends Config {
8180
.addComment("Default: ALL");
8281

8382
public final Setting<Set<Identifier>> ignoredEntityTypes = this.<Identifier, Set<Identifier>>value("compatibility", "ignoredEntityTypes", () -> new HashSet<Identifier>(Set.of(
84-
Identifier.ofVanilla("ghast"),
85-
Identifier.ofVanilla("happy_ghast"),
86-
Identifier.ofVanilla("phantom")
83+
Identifier.withDefaultNamespace("ghast"),
84+
Identifier.withDefaultNamespace("happy_ghast"),
85+
Identifier.withDefaultNamespace("phantom")
8786
)), Identifier.class)
8887
.addComment("A list of entity type for any types of mobs that should never produce footsteps. Usually should be any flying 'bird' mobs.")
8988
.addComment("Default: minecraft:ghast, minecraft:happy_ghast, minecraft:phantom");
@@ -93,7 +92,7 @@ public class PFConfig extends Config {
9392

9493
public PFConfig(Path file, PresenceFootsteps pf) {
9594
super(new HeirarchicalJsonConfigAdapter(new GsonBuilder()
96-
.registerTypeAdapter(Identifier.class, new ToStringAdapter<>(Identifier::toString, Identifier::of))
95+
.registerTypeAdapter(Identifier.class, new ToStringAdapter<>(Identifier::toString, Identifier::parse))
9796
), file);
9897
this.pf = pf;
9998
}
@@ -106,7 +105,7 @@ public boolean toggleMultiplayer() {
106105
}
107106

108107
public boolean isIgnoredForFootsteps(EntityType<?> type) {
109-
return this.ignoredEntityTypes.get().contains(Registries.ENTITY_TYPE.getId(type));
108+
return this.ignoredEntityTypes.get().contains(EntityType.getKey(type));
110109
}
111110

112111
public EntitySelector cycleTargetSelector() {
@@ -191,11 +190,11 @@ public boolean getEnabled() {
191190
}
192191

193192
public int getGlobalVolume() {
194-
return MathHelper.clamp(volume.get(), 0, 100);
193+
return Mth.clamp(volume.get(), 0, 100);
195194
}
196195

197196
public int getRunningVolumeIncrease() {
198-
return MathHelper.clamp(runningVolumeIncrease.get(), -100, 100);
197+
return Mth.clamp(runningVolumeIncrease.get(), -100, 100);
199198
}
200199

201200
public float setGlobalVolume(float volume) {
@@ -221,13 +220,13 @@ public float setRunningVolumeIncrease(float volume) {
221220
return getRunningVolumeIncrease();
222221
}
223222

224-
public void populateCrashReport(CrashReportSection section) {
225-
section.add("Disabled", getDisabled());
226-
section.add("Global Volume", volume.get());
227-
section.add("User's Selected Stance", getLocomotion());
228-
section.add("Target Selector", getEntitySelector());
229-
section.add("Enabled Global", global.get());
230-
section.add("Enabled Multiplayer", multiplayer.get());
223+
public void populateCrashReport(CrashReportCategory section) {
224+
section.setDetail("Disabled", getDisabled());
225+
section.setDetail("Global Volume", volume.get());
226+
section.setDetail("User's Selected Stance", getLocomotion());
227+
section.setDetail("Target Selector", getEntitySelector());
228+
section.setDetail("Enabled Global", global.get());
229+
section.setDetail("Enabled Multiplayer", multiplayer.get());
231230
}
232231

233232
private static int volumeScaleToInt(float volume) {

0 commit comments

Comments
 (0)