Skip to content

Commit ddd4bee

Browse files
committed
clean up
1 parent 49a33ad commit ddd4bee

2 files changed

Lines changed: 5 additions & 9 deletions

File tree

src/main/java/com/robertx22/mine_and_slash/capability/player/container/JewelsMenu.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ public JewelsMenu(MenuType<?> pType, int pContainerId, Inventory pPlayerInventor
3535
}
3636
}
3737

38+
private boolean isJewelSlot(int pIndex) {
39+
return pIndex >= maxJewels && pIndex < firstPlayerInventoryIndex;
40+
}
41+
3842
@Override
3943
public ItemStack quickMoveStack(Player pPlayer, int pIndex) {
4044
if (isJewelSlot(pIndex)) {
@@ -43,10 +47,6 @@ public ItemStack quickMoveStack(Player pPlayer, int pIndex) {
4347
return super.quickMoveStack(pPlayer, pIndex);
4448
}
4549

46-
private boolean isJewelSlot(int pIndex) {
47-
return pIndex >= maxJewels && pIndex < firstPlayerInventoryIndex;
48-
}
49-
5050
@Override
5151
public void clicked(int pSlotId, int pButton, ClickType pClickType, Player pPlayer) {
5252
if (isJewelSlot(pSlotId) || pClickType == ClickType.PICKUP_ALL) {

src/main/java/com/robertx22/mine_and_slash/vanilla_mc/packets/OpenJewelsPacket.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,11 @@ public void saveToData(FriendlyByteBuf buf) {
4040

4141
@Override
4242
public void onReceived(ExilePacketContext ctx) {
43-
4443
JewelInvHelper jewels = Load.player(ctx.getPlayer()).getJewels();
45-
var inv = jewels.inv;
46-
4744
Player p = ctx.getPlayer();
4845
int maxJewels = jewels.getJewelSocketsMaxStat(p);
49-
5046
p.openMenu(new SimpleMenuProvider((i, playerInventory, playerEntity) -> {
51-
return oneRow(i, playerInventory, inv, maxJewels); // todo why doesnt vanilla have this
47+
return oneRow(i, playerInventory, jewels.inv, maxJewels); // todo why doesnt vanilla have this
5248
}, Component.literal("")));
5349

5450
}

0 commit comments

Comments
 (0)