2018-02-08 22:08:21 +01:00
|
|
|
/*
|
2016-09-29 16:19:16 +02:00
|
|
|
* This file is part of Industrial Wires.
|
2018-02-28 21:06:33 +01:00
|
|
|
* Copyright (C) 2016-2018 malte0811
|
2016-09-29 16:19:16 +02:00
|
|
|
* Industrial Wires is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
* Industrial Wires is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
2017-02-26 13:56:36 +01:00
|
|
|
*/
|
2016-09-15 20:43:18 +02:00
|
|
|
package malte0811.industrialWires;
|
|
|
|
|
2018-02-08 22:08:21 +01:00
|
|
|
import blusunrize.immersiveengineering.ImmersiveEngineering;
|
|
|
|
import blusunrize.immersiveengineering.api.MultiblockHandler;
|
|
|
|
import blusunrize.immersiveengineering.api.energy.wires.WireApi;
|
|
|
|
import com.google.common.collect.ImmutableMap;
|
|
|
|
import malte0811.industrialWires.blocks.BlockIWBase;
|
|
|
|
import malte0811.industrialWires.blocks.controlpanel.*;
|
|
|
|
import malte0811.industrialWires.blocks.converter.*;
|
|
|
|
import malte0811.industrialWires.blocks.hv.*;
|
|
|
|
import malte0811.industrialWires.blocks.wire.*;
|
|
|
|
import malte0811.industrialWires.compat.Compat;
|
|
|
|
import malte0811.industrialWires.controlpanel.PanelComponent;
|
|
|
|
import malte0811.industrialWires.controlpanel.PanelUtils;
|
2018-02-28 21:03:26 +01:00
|
|
|
import malte0811.industrialWires.converter.EUCapability;
|
2018-02-08 22:08:21 +01:00
|
|
|
import malte0811.industrialWires.converter.MechMBPart;
|
2018-05-13 18:54:26 +02:00
|
|
|
import malte0811.industrialWires.converter.MultiblockMechMB;
|
2018-02-08 22:08:21 +01:00
|
|
|
import malte0811.industrialWires.crafting.Recipes;
|
2018-02-17 20:37:53 +01:00
|
|
|
import malte0811.industrialWires.entities.EntityBrokenPart;
|
2018-02-08 22:08:21 +01:00
|
|
|
import malte0811.industrialWires.hv.MarxOreHandler;
|
|
|
|
import malte0811.industrialWires.hv.MultiblockMarx;
|
|
|
|
import malte0811.industrialWires.items.ItemIC2Coil;
|
|
|
|
import malte0811.industrialWires.items.ItemKey;
|
|
|
|
import malte0811.industrialWires.items.ItemPanelComponent;
|
|
|
|
import malte0811.industrialWires.network.MessageGUIInteract;
|
|
|
|
import malte0811.industrialWires.network.MessageItemSync;
|
|
|
|
import malte0811.industrialWires.network.MessagePanelInteract;
|
|
|
|
import malte0811.industrialWires.network.MessageTileSyncIW;
|
|
|
|
import malte0811.industrialWires.util.CommandIW;
|
2018-06-02 21:22:26 +02:00
|
|
|
import malte0811.industrialWires.util.MultiblockTemplateManual;
|
2018-02-08 22:08:21 +01:00
|
|
|
import net.minecraft.block.Block;
|
|
|
|
import net.minecraft.creativetab.CreativeTabs;
|
|
|
|
import net.minecraft.item.Item;
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import net.minecraft.item.crafting.IRecipe;
|
2018-06-13 19:09:35 +02:00
|
|
|
import net.minecraft.network.datasync.DataSerializers;
|
|
|
|
import net.minecraft.network.datasync.EntityDataManager;
|
2018-02-08 22:08:21 +01:00
|
|
|
import net.minecraft.util.ResourceLocation;
|
2018-06-13 19:09:35 +02:00
|
|
|
import net.minecraft.util.SoundEvent;
|
2018-02-08 22:08:21 +01:00
|
|
|
import net.minecraftforge.event.RegistryEvent;
|
|
|
|
import net.minecraftforge.fml.common.Loader;
|
|
|
|
import net.minecraftforge.fml.common.Mod;
|
|
|
|
import net.minecraftforge.fml.common.Mod.EventHandler;
|
|
|
|
import net.minecraftforge.fml.common.SidedProxy;
|
|
|
|
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
|
|
|
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
|
|
|
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
|
|
|
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
|
|
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
|
|
|
import net.minecraftforge.fml.common.network.NetworkRegistry;
|
|
|
|
import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper;
|
2018-02-17 20:37:53 +01:00
|
|
|
import net.minecraftforge.fml.common.registry.EntityRegistry;
|
2018-02-08 22:08:21 +01:00
|
|
|
import net.minecraftforge.fml.common.registry.GameRegistry;
|
|
|
|
import net.minecraftforge.fml.relauncher.Side;
|
2018-06-13 19:09:35 +02:00
|
|
|
import net.minecraftforge.registries.IForgeRegistry;
|
2018-02-08 22:08:21 +01:00
|
|
|
import org.apache.logging.log4j.Logger;
|
2017-07-09 18:10:06 +02:00
|
|
|
|
2018-02-08 22:08:21 +01:00
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
2017-10-07 16:27:51 +02:00
|
|
|
|
2018-02-08 22:08:21 +01:00
|
|
|
import static malte0811.industrialWires.blocks.wire.BlockTypes_IC2_Connector.*;
|
2018-06-02 21:22:26 +02:00
|
|
|
import static malte0811.industrialWires.converter.MechMBPart.EXAMPLE_MECHMB_LOC;
|
2018-06-13 19:09:35 +02:00
|
|
|
import static malte0811.industrialWires.entities.EntityBrokenPart.MARKER_TEXTURE;
|
|
|
|
import static malte0811.industrialWires.entities.EntityBrokenPart.RES_LOC_SERIALIZER;
|
2018-02-08 22:08:21 +01:00
|
|
|
import static malte0811.industrialWires.wires.IC2Wiretype.*;
|
2018-01-30 21:59:09 +01:00
|
|
|
|
2018-02-04 17:00:31 +01:00
|
|
|
@Mod(modid = IndustrialWires.MODID, version = IndustrialWires.VERSION, dependencies = "required-after:immersiveengineering@[0.12-77,);after:ic2",
|
2017-09-02 17:20:57 +02:00
|
|
|
certificateFingerprint = "7e11c175d1e24007afec7498a1616bef0000027d")
|
2017-07-09 18:10:06 +02:00
|
|
|
@Mod.EventBusSubscriber
|
2016-09-15 20:43:18 +02:00
|
|
|
public class IndustrialWires {
|
|
|
|
public static final String MODID = "industrialwires";
|
|
|
|
public static final String VERSION = "${version}";
|
2017-08-29 21:31:22 +02:00
|
|
|
public static final String MODNAME = "Industrial Wires";
|
2018-06-13 19:09:35 +02:00
|
|
|
public static final ResourceLocation TINNITUS_LOC = new ResourceLocation(IndustrialWires.MODID, "tinnitus");
|
|
|
|
public static final ResourceLocation LADDER_START = new ResourceLocation(IndustrialWires.MODID, "jacobs_ladder_start");//~470 ms ~=9 ticks
|
|
|
|
public static final ResourceLocation LADDER_MIDDLE = new ResourceLocation(IndustrialWires.MODID, "jacobs_ladder_middle");
|
|
|
|
public static final ResourceLocation LADDER_END = new ResourceLocation(IndustrialWires.MODID, "jacobs_ladder_end");//~210 ms ~= 4 ticks
|
|
|
|
public static final ResourceLocation MARX_BANG = new ResourceLocation(IndustrialWires.MODID, "marx_bang");
|
|
|
|
public static final ResourceLocation MARX_POP = new ResourceLocation(IndustrialWires.MODID, "marx_pop");
|
|
|
|
public static final ResourceLocation TURN_FAST = new ResourceLocation(IndustrialWires.MODID, "mech_mb_fast");
|
|
|
|
public static final ResourceLocation TURN_SLOW = new ResourceLocation(IndustrialWires.MODID, "mech_mb_slow");
|
2017-07-09 18:10:06 +02:00
|
|
|
|
|
|
|
public static final List<BlockIWBase> blocks = new ArrayList<>();
|
|
|
|
public static final List<Item> items = new ArrayList<>();
|
|
|
|
|
2017-08-23 22:30:24 +02:00
|
|
|
@GameRegistry.ObjectHolder(MODID+":"+BlockIC2Connector.NAME)
|
|
|
|
public static BlockIC2Connector ic2conn = null;
|
|
|
|
@GameRegistry.ObjectHolder(MODID+":"+BlockMechanicalConverter.NAME)
|
|
|
|
public static BlockMechanicalConverter mechConv = null;
|
|
|
|
@GameRegistry.ObjectHolder(MODID+":"+BlockJacobsLadder.NAME)
|
|
|
|
public static BlockJacobsLadder jacobsLadder = null;
|
|
|
|
@GameRegistry.ObjectHolder(MODID+":"+BlockPanel.NAME)
|
|
|
|
public static BlockPanel panel = null;
|
2017-09-04 17:42:50 +02:00
|
|
|
@GameRegistry.ObjectHolder(MODID+":"+BlockHVMultiblocks.NAME)
|
|
|
|
public static BlockHVMultiblocks hvMultiblocks = null;
|
2017-10-04 17:05:04 +02:00
|
|
|
@GameRegistry.ObjectHolder(MODID+":"+BlockMechanicalMB.NAME)
|
|
|
|
public static BlockMechanicalMB mechanicalMB = null;
|
2018-01-28 21:29:55 +01:00
|
|
|
@GameRegistry.ObjectHolder(MODID+":"+ BlockGeneralHV.NAME)
|
|
|
|
public static BlockGeneralHV generalHV = null;
|
2017-08-23 22:30:24 +02:00
|
|
|
|
|
|
|
@GameRegistry.ObjectHolder(MODID+":"+ItemIC2Coil.NAME)
|
|
|
|
public static ItemIC2Coil coil = null;
|
|
|
|
@GameRegistry.ObjectHolder(MODID+":"+ItemPanelComponent.NAME)
|
|
|
|
public static ItemPanelComponent panelComponent = null;
|
|
|
|
@GameRegistry.ObjectHolder(MODID+":"+ItemKey.ITEM_NAME)
|
|
|
|
public static ItemKey key = null;
|
2018-02-28 21:03:26 +01:00
|
|
|
|
|
|
|
|
|
|
|
@GameRegistry.ObjectHolder("ic2:te")
|
|
|
|
public static Block ic2TeBlock = null;
|
|
|
|
|
2017-02-26 13:56:36 +01:00
|
|
|
public static final SimpleNetworkWrapper packetHandler = NetworkRegistry.INSTANCE.newSimpleChannel(MODID);
|
2017-07-09 18:10:06 +02:00
|
|
|
|
|
|
|
public static Logger logger;
|
2017-04-09 16:59:57 +02:00
|
|
|
@Mod.Instance(MODID)
|
|
|
|
public static IndustrialWires instance = new IndustrialWires();
|
2016-09-15 20:43:18 +02:00
|
|
|
public static CreativeTabs creativeTab = new CreativeTabs(MODID) {
|
2016-12-19 18:16:46 +01:00
|
|
|
|
2016-09-15 20:43:18 +02:00
|
|
|
@Override
|
2017-05-10 17:56:05 +02:00
|
|
|
public ItemStack getTabIconItem() {
|
2017-08-23 22:30:24 +02:00
|
|
|
if (coil!=null) {
|
|
|
|
return new ItemStack(coil, 1, 2);
|
|
|
|
} else {
|
|
|
|
return new ItemStack(panel, 1, 3);
|
|
|
|
}
|
2016-09-15 20:43:18 +02:00
|
|
|
}
|
|
|
|
};
|
2017-05-11 16:39:20 +02:00
|
|
|
@SidedProxy(clientSide = "malte0811.industrialWires.client.ClientProxy", serverSide = "malte0811.industrialWires.CommonProxy")
|
2016-09-15 20:43:18 +02:00
|
|
|
public static CommonProxy proxy;
|
2017-08-22 18:33:05 +02:00
|
|
|
public static boolean hasIC2;
|
|
|
|
public static boolean hasTechReborn;
|
2017-10-21 21:15:01 +02:00
|
|
|
public static boolean isOldIE;
|
2016-09-15 20:43:18 +02:00
|
|
|
|
|
|
|
@EventHandler
|
|
|
|
public void preInit(FMLPreInitializationEvent e) {
|
2017-08-22 18:33:05 +02:00
|
|
|
hasIC2 = Loader.isModLoaded("ic2");
|
|
|
|
hasTechReborn = Loader.isModLoaded("techreborn");
|
2017-10-21 21:15:01 +02:00
|
|
|
{
|
|
|
|
double ieThreshold = 12.74275;
|
2017-10-22 19:58:06 +02:00
|
|
|
String ieVer = Loader.instance().getIndexedModList().get(ImmersiveEngineering.MODID).getDisplayVersion();
|
2017-10-21 21:15:01 +02:00
|
|
|
int firstDash = ieVer.indexOf('-');
|
|
|
|
String end = ieVer.substring(firstDash+1);
|
|
|
|
String start = ieVer.substring(0, firstDash);
|
|
|
|
end = end.replaceAll("[^0-9]", "");
|
|
|
|
start = start.replaceAll("[^0-9]", "");
|
|
|
|
double ieVerDouble = Double.parseDouble(start+"."+end);
|
|
|
|
isOldIE = ieVerDouble<ieThreshold;
|
|
|
|
}
|
2017-07-09 18:10:06 +02:00
|
|
|
logger = e.getModLog();
|
2016-12-13 21:00:07 +01:00
|
|
|
new IWConfig();
|
2017-08-22 18:33:05 +02:00
|
|
|
if (hasIC2) {
|
|
|
|
GameRegistry.registerTileEntity(TileEntityIC2ConnectorTin.class, MODID + ":ic2ConnectorTin");
|
|
|
|
GameRegistry.registerTileEntity(TileEntityIC2ConnectorCopper.class, MODID + ":ic2ConnectorCopper");
|
|
|
|
GameRegistry.registerTileEntity(TileEntityIC2ConnectorGold.class, MODID + ":ic2ConnectorGold");
|
|
|
|
GameRegistry.registerTileEntity(TileEntityIC2ConnectorHV.class, MODID + ":ic2ConnectorHV");
|
|
|
|
GameRegistry.registerTileEntity(TileEntityIC2ConnectorGlass.class, MODID + ":ic2ConnectorGlass");
|
|
|
|
// Dummy TE's with bad names used to update old TE's to the proper names
|
|
|
|
GameRegistry.registerTileEntity(DummyTEs.TinDummy.class, MODID + "ic2ConnectorTin");
|
|
|
|
GameRegistry.registerTileEntity(DummyTEs.CopperDummy.class, MODID + "ic2ConnectorCopper");
|
|
|
|
GameRegistry.registerTileEntity(DummyTEs.GoldDummy.class, MODID + "ic2ConnectorGold");
|
|
|
|
GameRegistry.registerTileEntity(DummyTEs.HVDummy.class, MODID + "ic2ConnectorHV");
|
|
|
|
GameRegistry.registerTileEntity(DummyTEs.GlassDummy.class, MODID + "ic2ConnectorGlass");
|
|
|
|
|
|
|
|
if (IWConfig.enableConversion) {
|
|
|
|
GameRegistry.registerTileEntity(TileEntityIEMotor.class, MODID + ":ieMotor");
|
|
|
|
GameRegistry.registerTileEntity(TileEntityMechICtoIE.class, MODID + ":mechIcToIe");
|
|
|
|
GameRegistry.registerTileEntity(TileEntityMechIEtoIC.class, MODID + ":mechIeToIc");
|
|
|
|
}
|
|
|
|
}
|
2018-04-22 22:14:08 +02:00
|
|
|
GameRegistry.registerTileEntity(TileEntityMechMB.class, MODID + ":mechMB");
|
2017-05-11 16:39:20 +02:00
|
|
|
GameRegistry.registerTileEntity(TileEntityJacobsLadder.class, MODID + ":jacobsLadder");
|
2017-05-25 17:49:06 +02:00
|
|
|
GameRegistry.registerTileEntity(TileEntityMarx.class, MODID + ":marx_generator");
|
2017-05-11 16:39:20 +02:00
|
|
|
GameRegistry.registerTileEntity(TileEntityPanel.class, MODID + ":control_panel");
|
|
|
|
GameRegistry.registerTileEntity(TileEntityRSPanelConn.class, MODID + ":control_panel_rs");
|
|
|
|
GameRegistry.registerTileEntity(TileEntityPanelCreator.class, MODID + ":panel_creator");
|
2017-06-30 21:04:02 +02:00
|
|
|
GameRegistry.registerTileEntity(TileEntityUnfinishedPanel.class, MODID + ":unfinished_panel");
|
2017-07-03 17:06:47 +02:00
|
|
|
GameRegistry.registerTileEntity(TileEntityComponentPanel.class, MODID + ":single_component_panel");
|
2018-01-28 21:29:55 +01:00
|
|
|
GameRegistry.registerTileEntity(TileEntityDischargeMeter.class, MODID + ":discharge_meter");
|
2018-06-13 19:09:35 +02:00
|
|
|
|
|
|
|
DataSerializers.registerSerializer(RES_LOC_SERIALIZER);
|
|
|
|
MARKER_TEXTURE = EntityDataManager.createKey(EntityBrokenPart.class, RES_LOC_SERIALIZER);
|
2018-02-17 20:37:53 +01:00
|
|
|
EntityRegistry.registerModEntity(new ResourceLocation(MODID, "broken_part"), EntityBrokenPart.class,
|
2018-05-12 19:04:38 +02:00
|
|
|
"broken_part", 0, this, 64, 5, true);
|
2017-06-16 22:04:30 +02:00
|
|
|
|
2016-09-15 20:43:18 +02:00
|
|
|
proxy.preInit();
|
2017-08-27 22:45:52 +02:00
|
|
|
Compat.preInit();
|
2017-08-29 22:01:51 +02:00
|
|
|
MarxOreHandler.preInit();
|
2018-02-28 21:03:26 +01:00
|
|
|
MechMBPart.preInit();
|
2016-09-15 20:43:18 +02:00
|
|
|
}
|
|
|
|
|
2017-07-09 18:10:06 +02:00
|
|
|
@SubscribeEvent
|
|
|
|
public static void registerBlocks(RegistryEvent.Register<Block> event) {
|
2017-08-23 22:30:24 +02:00
|
|
|
|
|
|
|
if (IWConfig.enableConversion&&hasIC2) {
|
|
|
|
event.getRegistry().register(new BlockMechanicalConverter());
|
2017-07-09 18:10:06 +02:00
|
|
|
}
|
2017-09-04 17:42:50 +02:00
|
|
|
if (hasIC2) {
|
2017-08-23 22:30:24 +02:00
|
|
|
event.getRegistry().register(new BlockIC2Connector());
|
|
|
|
}
|
|
|
|
event.getRegistry().register(new BlockJacobsLadder());
|
|
|
|
event.getRegistry().register(new BlockPanel());
|
2017-09-04 17:42:50 +02:00
|
|
|
event.getRegistry().register(new BlockHVMultiblocks());
|
2017-10-04 17:05:04 +02:00
|
|
|
event.getRegistry().register(new BlockMechanicalMB());
|
2018-01-28 21:29:55 +01:00
|
|
|
event.getRegistry().register(new BlockGeneralHV());
|
2017-07-09 18:10:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@SubscribeEvent
|
|
|
|
public static void registerItems(RegistryEvent.Register<Item> event) {
|
|
|
|
for (BlockIWBase b:blocks) {
|
|
|
|
event.getRegistry().register(b.createItemBlock());
|
|
|
|
}
|
2017-08-23 22:30:24 +02:00
|
|
|
|
2017-09-04 17:42:50 +02:00
|
|
|
if (hasIC2) {
|
2017-08-23 22:30:24 +02:00
|
|
|
event.getRegistry().register(new ItemIC2Coil());
|
2017-07-09 18:10:06 +02:00
|
|
|
}
|
2017-08-23 22:30:24 +02:00
|
|
|
event.getRegistry().register(new ItemPanelComponent());
|
|
|
|
event.getRegistry().register(new ItemKey());
|
2017-07-09 18:10:06 +02:00
|
|
|
}
|
|
|
|
|
2018-06-13 19:09:35 +02:00
|
|
|
@SubscribeEvent
|
|
|
|
public static void registerSounds(RegistryEvent.Register<SoundEvent> event) {
|
|
|
|
registerSound(event.getRegistry(), TINNITUS_LOC);
|
|
|
|
registerSound(event.getRegistry(), LADDER_START);
|
|
|
|
registerSound(event.getRegistry(), LADDER_MIDDLE);
|
|
|
|
registerSound(event.getRegistry(), LADDER_END);
|
|
|
|
registerSound(event.getRegistry(), MARX_BANG);
|
|
|
|
registerSound(event.getRegistry(), MARX_POP);
|
|
|
|
registerSound(event.getRegistry(), TURN_FAST);
|
|
|
|
registerSound(event.getRegistry(), TURN_SLOW);
|
|
|
|
}
|
|
|
|
|
|
|
|
private static void registerSound(IForgeRegistry<SoundEvent> reg, ResourceLocation loc) {
|
|
|
|
reg.register(new SoundEvent(loc).setRegistryName(loc));
|
|
|
|
}
|
|
|
|
|
2017-07-10 17:59:43 +02:00
|
|
|
@SubscribeEvent
|
|
|
|
public static void registerRecipes(RegistryEvent.Register<IRecipe> event) {
|
|
|
|
Recipes.addRecipes(event.getRegistry());
|
|
|
|
}
|
|
|
|
|
2016-09-15 20:43:18 +02:00
|
|
|
@EventHandler
|
|
|
|
public void init(FMLInitializationEvent e) {
|
2017-09-03 20:48:10 +02:00
|
|
|
MultiblockMarx.INSTANCE = new MultiblockMarx();
|
|
|
|
MultiblockHandler.registerMultiblock(MultiblockMarx.INSTANCE);
|
2018-05-13 18:54:26 +02:00
|
|
|
MultiblockMechMB.INSTANCE = new MultiblockMechMB();
|
|
|
|
MultiblockHandler.registerMultiblock(MultiblockMechMB.INSTANCE);
|
2018-06-02 21:22:26 +02:00
|
|
|
MultiblockHandler.registerMultiblock(new MultiblockTemplateManual(EXAMPLE_MECHMB_LOC));
|
2017-05-15 21:40:43 +02:00
|
|
|
|
2017-02-26 13:56:36 +01:00
|
|
|
packetHandler.registerMessage(MessageTileSyncIW.HandlerClient.class, MessageTileSyncIW.class, 0, Side.CLIENT);
|
2017-04-04 17:07:45 +02:00
|
|
|
packetHandler.registerMessage(MessagePanelInteract.HandlerServer.class, MessagePanelInteract.class, 1, Side.SERVER);
|
2017-04-09 16:59:57 +02:00
|
|
|
packetHandler.registerMessage(MessageGUIInteract.HandlerServer.class, MessageGUIInteract.class, 2, Side.SERVER);
|
2017-05-18 18:13:08 +02:00
|
|
|
packetHandler.registerMessage(MessageItemSync.HandlerServer.class, MessageItemSync.class, 3, Side.SERVER);
|
2017-04-09 16:59:57 +02:00
|
|
|
|
2018-01-30 21:59:09 +01:00
|
|
|
if (hasIC2) {
|
|
|
|
ResourceLocation tex = new ResourceLocation(MODID, "blocks/ic2_conn_tin");
|
|
|
|
float[] uvs = {3, 4, 11, 12};
|
|
|
|
WireApi.registerFeedthroughForWiretype(TIN, new ResourceLocation("immersiveengineering:block/connector/connector_lv.obj"),
|
|
|
|
ImmutableMap.of("#immersiveengineering:blocks/connector_connector_lv",
|
|
|
|
IndustrialWires.MODID + ":blocks/ic2_conn_tin"), tex, uvs, .5, .5,
|
2018-04-06 18:25:46 +02:00
|
|
|
ic2conn.getDefaultState().withProperty(BlockIC2Connector.TYPE, TIN_CONN),
|
2018-02-19 18:11:45 +01:00
|
|
|
1/64F, TIN.getTransferRate(), f->(float)Math.ceil(f));
|
2018-01-30 21:59:09 +01:00
|
|
|
|
|
|
|
WireApi.registerFeedthroughForWiretype(COPPER_IC2, new ResourceLocation("immersiveengineering:block/connector/connector_lv.obj"),
|
|
|
|
ImmutableMap.of("#immersiveengineering:blocks/connector_connector_lv",
|
|
|
|
IndustrialWires.MODID + ":blocks/ic2_conn_copper"), tex, uvs, .5, .5,
|
2018-04-06 18:25:46 +02:00
|
|
|
ic2conn.getDefaultState().withProperty(BlockIC2Connector.TYPE, COPPER_CONN),
|
2018-02-19 18:11:45 +01:00
|
|
|
1/64F, COPPER_IC2.getTransferRate(), f->(float)Math.ceil(f));
|
2018-01-30 21:59:09 +01:00
|
|
|
|
|
|
|
WireApi.registerFeedthroughForWiretype(GOLD, new ResourceLocation("immersiveengineering:block/connector/connector_mv.obj"),
|
|
|
|
ImmutableMap.of("#immersiveengineering:blocks/connector_connector_mv",
|
|
|
|
IndustrialWires.MODID + ":blocks/ic2_conn_gold"), tex, uvs, .5625, .5625,
|
2018-04-06 18:25:46 +02:00
|
|
|
ic2conn.getDefaultState().withProperty(BlockIC2Connector.TYPE, GOLD_CONN),
|
2018-02-19 18:11:45 +01:00
|
|
|
1/64F, GOLD.getTransferRate(), f->(float)Math.ceil(f));
|
2018-01-30 21:59:09 +01:00
|
|
|
|
|
|
|
WireApi.registerFeedthroughForWiretype(HV, new ResourceLocation("immersiveengineering:block/connector/connector_hv.obj"),
|
|
|
|
ImmutableMap.of("#immersiveengineering:blocks/connector_connector_hv",
|
|
|
|
IndustrialWires.MODID + ":blocks/ic2_conn_hv"), tex, uvs, .75, .75,
|
2018-04-06 18:25:46 +02:00
|
|
|
ic2conn.getDefaultState().withProperty(BlockIC2Connector.TYPE, HV_CONN),
|
2018-02-19 18:11:45 +01:00
|
|
|
1/64F, HV.getTransferRate(), f->(float)Math.ceil(f));
|
2018-01-30 21:59:09 +01:00
|
|
|
|
|
|
|
WireApi.registerFeedthroughForWiretype(GLASS, new ResourceLocation("immersiveengineering:block/connector/connector_hv.obj"),
|
|
|
|
ImmutableMap.of("#immersiveengineering:blocks/connector_connector_hv",
|
|
|
|
IndustrialWires.MODID + ":blocks/ic2_conn_glass"), tex, uvs, .75, .75,
|
2018-04-06 18:25:46 +02:00
|
|
|
ic2conn.getDefaultState().withProperty(BlockIC2Connector.TYPE, GLASS_CONN),
|
2018-02-19 18:11:45 +01:00
|
|
|
1/64F, GLASS.getTransferRate(), f->(float)Math.ceil(f));
|
2018-01-30 21:59:09 +01:00
|
|
|
}
|
2017-04-09 16:59:57 +02:00
|
|
|
NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy);
|
2017-08-13 18:46:46 +02:00
|
|
|
IWPotions.init();
|
2017-08-29 21:31:22 +02:00
|
|
|
Compat.init();
|
2017-09-15 19:36:14 +02:00
|
|
|
MarxOreHandler.init();
|
2017-10-31 16:29:38 +01:00
|
|
|
PanelComponent.init();
|
2018-02-28 21:03:26 +01:00
|
|
|
if (hasIC2) {
|
|
|
|
EUCapability.register();
|
|
|
|
}
|
2016-09-15 20:43:18 +02:00
|
|
|
}
|
2017-05-11 16:39:20 +02:00
|
|
|
|
2016-09-15 20:43:18 +02:00
|
|
|
@EventHandler
|
2017-05-11 16:39:20 +02:00
|
|
|
public void postInit(FMLPostInitializationEvent e) {
|
2017-08-06 18:15:08 +02:00
|
|
|
PanelUtils.PANEL_ITEM = Item.getItemFromBlock(panel);
|
|
|
|
proxy.postInit();
|
2016-09-15 20:43:18 +02:00
|
|
|
}
|
2017-09-03 20:48:10 +02:00
|
|
|
@Mod.EventHandler
|
|
|
|
public void serverStarting(FMLServerStartingEvent event) {
|
|
|
|
event.registerServerCommand(new CommandIW());
|
2017-05-13 20:13:40 +02:00
|
|
|
}
|
2016-09-15 20:43:18 +02:00
|
|
|
}
|