2013-12-17 21:48:21 +01:00
|
|
|
package com.pahimar.ee3.handler;
|
2013-08-23 16:59:50 +02:00
|
|
|
|
2013-12-28 01:54:31 +01:00
|
|
|
import com.pahimar.ee3.item.crafting.RecipesAlchemicalBagDyes;
|
2014-07-18 21:55:10 +02:00
|
|
|
import com.pahimar.ee3.util.IOwnable;
|
2016-05-27 22:03:14 +02:00
|
|
|
import com.pahimar.ee3.util.ItemStackUtils;
|
2014-03-28 20:54:15 +01:00
|
|
|
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
|
|
|
import cpw.mods.fml.common.gameevent.PlayerEvent;
|
2013-12-28 01:54:31 +01:00
|
|
|
import net.minecraft.item.crafting.CraftingManager;
|
2013-08-23 16:59:50 +02:00
|
|
|
|
2014-03-28 20:54:15 +01:00
|
|
|
public class CraftingHandler
|
2013-12-16 02:26:42 +01:00
|
|
|
{
|
2015-11-25 22:00:25 +01:00
|
|
|
public static void init() {
|
2013-12-28 01:54:31 +01:00
|
|
|
// Add in the ability to dye Alchemical Bags
|
|
|
|
CraftingManager.getInstance().getRecipeList().add(new RecipesAlchemicalBagDyes());
|
2013-08-23 16:59:50 +02:00
|
|
|
}
|
|
|
|
|
2014-03-28 20:54:15 +01:00
|
|
|
@SubscribeEvent
|
2015-11-25 22:00:25 +01:00
|
|
|
public void onItemCraftedEvent(PlayerEvent.ItemCraftedEvent event) {
|
|
|
|
if (event.crafting.getItem() instanceof IOwnable) {
|
2016-05-27 22:03:14 +02:00
|
|
|
ItemStackUtils.setOwner(event.crafting, event.player);
|
2014-07-15 18:24:18 +02:00
|
|
|
}
|
2013-08-23 16:59:50 +02:00
|
|
|
}
|
|
|
|
}
|