3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-19 21:10:10 +01:00

All inventory stuff in org.bukkit moved to org.bukkit.inventory

Dieser Commit ist enthalten in:
Dinnerbone 2011-01-15 21:27:29 +00:00
Ursprung 9150e8d85d
Commit 6b9ad41a05
8 geänderte Dateien mit 99 neuen und 99 gelöschten Zeilen

Datei anzeigen

@ -4,10 +4,10 @@ import java.util.HashMap;
import net.minecraft.server.IInventory; import net.minecraft.server.IInventory;
import org.bukkit.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.Material; import org.bukkit.Material;
public class CraftInventory implements org.bukkit.Inventory { public class CraftInventory implements org.bukkit.inventory.Inventory {
protected IInventory inventory; protected IInventory inventory;
public CraftInventory(IInventory inventory) { public CraftInventory(IInventory inventory) {

Datei anzeigen

@ -1,66 +1,66 @@
package org.bukkit.craftbukkit; package org.bukkit.craftbukkit;
import net.minecraft.server.InventoryPlayer; import net.minecraft.server.InventoryPlayer;
import org.bukkit.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.PlayerInventory; import org.bukkit.inventory.PlayerInventory;
public class CraftInventoryPlayer extends CraftInventory implements PlayerInventory { public class CraftInventoryPlayer extends CraftInventory implements PlayerInventory {
public CraftInventoryPlayer(net.minecraft.server.InventoryPlayer inventory) { public CraftInventoryPlayer(net.minecraft.server.InventoryPlayer inventory) {
super(inventory); super(inventory);
} }
public InventoryPlayer getInventory() { public InventoryPlayer getInventory() {
return (InventoryPlayer) inventory; return (InventoryPlayer) inventory;
} }
public int getSize() { public int getSize() {
return super.getSize() - 4; return super.getSize() - 4;
} }
public CraftItemStack getItemInHand() { public CraftItemStack getItemInHand() {
return new CraftItemStack( getInventory().e() ); return new CraftItemStack( getInventory().e() );
} }
public CraftItemStack getHelmet() { public CraftItemStack getHelmet() {
return getItem( getSize() + 0 ); return getItem( getSize() + 0 );
} }
public CraftItemStack getChestplate() { public CraftItemStack getChestplate() {
return getItem( getSize() + 1 ); return getItem( getSize() + 1 );
} }
public CraftItemStack getLeggings() { public CraftItemStack getLeggings() {
return getItem( getSize() + 2 ); return getItem( getSize() + 2 );
} }
public CraftItemStack getBoots() { public CraftItemStack getBoots() {
return getItem( getSize() + 3 ); return getItem( getSize() + 3 );
} }
public void setHelmet(ItemStack helmet) { public void setHelmet(ItemStack helmet) {
setItem( getSize() + 0, helmet ); setItem( getSize() + 0, helmet );
} }
public void setChestplate(ItemStack chestplate) { public void setChestplate(ItemStack chestplate) {
setItem( getSize() + 1, chestplate ); setItem( getSize() + 1, chestplate );
} }
public void setLeggings(ItemStack leggings) { public void setLeggings(ItemStack leggings) {
setItem( getSize() + 2, leggings ); setItem( getSize() + 2, leggings );
} }
public void setBoots(ItemStack boots) { public void setBoots(ItemStack boots) {
setItem( getSize() + 3, boots ); setItem( getSize() + 3, boots );
} }
public ItemStack[] getArmorContents() { public ItemStack[] getArmorContents() {
net.minecraft.server.ItemStack[] mcItems = getInventory().getArmorContents(); net.minecraft.server.ItemStack[] mcItems = getInventory().getArmorContents();
ItemStack[] ret = new ItemStack[mcItems.length]; ItemStack[] ret = new ItemStack[mcItems.length];
for (int i = 0; i < mcItems.length; i++ ) { for (int i = 0; i < mcItems.length; i++ ) {
ret[i] = new CraftItemStack(mcItems[i]); ret[i] = new CraftItemStack(mcItems[i]);
} }
return ret; return ret;
} }
} }

Datei anzeigen

@ -1,6 +1,6 @@
package org.bukkit.craftbukkit; package org.bukkit.craftbukkit;
import org.bukkit.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.Material; import org.bukkit.Material;
public class CraftItemStack extends ItemStack { public class CraftItemStack extends ItemStack {

Datei anzeigen

@ -1,25 +1,25 @@
package org.bukkit.craftbukkit; package org.bukkit.craftbukkit;
import org.bukkit.Inventory; import org.bukkit.inventory.Inventory;
import org.bukkit.ItemStack; import org.bukkit.inventory.ItemStack;
import net.minecraft.server.Slot; import net.minecraft.server.Slot;
public class CraftSlot implements org.bukkit.Slot { public class CraftSlot implements org.bukkit.inventory.Slot {
private final Slot slot; private final Slot slot;
public CraftSlot(Slot slot) { public CraftSlot(Slot slot) {
this.slot = slot; this.slot = slot;
} }
public Inventory getInventory() { public Inventory getInventory() {
return new CraftInventory( slot.b ); return new CraftInventory( slot.b );
} }
public int getIndex() { public int getIndex() {
return slot.a; return slot.a;
} }
public ItemStack getItem() { public ItemStack getItem() {
return new CraftItemStack( slot.c() ); return new CraftItemStack( slot.c() );
} }
} }

Datei anzeigen

@ -34,7 +34,7 @@ import org.bukkit.Block;
import org.bukkit.entity.Boat; import org.bukkit.entity.Boat;
import org.bukkit.Chunk; import org.bukkit.Chunk;
import org.bukkit.entity.ItemDrop; import org.bukkit.entity.ItemDrop;
import org.bukkit.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.entity.Minecart; import org.bukkit.entity.Minecart;
import org.bukkit.entity.PoweredMinecart; import org.bukkit.entity.PoweredMinecart;

Datei anzeigen

@ -3,8 +3,8 @@ package org.bukkit.craftbukkit.entity;
import net.minecraft.server.EntityPlayer; import net.minecraft.server.EntityPlayer;
import org.bukkit.entity.HumanEntity; import org.bukkit.entity.HumanEntity;
import org.bukkit.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.PlayerInventory; import org.bukkit.inventory.PlayerInventory;
import org.bukkit.craftbukkit.CraftInventoryPlayer; import org.bukkit.craftbukkit.CraftInventoryPlayer;
import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftServer;

Datei anzeigen

@ -2,7 +2,7 @@ package org.bukkit.craftbukkit.entity;
import net.minecraft.server.EntityItem; import net.minecraft.server.EntityItem;
import org.bukkit.entity.ItemDrop; import org.bukkit.entity.ItemDrop;
import org.bukkit.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.craftbukkit.CraftItemStack; import org.bukkit.craftbukkit.CraftItemStack;
import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftServer;

Datei anzeigen

@ -2,7 +2,7 @@ package org.bukkit.craftbukkit.entity;
import net.minecraft.server.EntityMinecart; import net.minecraft.server.EntityMinecart;
import org.bukkit.Inventory; import org.bukkit.inventory.Inventory;
import org.bukkit.craftbukkit.CraftInventory; import org.bukkit.craftbukkit.CraftInventory;
import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.StorageMinecart; import org.bukkit.entity.StorageMinecart;