Skip to content

Commit

Permalink
Fix pinventory_holder() for virtual inventories
Browse files Browse the repository at this point in the history
  • Loading branch information
PseudoKnight committed Aug 12, 2024
1 parent 9658a8e commit 8d8f807
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,22 @@ public int hashCode() {

@Override
public MCInventory getBottomInventory() {
return new BukkitMCInventory(ReflectionUtils.invokeMethod(iv, "getBottomInventory"));
return new BukkitMCInventory(ReflectionUtils.invokeMethod(InventoryView.class, iv, "getBottomInventory"));
}

@Override
public MCInventory getTopInventory() {
return new BukkitMCInventory(ReflectionUtils.invokeMethod(iv, "getTopInventory"));
return new BukkitMCInventory(ReflectionUtils.invokeMethod(InventoryView.class, iv, "getTopInventory"));
}

@Override
public void close() {
ReflectionUtils.invokeMethod(iv, "close");
ReflectionUtils.invokeMethod(InventoryView.class, iv, "close");
}

@Override
public int countSlots() {
return ReflectionUtils.invokeMethod(iv, "countSlots");
return ReflectionUtils.invokeMethod(InventoryView.class, iv, "countSlots");
}

@Override
Expand All @@ -66,17 +66,17 @@ public MCItemStack getItem(int slot) {

@Override
public MCHumanEntity getPlayer() {
return new BukkitMCHumanEntity(ReflectionUtils.invokeMethod(iv, "getPlayer"));
return new BukkitMCHumanEntity(ReflectionUtils.invokeMethod(InventoryView.class, iv, "getPlayer"));
}

@Override
public String getTitle() {
return ReflectionUtils.invokeMethod(iv, "getTitle");
return ReflectionUtils.invokeMethod(InventoryView.class, iv, "getTitle");
}

@Override
public MCInventoryType getType() {
return MCInventoryType.valueOf(((InventoryType) ReflectionUtils.invokeMethod(iv, "getType")).name());
return MCInventoryType.valueOf(((InventoryType) ReflectionUtils.invokeMethod(InventoryView.class, iv, "getType")).name());
}

@Override
Expand Down

0 comments on commit 8d8f807

Please sign in to comment.