Compare commits

...
49 Commits
Author SHA1 Message Date
mezz 3978a068d1 Bump minor patch version 2015-04-05 21:15:14 -07:00
mezz 9d2d0af432 Fix #594 Crash in Natura plugin
(cherry picked from commit 689adab411)
2015-04-05 21:14:56 -07:00
mezz d451309170 bump patch version to 3.5.1 2015-04-05 20:28:27 -07:00
mezz c82dd0fbfb Fix #592 Some Crates are missing a recipe 2015-04-05 20:22:21 -07:00
mezz 803911e10a Fix #588 crash on crate registry with disabled storage module and natura
(cherry picked from commit 536254af42)
2015-04-05 20:20:40 -07:00
Nirek-K 29eedf9011 Fix #588 Bulletproof null checks for Natura Plugin
(cherry picked from commit 3f6f12f7cc)
2015-04-05 20:15:05 -07:00
mezz 882848a00f Revert "Close #441 Add Underground Biomes Constructs integration"
This reverts commit b3b1a6a415.

Conflicts:
	lang
	src/main/java/forestry/Forestry.java
	src/main/java/forestry/plugins/PluginManager.java

(cherry picked from commit 1ca041a29f)

Conflicts:
	src/main/java/forestry/plugins/PluginManager.java
2015-04-04 19:44:15 -07:00
mezz 4d253e1dd6 Merge branch 'dev' into release_3.5
Conflicts:
	src/main/java/forestry/apiculture/worldgen/HiveGenHelper.java
2015-03-26 23:02:38 -07:00
mezz 4d7988ee0f Merge branch 'dev' into release_3.4
Conflicts:
	application.properties
	src/main/java/forestry/apiculture/gadgets/TileSwarm.java
	src/main/java/forestry/apiculture/genetics/Bee.java
	src/main/java/forestry/arboriculture/gadgets/ForestryBlockLeaves.java
	src/main/java/forestry/core/config/Config.java
	src/main/java/forestry/core/gui/widgets/ReservoirWidget.java
	src/main/java/forestry/core/utils/BlockUtil.java
	src/main/java/forestry/energy/EnergyManager.java
	src/main/java/forestry/factory/gadgets/MachineCarpenter.java
	src/main/java/forestry/mail/gui/GuiCatalogue.java
	src/main/java/forestry/plugins/PluginArboriculture.java
2015-02-16 15:00:16 -08:00
CovertJaguar fcad67a1c2 Update lang 2015-01-29 14:45:38 -08:00
mezz 1bd3b61df9 Fix #480 Increase hive spawn rate 25%, add config option for spawn rate
(cherry picked from commit 56dfae034d)

Conflicts:
	src/main/java/forestry/apiculture/worldgen/HiveDecorator.java
2015-01-29 00:11:35 -08:00
mezz 060ca1eb80 Fix #479 Try to make sure hives are always glowing
(cherry picked from commit 636201ce5a)
2015-01-29 00:09:47 -08:00
mezz 98a2d9c65e Fix bee biome temperature check for nether biomes
(cherry picked from commit c3f37a379a)
2015-01-25 22:26:39 -08:00
mezz eb010094ca Fix crash from missing block when a plugin mod is uninstalled
(cherry picked from commit 5a7bd9f57a)
2015-01-25 22:25:36 -08:00
mezz e6cbced8a2 #457 Add config option for village generation (forgot lumberjack) 2015-01-24 00:25:50 -08:00
mezz d300078227 Close #457 Add config option for village generation
(cherry picked from commit dab217eab0)
2015-01-24 00:21:56 -08:00
mezz 65c7f0242c Fix #470 Engines don't output to other mods' machines
(cherry picked from commit dffa845851)
2015-01-23 23:27:46 -08:00
mezz c4140ef9c3 Fix #472 Crash with Thaumic Tinkerer Ichorium Axe
(cherry picked from commit 1aefd5863e)
2015-01-23 23:26:54 -08:00
mezz 389e5e01e7 Fix #467 Carpenter automation
(cherry picked from commit c6dae0318c)
2015-01-23 22:34:21 -08:00
mezz a55b2645b7 Fix #465 crash after closing catalogue and opening another item gui
(cherry picked from commit dc1449855e)
2015-01-23 22:33:46 -08:00
mezz 9a36381ce0 Fix possible reservoir crash from thermionic fabricator
(cherry picked from commit 195c8fc524)
2015-01-23 22:32:37 -08:00
CovertJaguar 2565eea5ba Set version to 3.4 2015-01-17 20:44:55 -08:00
CovertJaguar 13ae9ece47 Fix submodule issues 2015-01-17 20:36:25 -08:00
CovertJaguar d3e87b1aaf Merge branch 'dev' into release_3.4
Conflicts:
	application.properties
	src/main/java/forestry/apiculture/gadgets/TileAlvearyHygroregulator.java
	src/main/java/forestry/apiculture/gadgets/TileAlvearyPlain.java
	src/main/java/forestry/apiculture/gadgets/TileAlvearySwarmer.java
	src/main/java/forestry/apiculture/worldgen/HiveDecorator.java
	src/main/java/forestry/apiculture/worldgen/HiveForest.java
	src/main/java/forestry/apiculture/worldgen/HiveGen.java
	src/main/java/forestry/apiculture/worldgen/HiveGenHelper.java
	src/main/java/forestry/apiculture/worldgen/HiveMeadows.java
	src/main/java/forestry/apiculture/worldgen/HiveSnow.java
	src/main/java/forestry/apiculture/worldgen/HiveSwamp.java
	src/main/java/forestry/apiculture/worldgen/HiveSwarmer.java
	src/main/java/forestry/core/gui/ContainerForestry.java
	src/main/java/forestry/core/utils/RecipeUtil.java
	src/main/java/forestry/factory/gadgets/TileWorktable.java
	src/main/java/forestry/factory/gui/ContainerFabricator.java
	src/main/java/forestry/factory/gui/ContainerWorktable.java
	src/main/java/forestry/factory/recipes/RecipeMemory.java
2015-01-17 20:33:15 -08:00
CovertJaguar 990d4990db Fix lang 2014-12-14 21:39:45 -08:00
mezz ce232e808e Fix Alveary Swarmer and Swarm Hive
(cherry picked from commit 2577ee9c930cdc91bdf3d207cbeaaebbe1141257)

Conflicts:
	src/main/java/forestry/apiculture/gadgets/TileAlvearySwarmer.java
2014-12-09 01:08:14 -08:00
mezz 31574a9c6e Cleanup
(cherry picked from commit 4f95ceab29)
2014-12-09 01:03:05 -08:00
mezz cd9a4110ee Refactor out worktable canCraftRecipe logic to RecipeUtil 2014-12-08 20:26:51 -08:00
mezz 6b35ff2ba1 Improve null safety of memorized recipe isValid check
(cherry picked from commit 23ffb78ab3)
2014-12-07 16:25:01 -08:00
mezz 5133e721cc Add blacklist to worktable memory, blacklist non-empty maps
(cherry picked from commit 2cb1959421)
2014-12-07 16:18:23 -08:00
mezz 09ced92f5b Support left click drag on Worktable
(cherry picked from commit 029604222c)
2014-12-07 16:18:17 -08:00
mezz 12477a7711 Fix crash when crafting with a Map on a Worktable 2014-12-07 16:17:21 -08:00
mezz b7dc4d9144 Fix #359 Crafting with a worktable does not trigger achievements.
(cherry picked from commit c010977a0b)
2014-12-07 16:16:24 -08:00
mezz da48d317ff Fix #362 Missing Analyzer Crafting recipe
(cherry picked from commit 7ffb9d5c1d)
2014-12-07 15:32:02 -08:00
mezz 5bfb11e952 Fix #353 Alveary heater/fan energy consumption, animation
(cherry picked from commit 475d99eae8)
2014-12-07 15:30:30 -08:00
mezz 4dffb9f352 Fix biome error in Alveary
(cherry picked from commit d0244ece32)
2014-12-07 15:30:20 -08:00
mezz beadb47539 Fix #356 Worktable using the wrong wood with Shift-use all
(cherry picked from commit 0105f36668)
2014-12-07 15:30:08 -08:00
mezz 6301d3c193 Fix #357 Forestry stained glass not silk touchable
(cherry picked from commit ab3ba0c4db)
2014-12-07 15:30:02 -08:00
mezz 883863e047 Safety check for IC2 Plugin. #351
(cherry picked from commit 38009bb32a)
2014-12-07 15:29:42 -08:00
mezz 2c14f02151 Fix #352 Backpack deletion/duplication bug
(cherry picked from commit d827a0f132)
2014-12-07 15:29:07 -08:00
CovertJaguar 00771b1a42 Bump version 2014-11-30 17:22:40 -08:00
CovertJaguar 46ec2f2740 Merge branch 'dev' into release_3.3 2014-11-30 17:21:03 -08:00
mezz ac653d46c1 Fix #326 decorative leaves should not pollinate 2014-11-15 04:15:20 -08:00
mezz 63d9935d01 Minor code cleanup 2014-11-15 04:15:14 -08:00
mezz ba695b977d Fix #325 Centrifuge dupe bug 2014-11-15 04:13:46 -08:00
CovertJaguar 6b1dfb1596 Set submodules 2014-11-15 04:12:44 -08:00
CovertJaguar fff02be71d Bump version to 3.2 2014-11-08 21:40:45 -08:00
CovertJaguar 0e5b9e4957 Merge branch 'dev' into release_3.2
Conflicts:
	src/main/resources/assets/forestry/textures/blocks/storage/apatite.png
	src/main/resources/assets/forestry/textures/blocks/storage/bronze.png
	src/main/resources/assets/forestry/textures/blocks/storage/copper.png
	src/main/resources/assets/forestry/textures/blocks/storage/tin.png
2014-11-08 21:39:26 -08:00
MysteriousAges 3415030fbf Revert "Storage block textures - Apatite, Bronze, Copper, Tin."
This reverts commit c8fd93873a.
2014-10-24 20:18:30 -07:00
39 changed files with 611 additions and 840 deletions

No files matched your search

+1 -1
View File
@@ -2,4 +2,4 @@ mcversion=1.7.10
forgeversion=10.13.2.1286 forgeversion=10.13.2.1286
version_major=3 version_major=3
version_minor=5 version_minor=5
version_patch=0 version_patch=2
-5
View File
@@ -197,7 +197,6 @@ task mainJarSigned ( type: Jar, dependsOn: 'reobf' ) {
from (zipTree(jar.getArchivePath())) { from (zipTree(jar.getArchivePath())) {
exclude '**/api/**' exclude '**/api/**'
exclude '**/codechicken/**' exclude '**/codechicken/**'
exclude '**/undergroundBiomes/**'
} }
duplicatesStrategy = DuplicatesStrategy.EXCLUDE duplicatesStrategy = DuplicatesStrategy.EXCLUDE
@@ -224,7 +223,6 @@ task mainJar ( type: Zip, dependsOn: mainJarSigned ) {
from (zipTree(jar.getArchivePath())) { from (zipTree(jar.getArchivePath())) {
include '**' include '**'
exclude '**/codechicken/**' exclude '**/codechicken/**'
exclude '**/undergroundBiomes/**'
} }
duplicatesStrategy = DuplicatesStrategy.EXCLUDE duplicatesStrategy = DuplicatesStrategy.EXCLUDE
@@ -237,7 +235,6 @@ task devJarSigned ( type: Jar, dependsOn: 'classes' ) {
from(sourceSets.main.output) { from(sourceSets.main.output) {
exclude '**/api/**' exclude '**/api/**'
exclude '**/codechicken/**' exclude '**/codechicken/**'
exclude '**/undergroundBiomes/**'
} }
destinationDir = file("build/tmp") destinationDir = file("build/tmp")
@@ -263,13 +260,11 @@ task devJar ( type: Zip, dependsOn: devJarSigned ) {
from(sourceSets.main.allSource) { from(sourceSets.main.allSource) {
include '**' include '**'
exclude '**/codechicken/**' exclude '**/codechicken/**'
exclude '**/undergroundBiomes/**'
} }
from(sourceSets.main.output) { from(sourceSets.main.output) {
include '**' include '**'
exclude '**/codechicken/**' exclude '**/codechicken/**'
exclude '**/undergroundBiomes/**'
} }
duplicatesStrategy = DuplicatesStrategy.EXCLUDE duplicatesStrategy = DuplicatesStrategy.EXCLUDE
+1 -1
Submodule lang updated: c0000f0774...fa0f81998b.
@@ -1,11 +0,0 @@
package exterminatorJeff.undergroundBiomes.api;
/**
* Striped down version, get the full API from here: https://github.com/Zeno410/UndergroundBiomes1.7API
* @author Zeno410
*/
public class UBAPIHook {
public static final UBAPIHook ubAPIHook = new UBAPIHook();
//public UBDimensionalStrataColumnProvider dimensionalStrataColumnProvider; // set in the main Underground Biomes
public UBOreTexturizer ubOreTexturizer;
}
@@ -1,65 +0,0 @@
package exterminatorJeff.undergroundBiomes.api;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import net.minecraft.block.Block;
import net.minecraft.world.World;
/**
* Striped down version, get the full API from here: https://github.com/Zeno410/UndergroundBiomes1.7API
* This is an interface for the class that can create Underground Biomes versions of arbitary ores
* It creates three new blocks for each texturized ore.
* @author Zeno410
*/
public interface UBOreTexturizer {
// usage: Block is the ore block.
// Overlay name is the fully qualified name, e.g. modname:overlayName
// that static vars are fully qualified names for all the textures in the UB pack, just pass as is
// the event isn't needed per se, but if this is called anytime else, the blocks will not "stick"
public void setupUBOre(Block oreBlock, String overlayName, FMLPreInitializationEvent event);
public void setupUBOre(Block oreBlock, int metadata, String overlayName, FMLPreInitializationEvent event);
public void setupUBOre(Block oreBlock, int metadata, String overlayName, String blockName, FMLPreInitializationEvent event);
public void requestUBOreSetup(Block oreBlock, String overlayName) throws BlocksAreAlreadySet;
public void requestUBOreSetup(Block oreBlock, int metadata, String overlayName) throws BlocksAreAlreadySet;
public void requestUBOreSetup(Block oreBlock, int metadata, String overlayName, String blockName) throws BlocksAreAlreadySet;
public void redoOres(int xInBlockCoordinates, int zInBlockCoordinates, World serverSideWorld) ;
public static String amber_overlay = "undergroundbiomes:amber_overlay";
public static String cinnabar_overlay = "undergroundbiomes:cinnabar_overlay";
public static String coal_overlay = "undergroundbiomes:coal_overlay";
public static String copper_overlay = "undergroundbiomes:copper_overlay";
public static String diamond_overlay = "undergroundbiomes:diamond_overlay";
public static String emerald_overlay = "undergroundbiomes:emerald_overlay";
public static String gold_overlay = "undergroundbiomes:gold_overlay";
public static String iron_overlay = "undergroundbiomes:iron_overlay";
public static String lapis_overlay = "undergroundbiomes:lapis_overlay";
public static String lead_overlay = "undergroundbiomes:lead_overlay";
public static String olivine_peridot_overlay = "undergroundbiomes:olivine-peridot_overlay";
public static String redstone_overlay = "undergroundbiomes:redstone_overlay";
public static String ruby_overlay = "undergroundbiomes:ruby_overlay";
public static String sapphire_overlay = "undergroundbiomes:sapphire_overlay";
public static String tin_overlay = "undergroundbiomes:tin_overlay";
public static String uranium_overlay = "undergroundbiomes:uranium_overlay";
public class BlocksAreAlreadySet extends RuntimeException {
// this is thrown if UB has already run its pre-initialization step and can no longer register blocks
public final Block oreBlock;
public final String overlayName;
public BlocksAreAlreadySet(Block oreBlock, String overlayName) {
this.oreBlock = oreBlock;
this.overlayName = overlayName;
}
@Override
public String toString() {
String blockDescription = "undefined block";
String overlayDescription = "undefined overlay";
if (oreBlock != null) blockDescription = oreBlock.getUnlocalizedName();
if (overlayName != null) overlayDescription = overlayName;
return "Attempt to create Underground Biomes ore for "+blockDescription+" with "+overlayDescription +
" after blocks have already been defined";
}
}
}
+1 -1
View File
@@ -61,7 +61,7 @@ import forestry.core.utils.StringUtil;
+ "after:ExtrabiomesXL;" + "after:ExtrabiomesXL;"
+ "after:BiomesOPlenty;" + "after:BiomesOPlenty;"
+ "after:IC2@[2.0.140,);" + "after:IC2@[2.0.140,);"
+ "before:UndergroundBiomes") + "after:Natura@[2.2.0,);")
//, certificateFingerprint = Version.FINGERPRINT) //, certificateFingerprint = Version.FINGERPRINT)
public class Forestry { public class Forestry {
View File
File mode changed.
View File
File mode changed.
View File
File mode changed.
@@ -1,29 +1,29 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2011-2014 SirSengir. * Copyright (c) 2011-2014 SirSengir.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Lesser Public License v3 * are made available under the terms of the GNU Lesser Public License v3
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/lgpl-3.0.txt * http://www.gnu.org/licenses/lgpl-3.0.txt
* *
* Various Contributors including, but not limited to: * Various Contributors including, but not limited to:
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges * SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
******************************************************************************/ ******************************************************************************/
package forestry.apiculture.worldgen; package forestry.apiculture.worldgen;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.world.World; import net.minecraft.world.World;
import forestry.api.apiculture.hives.IHiveGen; import forestry.api.apiculture.hives.IHiveGen;
public abstract class HiveGen implements IHiveGen { public abstract class HiveGen implements IHiveGen {
@Override @Override
public boolean canReplace(World world, int x, int y, int z) { public boolean canReplace(World world, int x, int y, int z) {
Block block = world.getBlock(x, y, z); Block block = world.getBlock(x, y, z);
Material material = block.getMaterial(); Material material = block.getMaterial();
return (material.isReplaceable() && !material.isLiquid()) || return (material.isReplaceable() && !material.isLiquid()) ||
material == Material.air || material == Material.air ||
material == Material.plants; material == Material.plants;
} }
} }
@@ -1,31 +1,31 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2011-2014 SirSengir. * Copyright (c) 2011-2014 SirSengir.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Lesser Public License v3 * are made available under the terms of the GNU Lesser Public License v3
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/lgpl-3.0.txt * http://www.gnu.org/licenses/lgpl-3.0.txt
* *
* Various Contributors including, but not limited to: * Various Contributors including, but not limited to:
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges * SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
******************************************************************************/ ******************************************************************************/
package forestry.apiculture.worldgen; package forestry.apiculture.worldgen;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import forestry.api.apiculture.hives.IHiveGen; import forestry.api.apiculture.hives.IHiveGen;
import forestry.api.apiculture.hives.IHiveGenHelper; import forestry.api.apiculture.hives.IHiveGenHelper;
public class HiveGenHelper implements IHiveGenHelper { public class HiveGenHelper implements IHiveGenHelper {
private static final IHiveGen treeGen = new HiveGenTree(); private static final IHiveGen treeGen = new HiveGenTree();
@Override @Override
public IHiveGen ground(Block... validGroundBlocks) { public IHiveGen ground(Block... validGroundBlocks) {
return new HiveGenGround(validGroundBlocks); return new HiveGenGround(validGroundBlocks);
} }
@Override @Override
public IHiveGen tree() { public IHiveGen tree() {
return treeGen; return treeGen;
} }
} }
@@ -59,6 +59,7 @@ public class ForestryCore {
EnumErrorCode.init(); EnumErrorCode.init();
PluginManager.runSetup();
PluginManager.runPreInit(); PluginManager.runPreInit();
} }
+1 -1
View File
@@ -110,7 +110,7 @@ public class Config {
public static float getBeehivesRate() { public static float getBeehivesRate() {
return generateBeehivesRate; return generateBeehivesRate;
} }
public static boolean isExUtilEnderLilyEnabled() { public static boolean isExUtilEnderLilyEnabled() {
return ExUtilEnderLily; return ExUtilEnderLily;
} }
+114 -259
View File
@@ -225,45 +225,45 @@ public class Allele implements IAllele {
public static IAlleleButterflySpecies lepiLLacewing; public static IAlleleButterflySpecies lepiLLacewing;
// / ALL // GENERIC // / ALL // GENERIC
public static Allele boolFalse; public static final Allele boolFalse = new AlleleBoolean("boolFalse", false);
public static Allele boolTrue; public static final Allele boolTrue = new AlleleBoolean("boolTrue", true);
public static Allele int1; public static final Allele int1 = new AlleleInteger("i1d", 1, true);
public static Allele int2; public static final Allele int2 = new AlleleInteger("i2d", 2, true);
public static Allele int3; public static final Allele int3 = new AlleleInteger("i3d", 3, true);
public static Allele int4; public static final Allele int4 = new AlleleInteger("i4d", 4, true);
public static Allele int5; public static final Allele int5 = new AlleleInteger("i5d", 5, true);
public static Allele int6; public static final Allele int6 = new AlleleInteger("i6d", 6, true);
public static Allele int7; public static final Allele int7 = new AlleleInteger("i7d", 7, true);
public static Allele int8; public static final Allele int8 = new AlleleInteger("i8d", 8, true);
public static Allele int9; public static final Allele int9 = new AlleleInteger("i9d", 9, true);
public static Allele int10; public static final Allele int10 = new AlleleInteger("i10d", 10, true);
// / BEES // SPEED 1100 - 1199 // / BEES // SPEED 1100 - 1199
public static Allele speedSlowest; public static final Allele speedSlowest = new AlleleFloat("speedSlowest", 0.3f, true).setName("speed", "slowest");
public static Allele speedSlower; public static final Allele speedSlower = new AlleleFloat("speedSlower", 0.6f, true).setName("speed", "slower");
public static Allele speedSlow; public static final Allele speedSlow = new AlleleFloat("speedSlow", 0.8f, true).setName("speed", "slow");
public static Allele speedNorm; public static final Allele speedNorm = new AlleleFloat("speedNorm", 1.0f).setName("speed", "normal");
public static Allele speedFast; public static final Allele speedFast = new AlleleFloat("speedFast", 1.2f, true).setName("speed", "fast");
public static Allele speedFaster; public static final Allele speedFaster = new AlleleFloat("speedFaster", 1.4f).setName("speed", "faster");
public static Allele speedFastest; public static final Allele speedFastest = new AlleleFloat("speedFastest", 1.7f).setName("speed", "fastest");
// / BEES // LIFESPAN 1200 - 1299 // / BEES // LIFESPAN 1200 - 1299
public static Allele lifespanShortest; public static final Allele lifespanShortest = new AlleleInteger("lifespanShortest", 10, false).setName("gui.shortestlife");
public static Allele lifespanShorter; public static final Allele lifespanShorter = new AlleleInteger("lifespanShorter", 20, true).setName("gui.shorterlife");
public static Allele lifespanShort; public static final Allele lifespanShort = new AlleleInteger("lifespanShort", 30, true).setName("gui.shortlife");
public static Allele lifespanShortened; public static final Allele lifespanShortened = new AlleleInteger("lifespanShortened", 35, true).setName("gui.shortenedlife");
public static Allele lifespanNormal; public static final Allele lifespanNormal = new AlleleInteger("lifespanNormal", 40).setName("gui.normallife");
public static Allele lifespanElongated; public static final Allele lifespanElongated = new AlleleInteger("lifespanElongated", 45, true).setName("gui.elongatedlife");
public static Allele lifespanLong; public static final Allele lifespanLong = new AlleleInteger("lifespanLong", 50).setName("gui.longlife");
public static Allele lifespanLonger; public static final Allele lifespanLonger = new AlleleInteger("lifespanLonger", 60).setName("gui.longerlife");
public static Allele lifespanLongest; public static final Allele lifespanLongest = new AlleleInteger("lifespanLongest", 70).setName("gui.longestlife");
// / BEES // FERTILITY 1300 - 1349 // / BEES // FERTILITY 1300 - 1349
public static Allele fertilityLow; public static final Allele fertilityLow = new AlleleInteger("fertilityLow", 1, true);
public static Allele fertilityNormal; public static final Allele fertilityNormal = new AlleleInteger("fertilityNormal", 2, true);
public static Allele fertilityHigh; public static final Allele fertilityHigh = new AlleleInteger("fertilityHigh", 3);
public static Allele fertilityMaximum; public static final Allele fertilityMaximum = new AlleleInteger("fertilityMaximum", 4);
// / TREES // GROWTH PROVIDER 1350 - 1399 // / TREES // GROWTH PROVIDER 1350 - 1399
public static IAlleleGrowth growthLightlevel; public static IAlleleGrowth growthLightlevel;
@@ -285,41 +285,41 @@ public class Allele implements IAllele {
public static IAlleleFruit fruitJujube; public static IAlleleFruit fruitJujube;
// / TREES // HEIGHT 1400 - 1449 // / TREES // HEIGHT 1400 - 1449
public static Allele heightSmallest; public static final Allele heightSmallest = new AlleleFloat("heightSmallest", 0.25f).setName("height", "smallest");
public static Allele heightSmaller; public static final Allele heightSmaller = new AlleleFloat("heightSmaller", 0.5f).setName("height", "smaller");
public static Allele heightSmall; public static final Allele heightSmall = new AlleleFloat("heightSmall", 0.75f).setName("height", "small");
public static Allele heightAverage; public static final Allele heightAverage = new AlleleFloat("heightMax10", 1.0f).setName("height", "average");
public static Allele heightLarge; public static final Allele heightLarge = new AlleleFloat("heightLarge", 1.25f).setName("height", "large");
public static Allele heightLarger; public static final Allele heightLarger = new AlleleFloat("heightLarger", 1.5f).setName("height", "larger");
public static Allele heightLargest; public static final Allele heightLargest = new AlleleFloat("heightLargest", 1.75f).setName("height", "largest");
public static Allele heightGigantic; public static final Allele heightGigantic = new AlleleFloat("heightGigantic", 2.0f).setName("height", "gigantic");
/// BUTTERFLIES // SIZE /// BUTTERFLIES // SIZE
public static Allele sizeSmallest; public static final Allele sizeSmallest = new AlleleFloat("sizeSmallest", 0.3f).setName("size", "smallest");
public static Allele sizeSmaller; public static final Allele sizeSmaller = new AlleleFloat("sizeSmaller", 0.4f).setName("size", "smaller");
public static Allele sizeSmall; public static final Allele sizeSmall = new AlleleFloat("sizeSmall", 0.5f).setName("size", "small");
public static Allele sizeAverage; public static final Allele sizeAverage = new AlleleFloat("sizeAverage", 0.6f).setName("size", "average");
public static Allele sizeLarge; public static final Allele sizeLarge = new AlleleFloat("sizeLarge", 0.75f).setName("size", "large");
public static Allele sizeLarger; public static final Allele sizeLarger = new AlleleFloat("sizeLarger", 0.9f).setName("size", "larger");
public static Allele sizeLargest; public static final Allele sizeLargest = new AlleleFloat("sizeLargest", 1.0f).setName("size", "largest");
// / BOTH // TOLERANCE 1450 - 1499 // / BOTH // TOLERANCE 1450 - 1499
public static Allele toleranceNone; public static final Allele toleranceNone = new AlleleTolerance("toleranceNone", EnumTolerance.NONE);
public static Allele toleranceBoth1; public static final Allele toleranceBoth1 = new AlleleTolerance("toleranceBoth1", EnumTolerance.BOTH_1, true);
public static Allele toleranceBoth2; public static final Allele toleranceBoth2 = new AlleleTolerance("toleranceBoth2", EnumTolerance.BOTH_2);
public static Allele toleranceBoth3; public static final Allele toleranceBoth3 = new AlleleTolerance("toleranceBoth3", EnumTolerance.BOTH_3);
public static Allele toleranceBoth4; public static final Allele toleranceBoth4 = new AlleleTolerance("toleranceBoth4", EnumTolerance.BOTH_4);
public static Allele toleranceBoth5; public static final Allele toleranceBoth5 = new AlleleTolerance("toleranceBoth5", EnumTolerance.BOTH_5);
public static Allele toleranceUp1; public static final Allele toleranceUp1 = new AlleleTolerance("toleranceUp1", EnumTolerance.UP_1, true);
public static Allele toleranceUp2; public static final Allele toleranceUp2 = new AlleleTolerance("toleranceUp2", EnumTolerance.UP_2);
public static Allele toleranceUp3; public static final Allele toleranceUp3 = new AlleleTolerance("toleranceUp3", EnumTolerance.UP_3);
public static Allele toleranceUp4; public static final Allele toleranceUp4 = new AlleleTolerance("toleranceUp4", EnumTolerance.UP_4);
public static Allele toleranceUp5; public static final Allele toleranceUp5 = new AlleleTolerance("toleranceUp5", EnumTolerance.UP_5);
public static Allele toleranceDown1; public static final Allele toleranceDown1 = new AlleleTolerance("toleranceDown1", EnumTolerance.DOWN_1, true);
public static Allele toleranceDown2; public static final Allele toleranceDown2 = new AlleleTolerance("toleranceDown2", EnumTolerance.DOWN_2);
public static Allele toleranceDown3; public static final Allele toleranceDown3 = new AlleleTolerance("toleranceDown3", EnumTolerance.DOWN_3);
public static Allele toleranceDown4; public static final Allele toleranceDown4 = new AlleleTolerance("toleranceDown4", EnumTolerance.DOWN_4);
public static Allele toleranceDown5; public static final Allele toleranceDown5 = new AlleleTolerance("toleranceDown5", EnumTolerance.DOWN_5);
// / BEES // FLOWER PROVIDERS 1500 - 1599 // / BEES // FLOWER PROVIDERS 1500 - 1599
public static Allele flowersVanilla; public static Allele flowersVanilla;
@@ -333,56 +333,56 @@ public class Allele implements IAllele {
public static Allele flowersGourd; public static Allele flowersGourd;
// / TREES // FERTILITY 1600 - 1649 // / TREES // FERTILITY 1600 - 1649
public static Allele saplingsLowest; public static final Allele saplingsLowest = new AlleleFloat("saplingsLowest", 0.01f, true).setName("saplings", "lowest");
public static Allele saplingsLower; public static final Allele saplingsLower = new AlleleFloat("saplingsLower", 0.025f, true).setName("saplings", "lower");
public static Allele saplingsLow; public static final Allele saplingsLow = new AlleleFloat("saplingsLow", 0.035f, true).setName("saplings", "low");
public static Allele saplingsAverage; public static final Allele saplingsAverage = new AlleleFloat("saplingsDefault", 0.05f, true).setName("saplings", "average");
public static Allele saplingsHigh; public static final Allele saplingsHigh = new AlleleFloat("saplingsDouble", 0.1f, true).setName("saplings", "high");
public static Allele saplingsHigher; public static final Allele saplingsHigher = new AlleleFloat("saplingsTriple", 0.2f, true).setName("saplings", "higher");
public static Allele saplingsHighest; public static final Allele saplingsHighest = new AlleleFloat("saplingsHighest", 0.3f, true).setName("saplings", "highest");
// / TREES // YIELD 1650 - 1699 // / TREES // YIELD 1650 - 1699
public static Allele yieldLowest; public static final Allele yieldLowest = new AlleleFloat("yieldLowest", 0.025f, true).setName("yield", "lowest");
public static Allele yieldLower; public static final Allele yieldLower = new AlleleFloat("yieldLower", 0.05f, true).setName("yield", "lower");
public static Allele yieldLow; public static final Allele yieldLow = new AlleleFloat("yieldLow", 0.1f, true).setName("yield", "low");
public static Allele yieldAverage; public static final Allele yieldAverage = new AlleleFloat("yieldDefault", 0.2f, true).setName("yield", "average");
public static Allele yieldHigh; public static final Allele yieldHigh = new AlleleFloat("yieldHigh", 0.3f, false).setName("yield", "high");
public static Allele yieldHigher; public static final Allele yieldHigher = new AlleleFloat("yieldHigher", 0.35f, false).setName("yield", "higher");
public static Allele yieldHighest; public static final Allele yieldHighest = new AlleleFloat("yieldHighest", 0.4f, false).setName("yield", "highest");
// TREES // SAPPINESS // TREES // SAPPINESS
public static Allele sappinessLowest; public static final Allele sappinessLowest = new AlleleFloat("sappinessLowest", 0.1f, true).setName("sappiness", "lowest");
public static Allele sappinessLower; public static final Allele sappinessLower = new AlleleFloat("sappinessLower", 0.2f, true).setName("sappiness", "lower");
public static Allele sappinessLow; public static final Allele sappinessLow = new AlleleFloat("sappinessLow", 0.3f, true).setName("sappiness", "low");
public static Allele sappinessAverage; public static final Allele sappinessAverage = new AlleleFloat("sappinessAverage", 0.4f, true).setName("sappiness", "average");
public static Allele sappinessHigh; public static final Allele sappinessHigh = new AlleleFloat("sappinessHigh", 0.6f, true).setName("sappiness", "high");
public static Allele sappinessHigher; public static final Allele sappinessHigher = new AlleleFloat("sappinessHigher", 0.8f, false).setName("sappiness", "higher");
public static Allele sappinessHighest; public static final Allele sappinessHighest = new AlleleFloat("sappinessHighest", 1.0f, false).setName("sappiness", "highest");
// TREES // MATURATION TIME // TREES // MATURATION TIME
public static Allele maturationSlowest; public static final Allele maturationSlowest = new AlleleInteger("maturationSlowest", 10, true).setName("maturity", "slowest");
public static Allele maturationSlower; public static final Allele maturationSlower = new AlleleInteger("maturationSlower", 7).setName("maturity", "slower");
public static Allele maturationSlow; public static final Allele maturationSlow = new AlleleInteger("maturationSlow", 5, true).setName("maturity", "slow");
public static Allele maturationAverage; public static final Allele maturationAverage = new AlleleInteger("maturationAverage", 4).setName("maturity", "average");
public static Allele maturationFast; public static final Allele maturationFast = new AlleleInteger("maturationFast", 3).setName("maturity", "fast");
public static Allele maturationFaster; public static final Allele maturationFaster = new AlleleInteger("maturationFaster", 2).setName("maturity", "faster");
public static Allele maturationFastest; public static final Allele maturationFastest = new AlleleInteger("maturationFastest", 1).setName("maturity", "fastest");
// / BEES // FLOWER GROWTH 1700 - 1749 // / BEES // FLOWER GROWTH 1700 - 1749
public static Allele floweringSlowest; public static final Allele floweringSlowest = new AlleleInteger("floweringSlowest", 5, true).setName("flowering", "slowest");
public static Allele floweringSlower; public static final Allele floweringSlower = new AlleleInteger("floweringSlower", 10).setName("flowering", "slower");
public static Allele floweringSlow; public static final Allele floweringSlow = new AlleleInteger("floweringSlow", 15).setName("flowering", "slow");
public static Allele floweringAverage; public static final Allele floweringAverage = new AlleleInteger("floweringAverage", 20).setName("flowering", "average");
public static Allele floweringFast; public static final Allele floweringFast = new AlleleInteger("floweringFast", 25).setName("flowering", "fast");
public static Allele floweringFaster; public static final Allele floweringFaster = new AlleleInteger("floweringFaster", 30).setName("flowering", "faster");
public static Allele floweringFastest; public static final Allele floweringFastest = new AlleleInteger("floweringFastest", 35).setName("flowering", "fastest");
public static Allele floweringMaximum; public static final Allele floweringMaximum = new AlleleInteger("floweringMaximum", 99, true).setName("flowering", "maximum");
// / BOTH // TERRITORY 1750 - 1799 // / BOTH // TERRITORY 1750 - 1799
public static Allele territoryDefault; public static final Allele territoryDefault = new AlleleArea("territoryDefault", new int[]{9, 6, 9}).setName("territory", "average");
public static Allele territoryLarge; public static final Allele territoryLarge = new AlleleArea("territoryLarge", new int[]{11, 8, 11}).setName("territory", "large");
public static Allele territoryLarger; public static final Allele territoryLarger = new AlleleArea("territoryLarger", new int[]{13, 12, 13}).setName("territory", "larger");
public static Allele territoryLargest; public static final Allele territoryLargest = new AlleleArea("territoryLargest", new int[]{15, 13, 15}).setName("territory", "largest");
// / BEES // EFFECTS 1800 - 1899 // / BEES // EFFECTS 1800 - 1899
public static Allele effectNone; public static Allele effectNone;
@@ -412,164 +412,20 @@ public class Allele implements IAllele {
public static Allele butterflyNone; public static Allele butterflyNone;
// These are "secondary" plant attributes, i.e. the tree can double as one. // These are "secondary" plant attributes, i.e. the tree can double as one.
public static Allele plantTypeNone; public static final Allele plantTypeNone = new AllelePlantType("plantTypeNone", EnumSet.noneOf(EnumPlantType.class), true);
public static Allele plantTypePlains; public static final Allele plantTypePlains = new AllelePlantType("plantTypePlains", EnumPlantType.Plains);
public static Allele plantTypeDesert; public static final Allele plantTypeDesert = new AllelePlantType("plantTypeDesert", EnumPlantType.Desert);
public static Allele plantTypeBeach; public static final Allele plantTypeBeach = new AllelePlantType("plantTypeBeach", EnumPlantType.Beach);
public static Allele plantTypeCave; public static final Allele plantTypeCave = new AllelePlantType("plantTypeCave", EnumPlantType.Cave);
public static Allele plantTypeWater; public static final Allele plantTypeWater = new AllelePlantType("plantTypeWater", EnumPlantType.Water);
public static Allele plantTypeNether; public static final Allele plantTypeNether = new AllelePlantType("plantTypeNether", EnumPlantType.Nether);
public static Allele plantTypeCrop; public static final Allele plantTypeCrop = new AllelePlantType("plantTypeCrop", EnumPlantType.Crop);
// / TREES // FIREPROOF // / TREES // FIREPROOF
public static Allele fireproofFalse; public static final Allele fireproofFalse = new AlleleBoolean("fireproofFalse", false);
public static Allele fireproofTrue; public static final Allele fireproofTrue = new AlleleBoolean("fireproofTrue", true);
public static void initialize() {
// ALL // GENERIC
boolFalse = new AlleleBoolean("boolFalse", false);
boolTrue = new AlleleBoolean("boolTrue", true);
int1 = new AlleleInteger("i1d", 1, true);
int2 = new AlleleInteger("i2d", 2, true);
int3 = new AlleleInteger("i3d", 3, true);
int4 = new AlleleInteger("i4d", 4, true);
int5 = new AlleleInteger("i5d", 5, true);
int6 = new AlleleInteger("i6d", 6, true);
int7 = new AlleleInteger("i7d", 7, true);
int8 = new AlleleInteger("i8d", 8, true);
int9 = new AlleleInteger("i9d", 9, true);
int10 = new AlleleInteger("i10d", 10, true);
// BEES // SPEED
speedSlowest = new AlleleFloat("speedSlowest", 0.3f, true).setName("speed", "slowest");
speedSlower = new AlleleFloat("speedSlower", 0.6f, true).setName("speed", "slower");
speedSlow = new AlleleFloat("speedSlow", 0.8f, true).setName("speed", "slow");
speedNorm = new AlleleFloat("speedNorm", 1.0f).setName("speed", "normal");
speedFast = new AlleleFloat("speedFast", 1.2f, true).setName("speed", "fast");
speedFaster = new AlleleFloat("speedFaster", 1.4f).setName("speed", "faster");
speedFastest = new AlleleFloat("speedFastest", 1.7f).setName("speed", "fastest");
// BEES // LIFESPAN
lifespanShortest = new AlleleInteger("lifespanShortest", 10, false).setName("gui.shortestlife");
lifespanShorter = new AlleleInteger("lifespanShorter", 20, true).setName("gui.shorterlife");
lifespanShort = new AlleleInteger("lifespanShort", 30, true).setName("gui.shortlife");
lifespanShortened = new AlleleInteger("lifespanShortened", 35, true).setName("gui.shortenedlife");
lifespanNormal = new AlleleInteger("lifespanNormal", 40).setName("gui.normallife");
lifespanElongated = new AlleleInteger("lifespanElongated", 45, true).setName("gui.elongatedlife");
lifespanLong = new AlleleInteger("lifespanLong", 50).setName("gui.longlife");
lifespanLonger = new AlleleInteger("lifespanLonger", 60).setName("gui.longerlife");
lifespanLongest = new AlleleInteger("lifespanLongest", 70).setName("gui.longestlife");
// BEES // FERTILITY
fertilityLow = new AlleleInteger("fertilityLow", 1, true);
fertilityNormal = new AlleleInteger("fertilityNormal", 2, true);
fertilityHigh = new AlleleInteger("fertilityHigh", 3);
fertilityMaximum = new AlleleInteger("fertilityMaximum", 4);
// TREES // HEIGHT
heightSmallest = new AlleleFloat("heightSmallest", 0.25f).setName("height", "smallest");
heightSmaller = new AlleleFloat("heightSmaller", 0.5f).setName("height", "smaller");
heightSmall = new AlleleFloat("heightSmall", 0.75f).setName("height", "small");
heightAverage = new AlleleFloat("heightMax10", 1.0f).setName("height", "average");
heightLarge = new AlleleFloat("heightLarge", 1.25f).setName("height", "large");
heightLarger = new AlleleFloat("heightLarger", 1.5f).setName("height", "larger");
heightLargest = new AlleleFloat("heightLargest", 1.75f).setName("height", "largest");
heightGigantic = new AlleleFloat("heightGigantic", 2.0f).setName("height", "gigantic");
// BUTTERFLIES // SIZE
sizeSmallest = new AlleleFloat("sizeSmallest", 0.3f).setName("size", "smallest");
sizeSmaller = new AlleleFloat("sizeSmaller", 0.4f).setName("size", "smaller");
sizeSmall = new AlleleFloat("sizeSmall", 0.5f).setName("size", "small");
sizeAverage = new AlleleFloat("sizeAverage", 0.6f).setName("size", "average");
sizeLarge = new AlleleFloat("sizeLarge", 0.75f).setName("size", "large");
sizeLarger = new AlleleFloat("sizeLarger", 0.9f).setName("size", "larger");
sizeLargest = new AlleleFloat("sizeLargest", 1.0f).setName("size", "largest");
// BEES // TOLERANCE
toleranceNone = new AlleleTolerance("toleranceNone", EnumTolerance.NONE);
toleranceBoth1 = new AlleleTolerance("toleranceBoth1", EnumTolerance.BOTH_1, true);
toleranceBoth2 = new AlleleTolerance("toleranceBoth2", EnumTolerance.BOTH_2);
toleranceBoth3 = new AlleleTolerance("toleranceBoth3", EnumTolerance.BOTH_3);
toleranceBoth4 = new AlleleTolerance("toleranceBoth4", EnumTolerance.BOTH_4);
toleranceBoth5 = new AlleleTolerance("toleranceBoth5", EnumTolerance.BOTH_5);
toleranceUp1 = new AlleleTolerance("toleranceUp1", EnumTolerance.UP_1, true);
toleranceUp2 = new AlleleTolerance("toleranceUp2", EnumTolerance.UP_2);
toleranceUp3 = new AlleleTolerance("toleranceUp3", EnumTolerance.UP_3);
toleranceUp4 = new AlleleTolerance("toleranceUp4", EnumTolerance.UP_4);
toleranceUp5 = new AlleleTolerance("toleranceUp5", EnumTolerance.UP_5);
toleranceDown1 = new AlleleTolerance("toleranceDown1", EnumTolerance.DOWN_1, true);
toleranceDown2 = new AlleleTolerance("toleranceDown2", EnumTolerance.DOWN_2);
toleranceDown3 = new AlleleTolerance("toleranceDown3", EnumTolerance.DOWN_3);
toleranceDown4 = new AlleleTolerance("toleranceDown4", EnumTolerance.DOWN_4);
toleranceDown5 = new AlleleTolerance("toleranceDown5", EnumTolerance.DOWN_5);
// TREES // FERTILITY
saplingsLowest = new AlleleFloat("saplingsLowest", 0.01f, true).setName("saplings", "lowest");
saplingsLower = new AlleleFloat("saplingsLower", 0.025f, true).setName("saplings", "lower");
saplingsLow = new AlleleFloat("saplingsLow", 0.035f, true).setName("saplings", "low");
saplingsAverage = new AlleleFloat("saplingsDefault", 0.05f, true).setName("saplings", "average");
saplingsHigh = new AlleleFloat("saplingsDouble", 0.1f, true).setName("saplings", "high");
saplingsHigher = new AlleleFloat("saplingsTriple", 0.2f, true).setName("saplings", "higher");
saplingsHighest = new AlleleFloat("saplingsHighest", 0.3f, true).setName("saplings", "highest");
// TREES // YIELD
yieldLowest = new AlleleFloat("yieldLowest", 0.025f, true).setName("yield", "lowest");
yieldLower = new AlleleFloat("yieldLower", 0.05f, true).setName("yield", "lower");
yieldLow = new AlleleFloat("yieldLow", 0.1f, true).setName("yield", "low");
yieldAverage = new AlleleFloat("yieldDefault", 0.2f, true).setName("yield", "average");
yieldHigh = new AlleleFloat("yieldHigh", 0.3f, false).setName("yield", "high");
yieldHigher = new AlleleFloat("yieldHigher", 0.35f, false).setName("yield", "higher");
yieldHighest = new AlleleFloat("yieldHighest", 0.4f, false).setName("yield", "highest");
// TREES // SAPPINESS
sappinessLowest = new AlleleFloat("sappinessLowest", 0.1f, true).setName("sappiness", "lowest");
sappinessLower = new AlleleFloat("sappinessLower", 0.2f, true).setName("sappiness", "lower");
sappinessLow = new AlleleFloat("sappinessLow", 0.3f, true).setName("sappiness", "low");
sappinessAverage = new AlleleFloat("sappinessAverage", 0.4f, true).setName("sappiness", "average");
sappinessHigh = new AlleleFloat("sappinessHigh", 0.6f, true).setName("sappiness", "high");
sappinessHigher = new AlleleFloat("sappinessHigher", 0.8f, false).setName("sappiness", "higher");
sappinessHighest = new AlleleFloat("sappinessHighest", 1.0f, false).setName("sappiness", "highest");
// TREES // MATURATION TIME
maturationSlowest = new AlleleInteger("maturationSlowest", 10, true).setName("maturity", "slowest");
maturationSlower = new AlleleInteger("maturationSlower", 7).setName("maturity", "slower");
maturationSlow = new AlleleInteger("maturationSlow", 5, true).setName("maturity", "slow");
maturationAverage = new AlleleInteger("maturationAverage", 4).setName("maturity", "average");
maturationFast = new AlleleInteger("maturationFast", 3).setName("maturity", "fast");
maturationFaster = new AlleleInteger("maturationFaster", 2).setName("maturity", "faster");
maturationFastest = new AlleleInteger("maturationFastest", 1).setName("maturity", "fastest");
// BEES // FLOWER GROWTH
floweringSlowest = new AlleleInteger("floweringSlowest", 5, true).setName("flowering", "slowest");
floweringSlower = new AlleleInteger("floweringSlower", 10).setName("flowering", "slower");
floweringSlow = new AlleleInteger("floweringSlow", 15).setName("flowering", "slow");
floweringAverage = new AlleleInteger("floweringAverage", 20).setName("flowering", "average");
floweringFast = new AlleleInteger("floweringFast", 25).setName("flowering", "fast");
floweringFaster = new AlleleInteger("floweringFaster", 30).setName("flowering", "faster");
floweringFastest = new AlleleInteger("floweringFastest", 35).setName("flowering", "fastest");
floweringMaximum = new AlleleInteger("floweringMaximum", 99, true).setName("flowering", "maximum");
// BOTH // TERRITORY
territoryDefault = new AlleleArea("territoryDefault", new int[]{9, 6, 9}).setName("territory", "average");
territoryLarge = new AlleleArea("territoryLarge", new int[]{11, 8, 11}).setName("territory", "large");
territoryLarger = new AlleleArea("territoryLarger", new int[]{13, 12, 13}).setName("territory", "larger");
territoryLargest = new AlleleArea("territoryLargest", new int[]{15, 13, 15}).setName("territory", "largest");
// TREES // PLANTS
plantTypeNone = new AllelePlantType("plantTypeNone", EnumSet.noneOf(EnumPlantType.class), true);
plantTypePlains = new AllelePlantType("plantTypePlains", EnumPlantType.Plains);
plantTypeDesert = new AllelePlantType("plantTypeDesert", EnumPlantType.Desert);
plantTypeBeach = new AllelePlantType("plantTypeBeach", EnumPlantType.Beach);
plantTypeCave = new AllelePlantType("plantTypeCave", EnumPlantType.Cave);
plantTypeWater = new AllelePlantType("plantTypeWater", EnumPlantType.Water);
plantTypeNether = new AllelePlantType("plantTypeNether", EnumPlantType.Nether);
plantTypeCrop = new AllelePlantType("plantTypeCrop", EnumPlantType.Crop);
fireproofFalse = new AlleleBoolean("fireproofFalse", false);
fireproofTrue = new AlleleBoolean("fireproofTrue", true);
public static void setupLegacyAPI() {
// LEGACY MAPPINGS // LEGACY MAPPINGS
ILegacyHandler legacy = (ILegacyHandler) AlleleManager.alleleRegistry; ILegacyHandler legacy = (ILegacyHandler) AlleleManager.alleleRegistry;
@@ -703,7 +559,6 @@ public class Allele implements IAllele {
legacy.registerLegacyMapping(1751, "forestry.territoryLarge"); legacy.registerLegacyMapping(1751, "forestry.territoryLarge");
legacy.registerLegacyMapping(1752, "forestry.territoryLarger"); legacy.registerLegacyMapping(1752, "forestry.territoryLarger");
legacy.registerLegacyMapping(1753, "forestry.territoryLargest"); legacy.registerLegacyMapping(1753, "forestry.territoryLargest");
} }
@Override @Override
View File
File mode changed.
@@ -42,7 +42,7 @@ public class BlockUtil {
if (!(tile instanceof IEnergyReceiver)) { if (!(tile instanceof IEnergyReceiver)) {
return false; return false;
} }
IEnergyReceiver receptor = (IEnergyReceiver) tile; IEnergyReceiver receptor = (IEnergyReceiver) tile;
return receptor.canConnectEnergy(side); return receptor.canConnectEnergy(side);
} }
View File
File mode changed.
View File
File mode changed.
@@ -41,10 +41,13 @@ public abstract class ForestryPlugin {
return EnumSet.of(PluginManager.Module.CORE); return EnumSet.of(PluginManager.Module.CORE);
} }
protected void preInit() { protected void setupAPI() {
} }
protected void disabledPreInit() { protected void disabledSetupAPI() {
}
protected void preInit() {
} }
protected void doInit() { protected void doInit() {
@@ -53,9 +56,6 @@ public abstract class ForestryPlugin {
protected void postInit() { protected void postInit() {
} }
protected void disabledPostInit() {
}
public boolean processIMCMessage(IMCMessage message) { public boolean processIMCMessage(IMCMessage message) {
return false; return false;
} }
@@ -101,6 +101,9 @@ public abstract class ForestryPlugin {
protected void registerItems() { protected void registerItems() {
} }
protected void registerTriggers() {
}
protected void registerBackpackItems() { protected void registerBackpackItems() {
} }
@@ -188,12 +188,10 @@ public class PluginApiculture extends ForestryPlugin {
public static MachineDefinition definitionBeehouse; public static MachineDefinition definitionBeehouse;
public static MachineDefinition definitionAnalyzer; public static MachineDefinition definitionAnalyzer;
@SuppressWarnings({"unchecked", "rawtypes"})
@Override @Override
public void preInit() { @SuppressWarnings({"unchecked", "rawtypes"})
super.preInit(); protected void setupAPI() {
super.setupAPI();
MinecraftForge.EVENT_BUS.register(this);
HiveManager.hiveRegistry = hiveRegistry = new HiveRegistry(); HiveManager.hiveRegistry = hiveRegistry = new HiveRegistry();
HiveManager.genHelper = new HiveGenHelper(); HiveManager.genHelper = new HiveGenHelper();
@@ -201,6 +199,25 @@ public class PluginApiculture extends ForestryPlugin {
FlowerManager.flowerRegistry = new FlowerRegistry(); 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.registerBlock(new BlockBase(Material.iron), ItemForestryBlock.class, "apiculture");
ForestryBlock.apiculture.block().setCreativeTab(Tabs.tabApiculture); ForestryBlock.apiculture.block().setCreativeTab(Tabs.tabApiculture);
ForestryBlock.apiculture.block().setHarvestLevel("axe", 0); ForestryBlock.apiculture.block().setHarvestLevel("axe", 0);
@@ -240,10 +257,6 @@ public class PluginApiculture extends ForestryPlugin {
ForestryBlock.beehives.registerBlock(new BlockBeehives(), ItemForestryBlock.class, "beehives"); 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 // Candles
ForestryBlock.candle.registerBlock(new BlockCandle(), ItemCandleBlock.class, "candle"); ForestryBlock.candle.registerBlock(new BlockCandle(), ItemCandleBlock.class, "candle");
ForestryBlock.stump.registerBlock(new BlockStump(), ItemForestryBlock.class, "stump"); ForestryBlock.stump.registerBlock(new BlockStump(), ItemForestryBlock.class, "stump");
@@ -262,13 +275,6 @@ public class PluginApiculture extends ForestryPlugin {
VillageHandlerApiculture.registerVillageComponents(); 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 // Commands
PluginCore.rootCommand.addChildCommand(new CommandBee()); PluginCore.rootCommand.addChildCommand(new CommandBee());
} }
@@ -428,10 +434,6 @@ public class PluginApiculture extends ForestryPlugin {
ForestryItem.scoop.item().setHarvestLevel("scoop", 3); ForestryItem.scoop.item().setHarvestLevel("scoop", 3);
} }
@Override
protected void registerBackpackItems() {
}
@Override @Override
protected void registerCrates() { protected void registerCrates() {
ICrateRegistry crateRegistry = StorageManager.crateRegistry; ICrateRegistry crateRegistry = StorageManager.crateRegistry;
@@ -703,7 +705,7 @@ public class PluginApiculture extends ForestryPlugin {
definitionChest.register(); definitionChest.register();
} }
public IRecipe[] createAlyzerRecipes(Block block, int meta) { public static IRecipe[] createAlyzerRecipes(Block block, int meta) {
ArrayList<IRecipe> recipes = new ArrayList<IRecipe>(); 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.beealyzer, 'X', "ingotBronze"));
recipes.add(ShapedRecipeCustom.createShapedRecipe(new ItemStack(block, 1, meta), "XTX", " Y ", "X X", 'Y', ForestryItem.sturdyCasing, 'T', ForestryItem.treealyzer, '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)); swampDrops.add(new HiveDrop(BeeTemplates.getValiantTemplate(), new ItemStack[]{ForestryItem.beeComb.getItemStack(1, 15)}, 3));
} }
private void registerDungeonLoot() { private static void registerDungeonLoot() {
int rarity; int rarity;
if (Config.dungeonLootRare) { if (Config.dungeonLootRare) {
rarity = 5; 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)); 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)); IBee bee = new Bee(PluginApiculture.beeInterface.templateAsGenome(template));
ItemStack beeItem; ItemStack beeItem;
switch (beeType) { switch (beeType) {
@@ -810,7 +812,7 @@ public class PluginApiculture extends ForestryPlugin {
BeeManager.hiveDrops[7] = swarmDrops; BeeManager.hiveDrops[7] = swarmDrops;
} }
private void createHives() { private static void createHives() {
hiveRegistry.registerHive(HiveRegistry.forest, HiveDescription.FOREST); hiveRegistry.registerHive(HiveRegistry.forest, HiveDescription.FOREST);
hiveRegistry.registerHive(HiveRegistry.meadows, HiveDescription.MEADOWS); hiveRegistry.registerHive(HiveRegistry.meadows, HiveDescription.MEADOWS);
hiveRegistry.registerHive(HiveRegistry.desert, HiveDescription.DESERT); hiveRegistry.registerHive(HiveRegistry.desert, HiveDescription.DESERT);
@@ -830,7 +832,7 @@ public class PluginApiculture extends ForestryPlugin {
hiveRegistry.addDrops(HiveRegistry.swamp, swampDrops); hiveRegistry.addDrops(HiveRegistry.swamp, swampDrops);
} }
private void createAlleles() { private static void createAlleles() {
IClassification hymnoptera = AlleleManager.alleleRegistry.createAndRegisterClassification(EnumClassLevel.ORDER, "hymnoptera", "Hymnoptera"); IClassification hymnoptera = AlleleManager.alleleRegistry.createAndRegisterClassification(EnumClassLevel.ORDER, "hymnoptera", "Hymnoptera");
AlleleManager.alleleRegistry.getClassification("class.insecta").addMemberGroup(hymnoptera); AlleleManager.alleleRegistry.getClassification("class.insecta").addMemberGroup(hymnoptera);
@@ -194,6 +194,21 @@ public class PluginArboriculture extends ForestryPlugin {
ForestryBlock.fences1, ForestryBlock.fences1,
ForestryBlock.fences2); 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 @Override
public void preInit() { public void preInit() {
super.preInit(); super.preInit();
@@ -290,15 +305,9 @@ public class PluginArboriculture extends ForestryPlugin {
'Y', Blocks.chest)) 'Y', Blocks.chest))
.setFaces(0, 1, 2, 3, 4, 4, 0, 7)); .setFaces(0, 1, 2, 3, 4, 4, 0, 7));
// Init tree interface
AlleleManager.alleleRegistry.registerSpeciesRoot(PluginArboriculture.treeInterface = new TreeHelper());
// Init rendering // Init rendering
proxy.initializeRendering(); proxy.initializeRendering();
// Create alleles
createAlleles();
// Register vanilla and forestry fence ids // Register vanilla and forestry fence ids
validFences.add(ForestryBlock.fences1.block()); validFences.add(ForestryBlock.fences1.block());
validFences.add(ForestryBlock.fences2.block()); validFences.add(ForestryBlock.fences2.block());
@@ -306,15 +315,14 @@ public class PluginArboriculture extends ForestryPlugin {
validFences.add(Blocks.fence_gate); validFences.add(Blocks.fence_gate);
validFences.add(Blocks.nether_brick_fence); 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 // Commands
PluginCore.rootCommand.addChildCommand(new CommandTree()); PluginCore.rootCommand.addChildCommand(new CommandTree());
// Create alleles
createAlleles();
createMutations();
registerTemplates();
registerErsatzGenomes();
} }
@Override @Override
@@ -327,10 +335,6 @@ public class PluginArboriculture extends ForestryPlugin {
GameRegistry.registerTileEntity(TileFruitPod.class, "forestry.Pods"); GameRegistry.registerTileEntity(TileFruitPod.class, "forestry.Pods");
definitionChest.register(); definitionChest.register();
createMutations();
registerTemplates();
registerErsatzGenomes();
MinecraftForge.EVENT_BUS.register(new EventHandlerArboriculture()); MinecraftForge.EVENT_BUS.register(new EventHandlerArboriculture());
if (Config.enableVillager) { if (Config.enableVillager) {
@@ -590,7 +594,7 @@ public class PluginArboriculture extends ForestryPlugin {
Proxies.common.addRecipe(ForestryItem.grafter.getItemStack(), " B", " # ", "# ", 'B', "ingotBronze", '#', Items.stick); Proxies.common.addRecipe(ForestryItem.grafter.getItemStack(), " B", " # ", "# ", 'B', "ingotBronze", '#', Items.stick);
} }
private void createAlleles() { private static void createAlleles() {
// Divisions // Divisions
IClassification angiosperms = AlleleManager.alleleRegistry.createAndRegisterClassification( 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.getOakTemplate());
treeInterface.registerTemplate(TreeTemplates.getBirchTemplate()); treeInterface.registerTemplate(TreeTemplates.getBirchTemplate());
treeInterface.registerTemplate(TreeTemplates.getSpruceTemplate()); treeInterface.registerTemplate(TreeTemplates.getSpruceTemplate());
@@ -1084,7 +1088,7 @@ public class PluginArboriculture extends ForestryPlugin {
treeInterface.registerTemplate(TreeTemplates.getDateTemplate()); treeInterface.registerTemplate(TreeTemplates.getDateTemplate());
} }
private void registerErsatzGenomes() { private static void registerErsatzGenomes() {
AlleleManager.ersatzSpecimen.put(new ItemStack(Blocks.leaves, 1, 0), new Tree( AlleleManager.ersatzSpecimen.put(new ItemStack(Blocks.leaves, 1, 0), new Tree(
TreeTemplates.templateAsGenome(TreeTemplates.getOakTemplate()))); TreeTemplates.templateAsGenome(TreeTemplates.getOakTemplate())));
AlleleManager.ersatzSpecimen.put(new ItemStack(Blocks.leaves, 1, 1), new Tree( AlleleManager.ersatzSpecimen.put(new ItemStack(Blocks.leaves, 1, 1), new Tree(
@@ -1112,7 +1116,7 @@ public class PluginArboriculture extends ForestryPlugin {
TreeTemplates.templateAsGenome(TreeTemplates.getDarkOakTemplate()))); TreeTemplates.templateAsGenome(TreeTemplates.getDarkOakTemplate())));
} }
private void createMutations() { private static void createMutations() {
// Decidious // Decidious
TreeTemplates.limeA = new TreeMutation(Allele.treeBirch, Allele.treeOak, TreeTemplates.limeA = new TreeMutation(Allele.treeBirch, Allele.treeOak,
@@ -1213,22 +1217,7 @@ public class PluginArboriculture extends ForestryPlugin {
@Override @Override
public IFuelHandler getFuelHandler() { public IFuelHandler getFuelHandler() {
return new IFuelHandler() { return new FuelHandler();
@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;
}
};
} }
@Override @Override
@@ -1250,25 +1239,25 @@ public class PluginArboriculture extends ForestryPlugin {
return super.processIMCMessage(message); 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(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(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(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(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(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.getLimeTemplate(), EnumGermlingType.SAPLING), 1, 2, 4));
if (PluginManager.Module.APICULTURE.isEnabled()) { 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(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(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(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(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.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)); ITree tree = new Tree(PluginArboriculture.treeInterface.templateAsGenome(template));
ItemStack treeItem; ItemStack treeItem;
switch (type) { switch (type) {
@@ -1284,4 +1273,21 @@ public class PluginArboriculture extends ForestryPlugin {
treeItem.setTagCompound(nbtTagCompound); treeItem.setTagCompound(nbtTagCompound);
return treeItem; 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;
}
}
} }
+24 -25
View File
@@ -84,11 +84,8 @@ public class PluginCore extends ForestryPlugin {
public static final RootCommand rootCommand = new RootCommand(); public static final RootCommand rootCommand = new RootCommand();
@Override @Override
public void preInit() { protected void setupAPI() {
super.preInit(); super.setupAPI();
rootCommand.addChildCommand(new CommandVersion());
rootCommand.addChildCommand(new CommandPlugins());
ChipsetManager.solderManager = new ItemSolderingIron.SolderManager(); ChipsetManager.solderManager = new ItemSolderingIron.SolderManager();
@@ -101,7 +98,15 @@ public class PluginCore extends ForestryPlugin {
AlleleManager.climateHelper = new ClimateHelper(); AlleleManager.climateHelper = new ClimateHelper();
alleleRegistry.initialize(); 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"); 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"); ForestryItem.fruits.registerItem(new ItemFruit(), "fruits");
} }
@Override
public void postInit() {
}
@Override
protected void registerBackpackItems() {
}
@Override @Override
protected void registerCrates() { protected void registerCrates() {
ICrateRegistry crateRegistry = StorageManager.crateRegistry; ICrateRegistry crateRegistry = StorageManager.crateRegistry;
@@ -450,19 +447,21 @@ public class PluginCore extends ForestryPlugin {
@Override @Override
public IFuelHandler getFuelHandler() { public IFuelHandler getFuelHandler() {
return new IFuelHandler() { return new FuelHandler();
}
@Override private static class FuelHandler implements IFuelHandler {
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; @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.config.ForestryItem;
import forestry.core.gadgets.BlockBase; import forestry.core.gadgets.BlockBase;
import forestry.core.gadgets.MachineDefinition; import forestry.core.gadgets.MachineDefinition;
import forestry.core.interfaces.IOreDictionaryHandler;
import forestry.core.interfaces.ISaveEventHandler;
import forestry.core.items.ItemForestryBlock; import forestry.core.items.ItemForestryBlock;
import forestry.core.utils.ShapedRecipeCustom; import forestry.core.utils.ShapedRecipeCustom;
import forestry.energy.GuiHandlerEnergy; import forestry.energy.GuiHandlerEnergy;
@@ -97,34 +95,8 @@ public class PluginEnergy extends ForestryPlugin {
definitionEngineClockwork.register(); definitionEngineClockwork.register();
} }
@Override
protected void registerItems() {
}
@Override
protected void registerBackpackItems() {
}
@Override
protected void registerRecipes() {
}
@Override
protected void registerCrates() {
}
@Override @Override
public IGuiHandler getGuiHandler() { public IGuiHandler getGuiHandler() {
return new GuiHandlerEnergy(); return new GuiHandlerEnergy();
} }
@Override
public ISaveEventHandler getSaveEventHandler() {
return null;
}
@Override
public IOreDictionaryHandler getDictionaryHandler() {
return null;
}
} }
@@ -10,7 +10,7 @@
******************************************************************************/ ******************************************************************************/
package forestry.plugins; package forestry.plugins;
import java.util.Arrays; import com.google.common.collect.ImmutableList;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
@@ -68,10 +68,25 @@ public class PluginFactory extends ForestryPlugin {
public static MachineDefinition definitionWorktable; public static MachineDefinition definitionWorktable;
@Override @Override
protected void disabledPreInit() { protected void setupAPI() {
super.disabledPreInit(); 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.carpenterManager = new DummyManagers.CarpenterManager(),
RecipeManagers.centrifugeManager = new DummyManagers.CentrifugeManager(), RecipeManagers.centrifugeManager = new DummyManagers.CentrifugeManager(),
RecipeManagers.fabricatorManager = new DummyManagers.FabricatorManager(), RecipeManagers.fabricatorManager = new DummyManagers.FabricatorManager(),
@@ -86,16 +101,6 @@ public class PluginFactory extends ForestryPlugin {
public void preInit() { public void preInit() {
super.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"); ForestryBlock.factoryTESR.registerBlock(new BlockBase(Material.iron, true), ItemForestryBlock.class, "factory");
BlockBase factoryTESR = ((BlockBase) ForestryBlock.factoryTESR.block()); BlockBase factoryTESR = ((BlockBase) ForestryBlock.factoryTESR.block());
@@ -215,11 +220,11 @@ public class PluginFactory extends ForestryPlugin {
'W', Blocks.crafting_table, 'W', Blocks.crafting_table,
'C', Blocks.chest)) 'C', Blocks.chest))
.setFaces(0, 1, 2, 3, 4, 4)); .setFaces(0, 1, 2, 3, 4, 4));
}
// Triggers @Override
if (PluginManager.Module.BUILDCRAFT_STATEMENTS.isEnabled()) { protected void registerTriggers() {
FactoryTriggers.initialize(); FactoryTriggers.initialize();
}
} }
@Override @Override
@@ -85,10 +85,15 @@ public class PluginFarming extends ForestryPlugin {
public static ItemStack farmFertilizer; public static ItemStack farmFertilizer;
@Override @Override
public void preInit() { protected void setupAPI() {
super.preInit(); super.setupAPI();
Farmables.farmInterface = new FarmHelper(); Farmables.farmInterface = new FarmHelper();
}
@Override
public void preInit() {
super.preInit();
ForestryBlock.mushroom.registerBlock(new BlockMushroom(), ItemTypedBlock.class, "mushroom"); ForestryBlock.mushroom.registerBlock(new BlockMushroom(), ItemTypedBlock.class, "mushroom");
@@ -130,11 +135,6 @@ public class PluginFarming extends ForestryPlugin {
proxy.initializeRendering(); proxy.initializeRendering();
// Triggers
if (PluginManager.Module.BUILDCRAFT_STATEMENTS.isEnabled()) {
FarmingTriggers.initialize();
}
// Layouts // Layouts
ICircuitLayout layoutManaged = new CircuitLayout("farms.managed"); ICircuitLayout layoutManaged = new CircuitLayout("farms.managed");
ChipsetManager.circuitRegistry.registerLayout(layoutManaged); ChipsetManager.circuitRegistry.registerLayout(layoutManaged);
@@ -142,6 +142,11 @@ public class PluginFarming extends ForestryPlugin {
ChipsetManager.circuitRegistry.registerLayout(layoutManual); ChipsetManager.circuitRegistry.registerLayout(layoutManual);
} }
@Override
protected void registerTriggers() {
FarmingTriggers.initialize();
}
@Override @Override
public void doInit() { public void doInit() {
super.doInit(); super.doInit();
+2 -20
View File
@@ -36,8 +36,8 @@ import forestry.food.items.ItemInfuser;
public class PluginFood extends ForestryPlugin { public class PluginFood extends ForestryPlugin {
@Override @Override
public void preInit() { protected void setupAPI() {
super.preInit(); super.setupAPI();
// Init seasoner // Init seasoner
BeverageManager.infuserManager = new ItemInfuser.MixtureManager(); 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)); LiquidHelper.injectLiquidContainer(Fluids.SHORT_MEAD, Defaults.BUCKET_VOLUME, meadBottle, new ItemStack(Items.glass_bottle));
} }
@Override
protected void registerBackpackItems() {
}
@Override @Override
protected void registerRecipes() { protected void registerRecipes() {
// INFUSER // INFUSER
@@ -85,22 +81,8 @@ public class PluginFood extends ForestryPlugin {
'X', "ingotBronze"); 'X', "ingotBronze");
} }
@Override
protected void registerCrates() {
}
@Override @Override
public IGuiHandler getGuiHandler() { public IGuiHandler getGuiHandler() {
return new GuiHandlerFood(); 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; public static MachineDefinition definitionChest;
@Override @Override
public void preInit() { protected void setupAPI() {
ForestryBlock.lepidopterology.registerBlock(new BlockBase(Material.iron), ItemForestryBlock.class, "lepidopterology"); super.setupAPI();
ForestryBlock.lepidopterology.block().setCreativeTab(Tabs.tabLepidopterology);
AlleleManager.alleleRegistry.registerSpeciesRoot(PluginLepidopterology.butterflyInterface = new ButterflyHelper()); AlleleManager.alleleRegistry.registerSpeciesRoot(PluginLepidopterology.butterflyInterface = new ButterflyHelper());
createAlleles(); createAlleles();
registerTemplates();
}
@Override
public void preInit() {
ForestryBlock.lepidopterology.registerBlock(new BlockBase(Material.iron), ItemForestryBlock.class, "lepidopterology");
ForestryBlock.lepidopterology.block().setCreativeTab(Tabs.tabLepidopterology);
} }
@Override @Override
@@ -121,7 +127,6 @@ public class PluginLepidopterology extends ForestryPlugin {
Utils.registerEntity(EntityButterfly.class, "butterflyGE", 0, 0x000000, 0xffffff, 50, 1, true); Utils.registerEntity(EntityButterfly.class, "butterflyGE", 0, 0x000000, 0xffffff, 50, 1, true);
proxy.initializeRendering(); proxy.initializeRendering();
registerTemplates();
BlockBase lepidopterology = ((BlockBase) ForestryBlock.lepidopterology.block()); BlockBase lepidopterology = ((BlockBase) ForestryBlock.lepidopterology.block());
definitionChest = lepidopterology.addDefinition((new MachineDefinition(Defaults.DEFINITION_LEPICHEST_META, "forestry.LepiChest", TileLepidopteristChest.class, 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); Items.redstone, 'D', Items.diamond);
} }
private void createAlleles() { private static void createAlleles() {
IClassification lepidoptera = AlleleManager.alleleRegistry.createAndRegisterClassification(EnumClassLevel.ORDER, "lepidoptera", "Lepidoptera"); IClassification lepidoptera = AlleleManager.alleleRegistry.createAndRegisterClassification(EnumClassLevel.ORDER, "lepidoptera", "Lepidoptera");
AlleleManager.alleleRegistry.getClassification("class.insecta").addMemberGroup(lepidoptera); AlleleManager.alleleRegistry.getClassification("class.insecta").addMemberGroup(lepidoptera);
@@ -273,7 +278,13 @@ public class PluginLepidopterology extends ForestryPlugin {
Allele.butterflyNone = new AlleleEffectNone("bfNone", false); 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.getBrimstoneMothTemplate());
butterflyInterface.registerTemplate(ButterflyTemplates.getLatticedHeathTemplate()); butterflyInterface.registerTemplate(ButterflyTemplates.getLatticedHeathTemplate());
butterflyInterface.registerTemplate(ButterflyTemplates.getAtlasMothTemplate()); 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 @Override
public IGuiHandler getGuiHandler() { public IGuiHandler getGuiHandler() {
return new GuiHandlerLepidopterology(); return new GuiHandlerLepidopterology();
+13 -26
View File
@@ -63,6 +63,15 @@ public class PluginMail extends ForestryPlugin {
public static MachineDefinition definitionPhilatelist; public static MachineDefinition definitionPhilatelist;
public static StampInfo[] stampDefinitions; 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 @Override
public void preInit() { public void preInit() {
super.preInit(); super.preInit();
@@ -71,11 +80,6 @@ public class PluginMail extends ForestryPlugin {
new TickHandlerMailClient(); new TickHandlerMailClient();
// Triggers
if (PluginManager.Module.BUILDCRAFT_STATEMENTS.isEnabled()) {
MailTriggers.initialize();
}
ForestryBlock.mail.registerBlock(new BlockBase(Material.iron), ItemForestryBlock.class, "mail"); ForestryBlock.mail.registerBlock(new BlockBase(Material.iron), ItemForestryBlock.class, "mail");
ShapedRecipeCustom recipe = ShapedRecipeCustom.createShapedRecipe(ForestryBlock.mail.getItemStack(1, Defaults.DEFINITION_MAILBOX_META), 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) definitionPhilatelist = mail.addDefinition(new MachineDefinition(Defaults.DEFINITION_PHILATELIST_META, "forestry.Philatelist", MachinePhilatelist.class)
.setFaces(0, 1, 2, 3, 2, 2, 0, 7)); .setFaces(0, 1, 2, 3, 2, 2, 0, 7));
}
PostManager.postRegistry = new PostRegistry(); @Override
PostManager.postRegistry.registerCarrier(new PostalCarrier(EnumAddressee.PLAYER)); protected void registerTriggers() {
PostManager.postRegistry.registerCarrier(new PostalCarrier(EnumAddressee.TRADER)); MailTriggers.initialize();
} }
@Override @Override
@@ -117,11 +122,6 @@ public class PluginMail extends ForestryPlugin {
definitionPhilatelist.register(); definitionPhilatelist.register();
} }
@Override
public void postInit() {
super.postInit();
}
@Override @Override
public IGuiHandler getGuiHandler() { public IGuiHandler getGuiHandler() {
return new GuiHandlerMail(); return new GuiHandlerMail();
@@ -151,14 +151,6 @@ public class PluginMail extends ForestryPlugin {
ForestryItem.catalogue.registerItem(new ItemCatalogue(), "catalogue"); ForestryItem.catalogue.registerItem(new ItemCatalogue(), "catalogue");
} }
@Override
protected void registerBackpackItems() {
}
@Override
protected void registerCrates() {
}
@Override @Override
protected void registerRecipes() { protected void registerRecipes() {
// Letters // Letters
@@ -203,9 +195,4 @@ public class PluginMail extends ForestryPlugin {
public ISaveEventHandler getSaveEventHandler() { public ISaveEventHandler getSaveEventHandler() {
return new SaveEventHandlerMail(); return new SaveEventHandlerMail();
} }
@Override
public IOreDictionaryHandler getDictionaryHandler() {
return null;
}
} }
+101 -95
View File
@@ -61,8 +61,7 @@ public class PluginManager {
private static Stage stage = Stage.SETUP; private static Stage stage = Stage.SETUP;
public enum Stage { public enum Stage {
SETUP, SETUP_DISABLED, PRE_INIT, INIT, POST_INIT, FINISHED
SETUP, PRE_INIT, PRE_INIT_DISABLED, INIT, POST_INIT, POST_INIT_DISABLED, FINISHED
} }
public enum Module { public enum Module {
@@ -94,8 +93,7 @@ public class PluginManager {
HARVESTCRAFT(new PluginHarvestCraft()), HARVESTCRAFT(new PluginHarvestCraft()),
MAGICALCROPS(new PluginMagicalCrops()), MAGICALCROPS(new PluginMagicalCrops()),
NATURA(new PluginNatura()), NATURA(new PluginNatura()),
PLANTMEGAPACK(new PluginPlantMegaPack()), PLANTMEGAPACK(new PluginPlantMegaPack());
UNDERGROUND_BIOMES(new PluginUndergroundBiomes());
private final ForestryPlugin instance; private final ForestryPlugin instance;
private final boolean canBeDisabled; private final boolean canBeDisabled;
@@ -141,84 +139,6 @@ public class PluginManager {
return loadedModules.contains(module); 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) { private static void loadPlugin(ForestryPlugin plugin) {
Proxies.log.fine("Registering Handlers for Plugin: {0}", plugin); Proxies.log.fine("Registering Handlers for Plugin: {0}", plugin);
@@ -258,17 +178,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() { public static void runInit() {
stage = Stage.INIT; stage = Stage.INIT;
for (Module m : loadedModules) { for (Module m : loadedModules) {
ForestryPlugin plugin = m.instance; ForestryPlugin plugin = m.instance;
Proxies.log.fine("Init Start: {0}", plugin); Proxies.log.fine("Init Start: {0}", plugin);
if (Module.STORAGE.isEnabled()) {
plugin.registerBackpackItems();
plugin.registerCrates();
}
plugin.doInit(); plugin.doInit();
plugin.registerRecipes(); plugin.registerRecipes();
Proxies.log.fine("Init Complete: {0}", plugin); Proxies.log.fine("Init Complete: {0}", plugin);
@@ -284,13 +297,6 @@ public class PluginManager {
Proxies.log.fine("Post-Init Complete: {0}", plugin); 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; stage = Stage.FINISHED;
} }
@@ -66,8 +66,8 @@ public class PluginNatura extends ForestryPlugin {
} }
@Override @Override
public void doInit() { public void preInit() {
super.doInit(); super.preInit();
logNatura = GameRegistry.findBlock(NATURA, "tree"); logNatura = GameRegistry.findBlock(NATURA, "tree");
logWillow = GameRegistry.findBlock(NATURA, "willow"); logWillow = GameRegistry.findBlock(NATURA, "willow");
@@ -103,44 +103,93 @@ public class PluginNatura extends ForestryPlugin {
berryBlack = GameRegistry.findItemStack(NATURA, "berryBlack", 1); berryBlack = GameRegistry.findItemStack(NATURA, "berryBlack", 1);
berryMalo = GameRegistry.findItemStack(NATURA, "berryMalo", 1); berryMalo = GameRegistry.findItemStack(NATURA, "berryMalo", 1);
itemBarley = GameRegistry.findItemStack(NATURA, "barleyFood", 1); itemBarley = GameRegistry.findItemStack(NATURA, "barleyFood", 1);
}
@Override
protected void registerCrates() {
super.registerCrates();
ICrateRegistry crateRegistry = StorageManager.crateRegistry; ICrateRegistry crateRegistry = StorageManager.crateRegistry;
crateRegistry.registerCrate(berryBlight, "cratedNaturaBerryBlight");
crateRegistry.registerCrate(berryDusk, "cratedNaturaBerryDusk"); if (berryBlight != null) {
crateRegistry.registerCrate(berrySky, "cratedNaturaBerrySky"); crateRegistry.registerCrate(berryBlight, "cratedNaturaBerryBlight");
crateRegistry.registerCrate(berrySting, "cratedNaturaBerrySting"); }
crateRegistry.registerCrate(berryRasp, "cratedNaturaBerryRasp"); if (berryDusk != null) {
crateRegistry.registerCrate(berryBlue, "cratedNaturaBerryBlue"); crateRegistry.registerCrate(berryDusk, "cratedNaturaBerryDusk");
crateRegistry.registerCrate(berryBlack, "cratedNaturaBerryBlack"); }
crateRegistry.registerCrate(berryMalo, "cratedNaturaBerryMalo"); if (berrySky != null) {
crateRegistry.registerCrate(itemBarley, "cratedNaturaBarley"); crateRegistry.registerCrate(berrySky, "cratedNaturaBerrySky");
crateRegistry.registerCrate(new ItemStack(saplingNatura, 1, 0), "cratedNaturaSaplingRedwood"); }
crateRegistry.registerCrate(new ItemStack(saplingNatura, 1, 1), "cratedNaturaSaplingEucalyptus"); if (berrySting != null) {
crateRegistry.registerCrate(new ItemStack(saplingNatura, 1, 2), "cratedNaturaSaplingHopseed"); crateRegistry.registerCrate(berrySting, "cratedNaturaBerrySting");
crateRegistry.registerCrate(new ItemStack(saplingNatura, 1, 3), "cratedNaturaSaplingSakura"); }
crateRegistry.registerCrate(new ItemStack(saplingNatura, 1, 4), "cratedNaturaSaplingGhostwood"); if (berryRasp != null) {
crateRegistry.registerCrate(new ItemStack(saplingNatura, 1, 5), "cratedNaturaSaplingBlood"); crateRegistry.registerCrate(berryRasp, "cratedNaturaBerryRasp");
crateRegistry.registerCrate(new ItemStack(saplingNatura, 1, 6), "cratedNaturaSaplingDarkwood"); }
crateRegistry.registerCrate(new ItemStack(saplingNatura, 1, 7), "cratedNaturaSaplingFusewood"); if (berryBlue != null) {
crateRegistry.registerCrate(new ItemStack(saplingNaturaRare, 1, 0), "cratedNaturaSaplingMaple"); crateRegistry.registerCrate(berryBlue, "cratedNaturaBerryBlue");
crateRegistry.registerCrate(new ItemStack(saplingNaturaRare, 1, 1), "cratedNaturaSaplingSilverbell"); }
crateRegistry.registerCrate(new ItemStack(saplingNaturaRare, 1, 2), "cratedNaturaSaplingPurpleheart"); if (berryBlack != null) {
crateRegistry.registerCrate(new ItemStack(saplingNaturaRare, 1, 3), "cratedNaturaSaplingTiger"); crateRegistry.registerCrate(berryBlack, "cratedNaturaBerryBlack");
crateRegistry.registerCrate(new ItemStack(saplingNaturaRare, 1, 4), "cratedNaturaSaplingWillow"); }
crateRegistry.registerCrate(new ItemStack(GameRegistry.findItem(NATURA, "Natura.netherfood"), 1, 0), "cratedNaturaPotashApple"); if (berryMalo != null) {
crateRegistry.registerCrate(new ItemStack(GameRegistry.findItem(NATURA, "Glowshroom"), 1, 0), "cratedNaturaGreenGlowshroom"); crateRegistry.registerCrate(berryMalo, "cratedNaturaBerryMalo");
crateRegistry.registerCrate(new ItemStack(GameRegistry.findItem(NATURA, "Glowshroom"), 1, 1), "cratedNaturaPurpleGlowshroom"); }
crateRegistry.registerCrate(new ItemStack(GameRegistry.findItem(NATURA, "Glowshroom"), 1, 2), "cratedNaturaBlueGlowshroom"); if (itemBarley != null) {
crateRegistry.registerCrate(new ItemStack(logNatura, 1, 0), "cratedNaturaLogEucalyptus"); crateRegistry.registerCrate(itemBarley, "cratedNaturaBarley");
crateRegistry.registerCrate(new ItemStack(logNatura, 1, 1), "cratedNaturaLogSakura"); }
crateRegistry.registerCrate(new ItemStack(logNatura, 1, 2), "cratedNaturaLogGhostwood"); if (saplingNatura != null) {
crateRegistry.registerCrate(new ItemStack(logNatura, 1, 3), "cratedNaturaLogHopseed"); crateRegistry.registerCrate(new ItemStack(saplingNatura, 1, 0), "cratedNaturaSaplingRedwood");
crateRegistry.registerCrate(new ItemStack(logWillow, 1, 0), "cratedNaturaLogWillow"); crateRegistry.registerCrate(new ItemStack(saplingNatura, 1, 1), "cratedNaturaSaplingEucalyptus");
crateRegistry.registerCrate(new ItemStack(GameRegistry.findItem(NATURA, "bloodwood"), 1, 0), "cratedNaturaLogBloodwood"); crateRegistry.registerCrate(new ItemStack(saplingNatura, 1, 2), "cratedNaturaSaplingHopseed");
crateRegistry.registerCrate(new ItemStack(GameRegistry.findItem(NATURA, "Dark Tree"), 1, 0), "cratedNaturaLogDarkwood"); crateRegistry.registerCrate(new ItemStack(saplingNatura, 1, 3), "cratedNaturaSaplingSakura");
crateRegistry.registerCrate(new ItemStack(GameRegistry.findItem(NATURA, "Dark Tree"), 1, 1), "cratedNaturaLogFusewood"); crateRegistry.registerCrate(new ItemStack(saplingNatura, 1, 4), "cratedNaturaSaplingGhostwood");
crateRegistry.registerCrate(new ItemStack(GameRegistry.findItem(NATURA, "heatsand"), 1, 0), "cratedNaturaBlockHeatsand"); crateRegistry.registerCrate(new ItemStack(saplingNatura, 1, 5), "cratedNaturaSaplingBlood");
crateRegistry.registerCrate(new ItemStack(GameRegistry.findItem(NATURA, "soil.tainted"), 1, 0), "cratedNaturaBlockTainted"); crateRegistry.registerCrate(new ItemStack(saplingNatura, 1, 6), "cratedNaturaSaplingDarkwood");
crateRegistry.registerCrate(new ItemStack(saplingNatura, 1, 7), "cratedNaturaSaplingFusewood");
}
if (saplingNaturaRare != null) {
crateRegistry.registerCrate(new ItemStack(saplingNaturaRare, 1, 0), "cratedNaturaSaplingMaple");
crateRegistry.registerCrate(new ItemStack(saplingNaturaRare, 1, 1), "cratedNaturaSaplingSilverbell");
crateRegistry.registerCrate(new ItemStack(saplingNaturaRare, 1, 2), "cratedNaturaSaplingPurpleheart");
crateRegistry.registerCrate(new ItemStack(saplingNaturaRare, 1, 3), "cratedNaturaSaplingTiger");
crateRegistry.registerCrate(new ItemStack(saplingNaturaRare, 1, 4), "cratedNaturaSaplingWillow");
}
Item potashApple = GameRegistry.findItem(NATURA, "Natura.netherfood");
if (potashApple != null) {
crateRegistry.registerCrate(new ItemStack(potashApple, 1, 0), "cratedNaturaPotashApple");
}
Item glowShroom = GameRegistry.findItem(NATURA, "Glowshroom");
if (glowShroom != null) {
crateRegistry.registerCrate(new ItemStack(glowShroom, 1, 0), "cratedNaturaGreenGlowshroom");
crateRegistry.registerCrate(new ItemStack(glowShroom, 1, 1), "cratedNaturaPurpleGlowshroom");
crateRegistry.registerCrate(new ItemStack(glowShroom, 1, 2), "cratedNaturaBlueGlowshroom");
}
if (logNatura != null) {
crateRegistry.registerCrate(new ItemStack(logNatura, 1, 0), "cratedNaturaLogEucalyptus");
crateRegistry.registerCrate(new ItemStack(logNatura, 1, 1), "cratedNaturaLogSakura");
crateRegistry.registerCrate(new ItemStack(logNatura, 1, 2), "cratedNaturaLogGhostwood");
crateRegistry.registerCrate(new ItemStack(logNatura, 1, 3), "cratedNaturaLogHopseed");
crateRegistry.registerCrate(new ItemStack(logWillow, 1, 0), "cratedNaturaLogWillow");
}
Item bloodWood = GameRegistry.findItem(NATURA, "bloodwood");
if (bloodWood != null) {
crateRegistry.registerCrate(new ItemStack(bloodWood, 1, 0), "cratedNaturaLogBloodwood");
}
Item darkTree = GameRegistry.findItem(NATURA, "Dark Tree");
if (darkTree != null) {
crateRegistry.registerCrate(new ItemStack(darkTree, 1, 0), "cratedNaturaLogDarkwood");
crateRegistry.registerCrate(new ItemStack(darkTree, 1, 1), "cratedNaturaLogFusewood");
}
Item heatSand = GameRegistry.findItem(NATURA, "heatsand");
if (heatSand != null) {
crateRegistry.registerCrate(new ItemStack(heatSand, 1, 0), "cratedNaturaBlockHeatsand");
}
Item taintedSoil = GameRegistry.findItem(NATURA, "soil.tainted");
if (taintedSoil != null) {
crateRegistry.registerCrate(new ItemStack(taintedSoil, 1, 0), "cratedNaturaBlockTainted");
}
} }
@Override @Override
@@ -204,9 +253,10 @@ public class PluginNatura extends ForestryPlugin {
if (itemBarley != null) { if (itemBarley != null) {
RecipeUtil.injectLeveledRecipe(itemBarley, GameMode.getGameMode().getIntegerSetting("fermenter.yield.wheat"), Fluids.BIOMASS); RecipeUtil.injectLeveledRecipe(itemBarley, GameMode.getGameMode().getIntegerSetting("fermenter.yield.wheat"), Fluids.BIOMASS);
} if (GameMode.getGameMode().getStackSetting("recipe.output.compost.wheat").stackSize > 0) {
if (GameMode.getGameMode().getStackSetting("recipe.output.compost.wheat").stackSize > 0) { ItemStack compostWheat = GameMode.getGameMode().getStackSetting("recipe.output.compost.wheat");
Proxies.common.addRecipe(GameMode.getGameMode().getStackSetting("recipe.output.compost.wheat"), " X ", "X#X", " X ", '#', Blocks.dirt, 'X', itemBarley); Proxies.common.addRecipe(compostWheat, " X ", "X#X", " X ", '#', Blocks.dirt, 'X', itemBarley);
}
} }
} }
@@ -10,6 +10,7 @@
******************************************************************************/ ******************************************************************************/
package forestry.plugins; package forestry.plugins;
import java.awt.Color;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.logging.Level; import java.util.logging.Level;
@@ -96,7 +97,11 @@ public class PluginStorage extends ForestryPlugin implements IOreDictionaryHandl
@Override @Override
@SuppressWarnings({"unchecked", "rawtypes"}) @SuppressWarnings({"unchecked", "rawtypes"})
public void preInit() { protected void setupAPI() {
super.setupAPI();
StorageManager.crateRegistry = new CrateRegistry();
BackpackManager.backpackInterface = new BackpackHelper(); BackpackManager.backpackInterface = new BackpackHelper();
BackpackManager.backpackItems = new ArrayList[6]; BackpackManager.backpackItems = new ArrayList[6];
@@ -108,7 +113,35 @@ public class PluginStorage extends ForestryPlugin implements IOreDictionaryHandl
BackpackManager.backpackItems[4] = adventurerItems; BackpackManager.backpackItems[4] = adventurerItems;
BackpackManager.backpackItems[5] = builderItems; 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 @Override
@@ -147,7 +180,7 @@ public class PluginStorage extends ForestryPlugin implements IOreDictionaryHandl
} }
public static void registerCrate(ItemCrated crate) { public static void registerCrate(ItemCrated crate) {
proxy.registerCrate(crate); proxy.registerCrateForRendering(crate);
crates.add(crate); crates.add(crate);
} }
@@ -274,47 +307,41 @@ public class PluginStorage extends ForestryPlugin implements IOreDictionaryHandl
ForestryItem.crate.registerItem((new ItemCrated(null, false)), "crate"); ForestryItem.crate.registerItem((new ItemCrated(null, false)), "crate");
// BACKPACKS // BACKPACKS
BackpackDefinition definition; IBackpackDefinition definition;
if (PluginManager.Module.APICULTURE.isEnabled()) { if (PluginManager.Module.APICULTURE.isEnabled()) {
definition = new BackpackDefinitionApiarist("apiarist", 0xc4923d); definition = BackpackManager.definitions.get("apiarist");
BackpackManager.definitions.put(definition.getKey(), definition); Item backpack = new ItemNaturalistBackpack(GuiId.ApiaristBackpackGUI.ordinal(), definition).setCreativeTab(Tabs.tabApiculture);
ForestryItem.apiaristBackpack.registerItem(new ItemNaturalistBackpack(GuiId.ApiaristBackpackGUI.ordinal(), definition).setCreativeTab(Tabs.tabApiculture), "apiaristBag"); ForestryItem.apiaristBackpack.registerItem(backpack, "apiaristBag");
} }
if (PluginManager.Module.LEPIDOPTEROLOGY.isEnabled()) { if (PluginManager.Module.LEPIDOPTEROLOGY.isEnabled()) {
definition = new BackpackDefinitionLepidopterist("lepidopterist", 0x995b31); definition = BackpackManager.definitions.get("lepidopterist");
BackpackManager.definitions.put(definition.getKey(), definition); Item backpack = new ItemNaturalistBackpack(GuiId.LepidopteristBackpackGUI.ordinal(), definition).setCreativeTab(Tabs.tabLepidopterology);
ForestryItem.lepidopteristBackpack.registerItem(new ItemNaturalistBackpack(GuiId.LepidopteristBackpackGUI.ordinal(), definition).setCreativeTab(Tabs.tabLepidopterology), "lepidopteristBag"); ForestryItem.lepidopteristBackpack.registerItem(backpack, "lepidopteristBag");
} }
definition = new BackpackDefinition("miner", 0x36187d); definition = BackpackManager.definitions.get("miner");
BackpackManager.definitions.put(definition.getKey(), definition);
ForestryItem.minerBackpack.registerItem(BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T1), "minerBag"); ForestryItem.minerBackpack.registerItem(BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T1), "minerBag");
ForestryItem.minerBackpackT2.registerItem(BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T2), "minerBagT2"); ForestryItem.minerBackpackT2.registerItem(BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T2), "minerBagT2");
definition = new BackpackDefinition("digger", 0x363cc5); definition = BackpackManager.definitions.get("digger");
BackpackManager.definitions.put(definition.getKey(), definition);
ForestryItem.diggerBackpack.registerItem(BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T1), "diggerBag"); ForestryItem.diggerBackpack.registerItem(BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T1), "diggerBag");
ForestryItem.diggerBackpackT2.registerItem(BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T2), "diggerBagT2"); ForestryItem.diggerBackpackT2.registerItem(BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T2), "diggerBagT2");
definition = new BackpackDefinition("forester", 0x347427); definition = BackpackManager.definitions.get("forester");
BackpackManager.definitions.put(definition.getKey(), definition);
ForestryItem.foresterBackpack.registerItem(BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T1), "foresterBag"); ForestryItem.foresterBackpack.registerItem(BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T1), "foresterBag");
ForestryItem.foresterBackpackT2.registerItem(BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T2), "foresterBagT2"); ForestryItem.foresterBackpackT2.registerItem(BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T2), "foresterBagT2");
definition = new BackpackDefinition("hunter", 0x412215); definition = BackpackManager.definitions.get("hunter");
BackpackManager.definitions.put(definition.getKey(), definition);
ForestryItem.hunterBackpack.registerItem(BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T1), "hunterBag"); ForestryItem.hunterBackpack.registerItem(BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T1), "hunterBag");
ForestryItem.hunterBackpackT2.registerItem(BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T2), "hunterBagT2"); ForestryItem.hunterBackpackT2.registerItem(BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T2), "hunterBagT2");
definition = new BackpackDefinition("adventurer", 0x7fb8c2); definition = BackpackManager.definitions.get("adventurer");
BackpackManager.definitions.put(definition.getKey(), definition);
ForestryItem.adventurerBackpack.registerItem(BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T1), "adventurerBag"); ForestryItem.adventurerBackpack.registerItem(BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T1), "adventurerBag");
ForestryItem.adventurerBackpackT2.registerItem(BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T2), "adventurerBagT2"); ForestryItem.adventurerBackpackT2.registerItem(BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T2), "adventurerBagT2");
definition = new BackpackDefinition("builder", 0xdd3a3a); definition = BackpackManager.definitions.get("builder");
BackpackManager.definitions.put(definition.getKey(), definition);
ForestryItem.builderBackpack.registerItem(BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T1), "builderBag"); ForestryItem.builderBackpack.registerItem(BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T1), "builderBag");
ForestryItem.builderBackpackT2.registerItem(BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T2), "builderBagT2"); ForestryItem.builderBackpackT2.registerItem(BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T2), "builderBagT2");
} }
@@ -1,52 +0,0 @@
/*******************************************************************************
* Copyright (c) 2011-2014 SirSengir.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Lesser Public License v3
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/lgpl-3.0.txt
*
* Various Contributors including, but not limited to:
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
******************************************************************************/
package forestry.plugins;
import cpw.mods.fml.common.Optional;
import forestry.core.config.Defaults;
import forestry.core.config.ForestryBlock;
import forestry.core.proxy.Proxies;
import exterminatorJeff.undergroundBiomes.api.UBAPIHook;
import exterminatorJeff.undergroundBiomes.api.UBOreTexturizer;
@Plugin(pluginID = "UndergroundBiomes", name = "UndergroundBiomes", author = "mezz", url = Defaults.URL, unlocalizedDescription = "for.plugin.undergroundBiomes.description")
public class PluginUndergroundBiomes extends ForestryPlugin {
public boolean isAvailable() {
return Proxies.common.isModLoaded("UndergroundBiomes");
}
public String getFailMessage() {
return "UndergroundBiomes is not found.";
}
@Optional.Method(modid = "UndergroundBiomes")
@Override
protected void preInit() {
registerBlock(0, "apatite");
registerBlock(1, "copper");
registerBlock(2, "tin");
}
@Optional.Method(modid = "UndergroundBiomes")
private void registerBlock(int meta, String textureName) {
try {
String blockName = ForestryBlock.resources.getItemStack(1, meta).getUnlocalizedName();
UBAPIHook.ubAPIHook.ubOreTexturizer.requestUBOreSetup(ForestryBlock.resources.block(), meta, "forestry:ores/" + textureName + "_overlay", blockName);
} catch (UBOreTexturizer.BlocksAreAlreadySet exception) {
Proxies.log.severe(exception.toString());
} catch (Throwable throwable) {
Proxies.log.severe("Underground Biomes crashed.");
}
}
}
@@ -22,17 +22,15 @@ import forestry.plugins.PluginStorage;
public class CrateRegistry implements ICrateRegistry { public class CrateRegistry implements ICrateRegistry {
private void registerCrate(ItemStack stack, String uid, boolean useOreDict) { private static void registerCrate(ItemStack stack, String uid, boolean useOreDict) {
if (PluginManager.getStage() != PluginManager.Stage.INIT) {
throw new RuntimeException("Tried to make a crate outside of Init");
}
if (stack == null || stack.getItem() == null) { if (stack == null || stack.getItem() == null) {
throw new RuntimeException("Tried to make a crate without an item"); Proxies.log.severe("Tried to make a crate without an item");
return;
} }
if (uid == null) { if (uid == null) {
throw new RuntimeException("Tried to make a crate without a uid"); Proxies.log.severe("Tried to make a crate without a uid");
return;
} }
ItemCrated crate = new ItemCrated(stack, useOreDict); ItemCrated crate = new ItemCrated(stack, useOreDict);
@@ -15,6 +15,7 @@ import net.minecraft.item.ItemStack;
import forestry.api.core.ForestryAPI; import forestry.api.core.ForestryAPI;
import forestry.api.storage.EnumBackpackType; import forestry.api.storage.EnumBackpackType;
import forestry.api.storage.IBackpackDefinition;
import forestry.plugins.PluginApiculture; import forestry.plugins.PluginApiculture;
import forestry.plugins.PluginLepidopterology; import forestry.plugins.PluginLepidopterology;
import forestry.storage.BackpackDefinition; import forestry.storage.BackpackDefinition;
@@ -47,7 +48,7 @@ public class ItemNaturalistBackpack extends ItemBackpack {
private final int guiId; private final int guiId;
public ItemNaturalistBackpack(int guiId, BackpackDefinition definition) { public ItemNaturalistBackpack(int guiId, IBackpackDefinition definition) {
super(definition, EnumBackpackType.APIARIST); super(definition, EnumBackpackType.APIARIST);
this.guiId = guiId; this.guiId = guiId;
} }
@@ -20,7 +20,7 @@ public class ClientProxyStorage extends ProxyStorage {
private static final CrateRenderingHandler crateRenderer = new CrateRenderingHandler(); private static final CrateRenderingHandler crateRenderer = new CrateRenderingHandler();
@Override @Override
public void registerCrate(ItemCrated crate) { public void registerCrateForRendering(ItemCrated crate) {
MinecraftForgeClient.registerItemRenderer(crate, crateRenderer); MinecraftForgeClient.registerItemRenderer(crate, crateRenderer);
} }
} }
@@ -14,7 +14,7 @@ import forestry.core.items.ItemCrated;
public class ProxyStorage { public class ProxyStorage {
public void registerCrate(ItemCrated crate) { public void registerCrateForRendering(ItemCrated crate) {
} }
} }
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB