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
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,16 @@ public boolean shouldUpdateBeforeRendering() {

@Override
public void updateContent() {
if (client.player == null) {
if (client.player == null || client.level == null) {
addComponent(new PlainTextComponent(Component.literal("Nothing to show :p")));
return;
}
ItemStack farmingToolStack = client.player.getMainHandItem();
String itemId = farmingToolStack.getSkyblockId();
String cropItemId = FARMING_TOOLS.getOrDefault(itemId, "");
if (cropItemId.equals("DOUBLE_PLANT") && client.level.getDayTime() >= 12000) {
cropItemId = "MOONFLOWER";
}
ItemStack cropStack = ItemRepository.getItemStack(cropItemId.replace(":", "-")); // Hacky conversion to neu id since ItemUtils.getNeuId requires an item stack.

String counterText = FarmingHud.counterText();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;

public class StereoHarmonyHelper extends SimpleContainerSolver {
private static final Pattern PEST_NAME_PATTERN = Pattern.compile("^When playing, (?<name>.+) Pests are(?: more)*");
private static final Pattern PEST_NAME_PATTERN = Pattern.compile("^When playing, (?<name>.+) Pests.*");
public static final StereoHarmonyHelper INSTANCE = new StereoHarmonyHelper();

private StereoHarmonyHelper() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public static List<ScreenRectangle> getExclusionZones() {
private static void updateVisitors(AbstractContainerMenu handler) {
if (!processVisitor) return;
ItemStack visitorHead = handler.getSlot(13).getItem();
if (visitorHead == null || !visitorHead.has(DataComponents.LORE) || ItemUtils.getLoreLineIf(visitorHead, t -> t.contains("Times Visited")) == null) return;
if (visitorHead.isEmpty() || !visitorHead.has(DataComponents.LORE) || ItemUtils.getLoreLineIf(visitorHead, t -> t.contains("Times Visited")) == null) return;

Component visitorName = visitorHead.getHoverName();
if (activeVisitors.stream().map(Visitor::name).anyMatch(visitorName::equals)) return;
Expand All @@ -115,7 +115,7 @@ private static void updateVisitors(AbstractContainerMenu handler) {
*/
private static void extractRequiredItems(AbstractContainerMenu handler, Visitor visitor) {
ItemStack acceptButton = handler.getSlot(29).getItem();
if (acceptButton == null || ItemUtils.getLoreLineIf(acceptButton, t -> t.contains("Items Required")) == null) return;
if (acceptButton.isEmpty() || ItemUtils.getLoreLineIf(acceptButton, t -> t.contains("Items Required")) == null) return;

acceptButton.skyblocker$getLoreStrings().stream()
.map(String::trim)
Expand Down Expand Up @@ -227,7 +227,7 @@ public void renderWidget(GuiGraphics context, int mouseX, int mouseY, float delt

index++;
}
setHeight((groupedItems.size() + activeVisitors.size()) * (LINE_HEIGHT + Minecraft.getInstance().font.lineHeight) + PADDING * 2);
setHeight(index * (LINE_HEIGHT + Minecraft.getInstance().font.lineHeight) + PADDING * 2);
setWidth(newWidth + PADDING * 2);
exclusionZoneWidth = getWidth();
exclusionZoneHeight = getHeight();
Expand Down