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

new config option for autohost to force resource pack to be optional #162

Merged
merged 2 commits into from
Dec 8, 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
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ static <T> void register(Identifier identifier, Supplier<ResourcePackDataProvide
Collection<MinecraftServer.ServerResourcePackProperties> getProperties(ClientConnection connection);

static MinecraftServer.ServerResourcePackProperties createProperties(@Nullable UUID uuid, String address, @Nullable String hash) {
return new MinecraftServer.ServerResourcePackProperties(uuid != null
? uuid : UUID.nameUUIDFromBytes(address.getBytes(StandardCharsets.UTF_8)),
return new MinecraftServer.ServerResourcePackProperties(
uuid != null ? uuid : UUID.nameUUIDFromBytes(address.getBytes(StandardCharsets.UTF_8)),
address,
hash != null ? hash : "",
AutoHost.config.require || PolymerResourcePackUtils.isRequired(), AutoHost.message);
AutoHost.config.require || (AutoHost.config.modOverride && PolymerResourcePackUtils.isRequired()),
AutoHost.message
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,17 @@ public class AutoHostConfig {
public String _c2 = "Marks resource pack as required";
@SerializedName("required")
public boolean require = false;
public String _c3 = "Type of resource pack provider. Default: 'polymer:automatic'";
public String _c3 = "Mods may override the above setting and make the resource pack required, set this to false to disable that.";
@SerializedName("mod_override")
public boolean modOverride = true;
public String _c4 = "Type of resource pack provider. Default: 'polymer:automatic'";
public String type = "polymer:automatic";
public String _c4 = "Configuration of type, see provider's source for more details";
public String _c5 = "Configuration of type, see provider's source for more details";
@SerializedName("settings")
public JsonElement providerSettings = new JsonObject();
public String _c5 = "Message sent to clients before pack is loaded";
public String _c6 = "Message sent to clients before pack is loaded";
public JsonElement message = new JsonPrimitive("This server uses resource pack to enhance gameplay with custom textures and models. It might be unplayable without them.");
public String _c6 = "Disconnect message in case of failure";
public String _c7 = "Disconnect message in case of failure";
@SerializedName("disconnect_message")
public JsonElement disconnectMessage = new JsonPrimitive("Couldn't apply server resourcepack!");

Expand All @@ -39,4 +42,4 @@ public static class ExternalResourcePack {
public String url;
public String hash;
}
}
}
Loading