Implemented AutoCraft event

Not that the armbot works right now but why not. We can just fix it
later if it doesn't work.
This commit is contained in:
Robert 2013-11-10 21:48:20 -05:00
parent 73e4ccb805
commit dc000f4740

View file

@ -27,6 +27,7 @@ import com.google.common.io.ByteArrayDataInput;
import dark.api.al.coding.IArmbot;
import dark.api.al.coding.IArmbotUseable;
import dark.api.events.AutoCraftEvent;
import dark.core.common.DarkMain;
import dark.core.helpers.AutoCraftingManager;
import dark.core.helpers.AutoCraftingManager.IAutoCrafter;
@ -394,10 +395,14 @@ public class TileEntityImprinter extends TileEntityAdvanced implements ISidedInv
if (this.imprinterMatrix[craftingOutputSlot] != null)
{
armbot.grab(this.imprinterMatrix[craftingOutputSlot].copy());
this.onPickUpFromSlot(null, 2, this.imprinterMatrix[craftingOutputSlot]);
this.imprinterMatrix[craftingOutputSlot] = null;
return true;
AutoCraftEvent.PreCraft event = new AutoCraftEvent.PreCraft(this.worldObj, new Vector3(this), this, this.imprinterMatrix[craftingOutputSlot]);
if (!event.isCanceled())
{
armbot.grab(this.imprinterMatrix[craftingOutputSlot].copy());
this.onPickUpFromSlot(null, 2, this.imprinterMatrix[craftingOutputSlot]);
this.imprinterMatrix[craftingOutputSlot] = null;
return true;
}
}
return false;