mirror of
https://github.com/PuzzleMC/Puzzle.git
synced 2025-12-16 03:45:10 +01:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2ddfe4bd25 |
@@ -20,10 +20,6 @@ public class EMFCompat {
|
|||||||
public static void init() {
|
public static void init() {
|
||||||
PuzzleApi.addToResourceOptions(new PuzzleWidget(Text.translatable("entity_model_features.title")));
|
PuzzleApi.addToResourceOptions(new PuzzleWidget(Text.translatable("entity_model_features.title")));
|
||||||
EMFConfig emfConfig = EMF.config().getConfig();
|
EMFConfig emfConfig = EMF.config().getConfig();
|
||||||
PuzzleApi.addToResourceOptions(new PuzzleWidget(Text.translatable("entity_model_features.config.force_models"), (button) -> button.setMessage(emfConfig.attemptRevertingEntityModelsAlteredByAnotherMod ? YES : NO), (button) -> {
|
|
||||||
emfConfig.attemptRevertingEntityModelsAlteredByAnotherMod = !emfConfig.attemptRevertingEntityModelsAlteredByAnotherMod;
|
|
||||||
EMF.config().saveToFile();
|
|
||||||
}));
|
|
||||||
if (PlatformFunctions.isModLoaded("physicsmod")) {
|
if (PlatformFunctions.isModLoaded("physicsmod")) {
|
||||||
PuzzleApi.addToResourceOptions(new PuzzleWidget(Text.translatable("entity_model_features.config.physics"), (button) -> button.setMessage(emfConfig.attemptPhysicsModPatch_2 != EMFConfig.PhysicsModCompatChoice.OFF ?
|
PuzzleApi.addToResourceOptions(new PuzzleWidget(Text.translatable("entity_model_features.config.physics"), (button) -> button.setMessage(emfConfig.attemptPhysicsModPatch_2 != EMFConfig.PhysicsModCompatChoice.OFF ?
|
||||||
Text.translatable("entity_model_features.config." + (emfConfig.attemptPhysicsModPatch_2 == EMFConfig.PhysicsModCompatChoice.VANILLA ? "physics.1" : "physics.2")) : ScreenTexts.OFF), (button) -> {
|
Text.translatable("entity_model_features.config." + (emfConfig.attemptPhysicsModPatch_2 == EMFConfig.PhysicsModCompatChoice.VANILLA ? "physics.1" : "physics.2")) : ScreenTexts.OFF), (button) -> {
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public abstract class MixinOptionsScreen extends Screen {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(at = @At("TAIL"), method = "refreshWidgetPositions")
|
@Inject(at = @At("TAIL"), method = "initTabNavigation")
|
||||||
public void puzzle$onResize(CallbackInfo ci) {
|
public void puzzle$onResize(CallbackInfo ci) {
|
||||||
if (PuzzleConfig.enablePuzzleButton) this.puzzle$setButtonPos();
|
if (PuzzleConfig.enablePuzzleButton) this.puzzle$setButtonPos();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import net.minecraft.text.TranslatableTextContent;
|
|||||||
import net.minecraft.util.Formatting;
|
import net.minecraft.util.Formatting;
|
||||||
import net.puzzlemc.gui.screen.PuzzleOptionsScreen;
|
import net.puzzlemc.gui.screen.PuzzleOptionsScreen;
|
||||||
|
|
||||||
|
import java.lang.annotation.Annotation;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -32,7 +33,7 @@ public class PuzzleOptionListWidget extends MidnightConfig.MidnightConfigListWid
|
|||||||
int buttonX = this.width - 160;
|
int buttonX = this.width - 160;
|
||||||
for (PuzzleWidget button : buttons) {
|
for (PuzzleWidget button : buttons) {
|
||||||
if (button.buttonType == ButtonType.TEXT)
|
if (button.buttonType == ButtonType.TEXT)
|
||||||
this.addButton(List.of(), Text.literal(" ").append(button.descriptionText).formatted(Formatting.BOLD));
|
this.addButton(List.of(), Text.literal("").append(button.descriptionText).formatted(Formatting.BOLD));
|
||||||
else if (button.buttonType == ButtonType.BUTTON)
|
else if (button.buttonType == ButtonType.BUTTON)
|
||||||
this.addButton(List.of(new PuzzleButtonWidget(buttonX, 0, 150, 20, button.buttonTextAction, button.onPress)), button.descriptionText);
|
this.addButton(List.of(new PuzzleButtonWidget(buttonX, 0, 150, 20, button.buttonTextAction, button.onPress)), button.descriptionText);
|
||||||
else if (button.buttonType == ButtonType.SLIDER)
|
else if (button.buttonType == ButtonType.SLIDER)
|
||||||
@@ -44,8 +45,19 @@ public class PuzzleOptionListWidget extends MidnightConfig.MidnightConfigListWid
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void addButton(List<ClickableWidget> buttons, Text text) {
|
public void addButton(List<ClickableWidget> buttons, Text text) {
|
||||||
var entry = new MidnightConfig.ButtonEntry(buttons, text, new MidnightConfig.EntryInfo());
|
var info = new MidnightConfig.EntryInfo(null, "puzzle-gui");
|
||||||
entry.centered = buttons.isEmpty();
|
info.comment = new MidnightConfig.Comment() {
|
||||||
|
@Override
|
||||||
|
public boolean centered() {
|
||||||
|
return buttons.isEmpty();
|
||||||
|
}
|
||||||
|
public Class<? extends Annotation> annotationType() {return null;}
|
||||||
|
public String category() {return "";}
|
||||||
|
public String name() {return "";}
|
||||||
|
public String url() {return "";}
|
||||||
|
public String requiredMod() {return "";}
|
||||||
|
};
|
||||||
|
var entry = new MidnightConfig.ButtonEntry(buttons, text, info);
|
||||||
this.addEntry(entry);
|
this.addEntry(entry);
|
||||||
}
|
}
|
||||||
public void renderWidget(DrawContext context, int mouseX, int mouseY, float delta) {
|
public void renderWidget(DrawContext context, int mouseX, int mouseY, float delta) {
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import net.minecraft.client.texture.NativeImage;
|
|||||||
import net.minecraft.client.texture.NativeImageBackedTexture;
|
import net.minecraft.client.texture.NativeImageBackedTexture;
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
import net.minecraft.util.Util;
|
import net.minecraft.util.Util;
|
||||||
import net.minecraft.util.math.ColorHelper;
|
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
import net.puzzlemc.core.config.PuzzleConfig;
|
import net.puzzlemc.core.config.PuzzleConfig;
|
||||||
import net.puzzlemc.splashscreen.PuzzleSplashScreen;
|
import net.puzzlemc.splashscreen.PuzzleSplashScreen;
|
||||||
@@ -32,7 +31,7 @@ import static net.puzzlemc.splashscreen.PuzzleSplashScreen.BACKGROUND;
|
|||||||
|
|
||||||
@Mixin(value = SplashOverlay.class, priority = 2000)
|
@Mixin(value = SplashOverlay.class, priority = 2000)
|
||||||
public abstract class MixinSplashScreen extends Overlay {
|
public abstract class MixinSplashScreen extends Overlay {
|
||||||
@Shadow @Final public static Identifier LOGO;
|
@Shadow @Final static Identifier LOGO;
|
||||||
@Shadow private long reloadCompleteTime;
|
@Shadow private long reloadCompleteTime;
|
||||||
@Shadow @Final private MinecraftClient client;
|
@Shadow @Final private MinecraftClient client;
|
||||||
@Shadow @Final private boolean reloading;
|
@Shadow @Final private boolean reloading;
|
||||||
@@ -61,7 +60,7 @@ public abstract class MixinSplashScreen extends Overlay {
|
|||||||
private int puzzle$modifyBackground(IntSupplier instance) { // Set the Progress Bar Frame Color to our configured value //
|
private int puzzle$modifyBackground(IntSupplier instance) { // Set the Progress Bar Frame Color to our configured value //
|
||||||
return (!PuzzleConfig.resourcepackSplashScreen || PuzzleConfig.progressBarBackgroundColor == 15675965) ? instance.getAsInt() : PuzzleConfig.backgroundColor | 255 << 24;
|
return (!PuzzleConfig.resourcepackSplashScreen || PuzzleConfig.progressBarBackgroundColor == 15675965) ? instance.getAsInt() : PuzzleConfig.backgroundColor | 255 << 24;
|
||||||
}
|
}
|
||||||
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/ColorHelper;getWhite(F)I", shift = At.Shift.AFTER))
|
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/systems/RenderSystem;blendFunc(II)V", shift = At.Shift.AFTER), remap = false)
|
||||||
private void puzzle$betterBlend(DrawContext context, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
private void puzzle$betterBlend(DrawContext context, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||||
if (PuzzleConfig.resourcepackSplashScreen) {
|
if (PuzzleConfig.resourcepackSplashScreen) {
|
||||||
if (PuzzleConfig.disableBlend) RenderSystem.disableBlend();
|
if (PuzzleConfig.disableBlend) RenderSystem.disableBlend();
|
||||||
@@ -93,7 +92,9 @@ public abstract class MixinSplashScreen extends Overlay {
|
|||||||
RenderSystem.enableBlend();
|
RenderSystem.enableBlend();
|
||||||
RenderSystem.blendEquation(32774);
|
RenderSystem.blendEquation(32774);
|
||||||
RenderSystem.defaultBlendFunc();
|
RenderSystem.defaultBlendFunc();
|
||||||
context.drawTexture(RenderLayer::getGuiTextured, BACKGROUND, 0, 0, 0, 0, width, height, width, height, ColorHelper.getWhite(s));
|
RenderSystem.setShader(GameRenderer::getPositionTexProgram);
|
||||||
|
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, s);
|
||||||
|
context.drawTexture(BACKGROUND, 0, 0, 1, 0, 0, width, height, width, height);
|
||||||
RenderSystem.defaultBlendFunc();
|
RenderSystem.defaultBlendFunc();
|
||||||
RenderSystem.disableBlend();
|
RenderSystem.disableBlend();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
# Done to increase the memory available to gradle.
|
# Done to increase the memory available to gradle.
|
||||||
org.gradle.jvmargs=-Xmx2G
|
org.gradle.jvmargs=-Xmx2G
|
||||||
|
|
||||||
minecraft_version=1.21.3
|
minecraft_version=1.21
|
||||||
supported_versions=1.21.2
|
supported_versions=1.21.1
|
||||||
yarn_mappings=1.21.3+build.2
|
yarn_mappings=1.21+build.2
|
||||||
enabled_platforms=fabric,neoforge
|
enabled_platforms=fabric,neoforge
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version = 2.0.3
|
mod_version = 2.0.1.1
|
||||||
maven_group = net.puzzlemc
|
maven_group = net.puzzlemc
|
||||||
archives_base_name = puzzle
|
archives_base_name = puzzle
|
||||||
release_type=release
|
release_type=release
|
||||||
@@ -15,15 +15,15 @@ curseforge_id=563977
|
|||||||
modrinth_id=3IuO68q1
|
modrinth_id=3IuO68q1
|
||||||
|
|
||||||
# Modloaders
|
# Modloaders
|
||||||
fabric_loader_version=0.16.9
|
fabric_loader_version=0.15.11
|
||||||
fabric_api_version=0.107.0+1.21.3
|
fabric_api_version=0.100.1+1.21
|
||||||
|
|
||||||
neoforge_version=21.3.11-beta
|
neoforge_version=21.0.143
|
||||||
yarn_mappings_patch_neoforge_version = 1.21+build.4
|
yarn_mappings_patch_neoforge_version = 1.21+build.4
|
||||||
|
|
||||||
# Libraries
|
# Libraries
|
||||||
midnightlib_version = 1.6.4
|
midnightlib_version = 1.7.5+1.21.1
|
||||||
modmenu_version = 12.0.0-beta.1
|
modmenu_version = 11.0.2
|
||||||
|
|
||||||
# Mod Integrations
|
# Mod Integrations
|
||||||
cull_leaves_version = 3.0.2-fabric
|
cull_leaves_version = 3.0.2-fabric
|
||||||
@@ -39,8 +39,8 @@ toml4j_version = 0.7.2
|
|||||||
cit_resewn_version = 1.1.3+1.20
|
cit_resewn_version = 1.1.3+1.20
|
||||||
complete_config_version = 2.3.0
|
complete_config_version = 2.3.0
|
||||||
spruceui_version=5.0.0+1.20
|
spruceui_version=5.0.0+1.20
|
||||||
emf_version=2.2.3
|
emf_version=2.4.1
|
||||||
etf_version=6.2.2
|
etf_version=6.2.9
|
||||||
exordium_version=1.2.1-1.20.2
|
exordium_version=1.2.1-1.20.2
|
||||||
# Required for LBG
|
# Required for LBG
|
||||||
quilt_loader_version=0.19.0-beta.18
|
quilt_loader_version=0.19.0-beta.18
|
||||||
|
|||||||
Reference in New Issue
Block a user