More Thaumcraft compat

Fixed only some hives having aspects assigned
Removed the [MB] tag from research. This hasn't been needed since TC3, when addons didn't have their own tabs
Added Void metal scoop and grafter for the eldritch-inclined apiarists
Added uncommon rarity to Thaumium scoop/grafter for consistant tool look
This commit is contained in:
KryptonCaptain committed 2018-06-11 19:36:19 +10:00
1 parent afee91a925
commit 918334e5bf
10 files changed
+360 -17

No files matched your search

@@ -5,6 +5,7 @@ import magicbees.main.utils.compat.ThaumcraftHelper;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.oredict.OreDictionary;
@@ -84,4 +85,10 @@ public class ItemThaumiumGrafter extends ItemGrafter implements IRepairableExten
{
this.itemIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":thaumiumGrafter");
}
public EnumRarity getRarity(ItemStack itemstack)
{
return EnumRarity.uncommon;
}
}
@@ -5,6 +5,7 @@ import magicbees.main.utils.compat.ThaumcraftHelper;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
@@ -88,4 +89,10 @@ public class ItemThaumiumScoop extends Item implements IRepairable, IToolScoop
{
this.itemIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":thaumiumScoop");
}
public EnumRarity getRarity(ItemStack itemstack)
{
return EnumRarity.uncommon;
}
}
@@ -0,0 +1,126 @@
package magicbees.item;
import magicbees.main.CommonProxy;
import magicbees.main.utils.compat.ThaumcraftHelper;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.server.MinecraftServer;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.oredict.OreDictionary;
import thaumcraft.api.IRepairableExtended;
import thaumcraft.api.IWarpingGear;
import thaumcraft.api.ThaumcraftApi;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@Optional.InterfaceList({
@Optional.Interface(iface = "thaumcraft.api.IRepairableExtended", modid = ThaumcraftHelper.Name, striprefs = true),
@Optional.Interface(iface = "thaumcraft.api.IWarpingGear", modid = ThaumcraftHelper.Name, striprefs = true)
})
public class ItemVoidGrafter extends ItemGrafter implements IRepairableExtended, IWarpingGear
{
public ItemVoidGrafter()
{
super();
this.setMaxDamage(10);
this.setUnlocalizedName("voidGrafter");
}
@Override
public float func_150893_a(ItemStack itemStack, Block block)
{
return 1f;
}
@Override
public float getDigSpeed(ItemStack itemStack, Block block, int metadata)
{
return ForgeHooks.isToolEffective(itemStack, block, metadata) ? 4.8f : func_150893_a(itemStack, block);
}
/**
* Return the enchantability factor of the item, most of the time is based on material.
*/
@Optional.Method(modid = ThaumcraftHelper.Name)
public int getItemEnchantability()
{
return ThaumcraftApi.toolMatThaumium.getEnchantability();
}
/**
* Return the name for this tool's material.
*/
@Optional.Method(modid = ThaumcraftHelper.Name)
public String getToolMaterialName()
{
return ThaumcraftApi.toolMatThaumium.toString();
}
/**
* Return whether this item is repairable in an anvil.
*/
@Optional.Method(modid = ThaumcraftHelper.Name)
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
{
return OreDictionary.itemMatches(ThaumcraftApi.toolMatThaumium.getRepairItemStack(), par2ItemStack, true)
|| super.getIsRepairable(par1ItemStack, par2ItemStack);
}
@Override
public boolean doRepair(ItemStack stack, EntityPlayer player, int enchantLevel)
{
boolean flag = false;
if (stack.getItemDamage() > 0)
{
flag = true;
player.addExhaustion(0.6f * (enchantLevel * enchantLevel));
}
return flag;
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":voidGrafter"); //TODO
}
public EnumRarity getRarity(ItemStack itemstack)
{
return EnumRarity.uncommon;
}
public void onUpdate(ItemStack stack, World world, Entity entity, int p_77663_4_, boolean p_77663_5_)
{
super.onUpdate(stack, world, entity, p_77663_4_, p_77663_5_);
if ((stack.isItemDamaged()) && (entity != null) && (entity.ticksExisted % 20 == 0) && ((entity instanceof EntityLivingBase))) {
stack.damageItem(-1, (EntityLivingBase)entity);
}
}
public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity)
{
if ((!player.worldObj.isRemote) && ((entity instanceof EntityLivingBase)) && (
(!(entity instanceof EntityPlayer)) || (MinecraftServer.getServer().isPVPEnabled()))) {
((EntityLivingBase)entity).addPotionEffect(new PotionEffect(Potion.weakness.getId(), 80));
}
return super.onLeftClickEntity(stack, player, entity);
}
@Override
public int getWarp(ItemStack itemstack, EntityPlayer player)
{
return 1;
}
}
@@ -0,0 +1,128 @@
package magicbees.item;
import magicbees.main.CommonProxy;
import magicbees.main.utils.compat.ThaumcraftHelper;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.server.MinecraftServer;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.oredict.OreDictionary;
import thaumcraft.api.IRepairable;
import thaumcraft.api.IWarpingGear;
import thaumcraft.api.ThaumcraftApi;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import forestry.api.core.IToolScoop;
@Optional.InterfaceList(
{
@Optional.Interface(iface = "thaumcraft.api.IRepairable", modid = ThaumcraftHelper.Name, striprefs = true),
@Optional.Interface(iface = "thaumcraft.api.IWarpingGear", modid = ThaumcraftHelper.Name, striprefs = true)
}
)
public class ItemVoidScoop extends Item implements IRepairable, IToolScoop, IWarpingGear
{
public ItemVoidScoop()
{
super();
this.setMaxStackSize(1);
this.setMaxDamage(20);
this.setCreativeTab(forestry.api.core.Tabs.tabApiculture);
this.setUnlocalizedName("voidScoop");
this.setHarvestLevel("scoop", 3);
}
@Override
public float func_150893_a(ItemStack itemStack, Block block)
{
return 1f;
}
@Override
public float getDigSpeed(ItemStack itemStack, Block block, int metadata)
{
return ForgeHooks.isToolEffective(itemStack, block, metadata) ? 4.8f : func_150893_a(itemStack, block);
}
@Override
public boolean onBlockDestroyed(ItemStack itemstack, World world, Block block, int j, int k, int l,
EntityLivingBase entityliving)
{
itemstack.damageItem(1, entityliving);
return true;
}
/**
* Return the enchantability factor of the item, most of the time is based on material.
*/
@Optional.Method(modid = ThaumcraftHelper.Name)
public int getItemEnchantability()
{
return ThaumcraftApi.toolMatVoid.getEnchantability();
}
/**
* Return the name for this tool's material.
*/
@Optional.Method(modid = ThaumcraftHelper.Name)
public String getToolMaterialName()
{
return ThaumcraftApi.toolMatVoid.toString();
}
/**
* Return whether this item is repairable in an anvil.
*/
@Optional.Method(modid = ThaumcraftHelper.Name)
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
{
return OreDictionary.itemMatches(ThaumcraftApi.toolMatVoid.getRepairItemStack(), par2ItemStack, true)
|| super.getIsRepairable(par1ItemStack, par2ItemStack);
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":voidScoop"); //TODO
}
public EnumRarity getRarity(ItemStack itemstack)
{
return EnumRarity.uncommon;
}
public void onUpdate(ItemStack stack, World world, Entity entity, int p_77663_4_, boolean p_77663_5_)
{
super.onUpdate(stack, world, entity, p_77663_4_, p_77663_5_);
if ((stack.isItemDamaged()) && (entity != null) && (entity.ticksExisted % 20 == 0) && ((entity instanceof EntityLivingBase))) {
stack.damageItem(-1, (EntityLivingBase)entity);
}
}
public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity)
{
if ((!player.worldObj.isRemote) && ((entity instanceof EntityLivingBase)) && (
(!(entity instanceof EntityPlayer)) || (MinecraftServer.getServer().isPVPEnabled()))) {
((EntityLivingBase)entity).addPotionEffect(new PotionEffect(Potion.weakness.getId(), 80));
}
return super.onLeftClickEntity(stack, player, entity);
}
@Override
public int getWarp(ItemStack itemstack, EntityPlayer player)
{
return 1;
}
}
+16
View File
@@ -25,6 +25,8 @@ import magicbees.item.ItemPollen;
import magicbees.item.ItemPropolis;
import magicbees.item.ItemThaumiumGrafter;
import magicbees.item.ItemThaumiumScoop;
import magicbees.item.ItemVoidGrafter;
import magicbees.item.ItemVoidScoop;
import magicbees.item.ItemWax;
import magicbees.item.types.CapsuleType;
import magicbees.item.types.HiveFrameType;
@@ -124,6 +126,9 @@ public class Config
public static ItemMoonDial moonDial;
public static ItemMysteriousMagnet magnet;
public static Item voidScoop;
public static Item voidGrafter;
public static boolean disableMagnetSound;
//----- Liquid Capsules --------------------
@@ -460,6 +465,17 @@ public class Config
thaumiumGrafter = new ItemThaumiumGrafter();
GameRegistry.registerItem(thaumiumGrafter, thaumiumGrafter.getUnlocalizedName(), CommonProxy.DOMAIN);
voidScoop = new ItemVoidScoop();
GameRegistry.registerItem(voidScoop, voidScoop.getUnlocalizedName(), CommonProxy.DOMAIN);
voidGrafter = new ItemVoidGrafter();
GameRegistry.registerItem(voidGrafter, voidGrafter.getUnlocalizedName(), CommonProxy.DOMAIN);
}
}
@@ -1,6 +1,8 @@
package magicbees.main.utils.compat;
import magicbees.main.Config;
import magicbees.main.utils.BlockInterface;
import net.minecraft.block.Block;
import cpw.mods.fml.common.Loader;
public class ExtraBeesHelper implements IModHelper {
@@ -89,7 +91,10 @@ public class ExtraBeesHelper implements IModHelper {
SAWDUST,
;
}
public static Block hiveBlock;
public static final String Name = "ExtraBees";
private static boolean isEBPresent = false;
public static boolean isActive() {
@@ -103,8 +108,13 @@ public class ExtraBeesHelper implements IModHelper {
}
public void init() {
getBlocks();
}
public void postInit() {
}
private static void getBlocks() {
hiveBlock = BlockInterface.getBlock(Name, "hive");
}
}
@@ -253,6 +253,9 @@ public class ThaumcraftHelper implements IModHelper {
private static Object essenceTime;
private static Object essenceOblivion;
private static Object visAuraProvider;
private static Object voidScoop;
private static Object voidGrafter;
private static void getBlocks() {
plant = BlockInterface.getBlock(Name, "blockCustomPlant");
@@ -395,6 +398,20 @@ public class ThaumcraftHelper implements IModHelper {
new Object[] {
Config.miscResources.getStackForType(ResourceType.DIMENSIONAL_SINGULARITY),
Blocks.dragon_egg, });
voidScoop = ThaumcraftApi.addArcaneCraftingRecipe("MB_ScoopVoid", new ItemStack(Config.voidScoop),
new AspectList().add(Aspect.ORDER, 2), new Object[] {
"sWs", "sTs", " T ",
's', Items.stick,
'W', Blocks.wool,
'T', new ItemStack(miscResource, 1, MiscResource.VOID_INGOT.ordinal()) });
voidGrafter = ThaumcraftApi.addArcaneCraftingRecipe("MB_GrafterVoid",
new ItemStack(Config.voidGrafter),
new AspectList().add(Aspect.ORDER, 5), new Object[] {
" T", " s ", "s ",
's', Items.stick,
'T', new ItemStack(miscResource, 1, MiscResource.VOID_INGOT.ordinal()) });
}
private static void setupResearch() {
@@ -444,6 +461,22 @@ public class ThaumcraftHelper implements IModHelper {
new ItemStack(Config.thaumiumGrafter))
.setPages(getResearchPage("MB_Grafter.1"), new ResearchPage((IArcaneRecipe) thaumGrafter))
.setParents("MB_Scoop").registerResearchItem();
//Void tool insert
new ResearchItem("MB_ScoopVoid", category,
new AspectList().add(Aspect.TOOL, 1).add(Aspect.ELDRITCH, 1).add(Aspect.AIR, 1),
-4, -4, 1,
new ItemStack(Config.voidScoop))
.setPages(getResearchPage("MB_ScoopVoid.1"), new ResearchPage((IArcaneRecipe) voidScoop))
.setParents("MB_Scoop").setParentsHidden("VOIDMETAL").setSecondary().setConcealed().registerResearchItem();
new ResearchItem("MB_GrafterVoid", category,
new AspectList().add(Aspect.TOOL, 1).add(Aspect.TREE, 1).add(Aspect.ELDRITCH, 1),
-4, -2, 2,
new ItemStack(Config.voidGrafter))
.setPages(getResearchPage("MB_GrafterVoid.1"), new ResearchPage((IArcaneRecipe) voidGrafter))
.setParents("MB_Grafter").setParentsHidden("VOIDMETAL").setSecondary().setConcealed().registerResearchItem();
//
new ResearchItem("MB_FrameMagic", category,
new AspectList().add(Aspect.TOOL, 1).add(Aspect.ARMOR, 1),
@@ -595,9 +628,11 @@ public class ThaumcraftHelper implements IModHelper {
}
list = new AspectList().add(Aspect.ORDER, 5).add(Aspect.ARMOR, 2).add(Aspect.BEAST, 1);
item = new ItemStack(ForestryHelper.hiveBlock);
item = new ItemStack(ForestryHelper.hiveBlock,1,32767);
ThaumcraftApi.registerObjectTag(item, list);
ThaumcraftApi.registerObjectTag(new ItemStack(Config.hive), list);
ThaumcraftApi.registerObjectTag(new ItemStack(Config.hive,1,32767), list);
if (ExtraBeesHelper.isActive() )
ThaumcraftApi.registerObjectTag(new ItemStack(ExtraBeesHelper.hiveBlock,1,32767), list);
list = new AspectList().add(Aspect.LIGHT, 1);
item = new ItemStack(BlockInterface.getBlock(ForestryHelper.Name, "candle"));