Added some IC2 items to the Engineer's toolbox
This commit is contained in:
parent
0c52514b15
commit
fe7c44f298
2 changed files with 27 additions and 0 deletions
25
src/main/java/malte0811/industrialWires/ExtraIC2Compat.java
Normal file
25
src/main/java/malte0811/industrialWires/ExtraIC2Compat.java
Normal file
|
@ -0,0 +1,25 @@
|
|||
package malte0811.industrialWires;
|
||||
|
||||
import blusunrize.immersiveengineering.api.ApiUtils;
|
||||
import blusunrize.immersiveengineering.api.tool.ToolboxHandler;
|
||||
import ic2.api.item.IBoxable;
|
||||
import ic2.api.item.IC2Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ExtraIC2Compat {
|
||||
public static void addToolConmpat() {
|
||||
Item tinnedFood = IC2Items.getItem("filled_tin_can").getItem();
|
||||
ItemStack emptyMug = IC2Items.getItem("mug", "empty");
|
||||
ToolboxHandler.addFoodType((s)->s.getItem()==tinnedFood);
|
||||
ToolboxHandler.addFoodType((s)->
|
||||
s.getItem()==emptyMug.getItem()&&!ItemStack.areItemStacksEqual(emptyMug, ApiUtils.copyStackWithAmount(s, 1))
|
||||
);
|
||||
Item cable = IC2Items.getItem("cable", "type:copper,insulation:0").getItem();
|
||||
ToolboxHandler.addWiringType((s, w)->s.getItem()==cable);
|
||||
ToolboxHandler.addToolType((s)-> {
|
||||
Item a = s.getItem();
|
||||
return a instanceof IBoxable && ((IBoxable) a).canBeStoredInToolbox(s);
|
||||
});
|
||||
}
|
||||
}
|
|
@ -196,6 +196,8 @@ public class IndustrialWires {
|
|||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(panelComponent, 1, 6),
|
||||
"aaa", "asa", 'a', "plateAluminum", 's', new ItemStack(panelComponent, 2, 5)));
|
||||
|
||||
ExtraIC2Compat.addToolConmpat();
|
||||
|
||||
packetHandler.registerMessage(MessageTileSyncIW.HandlerClient.class, MessageTileSyncIW.class, 0, Side.CLIENT);
|
||||
packetHandler.registerMessage(MessagePanelInteract.HandlerServer.class, MessagePanelInteract.class, 1, Side.SERVER);
|
||||
packetHandler.registerMessage(MessageGUIInteract.HandlerServer.class, MessageGUIInteract.class, 2, Side.SERVER);
|
||||
|
|
Loading…
Reference in a new issue