Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import red.jackf.UpdateDependenciesTask

plugins {
id("maven-publish")
id("fabric-loom") version "1.9-SNAPSHOT"
id("fabric-loom") version "1.10-SNAPSHOT"
id("com.github.breadmoirai.github-release") version "2.5.2"
id("org.ajoberstar.grgit") version "5.3.0"
id("me.modmuss50.mod-publish-plugin") version "0.8.3"
Expand Down
28 changes: 14 additions & 14 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ org.gradle.parallel=true

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.21.4
parchment_version=1.21:2024.07.28
loader_version=0.16.10
minecraft_version=1.21.6
parchment_version=1.21.5:2025.06.15
loader_version=0.16.13

# Mod Properties
mod_version=2.6.7
Expand All @@ -15,22 +15,22 @@ archives_base_name=chesttracker

# Dependencies
bundle_searchables=false
searchables_version=1.21.3:1.0.1
searchables_version=1.21.5:1.0.2

# Mod Compat
clothconfig_version=15.0.127
shulkerboxtooltip_version=5.0.3+1.21
wthit_version=fabric-13.0.0
badpackets_version=fabric-0.8.1
jade_version=9bgHxSiP
yacl_version=3.6.2+1.21.4-fabric
litematica_version=0.20.1
malilib_version=0.22.2
clothconfig_version=19.0.147
shulkerboxtooltip_version=5.2.7+1.21.6
wthit_version=fabric-16.0.0
badpackets_version=fabric-0.9.0
yacl_version=3.7.1+1.21.6-fabric
jade_version=eM01zcHw
litematica_version=0.23.2
malilib_version=0.25.2
expandedstorage_version=90085b73dae01b72552e039e52e41f87

# JF_AUTO_UPDATE_BLOCK
fabric-api_version=0.111.0+1.21.4
modmenu_version=13.0.0-beta.1
fabric-api_version=0.127.0+1.21.6
modmenu_version=15.0.0-beta.1
where-is-it_version=2.6.4+1.21.2
emi_version=1.1.12+1.21
# JF_END_AUTO_UPDATE_BLOCK
Expand Down
Binary file removed libs/litematica-fabric-1.21.3-0.20.0-sakura.3.jar
Binary file not shown.
Binary file added libs/litematica-fabric-1.21.7-0.23.2-sakura.3.jar
Binary file not shown.
Binary file removed libs/malilib-fabric-1.21.3-0.22.0-sakura.5.jar
Binary file not shown.
Binary file added libs/malilib-fabric-1.21.7-0.25.2-sakura.3.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package red.jackf.chesttracker.impl.compat.mods.jade;

import net.minecraft.client.gui.layouts.LayoutElement;
import net.minecraft.nbt.Tag;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
Expand All @@ -15,8 +16,7 @@
import snownee.jade.api.JadeIds;
import snownee.jade.api.config.IPluginConfig;
import snownee.jade.api.theme.IThemeHelper;
import snownee.jade.api.ui.IElement;
import snownee.jade.api.ui.IElementHelper;
import snownee.jade.api.ui.JadeUI;
import snownee.jade.api.ui.ScreenDirection;

import java.util.ArrayList;
Expand All @@ -37,7 +37,7 @@ private static void possiblyAddItems(ITooltip tooltip, BlockAccessor accessor, I
return; // don't do it if jade is handling it
if (config.get(JadeIds.MC_FURNACE)
&& accessor.getBlock() instanceof AbstractFurnaceBlock &&
(accessor.getServerData().contains("furnace", Tag.TAG_LIST) // < 15.7.0
(accessor.getServerData().contains("furnace") // < 15.7.0
|| accessor.getServerData().contains(JadeIds.MC_FURNACE.toString()))) // >=15.7.0
return; // don't do furnaces if handled so progress still shows

Expand All @@ -46,11 +46,11 @@ private static void possiblyAddItems(ITooltip tooltip, BlockAccessor accessor, I
int max = config.getInt(accessor.showDetails() ? JadeIds.UNIVERSAL_ITEM_STORAGE_DETAILED_AMOUNT : JadeIds.UNIVERSAL_ITEM_STORAGE_NORMAL_AMOUNT);
int perLine = config.getInt(JadeIds.UNIVERSAL_ITEM_STORAGE_ITEMS_PER_LINE);

List<List<IElement>> lines = new ArrayList<>();
List<IElement> currentLine = new ArrayList<>(perLine);
List<List<LayoutElement>> lines = new ArrayList<>();
List<LayoutElement> currentLine = new ArrayList<>(perLine);
for (int i = 0; i < max && i < stacks.size(); i++) {
ItemStack item = stacks.get(i);
currentLine.add(IElementHelper.get().item(item));
currentLine.add(JadeUI.item(item));
if (currentLine.size() == perLine) {
lines.add(currentLine);
currentLine = new ArrayList<>(perLine);
Expand Down Expand Up @@ -84,3 +84,4 @@ public ResourceLocation getUid() {
return ID;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,34 @@
public enum ModIcon implements IGuiIcon {
INSTANCE;

private final int u = 0;
private final int v = 0;
private final int w = 11;
private final int h = 11;

@Override
public int getWidth() {
return 11;
return this.w;
}

@Override
public int getHeight() {
return 11;
return this.h;
}

@Override
public int getU() {
return 0;
return this.u;
}

@Override
public int getV() {
return 0;
return this.v;
}

@Override
public void renderAt(int x, int y, float z, boolean enabled, boolean selected, GuiGraphics guiGraphics) {
RenderUtils.drawTexturedRect(x, y, getU(), getV(), getWidth(), getHeight(), z);
RenderUtils.forceDraw(guiGraphics);
public void renderAt(GuiGraphics graphics, int x, int y, float zLevel, boolean enabled, boolean selected) {
RenderUtils.drawTexturedRect(graphics, this.getTexture(), x, y, this.u, this.v, this.w, this.h, zLevel);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ interface SMP {
static boolean isSMPJoinMessage(Component message) {
return message.getString().startsWith("SMP ID: ")
&& message.getStyle().getClickEvent() != null
&& message.getStyle().getClickEvent().getAction() == ClickEvent.Action.SUGGEST_COMMAND;
&& message.getStyle().getClickEvent().action() == ClickEvent.Action.SUGGEST_COMMAND;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class Types {

public static <T> Codec<T> wrapInFixer(DSL.TypeReference type, Codec<T> codec, int fallbackVersion) {
final DataFixer fixer = Minecraft.getInstance().getFixerUpper();
final int currentVersion = SharedConstants.getCurrentVersion().getDataVersion().getVersion();
final int currentVersion = SharedConstants.getCurrentVersion().dataVersion().version();

return new Codec<>() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import net.minecraft.client.gui.navigation.ScreenDirection;
import net.minecraft.client.gui.navigation.ScreenRectangle;
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
import net.minecraft.client.renderer.RenderPipelines;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
Expand Down Expand Up @@ -120,7 +121,7 @@ protected void renderWidget(@NotNull GuiGraphics graphics, int mouseX, int mouse
// NOTE: texture is 11x11 while button is 9x9

ResourceLocation texture = TEXTURE.get(this.isActive(), this.isHoveredOrFocused());
graphics.blitSprite(RenderType::guiTextured, texture, this.getX() - 1, this.getY() - 1, IMAGE_SIZE, IMAGE_SIZE);
graphics.blitSprite(RenderPipelines.GUI_TEXTURED, texture, this.getX() - 1, this.getY() - 1, IMAGE_SIZE, IMAGE_SIZE);

for (AbstractWidget secondary : this.secondaryButtons) {
secondary.render(graphics, mouseX, mouseY, partialTick);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.minecraft.client.gui.components.Tooltip;
import net.minecraft.client.gui.components.WidgetSprites;
import net.minecraft.client.gui.narration.NarrationElementOutput;
import net.minecraft.client.renderer.RenderPipelines;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
Expand Down Expand Up @@ -50,7 +51,7 @@ protected void renderWidget(GuiGraphics graphics, int mouseX, int mouseY, float
int x = Mth.lerpDiscrete(factor, this.startX - 1, this.getX() - 1);
int y = Mth.lerpDiscrete(factor, this.startY - 1, this.getY() - 1);

graphics.blitSprite(RenderType::guiTextured, texture, x, y, InventoryButton.IMAGE_SIZE, InventoryButton.IMAGE_SIZE);
graphics.blitSprite(RenderPipelines.GUI_TEXTURED, texture, x, y, InventoryButton.IMAGE_SIZE, InventoryButton.IMAGE_SIZE);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.renderer.RenderPipelines;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.network.chat.Component;
import org.jetbrains.annotations.NotNull;
Expand Down Expand Up @@ -34,7 +35,7 @@ protected void init() {
@Override
public void renderBackground(@NotNull GuiGraphics graphics, int i, int j, float f) {
super.renderBackground(graphics, i, j, f);
graphics.blitSprite(RenderType::guiTextured, GuiUtil.BACKGROUND_SPRITE, this.left, this.top, this.menuWidth, this.menuHeight);
graphics.blitSprite(RenderPipelines.GUI_TEXTURED, GuiUtil.BACKGROUND_SPRITE, this.left, this.top, this.menuWidth, this.menuHeight);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.components.*;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.renderer.RenderPipelines;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.network.chat.CommonComponents;
import net.minecraft.network.chat.Component;
Expand Down Expand Up @@ -354,8 +355,8 @@ public void render(@NotNull GuiGraphics graphics, int mouseX, int mouseY, float
@Override
public void renderBackground(@NotNull GuiGraphics graphics, int i, int j, float f) {
super.renderBackground(graphics, i, j, f);
graphics.blitSprite(RenderType::guiTextured, GuiUtil.BACKGROUND_SPRITE, left, top, menuWidth, menuHeight);
ifSearchables(() -> graphics.blitSprite(RenderType::guiTextured, GuiUtil.SEARCH_BAR_SPRITE, search.getX() - 2, search.getY() - 2, search.getWidth() + 4, search.getHeight()));
graphics.blitSprite(RenderPipelines.GUI_TEXTURED, GuiUtil.BACKGROUND_SPRITE, left, top, menuWidth, menuHeight);
ifSearchables(() -> graphics.blitSprite(RenderPipelines.GUI_TEXTURED, GuiUtil.SEARCH_BAR_SPRITE, search.getX() - 2, search.getY() - 2, search.getWidth() + 4, search.getHeight()));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.components.Button;
import net.minecraft.client.gui.components.WidgetSprites;
import net.minecraft.client.renderer.RenderPipelines;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
Expand All @@ -31,7 +32,7 @@ public void setSprites(WidgetSprites sprites) {
@Override
public void renderWidget(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick) {
ResourceLocation resourceLocation = this.sprites.get(this.isActive(), this.isHoveredOrFocused());
guiGraphics.blitSprite(RenderType::guiTextured, resourceLocation, this.getX(), this.getY(), this.width, this.height);
guiGraphics.blitSprite(RenderPipelines.GUI_TEXTURED, resourceLocation, this.getX(), this.getY(), this.width, this.height);
}

@Environment(EnvType.CLIENT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import net.minecraft.client.gui.Font;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.components.EditBox;
import net.minecraft.client.renderer.RenderPipelines;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.network.chat.Component;
import org.jetbrains.annotations.NotNull;
Expand All @@ -20,10 +21,10 @@ public CustomEditBox(Font font, int x, int y, int width, int height, @Nullable E

@Override
public void renderWidget(@NotNull GuiGraphics graphics, int mouseX, int mouseY, float partialTick) {
graphics.blitSprite(RenderType::guiTextured, GuiUtil.SEARCH_BAR_SPRITE, this.getX(), this.getY(), this.getWidth(), this.getHeight());
graphics.pose().translate(2, 2, 0);
graphics.blitSprite(RenderPipelines.GUI_TEXTURED, GuiUtil.SEARCH_BAR_SPRITE, this.getX(), this.getY(), this.getWidth(), this.getHeight());
graphics.pose().translate(2, 2);
super.renderWidget(graphics, mouseX, mouseY, partialTick);
graphics.pose().translate(-2, -2, 0);
graphics.pose().translate(-2, -2);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.minecraft.client.gui.components.WidgetSprites;
import net.minecraft.client.gui.narration.NarratedElementType;
import net.minecraft.client.gui.narration.NarrationElementOutput;
import net.minecraft.client.renderer.RenderPipelines;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.network.chat.Component;
import net.minecraft.util.Mth;
Expand Down Expand Up @@ -47,7 +48,7 @@ public DragHandleWidget(int x, int y, int highlightStartX, int highlightStartY,

@Override
protected void renderWidget(GuiGraphics graphics, int mouseX, int mouseY, float partialTick) {
graphics.blitSprite(RenderType::guiTextured, this.isHoveredOrFocused() ? TEXTURE.enabledFocused() : TEXTURE.enabled(), this.getX(), this.getY(), WIDTH, HEIGHT);
graphics.blitSprite(RenderPipelines.GUI_TEXTURED, this.isHoveredOrFocused() ? TEXTURE.enabledFocused() : TEXTURE.enabled(), this.getX(), this.getY(), WIDTH, HEIGHT);

if (this.target != null) {
int y = this.highlightStartY + yHeight * this.target;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.components.Button;
import net.minecraft.client.gui.components.WidgetSprites;
import net.minecraft.client.renderer.RenderPipelines;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.network.chat.CommonComponents;
import net.minecraft.world.item.ItemStack;
Expand Down Expand Up @@ -31,7 +32,7 @@ public void setHighlighted(boolean highlighted) {
protected void renderWidget(@NotNull GuiGraphics graphics, int mouseX, int mouseY, float partialTick) {
switch (background) {
case VANILLA -> super.renderWidget(graphics, mouseX, mouseY, partialTick);
case CUSTOM -> graphics.blitSprite(RenderType::guiTextured, this.highlighted || this.isHovered() ? TEXTURE.enabledFocused() : TEXTURE.enabled(),
case CUSTOM -> graphics.blitSprite(RenderPipelines.GUI_TEXTURED, this.highlighted || this.isHovered() ? TEXTURE.enabledFocused() : TEXTURE.enabled(),
getX(),
getY(),
SIZE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import net.minecraft.client.gui.components.AbstractWidget;
import net.minecraft.client.gui.narration.NarrationElementOutput;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.renderer.RenderPipelines;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
Expand Down Expand Up @@ -81,7 +82,7 @@ public void onClick(double mouseX, double mouseY) {

@Override
protected void renderWidget(@NotNull GuiGraphics graphics, int mouseX, int mouseY, float partialTick) {
graphics.blitSprite(RenderType::guiTextured, BACKGROUND_SPRITE, getX(), getY(), getWidth(), getHeight()); // background
graphics.blitSprite(RenderPipelines.GUI_TEXTURED, BACKGROUND_SPRITE, getX(), getY(), getWidth(), getHeight()); // background
this.renderItems(graphics); // item models
this.renderItemDecorations(graphics); // stack size and durability
this.renderAdditional(graphics, mouseX, mouseY); // tooltips
Expand Down Expand Up @@ -117,10 +118,10 @@ private void renderItemDecorations(GuiGraphics graphics) {
int offset = -GuiConstants.GRID_SLOT_SIZE + 2;

// move to correct slot on screen
graphics.pose().pushPose();
graphics.pose().pushMatrix();
int bottomRightX = this.getX() + GuiConstants.GRID_SLOT_SIZE * ((i % gridWidth) + 1);
int bottomRightY = this.getY() + GuiConstants.GRID_SLOT_SIZE * ((i / gridWidth) + 1);
graphics.pose().translate(bottomRightX - 1, bottomRightY - 1, 0);
graphics.pose().translate(bottomRightX - 1, bottomRightY - 1);

// durability, scaled normally
graphics.renderItemDecorations(Minecraft.getInstance().font, item, offset, offset, "");
Expand All @@ -130,12 +131,12 @@ private void renderItemDecorations(GuiGraphics graphics) {
int textScale = scales.getFirst();
int guiScale = scales.getSecond();
float scaleFactor = (float) textScale / guiScale;
graphics.pose().scale(scaleFactor, scaleFactor, 1f);
graphics.pose().scale(scaleFactor, scaleFactor);

// render count text scaled down
String text = Strings.magnitude(item.getCount(), 0);
graphics.renderItemDecorations(Minecraft.getInstance().font, DUMMY_ITEM_FOR_COUNT, offset, offset, text); // Count
graphics.pose().popPose();
graphics.pose().popMatrix();
}
}

Expand All @@ -156,10 +157,9 @@ private void renderAdditional(GuiGraphics graphics, int mouseX, int mouseY) {
if (stack.getCount() > 999) lines.add(Component.literal(Strings.commaSeparated(stack.getCount()))
.withStyle(ChatFormatting.GREEN));
var image = stack.getTooltipImage();
graphics.pose().pushPose();
graphics.pose().translate(0, 0, 150f);
graphics.renderTooltip(Minecraft.getInstance().font, lines, image, mouseX, mouseY);
graphics.pose().popPose();
graphics.pose().pushMatrix();
graphics.setTooltipForNextFrame(Minecraft.getInstance().font, lines, image, mouseX, mouseY);
graphics.pose().popMatrix();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import net.minecraft.client.gui.components.Tooltip;
import net.minecraft.client.gui.narration.NarratedElementType;
import net.minecraft.client.gui.narration.NarrationElementOutput;
import net.minecraft.client.renderer.RenderPipelines;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
Expand Down Expand Up @@ -53,7 +54,7 @@ public ResizeWidget(int x, int y, int screenLeft, int screenTop, int stepSize, i

@Override
protected void renderWidget(GuiGraphics graphics, int mouseX, int mouseY, float partialTick) {
graphics.blit(RenderType::guiTextured, TEXTURE, this.getX(), this.getY(), 0, 0, SIZE, SIZE, SIZE, SIZE);
graphics.blit(RenderPipelines.GUI_TEXTURED, TEXTURE, this.getX(), this.getY(), 0, 0, SIZE, SIZE, SIZE, SIZE);

// border
if (this.target != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ public record SimpleItemWidget(ItemStack stack, int x, int y, int size) implemen
public void render(GuiGraphics graphics, int mouseX, int mouseY, float partialTick) {
final float factor = (float) this.size / DEFAULT_ITEM_SIZE;

graphics.pose().pushPose();
graphics.pose().translate(x, y, 0);
graphics.pose().scale(factor, factor, factor);
graphics.pose().pushMatrix();
graphics.pose().translate(x, y);
graphics.pose().scale(factor, factor);
graphics.renderFakeItem(stack, 0, 0);
graphics.pose().popPose();
graphics.pose().popMatrix();
}
}
Loading