mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-22 21:09:51 +00:00
Fix #592 Some Crates are missing a recipe
This commit is contained in:
1 parent
3f6f12f7cc
commit
f7bc38c7e4
18 files changed
+454
-599
No files matched your search
@@ -41,10 +41,13 @@ public abstract class ForestryPlugin {
|
||||
return EnumSet.of(PluginManager.Module.CORE);
|
||||
}
|
||||
|
||||
protected void preInit() {
|
||||
protected void setupAPI() {
|
||||
}
|
||||
|
||||
protected void disabledPreInit() {
|
||||
protected void disabledSetupAPI() {
|
||||
}
|
||||
|
||||
protected void preInit() {
|
||||
}
|
||||
|
||||
protected void doInit() {
|
||||
@@ -53,9 +56,6 @@ public abstract class ForestryPlugin {
|
||||
protected void postInit() {
|
||||
}
|
||||
|
||||
protected void disabledPostInit() {
|
||||
}
|
||||
|
||||
public boolean processIMCMessage(IMCMessage message) {
|
||||
return false;
|
||||
}
|
||||
@@ -101,6 +101,9 @@ public abstract class ForestryPlugin {
|
||||
protected void registerItems() {
|
||||
}
|
||||
|
||||
protected void registerTriggers() {
|
||||
}
|
||||
|
||||
protected void registerBackpackItems() {
|
||||
}
|
||||
|
||||
|
||||
@@ -188,12 +188,10 @@ public class PluginApiculture extends ForestryPlugin {
|
||||
public static MachineDefinition definitionBeehouse;
|
||||
public static MachineDefinition definitionAnalyzer;
|
||||
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
@Override
|
||||
public void preInit() {
|
||||
super.preInit();
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
protected void setupAPI() {
|
||||
super.setupAPI();
|
||||
|
||||
HiveManager.hiveRegistry = hiveRegistry = new HiveRegistry();
|
||||
HiveManager.genHelper = new HiveGenHelper();
|
||||
@@ -201,6 +199,25 @@ public class PluginApiculture extends ForestryPlugin {
|
||||
|
||||
FlowerManager.flowerRegistry = new FlowerRegistry();
|
||||
|
||||
BeeManager.villageBees = new ArrayList[]{new ArrayList<IBeeGenome>(), new ArrayList<IBeeGenome>()};
|
||||
|
||||
// Init bee interface
|
||||
AlleleManager.alleleRegistry.registerSpeciesRoot(PluginApiculture.beeInterface = new BeeHelper());
|
||||
|
||||
// Modes
|
||||
PluginApiculture.beeInterface.registerBeekeepingMode(BeekeepingMode.easy);
|
||||
PluginApiculture.beeInterface.registerBeekeepingMode(BeekeepingMode.normal);
|
||||
PluginApiculture.beeInterface.registerBeekeepingMode(BeekeepingMode.hard);
|
||||
PluginApiculture.beeInterface.registerBeekeepingMode(BeekeepingMode.hardcore);
|
||||
PluginApiculture.beeInterface.registerBeekeepingMode(BeekeepingMode.insane);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
super.preInit();
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
|
||||
ForestryBlock.apiculture.registerBlock(new BlockBase(Material.iron), ItemForestryBlock.class, "apiculture");
|
||||
ForestryBlock.apiculture.block().setCreativeTab(Tabs.tabApiculture);
|
||||
ForestryBlock.apiculture.block().setHarvestLevel("axe", 0);
|
||||
@@ -240,10 +257,6 @@ public class PluginApiculture extends ForestryPlugin {
|
||||
|
||||
ForestryBlock.beehives.registerBlock(new BlockBeehives(), ItemForestryBlock.class, "beehives");
|
||||
|
||||
// Init bee interface
|
||||
AlleleManager.alleleRegistry.registerSpeciesRoot(PluginApiculture.beeInterface = new BeeHelper());
|
||||
BeeManager.villageBees = new ArrayList[]{new ArrayList<IBeeGenome>(), new ArrayList<IBeeGenome>()};
|
||||
|
||||
// Candles
|
||||
ForestryBlock.candle.registerBlock(new BlockCandle(), ItemCandleBlock.class, "candle");
|
||||
ForestryBlock.stump.registerBlock(new BlockStump(), ItemForestryBlock.class, "stump");
|
||||
@@ -262,13 +275,6 @@ public class PluginApiculture extends ForestryPlugin {
|
||||
VillageHandlerApiculture.registerVillageComponents();
|
||||
}
|
||||
|
||||
// Modes
|
||||
PluginApiculture.beeInterface.registerBeekeepingMode(BeekeepingMode.easy);
|
||||
PluginApiculture.beeInterface.registerBeekeepingMode(BeekeepingMode.normal);
|
||||
PluginApiculture.beeInterface.registerBeekeepingMode(BeekeepingMode.hard);
|
||||
PluginApiculture.beeInterface.registerBeekeepingMode(BeekeepingMode.hardcore);
|
||||
PluginApiculture.beeInterface.registerBeekeepingMode(BeekeepingMode.insane);
|
||||
|
||||
// Commands
|
||||
PluginCore.rootCommand.addChildCommand(new CommandBee());
|
||||
}
|
||||
@@ -428,10 +434,6 @@ public class PluginApiculture extends ForestryPlugin {
|
||||
ForestryItem.scoop.item().setHarvestLevel("scoop", 3);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerBackpackItems() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerCrates() {
|
||||
ICrateRegistry crateRegistry = StorageManager.crateRegistry;
|
||||
@@ -703,7 +705,7 @@ public class PluginApiculture extends ForestryPlugin {
|
||||
definitionChest.register();
|
||||
}
|
||||
|
||||
public IRecipe[] createAlyzerRecipes(Block block, int meta) {
|
||||
public static IRecipe[] createAlyzerRecipes(Block block, int meta) {
|
||||
ArrayList<IRecipe> recipes = new ArrayList<IRecipe>();
|
||||
recipes.add(ShapedRecipeCustom.createShapedRecipe(new ItemStack(block, 1, meta), "XTX", " Y ", "X X", 'Y', ForestryItem.sturdyCasing, 'T', ForestryItem.beealyzer, 'X', "ingotBronze"));
|
||||
recipes.add(ShapedRecipeCustom.createShapedRecipe(new ItemStack(block, 1, meta), "XTX", " Y ", "X X", 'Y', ForestryItem.sturdyCasing, 'T', ForestryItem.treealyzer, 'X', "ingotBronze"));
|
||||
@@ -733,7 +735,7 @@ public class PluginApiculture extends ForestryPlugin {
|
||||
swampDrops.add(new HiveDrop(BeeTemplates.getValiantTemplate(), new ItemStack[]{ForestryItem.beeComb.getItemStack(1, 15)}, 3));
|
||||
}
|
||||
|
||||
private void registerDungeonLoot() {
|
||||
private static void registerDungeonLoot() {
|
||||
int rarity;
|
||||
if (Config.dungeonLootRare) {
|
||||
rarity = 5;
|
||||
@@ -760,7 +762,7 @@ public class PluginApiculture extends ForestryPlugin {
|
||||
ChestGenHooks.addItem(Defaults.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(getBeeItemFromTemplate(BeeTemplates.getMeadowsTemplate(), EnumBeeType.PRINCESS), 1, 1, 5));
|
||||
}
|
||||
|
||||
private ItemStack getBeeItemFromTemplate(IAllele[] template, EnumBeeType beeType) {
|
||||
private static ItemStack getBeeItemFromTemplate(IAllele[] template, EnumBeeType beeType) {
|
||||
IBee bee = new Bee(PluginApiculture.beeInterface.templateAsGenome(template));
|
||||
ItemStack beeItem;
|
||||
switch (beeType) {
|
||||
@@ -810,7 +812,7 @@ public class PluginApiculture extends ForestryPlugin {
|
||||
BeeManager.hiveDrops[7] = swarmDrops;
|
||||
}
|
||||
|
||||
private void createHives() {
|
||||
private static void createHives() {
|
||||
hiveRegistry.registerHive(HiveRegistry.forest, HiveDescription.FOREST);
|
||||
hiveRegistry.registerHive(HiveRegistry.meadows, HiveDescription.MEADOWS);
|
||||
hiveRegistry.registerHive(HiveRegistry.desert, HiveDescription.DESERT);
|
||||
@@ -830,7 +832,7 @@ public class PluginApiculture extends ForestryPlugin {
|
||||
hiveRegistry.addDrops(HiveRegistry.swamp, swampDrops);
|
||||
}
|
||||
|
||||
private void createAlleles() {
|
||||
private static void createAlleles() {
|
||||
|
||||
IClassification hymnoptera = AlleleManager.alleleRegistry.createAndRegisterClassification(EnumClassLevel.ORDER, "hymnoptera", "Hymnoptera");
|
||||
AlleleManager.alleleRegistry.getClassification("class.insecta").addMemberGroup(hymnoptera);
|
||||
|
||||
@@ -194,6 +194,21 @@ public class PluginArboriculture extends ForestryPlugin {
|
||||
ForestryBlock.fences1,
|
||||
ForestryBlock.fences2);
|
||||
|
||||
@Override
|
||||
protected void setupAPI() {
|
||||
super.setupAPI();
|
||||
|
||||
// Init tree interface
|
||||
AlleleManager.alleleRegistry.registerSpeciesRoot(PluginArboriculture.treeInterface = new TreeHelper());
|
||||
|
||||
// Modes
|
||||
PluginArboriculture.treeInterface.registerTreekeepingMode(TreekeepingMode.easy);
|
||||
PluginArboriculture.treeInterface.registerTreekeepingMode(TreekeepingMode.normal);
|
||||
PluginArboriculture.treeInterface.registerTreekeepingMode(TreekeepingMode.hard);
|
||||
PluginArboriculture.treeInterface.registerTreekeepingMode(TreekeepingMode.hardcore);
|
||||
PluginArboriculture.treeInterface.registerTreekeepingMode(TreekeepingMode.insane);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
super.preInit();
|
||||
@@ -290,15 +305,9 @@ public class PluginArboriculture extends ForestryPlugin {
|
||||
'Y', Blocks.chest))
|
||||
.setFaces(0, 1, 2, 3, 4, 4, 0, 7));
|
||||
|
||||
// Init tree interface
|
||||
AlleleManager.alleleRegistry.registerSpeciesRoot(PluginArboriculture.treeInterface = new TreeHelper());
|
||||
|
||||
// Init rendering
|
||||
proxy.initializeRendering();
|
||||
|
||||
// Create alleles
|
||||
createAlleles();
|
||||
|
||||
// Register vanilla and forestry fence ids
|
||||
validFences.add(ForestryBlock.fences1.block());
|
||||
validFences.add(ForestryBlock.fences2.block());
|
||||
@@ -306,15 +315,14 @@ public class PluginArboriculture extends ForestryPlugin {
|
||||
validFences.add(Blocks.fence_gate);
|
||||
validFences.add(Blocks.nether_brick_fence);
|
||||
|
||||
// Modes
|
||||
PluginArboriculture.treeInterface.registerTreekeepingMode(TreekeepingMode.easy);
|
||||
PluginArboriculture.treeInterface.registerTreekeepingMode(TreekeepingMode.normal);
|
||||
PluginArboriculture.treeInterface.registerTreekeepingMode(TreekeepingMode.hard);
|
||||
PluginArboriculture.treeInterface.registerTreekeepingMode(TreekeepingMode.hardcore);
|
||||
PluginArboriculture.treeInterface.registerTreekeepingMode(TreekeepingMode.insane);
|
||||
|
||||
// Commands
|
||||
PluginCore.rootCommand.addChildCommand(new CommandTree());
|
||||
|
||||
// Create alleles
|
||||
createAlleles();
|
||||
createMutations();
|
||||
registerTemplates();
|
||||
registerErsatzGenomes();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -327,10 +335,6 @@ public class PluginArboriculture extends ForestryPlugin {
|
||||
GameRegistry.registerTileEntity(TileFruitPod.class, "forestry.Pods");
|
||||
definitionChest.register();
|
||||
|
||||
createMutations();
|
||||
registerTemplates();
|
||||
registerErsatzGenomes();
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(new EventHandlerArboriculture());
|
||||
|
||||
if (Config.enableVillager) {
|
||||
@@ -590,7 +594,7 @@ public class PluginArboriculture extends ForestryPlugin {
|
||||
Proxies.common.addRecipe(ForestryItem.grafter.getItemStack(), " B", " # ", "# ", 'B', "ingotBronze", '#', Items.stick);
|
||||
}
|
||||
|
||||
private void createAlleles() {
|
||||
private static void createAlleles() {
|
||||
|
||||
// Divisions
|
||||
IClassification angiosperms = AlleleManager.alleleRegistry.createAndRegisterClassification(
|
||||
@@ -1037,7 +1041,7 @@ public class PluginArboriculture extends ForestryPlugin {
|
||||
|
||||
}
|
||||
|
||||
private void registerTemplates() {
|
||||
private static void registerTemplates() {
|
||||
treeInterface.registerTemplate(TreeTemplates.getOakTemplate());
|
||||
treeInterface.registerTemplate(TreeTemplates.getBirchTemplate());
|
||||
treeInterface.registerTemplate(TreeTemplates.getSpruceTemplate());
|
||||
@@ -1084,7 +1088,7 @@ public class PluginArboriculture extends ForestryPlugin {
|
||||
treeInterface.registerTemplate(TreeTemplates.getDateTemplate());
|
||||
}
|
||||
|
||||
private void registerErsatzGenomes() {
|
||||
private static void registerErsatzGenomes() {
|
||||
AlleleManager.ersatzSpecimen.put(new ItemStack(Blocks.leaves, 1, 0), new Tree(
|
||||
TreeTemplates.templateAsGenome(TreeTemplates.getOakTemplate())));
|
||||
AlleleManager.ersatzSpecimen.put(new ItemStack(Blocks.leaves, 1, 1), new Tree(
|
||||
@@ -1112,7 +1116,7 @@ public class PluginArboriculture extends ForestryPlugin {
|
||||
TreeTemplates.templateAsGenome(TreeTemplates.getDarkOakTemplate())));
|
||||
}
|
||||
|
||||
private void createMutations() {
|
||||
private static void createMutations() {
|
||||
|
||||
// Decidious
|
||||
TreeTemplates.limeA = new TreeMutation(Allele.treeBirch, Allele.treeOak,
|
||||
@@ -1213,22 +1217,7 @@ public class PluginArboriculture extends ForestryPlugin {
|
||||
|
||||
@Override
|
||||
public IFuelHandler getFuelHandler() {
|
||||
return new IFuelHandler() {
|
||||
@Override
|
||||
public int getBurnTime(ItemStack fuel) {
|
||||
if (ForestryItem.sapling.isItemEqual(fuel)) {
|
||||
return 100;
|
||||
}
|
||||
|
||||
for (ForestryBlock slab : slabs) {
|
||||
if (slab.isItemEqual(fuel)) {
|
||||
return 150;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
return new FuelHandler();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1250,25 +1239,25 @@ public class PluginArboriculture extends ForestryPlugin {
|
||||
return super.processIMCMessage(message);
|
||||
}
|
||||
|
||||
private void registerDungeonLoot() {
|
||||
private static void registerDungeonLoot() {
|
||||
ChestGenHooks.addItem(Defaults.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(ForestryItem.grafter.getItemStack(), 1, 1, 8));
|
||||
|
||||
ChestGenHooks.addItem(Defaults.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(this.getTreeItemFromTemplate(TreeTemplates.getOakTemplate(), EnumGermlingType.SAPLING), 2, 3, 6));
|
||||
ChestGenHooks.addItem(Defaults.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(this.getTreeItemFromTemplate(TreeTemplates.getSpruceTemplate(), EnumGermlingType.SAPLING), 2, 3, 6));
|
||||
ChestGenHooks.addItem(Defaults.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(this.getTreeItemFromTemplate(TreeTemplates.getBirchTemplate(), EnumGermlingType.SAPLING), 2, 3, 6));
|
||||
ChestGenHooks.addItem(Defaults.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(this.getTreeItemFromTemplate(TreeTemplates.getLarchTemplate(), EnumGermlingType.SAPLING), 1, 2, 4));
|
||||
ChestGenHooks.addItem(Defaults.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(this.getTreeItemFromTemplate(TreeTemplates.getLimeTemplate(), EnumGermlingType.SAPLING), 1, 2, 4));
|
||||
ChestGenHooks.addItem(Defaults.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(getTreeItemFromTemplate(TreeTemplates.getOakTemplate(), EnumGermlingType.SAPLING), 2, 3, 6));
|
||||
ChestGenHooks.addItem(Defaults.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(getTreeItemFromTemplate(TreeTemplates.getSpruceTemplate(), EnumGermlingType.SAPLING), 2, 3, 6));
|
||||
ChestGenHooks.addItem(Defaults.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(getTreeItemFromTemplate(TreeTemplates.getBirchTemplate(), EnumGermlingType.SAPLING), 2, 3, 6));
|
||||
ChestGenHooks.addItem(Defaults.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(getTreeItemFromTemplate(TreeTemplates.getLarchTemplate(), EnumGermlingType.SAPLING), 1, 2, 4));
|
||||
ChestGenHooks.addItem(Defaults.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(getTreeItemFromTemplate(TreeTemplates.getLimeTemplate(), EnumGermlingType.SAPLING), 1, 2, 4));
|
||||
|
||||
if (PluginManager.Module.APICULTURE.isEnabled()) {
|
||||
ChestGenHooks.addItem(Defaults.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(this.getTreeItemFromTemplate(TreeTemplates.getOakTemplate(), EnumGermlingType.POLLEN), 2, 3, 4));
|
||||
ChestGenHooks.addItem(Defaults.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(this.getTreeItemFromTemplate(TreeTemplates.getSpruceTemplate(), EnumGermlingType.POLLEN), 2, 3, 4));
|
||||
ChestGenHooks.addItem(Defaults.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(this.getTreeItemFromTemplate(TreeTemplates.getBirchTemplate(), EnumGermlingType.POLLEN), 2, 3, 4));
|
||||
ChestGenHooks.addItem(Defaults.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(this.getTreeItemFromTemplate(TreeTemplates.getLarchTemplate(), EnumGermlingType.POLLEN), 1, 2, 3));
|
||||
ChestGenHooks.addItem(Defaults.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(this.getTreeItemFromTemplate(TreeTemplates.getLimeTemplate(), EnumGermlingType.POLLEN), 1, 2, 3));
|
||||
ChestGenHooks.addItem(Defaults.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(getTreeItemFromTemplate(TreeTemplates.getOakTemplate(), EnumGermlingType.POLLEN), 2, 3, 4));
|
||||
ChestGenHooks.addItem(Defaults.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(getTreeItemFromTemplate(TreeTemplates.getSpruceTemplate(), EnumGermlingType.POLLEN), 2, 3, 4));
|
||||
ChestGenHooks.addItem(Defaults.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(getTreeItemFromTemplate(TreeTemplates.getBirchTemplate(), EnumGermlingType.POLLEN), 2, 3, 4));
|
||||
ChestGenHooks.addItem(Defaults.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(getTreeItemFromTemplate(TreeTemplates.getLarchTemplate(), EnumGermlingType.POLLEN), 1, 2, 3));
|
||||
ChestGenHooks.addItem(Defaults.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(getTreeItemFromTemplate(TreeTemplates.getLimeTemplate(), EnumGermlingType.POLLEN), 1, 2, 3));
|
||||
}
|
||||
}
|
||||
|
||||
private ItemStack getTreeItemFromTemplate(IAllele[] template, EnumGermlingType type) {
|
||||
private static ItemStack getTreeItemFromTemplate(IAllele[] template, EnumGermlingType type) {
|
||||
ITree tree = new Tree(PluginArboriculture.treeInterface.templateAsGenome(template));
|
||||
ItemStack treeItem;
|
||||
switch (type) {
|
||||
@@ -1284,4 +1273,21 @@ public class PluginArboriculture extends ForestryPlugin {
|
||||
treeItem.setTagCompound(nbtTagCompound);
|
||||
return treeItem;
|
||||
}
|
||||
|
||||
private static class FuelHandler implements IFuelHandler {
|
||||
@Override
|
||||
public int getBurnTime(ItemStack fuel) {
|
||||
if (ForestryItem.sapling.isItemEqual(fuel)) {
|
||||
return 100;
|
||||
}
|
||||
|
||||
for (ForestryBlock slab : slabs) {
|
||||
if (slab.isItemEqual(fuel)) {
|
||||
return 150;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -84,11 +84,8 @@ public class PluginCore extends ForestryPlugin {
|
||||
public static final RootCommand rootCommand = new RootCommand();
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
super.preInit();
|
||||
|
||||
rootCommand.addChildCommand(new CommandVersion());
|
||||
rootCommand.addChildCommand(new CommandPlugins());
|
||||
protected void setupAPI() {
|
||||
super.setupAPI();
|
||||
|
||||
ChipsetManager.solderManager = new ItemSolderingIron.SolderManager();
|
||||
|
||||
@@ -101,7 +98,15 @@ public class PluginCore extends ForestryPlugin {
|
||||
AlleleManager.climateHelper = new ClimateHelper();
|
||||
alleleRegistry.initialize();
|
||||
|
||||
Allele.initialize();
|
||||
Allele.setupLegacyAPI();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
super.preInit();
|
||||
|
||||
rootCommand.addChildCommand(new CommandVersion());
|
||||
rootCommand.addChildCommand(new CommandPlugins());
|
||||
|
||||
ForestryBlock.core.registerBlock(new BlockBase(Material.iron, true), ItemForestryBlock.class, "core");
|
||||
|
||||
@@ -276,14 +281,6 @@ public class PluginCore extends ForestryPlugin {
|
||||
ForestryItem.fruits.registerItem(new ItemFruit(), "fruits");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerBackpackItems() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerCrates() {
|
||||
ICrateRegistry crateRegistry = StorageManager.crateRegistry;
|
||||
@@ -450,19 +447,21 @@ public class PluginCore extends ForestryPlugin {
|
||||
|
||||
@Override
|
||||
public IFuelHandler getFuelHandler() {
|
||||
return new IFuelHandler() {
|
||||
return new FuelHandler();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBurnTime(ItemStack fuel) {
|
||||
if (fuel != null && fuel.getItem() == ForestryItem.peat.item()) {
|
||||
return 2000;
|
||||
}
|
||||
if (fuel != null && fuel.getItem() == ForestryItem.bituminousPeat.item()) {
|
||||
return 4200;
|
||||
}
|
||||
private static class FuelHandler implements IFuelHandler {
|
||||
|
||||
return 0;
|
||||
@Override
|
||||
public int getBurnTime(ItemStack fuel) {
|
||||
if (fuel != null && fuel.getItem() == ForestryItem.peat.item()) {
|
||||
return 2000;
|
||||
}
|
||||
};
|
||||
if (fuel != null && fuel.getItem() == ForestryItem.bituminousPeat.item()) {
|
||||
return 4200;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,8 +23,6 @@ import forestry.core.config.ForestryBlock;
|
||||
import forestry.core.config.ForestryItem;
|
||||
import forestry.core.gadgets.BlockBase;
|
||||
import forestry.core.gadgets.MachineDefinition;
|
||||
import forestry.core.interfaces.IOreDictionaryHandler;
|
||||
import forestry.core.interfaces.ISaveEventHandler;
|
||||
import forestry.core.items.ItemForestryBlock;
|
||||
import forestry.core.utils.ShapedRecipeCustom;
|
||||
import forestry.energy.GuiHandlerEnergy;
|
||||
@@ -97,34 +95,8 @@ public class PluginEnergy extends ForestryPlugin {
|
||||
definitionEngineClockwork.register();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerItems() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerBackpackItems() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerRecipes() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerCrates() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGuiHandler getGuiHandler() {
|
||||
return new GuiHandlerEnergy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ISaveEventHandler getSaveEventHandler() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IOreDictionaryHandler getDictionaryHandler() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.plugins;
|
||||
|
||||
import java.util.Arrays;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.init.Blocks;
|
||||
@@ -68,10 +68,25 @@ public class PluginFactory extends ForestryPlugin {
|
||||
public static MachineDefinition definitionWorktable;
|
||||
|
||||
@Override
|
||||
protected void disabledPreInit() {
|
||||
super.disabledPreInit();
|
||||
protected void setupAPI() {
|
||||
super.setupAPI();
|
||||
|
||||
RecipeManagers.craftingProviders = Arrays.asList(
|
||||
RecipeManagers.craftingProviders = ImmutableList.of(
|
||||
RecipeManagers.carpenterManager = new MachineCarpenter.RecipeManager(),
|
||||
RecipeManagers.centrifugeManager = new MachineCentrifuge.RecipeManager(),
|
||||
RecipeManagers.fabricatorManager = new MachineFabricator.RecipeManager(),
|
||||
RecipeManagers.fermenterManager = new MachineFermenter.RecipeManager(),
|
||||
RecipeManagers.moistenerManager = new MachineMoistener.RecipeManager(),
|
||||
RecipeManagers.squeezerManager = new MachineSqueezer.RecipeManager(),
|
||||
RecipeManagers.stillManager = new MachineStill.RecipeManager()
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void disabledSetupAPI() {
|
||||
super.disabledSetupAPI();
|
||||
|
||||
RecipeManagers.craftingProviders = ImmutableList.of(
|
||||
RecipeManagers.carpenterManager = new DummyManagers.CarpenterManager(),
|
||||
RecipeManagers.centrifugeManager = new DummyManagers.CentrifugeManager(),
|
||||
RecipeManagers.fabricatorManager = new DummyManagers.FabricatorManager(),
|
||||
@@ -86,16 +101,6 @@ public class PluginFactory extends ForestryPlugin {
|
||||
public void preInit() {
|
||||
super.preInit();
|
||||
|
||||
RecipeManagers.craftingProviders = Arrays.asList(
|
||||
RecipeManagers.carpenterManager = new MachineCarpenter.RecipeManager(),
|
||||
RecipeManagers.centrifugeManager = new MachineCentrifuge.RecipeManager(),
|
||||
RecipeManagers.fabricatorManager = new MachineFabricator.RecipeManager(),
|
||||
RecipeManagers.fermenterManager = new MachineFermenter.RecipeManager(),
|
||||
RecipeManagers.moistenerManager = new MachineMoistener.RecipeManager(),
|
||||
RecipeManagers.squeezerManager = new MachineSqueezer.RecipeManager(),
|
||||
RecipeManagers.stillManager = new MachineStill.RecipeManager()
|
||||
);
|
||||
|
||||
ForestryBlock.factoryTESR.registerBlock(new BlockBase(Material.iron, true), ItemForestryBlock.class, "factory");
|
||||
|
||||
BlockBase factoryTESR = ((BlockBase) ForestryBlock.factoryTESR.block());
|
||||
@@ -215,11 +220,11 @@ public class PluginFactory extends ForestryPlugin {
|
||||
'W', Blocks.crafting_table,
|
||||
'C', Blocks.chest))
|
||||
.setFaces(0, 1, 2, 3, 4, 4));
|
||||
}
|
||||
|
||||
// Triggers
|
||||
if (PluginManager.Module.BUILDCRAFT_STATEMENTS.isEnabled()) {
|
||||
FactoryTriggers.initialize();
|
||||
}
|
||||
@Override
|
||||
protected void registerTriggers() {
|
||||
FactoryTriggers.initialize();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -85,10 +85,15 @@ public class PluginFarming extends ForestryPlugin {
|
||||
public static ItemStack farmFertilizer;
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
super.preInit();
|
||||
protected void setupAPI() {
|
||||
super.setupAPI();
|
||||
|
||||
Farmables.farmInterface = new FarmHelper();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
super.preInit();
|
||||
|
||||
ForestryBlock.mushroom.registerBlock(new BlockMushroom(), ItemTypedBlock.class, "mushroom");
|
||||
|
||||
@@ -130,11 +135,6 @@ public class PluginFarming extends ForestryPlugin {
|
||||
|
||||
proxy.initializeRendering();
|
||||
|
||||
// Triggers
|
||||
if (PluginManager.Module.BUILDCRAFT_STATEMENTS.isEnabled()) {
|
||||
FarmingTriggers.initialize();
|
||||
}
|
||||
|
||||
// Layouts
|
||||
ICircuitLayout layoutManaged = new CircuitLayout("farms.managed");
|
||||
ChipsetManager.circuitRegistry.registerLayout(layoutManaged);
|
||||
@@ -142,6 +142,11 @@ public class PluginFarming extends ForestryPlugin {
|
||||
ChipsetManager.circuitRegistry.registerLayout(layoutManual);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerTriggers() {
|
||||
FarmingTriggers.initialize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doInit() {
|
||||
super.doInit();
|
||||
|
||||
@@ -36,8 +36,8 @@ import forestry.food.items.ItemInfuser;
|
||||
public class PluginFood extends ForestryPlugin {
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
super.preInit();
|
||||
protected void setupAPI() {
|
||||
super.setupAPI();
|
||||
|
||||
// Init seasoner
|
||||
BeverageManager.infuserManager = new ItemInfuser.MixtureManager();
|
||||
@@ -72,10 +72,6 @@ public class PluginFood extends ForestryPlugin {
|
||||
LiquidHelper.injectLiquidContainer(Fluids.SHORT_MEAD, Defaults.BUCKET_VOLUME, meadBottle, new ItemStack(Items.glass_bottle));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerBackpackItems() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerRecipes() {
|
||||
// INFUSER
|
||||
@@ -85,22 +81,8 @@ public class PluginFood extends ForestryPlugin {
|
||||
'X', "ingotBronze");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerCrates() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGuiHandler getGuiHandler() {
|
||||
return new GuiHandlerFood();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ISaveEventHandler getSaveEventHandler() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IOreDictionaryHandler getDictionaryHandler() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -84,12 +84,18 @@ public class PluginLepidopterology extends ForestryPlugin {
|
||||
public static MachineDefinition definitionChest;
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
ForestryBlock.lepidopterology.registerBlock(new BlockBase(Material.iron), ItemForestryBlock.class, "lepidopterology");
|
||||
ForestryBlock.lepidopterology.block().setCreativeTab(Tabs.tabLepidopterology);
|
||||
protected void setupAPI() {
|
||||
super.setupAPI();
|
||||
|
||||
AlleleManager.alleleRegistry.registerSpeciesRoot(PluginLepidopterology.butterflyInterface = new ButterflyHelper());
|
||||
createAlleles();
|
||||
registerTemplates();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
ForestryBlock.lepidopterology.registerBlock(new BlockBase(Material.iron), ItemForestryBlock.class, "lepidopterology");
|
||||
ForestryBlock.lepidopterology.block().setCreativeTab(Tabs.tabLepidopterology);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -121,7 +127,6 @@ public class PluginLepidopterology extends ForestryPlugin {
|
||||
|
||||
Utils.registerEntity(EntityButterfly.class, "butterflyGE", 0, 0x000000, 0xffffff, 50, 1, true);
|
||||
proxy.initializeRendering();
|
||||
registerTemplates();
|
||||
|
||||
BlockBase lepidopterology = ((BlockBase) ForestryBlock.lepidopterology.block());
|
||||
definitionChest = lepidopterology.addDefinition((new MachineDefinition(Defaults.DEFINITION_LEPICHEST_META, "forestry.LepiChest", TileLepidopteristChest.class,
|
||||
@@ -159,7 +164,7 @@ public class PluginLepidopterology extends ForestryPlugin {
|
||||
Items.redstone, 'D', Items.diamond);
|
||||
}
|
||||
|
||||
private void createAlleles() {
|
||||
private static void createAlleles() {
|
||||
|
||||
IClassification lepidoptera = AlleleManager.alleleRegistry.createAndRegisterClassification(EnumClassLevel.ORDER, "lepidoptera", "Lepidoptera");
|
||||
AlleleManager.alleleRegistry.getClassification("class.insecta").addMemberGroup(lepidoptera);
|
||||
@@ -273,7 +278,13 @@ public class PluginLepidopterology extends ForestryPlugin {
|
||||
Allele.butterflyNone = new AlleleEffectNone("bfNone", false);
|
||||
}
|
||||
|
||||
private void registerTemplates() {
|
||||
private static IClassification createButterflyBranch(IClassification family, String scientific) {
|
||||
IClassification branch = new Branch("moth." + scientific.toLowerCase(Locale.ENGLISH), scientific);
|
||||
branch.setParent(family);
|
||||
return branch;
|
||||
}
|
||||
|
||||
private static void registerTemplates() {
|
||||
butterflyInterface.registerTemplate(ButterflyTemplates.getBrimstoneMothTemplate());
|
||||
butterflyInterface.registerTemplate(ButterflyTemplates.getLatticedHeathTemplate());
|
||||
butterflyInterface.registerTemplate(ButterflyTemplates.getAtlasMothTemplate());
|
||||
@@ -319,12 +330,6 @@ public class PluginLepidopterology extends ForestryPlugin {
|
||||
|
||||
}
|
||||
|
||||
private IClassification createButterflyBranch(IClassification family, String scientific) {
|
||||
IClassification branch = new Branch("moth." + scientific.toLowerCase(Locale.ENGLISH), scientific);
|
||||
branch.setParent(family);
|
||||
return branch;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGuiHandler getGuiHandler() {
|
||||
return new GuiHandlerLepidopterology();
|
||||
|
||||
@@ -63,6 +63,15 @@ public class PluginMail extends ForestryPlugin {
|
||||
public static MachineDefinition definitionPhilatelist;
|
||||
public static StampInfo[] stampDefinitions;
|
||||
|
||||
@Override
|
||||
protected void setupAPI() {
|
||||
super.setupAPI();
|
||||
|
||||
PostManager.postRegistry = new PostRegistry();
|
||||
PostManager.postRegistry.registerCarrier(new PostalCarrier(EnumAddressee.PLAYER));
|
||||
PostManager.postRegistry.registerCarrier(new PostalCarrier(EnumAddressee.TRADER));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
super.preInit();
|
||||
@@ -71,11 +80,6 @@ public class PluginMail extends ForestryPlugin {
|
||||
|
||||
new TickHandlerMailClient();
|
||||
|
||||
// Triggers
|
||||
if (PluginManager.Module.BUILDCRAFT_STATEMENTS.isEnabled()) {
|
||||
MailTriggers.initialize();
|
||||
}
|
||||
|
||||
ForestryBlock.mail.registerBlock(new BlockBase(Material.iron), ItemForestryBlock.class, "mail");
|
||||
|
||||
ShapedRecipeCustom recipe = ShapedRecipeCustom.createShapedRecipe(ForestryBlock.mail.getItemStack(1, Defaults.DEFINITION_MAILBOX_META),
|
||||
@@ -102,10 +106,11 @@ public class PluginMail extends ForestryPlugin {
|
||||
|
||||
definitionPhilatelist = mail.addDefinition(new MachineDefinition(Defaults.DEFINITION_PHILATELIST_META, "forestry.Philatelist", MachinePhilatelist.class)
|
||||
.setFaces(0, 1, 2, 3, 2, 2, 0, 7));
|
||||
}
|
||||
|
||||
PostManager.postRegistry = new PostRegistry();
|
||||
PostManager.postRegistry.registerCarrier(new PostalCarrier(EnumAddressee.PLAYER));
|
||||
PostManager.postRegistry.registerCarrier(new PostalCarrier(EnumAddressee.TRADER));
|
||||
@Override
|
||||
protected void registerTriggers() {
|
||||
MailTriggers.initialize();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -117,11 +122,6 @@ public class PluginMail extends ForestryPlugin {
|
||||
definitionPhilatelist.register();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
super.postInit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGuiHandler getGuiHandler() {
|
||||
return new GuiHandlerMail();
|
||||
@@ -151,14 +151,6 @@ public class PluginMail extends ForestryPlugin {
|
||||
ForestryItem.catalogue.registerItem(new ItemCatalogue(), "catalogue");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerBackpackItems() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerCrates() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerRecipes() {
|
||||
// Letters
|
||||
@@ -203,9 +195,4 @@ public class PluginMail extends ForestryPlugin {
|
||||
public ISaveEventHandler getSaveEventHandler() {
|
||||
return new SaveEventHandlerMail();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IOreDictionaryHandler getDictionaryHandler() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -61,8 +61,7 @@ public class PluginManager {
|
||||
private static Stage stage = Stage.SETUP;
|
||||
|
||||
public enum Stage {
|
||||
|
||||
SETUP, PRE_INIT, PRE_INIT_DISABLED, INIT, POST_INIT, POST_INIT_DISABLED, FINISHED
|
||||
SETUP, SETUP_DISABLED, PRE_INIT, INIT, POST_INIT, FINISHED
|
||||
}
|
||||
|
||||
public enum Module {
|
||||
@@ -142,84 +141,6 @@ public class PluginManager {
|
||||
return loadedModules.contains(module);
|
||||
}
|
||||
|
||||
public static void runPreInit() {
|
||||
stage = Stage.SETUP;
|
||||
Locale locale = Locale.getDefault();
|
||||
Locale.setDefault(Locale.ENGLISH);
|
||||
|
||||
Configuration config = new Configuration(new File(Forestry.instance.getConfigFolder(), MODULE_CONFIG_FILE_NAME));
|
||||
|
||||
config.load();
|
||||
config.addCustomCategoryComment(CATEGORY_MODULES, "Disabling these modules can greatly change how the mod functions.\n"
|
||||
+ "Your mileage may vary, please report any issues.");
|
||||
|
||||
Set<Module> toLoad = EnumSet.allOf(Module.class);
|
||||
Iterator<Module> it = toLoad.iterator();
|
||||
while (it.hasNext()) {
|
||||
Module m = it.next();
|
||||
if (!m.canBeDisabled()) {
|
||||
continue;
|
||||
}
|
||||
if (!isEnabled(config, m)) {
|
||||
it.remove();
|
||||
Proxies.log.info("Module disabled: {0}", m);
|
||||
continue;
|
||||
}
|
||||
ForestryPlugin plugin = m.instance;
|
||||
if (!plugin.isAvailable()) {
|
||||
it.remove();
|
||||
Proxies.log.info("Module {0} failed to load: {1}", plugin, plugin.getFailMessage());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
boolean changed;
|
||||
do {
|
||||
changed = false;
|
||||
it = toLoad.iterator();
|
||||
while (it.hasNext()) {
|
||||
Module m = it.next();
|
||||
Set<Module> deps = m.instance().getDependancies();
|
||||
if (!toLoad.containsAll(deps)) {
|
||||
it.remove();
|
||||
changed = true;
|
||||
Proxies.log.warning("Module {0} is missing dependencies: {1}", m, deps);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
} while (changed);
|
||||
|
||||
unloadedModules.removeAll(toLoad);
|
||||
loadedModules.addAll(toLoad);
|
||||
|
||||
if (config.hasChanged()) {
|
||||
config.save();
|
||||
}
|
||||
|
||||
Locale.setDefault(locale);
|
||||
|
||||
stage = Stage.PRE_INIT;
|
||||
for (Module m : loadedModules) {
|
||||
ForestryPlugin plugin = m.instance;
|
||||
loadPlugin(plugin);
|
||||
}
|
||||
|
||||
for (Module m : loadedModules) {
|
||||
ForestryPlugin plugin = m.instance;
|
||||
Proxies.log.fine("Pre-Init Start: {0}", plugin);
|
||||
plugin.preInit();
|
||||
plugin.registerItems();
|
||||
Proxies.log.fine("Pre-Init Complete: {0}", plugin);
|
||||
}
|
||||
|
||||
stage = Stage.PRE_INIT_DISABLED;
|
||||
for (Module m : unloadedModules) {
|
||||
ForestryPlugin plugin = m.instance;
|
||||
Proxies.log.fine("Disabled-Pre-Init Start: {0}", plugin);
|
||||
plugin.disabledPreInit();
|
||||
Proxies.log.fine("Disabled-Pre-Init Complete: {0}", plugin);
|
||||
}
|
||||
}
|
||||
|
||||
private static void loadPlugin(ForestryPlugin plugin) {
|
||||
Proxies.log.fine("Registering Handlers for Plugin: {0}", plugin);
|
||||
|
||||
@@ -259,17 +180,110 @@ public class PluginManager {
|
||||
}
|
||||
}
|
||||
|
||||
private static void configureModules() {
|
||||
Locale locale = Locale.getDefault();
|
||||
Locale.setDefault(Locale.ENGLISH);
|
||||
|
||||
Configuration config = new Configuration(new File(Forestry.instance.getConfigFolder(), MODULE_CONFIG_FILE_NAME));
|
||||
|
||||
config.load();
|
||||
config.addCustomCategoryComment(CATEGORY_MODULES, "Disabling these modules can greatly change how the mod functions.\n"
|
||||
+ "Your mileage may vary, please report any issues.");
|
||||
|
||||
Set<Module> toLoad = EnumSet.allOf(Module.class);
|
||||
Iterator<Module> it = toLoad.iterator();
|
||||
while (it.hasNext()) {
|
||||
Module m = it.next();
|
||||
if (!m.canBeDisabled()) {
|
||||
continue;
|
||||
}
|
||||
if (!isEnabled(config, m)) {
|
||||
it.remove();
|
||||
Proxies.log.info("Module disabled: {0}", m);
|
||||
continue;
|
||||
}
|
||||
ForestryPlugin plugin = m.instance;
|
||||
if (!plugin.isAvailable()) {
|
||||
it.remove();
|
||||
Proxies.log.info("Module {0} failed to load: {1}", plugin, plugin.getFailMessage());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
boolean changed;
|
||||
do {
|
||||
changed = false;
|
||||
it = toLoad.iterator();
|
||||
while (it.hasNext()) {
|
||||
Module m = it.next();
|
||||
Set<Module> deps = m.instance().getDependancies();
|
||||
if (!toLoad.containsAll(deps)) {
|
||||
it.remove();
|
||||
changed = true;
|
||||
Proxies.log.warning("Module {0} is missing dependencies: {1}", m, deps);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
} while (changed);
|
||||
|
||||
unloadedModules.removeAll(toLoad);
|
||||
loadedModules.addAll(toLoad);
|
||||
|
||||
if (config.hasChanged()) {
|
||||
config.save();
|
||||
}
|
||||
|
||||
Locale.setDefault(locale);
|
||||
}
|
||||
|
||||
public static void runSetup() {
|
||||
stage = Stage.SETUP;
|
||||
configureModules();
|
||||
|
||||
for (Module m : loadedModules) {
|
||||
ForestryPlugin plugin = m.instance;
|
||||
Proxies.log.fine("Setup Start: {0}", plugin);
|
||||
plugin.setupAPI();
|
||||
Proxies.log.fine("Setup Complete: {0}", plugin);
|
||||
}
|
||||
|
||||
stage = Stage.SETUP_DISABLED;
|
||||
for (Module m : unloadedModules) {
|
||||
ForestryPlugin plugin = m.instance;
|
||||
Proxies.log.fine("Disabled-Setup Start: {0}", plugin);
|
||||
plugin.disabledSetupAPI();
|
||||
Proxies.log.fine("Disabled-Setup Complete: {0}", plugin);
|
||||
}
|
||||
}
|
||||
|
||||
public static void runPreInit() {
|
||||
stage = Stage.PRE_INIT;
|
||||
for (Module m : loadedModules) {
|
||||
ForestryPlugin plugin = m.instance;
|
||||
loadPlugin(plugin);
|
||||
}
|
||||
|
||||
for (Module m : loadedModules) {
|
||||
ForestryPlugin plugin = m.instance;
|
||||
Proxies.log.fine("Pre-Init Start: {0}", plugin);
|
||||
plugin.preInit();
|
||||
plugin.registerItems();
|
||||
if (Module.BUILDCRAFT_STATEMENTS.isEnabled()) {
|
||||
plugin.registerTriggers();
|
||||
}
|
||||
if (Module.STORAGE.isEnabled()) {
|
||||
plugin.registerBackpackItems();
|
||||
plugin.registerCrates();
|
||||
}
|
||||
Proxies.log.fine("Pre-Init Complete: {0}", plugin);
|
||||
}
|
||||
}
|
||||
|
||||
public static void runInit() {
|
||||
stage = Stage.INIT;
|
||||
for (Module m : loadedModules) {
|
||||
ForestryPlugin plugin = m.instance;
|
||||
Proxies.log.fine("Init Start: {0}", plugin);
|
||||
|
||||
if (Module.STORAGE.isEnabled()) {
|
||||
plugin.registerBackpackItems();
|
||||
plugin.registerCrates();
|
||||
}
|
||||
|
||||
plugin.doInit();
|
||||
plugin.registerRecipes();
|
||||
Proxies.log.fine("Init Complete: {0}", plugin);
|
||||
@@ -285,13 +299,6 @@ public class PluginManager {
|
||||
Proxies.log.fine("Post-Init Complete: {0}", plugin);
|
||||
}
|
||||
|
||||
stage = Stage.POST_INIT_DISABLED;
|
||||
for (Module m : unloadedModules) {
|
||||
ForestryPlugin plugin = m.instance;
|
||||
Proxies.log.fine("Disabled-Post-Init Start: {0}", plugin);
|
||||
plugin.disabledPostInit();
|
||||
Proxies.log.fine("Disabled-Post-Init Complete: {0}", plugin);
|
||||
}
|
||||
stage = Stage.FINISHED;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.plugins;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
@@ -96,7 +97,11 @@ public class PluginStorage extends ForestryPlugin implements IOreDictionaryHandl
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
public void preInit() {
|
||||
protected void setupAPI() {
|
||||
super.setupAPI();
|
||||
|
||||
StorageManager.crateRegistry = new CrateRegistry();
|
||||
|
||||
BackpackManager.backpackInterface = new BackpackHelper();
|
||||
|
||||
BackpackManager.backpackItems = new ArrayList[6];
|
||||
@@ -108,7 +113,35 @@ public class PluginStorage extends ForestryPlugin implements IOreDictionaryHandl
|
||||
BackpackManager.backpackItems[4] = adventurerItems;
|
||||
BackpackManager.backpackItems[5] = builderItems;
|
||||
|
||||
StorageManager.crateRegistry = new CrateRegistry();
|
||||
BackpackDefinition definition;
|
||||
|
||||
if (PluginManager.Module.APICULTURE.isEnabled()) {
|
||||
definition = new BackpackDefinitionApiarist("apiarist", new Color(0xc4923d).getRGB());
|
||||
BackpackManager.definitions.put(definition.getKey(), definition);
|
||||
}
|
||||
|
||||
if (PluginManager.Module.LEPIDOPTEROLOGY.isEnabled()) {
|
||||
definition = new BackpackDefinitionLepidopterist("lepidopterist", new Color(0x995b31).getRGB());
|
||||
BackpackManager.definitions.put(definition.getKey(), definition);
|
||||
}
|
||||
|
||||
definition = new BackpackDefinition("miner", new Color(0x36187d).getRGB());
|
||||
BackpackManager.definitions.put(definition.getKey(), definition);
|
||||
|
||||
definition = new BackpackDefinition("digger", new Color(0x363cc5).getRGB());
|
||||
BackpackManager.definitions.put(definition.getKey(), definition);
|
||||
|
||||
definition = new BackpackDefinition("forester", new Color(0x347427).getRGB());
|
||||
BackpackManager.definitions.put(definition.getKey(), definition);
|
||||
|
||||
definition = new BackpackDefinition("hunter", new Color(0x412215).getRGB());
|
||||
BackpackManager.definitions.put(definition.getKey(), definition);
|
||||
|
||||
definition = new BackpackDefinition("adventurer", new Color(0x7fb8c2).getRGB());
|
||||
BackpackManager.definitions.put(definition.getKey(), definition);
|
||||
|
||||
definition = new BackpackDefinition("builder", new Color(0xdd3a3a).getRGB());
|
||||
BackpackManager.definitions.put(definition.getKey(), definition);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -147,7 +180,7 @@ public class PluginStorage extends ForestryPlugin implements IOreDictionaryHandl
|
||||
}
|
||||
|
||||
public static void registerCrate(ItemCrated crate) {
|
||||
proxy.registerCrate(crate);
|
||||
proxy.registerCrateForRendering(crate);
|
||||
crates.add(crate);
|
||||
}
|
||||
|
||||
@@ -274,47 +307,41 @@ public class PluginStorage extends ForestryPlugin implements IOreDictionaryHandl
|
||||
ForestryItem.crate.registerItem((new ItemCrated(null, false)), "crate");
|
||||
|
||||
// BACKPACKS
|
||||
BackpackDefinition definition;
|
||||
IBackpackDefinition definition;
|
||||
|
||||
if (PluginManager.Module.APICULTURE.isEnabled()) {
|
||||
definition = new BackpackDefinitionApiarist("apiarist", 0xc4923d);
|
||||
BackpackManager.definitions.put(definition.getKey(), definition);
|
||||
ForestryItem.apiaristBackpack.registerItem(new ItemNaturalistBackpack(GuiId.ApiaristBackpackGUI.ordinal(), definition).setCreativeTab(Tabs.tabApiculture), "apiaristBag");
|
||||
definition = BackpackManager.definitions.get("apiarist");
|
||||
Item backpack = new ItemNaturalistBackpack(GuiId.ApiaristBackpackGUI.ordinal(), definition).setCreativeTab(Tabs.tabApiculture);
|
||||
ForestryItem.apiaristBackpack.registerItem(backpack, "apiaristBag");
|
||||
}
|
||||
|
||||
if (PluginManager.Module.LEPIDOPTEROLOGY.isEnabled()) {
|
||||
definition = new BackpackDefinitionLepidopterist("lepidopterist", 0x995b31);
|
||||
BackpackManager.definitions.put(definition.getKey(), definition);
|
||||
ForestryItem.lepidopteristBackpack.registerItem(new ItemNaturalistBackpack(GuiId.LepidopteristBackpackGUI.ordinal(), definition).setCreativeTab(Tabs.tabLepidopterology), "lepidopteristBag");
|
||||
definition = BackpackManager.definitions.get("lepidopterist");
|
||||
Item backpack = new ItemNaturalistBackpack(GuiId.LepidopteristBackpackGUI.ordinal(), definition).setCreativeTab(Tabs.tabLepidopterology);
|
||||
ForestryItem.lepidopteristBackpack.registerItem(backpack, "lepidopteristBag");
|
||||
}
|
||||
|
||||
definition = new BackpackDefinition("miner", 0x36187d);
|
||||
BackpackManager.definitions.put(definition.getKey(), definition);
|
||||
definition = BackpackManager.definitions.get("miner");
|
||||
ForestryItem.minerBackpack.registerItem(BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T1), "minerBag");
|
||||
ForestryItem.minerBackpackT2.registerItem(BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T2), "minerBagT2");
|
||||
|
||||
definition = new BackpackDefinition("digger", 0x363cc5);
|
||||
BackpackManager.definitions.put(definition.getKey(), definition);
|
||||
definition = BackpackManager.definitions.get("digger");
|
||||
ForestryItem.diggerBackpack.registerItem(BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T1), "diggerBag");
|
||||
ForestryItem.diggerBackpackT2.registerItem(BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T2), "diggerBagT2");
|
||||
|
||||
definition = new BackpackDefinition("forester", 0x347427);
|
||||
BackpackManager.definitions.put(definition.getKey(), definition);
|
||||
definition = BackpackManager.definitions.get("forester");
|
||||
ForestryItem.foresterBackpack.registerItem(BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T1), "foresterBag");
|
||||
ForestryItem.foresterBackpackT2.registerItem(BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T2), "foresterBagT2");
|
||||
|
||||
definition = new BackpackDefinition("hunter", 0x412215);
|
||||
BackpackManager.definitions.put(definition.getKey(), definition);
|
||||
definition = BackpackManager.definitions.get("hunter");
|
||||
ForestryItem.hunterBackpack.registerItem(BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T1), "hunterBag");
|
||||
ForestryItem.hunterBackpackT2.registerItem(BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T2), "hunterBagT2");
|
||||
|
||||
definition = new BackpackDefinition("adventurer", 0x7fb8c2);
|
||||
BackpackManager.definitions.put(definition.getKey(), definition);
|
||||
definition = BackpackManager.definitions.get("adventurer");
|
||||
ForestryItem.adventurerBackpack.registerItem(BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T1), "adventurerBag");
|
||||
ForestryItem.adventurerBackpackT2.registerItem(BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T2), "adventurerBagT2");
|
||||
|
||||
definition = new BackpackDefinition("builder", 0xdd3a3a);
|
||||
BackpackManager.definitions.put(definition.getKey(), definition);
|
||||
definition = BackpackManager.definitions.get("builder");
|
||||
ForestryItem.builderBackpack.registerItem(BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T1), "builderBag");
|
||||
ForestryItem.builderBackpackT2.registerItem(BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T2), "builderBagT2");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user