generated from isXander/FabricKotlinTemplate
-
-
Notifications
You must be signed in to change notification settings - Fork 52
1.21.11 #518
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
Merged
Merged
1.21.11 #518
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
bb133a5
fix MC-197260 causing armorstands to render dark
MrKinau aed218d
Port to 1.21.11
Rektroth b08f6d8
Modify return value instead of overwriting book screen methods
Rektroth f00e6f6
WrapOperation instead of Redirect for creating telemetry checkbox
Rektroth e8d92d6
Better telemetry screen
Rektroth d3deb6e
Fix squid renderer
Rektroth 2b7fbbe
Remove build.gradle.kts changes
Rektroth ce3c5ad
Merge MrKinau fix
Rektroth File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,7 @@ | ||
| distributionBase=GRADLE_USER_HOME | ||
| distributionPath=wrapper/dists | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-all.zip | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip | ||
| networkTimeout=10000 | ||
| validateDistributionUrl=true | ||
| zipStoreBase=GRADLE_USER_HOME | ||
| zipStorePath=wrapper/dists |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 16 additions & 29 deletions
45
src/client/java/dev/isxander/debugify/client/helpers/mc237493/DebugifyTelemetry.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,50 +1,37 @@ | ||
| package dev.isxander.debugify.client.helpers.mc237493; | ||
|
|
||
| import com.mojang.serialization.Codec; | ||
| import java.util.Arrays; | ||
| import java.util.Comparator; | ||
| import java.util.function.IntFunction; | ||
|
|
||
| import net.minecraft.network.chat.Component; | ||
| import net.minecraft.util.ByIdMap; | ||
| import net.minecraft.util.Mth; | ||
| import net.minecraft.util.OptionEnum; | ||
| import net.minecraft.util.StringRepresentable; | ||
|
|
||
| public enum DebugifyTelemetry implements OptionEnum { | ||
| public enum DebugifyTelemetry { | ||
| OFF(0, "options.telemetry.state.none", "debugify.mc_237493.tooltip.off"), | ||
| MINIMAL(1, "options.telemetry.state.minimal", "debugify.mc_237493.tooltip.minimal"), | ||
| ALL(2, "options.telemetry.state.all", "debugify.mc_237493.tooltip.all"); | ||
|
|
||
| private static final DebugifyTelemetry[] VALUES = Arrays.stream(values()) | ||
| .sorted(Comparator.comparingInt(DebugifyTelemetry::getId)) | ||
| .toArray(DebugifyTelemetry[]::new); | ||
|
|
||
| private static final IntFunction<DebugifyTelemetry> BY_ID = ByIdMap.continuous(value -> value.id, values(), ByIdMap.OutOfBoundsStrategy.WRAP); | ||
| public static final Codec<DebugifyTelemetry> LEGACY_CODEC = Codec.INT.xmap(BY_ID::apply, value -> value.id); | ||
| private final int id; | ||
| private final String translationKey; | ||
| private final String tooltipTranslationKey; | ||
| private final Component caption; | ||
| private final Component tooltip; | ||
|
|
||
| DebugifyTelemetry(int id, String translationKey, String tooltipTranslationKey) { | ||
| DebugifyTelemetry(int id, final String key, final String translationKey) { | ||
| this.id = id; | ||
| this.translationKey = translationKey; | ||
| this.tooltipTranslationKey = tooltipTranslationKey; | ||
| } | ||
|
|
||
| @Override | ||
| public int getId() { | ||
| return this.id; | ||
| } | ||
|
|
||
| @Override | ||
| public String getKey() { | ||
| return this.translationKey; | ||
| } | ||
|
|
||
| public String getTooltipKey() { | ||
| return this.tooltipTranslationKey; | ||
| this.caption = Component.translatable(key); | ||
| this.tooltip = Component.translatable(translationKey); | ||
| } | ||
|
|
||
| public Component getTooltipText() { | ||
| return Component.translatable(getTooltipKey(), getCaption()); | ||
| public Component caption() { | ||
| return this.caption; | ||
| } | ||
|
|
||
| public static DebugifyTelemetry byId(int id) { | ||
| return VALUES[Mth.positiveModulo(id, VALUES.length)]; | ||
| public Component tooltip() { | ||
| return this.tooltip; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 0 additions & 22 deletions
22
.../java/dev/isxander/debugify/client/mixins/basic/mc22882/AbstractContainerScreenMixin.java
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
src/client/java/dev/isxander/debugify/client/mixins/basic/mc22882/MinecraftMixin.java
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 34 additions & 10 deletions
44
...ent/java/dev/isxander/debugify/client/mixins/basic/mc237493/TelemetryInfoScreenMixin.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,32 +1,56 @@ | ||
| package dev.isxander.debugify.client.mixins.basic.mc237493; | ||
|
|
||
| import com.llamalad7.mixinextras.expression.Definition; | ||
| import com.llamalad7.mixinextras.expression.Expression; | ||
| import com.llamalad7.mixinextras.injector.wrapoperation.Operation; | ||
| import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; | ||
| import dev.isxander.debugify.client.helpers.mc237493.DebugifyTelemetry; | ||
| import dev.isxander.debugify.client.helpers.mc237493.DebugifyTelemetryAccessor; | ||
| import dev.isxander.debugify.fixes.BugFix; | ||
| import dev.isxander.debugify.fixes.FixCategory; | ||
| import net.minecraft.client.Options; | ||
| import net.minecraft.client.gui.components.AbstractWidget; | ||
| import net.minecraft.client.gui.layouts.LayoutElement; | ||
| import net.minecraft.client.gui.layouts.LinearLayout; | ||
| import net.minecraft.client.gui.screens.Screen; | ||
| import net.minecraft.client.gui.screens.telemetry.TelemetryEventWidget; | ||
| import net.minecraft.client.gui.screens.telemetry.TelemetryInfoScreen; | ||
| import net.minecraft.network.chat.Component; | ||
| import org.spongepowered.asm.mixin.Final; | ||
| import org.spongepowered.asm.mixin.Mixin; | ||
| import org.spongepowered.asm.mixin.Overwrite; | ||
| import org.spongepowered.asm.mixin.Shadow; | ||
| import org.spongepowered.asm.mixin.Unique; | ||
| import org.spongepowered.asm.mixin.injection.At; | ||
| import org.spongepowered.asm.mixin.injection.Inject; | ||
| import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
|
||
| @BugFix(id = "MC-237493", category = FixCategory.BASIC, env = BugFix.Env.CLIENT, modConflicts = "no-telemetry", description = "Telemetry cannot be disabled") | ||
| @Mixin(TelemetryInfoScreen.class) | ||
| public class TelemetryInfoScreenMixin { | ||
| @Shadow @Final private Options options; | ||
| public abstract class TelemetryInfoScreenMixin extends Screen { | ||
| protected TelemetryInfoScreenMixin(Component title) { | ||
| super(title); | ||
| } | ||
|
|
||
| @Shadow @Final private Options options; | ||
|
|
||
| @Shadow private TelemetryEventWidget telemetryEventWidget; | ||
|
|
||
| /** | ||
| * @author | ||
| * @reason | ||
| */ | ||
| @Overwrite | ||
| private AbstractWidget createTelemetryCheckbox() { | ||
| return ((DebugifyTelemetryAccessor) options).getTelemetryOption().createButton(options, 0, 0, 308, state -> telemetryEventWidget.onOptInChanged(state == DebugifyTelemetry.ALL)); | ||
| @Unique private AbstractWidget cycleButton; | ||
|
|
||
| @Definition(id = "addChild", method = "Lnet/minecraft/client/gui/layouts/LinearLayout;addChild(Lnet/minecraft/client/gui/layouts/LayoutElement;)Lnet/minecraft/client/gui/layouts/LayoutElement;") | ||
| @Definition(id = "builder", method = "Lnet/minecraft/client/gui/components/Checkbox;builder(Lnet/minecraft/network/chat/Component;Lnet/minecraft/client/gui/Font;)Lnet/minecraft/client/gui/components/Checkbox$Builder;") | ||
| @Definition(id = "CHECKBOX_OPT_IN", field = "Lnet/minecraft/client/gui/screens/telemetry/TelemetryInfoScreen;CHECKBOX_OPT_IN:Lnet/minecraft/network/chat/Component;") | ||
| @Expression("?.addChild(builder(CHECKBOX_OPT_IN, ?).?(?).?(?.?.?()).?(?).?())") | ||
| @WrapOperation(method = "init", at = @At("MIXINEXTRAS:EXPRESSION")) | ||
| private LayoutElement createTelemetryCheckbox(LinearLayout instance, LayoutElement child, Operation<LayoutElement> original) { | ||
| this.cycleButton = instance.addChild(((DebugifyTelemetryAccessor) options).getTelemetryOption().createButton(options, 0, 0, 308, state -> telemetryEventWidget.onOptInChanged(state == DebugifyTelemetry.ALL))); | ||
| return null; | ||
| } | ||
|
|
||
| @Inject(method = "repositionElements", at = @At("TAIL")) | ||
| private void repositionCycleButton(CallbackInfo ci) { | ||
| if (this.cycleButton != null) { | ||
| this.cycleButton.setWidth(308); | ||
| } | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.