Giant multiblock refactor

This commit is contained in:
mezz committed 2015-07-19 22:35:34 -07:00
1 parent 201111cb83
commit aa47599278
259 files changed
+10117 -6495

No files matched your search

@@ -21,6 +21,7 @@ import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Random;
import java.util.Set;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
@@ -46,7 +47,6 @@ import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.network.IGuiHandler;
import cpw.mods.fml.common.registry.GameData;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.VillagerRegistry;
import cpw.mods.fml.relauncher.Side;
@@ -77,14 +77,6 @@ import forestry.apiculture.gadgets.BlockAlveary;
import forestry.apiculture.gadgets.BlockBeehives;
import forestry.apiculture.gadgets.BlockCandle;
import forestry.apiculture.gadgets.BlockStump;
import forestry.apiculture.gadgets.StructureLogicAlveary;
import forestry.apiculture.gadgets.TileAlvearyFan;
import forestry.apiculture.gadgets.TileAlvearyHeater;
import forestry.apiculture.gadgets.TileAlvearyHygroregulator;
import forestry.apiculture.gadgets.TileAlvearyPlain;
import forestry.apiculture.gadgets.TileAlvearySieve;
import forestry.apiculture.gadgets.TileAlvearyStabiliser;
import forestry.apiculture.gadgets.TileAlvearySwarmer;
import forestry.apiculture.gadgets.TileApiaristChest;
import forestry.apiculture.gadgets.TileApiary;
import forestry.apiculture.gadgets.TileBeehouse;
@@ -124,6 +116,14 @@ import forestry.apiculture.items.ItemHiveFrame;
import forestry.apiculture.items.ItemHoneycomb;
import forestry.apiculture.items.ItemImprinter;
import forestry.apiculture.items.ItemWaxCast;
import forestry.apiculture.multiblock.TileAlveary;
import forestry.apiculture.multiblock.TileAlvearyFan;
import forestry.apiculture.multiblock.TileAlvearyHeater;
import forestry.apiculture.multiblock.TileAlvearyHygroregulator;
import forestry.apiculture.multiblock.TileAlvearyPlain;
import forestry.apiculture.multiblock.TileAlvearySieve;
import forestry.apiculture.multiblock.TileAlvearyStabiliser;
import forestry.apiculture.multiblock.TileAlvearySwarmer;
import forestry.apiculture.network.PacketHandlerApiculture;
import forestry.apiculture.proxy.ProxyApiculture;
import forestry.apiculture.trigger.ApicultureTriggers;
@@ -164,7 +164,7 @@ public class PluginApiculture extends ForestryPlugin {
public static final String[] EMPTY_STRINGS = new String[0];
public static String beekeepingMode = "NORMAL";
private static float secondPrincessChance = 0;
public static int ticksPerBeeWorkCycle = 550;
public static final int ticksPerBeeWorkCycle = 550;
public static boolean apiarySideSensitive = false;
public static boolean fancyRenderedBees = false;
@@ -327,7 +327,7 @@ public class PluginApiculture extends ForestryPlugin {
property.comment = plantableFlowerMessage;
parsePlantableFlowers(property, flowerType);
List<IFlower> acceptableFlowers = FlowerManager.flowerRegistry.getAcceptableFlowers(flowerType);
Set<IFlower> acceptableFlowers = FlowerManager.flowerRegistry.getAcceptableFlowers(flowerType);
if (acceptableFlowers == null || acceptableFlowers.size() == 0) {
Proxies.log.severe("Flower type '" + flowerType + "' has no valid flowers set in apiculture.cfg. Add valid flowers or delete the config to set it to default.");
}
@@ -425,7 +425,7 @@ public class PluginApiculture extends ForestryPlugin {
weightDecimalFormat.setGroupingUsed(false);
for (String flowerType : FlowerManager.flowerRegistry.getFlowerTypes()) {
List<IFlower> flowers = FlowerManager.flowerRegistry.getAcceptableFlowers(flowerType);
Set<IFlower> flowers = FlowerManager.flowerRegistry.getAcceptableFlowers(flowerType);
List<String> acceptedFlowerNames = new ArrayList<String>();
List<String> plantableFlowerNames = new ArrayList<String>();
if (flowers != null) {
@@ -475,10 +475,6 @@ public class PluginApiculture extends ForestryPlugin {
property.comment = "percent chance of second princess drop, for limited/skyblock maps. Acceptable values up to 2 decimals.";
secondPrincessChance = Float.parseFloat(property.value);
property = apicultureConfig.get("beekeeping.flowers.custom", CONFIG_CATEGORY, "");
property.comment = "add additional flower blocks for apiaries here in the format modid:name or modid:name:meta. separate blocks using ';'. wildcard for metadata: '*'. will be treated like vanilla flowers. not recommended for flowers implemented as tile entities.";
parseAdditionalFlowers(property.value, FlowerManager.plainFlowers);
property = apicultureConfig.get("species.blacklist", CONFIG_CATEGORY, "");
property.comment = "add species to blacklist identified by their uid and seperated with ';'.";
parseBeeBlacklist(property.value);
@@ -677,14 +673,14 @@ public class PluginApiculture extends ForestryPlugin {
'#', ForestryItem.beeswax);
// / ALVEARY
Proxies.common.addRecipe(ForestryBlock.alveary.getItemStack(),
Proxies.common.addRecipe(ForestryBlock.alveary.getItemStack(1, TileAlveary.PLAIN_META),
"###",
"#X#",
"###",
'X', ForestryItem.impregnatedCasing,
'#', ForestryItem.craftingMaterial.getItemStack(1, 6));
// SWARMER
Proxies.common.addRecipe(ForestryBlock.alveary.getItemStack(1, 2),
Proxies.common.addRecipe(ForestryBlock.alveary.getItemStack(1, TileAlveary.SWARMER_META),
"#G#",
" X ",
"#G#",
@@ -692,7 +688,7 @@ public class PluginApiculture extends ForestryPlugin {
'X', ForestryBlock.alveary,
'G', Items.gold_ingot);
// FAN
Proxies.common.addRecipe(ForestryBlock.alveary.getItemStack(1, 3),
Proxies.common.addRecipe(ForestryBlock.alveary.getItemStack(1, TileAlveary.FAN_META),
"I I",
" X ",
"I#I",
@@ -700,7 +696,7 @@ public class PluginApiculture extends ForestryPlugin {
'X', ForestryBlock.alveary,
'I', Items.iron_ingot);
// HEATER
Proxies.common.addRecipe(ForestryBlock.alveary.getItemStack(1, 4),
Proxies.common.addRecipe(ForestryBlock.alveary.getItemStack(1, TileAlveary.HEATER_META),
"#I#",
" X ",
"YYY",
@@ -708,7 +704,7 @@ public class PluginApiculture extends ForestryPlugin {
'X', ForestryBlock.alveary,
'I', Items.iron_ingot, 'Y', Blocks.stone);
// HYGROREGULATOR
Proxies.common.addRecipe(ForestryBlock.alveary.getItemStack(1, 5),
Proxies.common.addRecipe(ForestryBlock.alveary.getItemStack(1, TileAlveary.HYGRO_META),
"GIG",
"GXG",
"GIG",
@@ -716,14 +712,14 @@ public class PluginApiculture extends ForestryPlugin {
'I', Items.iron_ingot,
'G', Blocks.glass);
// STABILISER
Proxies.common.addRecipe(ForestryBlock.alveary.getItemStack(1, 6),
Proxies.common.addRecipe(ForestryBlock.alveary.getItemStack(1, TileAlveary.STABILIZER_META),
"G G",
"GXG",
"G G",
'X', ForestryBlock.alveary,
'G', Items.quartz);
// SIEVE
Proxies.common.addRecipe(ForestryBlock.alveary.getItemStack(1, TileAlvearySieve.BLOCK_META),
Proxies.common.addRecipe(ForestryBlock.alveary.getItemStack(1, TileAlveary.SIEVE_META),
"III",
" X ",
"WWW",
@@ -1091,17 +1087,8 @@ public class PluginApiculture extends ForestryPlugin {
}
return true;
} else if (message.key.equals("add-alveary-slab") && message.isStringMessage()) {
try {
Block block = GameData.getBlockRegistry().getRaw(message.getStringValue());
if (block != null && block != Blocks.air) {
StructureLogicAlveary.addSlabBlock(block);
} else {
logInvalidIMCMessage(message);
}
} catch (Exception e) {
logInvalidIMCMessage(message);
}
String messageString = String.format("Received a '%s' request from mod '%s'. This IMC message has been replaced with the oreDictionary for 'slabWood'. Please contact the author and report this issue.", message.key, message.getSender());
Proxies.log.warning(messageString);
return true;
}
@@ -20,7 +20,6 @@ import cpw.mods.fml.common.network.IGuiHandler;
import forestry.core.GameMode;
import forestry.core.config.Defaults;
import forestry.core.config.ForestryBlock;
import forestry.core.config.ForestryItem;
import forestry.core.gadgets.BlockBase;
import forestry.core.gadgets.MachineDefinition;
import forestry.core.items.ItemForestryBlock;
@@ -40,17 +40,9 @@ import forestry.core.items.ItemTypedBlock;
import forestry.core.proxy.Proxies;
import forestry.core.utils.ShapedRecipeCustom;
import forestry.farming.EventHandlerFarming;
import forestry.farming.FarmHelper;
import forestry.farming.GuiHandlerFarming;
import forestry.farming.circuits.CircuitFarmLogic;
import forestry.farming.gadgets.BlockFarm;
import forestry.farming.gadgets.BlockMushroom;
import forestry.farming.gadgets.EnumFarmBlock;
import forestry.farming.gadgets.TileControl;
import forestry.farming.gadgets.TileFarmPlain;
import forestry.farming.gadgets.TileGearbox;
import forestry.farming.gadgets.TileHatch;
import forestry.farming.gadgets.TileValve;
import forestry.farming.items.ItemFarmBlock;
import forestry.farming.logic.FarmLogicArboreal;
import forestry.farming.logic.FarmLogicCereal;
@@ -71,6 +63,13 @@ import forestry.farming.logic.FarmableGourd;
import forestry.farming.logic.FarmableStacked;
import forestry.farming.logic.FarmableVanillaSapling;
import forestry.farming.logic.FarmableVanillaShroom;
import forestry.farming.multiblock.BlockFarm;
import forestry.farming.multiblock.EnumFarmBlockTexture;
import forestry.farming.multiblock.TileControl;
import forestry.farming.multiblock.TileFarmPlain;
import forestry.farming.multiblock.TileGearbox;
import forestry.farming.multiblock.TileHatch;
import forestry.farming.multiblock.TileValve;
import forestry.farming.proxy.ProxyFarming;
import forestry.farming.triggers.FarmingTriggers;
@@ -82,13 +81,6 @@ public class PluginFarming extends ForestryPlugin {
public static int modelIdFarmBlock;
public static ItemStack farmFertilizer;
@Override
protected void setupAPI() {
super.setupAPI();
Farmables.farmInterface = new FarmHelper();
}
@Override
public void preInit() {
super.preInit();
@@ -283,7 +275,7 @@ public class PluginFarming extends ForestryPlugin {
protected void registerRecipes() {
ItemStack basic = ForestryBlock.farm.getItemStack(1, 0);
for (EnumFarmBlock block : EnumFarmBlock.values()) {
for (EnumFarmBlockTexture block : EnumFarmBlockTexture.values()) {
NBTTagCompound compound = new NBTTagCompound();
block.saveToCompound(compound);
@@ -249,7 +249,7 @@ public class PluginHarvestCraft extends ForestryPlugin {
Block grainBlock = GameRegistry.findBlock(HC, "pam" + grainName + "Crop");
if (grain != null && wheatamount.stackSize > 0) {
Proxies.common.addRecipe(wheatamount, " X ", "X#X", " X ", '#', Blocks.dirt, 'X', grain);
FuelManager.moistenerResource.put(grain, new MoistenerFuel(grain, ForestryItem.mouldyWheat.getItemStack(), 0, 300));
FuelManager.moistenerResource.put(grain, new MoistenerFuel(grain, ForestryItem.mouldyWheat.getItemStack(), 0, 300));
}
if (grainSeed != null) {
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{grainSeed}, Fluids.SEEDOIL.getFluid(seedamount));
@@ -260,7 +260,7 @@ public class PluginNatura extends ForestryPlugin {
ItemStack compostWheat = GameMode.getGameMode().getStackSetting("recipe.output.compost.wheat");
Proxies.common.addRecipe(compostWheat, " X ", "X#X", " X ", '#', Blocks.dirt, 'X', itemBarley);
}
FuelManager.moistenerResource.put(itemBarley, new MoistenerFuel(itemBarley, ForestryItem.mouldyWheat.getItemStack(), 0, 300));
FuelManager.moistenerResource.put(itemBarley, new MoistenerFuel(itemBarley, ForestryItem.mouldyWheat.getItemStack(), 0, 300));
}
}
@@ -448,8 +448,9 @@ public class PluginPlantMegaPack extends ForestryPlugin {
}
if (flowerStack != null && flowerBlock != null) {
Farmables.farmables.get("farmWheat").add(new FarmableGenericCrop(flowerStack, flowerBlock, flower.getValue()));
if( flower.getValue() < 5 )
Farmables.farmables.get("farmOrchard").add(new FarmableBasicFruit(flowerBlock, flower.getValue()));
if (flower.getValue() < 5) {
Farmables.farmables.get("farmOrchard").add(new FarmableBasicFruit(flowerBlock, flower.getValue()));
}
}
}
}
@@ -126,22 +126,22 @@ public class PluginStorage extends ForestryPlugin {
BackpackManager.definitions.put(definition.getKey(), definition);
}
definition = new BackpackDefinition("miner", new Color(0x36187d).getRGB());
definition = new BackpackDefinition("miner", new Color(0x36187d).getRGB());
BackpackManager.definitions.put(definition.getKey(), definition);
definition = new BackpackDefinition("digger", new Color(0x363cc5).getRGB());
definition = new BackpackDefinition("digger", new Color(0x363cc5).getRGB());
BackpackManager.definitions.put(definition.getKey(), definition);
definition = new BackpackDefinition("forester", new Color(0x347427).getRGB());
definition = new BackpackDefinition("forester", new Color(0x347427).getRGB());
BackpackManager.definitions.put(definition.getKey(), definition);
definition = new BackpackDefinition("hunter", new Color(0x412215).getRGB());
definition = new BackpackDefinition("hunter", new Color(0x412215).getRGB());
BackpackManager.definitions.put(definition.getKey(), definition);
definition = new BackpackDefinition("adventurer", new Color(0x7fb8c2).getRGB());
definition = new BackpackDefinition("adventurer", new Color(0x7fb8c2).getRGB());
BackpackManager.definitions.put(definition.getKey(), definition);
definition = new BackpackDefinition("builder", new Color(0xdd3a3a).getRGB());
definition = new BackpackDefinition("builder", new Color(0xdd3a3a).getRGB());
BackpackManager.definitions.put(definition.getKey(), definition);
}