mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-25 22:44:38 +00:00
Fix #252 Server startup Crash
This commit is contained in:
1 parent
b18c195aa9
commit
ad20fa2ffc
28 files changed
+120
-102
No files matched your search
@@ -40,7 +40,7 @@ public class Botany extends BlankModuleContainer {
|
||||
@Mod.EventHandler
|
||||
public void preInit(FMLPreInitializationEvent evt) {
|
||||
preInit();
|
||||
ModuleManager.register(evt, this);
|
||||
ModuleManager.runRegisterItemsAndBlocks(this);
|
||||
ModuleManager.runPreInit(evt, this);
|
||||
getProxy().registerModels();
|
||||
}
|
||||
|
||||
@@ -131,19 +131,7 @@ public class BlockFlower extends BlockContainer implements IColoredBlock, IState
|
||||
return FULL_BLOCK_AABB;
|
||||
}
|
||||
}
|
||||
return FLOWER_BLOCK_AABB.move(getOffset(state, source, pos));
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getSelectedBoundingBox(IBlockState state, World world, BlockPos pos) {
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
if (tile instanceof TileEntityFlower) {
|
||||
TileEntityFlower flower = (TileEntityFlower) tile;
|
||||
if (flower.getType().getSections() > 1) {
|
||||
return FULL_BLOCK_AABB.offset(pos);
|
||||
}
|
||||
}
|
||||
return FLOWER_BLOCK_AABB.offset(pos).move(getOffset(state, world, pos));
|
||||
return FLOWER_BLOCK_AABB.offset(getOffset(state, source, pos));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -5,6 +5,9 @@ import java.util.Locale;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import binnie.botany.modules.ModuleGardening;
|
||||
import binnie.core.item.IItemMiscProvider;
|
||||
import binnie.core.util.I18N;
|
||||
@@ -26,6 +29,7 @@ public enum BotanyItems implements IItemMiscProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(List<String> tooltip) {
|
||||
if(this == MORTAR){
|
||||
tooltip.add(I18N.localise("item.botany.mortar.tooltip"));
|
||||
|
||||
@@ -5,6 +5,9 @@ import java.util.Locale;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import binnie.botany.modules.ModuleCeramic;
|
||||
import binnie.core.item.IItemMiscProvider;
|
||||
import binnie.core.util.I18N;
|
||||
@@ -19,6 +22,7 @@ public enum CeramicItems implements IItemMiscProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(List<String> tooltip) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
@@ -29,7 +29,9 @@ public class ItemDatabaseBotany extends ItemBotany implements IItemModelRegister
|
||||
@Override
|
||||
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> items) {
|
||||
if (this.isInCreativeTab(tab)) {
|
||||
items.add(new ItemStack(this, 1, 1));
|
||||
for(int i = 0;i < 2;i++) {
|
||||
items.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,23 +1,21 @@
|
||||
package binnie.botany.items;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.google.common.collect.ArrayListMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
|
||||
@@ -5,8 +5,9 @@ import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
import net.minecraftforge.oredict.RecipeSorter;
|
||||
|
||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
|
||||
import binnie.Constants;
|
||||
@@ -28,6 +29,7 @@ import binnie.botany.recipes.CeramicTileRecipe;
|
||||
import binnie.botany.recipes.PigmentRecipe;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.core.item.ItemMisc;
|
||||
import binnie.core.util.RecipeUtil;
|
||||
import binnie.extratrees.carpentry.ItemDesign;
|
||||
import binnie.modules.BinnieModule;
|
||||
import binnie.modules.Module;
|
||||
@@ -67,18 +69,24 @@ public class ModuleCeramic extends Module {
|
||||
OreDictionary.registerOre("pigment", pigment);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
RecipeSorter.register("botany:ceramictile", CeramicTileRecipe.class, RecipeSorter.Category.SHAPED, "");
|
||||
RecipeSorter.register("botany:pigment", PigmentRecipe.class, RecipeSorter.Category.SHAPED, "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
GameRegistry.addRecipe(new CeramicTileRecipe());
|
||||
RecipeUtil recipeUtil = new RecipeUtil(Constants.BOTANY_MOD_ID);
|
||||
ForgeRegistries.RECIPES.register(new CeramicTileRecipe());
|
||||
|
||||
if(ModuleManager.isEnabled(Constants.BOTANY_MOD_ID, BotanyModuleUIDs.GARDENING)){
|
||||
GameRegistry.addShapelessRecipe(CeramicItems.MORTAR.get(1), BotanyItems.MORTAR.get(1));
|
||||
recipeUtil.addShapelessRecipe("mortar_old", CeramicItems.MORTAR.get(1), BotanyItems.MORTAR.get(1));
|
||||
}
|
||||
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(pigment, 2, EnumFlowerColor.Black.ordinal()), "pigment", "pigment", "dyeBlack"
|
||||
));
|
||||
recipeUtil.addShapelessRecipe("pigment_black", new ItemStack(pigment, 2, EnumFlowerColor.Black.ordinal()), "pigment", "pigment", "dyeBlack");
|
||||
|
||||
GameRegistry.addRecipe(CeramicItems.MORTAR.get(6),
|
||||
recipeUtil.addRecipe("mortar", CeramicItems.MORTAR.get(6),
|
||||
" c ",
|
||||
"cgc",
|
||||
" c ",
|
||||
@@ -87,12 +95,12 @@ public class ModuleCeramic extends Module {
|
||||
for (EnumFlowerColor c : EnumFlowerColor.values()) {
|
||||
ItemStack clay = new ItemStack(ModuleCeramic.clay, 1, c.ordinal());
|
||||
ItemStack pigment = new ItemStack(ModuleCeramic.pigment, 1, c.ordinal());
|
||||
GameRegistry.addShapelessRecipe(clay, Items.CLAY_BALL, Items.CLAY_BALL, Items.CLAY_BALL, pigment);
|
||||
recipeUtil.addShapelessRecipe("clay_" + c.getIdent(), clay, Items.CLAY_BALL, Items.CLAY_BALL, Items.CLAY_BALL, pigment);
|
||||
GameRegistry.addSmelting(clay, TileEntityMetadata.getItemStack(ceramic, c.ordinal()), 0.0f);
|
||||
ItemStack glass = TileEntityMetadata.getItemStack(stained, c.ordinal());
|
||||
glass.setCount(4);
|
||||
|
||||
GameRegistry.addShapedRecipe(
|
||||
recipeUtil.addRecipe("mortar_" + c.getIdent(),
|
||||
glass,
|
||||
" g ",
|
||||
"gpg",
|
||||
@@ -101,6 +109,6 @@ public class ModuleCeramic extends Module {
|
||||
'p', pigment
|
||||
);
|
||||
}
|
||||
GameRegistry.addRecipe(new PigmentRecipe());
|
||||
ForgeRegistries.RECIPES.register(new PigmentRecipe());
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@ public class ModuleDatabase extends Module {
|
||||
public static ItemDatabaseBotany database;
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
public void registerItemsAndBlocks() {
|
||||
database = new ItemDatabaseBotany();
|
||||
Botany.proxy.registerItem(database);
|
||||
}
|
||||
|
||||
@@ -7,15 +7,16 @@ import java.util.Set;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
|
||||
import binnie.Constants;
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.api.gardening.EnumAcidity;
|
||||
import binnie.botany.api.gardening.EnumMoisture;
|
||||
import binnie.botany.farming.CircuitGarden;
|
||||
import binnie.botany.items.EnumTubeInsulate;
|
||||
import binnie.botany.items.EnumTubeMaterial;
|
||||
import binnie.botany.items.ItemInsulatedTube;
|
||||
import binnie.core.Mods;
|
||||
import binnie.core.util.RecipeUtil;
|
||||
import binnie.modules.BinnieModule;
|
||||
import binnie.modules.Module;
|
||||
|
||||
@@ -29,7 +30,7 @@ public class ModuleFarming extends Module {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
public void registerItemsAndBlocks() {
|
||||
insulatedTube = new ItemInsulatedTube();
|
||||
Botany.proxy.registerItem(insulatedTube);
|
||||
}
|
||||
@@ -65,12 +66,14 @@ public class ModuleFarming extends Module {
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
for (int mat = 0; mat < 4; ++mat) {
|
||||
for (int insulate = 0; insulate < 6; ++insulate) {
|
||||
ItemStack tubes = new ItemStack(insulatedTube, 2, mat + 128 * insulate);
|
||||
for (EnumTubeMaterial mat: EnumTubeMaterial.VALUES) {
|
||||
RecipeUtil recipeUtil = new RecipeUtil(Constants.BOTANY_MOD_ID);
|
||||
for (EnumTubeInsulate insulate : EnumTubeInsulate.VALUES) {
|
||||
ItemStack tubes = new ItemStack(insulatedTube, 2, mat.ordinal() + 128 * insulate.ordinal());
|
||||
ItemStack insulateStack = ItemInsulatedTube.getInsulateStack(tubes);
|
||||
ItemStack forestryTube = new ItemStack(Mods.Forestry.item("thermionic_tubes"), 1, mat);
|
||||
GameRegistry.addShapelessRecipe(tubes, forestryTube, forestryTube, insulateStack);
|
||||
ItemStack forestryTube = new ItemStack(Mods.Forestry.item("thermionic_tubes"), 1, mat.ordinal());
|
||||
String recipeName = "thermionic_tubes_" + insulate.getUid() + "_" + mat.getUid();
|
||||
recipeUtil.addShapelessRecipe(recipeName, tubes, forestryTube, forestryTube, insulateStack);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,11 +25,11 @@ import net.minecraftforge.event.world.BlockEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
import forestry.api.apiculture.FlowerManager;
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.storage.BackpackManager;
|
||||
import forestry.api.storage.IBackpackInterface;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
import forestry.storage.BackpackDefinition;
|
||||
|
||||
import binnie.Constants;
|
||||
@@ -49,6 +49,7 @@ import binnie.botany.genetics.allele.AlleleEffectNone;
|
||||
import binnie.botany.items.ItemFlowerGE;
|
||||
import binnie.botany.tile.TileEntityFlower;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.util.RecipeUtil;
|
||||
import binnie.modules.BinnieModule;
|
||||
import binnie.modules.Module;
|
||||
|
||||
@@ -112,8 +113,9 @@ public class ModuleFlowers extends Module {
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
forestry.api.apiculture.FlowerManager.flowerRegistry.registerAcceptableFlower(flower, "flowersVanilla");
|
||||
RecipeUtil.addRecipe(botanistBackpack,
|
||||
RecipeUtil recipeUtil = new RecipeUtil(Constants.GENETICS_MOD_ID);
|
||||
FlowerManager.flowerRegistry.registerAcceptableFlower(flower, "flowersVanilla");
|
||||
recipeUtil.addRecipe("botanist_backpack", botanistBackpack,
|
||||
"X#X",
|
||||
"VYZ",
|
||||
"X#X",
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package binnie.botany.modules;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -15,13 +16,9 @@ import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.BonemealEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.oredict.RecipeSorter;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
|
||||
import binnie.Constants;
|
||||
import binnie.botany.Botany;
|
||||
@@ -40,14 +37,13 @@ import binnie.botany.items.ItemSoil;
|
||||
import binnie.botany.items.ItemSoilMeter;
|
||||
import binnie.botany.items.ItemTrowel;
|
||||
import binnie.botany.items.ItemWeed;
|
||||
import binnie.botany.recipes.CeramicTileRecipe;
|
||||
import binnie.botany.recipes.PigmentRecipe;
|
||||
import binnie.botany.tile.TileCeramic;
|
||||
import binnie.botany.tile.TileCeramicBrick;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.Mods;
|
||||
import binnie.core.item.ItemMisc;
|
||||
import binnie.core.util.OreDictionaryUtil;
|
||||
import binnie.core.util.RecipeUtil;
|
||||
import binnie.modules.BinnieModule;
|
||||
import binnie.modules.Module;
|
||||
|
||||
@@ -69,8 +65,7 @@ public class ModuleGardening extends Module {
|
||||
public static ItemMisc misc;
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
public void registerItemsAndBlocks() {
|
||||
plant = new BlockPlant();
|
||||
soil = new BlockSoil(EnumSoilType.SOIL, "soil", false);
|
||||
loam = new BlockSoil(EnumSoilType.LOAM, "loam", false);
|
||||
@@ -117,64 +112,64 @@ public class ModuleGardening extends Module {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
RecipeSorter.register("botany:ceramictile", CeramicTileRecipe.class, RecipeSorter.Category.SHAPED, "");
|
||||
RecipeSorter.register("botany:pigment", PigmentRecipe.class, RecipeSorter.Category.SHAPED, "");
|
||||
public void preInit() {
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
RecipeUtil recipeUtil = new RecipeUtil(Constants.BOTANY_MOD_ID);
|
||||
IGardeningManager gardening = BotanyCore.getGardening();
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
recipeUtil.addRecipe("trowel_wood",
|
||||
trowelWood,
|
||||
"d ", " x ", " s",
|
||||
'd', Blocks.DIRT,
|
||||
's', "stickWood",
|
||||
'x', "plankWood")
|
||||
'x', "plankWood"
|
||||
);
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
recipeUtil.addRecipe("trowel_stone",
|
||||
trowelStone,
|
||||
"d ", " x ", " s",
|
||||
'd', Blocks.DIRT,
|
||||
's', "stickWood",
|
||||
'x', "cobblestone"
|
||||
));
|
||||
);
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
recipeUtil.addRecipe("trowel_iron",
|
||||
trowelIron,
|
||||
"d ", " x ", " s",
|
||||
'd', Blocks.DIRT,
|
||||
's', "stickWood",
|
||||
'x', "ingotIron"
|
||||
));
|
||||
);
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
recipeUtil.addRecipe("trowel_gold",
|
||||
trowelGold,
|
||||
"d ", " x ", " s",
|
||||
'd', Blocks.DIRT,
|
||||
's', "stickWood",
|
||||
'x', "ingotGold"
|
||||
));
|
||||
);
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
recipeUtil.addRecipe("trowel_diamond",
|
||||
trowelDiamond,
|
||||
"d ", " x ", " s",
|
||||
'd', Blocks.DIRT,
|
||||
's', "stickWood",
|
||||
'x', "gemDiamond"
|
||||
));
|
||||
);
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
recipeUtil.addRecipe("soil_meter",
|
||||
soilMeter,
|
||||
" gg", " rg", "i ",
|
||||
'g', "ingotGold",
|
||||
'r', "dustRedstone",
|
||||
'i', "ingotIron"
|
||||
));
|
||||
);
|
||||
|
||||
GameRegistry.addShapelessRecipe(
|
||||
recipeUtil.addShapelessRecipe("weed_killer",
|
||||
BotanyItems.WEEDKILLER.get(4),
|
||||
new ItemStack(Items.SPIDER_EYE),
|
||||
new ItemStack(Items.WHEAT_SEEDS),
|
||||
@@ -182,35 +177,35 @@ public class ModuleGardening extends Module {
|
||||
new ItemStack(Items.WHEAT_SEEDS)
|
||||
);
|
||||
|
||||
GameRegistry.addShapelessRecipe(
|
||||
recipeUtil.addShapelessRecipe("powder_ash",
|
||||
BotanyItems.POWDER_ASH.get(4),
|
||||
Mods.Forestry.stack("ash")
|
||||
);
|
||||
|
||||
GameRegistry.addShapelessRecipe(
|
||||
recipeUtil.addShapelessRecipe("powder_mulch",
|
||||
BotanyItems.POWDER_MULCH.get(4),
|
||||
Mods.Forestry.stack("mulch")
|
||||
);
|
||||
|
||||
GameRegistry.addShapelessRecipe(
|
||||
recipeUtil.addShapelessRecipe("powder_compost",
|
||||
BotanyItems.POWDER_COMPOST.get(4),
|
||||
Mods.Forestry.stack("fertilizer_bio")
|
||||
);
|
||||
|
||||
GameRegistry.addShapelessRecipe(
|
||||
recipeUtil.addShapelessRecipe("powder_fertilizer",
|
||||
BotanyItems.POWDER_FERTILISER.get(4),
|
||||
Mods.Forestry.stack("fertilizer_compound")
|
||||
);
|
||||
|
||||
GameRegistry.addShapelessRecipe(
|
||||
recipeUtil.addShapelessRecipe("powder_pulp",
|
||||
BotanyItems.POWDER_PULP.get(4),
|
||||
Mods.Forestry.stack("wood_pulp")
|
||||
);
|
||||
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(
|
||||
recipeUtil.addShapelessRecipe("pigment_black",
|
||||
BotanyItems.POWDER_SULPHUR.get(4),
|
||||
"dustSulphur"
|
||||
));
|
||||
);
|
||||
|
||||
gardening.registerFertiliser(EnumFertiliserType.ACID, BotanyItems.POWDER_SULPHUR.get(1), 1);
|
||||
gardening.registerFertiliser(EnumFertiliserType.ACID, BotanyItems.POWDER_MULCH.get(1), 1);
|
||||
@@ -229,7 +224,7 @@ public class ModuleGardening extends Module {
|
||||
gardening.registerFertiliser(EnumFertiliserType.NUTRIENT, Mods.Forestry.stack("fertilizer_bio"), 2);
|
||||
gardening.registerFertiliser(EnumFertiliserType.NUTRIENT, Mods.Forestry.stack("fertilizer_compound"), 2);
|
||||
|
||||
addFertiliserRecipes();
|
||||
addFertiliserRecipes(recipeUtil);
|
||||
}
|
||||
|
||||
private ItemStack getStack(EnumSoilType type, EnumAcidity pH, EnumMoisture moisture, boolean weedkiller) {
|
||||
@@ -237,7 +232,7 @@ public class ModuleGardening extends Module {
|
||||
return new ItemStack(gardeningManager.getSoilBlock(type, weedkiller), 1, BlockSoil.getMeta(pH, moisture));
|
||||
}
|
||||
|
||||
private void addFertiliserRecipes() {
|
||||
private void addFertiliserRecipes(RecipeUtil recipeUtil) {
|
||||
IGardeningManager gardening = BotanyCore.getGardening();
|
||||
for (EnumMoisture moisture : EnumMoisture.values()) {
|
||||
for (EnumAcidity acidity : EnumAcidity.values()) {
|
||||
@@ -271,7 +266,8 @@ public class ModuleGardening extends Module {
|
||||
stacks[i] = start;
|
||||
}
|
||||
stacks[numOfBlocks] = stack.copy();
|
||||
GameRegistry.addShapelessRecipe(end, stacks);
|
||||
String recipeName = fertiliserType.name().toLowerCase(Locale.ENGLISH) + "_fertiliser_moisture" + moisture + "_ph" + pH + "_type" + type + "_strength" + strength;
|
||||
recipeUtil.addShapelessRecipe(recipeName, end, stacks);
|
||||
}
|
||||
numOfBlocks /= 2;
|
||||
}
|
||||
@@ -280,7 +276,8 @@ public class ModuleGardening extends Module {
|
||||
}
|
||||
ItemStack start = getStack(type, acidity, moisture, false);
|
||||
ItemStack end = getStack(type, acidity, moisture, true);
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(end, start, start, start, start, "weedkiller"));
|
||||
String recipeName = "weedkiller_moisture" + moisture + "_ph" + pH + "_type" + type;
|
||||
recipeUtil.addShapelessRecipe(recipeName, end, start, start, start, start, "weedkiller");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package binnie.botany.recipes;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import binnie.Constants;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -13,10 +12,10 @@ import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
|
||||
import binnie.botany.ceramic.brick.CeramicBrickType;
|
||||
import binnie.botany.gardening.ModuleGardening;
|
||||
import net.minecraftforge.registries.IForgeRegistryEntry;
|
||||
|
||||
import binnie.Constants;
|
||||
import binnie.botany.ceramic.brick.CeramicBrickType;
|
||||
import binnie.botany.modules.ModuleCeramic;
|
||||
|
||||
public class CeramicTileRecipe extends IForgeRegistryEntry.Impl<IRecipe> implements IRecipe { private ItemStack cached = ItemStack.EMPTY;
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
package binnie.botany.recipes;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.Constants;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.minecraftforge.registries.IForgeRegistryEntry;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.Constants;
|
||||
import binnie.botany.api.genetics.IFlower;
|
||||
import binnie.botany.modules.ModuleCeramic;
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@ import binnie.core.proxy.IProxyCore;
|
||||
|
||||
public abstract class AbstractMod implements IPacketProvider, IInitializable {
|
||||
protected List<IInitializable> modules;
|
||||
protected List<String> enabledPlugins;
|
||||
|
||||
@Nullable
|
||||
private SimpleNetworkWrapper wrapper;
|
||||
|
||||
@@ -51,6 +51,7 @@ import binnie.core.network.IPacketID;
|
||||
import binnie.core.proxy.BinnieProxy;
|
||||
import binnie.core.proxy.IBinnieProxy;
|
||||
import binnie.core.triggers.ModuleTrigger;
|
||||
import binnie.modules.ModuleManager;
|
||||
|
||||
@Mod(
|
||||
modid = Constants.CORE_MOD_ID,
|
||||
@@ -160,6 +161,7 @@ public final class BinnieCore extends AbstractMod {
|
||||
|
||||
@Mod.EventHandler
|
||||
public void preInit(final FMLPreInitializationEvent evt) {
|
||||
ModuleManager.loadModules(evt);
|
||||
MinecraftForge.EVENT_BUS.register(Binnie.LIQUID);
|
||||
Binnie.CONFIGURATION.registerConfiguration(ConfigurationMods.class, this);
|
||||
for (FluidContainerType container : FluidContainerType.getBinnieContainers()) {
|
||||
|
||||
@@ -2,8 +2,12 @@ package binnie.core.item;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public interface IItemMiscProvider extends IItemEnum {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
void addInformation(List<String> tooltip);
|
||||
|
||||
String getModelPath();
|
||||
|
||||
@@ -5,12 +5,11 @@ import java.util.List;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
|
||||
@@ -7,6 +7,9 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import binnie.extrabees.ExtraBees;
|
||||
|
||||
public enum ExtraBeeItems implements IEBItemMiscProvider {
|
||||
@@ -95,6 +98,7 @@ public enum ExtraBeeItems implements IEBItemMiscProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(final List<String> tooltip) {
|
||||
}
|
||||
|
||||
|
||||
@@ -2,8 +2,12 @@ package binnie.extrabees.items.types;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public interface IEBItemMiscProvider extends IEBEnumItem {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
void addInformation(List<String> tooltip);
|
||||
|
||||
String getModelPath();
|
||||
|
||||
@@ -143,6 +143,7 @@ public abstract class BlockDesign extends BlockMetadata implements IMultipassBlo
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, @Nullable World player, List<String> tooltip, ITooltipFlag advanced) {
|
||||
DesignBlock block = ModuleCarpentry.getDesignBlock(this.getDesignSystem(), TileEntityMetadata.getItemDamage(stack));
|
||||
if (block.getPrimaryMaterial() != block.getSecondaryMaterial()) {
|
||||
|
||||
@@ -4,6 +4,9 @@ import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import binnie.core.item.IItemMiscProvider;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
@@ -35,6 +38,7 @@ public enum ExtraTreeItems implements IItemMiscProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(final List<String> tooltip) {
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,9 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.core.fluids.Fluids;
|
||||
|
||||
@@ -166,6 +169,7 @@ public enum Food implements IItemMiscProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(final List<String> tooltip) {
|
||||
}
|
||||
|
||||
|
||||
@@ -5,13 +5,12 @@ import java.util.List;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemFood;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -52,6 +51,7 @@ public class ItemETFood extends ItemFood implements IItemModelRegister {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, @Nullable World worldIn, List<String> tooltip, ITooltipFlag flagIn) {
|
||||
IItemMiscProvider item = this.getItem(stack.getItemDamage());
|
||||
item.addInformation(tooltip);
|
||||
|
||||
@@ -43,6 +43,7 @@ public class ItemMothDatabase extends Item implements IItemModelRegister {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, @Nullable World worldIn, List<String> tooltip, ITooltipFlag flagIn) {
|
||||
if (isMaster(stack)) {
|
||||
tooltip.add(TextFormatting.DARK_PURPLE + I18N.localise("extratrees.item.database.lepi.master.tooltip"));
|
||||
|
||||
@@ -5,6 +5,9 @@ import java.util.List;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import binnie.core.item.IItemMiscProvider;
|
||||
import binnie.genetics.Genetics;
|
||||
|
||||
@@ -35,6 +38,7 @@ public enum GeneticsItems implements IItemMiscProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(final List<String> tooltip) {
|
||||
}
|
||||
|
||||
|
||||
@@ -26,11 +26,6 @@ public abstract class BlankModuleContainer extends AbstractMod implements IModul
|
||||
this.unloadedModules = new LinkedHashSet<>();
|
||||
this.enabledModules = new LinkedHashSet<>();
|
||||
this.disabledModules = new LinkedHashSet<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
super.preInit();
|
||||
configFolder = new File(Loader.instance().getConfigDir(), "forestry/" + getModID());
|
||||
}
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ public class ModuleManager {
|
||||
}
|
||||
}
|
||||
|
||||
private static void runRegisterItemsAndBlocks(IModuleContainer moduleContainer) {
|
||||
public static void runRegisterItemsAndBlocks(IModuleContainer moduleContainer) {
|
||||
stage = Stage.REGISTER;
|
||||
for (Module module : moduleContainer.getLoadedModules()) {
|
||||
Log.debug("Register Items and Blocks Start: {}", module);
|
||||
@@ -186,13 +186,7 @@ public class ModuleManager {
|
||||
stage = Stage.FINISHED;
|
||||
}
|
||||
|
||||
public static void register(FMLPreInitializationEvent event, IModuleContainer moduleContainer){
|
||||
if(stage == Stage.REGISTER){
|
||||
runRegisterItemsAndBlocks(moduleContainer);
|
||||
return;
|
||||
} else if (stage != Stage.SETUP){
|
||||
return;
|
||||
}
|
||||
public static void loadModules(FMLPreInitializationEvent event){
|
||||
ASMDataTable asmDataTable = event.getAsmData();
|
||||
Map<String, List<Module>> modules = ModuleHelper.getModules(asmDataTable);
|
||||
|
||||
@@ -215,8 +209,6 @@ public class ModuleManager {
|
||||
Log.debug("Disabled-Setup Complete: {}", module);
|
||||
}
|
||||
}
|
||||
|
||||
runRegisterItemsAndBlocks(moduleContainer);
|
||||
}
|
||||
|
||||
private static boolean isEnabled(Configuration config, Module module) {
|
||||
|
||||
Reference in new issue
Block a user