forked from emilyploszaj/trinkets
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update polymer port to my pr 1.21.4 version of trinkets
- Loading branch information
Showing
11 changed files
with
78 additions
and
74 deletions.
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
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
18 changes: 0 additions & 18 deletions
18
src/main/java/dev/emi/trinkets/mixin/RecipeBookScreenMixin.java
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,20 +1,35 @@ | ||
package dev.emi.trinkets.poly; | ||
|
||
import dev.emi.trinkets.TrinketsMain; | ||
import eu.pb4.polymer.resourcepack.api.PolymerModelData; | ||
import eu.pb4.sgui.api.elements.GuiElementBuilder; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.item.Items; | ||
import net.minecraft.text.Text; | ||
import net.minecraft.util.Identifier; | ||
|
||
public class Elements { | ||
public static final GuiElementBuilder FILLER = new GuiElementBuilder(Items.WHITE_STAINED_GLASS_PANE).hideTooltip() | ||
.setCustomModelData(GuiModels.getOrCreate(Identifier.of(TrinketsMain.MOD_ID, "gui/polybuttons/filler"), Items.WHITE_STAINED_GLASS_PANE).value()); | ||
public static final GuiElementBuilder FILLER_NAVBAR = new GuiElementBuilder(Items.BLACK_STAINED_GLASS_PANE).hideTooltip(); | ||
public static final Getter FILLER = new Getter(Items.WHITE_STAINED_GLASS_PANE, Identifier.of(TrinketsMain.MOD_ID, "gui/polybuttons/filler")); | ||
public static final Getter FILLER_NAVBAR = new Getter(Items.BLACK_STAINED_GLASS_PANE, Identifier.ofVanilla("air")); | ||
|
||
|
||
public static final PolymerModelData PREVIOUS = GuiModels.getOrCreate(Identifier.of(TrinketsMain.MOD_ID, "gui/polybuttons/previous"), Items.GREEN_STAINED_GLASS_PANE); | ||
public static final PolymerModelData NEXT = GuiModels.getOrCreate(Identifier.of(TrinketsMain.MOD_ID, "gui/polybuttons/next"), Items.GREEN_STAINED_GLASS_PANE); | ||
public static final PolymerModelData SUBPAGE = GuiModels.getOrCreate(Identifier.of(TrinketsMain.MOD_ID, "gui/polybuttons/subpage"), Items.LIGHT_BLUE_STAINED_GLASS_PANE); | ||
public static final Getter PREVIOUS = new Getter(Items.GREEN_STAINED_GLASS_PANE, Identifier.of(TrinketsMain.MOD_ID, "gui/polybuttons/previous")); | ||
public static final Getter NEXT = new Getter(Items.GREEN_STAINED_GLASS_PANE, Identifier.of(TrinketsMain.MOD_ID, "gui/polybuttons/next")); | ||
public static final Getter SUBPAGE = new Getter(Items.LIGHT_BLUE_STAINED_GLASS_PANE, Identifier.of(TrinketsMain.MOD_ID, "gui/polybuttons/subpage")); | ||
|
||
|
||
public record Getter(Item item, Identifier modelId) { | ||
|
||
public Getter { | ||
if (modelId != null) { | ||
GuiModels.createModel(modelId); | ||
} | ||
} | ||
|
||
public GuiElementBuilder get(boolean hasPack) { | ||
var b = new GuiElementBuilder(this.item); | ||
if (hasPack && modelId != null) { | ||
b.model(modelId); | ||
} | ||
return b; | ||
} | ||
} | ||
} |
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