這是我在Bukkit
中新庫存的代碼。在bukkit中創建自定義庫存
package com;
import org.bukkit.craftbukkit.v1_6_R2.inventory.CraftInventoryCustom;
import org.bukkit.inventory.*;
public class Server_Doc extends CraftInventoryCustom implements CraftingInventory, Inventory {
InventoryHolder IH;
public Server_Doc(InventoryHolder owner, int size) {
super(owner, size);
ItemStack items = new ItemStack(278);
((Inventory) owner).addItem(items);
// TODO Auto-generated constructor stub
}
@Override
public ItemStack[] getMatrix() {
// TODO Auto-generated method stub
return null;
}
@Override
public Recipe getRecipe() {
// TODO Auto-generated method stub
return null;
}
@Override
public ItemStack getResult() {
// TODO Auto-generated method stub
return null;
}
@Override
public void setMatrix(ItemStack[] contents) {
// TODO Auto-generated method stub
}
@Override
public void setResult(ItemStack newResult) {
// TODO Auto-generated method stub
}
//Inventory inv = Server_Doc(IH,8);
}
我怎樣才能打開庫存,一旦創建?
它確實打開一個GUI,但各具特色貴!..請幫助 –
@ user3171380在這種情況下,你需要的唯一代碼是'p.openWorkbench' – Jojodmo