use of buildcraft.api.transport.ICustomPipeConnection in project BuildCraft by BuildCraft.
the class BuildCraftTransport method init.
@Mod.EventHandler
public void init(FMLInitializationEvent evt) {
transportChannelHandler = new ChannelHandler();
MinecraftForge.EVENT_BUS.register(this);
transportChannelHandler.registerPacketType(PacketFluidUpdate.class);
transportChannelHandler.registerPacketType(PacketPipeSyncRequest.class);
transportChannelHandler.registerPacketType(PacketPipeTransportItemStack.class);
transportChannelHandler.registerPacketType(PacketPipeTransportItemStackRequest.class);
transportChannelHandler.registerPacketType(PacketPipeTransportTraveler.class);
transportChannelHandler.registerPacketType(PacketPowerUpdate.class);
channels = NetworkRegistry.INSTANCE.newChannel(DefaultProps.NET_CHANNEL_NAME + "-TRANSPORT", transportChannelHandler, new PacketHandler());
TransportProxy.proxy.registerTileEntities();
BuilderAPI.schematicRegistry.registerSchematicBlock(genericPipeBlock, SchematicPipe.class);
BuilderAPI.schematicRegistry.registerSchematicBlock(filteredBufferBlock, SchematicTile.class);
new BptPipeRotatable(pipeItemsWood);
new BptPipeRotatable(pipeFluidsWood);
new BptPipeRotatable(pipeItemsIron);
new BptPipeRotatable(pipeFluidsIron);
new BptPipeRotatable(pipeItemsEmerald);
new BptPipeRotatable(pipeFluidsEmerald);
new BptPipeRotatable(pipeItemsDaizuli);
new BptPipeRotatable(pipeItemsEmzuli);
for (Item itemPipe : BlockGenericPipe.pipes.keySet()) {
Class<? extends Pipe<?>> klazz = BlockGenericPipe.pipes.get(itemPipe);
if (IDiamondPipe.class.isAssignableFrom(klazz)) {
new BptPipeFiltered(itemPipe);
}
}
PipeEventBus.registerGlobalHandler(new LensFilterHandler());
BCCreativeTab.get("pipes").setIcon(new ItemStack(BuildCraftTransport.pipeItemsDiamond, 1));
if (NEPTUNE_TESTING)
BCCreativeTab.get("neptune").setIcon(new ItemStack(Items.cake));
if (showAllFacadesCreative) {
BCCreativeTab.get("facades").setIcon(facadeItem.getFacadeForBlock(Blocks.brick_block.getDefaultState()));
}
if (Loader.isModLoaded("BuildCraft|Silicon")) {
BCCreativeTab.get("gates").setIcon(ItemGate.makeGateItem(GateMaterial.DIAMOND, GateLogic.AND));
}
StatementManager.registerParameterClass(TriggerParameterSignal.class);
StatementManager.registerParameterClass(ActionParameterSignal.class);
// Item use stripes handlers
PipeManager.registerStripesHandler(new StripesHandlerRightClick(), -32768);
PipeManager.registerStripesHandler(new StripesHandlerDispenser(), -49152);
PipeManager.registerStripesHandler(new StripesHandlerPlant(), 0);
PipeManager.registerStripesHandler(new StripesHandlerBucket(), 0);
PipeManager.registerStripesHandler(new StripesHandlerArrow(), 0);
PipeManager.registerStripesHandler(new StripesHandlerShears(), 0);
PipeManager.registerStripesHandler(new StripesHandlerPipes(), 0);
PipeManager.registerStripesHandler(new StripesHandlerPipeWires(), 0);
PipeManager.registerStripesHandler(new StripesHandlerEntityInteract(), 0);
PipeManager.registerStripesHandler(new StripesHandlerPlaceBlock(), -65536);
PipeManager.registerStripesHandler(new StripesHandlerUse(), -131072);
PipeManager.registerStripesHandler(new StripesHandlerHoe(), 0);
StripesHandlerDispenser.items.add(ItemMinecart.class);
StripesHandlerRightClick.items.add(Items.egg);
StripesHandlerRightClick.items.add(Items.snowball);
StripesHandlerRightClick.items.add(Items.experience_bottle);
StripesHandlerUse.items.add(Items.fireworks);
// Block breaking stripes handlers
PipeManager.registerStripesHandler(new StripesHandlerMinecartDestroy(), 0);
PipeManager.registerPipePluggable(FacadePluggable.class, "facade");
PipeManager.registerPipePluggable(GatePluggable.class, "gate");
PipeManager.registerPipePluggable(LensPluggable.class, "lens");
PipeManager.registerPipePluggable(PlugPluggable.class, "plug");
PipeManager.registerPipePluggable(PowerAdapterPluggable.class, "powerAdapter");
GateExpansions.registerExpansion(GateExpansionPulsar.INSTANCE);
GateExpansions.registerExpansion(GateExpansionTimer.INSTANCE);
GateExpansions.registerExpansion(GateExpansionRedstoneFader.INSTANCE);
GateExpansions.registerExpansion(GateExpansionLightSensor.INSTANCE, new ItemStack(Blocks.daylight_detector));
if (BuildCraftCore.loadDefaultRecipes) {
loadRecipes();
}
TransportProxy.proxy.registerRenderers();
NetworkRegistry.INSTANCE.registerGuiHandler(instance, new TransportGuiHandler());
/* Make pipes extend to connect to blocks like chests. This means that a connection going UP (the bottom of the
* block in question) will be the only face that does not extend into the block slightly. */
ICustomPipeConnection smallerBlockConnection = (world, pos, face, state) -> face == EnumFacing.UP ? 0 : 2 / 16f;
PipeConnectionAPI.registerConnection(Blocks.chest, smallerBlockConnection);
PipeConnectionAPI.registerConnection(Blocks.trapped_chest, smallerBlockConnection);
PipeConnectionAPI.registerConnection(Blocks.hopper, smallerBlockConnection);
if (NEPTUNE_TESTING)
TransportPipes_BC8.init();
}
Aggregations