Search in sources :

Example 1 with ChannelHandler

use of buildcraft.core.lib.network.base.ChannelHandler in project BuildCraft by BuildCraft.

the class BuildCraftEnergy method init.

@Mod.EventHandler
public void init(FMLInitializationEvent evt) {
    channels = NetworkRegistry.INSTANCE.newChannel(DefaultProps.NET_CHANNEL_NAME + "-ENERGY", new ChannelHandler(), new PacketHandler());
    NetworkRegistry.INSTANCE.registerGuiHandler(instance, new EnergyGuiHandler());
    StatementManager.registerTriggerProvider(new EnergyStatementProvider());
    if (BuildCraftCore.loadDefaultRecipes) {
        loadRecipes();
    }
    reloadConfig(RestartRequirement.GAME);
    BuildcraftRecipeRegistry.refinery.addRecipe("buildcraft:fuel", new FluidStack(oil.fluid, 1), new FluidStack(fuel.fluid, 1), 120, 1);
    double fuelOilMultiplier = BuildCraftCore.mainConfigManager.get("general", "fuel.oil.combustion").getDouble();
    double fuelFuelMultiplier = BuildCraftCore.mainConfigManager.get("general", "fuel.fuel.combustion").getDouble();
    int fuelOilEnergyOutput = BuildCraftCore.mainConfigManager.get("general", "fuel.oil.combustion.energyOutput").getInt();
    int fuelFuelEnergyOutput = BuildCraftCore.mainConfigManager.get("general", "fuel.fuel.combustion.energyOutput").getInt();
    if (!Loader.isModLoaded("BuildCraft|Factory")) {
        BuildcraftFuelRegistry.fuel.addFuel(oil.fluid, fuelOilEnergyOutput, (int) (5000 * fuelOilMultiplier));
        BuildcraftFuelRegistry.fuel.addFuel(fuel.fluid, fuelFuelEnergyOutput, (int) (25000 * fuelFuelMultiplier));
    }
    BuildcraftFuelRegistry.coolant.addCoolant(FluidRegistry.WATER, 0.0023f);
    BuildcraftFuelRegistry.coolant.addSolidCoolant(StackKey.stack(Blocks.ice), StackKey.fluid(FluidRegistry.WATER), 1.5f);
    BuildcraftFuelRegistry.coolant.addSolidCoolant(StackKey.stack(Blocks.packed_ice), StackKey.fluid(FluidRegistry.WATER), 2.0f);
    EnergyProxy.proxy.registerBlockRenderers();
    EnergyProxy.proxy.registerTileEntities();
    engineAchievement2 = BuildCraftCore.achievementManager.registerAchievement(new Achievement("buildcraft|energy:achievement.stirlingEngine", "engineAchievement2", 3, -2, new ItemStack(BuildCraftCore.engineBlock, 1, 1), BuildCraftCore.engineRedstoneAchievement));
    engineAchievement3 = BuildCraftCore.achievementManager.registerAchievement(new Achievement("buildcraft|energy:achievement.combustionEngine", "engineAchievement3", 5, -2, new ItemStack(BuildCraftCore.engineBlock, 1, 2), engineAchievement2));
}
Also used : PacketHandler(buildcraft.core.lib.network.base.PacketHandler) EnergyStatementProvider(buildcraft.energy.statements.EnergyStatementProvider) FluidStack(net.minecraftforge.fluids.FluidStack) ChannelHandler(buildcraft.core.lib.network.base.ChannelHandler) Achievement(net.minecraft.stats.Achievement) ItemStack(net.minecraft.item.ItemStack)

Example 2 with ChannelHandler

use of buildcraft.core.lib.network.base.ChannelHandler 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();
}
Also used : ModelBakeEvent(net.minecraftforge.client.event.ModelBakeEvent) Loader(net.minecraftforge.fml.common.Loader) net.minecraftforge.fml.common.event(net.minecraftforge.fml.common.event) ConfigChangedEvent(net.minecraftforge.fml.client.event.ConfigChangedEvent) PacketHandler(buildcraft.core.lib.network.base.PacketHandler) GateLogic(buildcraft.transport.gates.GateDefinition.GateLogic) Block(net.minecraft.block.Block) StatementManager(buildcraft.api.statements.StatementManager) RestartRequirement(buildcraft.lib.config.RestartRequirement) Side(net.minecraftforge.fml.relauncher.Side) SchematicPipe(buildcraft.transport.schematics.SchematicPipe) Locale(java.util.Locale) IMCEvent(net.minecraftforge.fml.common.event.FMLInterModComms.IMCEvent) PipeConnectionAPI(buildcraft.api.transport.PipeConnectionAPI) buildcraft.transport.client.model(buildcraft.transport.client.model) buildcraft.transport.network(buildcraft.transport.network) PrintWriter(java.io.PrintWriter) ItemBuildCraft(buildcraft.core.lib.items.ItemBuildCraft) ModelHelper(buildcraft.core.lib.utils.ModelHelper) ITriggerInternal(buildcraft.api.statements.ITriggerInternal) net.minecraft.item(net.minecraft.item) BptPipeRotatable(buildcraft.transport.schematics.BptPipeRotatable) buildcraft.transport.statements(buildcraft.transport.statements) GateExpansions(buildcraft.api.gates.GateExpansions) IActionInternal(buildcraft.api.statements.IActionInternal) ColorUtils(buildcraft.core.lib.utils.ColorUtils) TickEvent(net.minecraftforge.fml.common.gameevent.TickEvent) ICustomPipeConnection(buildcraft.api.transport.ICustomPipeConnection) PipeContents(buildcraft.transport.statements.TriggerPipeContents.PipeContents) Blocks(net.minecraft.init.Blocks) buildcraft.transport(buildcraft.transport) IGateExpansion(buildcraft.api.gates.IGateExpansion) BuilderAPI(buildcraft.api.blueprints.BuilderAPI) GameRegistry(net.minecraftforge.fml.common.registry.GameRegistry) BlockPipe(buildcraft.transport.block.BlockPipe) buildcraft.transport.gates(buildcraft.transport.gates) ShapedOreRecipe(net.minecraftforge.oredict.ShapedOreRecipe) ChannelHandler(buildcraft.core.lib.network.base.ChannelHandler) PipeWire(buildcraft.api.transport.PipeWire) buildcraft.transport.pipes(buildcraft.transport.pipes) TextureStitchEvent(net.minecraftforge.client.event.TextureStitchEvent) ListRegistry(buildcraft.api.lists.ListRegistry) Mod(net.minecraftforge.fml.common.Mod) LinkedList(java.util.LinkedList) SideOnly(net.minecraftforge.fml.relauncher.SideOnly) WorldServer(net.minecraft.world.WorldServer) DimensionManager(net.minecraftforge.common.DimensionManager) RecipeSorter(net.minecraftforge.oredict.RecipeSorter) FacadeAPI(buildcraft.api.facades.FacadeAPI) Time(buildcraft.transport.statements.TriggerClockTimer.Time) BCLog(buildcraft.api.core.BCLog) BptPipeFiltered(buildcraft.transport.schematics.BptPipeFiltered) buildcraft.transport.stripes(buildcraft.transport.stripes) Items(net.minecraft.init.Items) EnumFacing(net.minecraft.util.EnumFacing) buildcraft.transport.pluggable(buildcraft.transport.pluggable) buildcraft.core(buildcraft.core) ModelResourceLocation(net.minecraft.client.resources.model.ModelResourceLocation) GateMaterial(buildcraft.transport.gates.GateDefinition.GateMaterial) IBlockState(net.minecraft.block.state.IBlockState) EnumColor(buildcraft.api.core.EnumColor) MinecraftForge(net.minecraftforge.common.MinecraftForge) NetworkRegistry(net.minecraftforge.fml.common.network.NetworkRegistry) PipeTransportRendererFluids(buildcraft.transport.client.render.PipeTransportRendererFluids) ResourceLocation(net.minecraft.util.ResourceLocation) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent) SchematicTile(buildcraft.api.blueprints.SchematicTile) PipeManager(buildcraft.api.transport.PipeManager) BptPipeFiltered(buildcraft.transport.schematics.BptPipeFiltered) ChannelHandler(buildcraft.core.lib.network.base.ChannelHandler) PacketHandler(buildcraft.core.lib.network.base.PacketHandler) BptPipeRotatable(buildcraft.transport.schematics.BptPipeRotatable) ICustomPipeConnection(buildcraft.api.transport.ICustomPipeConnection)

Example 3 with ChannelHandler

use of buildcraft.core.lib.network.base.ChannelHandler in project BuildCraft by BuildCraft.

the class BuildCraftCore method init.

@Mod.EventHandler
public void init(FMLInitializationEvent evt) {
    BuildCraftAPI.fakePlayerProvider = CoreProxy.proxy;
    EntityRegistry.registerModEntity(EntityResizableCuboid.class, "bcResizCuboid", EntityIds.RESIZABLE_CUBOID, instance, 0, 100, false);
    ChannelHandler coreChannelHandler = new ChannelHandler();
    coreChannelHandler.registerPacketType(PacketTabletMessage.class);
    channels = NetworkRegistry.INSTANCE.newChannel(DefaultProps.NET_CHANNEL_NAME + "-CORE", coreChannelHandler, handler = new PacketHandler());
    achievementManager = new AchievementPageManager("BuildCraft");
    MinecraftForge.EVENT_BUS.register(achievementManager);
    woodenGearAchievement = achievementManager.registerAchievement(new Achievement("buildcraft|core:achievement.woodenGear", "woodenGearAchievement", 0, 0, woodenGearItem, null));
    stoneGearAchievement = achievementManager.registerAchievement(new Achievement("buildcraft|core:achievement.stoneGear", "stoneGearAchievement", 2, 0, stoneGearItem, woodenGearAchievement));
    ironGearAchievement = achievementManager.registerAchievement(new Achievement("buildcraft|core:achievement.ironGear", "ironGearAchievement", 4, 0, ironGearItem, stoneGearAchievement));
    goldGearAchievement = achievementManager.registerAchievement(new Achievement("buildcraft|core:achievement.goldGear", "goldGearAchievement", 6, 0, goldGearItem, ironGearAchievement));
    diamondGearAchievement = achievementManager.registerAchievement(new Achievement("buildcraft|core:achievement.diamondGear", "diamondGearAchievement", 8, 0, diamondGearItem, goldGearAchievement));
    wrenchAchievement = achievementManager.registerAchievement(new Achievement("buildcraft|core:achievement.wrench", "wrenchAchievement", 3, 2, wrenchItem, stoneGearAchievement));
    engineRedstoneAchievement = BuildCraftCore.achievementManager.registerAchievement(new Achievement("buildcraft|core:achievement.redstoneEngine", "engineAchievement1", 1, -2, new ItemStack(engineBlock, 1, 0), BuildCraftCore.woodenGearAchievement));
    StatementManager.registerParameterClass(StatementParameterItemStack.class);
    StatementManager.registerParameterClass(StatementParameterItemStackExact.class);
    StatementManager.registerParameterClass(StatementParameterDirection.class);
    StatementManager.registerParameterClass(StatementParamGateSideOnly.class);
    StatementManager.registerParameterClass(StatementParameterRedstoneLevel.class);
    StatementManager.registerTriggerProvider(new CoreTriggerProvider());
    StatementManager.registerActionProvider(new CoreActionProvider());
    if (BuildCraftCore.modifyWorld) {
        MinecraftForge.EVENT_BUS.register(new SpringPopulate());
    }
    if (mainConfiguration.hasChanged()) {
        mainConfiguration.save();
    }
    if (BuildCraftCore.loadDefaultRecipes) {
        loadRecipes();
    }
    BCCreativeTab.get("main").setIcon(new ItemStack(BuildCraftCore.wrenchItem, 1));
    EntityList.stringToClassMapping.remove("BuildCraft|Core.bcLaser");
    EntityList.stringToClassMapping.remove("BuildCraft|Core.bcEnergyLaser");
    BuilderAPI.schematicRegistry.registerSchematicBlock(engineBlock, SchematicEngine.class);
    CoreProxy.proxy.init();
    NetworkRegistry.INSTANCE.registerGuiHandler(instance, new CoreGuiHandler());
    MinecraftForge.EVENT_BUS.register(TabletManagerClient.INSTANCE);
    MinecraftForge.EVENT_BUS.register(TabletManagerServer.INSTANCE);
    MinecraftForge.EVENT_BUS.register(TickHandlerCore.INSTANCE);
    TabletAPI.registerProgram(new TabletProgramMenuFactory());
    // Create filler registry
    try {
        FillerManager.registry = new FillerRegistry();
        // INIT FILLER PATTERNS
        IFillerPattern[] patterns = { PatternFill.INSTANCE, PatternNone.INSTANCE, new PatternFlatten(), new PatternHorizon(), new PatternClear(), new PatternBox(), new PatternPyramid(), new PatternStairs(), new PatternCylinder(), new PatternFrame() };
        for (IFillerPattern pattern : patterns) {
            FillerManager.registry.addPattern(pattern);
        }
        ActionFiller.resetMap();
    } catch (Error error) {
        BCLog.logErrorAPI(error, IFillerPattern.class);
        throw error;
    }
    StatementManager.registerParameterClass(PatternParameterYDir.class);
    StatementManager.registerParameterClass(PatternParameterXZDir.class);
    StatementManager.registerParameterClass(PatternParameterCenter.class);
    StatementManager.registerParameterClass(PatternParameterHollow.class);
    ListRegistry.registerHandler(new ListMatchHandlerClass());
    ListRegistry.registerHandler(new ListMatchHandlerFluid());
    ListRegistry.registerHandler(new ListMatchHandlerTools());
    ListRegistry.registerHandler(new ListMatchHandlerArmor());
    // ListRegistry.registerHandler(new ListMatchHandler());
    ListRegistry.itemClassAsType.add(ItemFood.class);
    DebuggingTools.fmlInit();
}
Also used : IFillerPattern(buildcraft.api.filler.IFillerPattern) ChannelHandler(buildcraft.core.lib.network.base.ChannelHandler) SpringPopulate(buildcraft.core.gen.SpringPopulate) Achievement(net.minecraft.stats.Achievement) TabletProgramMenuFactory(buildcraft.core.tablet.TabletProgramMenuFactory) PacketHandler(buildcraft.core.lib.network.base.PacketHandler) ItemStack(net.minecraft.item.ItemStack)

Example 4 with ChannelHandler

use of buildcraft.core.lib.network.base.ChannelHandler in project BuildCraft by BuildCraft.

the class BuildCraftFactory method fmlPreInit.

@Mod.EventHandler
public void fmlPreInit(FMLPreInitializationEvent evt) {
    channels = NetworkRegistry.INSTANCE.newChannel(DefaultProps.NET_CHANNEL_NAME + "-FACTORY", new ChannelHandler(), new PacketHandler());
    BuildcraftRecipeRegistry.complexRefinery = ComplexRefineryRecipeManager.INSTANCE;
    String plc = "Allows admins to whitelist or blacklist pumping of specific fluids in specific dimensions.\n" + "Eg. \"-/-1/Lava\" will disable lava in the nether. \"-/*/Lava\" will disable lava in any dimension. \"+/0/*\" will enable any fluid in the overworld.\n" + "Entries are comma seperated, banned fluids have precedence over allowed ones." + "Default is \"+/*/*,+/-1/Lava\" - the second redundant entry (\"+/-1/lava\") is there to show the format.";
    BuildCraftCore.mainConfigManager.register("general.miningDepth", 256, "Should the mining well only be usable once after placing?", RestartRequirement.NONE);
    BuildCraftCore.mainConfigManager.get("general.miningDepth").setMinValue(2).setMaxValue(256);
    BuildCraftCore.mainConfigManager.register("general.pumpDimensionControl", DefaultProps.PUMP_DIMENSION_LIST, plc, RestartRequirement.NONE);
    BuildCraftCore.mainConfigManager.register("general.pumpsNeedRealPower", false, "Do pumps need real (non-redstone) power?", RestartRequirement.WORLD);
    reloadConfig(RestartRequirement.GAME);
    miningWellBlock = (BlockMiningWell) CompatHooks.INSTANCE.getBlock(BlockMiningWell.class);
    if (BCRegistry.INSTANCE.registerBlock(miningWellBlock.setUnlocalizedName("miningWellBlock"), false)) {
        plainPipeBlock = new BlockPlainPipe();
        BCRegistry.INSTANCE.registerBlock(plainPipeBlock.setUnlocalizedName("plainPipeBlock"), true);
    }
    autoWorkbenchBlock = (BlockAutoWorkbench) CompatHooks.INSTANCE.getBlock(BlockAutoWorkbench.class);
    BCRegistry.INSTANCE.registerBlock(autoWorkbenchBlock.setUnlocalizedName("autoWorkbenchBlock"), false);
    tankBlock = (BlockTank) CompatHooks.INSTANCE.getBlock(BlockTank.class);
    BCRegistry.INSTANCE.registerBlock(tankBlock.setUnlocalizedName("tankBlock"), false);
    pumpBlock = (BlockPump) CompatHooks.INSTANCE.getBlock(BlockPump.class);
    BCRegistry.INSTANCE.registerBlock(pumpBlock.setUnlocalizedName("pumpBlock"), false);
    floodGateBlock = (BlockFloodGate) CompatHooks.INSTANCE.getBlock(BlockFloodGate.class);
    BCRegistry.INSTANCE.registerBlock(floodGateBlock.setUnlocalizedName("floodGateBlock"), false);
    refineryBlock = (BlockRefinery) CompatHooks.INSTANCE.getBlock(BlockRefinery.class);
    BCRegistry.INSTANCE.registerBlock(refineryBlock.setUnlocalizedName("refineryBlock"), false);
    chuteBlock = (BlockChute) CompatHooks.INSTANCE.getBlock(BlockChute.class);
    BCRegistry.INSTANCE.registerBlock(chuteBlock.setUnlocalizedName("blockChute"), false);
    if (Loader.isModLoaded("BuildCraft|Energy")) {
        energyHeaterBlock = (BlockEnergyHeater) CompatHooks.INSTANCE.getBlock(BlockEnergyHeater.class);
        BCRegistry.INSTANCE.registerBlock(energyHeaterBlock.setUnlocalizedName("blockEnergyHeater"), false);
        heatExchangeBlock = (BlockHeatExchange) CompatHooks.INSTANCE.getBlock(BlockHeatExchange.class);
        BCRegistry.INSTANCE.registerBlock(heatExchangeBlock.setUnlocalizedName("blockHeatExchange"), false);
        distillerBlock = (BlockDistiller) CompatHooks.INSTANCE.getBlock(BlockDistiller.class);
        BCRegistry.INSTANCE.registerBlock(distillerBlock.setUnlocalizedName("blockDistiller"), false);
        plasticSheetItem = new ItemBuildCraft();
        plasticSheetItem.setUnlocalizedName("plasticSheet");
        plasticSheetItem.setLocalizationRuleArray("item.plasticSheet.singular", "item.plasticSheet.plural");
        plasticSheetItem.setLocalizationRule((stack) -> stack == null ? 0 : stack.stackSize > 1 ? 1 : 0);
        BCRegistry.INSTANCE.registerItem(plasticSheetItem, false);
        ComplexRefiningManager.preInit();
    }
    FactoryProxy.proxy.preInit();
    MinecraftForge.EVENT_BUS.register(this);
}
Also used : PacketHandler(buildcraft.core.lib.network.base.PacketHandler) ItemBuildCraft(buildcraft.core.lib.items.ItemBuildCraft) BlockPlainPipe(buildcraft.factory.BlockPlainPipe) ChannelHandler(buildcraft.core.lib.network.base.ChannelHandler)

Example 5 with ChannelHandler

use of buildcraft.core.lib.network.base.ChannelHandler in project BuildCraft by BuildCraft.

the class BuildCraftSilicon method init.

@Mod.EventHandler
public void init(FMLInitializationEvent evt) {
    channels = NetworkRegistry.INSTANCE.newChannel(DefaultProps.NET_CHANNEL_NAME + "-SILICON", new ChannelHandler(), new PacketHandler());
    NetworkRegistry.INSTANCE.registerGuiHandler(instance, new SiliconGuiHandler());
    BCRegistry.INSTANCE.registerTileEntity(TileLaser.class, "buildcraft.silicon.TileLaser", "net.minecraft.src.buildcraft.factory.TileLaser");
    BCRegistry.INSTANCE.registerTileEntity(TileAssemblyTable.class, "buildcraft.silicon.TileAssemblyTable", "net.minecraft.src.buildcraft.factory.TileAssemblyTable");
    BCRegistry.INSTANCE.registerTileEntity(TileAdvancedCraftingTable.class, "buildcraft.silicon.TileAdvancedCraftingTable", "net.minecraft.src.buildcraft.factory.TileAssemblyAdvancedWorkbench");
    BCRegistry.INSTANCE.registerTileEntity(TileIntegrationTable.class, "buildcraft.silicon.TileIntegrationTable", "net.minecraft.src.buildcraft.factory.TileIntegrationTable");
    BCRegistry.INSTANCE.registerTileEntity(TileChargingTable.class, "buildcraft.silicon.TileChargingTable", "net.minecraft.src.buildcraft.factory.TileChargingTable");
    BCRegistry.INSTANCE.registerTileEntity(TileProgrammingTable.class, "buildcraft.silicon.TileProgrammingTable", "net.minecraft.src.buildcraft.factory.TileProgrammingTable");
    timeForSomeLogicAchievement = BuildCraftCore.achievementManager.registerAchievement(new Achievement("buildcraft|silicon:achievement.timeForSomeLogic", "timeForSomeLogicAchievement", 9, -2, assemblyTableBlock, BuildCraftCore.diamondGearAchievement));
    tinglyLaserAchievement = BuildCraftCore.achievementManager.registerAchievement(new Achievement("buildcraft|silicon:achievement.tinglyLaser", "tinglyLaserAchievement", 11, -2, laserBlock, timeForSomeLogicAchievement));
    if (BuildCraftCore.loadDefaultRecipes) {
        loadRecipes();
    }
    SiliconProxy.proxy.registerRenderers();
}
Also used : PacketHandler(buildcraft.core.lib.network.base.PacketHandler) SiliconGuiHandler(buildcraft.silicon.SiliconGuiHandler) ChannelHandler(buildcraft.core.lib.network.base.ChannelHandler) Achievement(net.minecraft.stats.Achievement)

Aggregations

ChannelHandler (buildcraft.core.lib.network.base.ChannelHandler)5 PacketHandler (buildcraft.core.lib.network.base.PacketHandler)5 Achievement (net.minecraft.stats.Achievement)3 ItemBuildCraft (buildcraft.core.lib.items.ItemBuildCraft)2 ItemStack (net.minecraft.item.ItemStack)2 BuilderAPI (buildcraft.api.blueprints.BuilderAPI)1 SchematicTile (buildcraft.api.blueprints.SchematicTile)1 BCLog (buildcraft.api.core.BCLog)1 EnumColor (buildcraft.api.core.EnumColor)1 FacadeAPI (buildcraft.api.facades.FacadeAPI)1 IFillerPattern (buildcraft.api.filler.IFillerPattern)1 GateExpansions (buildcraft.api.gates.GateExpansions)1 IGateExpansion (buildcraft.api.gates.IGateExpansion)1 ListRegistry (buildcraft.api.lists.ListRegistry)1 IActionInternal (buildcraft.api.statements.IActionInternal)1 ITriggerInternal (buildcraft.api.statements.ITriggerInternal)1 StatementManager (buildcraft.api.statements.StatementManager)1 ICustomPipeConnection (buildcraft.api.transport.ICustomPipeConnection)1 PipeConnectionAPI (buildcraft.api.transport.PipeConnectionAPI)1 PipeManager (buildcraft.api.transport.PipeManager)1