Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-10 05:20:04 +01:00
Updated SpoutPlayerBlockBag for Vanilla breakage
Dieser Commit ist enthalten in:
Ursprung
50b7ef02c7
Commit
b32668057f
@ -29,12 +29,12 @@ import com.sk89q.worldedit.bags.OutOfSpaceException;
|
|||||||
import com.sk89q.worldedit.blocks.BaseItem;
|
import com.sk89q.worldedit.blocks.BaseItem;
|
||||||
import com.sk89q.worldedit.blocks.BaseItemStack;
|
import com.sk89q.worldedit.blocks.BaseItemStack;
|
||||||
import com.sk89q.worldedit.blocks.BlockID;
|
import com.sk89q.worldedit.blocks.BlockID;
|
||||||
import org.spout.api.inventory.Inventory;
|
import org.spout.api.inventory.InventoryBase;
|
||||||
import org.spout.api.inventory.ItemStack;
|
import org.spout.api.inventory.ItemStack;
|
||||||
import org.spout.api.material.Material;
|
import org.spout.api.material.Material;
|
||||||
import org.spout.api.material.MaterialRegistry;
|
import org.spout.api.material.MaterialRegistry;
|
||||||
import org.spout.api.player.Player;
|
import org.spout.api.player.Player;
|
||||||
import org.spout.vanilla.controller.living.player.VanillaPlayer;
|
import org.spout.vanilla.util.VanillaPlayerUtil;
|
||||||
|
|
||||||
public class SpoutPlayerBlockBag extends BlockBag {
|
public class SpoutPlayerBlockBag extends BlockBag {
|
||||||
/**
|
/**
|
||||||
@ -60,8 +60,7 @@ public class SpoutPlayerBlockBag extends BlockBag {
|
|||||||
*/
|
*/
|
||||||
private void loadInventory() {
|
private void loadInventory() {
|
||||||
if (items == null) {
|
if (items == null) {
|
||||||
VanillaPlayer vanillaPlayer = (VanillaPlayer) player.getEntity().getController();
|
items = VanillaPlayerUtil.getInventory(player.getEntity()).getContents();
|
||||||
items = vanillaPlayer.getInventory().getContents();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -208,8 +207,7 @@ public class SpoutPlayerBlockBag extends BlockBag {
|
|||||||
@Override
|
@Override
|
||||||
public void flushChanges() {
|
public void flushChanges() {
|
||||||
if (items != null) {
|
if (items != null) {
|
||||||
VanillaPlayer vanillaPlayer = (VanillaPlayer) player.getEntity().getController();
|
InventoryBase inv = VanillaPlayerUtil.getInventory(player.getEntity());
|
||||||
Inventory inv = vanillaPlayer.getInventory();
|
|
||||||
for (int i = 0; i < items.length && i < inv.getSize(); ++i) {
|
for (int i = 0; i < items.length && i < inv.getSize(); ++i) {
|
||||||
inv.setItem(i, items[i]);
|
inv.setItem(i, items[i]);
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren