Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to 1.21 #56

Merged
merged 3 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
org.gradle.jvmargs=-Xmx1G

minecraft_version=1.20.6
yarn_mappings=1.20.6+build.3
minecraft_version=1.21
yarn_mappings=1.21+build.1
loader_version=0.15.11

# Fabric API
fabric_version=0.100.0+1.20.6
#Fabric api
fabric_version=0.100.1+1.21

mod_version = 0.6.1+1.20.6
mod_version = 0.6.1+1.21
maven_group = io.github.foundationgames
archives_base_name = animatica

Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ public void onInitializeClient() {
}

public static Identifier id(String path) {
return new Identifier(NAMESPACE, path);
return Identifier.of(NAMESPACE, path);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public void reload(ResourceManager manager) {
for (var targetId : animations.keySet()) {
AnimatedTexture.tryCreate(manager, targetId, animations.get(targetId))
.ifPresent(tex -> {
var animId = new Identifier(targetId.getNamespace(), targetId.getPath() + "-anim");
var animId = Identifier.of(targetId.getNamespace(), targetId.getPath() + "-anim");
this.animationIds.put(targetId, animId);
this.animatedTextures.add(tex);
tex.registerTexture(MinecraftClient.getInstance().getTextureManager(), manager, animId, MinecraftClient.getInstance());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ public static AnimationMeta of(Identifier file, Properties properties) throws Pr
Identifier source;
Identifier target;
try {
source = Utilities.processPath(file, new Identifier(PropertyUtil.get(file, properties, "from")));
source = Utilities.processPath(file, Identifier.of(PropertyUtil.get(file, properties, "from")));
} catch (InvalidIdentifierException ex) { throw new InvalidPropertyException(file, "from", "resource location"); }
try {
target = Utilities.processPath(file, new Identifier(PropertyUtil.get(file, properties, "to")));
target = Utilities.processPath(file, Identifier.of(PropertyUtil.get(file, properties, "to")));
} catch (InvalidIdentifierException ex) { throw new InvalidPropertyException(file, "to", "resource location"); }
return new AnimationMeta(
source,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
// Allows invalid characters in paths to support packs with extremely outdated formatting (because OptiFine does too)
@Mixin(Identifier.class)
public class IdentifierMixin {
@Inject(method = "<init>([Ljava/lang/String;)V", at = @At("TAIL"))
private void animatica$reportInvalidIdentifierCharacters(String[] id, CallbackInfo ci) {
if (Flags.ALLOW_INVALID_ID_CHARS && !animatica$isPathAllowed(id[1]) && !id[1].startsWith("~/")) {
Animatica.LOG.warn("Legacy resource pack is using an invalid namespaced identifier '{}:{}'! DO NOT use non [a-z0-9_.-] characters for resource pack files and file names!", id[0], id[1]);
@Inject(method = "of(Ljava/lang/String;)Lnet/minecraft/util/Identifier;", at = @At("TAIL"))
private static void animatica$reportInvalidIdentifierCharacters(String id, CallbackInfoReturnable<Identifier> ci) {
if (Flags.ALLOW_INVALID_ID_CHARS && !animatica$isPathAllowed(Identifier.splitOn(id, ':').getPath()) && !Identifier.splitOn(id, ':').getPath().startsWith("~/")) {
Animatica.LOG.warn("Legacy resource pack is using an invalid namespaced identifier '{}'! DO NOT use non [a-z0-9_.-] characters for resource pack files and file names!", id);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ protected VideoOptionsScreenMixin(Text title) {
}

@ModifyArg(
method = "init",
method = "addOptions",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/client/gui/widget/OptionListWidget;addAll([Lnet/minecraft/client/option/SimpleOption;)V"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ public static Identifier processPath(Identifier fileRelativeTo, Identifier path)
if (lInd > 0) {
var builder = new StringBuilder(fileRelativeTo.getPath());
builder.replace(lInd, builder.length(), path.getPath().replaceFirst("\\./", "/"));
return new Identifier(fileRelativeTo.getNamespace(), builder.toString());
return Identifier.of(fileRelativeTo.getNamespace(), builder.toString());
}
} else if (path.getPath().startsWith("~/")) {
return new Identifier(path.getNamespace(), path.getPath().replaceFirst("~/", "optifine/"));
return Identifier.of(path.getNamespace(), path.getPath().replaceFirst("~/", "optifine/"));
}
return path;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"depends": {
"fabricloader": ">=0.11.3",
"fabric": "*",
"minecraft": ">=1.20.5",
"minecraft": ">=1.21",
"java": ">=21"
}
}
Loading