Search in sources :

Example 1 with BlockDecoration

use of buildcraft.core.block.BlockDecoration in project BuildCraft by BuildCraft.

the class BuildingItem method build.

private void build() {
    if (slotToBuild != null) {
        BlockPos dest = Utils.convertFloor(destination);
        IBlockState state = context.world().getBlockState(dest);
        if (slotToBuild.writeToWorld(context)) {
            context.world().playAuxSFXAtEntity(null, 2001, dest, Block.getStateId(state));
        } else {
            for (ItemStack s : slotToBuild.stackConsumed) {
                if (s != null && !(s.getItem() instanceof ItemBlock && Block.getBlockFromItem(s.getItem()) instanceof BlockDecoration)) {
                    InvUtils.dropItems(context.world(), s, dest);
                }
            }
        }
    }
}
Also used : IBlockState(net.minecraft.block.state.IBlockState) BlockDecoration(buildcraft.core.block.BlockDecoration) BlockPos(net.minecraft.util.math.BlockPos) ItemStack(net.minecraft.item.ItemStack) ItemBlock(net.minecraft.item.ItemBlock)

Example 2 with BlockDecoration

use of buildcraft.core.block.BlockDecoration in project BuildCraft by BuildCraft.

the class BuildCraftCore method loadConfiguration.

@Mod.EventHandler
public void loadConfiguration(FMLPreInitializationEvent evt) {
    BCLog.logger.info("Starting BuildCraft " + DefaultProps.VERSION);
    BCLog.logger.info("Copyright (c) the BuildCraft team, 2011-2016");
    BCLog.logger.info("http://www.mod-buildcraft.com");
    new BCCreativeTab("main");
    commandBuildcraft.addAlias("bc");
    commandBuildcraft.addChildCommand(new SubCommandDeop());
    commandBuildcraft.addChildCommand(new SubCommandOp());
    BuildcraftRecipeRegistry.assemblyTable = AssemblyRecipeManager.INSTANCE;
    BuildcraftRecipeRegistry.integrationTable = IntegrationRecipeManager.INSTANCE;
    BuildcraftRecipeRegistry.refinery = RefineryRecipeManager.INSTANCE;
    BuildcraftRecipeRegistry.programmingTable = ProgrammingRecipeManager.INSTANCE;
    BuilderAPI.schematicHelper = SchematicHelper.INSTANCE;
    BuilderAPI.schematicRegistry = SchematicRegistry.INSTANCE;
    File cfgBase = new File(evt.getModConfigurationDirectory(), "buildcraft");
    BCRegistry.INSTANCE.setRegistryConfig(new File(cfgBase, "objects.cfg"));
    mainConfiguration = new Configuration(new File(cfgBase, "main.cfg"));
    detailedConfigManager = new FileConfigManager(" The buildcraft detailed configuration file. This contains a lot of miscelaneous options that have no " + "affect on gameplay.\n You should refer to the BC source code for a detailed description of what these do. " + "(https://github.com/BuildCraft/BuildCraft)\n" + " This file will be overwritten every time that buildcraft starts, so there is no point in adding comments");
    detailedConfigManager.setConfigFile(new File(cfgBase, "detailed.properties"));
    ConficGuiFactoryBC.setConfig(mainConfiguration);
    mainConfiguration.load();
    ConficGuiFactoryBC.getCat("debug").setShowInGui(false);
    ConficGuiFactoryBC.getCat("vars").setShowInGui(false);
    ConficGuiFactoryBC.register("general.useServerDataOnClient", BuildCraftCore.useServerDataOnClient, "Allows BuildCraft to use the integrated server's data on the client on singleplayer worlds. Disable if you're getting the odd crash caused by it.", RestartRequirement.NONE);
    ConficGuiFactoryBC.register("general.builderMaxIterationsPerItemFactor", BuildCraftCore.builderMaxPerItemFactor, "Lower this number if BuildCraft builders/fillers are causing TPS lag. Raise it if you think they are being too slow.", RestartRequirement.NONE);
    ConficGuiFactoryBC.register("general.miningBreaksPlayerProtectedBlocks", false, "Should BuildCraft miners be allowed to break blocks using player-specific protection?", RestartRequirement.NONE);
    ConficGuiFactoryBC.register("general.updateCheck", true, "Should I check the BuildCraft version on startup?", RestartRequirement.NONE);
    ConficGuiFactoryBC.register("display.hidePowerValues", false, "Should all power values (RF, RF/t) be hidden?", RestartRequirement.NONE);
    ConficGuiFactoryBC.register("display.hideFluidValues", false, "Should all fluid values (mB, mB/t) be hidden?", RestartRequirement.NONE);
    ConficGuiFactoryBC.register("general.itemLifespan", 60, "How long, in seconds, should items stay on the ground? (Vanilla = 300, default = 60)", RestartRequirement.NONE).setMinValue(5);
    ConficGuiFactoryBC.register("network.updateFactor", 10, "How often, in ticks, should network update packets be sent? Increasing this might help network performance.", RestartRequirement.GAME).setMinValue(1);
    ConficGuiFactoryBC.register("network.longUpdateFactor", 40, "How often, in ticks, should full network sync packets be sent? Increasing this might help network performance.", RestartRequirement.GAME).setMinValue(1);
    ConficGuiFactoryBC.register("general.canEnginesExplode", false, "Should engines explode upon overheat?", RestartRequirement.NONE);
    ConficGuiFactoryBC.register("worldgen.enable", true, "Should BuildCraft generate anything in the world?", RestartRequirement.GAME);
    ConficGuiFactoryBC.register("general.pumpsConsumeWater", false, "Should pumps consume water? Enabling this might cause performance issues!", RestartRequirement.NONE);
    ConficGuiFactoryBC.register("power.miningUsageMultiplier", 1.0D, "What should the multiplier of all mining-related power usage be?", RestartRequirement.NONE);
    ConficGuiFactoryBC.register("display.colorBlindMode", false, "Should I enable colorblind mode?", RestartRequirement.GAME);
    ConficGuiFactoryBC.register("worldgen.generateWaterSprings", true, "Should BuildCraft generate water springs?", RestartRequirement.GAME);
    ConficGuiFactoryBC.register("debug.network.stats", false, "Should all network packets be tracked for statistical purposes?", RestartRequirement.NONE);
    reloadConfig(RestartRequirement.GAME);
    wrenchItem = (new ItemWrench()).setTextureLocation("buildcraftcore:wrench").setUnlocalizedName("wrenchItem");
    BCRegistry.INSTANCE.registerItem(wrenchItem, false);
    mapLocationItem = (new ItemMapLocation()).setUnlocalizedName("mapLocation");
    BCRegistry.INSTANCE.registerItem(mapLocationItem, false);
    listItem = (ItemList) (new ItemList()).setUnlocalizedName("list");
    BCRegistry.INSTANCE.registerItem(listItem, false);
    debuggerItem = (new ItemDebugger()).setUnlocalizedName("debugger");
    BCRegistry.INSTANCE.registerItem(debuggerItem, false);
    if (BuildCraftCore.modifyWorld) {
        EnumSpring.WATER.canGen = ConficGuiFactoryBC.get("worldgen.generateWaterSprings").getBoolean();
        springBlock = new BlockSpring();
        springBlock.setUnlocalizedName("eternalSpring");
        BCRegistry.INSTANCE.registerBlock(springBlock, ItemSpring.class, false);
    }
    woodenGearItem = (new ItemBuildCraft()).setTextureLocation("buildcraftcore:gear/wood").setUnlocalizedName("woodenGearItem");
    if (BCRegistry.INSTANCE.registerItem(woodenGearItem, false)) {
        OreDictionary.registerOre("gearWood", new ItemStack(woodenGearItem));
    }
    stoneGearItem = (new ItemBuildCraft()).setTextureLocation("buildcraftcore:gear/stone").setUnlocalizedName("stoneGearItem");
    if (BCRegistry.INSTANCE.registerItem(stoneGearItem, false)) {
        OreDictionary.registerOre("gearStone", new ItemStack(stoneGearItem));
    }
    ironGearItem = (new ItemBuildCraft()).setTextureLocation("buildcraftcore:gear/iron").setUnlocalizedName("ironGearItem");
    if (BCRegistry.INSTANCE.registerItem(ironGearItem, false)) {
        OreDictionary.registerOre("gearIron", new ItemStack(ironGearItem));
    }
    goldGearItem = (new ItemBuildCraft()).setTextureLocation("buildcraftcore:gear/gold").setUnlocalizedName("goldGearItem");
    if (BCRegistry.INSTANCE.registerItem(goldGearItem, false)) {
        OreDictionary.registerOre("gearGold", new ItemStack(goldGearItem));
    }
    diamondGearItem = (new ItemBuildCraft()).setTextureLocation("buildcraftcore:gear/diamond").setUnlocalizedName("diamondGearItem");
    if (BCRegistry.INSTANCE.registerItem(diamondGearItem, false)) {
        OreDictionary.registerOre("gearDiamond", new ItemStack(diamondGearItem));
    }
    paintbrushItem = new ItemPaintbrush();
    paintbrushItem.setUnlocalizedName("paintbrush");
    BCRegistry.INSTANCE.registerItem(paintbrushItem, false);
    if (DEVELOPER_MODE) {
        tabletItem = new ItemTablet();
        tabletItem.setUnlocalizedName("tablet");
        BCRegistry.INSTANCE.registerItem(tabletItem, false);
    }
    decoratedBlock = new BlockDecoration();
    decoratedBlock.setUnlocalizedName("decoratedBlock");
    BCRegistry.INSTANCE.registerBlock(decoratedBlock, true);
    engineBlock = (BlockEngine) CompatHooks.INSTANCE.getBlock(BlockEngine.class);
    BCRegistry.INSTANCE.registerBlock(engineBlock, ItemEngine.class, true);
    engineBlock.registerTile((Class<? extends TileEngineBase>) CompatHooks.INSTANCE.getTile(TileEngineWood.class), 0, "tile.engineWood");
    BCRegistry.INSTANCE.registerTileEntity(TileEngineWood.class, "buildcraft.core.engine.wood", "net.minecraft.src.buildcraft.energy.TileEngineWood");
    markerBlock = (BlockMarker) CompatHooks.INSTANCE.getBlock(BlockMarker.class);
    BCRegistry.INSTANCE.registerBlock(markerBlock.setUnlocalizedName("markerBlock"), false);
    pathMarkerBlock = (BlockPathMarker) CompatHooks.INSTANCE.getBlock(BlockPathMarker.class);
    BCRegistry.INSTANCE.registerBlock(pathMarkerBlock.setUnlocalizedName("pathMarkerBlock"), false);
    MinecraftForge.EVENT_BUS.register(this);
    MinecraftForge.EVENT_BUS.register(new BlockHighlightHandler());
    MinecraftForge.EVENT_BUS.register(new ListTooltipHandler());
    MinecraftForge.EVENT_BUS.register(BucketHandler.INSTANCE);
    OreDictionary.registerOre("craftingTableWood", Blocks.crafting_table);
}
Also used : BlockHighlightHandler(buildcraft.core.render.BlockHighlightHandler) ItemMapLocation(buildcraft.core.item.ItemMapLocation) ListTooltipHandler(buildcraft.core.list.ListTooltipHandler) Configuration(net.minecraftforge.common.config.Configuration) BlockDecoration(buildcraft.core.block.BlockDecoration) FileConfigManager(buildcraft.lib.config.FileConfigManager) BlockSpring(buildcraft.core.block.BlockSpring) ItemTablet(buildcraft.core.tablet.ItemTablet) SubCommandOp(buildcraft.core.command.SubCommandOp) ItemBuildCraft(buildcraft.core.lib.items.ItemBuildCraft) SubCommandDeop(buildcraft.core.command.SubCommandDeop) ItemStack(net.minecraft.item.ItemStack) File(java.io.File)

Aggregations

BlockDecoration (buildcraft.core.block.BlockDecoration)2 ItemStack (net.minecraft.item.ItemStack)2 BlockSpring (buildcraft.core.block.BlockSpring)1 SubCommandDeop (buildcraft.core.command.SubCommandDeop)1 SubCommandOp (buildcraft.core.command.SubCommandOp)1 ItemMapLocation (buildcraft.core.item.ItemMapLocation)1 ItemBuildCraft (buildcraft.core.lib.items.ItemBuildCraft)1 ListTooltipHandler (buildcraft.core.list.ListTooltipHandler)1 BlockHighlightHandler (buildcraft.core.render.BlockHighlightHandler)1 ItemTablet (buildcraft.core.tablet.ItemTablet)1 FileConfigManager (buildcraft.lib.config.FileConfigManager)1 File (java.io.File)1 IBlockState (net.minecraft.block.state.IBlockState)1 ItemBlock (net.minecraft.item.ItemBlock)1 BlockPos (net.minecraft.util.math.BlockPos)1 Configuration (net.minecraftforge.common.config.Configuration)1