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 gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ minecraft_version_dependency=>=1.21.11 <1.22
fabric_api_version=0.139.4+1.21.11
parchment_mappings=parchment-1.21.9:2025.10.05@zip
fabric_loader_version=0.18.2
fabric_loom_version=1.14-SNAPSHOT
fabric_loom_version=1.15-SNAPSHOT

# Library dependencies
betterconfig_version=2.5.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class FeatureToggleWidget extends Button {
public FeatureToggleWidget(MapFeature feature, int x, int y) {
super(x, y, feature.getDefaultTexture().width(), feature.getDefaultTexture().height(), Component.literal(feature.getName()), FeatureToggleWidget::onButtonPress, DEFAULT_NARRATION);
this.feature = feature;
this.setTooltip(Tooltip.create(Component.literal(this.feature.getName())));
this.setTooltip(Tooltip.create(this.message));
}

@Override
Expand Down
25 changes: 25 additions & 0 deletions src/main/java/dev/xpple/seedmapper/seedmap/ItemIconButton.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package dev.xpple.seedmapper.seedmap;

import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.components.Button;
import net.minecraft.client.gui.components.Tooltip;
import net.minecraft.network.chat.Component;
import net.minecraft.world.item.ItemStack;

public class ItemIconButton extends Button {

public static final int ICON_SIZE = 16;

private final ItemStack item;

protected ItemIconButton(int x, int y, ItemStack item, Component message, OnPress onPress) {
super(x, y, ICON_SIZE, ICON_SIZE, message, onPress, DEFAULT_NARRATION);
this.item = item;
this.setTooltip(Tooltip.create(message));
}

@Override
protected void renderContents(GuiGraphics guiGraphics, int i, int j, float f) {
guiGraphics.renderItem(this.item, this.getX(), this.getY());
}
}
689 changes: 689 additions & 0 deletions src/main/java/dev/xpple/seedmapper/seedmap/LootSearchScreen.java

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions src/main/java/dev/xpple/seedmapper/seedmap/MinimapScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,18 @@ public void renderToHud(GuiGraphics guiGraphics, float partialTick) {
renderContentHeight = diagonal;
}
// ensures super.seedMapWidth == renderContentWidth
int renderWidth = renderContentWidth + 2 * this.horizontalPadding();
int renderWidth = renderContentWidth + 2 * this.leftPadding();
// ensures super.seedMapHeight == renderContentHeight
int renderHeight = renderContentHeight + 2 * this.verticalPadding();
int renderHeight = renderContentHeight + 2 * this.topPadding();

this.initForOverlay(renderWidth, renderHeight);

guiGraphics.enableScissor(this.horizontalPadding(), this.verticalPadding(), this.horizontalPadding() + contentWidth, this.verticalPadding() + contentHeight);
guiGraphics.enableScissor(this.leftPadding(), this.topPadding(), this.leftPadding() + contentWidth, this.topPadding() + contentHeight);

var pose = guiGraphics.pose();
pose.pushMatrix();
if (rotateMinimap) {
pose.translate(-this.centerX + (float) (this.horizontalPadding() + contentWidth / 2), -this.centerY + (float) (this.verticalPadding() + contentHeight / 2));
pose.translate(-this.centerX + (float) (this.leftPadding() + contentWidth / 2), -this.centerY + (float) (this.topPadding() + contentHeight / 2));
pose.translate(this.centerX, this.centerY);
pose.rotate((float) (-Math.toRadians(this.getPlayerRotation().y) + Math.PI));
pose.translate(-this.centerX, -this.centerY);
Expand All @@ -64,7 +64,7 @@ public void renderToHud(GuiGraphics guiGraphics, float partialTick) {
pose.popMatrix();

if (Configs.RotateMinimap) {
this.drawCenterCross(guiGraphics, this.horizontalPadding() + contentWidth / 2, this.verticalPadding() + contentHeight / 2);
this.drawCenterCross(guiGraphics, this.leftPadding() + contentWidth / 2, this.topPadding() + contentHeight / 2);
}

guiGraphics.disableScissor();
Expand Down Expand Up @@ -100,12 +100,12 @@ protected boolean isMinimap() {
}

@Override
protected int horizontalPadding() {
protected int leftPadding() {
return Configs.MinimapOffsetX;
}

@Override
protected int verticalPadding() {
protected int topPadding() {
return Configs.MinimapOffsetY;
}
}
Loading