1.7.10 Port

Initial 1.7.10 Port. Everything seems to be working, but can't be tested
without access to Thaumcraft.
Got rid of Forestrys Item/BlockInterfaces and created my own.
Started to use @Optional.Interface
Implemented @Pahimar s LogHelper to deal with log4j
Changed localization system to use the vanilla one
This commit is contained in:
Arkandos committed 2014-08-01 04:05:49 +02:00
1 parent 5b053dd990
commit d3c6ad5433
28 files changed
+1581 -771

No files matched your search

@@ -81,7 +81,7 @@ public abstract class AlleleEffect extends Allele implements IAlleleBeeEffect
min[2] = housing.getZCoord() - area[2] / 2;
max[2] = housing.getZCoord() + area[2] / 2;
AxisAlignedBB bounds = AxisAlignedBB.getAABBPool().getAABB(min[0], min[1], min[2], max[0], max[1], max[2]);
AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox(min[0], min[1], min[2], max[0], max[1], max[2]);
return housing.getWorld().getEntitiesWithinAABB(EntityPlayer.class, bounds);
}
@@ -4,7 +4,7 @@ package magicbees.bees;
import cpw.mods.fml.common.registry.GameRegistry;
import forestry.api.apiculture.EnumBeeChromosome;
import forestry.api.apiculture.EnumBeeType;
import forestry.api.core.ItemInterface;
import magicbees.main.utils.ItemInterface;
import forestry.api.genetics.IAllele;
import magicbees.main.utils.compat.ExtraBeesHelper;
import net.minecraft.item.ItemStack;
@@ -1379,14 +1379,14 @@ public class BeeGenomeManager
switch (beeType)
{
case PRINCESS:
taggedBee = ItemInterface.getItem("beePrincessGE");
taggedBee = ItemInterface.getItemStack("beePrincessGE");
break;
case QUEEN:
taggedBee = ItemInterface.getItem("beeQueenGE");
taggedBee = ItemInterface.getItemStack("beeQueenGE");
break;
case DRONE:
default:
taggedBee = ItemInterface.getItem("beeDroneGE");
taggedBee = ItemInterface.getItemStack("beeDroneGE");
break;
}
File diff suppressed because it is too large. Load diff
@@ -31,7 +31,7 @@ public class TransmutationEffectRailcraft implements ITransmutationEffectLogic
{
boolean flag = false;
if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.FOREST) &&
!BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.FROZEN))
!BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.SNOWY))
{
ItemStack item = GameRegistry.findItemStack("Railcraft", "cube.stone.quarried", 1);
if (item != null)
@@ -21,7 +21,7 @@ public class TransmutationEffectVanilla implements ITransmutationEffectLogic
private boolean trySpawnSandstone(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z)
{
boolean flag = false;
if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.DESERT) &&
if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.SANDY) &&
OreDictionary.itemMatches(new ItemStack(Blocks.sand), sourceBlock, false))
{
world.setBlock(x, y, z, Blocks.sandstone);
@@ -74,7 +74,7 @@ public enum HiveType
UNUSUAL.drops.add(new HiveDrop(BeeGenomeManager.addRainResist(BeeSpecies.UNUSUAL.getGenome()), combs, 15));
UNUSUAL.drops.add(valiantDrop);
RESONANT.validBiomes.add(Type.DESERT);
RESONANT.validBiomes.add(Type.SANDY);
RESONANT.validBiomes.add(Type.MAGICAL);
RESONANT.drops.add(new HiveDrop(BeeSpecies.SORCEROUS.getGenome(), combs, 80).setIgnoblePercentage(0.7f));
RESONANT.drops.add(new HiveDrop(BeeGenomeManager.addRainResist(BeeSpecies.SORCEROUS.getGenome()), combs, 20));
@@ -0,0 +1,27 @@
package magicbees.item;
import forestry.core.items.ItemForestryBlock;
import magicbees.block.types.HiveType;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
/**
* Created by Allen on 7/29/2014.
*/
public class ItemMagicHive extends ItemForestryBlock {
public ItemMagicHive(Block block) {
super(block);
}
@Override
public String getUnlocalizedName(ItemStack itemstack) {
return getBlock().getUnlocalizedName() + "." + HiveType.getHiveFromMeta(itemstack.getItemDamage()).name().toLowerCase();
}
@Override
public String getItemStackDisplayName(ItemStack p_77653_1_)
{
return ("" + StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(p_77653_1_) + ".name")).trim();
}
}
@@ -1,5 +1,6 @@
package magicbees.item;
import cpw.mods.fml.common.Optional;
import magicbees.main.CommonProxy;
import magicbees.main.Config;
import magicbees.main.utils.compat.ThaumcraftHelper;
@@ -18,6 +19,10 @@ import forestry.api.arboriculture.IToolGrafter;
import java.util.HashSet;
import java.util.Set;
@Optional.InterfaceList(
{@Optional.Interface(iface = "IRepairableExtended", modid = "Thaumcraft", striprefs = true),
@Optional.Interface(iface = "IToolGrafter", modid = "forestry", striprefs = true)}
)
public class ItemThaumiumGrafter extends Item implements IRepairableExtended, IToolGrafter
{
public ItemThaumiumGrafter()
@@ -92,6 +97,7 @@ public class ItemThaumiumGrafter extends Item implements IRepairableExtended, IT
/**
* Return the enchantability factor of the item, most of the time is based on material.
*/
@Optional.Method(modid = "Thaumcraft")
public int getItemEnchantability()
{
return ThaumcraftApi.toolMatThaumium.getEnchantability();
@@ -100,6 +106,7 @@ public class ItemThaumiumGrafter extends Item implements IRepairableExtended, IT
/**
* Return the name for this tool's material.
*/
@Optional.Method(modid = "Thaumcraft")
public String getToolMaterialName()
{
return ThaumcraftApi.toolMatThaumium.toString();
@@ -108,6 +115,7 @@ public class ItemThaumiumGrafter extends Item implements IRepairableExtended, IT
/**
* Return whether this item is repairable in an anvil.
*/
@Optional.Method(modid = "Thaumcraft")
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
{
return ThaumcraftApi.toolMatThaumium.customCraftingMaterial == par2ItemStack.getItem() ? true : super.getIsRepairable
@@ -115,6 +123,7 @@ public class ItemThaumiumGrafter extends Item implements IRepairableExtended, IT
}
@Override
@Optional.Method(modid = "Thaumcraft")
public boolean doRepair(ItemStack stack, EntityPlayer player, int enchantLevel)
{
boolean flag = false;
@@ -1,5 +1,6 @@
package magicbees.item;
import cpw.mods.fml.common.Optional;
import magicbees.main.CommonProxy;
import net.minecraft.block.Block;
import net.minecraft.entity.EntityLivingBase;
@@ -14,6 +15,10 @@ import forestry.api.core.IToolScoop;
import java.util.HashSet;
import java.util.Set;
@Optional.InterfaceList(
{@Optional.Interface(iface = "IRepairable", modid = "Thaumcraft", striprefs = true),
@Optional.Interface(iface = "IToolScoop", modid = "forestry", striprefs = true)}
)
public class ItemThaumiumScoop extends Item implements IRepairable, IToolScoop
{
public ItemThaumiumScoop()
+4 -3
View File
@@ -227,11 +227,11 @@ public class Config
GameRegistry.registerTileEntity(TileEntityEffectJar.class, TileEntityEffectJar.tileEntityName);
hive = new BlockHive();
GameRegistry.registerBlock(hive, "hive");
GameRegistry.registerBlock(hive, ItemMagicHive.class, "hive");
for (HiveType t : HiveType.values())
{
hive.setHarvestLevel("scoop", t.ordinal(), 0);
hive.setHarvestLevel("scoop", 0, t.ordinal() );
}
FMLLog.info("Replacing stupid-block with 'Here, have some delicious textures' ItemBlock. This is 100%% normal.");
@@ -301,7 +301,7 @@ public class Config
jellyBaby = new ItemFood(1, false).setAlwaysEdible()
.setPotionEffect(Potion.moveSpeed.id, 5, 1, 1f);
jellyBaby.setUnlocalizedName(CommonProxy.DOMAIN + ":jellyBabies").setTextureName(CommonProxy.DOMAIN + ":jellyBabies");
GameRegistry.registerItem(jellyBaby, CommonProxy.DOMAIN + ":jellyBabies");
GameRegistry.registerItem(jellyBaby, "jellyBabies");
voidCapsule = new ItemCapsule(CapsuleType.VOID, this.CapsuleStackSizeMax);
@@ -330,6 +330,7 @@ public class Config
magnet.setBaseRange(MagnetBaseRange);
magnet.setLevelMultiplier(MagnetLevelMultiplier);
magnet.setMaximumLevel(MagnetMaxLevel);
GameRegistry.registerItem(magnet, "magnet", CommonProxy.DOMAIN);
for (int level = 0; level <= 8; level++)
{
+6 -5
View File
@@ -11,10 +11,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
import magicbees.bees.BeeManager;
import magicbees.bees.TransmutationEffectController;
import magicbees.client.gui.GUIHandler;
import magicbees.main.utils.CraftingManager;
import magicbees.main.utils.IMCManager;
import magicbees.main.utils.LocalizationManager;
import magicbees.main.utils.VersionInfo;
import magicbees.main.utils.*;
import magicbees.main.utils.compat.*;
import magicbees.world.WorldGeneratorHandler;
@@ -54,9 +51,10 @@ public class MagicBees
this.modConfig.setupBlocks();
this.modConfig.setupItems();
LocalizationManager.setupLocalizationInfo();
// LocalizationManager.setupLocalizationInfo();
new TransmutationEffectController();
LogHelper.info("Preinit completed");
}
@Mod.EventHandler
@@ -72,6 +70,8 @@ public class MagicBees
worldHandler = new WorldGeneratorHandler();
GameRegistry.registerWorldGenerator(worldHandler, 0);
LogHelper.info("Init completed");
}
@Mod.EventHandler
@@ -98,6 +98,7 @@ public class MagicBees
CraftingManager.registerLiquidContainers();
VersionInfo.doVersionCheck();
LogHelper.info("Postinit completed");
}
@Mod.EventHandler
@@ -0,0 +1,17 @@
package magicbees.main.utils;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
public class BlockInterface {
public static Block getBlock(String item)
{
return GameRegistry.findBlock("Forestry", item);
}
public static Block getBlock(String modId, String item)
{
return GameRegistry.findBlock(modId, item);
}
}
@@ -1,8 +1,8 @@
package magicbees.main.utils;
import cpw.mods.fml.common.registry.GameRegistry;
import forestry.api.core.BlockInterface;
import forestry.api.core.ItemInterface;
import magicbees.main.utils.BlockInterface;
import magicbees.main.utils.ItemInterface;
import forestry.api.recipes.RecipeManagers;
import magicbees.item.ItemCapsule;
import magicbees.item.types.*;
@@ -50,8 +50,7 @@ public class CraftingManager
// Concentrated Fertilizer -> Forestry fertilizer
input = Config.miscResources.getStackForType(ResourceType.EXTENDED_FERTILIZER);
output = ItemInterface.getItem("fertilizerCompound");
output.stackSize = 6;
output = ItemInterface.getItemStack("Forestry", "fertilizerCompound", 6);
GameRegistry.addRecipe(output, new Object[] {
" S ", " F ", " S ",
'F', input,
@@ -63,12 +62,11 @@ public class CraftingManager
'S', Blocks.sand
});
output = output.copy();
output.stackSize = 12;
output = output.copy();
GameRegistry.addRecipe(output, new Object[] {
"aaa", "aFa", "aaa",
'F', input,
'a', ItemInterface.getItem("ash")
'a', ItemInterface.getItemStack("ash")
});
// "bottling" Intellect drops
@@ -92,7 +90,7 @@ public class CraftingManager
});
output = new ItemStack(Config.hiveFrameMagic);
input = ItemInterface.getItem("frameUntreated");
input = ItemInterface.getItemStack("frameUntreated");
GameRegistry.addRecipe(output, new Object[] {
"www", "wfw", "www",
'w', Config.wax.getStackForType(WaxType.MAGIC),
@@ -239,7 +237,7 @@ public class CraftingManager
GameRegistry.addShapelessRecipe(new ItemStack(Config.hiveFrameOblivion), new Object[] {
Config.miscResources.getStackForType(ResourceType.ESSENCE_SCORNFUL_OBLIVION),
ItemInterface.getItem("frameProven")
ItemInterface.getItemStack("frameProven")
});
// </idiot>
@@ -303,7 +301,7 @@ public class CraftingManager
'x', "shardEmerald"
}));
GameRegistry.addRecipe(new ShapedOreRecipe(ItemInterface.getItem("apatite"), new Object[] {
GameRegistry.addRecipe(new ShapedOreRecipe(ItemInterface.getItemStack("apatite"), new Object[] {
"xxx", "xxx", "xxx",
'x', Config.nuggets.getStackForType(NuggetType.APATITE)
}));
@@ -410,7 +408,7 @@ public class CraftingManager
if (ArsMagicaHelper.isActive())
{
input = ItemInterface.getItem("apatite");
input = ItemInterface.getItemStack("apatite");
output = Config.miscResources.getStackForType(ResourceType.EXTENDED_FERTILIZER, 4);
GameRegistry.addShapelessRecipe(output, new Object[] {
new ItemStack(Config.amEssence, 1, ArsMagicaHelper.EssenceType.EARTH.ordinal()),
@@ -425,22 +423,22 @@ public class CraftingManager
private static void setupCentrifugeRecipes()
{
ItemStack beeswax = ItemInterface.getItem("beeswax");
ItemStack propolis = ItemInterface.getItem("propolis");
ItemStack beeswax = ItemInterface.getItemStack("beeswax");
ItemStack propolis = ItemInterface.getItemStack("propolis");
propolis.setItemDamage(ForestryHelper.Propolis.PULSATING.ordinal());
// 20 is the 'average' time to centrifuge a comb.
RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.MUNDANE),
new ItemStack[] {beeswax, ItemInterface.getItem("honeyDrop"),
new ItemStack[] {beeswax, ItemInterface.getItemStack("honeyDrop"),
Config.wax.getStackForType(WaxType.MAGIC)},
new int[] {90, 60, 10});
RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.MOLTEN),
new ItemStack[] {ItemInterface.getItem("refractoryWax"),
ItemInterface.getItem("honeyDrop")},
new ItemStack[] {ItemInterface.getItemStack("refractoryWax"),
ItemInterface.getItemStack("honeyDrop")},
new int[] {86, 8});
RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.FORGOTTEN),
new ItemStack[] {Config.wax.getStackForType(WaxType.AMNESIC), propolis,
ItemInterface.getItem("honeyDrop")},
ItemInterface.getItemStack("honeyDrop")},
new int[] {50, 50, 22});
RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.OCCULT),
new ItemStack[] {Config.wax.getStackForType(WaxType.MAGIC), GameRegistry.findItemStack("forestry",
@@ -448,10 +446,10 @@ public class CraftingManager
new int[] { 100, 60 });
RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.OTHERWORLDLY),
new ItemStack[] {beeswax, Config.wax.getStackForType(WaxType.MAGIC),
ItemInterface.getItem("honeyDrop") },
ItemInterface.getItemStack("honeyDrop") },
new int[] { 50, 20, 100 });
RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.PAPERY),
new ItemStack[] {ItemInterface.getItem("beeswax"),
new ItemStack[] {ItemInterface.getItemStack("beeswax"),
Config.wax.getStackForType(WaxType.MAGIC),
new ItemStack(Items.paper) },
new int[] { 80, 20, 5 });
@@ -461,8 +459,8 @@ public class CraftingManager
new int[] { 90, 40, 10 });
propolis.setItemDamage(ForestryHelper.Propolis.NORMAL.ordinal());
RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.FURTIVE),
new ItemStack[] {ItemInterface.getItem("beeswax"), propolis,
ItemInterface.getItem("honeydew") },
new ItemStack[] {ItemInterface.getItemStack("beeswax"), propolis,
ItemInterface.getItemStack("honeydew") },
new int[] { 90, 20, 35 });
RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.SOUL),
new ItemStack[] {Config.wax.getStackForType(WaxType.SOUL), GameRegistry.findItemStack("forestry",
@@ -472,7 +470,7 @@ public class CraftingManager
new ItemStack[] {Config.wax.getStackForType(WaxType.MAGIC), Config.pollen.getStackForType(PollenType.PHASED), new ItemStack(Config.fHoneydew, 1)},
new int[] {100, 5, 60});
RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.TRANSMUTED),
new ItemStack[] {ItemInterface.getItem("beeswax"),
new ItemStack[] {ItemInterface.getItemStack("beeswax"),
Config.wax.getStackForType(WaxType.MAGIC), Config.propolis.getStackForType(PropolisType.UNSTABLE)},
new int[] {80, 80, 15});
@@ -540,9 +538,9 @@ public class CraftingManager
new ItemStack[] {Config.wax.getStackForType(WaxType.MAGIC), new ItemStack(Config.amItemResource), new ItemStack(Config.amItemResource) },
new int[] { 85, 10, 2 } );
RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.AM_POTENT),
new ItemStack[] {ItemInterface.getItem("beeswax"),
ItemInterface.getItem("refractoryWax"),
ItemInterface.getItem("honeydew")},
new ItemStack[] {ItemInterface.getItemStack("beeswax"),
ItemInterface.getItemStack("refractoryWax"),
ItemInterface.getItemStack("honeydew")},
new int[] { 50, 50, 65 } );
}
if (ThermalExpansionHelper.isActive())
@@ -570,17 +568,15 @@ public class CraftingManager
ItemStack input;
ItemStack output;
output = BlockInterface.getBlock("candle");
output.stackSize = 24;
output = ItemInterface.getItemStack("Forestry", "candle", 24);
RecipeManagers.carpenterManager.addRecipe(30, new FluidStack(FluidRegistry.WATER, 600), null, output, new Object[] {
" S ", "WWW", "WWW",
'W', Config.wax,
'S', Items.string
});
output = BlockInterface.getBlock("candle");
output.stackSize = 6;
input = ItemInterface.getItem("craftingMaterial");
output = ItemInterface.getItemStack("Forestry", "candle", 6);
input = ItemInterface.getItemStack("craftingMaterial");
input.setItemDamage(ForestryHelper.CraftingMaterial.SILK_WISP.ordinal()); // Set to Silk Wisp
RecipeManagers.carpenterManager.addRecipe(30, new FluidStack(FluidRegistry.WATER, 600), null, output, new Object[] {
"WSW",
@@ -591,22 +587,22 @@ public class CraftingManager
output = Config.miscResources.getStackForType(ResourceType.AROMATIC_LUMP, 2);
RecipeManagers.carpenterManager.addRecipe(30, FluidRegistry.getFluidStack("honey", 1000), null, output, new Object[] {
" P ", "JDJ", " P ",
'P', ItemInterface.getItem("pollen"),
'J', ItemInterface.getItem("royalJelly"),
'P', ItemInterface.getItemStack("pollen"),
'J', ItemInterface.getItemStack("royalJelly"),
'D', Config.drops.getStackForType(DropType.ENCHANTED)
});
RecipeManagers.carpenterManager.addRecipe(30, FluidRegistry.getFluidStack("honey", 1000), null, output, new Object[] {
" J ", "PDP", " J ",
'P', ItemInterface.getItem("pollen"),
'J', ItemInterface.getItem("royalJelly"),
'P', ItemInterface.getItemStack("pollen"),
'J', ItemInterface.getItemStack("royalJelly"),
'D', Config.drops.getStackForType(DropType.ENCHANTED)
});
if (ThaumcraftHelper.isActive())
{
// Carpenter recipes
input = ItemInterface.getItem("craftingMaterial");
input = ItemInterface.getItemStack("craftingMaterial");
input.setItemDamage(3); // Set to Silk Mesh
output = new ItemStack(Config.thaumaturgeBackpackT2);
RecipeManagers.carpenterManager.addRecipe(200, new FluidStack(FluidRegistry.WATER, 1000), null, output, new Object[] {
@@ -0,0 +1,39 @@
package magicbees.main.utils;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public class ItemInterface {
public static ItemStack getItemStack(String item)
{
return GameRegistry.findItemStack("Forestry", item, 1);
}
public static ItemStack getItemStack(String modId, String item, int stackSize)
{
return GameRegistry.findItemStack(modId, item, stackSize);
}
public static Item getItem(String item)
{
Item i;
i = GameRegistry.findItem("Forestry", item);
if (i == null)
{
LogHelper.warn("Trying to get Item " + item + " from Forestry which does not exist!");
}
return i;
}
public static Item getItem(String modId, String item)
{
Item i;
i = GameRegistry.findItem(modId, item);
if (i == null)
{
LogHelper.warn("Trying to get Item " + item + " from " + modId + " which does not exist!");
}
return i;
}
}
@@ -0,0 +1,27 @@
package magicbees.main.utils;
import cpw.mods.fml.common.FMLLog;
import org.apache.logging.log4j.Level;
public class LogHelper
{
public static void log(Level logLevel, Object object){
FMLLog.log(VersionInfo.ModName, logLevel, "[MagicBees]: " + String.valueOf(object));
}
public static void all(Object object){ log(Level.ALL, object); }
public static void debug(Object object){ log(Level.DEBUG, object); }
public static void error(Object object){ log(Level.ERROR, object); }
public static void fatal(Object object){ log(Level.FATAL, object); }
public static void info(Object object){ log(Level.INFO, object); }
public static void off(Object object){ log(Level.OFF, object); }
public static void trace(Object object){ log(Level.TRACE, object); }
public static void warn(Object object){ log(Level.WARN, object); }
}
@@ -2,6 +2,8 @@ package magicbees.main.utils.compat;
import cpw.mods.fml.common.Loader;
import magicbees.main.Config;
import magicbees.main.utils.BlockInterface;
import magicbees.main.utils.ItemInterface;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
@@ -69,12 +71,12 @@ public class ArsMagicaHelper
try
{
Class clazz = Class.forName("am2.blocks.BlocksCommonProxy");
Config.amResourceBlock = (Block)(clazz.getField("AMOres").get(null));
Config.amBlackOrchid = (Block)(clazz.getField("blueOrchid").get(null));
Config.amDesertNova = (Block)(clazz.getField("desertNova").get(null));
Config.amAum = (Block)(clazz.getField("aum").get(null));
Config.amWakebloom = (Block)(clazz.getField("wakebloom").get(null));
Config.amTarmaRoot = (Block)(clazz.getField("tarmaRoot").get(null));
Config.amResourceBlock = BlockInterface.getBlock(Name, "AMOres");
Config.amBlackOrchid = BlockInterface.getBlock(Name, "blueOrchid");
Config.amDesertNova = BlockInterface.getBlock(Name, "desertNova");
Config.amAum = BlockInterface.getBlock(Name, "aum");
Config.amWakebloom = BlockInterface.getBlock(Name, "wakebloom");
Config.amTarmaRoot = BlockInterface.getBlock(Name, "tarmaRoot");
}
catch (Exception e)
{
@@ -87,8 +89,8 @@ public class ArsMagicaHelper
try
{
Class clazz = Class.forName("am2.items.ItemsCommonProxy");
Config.amItemResource = (Item)(clazz.getField("itemOre").get(null));
Config.amEssence = (Item)(clazz.getField("essence").get(null));
Config.amItemResource = ItemInterface.getItem(Name, "itemOre");
Config.amEssence = ItemInterface.getItem(Name, "essence");
}
catch (Exception e)
{
@@ -3,6 +3,7 @@ package magicbees.main.utils.compat;
import cpw.mods.fml.common.FMLLog;
import cpw.mods.fml.common.Loader;
import magicbees.main.Config;
import magicbees.main.utils.ItemInterface;
import net.minecraft.item.Item;
public class EquivalentExchangeHelper
@@ -40,7 +41,7 @@ public class EquivalentExchangeHelper
try
{
Class itemClass = Class.forName("com.pahimar.ee3.item.ModItems");
Config.eeMinuimShard = (Item)(itemClass.getField("miniumShard").get(null));
Config.eeMinuimShard = ItemInterface.getItem("EE3", "miniumShard");
}
catch (Exception e)
{
@@ -3,7 +3,8 @@ package magicbees.main.utils.compat;
import cpw.mods.fml.common.registry.GameRegistry;
import forestry.api.core.EnumHumidity;
import forestry.api.core.EnumTemperature;
import forestry.api.core.ItemInterface;
import magicbees.main.utils.BlockInterface;
import magicbees.main.utils.ItemInterface;
import forestry.api.genetics.IAllele;
import magicbees.bees.BeeManager;
import magicbees.main.Config;
@@ -111,8 +112,8 @@ public class ForestryHelper
try
{
Class c = Class.forName("forestry.core.config.ForestryBlock");
Config.fAlvearyBlock = (Block)(c.getField("alveary").get(null));
Config.fHiveBlock = (Block)(c.getField("beehives").get(null));
Config.fAlvearyBlock = BlockInterface.getBlock("alveary");
Config.fHiveBlock = BlockInterface.getBlock("beehives");
}
catch (Exception e)
{
@@ -122,11 +123,11 @@ public class ForestryHelper
private static void getItems()
{
Config.fBeeComb = ItemInterface.getItem("beeComb").getItem();
Config.fPollen = ItemInterface.getItem("pollen").getItem();
Config.fCraftingResource = ItemInterface.getItem("craftingMaterial").getItem();
Config.fHoneyDrop = ItemInterface.getItem("honeyDrop").getItem();
Config.fHoneydew = ItemInterface.getItem("honeydew").getItem();
Config.fBeeComb = ItemInterface.getItem("beeComb");
Config.fPollen = ItemInterface.getItem("pollen");
Config.fCraftingResource = ItemInterface.getItem("craftingMaterial");
Config.fHoneyDrop = ItemInterface.getItem("honeyDrop");
Config.fHoneydew = ItemInterface.getItem("honeydew");
}
public static IAllele[] getTemplateForestryForSpecies(String speciesName)
@@ -2,6 +2,7 @@ package magicbees.main.utils.compat;
import cpw.mods.fml.common.registry.GameRegistry;
import magicbees.main.Config;
import magicbees.main.utils.ItemInterface;
import net.minecraft.item.ItemStack;
public class RedstoneArsenalHelper
@@ -64,12 +65,12 @@ public class RedstoneArsenalHelper
private static void getBlocks()
{
Config.rsaFluxBlock = GameRegistry.findItemStack("RedstoneArsenal", "blockElectrumFlux", 1);
Config.rsaFluxBlock = ItemInterface.getItemStack("RedstoneArsenal", "blockElectrumFlux", 1);
}
private static void getItems()
{
Config.rsaFluxNugget = GameRegistry.findItemStack("RedstoneArsenal", "nuggetElectrumFlux", 1);
Config.rsaFluxNugget = ItemInterface.getItemStack("RedstoneArsenal", "nuggetElectrumFlux", 1);
}
@@ -1,8 +1,8 @@
package magicbees.main.utils.compat;
import cpw.mods.fml.common.registry.GameRegistry;
import forestry.api.core.BlockInterface;
import forestry.api.core.ItemInterface;
import magicbees.main.utils.ItemInterface;
import magicbees.main.utils.BlockInterface;
import magicbees.item.types.PollenType;
import magicbees.item.types.PropolisType;
import magicbees.item.types.ResourceType;
@@ -171,29 +171,29 @@ public class ThaumcraftHelper
private static void getBlocks()
{
Config.tcPlant = GameRegistry.findBlock(Name, "blockCustomPlant");
Config.tcCandle = GameRegistry.findBlock(Name, "blockCandle");
Config.tcCrystal = GameRegistry.findBlock(Name, "blockCrystal");
Config.tcMarker = GameRegistry.findBlock(Name, "blockMarker");
Config.tcJar = GameRegistry.findBlock(Name, "blockJar");
Config.tcLog = GameRegistry.findBlock(Name, "blockMagicalLog");
Config.tcLeaf = GameRegistry.findBlock(Name, "blockMagicalLeaves");
Config.tcWarded = GameRegistry.findBlock(Name, "blockWarded");
Config.tcPlant = BlockInterface.getBlock(Name, "blockCustomPlant");
Config.tcCandle = BlockInterface.getBlock(Name, "blockCandle");
Config.tcCrystal = BlockInterface.getBlock(Name, "blockCrystal");
Config.tcMarker = BlockInterface.getBlock(Name, "blockMarker");
Config.tcJar = BlockInterface.getBlock(Name, "blockJar");
Config.tcLog = BlockInterface.getBlock(Name, "blockMagicalLog");
Config.tcLeaf = BlockInterface.getBlock(Name, "blockMagicalLeaves");
Config.tcWarded = BlockInterface.getBlock(Name, "blockWarded");
}
private static void getItems()
{
Config.tcFilledJar = GameRegistry.findItem(Name, "BlockJarFilledItem");
Config.tcMiscResource = GameRegistry.findItem(Name, "ItemResource");
//Config.tcEssentiaBottle = GameRegistry.findItem(Name, "BlockJarFilledItem");
Config.tcShard = GameRegistry.findItem(Name, "ItemShard");
Config.tcGolem = GameRegistry.findItem(Name, "ItemGolemPlacer");
Config.tcFilledJar = ItemInterface.getItem(Name, "BlockJarFilledItem");
Config.tcMiscResource = ItemInterface.getItem(Name, "ItemResource");
//Config.tcEssentiaBottle = ItemInterface.getItem(Name, "BlockJarFilledItem");
Config.tcShard = ItemInterface.getItem(Name, "ItemShard");
Config.tcGolem = ItemInterface.getItem(Name, "ItemGolemPlacer");
//Config.tcWispEssence = ItemApi.getItem("itemWispEssence", 0).getItem();
Config.tcNuggets = GameRegistry.findItem(Name, "ItemNugget");
Config.tcShard = GameRegistry.findItem(Name, "ItemShard");
Config.tcNuggetChicken = GameRegistry.findItem(Name, "ItemNuggetChicken");
Config.tcNuggetBeef = GameRegistry.findItem(Name, "ItemNuggetBeef");
Config.tcNuggetPork = GameRegistry.findItem(Name, "ItemNuggetPork");
Config.tcNuggets = ItemInterface.getItem(Name, "ItemNugget");
Config.tcShard = ItemInterface.getItem(Name, "ItemShard");
Config.tcNuggetChicken = ItemInterface.getItem(Name, "ItemNuggetChicken");
Config.tcNuggetBeef = ItemInterface.getItem(Name, "ItemNuggetBeef");
Config.tcNuggetPork = ItemInterface.getItem(Name, "ItemNuggetPork");
}
private static void addItemsToBackpack()
@@ -463,7 +463,7 @@ public class ThaumcraftHelper
list = new ArrayList<Object>(2);
list.add(Config.miscResources.getStackForType(ResourceType.ESSENCE_SCORNFUL_OBLIVION));
list.add(ItemInterface.getItem("frameProven"));
list.add(ItemInterface.getItemStack("frameProven"));
recipe = new ShapelessRecipes(new ItemStack(Config.hiveFrameOblivion), list);
ResearchItem essenceOblivionR = new ResearchItem("MB_EssenceOblivion", category, new AspectList().add(Aspect.VOID, 2).add(Aspect.HUNGER, 1).add((Aspect)aspectTime, 1),
@@ -499,7 +499,7 @@ public class ThaumcraftHelper
list = new AspectList(new ItemStack(Blocks.log));
for (int i = 1; i <= 8; i++)
{
item = forestry.api.core.BlockInterface.getBlock("log" + i);
item = ItemInterface.getItemStack("log" + i);
if (item != null)
{
ThaumcraftApi.registerObjectTag(item, list);
@@ -509,7 +509,7 @@ public class ThaumcraftHelper
list = new AspectList(new ItemStack(Blocks.planks));
for (int i = 1; i <= 2; i++)
{
item = BlockInterface.getBlock("planks" + i);
item = ItemInterface.getItemStack("planks" + i);
if (item != null)
{
ThaumcraftApi.registerObjectTag(item, list);
@@ -522,63 +522,63 @@ public class ThaumcraftHelper
ThaumcraftApi.registerObjectTag(new ItemStack(Config.hive), list);
list = new AspectList().add(Aspect.LIGHT, 1);
item = BlockInterface.getBlock("candle");
item = ItemInterface.getItemStack("candle");
ThaumcraftApi.registerObjectTag(item, new int[] { item.getItemDamage() }, list);
list = new AspectList().add(Aspect.DARKNESS, 1);
item = BlockInterface.getBlock("stump");
item = ItemInterface.getItemStack("stump");
ThaumcraftApi.registerObjectTag(item, new int[] { item.getItemDamage() }, list);
list = new AspectList(new ItemStack(Blocks.glass)).add(Aspect.SENSES, 1);
item = BlockInterface.getBlock("glass");
item = ItemInterface.getItemStack("glass");
ThaumcraftApi.registerObjectTag(item, list);
list = new AspectList().add(Aspect.EARTH, 2).add(Aspect.WATER, 2);
item = BlockInterface.getBlock("soil");
item = ItemInterface.getItemStack("soil");
ThaumcraftApi.registerObjectTag(item, new int[]{1}, list);
list = new AspectList(new ItemStack(Blocks.leaves));
item = BlockInterface.getBlock("leaves");
item = ItemInterface.getItemStack("leaves");
ThaumcraftApi.registerObjectTag(item, new int[] { item.getItemDamage() }, list);
list = new AspectList(new ItemStack(Blocks.sapling));
item = forestry.api.core.BlockInterface.getBlock("saplingGE");
item = ItemInterface.getItemStack("saplingGE");
ThaumcraftApi.registerObjectTag(item, list);
list = new AspectList()/*.add(Aspect.SEED, 1)*/.add(Aspect.PLANT, 1);
item = forestry.api.core.ItemInterface.getItem("pollenFertile");
item = ItemInterface.getItemStack("pollenFertile");
ThaumcraftApi.registerObjectTag(item, list);
list = new AspectList().add(Aspect.CRYSTAL, 1).add(Aspect.EARTH, 2);
item = forestry.api.core.BlockInterface.getBlock("resources");
item = ItemInterface.getItemStack("resources");
ThaumcraftApi.registerObjectTag(new ItemStack(item.getItem(), 1, ForestryHelper.BlockResource.APATITE.ordinal()),
list.copy()/*.add(Aspect.STONE, 2)*/);
item = forestry.api.core.ItemInterface.getItem("apatite");
item = ItemInterface.getItemStack("apatite");
ThaumcraftApi.registerObjectTag(new ItemStack(item.getItem(), 1, item.getItemDamage()),
list.copy().add(Aspect.CRYSTAL, 2));
list = new AspectList().add(Aspect.MOTION, 2).add(Aspect.FLIGHT, 1);
item = forestry.api.core.ItemInterface.getItem("beeDroneGE");
item = ItemInterface.getItemStack("beeDroneGE");
ThaumcraftApi.registerObjectTag(item, list);
list = list.copy().add(Aspect.GREED, 2).add(Aspect.EXCHANGE, 1);
item = forestry.api.core.ItemInterface.getItem("beePrincessGE");
item = ItemInterface.getItemStack("beePrincessGE");
ThaumcraftApi.registerObjectTag(item, list);
item = forestry.api.core.ItemInterface.getItem("beeQueenGE");
item = ItemInterface.getItemStack("beeQueenGE");
ThaumcraftApi.registerObjectTag(item, list);
list = new AspectList().add(Aspect.LIFE, 2).add(Aspect.EXCHANGE, 5);
item = forestry.api.core.ItemInterface.getItem("beeLarvaeGE");
item = ItemInterface.getItemStack("beeLarvaeGE");
ThaumcraftApi.registerObjectTag(item, list);
item = forestry.api.core.ItemInterface.getItem("scoop");
item = ItemInterface.getItemStack("scoop");
list = new AspectList(new ItemStack(item.getItem(), 1, 0)).add(Aspect.TOOL, 2);
ThaumcraftApi.registerComplexObjectTag(item, list);
item = forestry.api.core.ItemInterface.getItem("grafter");
item = ItemInterface.getItemStack("grafter");
list = new AspectList(new ItemStack(item.getItem(), 1, item.getItemDamage())).add(Aspect.TOOL, 2);
ThaumcraftApi.registerComplexObjectTag(item, list);
item = forestry.api.core.ItemInterface.getItem("grafterProven");
item = ItemInterface.getItemStack("grafterProven");
list = list.copy().add(Aspect.TOOL, 2).add(Aspect.EXCHANGE, 3);
ThaumcraftApi.registerObjectTag(new ItemStack(item.getItem(), 1, item.getItemDamage()), list);
@@ -586,7 +586,7 @@ public class ThaumcraftHelper
ThaumcraftApi.registerObjectTag("beeComb", list);
list = new AspectList().add(Aspect.SLIME, 1);
item = forestry.api.core.ItemInterface.getItem("propolis");
item = ItemInterface.getItemStack("propolis");
ThaumcraftApi.registerObjectTag(new ItemStack(item.getItem(), 1, ForestryHelper.Propolis.NORMAL.ordinal()),
list);
ThaumcraftApi.registerObjectTag(new ItemStack(item.getItem(), 1, ForestryHelper.Propolis.SILKY.ordinal()),
@@ -609,7 +609,7 @@ public class ThaumcraftHelper
list.copy().add(Aspect.ENTROPY, 2));
list = new AspectList().add(Aspect.PLANT, 2);
item = forestry.api.core.ItemInterface.getItem("pollen");
item = ItemInterface.getItemStack("pollen");
ThaumcraftApi.registerObjectTag(new ItemStack(item.getItem(), 1, ForestryHelper.Pollen.NORMAL.ordinal()), list);
ThaumcraftApi.registerObjectTag(new ItemStack(item.getItem(), 1, ForestryHelper.Pollen.CRYSTALLINE.ordinal()),
list.copy()/*.add(Aspect.ICE, 2)*/);
@@ -619,7 +619,7 @@ public class ThaumcraftHelper
list.copy().add((Aspect)aspectTime, 2));
list = new AspectList().add(Aspect.ORDER, 1);
item = forestry.api.core.ItemInterface.getItem("beeswax");
item = ItemInterface.getItemStack("beeswax");
ThaumcraftApi.registerObjectTag(item, new int[] {item.getItemDamage()}, list.copy().add(Aspect.ORDER,
2));
ThaumcraftApi.registerObjectTag(new ItemStack(Config.wax, 1, WaxType.MAGIC.ordinal()),
@@ -630,19 +630,19 @@ public class ThaumcraftHelper
list.copy().add(Aspect.MIND, 2));
list = new AspectList().add(Aspect.EXCHANGE, 2).add(Aspect.LIFE, 2);
item = forestry.api.core.ItemInterface.getItem("honeyDrop");
item = ItemInterface.getItemStack("honeyDrop");
ThaumcraftApi.registerObjectTag(item, new int[] {item.getItemDamage()}, list);
list = new AspectList().add(Aspect.LIFE, 2).add(Aspect.ENERGY, 2);
item = forestry.api.core.ItemInterface.getItem("honeydew");
item = ItemInterface.getItemStack("honeydew");
ThaumcraftApi.registerObjectTag(item, new int[] {item.getItemDamage()}, list);
list = new AspectList().add(Aspect.GREED, 1).add(Aspect.LIFE, 4);
item = forestry.api.core.ItemInterface.getItem("royalJelly");
item = ItemInterface.getItemStack("royalJelly");
ThaumcraftApi.registerObjectTag(item, new int[] {item.getItemDamage()}, list);
list = new AspectList().add(Aspect.FIRE, 1).add(Aspect.TRAP, 2);
item = forestry.api.core.ItemInterface.getItem("phosphor");
item = ItemInterface.getItemStack("phosphor");
ThaumcraftApi.registerObjectTag(item, new int[] {item.getItemDamage()}, list);
item = Config.miscResources.getStackForType(ResourceType.ESSENCE_FALSE_LIFE);
@@ -1,5 +1,6 @@
package magicbees.tileentity;
import com.mojang.authlib.GameProfile;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import forestry.api.apiculture.BeeManager;
@@ -173,7 +174,7 @@ public class EffectJarHousing implements IBeeHousing
}
@Override
public String getOwnerName()
public GameProfile getOwnerName()
{
return this.jarEntity.getOwner();
}
@@ -1,5 +1,6 @@
package magicbees.tileentity;
import com.mojang.authlib.GameProfile;
import magicbees.main.CommonProxy;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
@@ -12,11 +13,12 @@ import forestry.api.apiculture.IBee;
import forestry.api.genetics.IEffectData;
import net.minecraftforge.common.util.Constants;
public class TileEntityEffectJar extends TileEntity implements IInventory
{
public static final String tileEntityName = CommonProxy.DOMAIN + ".effectJar";
private String ownerName;
private GameProfile ownerName;
private EffectJarHousing housingLogic;
private static final int SLOT_COUNT = 2;
@@ -38,7 +40,7 @@ public class TileEntityEffectJar extends TileEntity implements IInventory
public void setOwner(EntityPlayer player)
{
this.ownerName = player.getCommandSenderName();
this.ownerName = player.getGameProfile();
}
@Override
@@ -47,7 +49,7 @@ public class TileEntityEffectJar extends TileEntity implements IInventory
return pass == 1;
}
public String getOwner()
public GameProfile getOwner()
{
return this.ownerName;
}