Skip to content

Commit

Permalink
Search options screen: don't hold on to item search screen instance
Browse files Browse the repository at this point in the history
Also, allow search item to be updated even if search upgrade isn't
currently switched on
  • Loading branch information
desht committed Aug 20, 2024
1 parent 69c6df6 commit df6142e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public void populateGui(IGuiScreen gui) {
PneumaticArmorItem.setSearchedItem(helmetStack, newSearchedItem);
NetworkHandler.sendToServer(new PacketUpdateSearchItem(newSearchedItem));
}
searchGui = null;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public Type<PacketUpdateSearchItem> type() {
public static void handle(PacketUpdateSearchItem message, IPayloadContext ctx) {
if (message.item() != null && message.item() != Items.AIR) {
CommonArmorHandler handler = CommonArmorHandler.getHandlerForPlayer(ctx.player());
if (handler.upgradeUsable(CommonUpgradeHandlers.searchHandler, true)) {
if (handler.upgradeUsable(CommonUpgradeHandlers.searchHandler, false)) {
ItemStack helmetStack = handler.getPlayer().getItemBySlot(EquipmentSlot.HEAD);
if (helmetStack.getItem() instanceof PneumaticArmorItem) { // should be, but let's be paranoid...
PneumaticArmorItem.setSearchedItem(helmetStack, message.item());
Expand Down

0 comments on commit df6142e

Please sign in to comment.