geforkt von Mirrors/Paper
SPIGOT-3272: Fix convertSlot in creative
Creative's slots are indexed the same as the survival crafting inventory, and thus the same transforms that happen in survival should happen in creative. By: Pokechu22 <Pokechu022@gmail.com>
Dieser Commit ist enthalten in:
Ursprung
6e76dbda88
Commit
96d1c2ec96
@ -1,6 +1,5 @@
|
|||||||
package org.bukkit.inventory;
|
package org.bukkit.inventory;
|
||||||
|
|
||||||
import org.bukkit.GameMode;
|
|
||||||
import org.bukkit.entity.HumanEntity;
|
import org.bukkit.entity.HumanEntity;
|
||||||
import org.bukkit.event.inventory.InventoryType;
|
import org.bukkit.event.inventory.InventoryType;
|
||||||
|
|
||||||
@ -228,13 +227,9 @@ public abstract class InventoryView {
|
|||||||
// Move down the slot index by the top size
|
// Move down the slot index by the top size
|
||||||
int slot = rawSlot - numInTop;
|
int slot = rawSlot - numInTop;
|
||||||
|
|
||||||
// Creative mode players have one contiguous inventory dictated by the client
|
|
||||||
if (getPlayer().getGameMode() == GameMode.CREATIVE && getType() == InventoryType.PLAYER) {
|
|
||||||
return slot;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Player crafting slots are indexed differently. The matrix is caught by the first return.
|
// Player crafting slots are indexed differently. The matrix is caught by the first return.
|
||||||
if (getType() == InventoryType.CRAFTING) {
|
// Creative mode is the same, except that you can't see the crafting slots (but the IDs are still used)
|
||||||
|
if (getType() == InventoryType.CRAFTING || getType() == InventoryType.CREATIVE) {
|
||||||
/**
|
/**
|
||||||
* Raw Slots:
|
* Raw Slots:
|
||||||
*
|
*
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren