Move engine blocks to PluginEnergy.blocks

This commit is contained in:
mezz committed 2015-11-19 01:04:38 -08:00
1 parent 10e5391f48
commit ce2a2ec8ed
32 files changed
+313 -191

No files matched your search

@@ -313,8 +313,8 @@ public class PluginApiculture extends ForestryPlugin {
proxy.initializeRendering();
blocks.apiculture.registerDefinitions();
blocks.apicultureChest.registerDefinitions();
blocks.apiculture.init();
blocks.apicultureChest.init();
}
@Override
@@ -41,7 +41,7 @@ import forestry.api.storage.StorageManager;
import forestry.arboriculture.GuiHandlerArboriculture;
import forestry.arboriculture.VillageHandlerArboriculture;
import forestry.arboriculture.WoodItemAccess;
import forestry.arboriculture.blocks.BlockArboriculture;
import forestry.arboriculture.blocks.BlockArboricultureType;
import forestry.arboriculture.blocks.BlockRegistryArboriculture;
import forestry.arboriculture.commands.CommandTree;
import forestry.arboriculture.genetics.TreeBranchDefinition;
@@ -137,7 +137,7 @@ public class PluginArboriculture extends ForestryPlugin {
WoodItemAccess.registerStairs(blocks.stairsFireproof, woodType, true);
}
MachineDefinition definitionChest = new MachineDefinition(BlockArboriculture.Type.ARBCHEST.ordinal(),
MachineDefinition definitionChest = new MachineDefinition(BlockArboricultureType.ARBCHEST.ordinal(),
"forestry.ArbChest", TileArboristChest.class, Proxies.render.getRenderChest("arbchest"))
.setBoundingBox(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F);
blocks.arboriculture.addDefinition(definitionChest);
@@ -170,7 +170,7 @@ public class PluginArboriculture extends ForestryPlugin {
GameRegistry.registerTileEntity(TileWood.class, "forestry.Wood");
GameRegistry.registerTileEntity(TileFruitPod.class, "forestry.Pods");
blocks.arboriculture.registerDefinitions();
blocks.arboriculture.init();
if (Config.enableVillagers) {
VillagerRegistry.instance().registerVillagerId(Constants.ID_VILLAGER_LUMBERJACK);
@@ -328,7 +328,7 @@ public class PluginArboriculture extends ForestryPlugin {
'T', items.treealyzer,
'X', "ingotBronze");
RecipeUtil.addRecipe(blocks.arboriculture.get(BlockArboriculture.Type.ARBCHEST, 1),
RecipeUtil.addRecipe(blocks.arboriculture.get(BlockArboricultureType.ARBCHEST, 1),
" # ",
"XYX",
"XXX",
@@ -59,8 +59,6 @@ import forestry.core.recipes.RecipeUtil;
import forestry.core.recipes.ShapedRecipeCustom;
import forestry.core.recipes.ShapelessRecipeCustom;
import forestry.core.tiles.MachineDefinition;
import forestry.core.tiles.TileAnalyzer;
import forestry.core.tiles.TileEscritoire;
import forestry.core.utils.ClimateUtil;
import forestry.core.utils.ForestryModEnvWarningCallable;
@@ -103,9 +101,8 @@ public class PluginCore extends ForestryPlugin {
rootCommand.addChildCommand(new CommandPlugins());
blocks.core.addDefinitions(
new MachineDefinition(BlockCoreType.ESCRITOIRE.ordinal(), "forestry.Escritoire", TileEscritoire.class, Proxies.render.getRenderEscritoire()),
new MachineDefinition(BlockCoreType.ANALYZER.ordinal(), "forestry.Analyzer", TileAnalyzer.class,
PluginApiculture.proxy.getRendererAnalyzer(Constants.TEXTURE_PATH_BLOCKS + "/analyzer_"))
new MachineDefinition(BlockCoreType.ESCRITOIRE),
new MachineDefinition(BlockCoreType.ANALYZER)
);
}
@@ -115,7 +112,7 @@ public class PluginCore extends ForestryPlugin {
Proxies.render.init();
blocks.core.registerDefinitions();
blocks.core.init();
ForestryModEnvWarningCallable.register();
@@ -10,7 +10,6 @@
******************************************************************************/
package forestry.plugins;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
@@ -18,18 +17,13 @@ import cpw.mods.fml.common.SidedProxy;
import forestry.api.core.ForestryAPI;
import forestry.core.GuiHandlerBase;
import forestry.core.blocks.BlockBase;
import forestry.core.config.Constants;
import forestry.core.config.ForestryBlock;
import forestry.core.items.ItemBlockForestry;
import forestry.core.recipes.RecipeUtil;
import forestry.energy.GuiHandlerEnergy;
import forestry.energy.blocks.BlockEngine;
import forestry.energy.blocks.BlockEngineType;
import forestry.energy.blocks.BlockRegistryEnergy;
import forestry.energy.proxy.ProxyEnergy;
import forestry.energy.tiles.EngineDefinition;
import forestry.energy.tiles.TileEngineBiogas;
import forestry.energy.tiles.TileEngineClockwork;
import forestry.energy.tiles.TileEnginePeat;
@Plugin(pluginID = "Energy", name = "Energy", author = "SirSengir", url = Constants.URL, unlocalizedDescription = "for.plugin.energy.description")
public class PluginEnergy extends ForestryPlugin {
@@ -37,38 +31,35 @@ public class PluginEnergy extends ForestryPlugin {
@SidedProxy(clientSide = "forestry.energy.proxy.ProxyEnergyClient", serverSide = "forestry.energy.proxy.ProxyEnergy")
public static ProxyEnergy proxy;
public static BlockRegistryEnergy blocks;
@Override
protected void registerItemsAndBlocks() {
super.registerItemsAndBlocks();
ForestryBlock.engine.registerBlock(new BlockEngine(Material.iron), ItemBlockForestry.class, "engine");
blocks = new BlockRegistryEnergy();
}
@Override
public void preInit() {
EngineDefinition definitionEnginePeat = new EngineDefinition(Constants.DEFINITION_ENGINE_PEAT_META, "forestry.EngineCopper", TileEnginePeat.class,
PluginEnergy.proxy.getRenderDefaultEngine(Constants.TEXTURE_PATH_BLOCKS + "/engine_copper_"));
((BlockBase) ForestryBlock.engine.block()).addDefinition(definitionEnginePeat);
blocks.engine.addDefinitions(
new EngineDefinition(BlockEngineType.PEAT),
new EngineDefinition(BlockEngineType.BIOGAS)
);
EngineDefinition definitionEngineBiogas = new EngineDefinition(Constants.DEFINITION_ENGINE_BIOGAS_META, "forestry.EngineBronze", TileEngineBiogas.class,
PluginEnergy.proxy.getRenderDefaultEngine(Constants.TEXTURE_PATH_BLOCKS + "/engine_bronze_"));
((BlockBase) ForestryBlock.engine.block()).addDefinition(definitionEngineBiogas);
EngineDefinition definitionEngineClockwork = new EngineDefinition(Constants.DEFINITION_ENGINE_CLOCKWORK_META, "forestry.EngineClockwork", TileEngineClockwork.class,
PluginEnergy.proxy.getRenderDefaultEngine(Constants.TEXTURE_PATH_BLOCKS + "/engine_clock_"));
((BlockBase) ForestryBlock.engine.block()).addDefinition(definitionEngineClockwork);
if (ForestryAPI.activeMode.getBooleanSetting("energy.engine.clockwork")) {
blocks.engine.addDefinition(new EngineDefinition(BlockEngineType.CLOCKWORK));
}
}
@Override
public void doInit() {
((BlockBase) ForestryBlock.engine.block()).registerDefinitions();
blocks.engine.init();
}
@Override
protected void registerRecipes() {
super.registerRecipes();
RecipeUtil.addRecipe(ForestryBlock.engine.getItemStack(1, Constants.DEFINITION_ENGINE_PEAT_META),
RecipeUtil.addRecipe(blocks.engine.get(BlockEngineType.PEAT),
"###",
" X ",
"YVY",
@@ -77,7 +68,7 @@ public class PluginEnergy extends ForestryPlugin {
'Y', "gearCopper",
'V', Blocks.piston);
RecipeUtil.addRecipe(ForestryBlock.engine.getItemStack(1, Constants.DEFINITION_ENGINE_BIOGAS_META),
RecipeUtil.addRecipe(blocks.engine.get(BlockEngineType.BIOGAS),
"###",
" X ",
"YVY",
@@ -87,7 +78,7 @@ public class PluginEnergy extends ForestryPlugin {
'V', Blocks.piston);
if (ForestryAPI.activeMode.getBooleanSetting("energy.engine.clockwork")) {
RecipeUtil.addRecipe(ForestryBlock.engine.getItemStack(1, Constants.DEFINITION_ENGINE_CLOCKWORK_META),
RecipeUtil.addRecipe(blocks.engine.get(BlockEngineType.CLOCKWORK),
"###",
" X ",
"ZVY",
@@ -218,8 +218,8 @@ public class PluginFactory extends ForestryPlugin {
public void doInit() {
super.doInit();
blocks.factoryTESR.registerDefinitions();
blocks.factoryPlain.registerDefinitions();
blocks.factoryTESR.init();
blocks.factoryPlain.init();
Circuit.machineSpeedUpgrade1 = new CircuitSpeedUpgrade("machine.speed.boost.1", 0.125f, 0.05f, 4);
Circuit.machineSpeedUpgrade2 = new CircuitSpeedUpgrade("machine.speed.boost.2", 0.250f, 0.10f, 4);
@@ -13,7 +13,6 @@ package forestry.plugins;
import java.io.File;
import java.util.EnumSet;
import net.minecraft.block.material.Material;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
@@ -80,7 +79,7 @@ public class PluginLepidopterology extends ForestryPlugin {
protected void registerItemsAndBlocks() {
items = new ItemRegistryLepidopterology();
ForestryBlock.lepidopterology.registerBlock(new BlockBase(Material.iron, true), ItemBlockForestry.class, "lepidopterology");
ForestryBlock.lepidopterology.registerBlock(new BlockBase(true), ItemBlockForestry.class, "lepidopterology");
ForestryBlock.lepidopterology.block().setCreativeTab(Tabs.tabLepidopterology);
}
@@ -115,7 +114,7 @@ public class PluginLepidopterology extends ForestryPlugin {
MothDefinition.initMoths();
ButterflyDefinition.initButterflies();
((BlockBase) ForestryBlock.lepidopterology.block()).registerDefinitions();
((BlockBase) ForestryBlock.lepidopterology.block()).init();
TreeManager.treeRoot.registerLeafTickHandler(new ButterflySpawner());
@@ -88,7 +88,7 @@ public class PluginMail extends ForestryPlugin {
public void doInit() {
super.doInit();
blocks.mail.registerDefinitions();
blocks.mail.init();
}
@Override
@@ -37,25 +37,21 @@ import forestry.api.storage.ICrateRegistry;
import forestry.api.storage.StorageManager;
import forestry.apiculture.items.EnumPropolis;
import forestry.apiculture.items.ItemRegistryApiculture;
import forestry.core.blocks.BlockBase;
import forestry.core.circuits.Circuit;
import forestry.core.circuits.CircuitLayout;
import forestry.core.config.Constants;
import forestry.core.config.ForestryBlock;
import forestry.core.fluids.Fluids;
import forestry.core.items.EnumElectronTube;
import forestry.core.proxy.Proxies;
import forestry.core.recipes.RecipeUtil;
import forestry.core.tiles.MachineDefinition;
import forestry.core.utils.ItemStackUtil;
import forestry.core.utils.Log;
import forestry.core.utils.ModUtil;
import forestry.energy.blocks.BlockEngineType;
import forestry.energy.blocks.BlockRegistryEnergy;
import forestry.energy.circuits.CircuitElectricBoost;
import forestry.energy.circuits.CircuitElectricChoke;
import forestry.energy.circuits.CircuitElectricEfficiency;
import forestry.energy.tiles.EngineDefinition;
import forestry.energy.tiles.TileEngineElectric;
import forestry.energy.tiles.TileGenerator;
import forestry.farming.circuits.CircuitFarmLogic;
import forestry.farming.logic.FarmLogicRubber;
import forestry.plugins.ForestryPlugin;
@@ -113,7 +109,6 @@ public class PluginIC2 extends ForestryPlugin {
EnumSet<PluginManager.Module> deps = super.getDependancies();
deps.add(PluginManager.Module.FARMING);
deps.add(PluginManager.Module.FACTORY);
deps.add(PluginManager.Module.ENERGY);
return deps;
}
@@ -122,13 +117,13 @@ public class PluginIC2 extends ForestryPlugin {
public void preInit() {
super.preInit();
EngineDefinition definitionEngineElectric = new EngineDefinition(Constants.DEFINITION_ENGINE_ELECTRIC_META, "forestry.EngineTin", TileEngineElectric.class,
PluginEnergy.proxy.getRenderDefaultEngine(Constants.TEXTURE_PATH_BLOCKS + "/engine_tin_"));
((BlockBase) ForestryBlock.engine.block()).addDefinition(definitionEngineElectric);
MachineDefinition definitionGenerator = new MachineDefinition(Constants.DEFINITION_GENERATOR_META, "forestry.Generator", TileGenerator.class,
Proxies.render.getRenderDefaultMachine(Constants.TEXTURE_PATH_BLOCKS + "/generator_"));
((BlockBase) ForestryBlock.engine.block()).addDefinition(definitionGenerator);
BlockRegistryEnergy energyBlocks = PluginEnergy.blocks;
if (energyBlocks != null) {
energyBlocks.engine.addDefinitions(
new EngineDefinition(BlockEngineType.ELECTRIC),
new EngineDefinition(BlockEngineType.GENERATOR)
);
}
emptyCell = IC2Items.getItem("cell");
if (emptyCell != null) {
@@ -179,8 +174,6 @@ public class PluginIC2 extends ForestryPlugin {
Log.severe("IC2 Recipes.recyclerBlacklist not found.");
}
((BlockBase) ForestryBlock.engine.block()).registerDefinitions();
Circuit.energyElectricChoke1 = new CircuitElectricChoke("electric.choke.1");
Circuit.energyElectricEfficiency1 = new CircuitElectricEfficiency("electric.efficiency.1");
Circuit.energyElectricBoost1 = new CircuitElectricBoost("electric.boost.1", 2, 7, 20);
@@ -307,21 +300,24 @@ public class PluginIC2 extends ForestryPlugin {
ChipsetManager.solderManager.addRecipe(layoutManual, PluginCore.items.tubes.get(EnumElectronTube.RUBBER, 1), Circuit.farmRubberManual);
}
RecipeUtil.addRecipe(ForestryBlock.engine.getItemStack(1, Constants.DEFINITION_GENERATOR_META),
"X#X",
"XYX",
"X#X",
'#', "blockGlass",
'X', "ingotGold",
'Y', PluginCore.items.sturdyCasing);
BlockRegistryEnergy energyBlocks = PluginEnergy.blocks;
if (energyBlocks != null) {
RecipeUtil.addRecipe(energyBlocks.engine.get(BlockEngineType.GENERATOR),
"X#X",
"XYX",
"X#X",
'#', "blockGlass",
'X', "ingotGold",
'Y', PluginCore.items.sturdyCasing);
RecipeUtil.addRecipe(ForestryBlock.engine.getItemStack(1, Constants.DEFINITION_ENGINE_ELECTRIC_META),
"###",
" X ",
"YVY",
'#', "ingotTin",
'X', "blockGlass",
'Y', "gearTin",
'V', Blocks.piston);
RecipeUtil.addRecipe(energyBlocks.engine.get(BlockEngineType.ELECTRIC),
"###",
" X ",
"YVY",
'#', "ingotTin",
'X', "blockGlass",
'Y', "gearTin",
'V', Blocks.piston);
}
}
}