3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-21 05:50:05 +01:00
Paper/src/main/java/net/minecraft/server/Slot.java

55 Zeilen
1.1 KiB
Java

package net.minecraft.server;
public class Slot {
2011-05-14 16:29:42 +02:00
public final int index; // CraftBukkit - private -> public
2011-09-15 02:23:52 +02:00
public final IInventory inventory;
public int c;
2011-09-15 02:23:52 +02:00
public int d;
2011-11-20 09:01:14 +01:00
public int e;
public Slot(IInventory iinventory, int i, int j, int k) {
this.inventory = iinventory;
this.index = i;
2011-11-20 09:01:14 +01:00
this.d = j;
this.e = k;
}
2011-11-20 09:01:14 +01:00
public void b(ItemStack itemstack) {
this.d();
}
public boolean isAllowed(ItemStack itemstack) {
return true;
}
public ItemStack getItem() {
return this.inventory.getItem(this.index);
}
2011-11-20 09:01:14 +01:00
public boolean c() {
2011-04-20 22:47:26 +02:00
return this.getItem() != null;
}
2011-03-31 22:40:00 +02:00
public void c(ItemStack itemstack) {
this.inventory.setItem(this.index, itemstack);
2011-11-20 09:01:14 +01:00
this.d();
}
2011-11-20 09:01:14 +01:00
public void d() {
this.inventory.update();
}
2011-11-20 09:01:14 +01:00
public int a() {
return this.inventory.getMaxStackSize();
}
public ItemStack a(int i) {
return this.inventory.splitStack(this.index, i);
}
public boolean a(IInventory iinventory, int i) {
return iinventory == this.inventory && i == this.index;
}
}