electrodynamics/archive/java/dark/lib/prefab/invgui/WatchedSlot.java
2014-01-11 17:44:07 +08:00

26 lines
589 B
Java

package dark.lib.prefab.invgui;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
/** A slot that triggers the container class if changed */
public class WatchedSlot extends Slot
{
private ISlotWatcher slotWatcher;
public WatchedSlot(IInventory inventory, int id, int xPosition, int yPosition, ISlotWatcher slotWatcher)
{
super(inventory, id, xPosition, yPosition);
this.slotWatcher = slotWatcher;
}
@Override
public void onSlotChanged()
{
if (this.slotWatcher != null)
{
this.slotWatcher.slotContentsChanged(this.slotNumber);
}
}
}