Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-26 00:00:41 +01:00
Also check out-of-bounds on player inventory
Dieser Commit ist enthalten in:
Ursprung
ffae69471d
Commit
d80372e0b4
@ -28,6 +28,7 @@ package org.geysermc.connector.inventory;
|
|||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.NonNull;
|
import lombok.NonNull;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
import org.geysermc.connector.GeyserConnector;
|
||||||
import org.geysermc.connector.network.session.GeyserSession;
|
import org.geysermc.connector.network.session.GeyserSession;
|
||||||
|
|
||||||
public class PlayerInventory extends Inventory {
|
public class PlayerInventory extends Inventory {
|
||||||
@ -55,10 +56,18 @@ public class PlayerInventory extends Inventory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public GeyserItemStack getItemInHand() {
|
public GeyserItemStack getItemInHand() {
|
||||||
|
if (36 + heldItemSlot > this.size) {
|
||||||
|
GeyserConnector.getInstance().getLogger().debug("Held item slot was larger than expected!");
|
||||||
|
return GeyserItemStack.EMPTY;
|
||||||
|
}
|
||||||
return items[36 + heldItemSlot];
|
return items[36 + heldItemSlot];
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setItemInHand(@NonNull GeyserItemStack item) {
|
public void setItemInHand(@NonNull GeyserItemStack item) {
|
||||||
|
if (36 + heldItemSlot > this.size) {
|
||||||
|
GeyserConnector.getInstance().getLogger().debug("Held item slot was larger than expected!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
items[36 + heldItemSlot] = item;
|
items[36 + heldItemSlot] = item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren