Fix crash on startup - wrong name FORESTRY (need Forestry)
Fix genesis crash
Some refactoring
This commit is contained in:
kordum committed 2017-06-03 11:13:26 +03:00
1 parent 2f683650c0
commit 57088f03d7
10 files changed
+32 -51

No files matched your search

@@ -339,12 +339,7 @@ public class GardenLogic extends FarmLogic {
try {
IOwnable housing2 = (IOwnable) housing;
GameProfile prof;
if (Mods.forestry.dev()) {
prof = (GameProfile) IOwnable.class.getMethod("getOwner", new Class[0]).invoke(housing2);
} else {
prof = (GameProfile) IOwnable.class.getMethod("getOwnerProfile", new Class[0]).invoke(housing2);
}
GameProfile prof = (GameProfile) IOwnable.class.getMethod("getOwnerProfile", new Class[0]).invoke(housing2);
((TileEntityFlower) tile).setOwner(prof);
} catch (Exception ex) {
// ignored
@@ -212,7 +212,7 @@ public class ModuleGardening implements IInitializable {
));
ModuleGardening.queuedAcidFertilisers.put(BotanyItems.SulphurPowder.get(1), 1);
ModuleGardening.queuedAcidFertilisers.put(BotanyItems.MulchPowder.get(1), 1);
ModuleGardening.queuedAcidFertilisers.put(new ItemStack(GameRegistry.findItem("FORESTRY", "mulch")), 2);
ModuleGardening.queuedAcidFertilisers.put(new ItemStack(GameRegistry.findItem("Forestry", "mulch")), 2);
for (ItemStack stack : OreDictionary.getOres("dustSulfur")) {
ModuleGardening.queuedAcidFertilisers.put(stack, 2);
@@ -220,12 +220,12 @@ public class ModuleGardening implements IInitializable {
ModuleGardening.queuedAlkalineFertilisers.put(BotanyItems.AshPowder.get(1), 1);
ModuleGardening.queuedAlkalineFertilisers.put(BotanyItems.PulpPowder.get(1), 1);
ModuleGardening.queuedAlkalineFertilisers.put(new ItemStack(GameRegistry.findItem("FORESTRY", "ash")), 2);
ModuleGardening.queuedAlkalineFertilisers.put(new ItemStack(GameRegistry.findItem("FORESTRY", "woodPulp")), 2);
ModuleGardening.queuedAlkalineFertilisers.put(new ItemStack(GameRegistry.findItem("Forestry", "ash")), 2);
ModuleGardening.queuedAlkalineFertilisers.put(new ItemStack(GameRegistry.findItem("Forestry", "woodPulp")), 2);
ModuleGardening.queuedNutrientFertilisers.put(BotanyItems.CompostPowder.get(1), 1);
ModuleGardening.queuedNutrientFertilisers.put(BotanyItems.FertiliserPowder.get(1), 1);
ModuleGardening.queuedNutrientFertilisers.put(new ItemStack(GameRegistry.findItem("FORESTRY", "fertilizerBio")), 2);
ModuleGardening.queuedNutrientFertilisers.put(new ItemStack(GameRegistry.findItem("FORESTRY", "fertilizerCompound")), 2);
ModuleGardening.queuedNutrientFertilisers.put(new ItemStack(GameRegistry.findItem("Forestry", "fertilizerBio")), 2);
ModuleGardening.queuedNutrientFertilisers.put(new ItemStack(GameRegistry.findItem("Forestry", "fertilizerCompound")), 2);
for (Map.Entry<ItemStack, Integer> entry : ModuleGardening.queuedAcidFertilisers.entrySet()) {
addAcidFertiliser(entry.getKey(), entry.getValue());
+1 -1
View File
@@ -1,13 +1,13 @@
package binnie.core;
import binnie.Binnie;
import binnie.botany.items.ItemFieldKit;
import binnie.core.block.MultipassBlockRenderer;
import binnie.core.block.TileEntityMetadata;
import binnie.core.craftgui.minecraft.ModuleCraftGUI;
import binnie.core.gui.BinnieCoreGUI;
import binnie.core.gui.BinnieGUIHandler;
import binnie.core.gui.IBinnieGUID;
import binnie.botany.items.ItemFieldKit;
import binnie.core.item.ItemGenesis;
import binnie.core.item.ModuleItems;
import binnie.core.liquid.FluidContainer;
+5 -20
View File
@@ -2,8 +2,6 @@ package binnie.core;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.versioning.DefaultArtifactVersion;
import cpw.mods.fml.common.versioning.Restriction;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -12,11 +10,10 @@ public class Mods {
public static Mod forestry;
public static Mod ic2;
public static Mod botania;
private static boolean warn;
private static Item findItem(String modId, String name) {
Item stack = GameRegistry.findItem(modId, name);
if (stack == null && Mods.warn && modId.equals("FORESTRY")) {
if (stack == null && modId.equals("Forestry")) {
throw new RuntimeException("Item not found: " + modId + ":" + name);
}
return stack;
@@ -24,7 +21,7 @@ public class Mods {
private static ItemStack findItemStack(String modId, String name, int stackSize) {
ItemStack stack = GameRegistry.findItemStack(modId, name, stackSize);
if (stack == null && Mods.warn && modId.equals("FORESTRY")) {
if (stack == null && modId.equals("Forestry")) {
throw new RuntimeException("Stack not found: " + modId + ":" + name);
}
return stack;
@@ -32,24 +29,16 @@ public class Mods {
private static Block findBlock(String modId, String name) {
Block stack = GameRegistry.findBlock(modId, name);
if (stack == null && Mods.warn && modId.equals("FORESTRY")) {
if (stack == null && modId.equals("Forestry")) {
throw new RuntimeException("Block not found: " + modId + ":" + name);
}
return stack;
}
static {
Mods.forestry = new Mod("FORESTRY") {
@Override
public boolean dev() {
String forVersion = Loader.instance().getIndexedModList().get("FORESTRY").getVersion();
Restriction rest = new Restriction(new DefaultArtifactVersion("3.6"), true, null, false);
return rest.containsVersion(new DefaultArtifactVersion(forVersion));
}
};
Mods.forestry = new Mod("Forestry");
Mods.ic2 = new Mod("IC2");
Mods.botania = new Mod("BOTANIA");
Mods.warn = true;
Mods.botania = new Mod("Botania");
}
public static class Mod {
@@ -82,9 +71,5 @@ public class Mods {
public boolean active() {
return Loader.isModLoaded(id);
}
public boolean dev() {
return false;
}
}
}
@@ -5,15 +5,15 @@ import net.minecraft.util.EnumChatFormatting;
public class MinecraftTooltip extends Tooltip {
public static int getOutline(ITooltipType type) {
return TypeColour.valueOf(type.toString()).getOutline();
return TypeColor.valueOf(type.toString()).getOutline();
}
public static String getTitle(ITooltipType type) {
return TypeColour.valueOf(type.toString()).getTitle();
return TypeColor.valueOf(type.toString()).getTitle();
}
public static String getBody(ITooltipType type) {
return TypeColour.valueOf(type.toString()).getBody();
return TypeColor.valueOf(type.toString()).getBody();
}
public enum Type implements ITooltipType {
@@ -21,20 +21,20 @@ public class MinecraftTooltip extends Tooltip {
WARNING
}
private enum TypeColour {
Standard(5243135, EnumChatFormatting.WHITE, EnumChatFormatting.GRAY),
Help(5046016, EnumChatFormatting.GREEN, EnumChatFormatting.DARK_GREEN),
Information(49151, EnumChatFormatting.AQUA, EnumChatFormatting.DARK_AQUA),
Error(16724224, EnumChatFormatting.RED, EnumChatFormatting.DARK_RED),
Warning(16752384, EnumChatFormatting.YELLOW, EnumChatFormatting.GOLD),
User(9839667, EnumChatFormatting.RED, EnumChatFormatting.DARK_RED),
Power(9006592, EnumChatFormatting.YELLOW, EnumChatFormatting.GOLD);
private enum TypeColor {
STANDARD(0x5000ff, EnumChatFormatting.WHITE, EnumChatFormatting.GRAY),
HELP(0x4cff00, EnumChatFormatting.GREEN, EnumChatFormatting.DARK_GREEN),
INFORMATION(0x00bfff, EnumChatFormatting.AQUA, EnumChatFormatting.DARK_AQUA),
ERROR(0xff3100, EnumChatFormatting.RED, EnumChatFormatting.DARK_RED),
WARNING(0xff9f00, EnumChatFormatting.YELLOW, EnumChatFormatting.GOLD),
USER(0x962433, EnumChatFormatting.RED, EnumChatFormatting.DARK_RED),
POWER(0x896e00, EnumChatFormatting.YELLOW, EnumChatFormatting.GOLD);
int outline;
String mainText;
String bodyText;
TypeColour(int outline, EnumChatFormatting mainText, EnumChatFormatting bodyText) {
TypeColor(int outline, EnumChatFormatting mainText, EnumChatFormatting bodyText) {
this.outline = outline;
this.mainText = mainText.toString();
this.bodyText = bodyText.toString();
@@ -36,6 +36,7 @@ public enum FluidContainer {
} else {
modName = "forestry";
}
bottle = BinnieCore.proxy.getIcon(register, modName, liquidName + ".bottle");
contents = BinnieCore.proxy.getIcon(register, modName, liquidName + ".contents");
}
@@ -164,7 +164,7 @@ public class AlvearyStimulator {
@Override
public String getTooltip() {
return "FORESTRY Circuits";
return "Forestry Circuits";
}
}
@@ -67,11 +67,11 @@ public class ModuleBlocks implements IInitializable {
OreDictionary.registerOre("plankWood", plank2.getStack());
}
FMLInterModComms.sendMessage("FORESTRY", "add-fence-block", "ExtraTrees:fence");
FMLInterModComms.sendMessage("FORESTRY", "add-fence-block", "ExtraTrees:gate");
// FMLInterModComms.sendMessage("FORESTRY", "add-alveary-slab",
FMLInterModComms.sendMessage("Forestry", "add-fence-block", "ExtraTrees:fence");
FMLInterModComms.sendMessage("Forestry", "add-fence-block", "ExtraTrees:gate");
// FMLInterModComms.sendMessage("Forestry", "add-alveary-slab",
// "ExtraTrees:slab");
FMLInterModComms.sendMessage("FORESTRY", "add-fence-block", "ExtraTrees:multifence");
FMLInterModComms.sendMessage("Forestry", "add-fence-block", "ExtraTrees:multifence");
ModuleBlocks.hedgeRenderID = BinnieCore.proxy.getUniqueRenderID();
}
@@ -8,7 +8,7 @@ import binnie.core.mod.config.PropBoolean;
public class ConfigurationMain {
@ConfigProperty(
key = "lemon.citrus.family",
comment = {"Uses reflection to convert the FORESTRY lemon tree to the Citrus family."}
comment = {"Uses reflection to convert the Forestry lemon tree to the Citrus family."}
)
@PropBoolean
public static boolean alterLemon = true;