Skip to content

Commit

Permalink
Puzzle 1.4.2 - Update to 1.19.3
Browse files Browse the repository at this point in the history
Here's a little Christmas present for y'all!
Puzzle now has 1.19.3 support.
  • Loading branch information
Motschen committed Dec 24, 2022
1 parent a8c89b1 commit 12015d6
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 48 deletions.
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,18 @@ dependencies {
}
modImplementation ("maven.modrinth:cull-leaves:${project.cull_leaves_version}")
modImplementation ("maven.modrinth:lambdynamiclights:${project.ldl_version}")
modImplementation ("maven.modrinth:lambdabettergrass:${project.lbg_version}")
modCompileOnlyApi ("maven.modrinth:lambdabettergrass:${project.lbg_version}")
modImplementation ("maven.modrinth:iris:${project.iris_version}")
modCompileOnly ("maven.modrinth:cit-resewn:${project.cit_resewn_version}")
modImplementation ("maven.modrinth:continuity:${project.continuity_version}")
modCompileOnlyApi ("maven.modrinth:continuity:${project.continuity_version}")
modImplementation ("maven.modrinth:animatica:${project.animatica_version}")
modImplementation ("maven.modrinth:colormatic:${project.colormatic_version}")
modCompileOnlyApi ("maven.modrinth:colormatic:${project.colormatic_version}")
modImplementation ("maven.modrinth:borderless-mining:${project.borderless_mining_version}")
modImplementation ("maven.modrinth:dynamic-fps:${project.dynamic_fps_version}")
modImplementation("com.moandjiezana.toml:toml4j:${project.toml4j_version}")
modImplementation ("maven.modrinth:entitytexturefeatures:${project.entitytexturefeatures_version}")
modImplementation ("maven.modrinth:cem:${project.cem_version}")
modImplementation "com.gitlab.Lortseam:completeconfig:${project.complete_config_version}"
modImplementation "com.github.Lortseam.completeconfig:base:${project.complete_config_version}"

modImplementation("org.aperlambda:lambdajcommon:1.8.1") {
exclude group: 'com.google.code.gson'
Expand Down
30 changes: 15 additions & 15 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,33 @@ org.gradle.jvmargs=-Xmx4G

# Fabric Properties
# check these on https://fabricmc.net/use
minecraft_version=1.19
yarn_mappings=1.19+build.4
loader_version=0.14.8
minecraft_version=1.19.3
yarn_mappings=1.19.3+build.5
loader_version=0.14.12

# Mod Properties
mod_version = 1.4.0-1.19
mod_version = 1.4.2-1.19.3
maven_group = net.puzzlemc
archives_base_name = puzzle

# Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
fabric_version=0.57.0+1.19
mod_menu_version = 4.0.0
fabric_version=0.70.0+1.19.3
mod_menu_version = 5.0.2

cull_leaves_version = 2.3.3
ldl_version = 2.1.2+1.19
cull_leaves_version = 3.0.2-fabric
ldl_version = 2.2.0+1.19.3
lbg_version = 1.3.0+1.19
iris_version = 1.19.x-v1.2.5
iris_version = 1.19.3-v1.4.6
continuity_version = 2.0.0+1.19
animatica_version = 0.5+1.19
colormatic_version = 3.1.2
borderless_mining_version = 1.1.5+1.19
borderless_mining_version = 1.1.6+1.19.3
dynamic_fps_version = 2.2.0
toml4j_version = 0.7.2
cit_resewn_version = 1.1.1+1.19
cem_version = 0.7.1-1.19
complete_config_version = 1.0.0
spruceui_version=4.0.0+1.19
midnightlib_version=0.5.2
entitytexturefeatures_version=4.0.1.fabric
cem_version = 0.7.1-1.19.3
complete_config_version = 2.2.0
spruceui_version=4.1.0+1.19.3
midnightlib_version=1.1.0-fabric
entitytexturefeatures_version=4.2.0.1.fabric.1.19.3
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ private void confirmLink(boolean open) {
private void puzzle$mouseClicked(double mouseX, double mouseY, int button, CallbackInfoReturnable<Boolean> cir) {
if (mouseX > 2 && mouseX < (double)(2 + this.puzzleTextWidth) && mouseY > (double)(this.height - yOffset) && mouseY < (double)this.height - yOffset + 10) {
if (Objects.requireNonNull(this.client).options.getChatLinksPrompt().getValue()) {
this.client.setScreen(new ConfirmChatLinkScreen(this::confirmLink, PuzzleCore.updateURL, true));
this.client.setScreen(new ConfirmLinkScreen(this::confirmLink, PuzzleCore.updateURL, true));
} else {
Util.getOperatingSystem().open(PuzzleCore.updateURL);
}
Expand Down
8 changes: 4 additions & 4 deletions puzzle-gui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,21 @@ dependencies {
modImplementation ("com.terraformersmc:modmenu:${project.mod_menu_version}")
modImplementation ("maven.modrinth:cull-leaves:${project.cull_leaves_version}")
modImplementation ("maven.modrinth:lambdynamiclights:${project.ldl_version}")
modImplementation ("maven.modrinth:lambdabettergrass:${project.lbg_version}")
modCompileOnlyApi ("maven.modrinth:lambdabettergrass:${project.lbg_version}")
modImplementation ("maven.modrinth:iris:${project.iris_version}")
modImplementation ("maven.modrinth:cit-resewn:${project.cit_resewn_version}")
modImplementation ("maven.modrinth:colormatic:${project.colormatic_version}")
modCompileOnlyApi ("maven.modrinth:colormatic:${project.colormatic_version}")
modImplementation ("maven.modrinth:borderless-mining:${project.borderless_mining_version}")
modImplementation ("maven.modrinth:dynamic-fps:${project.dynamic_fps_version}")
modImplementation ("maven.modrinth:entitytexturefeatures:${project.entitytexturefeatures_version}")
modImplementation ("maven.modrinth:cem:${project.cem_version}")
modImplementation "com.gitlab.Lortseam:completeconfig:${project.complete_config_version}"
modImplementation "com.github.Lortseam.completeconfig:base:${project.complete_config_version}"

modImplementation("org.aperlambda:lambdajcommon:1.8.1") {
exclude group: 'com.google.code.gson'
exclude group: 'com.google.guava'
}
modImplementation ("maven.modrinth:continuity:${project.continuity_version}") {
modCompileOnlyApi ("maven.modrinth:continuity:${project.continuity_version}") {
exclude module: "modmenu"
}
}
7 changes: 4 additions & 3 deletions puzzle-gui/src/main/java/net/puzzlemc/gui/PuzzleClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import traben.entity_texture_features.ETFApi;
import traben.entity_texture_features.config.ETFConfig;
import io.github.kvverti.colormatic.ColormaticConfig;
import traben.entity_texture_features.texture_handlers.ETFManager;

public class PuzzleClient implements ClientModInitializer {

Expand Down Expand Up @@ -265,9 +266,9 @@ public static void lateInit() { // Some mods are initialized after Puzzle, so we
etfConfig.enableEmissiveTextures = !etfConfig.enableEmissiveTextures;
ETFApi.saveETFConfigChangesAndResetETF();
}));
PuzzleApi.addToResourceOptions(new PuzzleWidget(Text.translatable("config.entity_texture_features.full_bright_emissives.title"), (button) -> button.setMessage(
etfConfig.fullBrightEmissives ? Text.translatable("entity_texture_features.puzzle.emissive_type.brighter") : Text.translatable("entity_texture_features.puzzle.emissive_type.default")), (button) -> {
etfConfig.fullBrightEmissives = !etfConfig.fullBrightEmissives ;
PuzzleApi.addToResourceOptions(new PuzzleWidget(Text.translatable("config.entity_texture_features.emissive_mode.title"), (button) -> button.setMessage(
Text.literal(etfConfig.emissiveRenderMode.toString())), (button) -> {
etfConfig.emissiveRenderMode = etfConfig.emissiveRenderMode.next();
ETFApi.saveETFConfigChangesAndResetETF();
}));
PuzzleApi.addToResourceOptions(new PuzzleWidget(Text.translatable("config.entity_texture_features.blinking_mob_settings.title"), (button) -> button.setMessage(etfConfig.enableBlinking ? YES : NO), (button) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ protected void init() {
PerformancePage performancePage = new PerformancePage(this);
ResourcesPage resourcesPage = new ResourcesPage(this);

if (!PuzzleApi.GRAPHICS_OPTIONS.isEmpty()) this.addDrawableChild(new ButtonWidget(this.width / 2 - 155, this.height / 6 + 48 - 6, 150, 20, graphicsPage.getTitle().copy().append("..."), (button) -> Objects.requireNonNull(client).setScreen(graphicsPage)));
if (!PuzzleApi.RESOURCE_OPTIONS.isEmpty()) this.addDrawableChild(new ButtonWidget(this.width / 2 + 5, this.height / 6 + 48 - 6, 150, 20, resourcesPage.getTitle().copy().append("..."), (button) -> Objects.requireNonNull(client).setScreen(resourcesPage)));
if (!PuzzleApi.PERFORMANCE_OPTIONS.isEmpty()) this.addDrawableChild(new ButtonWidget(this.width / 2 - 155, this.height / 6 + 72 - 6, 150, 20, performancePage.getTitle().copy().append("..."), (button) -> Objects.requireNonNull(client).setScreen(performancePage)));
if (!PuzzleApi.MISC_OPTIONS.isEmpty()) this.addDrawableChild(new ButtonWidget(this.width / 2 + 5, this.height / 6 + 72 - 6, 150, 20, miscPage.getTitle().copy().append("..."), (button) -> Objects.requireNonNull(client).setScreen(miscPage)));
this.addDrawableChild(new ButtonWidget(this.width / 2 - 100, this.height / 6 + 168, 200, 20, ScreenTexts.DONE, (button) -> Objects.requireNonNull(client).setScreen(parent)));
if (!PuzzleApi.GRAPHICS_OPTIONS.isEmpty()) this.addDrawableChild(ButtonWidget.builder(graphicsPage.getTitle().copy().append("..."), (button) -> Objects.requireNonNull(client).setScreen(graphicsPage)).dimensions(this.width / 2 - 155, this.height / 6 + 48 - 6, 150, 20).build());
if (!PuzzleApi.RESOURCE_OPTIONS.isEmpty()) this.addDrawableChild(ButtonWidget.builder(resourcesPage.getTitle().copy().append("..."), (button) -> Objects.requireNonNull(client).setScreen(resourcesPage)).dimensions(this.width / 2 + 5, this.height / 6 + 48 - 6, 150, 20).build());
if (!PuzzleApi.PERFORMANCE_OPTIONS.isEmpty()) this.addDrawableChild(ButtonWidget.builder(performancePage.getTitle().copy().append("..."), (button) -> Objects.requireNonNull(client).setScreen(performancePage)).dimensions(this.width / 2 - 155, this.height / 6 + 72 - 6, 150, 20).build());
if (!PuzzleApi.MISC_OPTIONS.isEmpty()) this.addDrawableChild(ButtonWidget.builder(miscPage.getTitle().copy().append("..."), (button) -> Objects.requireNonNull(client).setScreen(miscPage)).dimensions(this.width / 2 + 5, this.height / 6 + 72 - 6, 150, 20).build());
this.addDrawableChild(ButtonWidget.builder(ScreenTexts.DONE, (button) -> Objects.requireNonNull(client).setScreen(parent)).dimensions(this.width / 2 - 100, this.height / 6 + 168, 200, 20).build());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected void init() {

super.init();

this.addDrawableChild(new ButtonWidget(this.width / 2 - 100, this.height - 28, 200, 20, ScreenTexts.DONE, (button) -> Objects.requireNonNull(client).setScreen(parent)));
this.addDrawableChild(ButtonWidget.builder(ScreenTexts.DONE, (button) -> Objects.requireNonNull(client).setScreen(parent)).dimensions(this.width / 2 - 100, this.height - 28, 200, 20).build());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.Text;

import java.util.function.Supplier;

public class PuzzleButtonWidget extends ButtonWidget {
private final PuzzleWidget.TextAction title;

public PuzzleButtonWidget(int x, int y, int width, int height, PuzzleWidget.TextAction title, PressAction onPress) {
super(x, y, width, height, Text.of(""), onPress);
super(x, y, width, height, Text.of(""), onPress, Supplier::get);
this.title = title;
}
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public static ButtonEntry create(ClickableWidget button, Text text) {

public void render(MatrixStack matrices, int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean hovered, float tickDelta) {
if (button != null) {
button.y = y;
button.setY(y);
button.render(matrices, mouseX, mouseY, tickDelta);
}
if (button == null) drawCenteredText(matrices,textRenderer, Text.literal("------ ").append(text).append(" ------"),x + 200,y+5,0xFFFFFF);
Expand All @@ -105,10 +105,10 @@ public void render(MatrixStack matrices, int index, int y, int x, int entryWidth
}
}
public int getY() {
return button.y;
return button.getY();
}
public int getX() {
return button.x;
return button.getX();
}
public int getHeight() {
return button.getHeight();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import com.google.gson.JsonParseException;
import net.minecraft.client.render.model.json.ModelElement;
import net.minecraft.util.JsonHelper;
import net.minecraft.util.math.Vec3f;
import net.puzzlemc.core.config.PuzzleConfig;
import org.joml.Vector3f;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -14,7 +14,7 @@

@Mixin(ModelElement.Deserializer.class)
public abstract class MixinModelElementDeserializer {
@Shadow protected abstract Vec3f deserializeVec3f(JsonObject object, String name);
@Shadow protected abstract Vector3f deserializeVec3f(JsonObject object, String name);

@Inject(at = @At("HEAD"),method = "deserializeRotationAngle", cancellable = true)
private void puzzle$deserializeRotationAngle(JsonObject object, CallbackInfoReturnable<Float> cir) {
Expand All @@ -24,21 +24,21 @@ public abstract class MixinModelElementDeserializer {
}
}
@Inject(at = @At("HEAD"),method = "deserializeTo", cancellable = true)
private void puzzle$deserializeTo(JsonObject object, CallbackInfoReturnable<Vec3f> cir) {
private void puzzle$deserializeTo(JsonObject object, CallbackInfoReturnable<Vector3f> cir) {
if (PuzzleConfig.biggerModels) {
Vec3f vec3f = this.deserializeVec3f(object, "to");
if (!(vec3f.getX() < -32.0F) && !(vec3f.getY() < -32.0F) && !(vec3f.getZ() < -32.0F) && !(vec3f.getX() > 48.0F) && !(vec3f.getY() > 48.0F) && !(vec3f.getZ() > 48.0F)) {
Vector3f vec3f = this.deserializeVec3f(object, "to");
if (!(vec3f.x < -32.0F) && !(vec3f.y < -32.0F) && !(vec3f.z < -32.0F) && !(vec3f.x > 48.0F) && !(vec3f.y > 48.0F) && !(vec3f.z > 48.0F)) {
cir.setReturnValue(vec3f);
} else {
throw new JsonParseException("'to' specifier exceeds the allowed boundaries: " + vec3f);
}
}
}
@Inject(at = @At("HEAD"),method = "deserializeFrom", cancellable = true)
private void puzzle$deserializeFrom(JsonObject object, CallbackInfoReturnable<Vec3f> cir) {
private void puzzle$deserializeFrom(JsonObject object, CallbackInfoReturnable<Vector3f> cir) {
if (PuzzleConfig.biggerModels) {
Vec3f vec3f = this.deserializeVec3f(object, "from");
if (!(vec3f.getX() < -32.0F) && !(vec3f.getY() < -32.0F) && !(vec3f.getZ() < -32.0F) && !(vec3f.getX() > 48.0F) && !(vec3f.getY() > 48.0F) && !(vec3f.getZ() > 48.0F)) {
Vector3f vec3f = this.deserializeVec3f(object, "from");
if (!(vec3f.x < -32.0F) && !(vec3f.y < -32.0F) && !(vec3f.z < -32.0F) && !(vec3f.x > 48.0F) && !(vec3f.y > 48.0F) && !(vec3f.z > 48.0F)) {
cir.setReturnValue(vec3f);
} else {
throw new JsonParseException("'from' specifier exceeds the allowed boundaries: " + vec3f);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import java.util.Objects;
import java.util.Properties;

public class PuzzleSplashScreen implements ClientModInitializer {
Expand Down Expand Up @@ -138,9 +139,9 @@ public static class LogoTexture extends ResourceTexture {

protected TextureData loadTextureData(ResourceManager resourceManager) {
MinecraftClient minecraftClient = MinecraftClient.getInstance();
DefaultResourcePack defaultResourcePack = minecraftClient.getResourcePackProvider().getPack();
DefaultResourcePack defaultResourcePack = minecraftClient.getDefaultResourcePack();
try {
InputStream inputStream = defaultResourcePack.open(ResourceType.CLIENT_RESOURCES, LOGO);
InputStream inputStream = Objects.requireNonNull(defaultResourcePack.open(ResourceType.CLIENT_RESOURCES, LOGO)).get();
TextureData var6;
try {
var6 = new TextureData(new TextureResourceMetadata(true, true), NativeImage.read(inputStream));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ else if (reloading)
RenderSystem.enableBlend();
RenderSystem.blendEquation(32774);
RenderSystem.defaultBlendFunc();
RenderSystem.setShader(GameRenderer::getPositionTexShader);
RenderSystem.setShader(GameRenderer::getPositionTexProgram);
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, s);
drawTexture(matrices, 0, 0, 0, 0, 0, width, height, width, height);
RenderSystem.defaultBlendFunc();
Expand Down

0 comments on commit 12015d6

Please sign in to comment.