generated from QuiltMC/quilt-template-mod
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c9a2848
commit 37b2f70
Showing
9 changed files
with
60 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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 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 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 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
10 changes: 10 additions & 0 deletions
10
src/main/java/net/modfest/scatteredshards/ScatteredShardsConfig.java
This file contains 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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package net.modfest.scatteredshards; | ||
|
||
import folk.sisby.kaleido.api.ReflectiveConfig; | ||
import folk.sisby.kaleido.lib.quiltconfig.api.annotations.Comment; | ||
import folk.sisby.kaleido.lib.quiltconfig.api.values.TrackedValue; | ||
|
||
public class ScatteredShardsConfig extends ReflectiveConfig { | ||
@Comment("Whether to replace advancements button with a shard collection button") | ||
public final TrackedValue<Boolean> replace_advancements = value(true); | ||
} |
22 changes: 22 additions & 0 deletions
22
src/main/java/net/modfest/scatteredshards/mixin/client/GameMenuScreenMixin.java
This file contains 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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package net.modfest.scatteredshards.mixin.client; | ||
|
||
import com.llamalad7.mixinextras.injector.wrapoperation.Operation; | ||
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; | ||
import net.minecraft.client.gui.screen.GameMenuScreen; | ||
import net.minecraft.client.gui.widget.ButtonWidget; | ||
import net.minecraft.client.gui.widget.GridWidget; | ||
import net.minecraft.client.gui.widget.Widget; | ||
import net.minecraft.text.Text; | ||
import net.modfest.scatteredshards.ScatteredShards; | ||
import net.modfest.scatteredshards.client.ScatteredShardsClient; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
|
||
@Mixin(GameMenuScreen.class) | ||
public class GameMenuScreenMixin { | ||
@WrapOperation(method = "initWidgets", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/widget/GridWidget$Adder;add(Lnet/minecraft/client/gui/widget/Widget;)Lnet/minecraft/client/gui/widget/Widget;", ordinal = 0)) | ||
private Widget replaceAdvancements(GridWidget.Adder instance, Widget widget, Operation<Widget> original) { | ||
if (!ScatteredShards.CONFIG.replace_advancements.value()) return original.call(instance, widget); | ||
return instance.add(ButtonWidget.builder(Text.translatable("menu.scattered_shards.collection"), b -> ScatteredShardsClient.openShardTablet()).width(98).build()); | ||
} | ||
} |
This file contains 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 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 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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"required": true, | ||
"minVersion": "0.8", | ||
"package": "net.modfest.scatteredshards.mixin", | ||
"compatibilityLevel": "JAVA_21", | ||
"client": [ | ||
"client.GameMenuScreenMixin" | ||
], | ||
"injectors": { | ||
"defaultRequire": 1 | ||
} | ||
} |