Compare commits

..
23 Commits
Author SHA1 Message Date
Vazkii 8124669363 Hotfix for a server crash, hopefully... (I can't test server in my current setup, need to get that fixed sometime) 2013-07-04 00:58:16 +01:00
Vazkii 581c781319 Wrapping up the 1.0.7 update. 2013-07-03 20:02:44 +01:00
Vazkii 7b2829612d Wrapping up the loev potion. 2013-07-03 20:00:42 +01:00
Vazkii 2f6467230b Added the Love Potion item, still needs some tweaking... 2013-07-03 18:43:45 +01:00
Vazkii 34705d56b7 Fixed check in the TDT, should act better with tanks and things of the sort. Closes #11. 2013-07-03 16:05:45 +01:00
Vazkii 361732dbe4 Added research and recipe stuff for the bottle of rainwater and the weather crystals. 2013-07-03 14:51:11 +01:00
Vazkii 6b7fb79d45 Added a handler to get the rainwater bottles. 2013-07-03 14:22:56 +01:00
Vazkii 9a726225f1 Added Weather Crystals. 2013-07-03 13:46:59 +01:00
Vazkii b1be5335be Added Bottle of Rainwater (to be used as a resource later), removed debug features in the runes, and flagged those ase NYI, added 2 sprites for new items. 2013-07-03 13:22:32 +01:00
Vazkii b9ce0a5ed3 Wrapped up the Reaper's Scythe (added research and recipe, changed soul hp output to 2 rather than 1 and made the scythe be usable to block). 2013-07-03 00:47:40 +01:00
Vazkii 91524232aa Added the actual Scythe feature, for getting soul hearts. 2013-07-02 22:45:46 +01:00
Vazkii 9592829796 Added the ability of the Scythe. 2013-07-02 21:57:30 +01:00
Vazkii 383dfe0281 Added the Reaper Scythe item, it does nothing... yet. 2013-07-02 20:16:34 +01:00
Vazkii eb4b2cd448 Soul Heart HUD feature wraps up the mechanic. Now to put it to use ;D 2013-07-02 18:30:17 +01:00
Vazkii 1d0c7ce8b6 Derp... 2013-07-02 17:39:53 +01:00
Vazkii bef4a41c52 Some debug measures for the soul heart system. (Temporary) 2013-07-02 17:36:40 +01:00
Vazkii 59f8be7793 Added Soul Hearts GUI resouce. 2013-07-02 17:31:35 +01:00
Vazkii 82360f8759 Networked Soul Hearts. 2013-07-02 17:29:51 +01:00
Vazkii 514cac18fa Framework for the Soul Heart system. 2013-07-02 17:21:35 +01:00
Vazkii 4e01ec77ef Merge branch 'master' of https://github.com/Vazkii/ThaumicTinkerer 2013-06-30 00:38:45 +01:00
Vazkii f394e0ca2e New Rune item. 2013-06-30 00:37:04 +01:00
Vazkii ddbf9571a3 Merge pull request #14 from ZeroLevels/master 2013-06-29 06:04:14 -07:00
Zero 8620f42e6e Optimized Image Files, Saved 151.44 KB 2013-06-29 08:59:29 -04:00
91 changed files with 1072 additions and 8 deletions

No files matched your search

+1 -1
View File
@@ -3,7 +3,7 @@
"modid": "ThaumicTinkerer",
"name": "Thaumic Tinkerer",
"description": "An addon to Thaumcraft 3, implementing new content. This mod is a spiritual successor to Elemental Tinkerer. Researches that come from this mod are prefixed by [TT]. Compiled for Thaumcraft 3.0.5.",
"version": "1.0.6",
"version": "1.0.7",
"mcversion": "1.5.2",
"logoFile": "/mods/ThaumicTinkerer/logo.png",
"url": "minecraftforum.net/topic/1813058-",
@@ -35,6 +35,7 @@ import vazkii.tinkerer.research.ModResearchItems;
import vazkii.tinkerer.util.handler.ConfigurationHandler;
import vazkii.tinkerer.util.handler.EntityInteractionHandler;
import vazkii.tinkerer.util.handler.GuiHandler;
import vazkii.tinkerer.util.handler.SoulHeartHandler;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
@@ -84,6 +85,7 @@ public class ThaumicTinkerer {
proxy.initRenders();
MinecraftForge.EVENT_BUS.register(new EntityInteractionHandler());
MinecraftForge.EVENT_BUS.register(new SoulHeartHandler());
GameRegistry.registerPlayerTracker(new PlayerTracker());
NetworkRegistry.instance().registerGuiHandler(modInstance, new GuiHandler());
@@ -0,0 +1,84 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 3.
* Thaumcraft 3 © Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [4 Jul 2013, 00:39:50 (GMT)]
*/
package vazkii.tinkerer.client.util.handler;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.Tessellator;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
import net.minecraftforge.event.ForgeSubscribe;
import org.lwjgl.opengl.GL11;
import vazkii.tinkerer.lib.LibResources;
import vazkii.tinkerer.util.helper.MiscHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class SoulHeartClientHandler {
@SideOnly(Side.CLIENT)
public static int clientPlayerHP = 0;
@SideOnly(Side.CLIENT)
@ForgeSubscribe
public void renderHealthBar(RenderGameOverlayEvent event) {
if(event.type == ElementType.FOOD && clientPlayerHP > 0) {
if(event instanceof RenderGameOverlayEvent.Post) {
Minecraft mc = MiscHelper.getMc();
int x = event.resolution.getScaledWidth() / 2 + 10;
int y = event.resolution.getScaledHeight() - 39;
GL11.glTranslatef(0F, 10F, 0F);
mc.renderEngine.bindTexture(LibResources.GUI_SOUL_HEARTS);
int it = 0;
for(int i = 0; i < clientPlayerHP; i++) {
boolean half = i == clientPlayerHP - 1 && clientPlayerHP % 2 != 0;
if(half || i % 2 == 0) {
renderHeart(x + it * 8, y, !half);
it++;
}
}
mc.renderEngine.bindTexture("/gui/icons.png");
}
GL11.glTranslatef(0F, -10F, 0F);
}
if(event.type == ElementType.AIR && event instanceof RenderGameOverlayEvent.Post && clientPlayerHP > 0)
GL11.glTranslatef(0F, 10F, 0F);
}
@SideOnly(Side.CLIENT)
private static void renderHeart(int x, int y, boolean full) {
Tessellator tess = Tessellator.instance;
float size = 1 / 16F;
float startX = full ? 0 : 9 * size;
float endX = full ? 9 * size : 1;
float startY = 0;
float endY = 9 * size;
tess.startDrawingQuads();
tess.addVertexWithUV(x, y + 9, 0, startX, endY);
tess.addVertexWithUV(x + (full ? 9 : 7), y + 9, 0, endX, endY);
tess.addVertexWithUV(x + (full ? 9 : 7), y, 0, endX, startY);
tess.addVertexWithUV(x, y, 0, startX, startY);
tess.draw();
}
}
@@ -14,11 +14,13 @@
*/
package vazkii.tinkerer.core.proxy;
import net.minecraft.client.renderer.entity.RenderSnowball;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.common.MinecraftForge;
import thaumcraft.client.fx.FXLightningBolt;
import vazkii.tinkerer.ThaumicTinkerer;
import vazkii.tinkerer.client.render.block.RenderMagnet;
@@ -30,11 +32,14 @@ import vazkii.tinkerer.client.render.tile.RenderTileMagnet;
import vazkii.tinkerer.client.render.tile.RenderTileTransmutator;
import vazkii.tinkerer.client.render.tile.RenderTileWardChest;
import vazkii.tinkerer.client.util.handler.ClientTickHandler;
import vazkii.tinkerer.client.util.handler.SoulHeartClientHandler;
import vazkii.tinkerer.entity.EntityDeathRune;
import vazkii.tinkerer.entity.EntityLovePotion;
import vazkii.tinkerer.item.ModItems;
import vazkii.tinkerer.lib.LibRenderIDs;
import vazkii.tinkerer.network.PacketManager;
import vazkii.tinkerer.network.packet.PacketAnimationTabletSync;
import vazkii.tinkerer.network.packet.PacketSoulHeartSync;
import vazkii.tinkerer.network.packet.PacketTransmutatorSync;
import vazkii.tinkerer.network.packet.PacketVerification;
import vazkii.tinkerer.tile.TileEntityAnimationTablet;
@@ -54,6 +59,8 @@ public class TTClientProxy extends TTCommonProxy {
super.initTickHandlers();
TickRegistry.registerTickHandler(new ClientTickHandler(), Side.CLIENT);
MinecraftForge.EVENT_BUS.register(new SoulHeartClientHandler());
}
@Override
@@ -71,6 +78,7 @@ public class TTClientProxy extends TTCommonProxy {
super.initEntities();
RenderingRegistry.registerEntityRenderingHandler(EntityDeathRune.class, new RenderDeathRune());
RenderingRegistry.registerEntityRenderingHandler(EntityLovePotion.class, new RenderSnowball(ModItems.lovePotion, 0));
}
@Override
@@ -80,6 +88,7 @@ public class TTClientProxy extends TTCommonProxy {
PacketManager.packetHandlers.add(new PacketVerification());
PacketManager.packetHandlers.add(new PacketTransmutatorSync());
PacketManager.packetHandlers.add(new PacketAnimationTabletSync());
PacketManager.packetHandlers.add(new PacketSoulHeartSync());
}
@Override
@@ -20,6 +20,7 @@ import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import vazkii.tinkerer.ThaumicTinkerer;
import vazkii.tinkerer.entity.EntityDeathRune;
import vazkii.tinkerer.entity.EntityLovePotion;
import vazkii.tinkerer.lib.LibBlockNames;
import vazkii.tinkerer.lib.LibItemNames;
import vazkii.tinkerer.lib.LibMisc;
@@ -46,7 +47,9 @@ public class TTCommonProxy {
public void initRenders() { }
public void initEntities() {
EntityRegistry.registerModEntity(EntityDeathRune.class, LibMisc.MOD_ID + "_" + LibItemNames.DEATH_RUNE, 0, ThaumicTinkerer.modInstance, 64, 10, false);
int id = 0;
EntityRegistry.registerModEntity(EntityDeathRune.class, LibMisc.MOD_ID + "_" + LibItemNames.DEATH_RUNE, id++, ThaumicTinkerer.modInstance, 64, 10, false);
EntityRegistry.registerModEntity(EntityLovePotion.class, LibMisc.MOD_ID + "_" + LibItemNames.LOVE_POTION, id++, ThaumicTinkerer.modInstance, 64, 10, true);
}
public void initPackets() {
@@ -0,0 +1,115 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 3.
* Thaumcraft 3 © Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [3 Jul 2013, 17:46:58 (GMT)]
*/
package vazkii.tinkerer.entity;
import java.util.List;
import java.util.Random;
import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.item.Item;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import vazkii.tinkerer.ThaumicTinkerer;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class EntityLovePotion extends EntityThrowable {
public EntityLovePotion(World par1World) {
super(par1World);
}
public EntityLovePotion(World par1World, EntityPlayer par2EntityPlayer) {
super(par1World, par2EntityPlayer);
}
@SideOnly(Side.CLIENT)
public EntityLovePotion(World par1World, double par2, double par4, double par6, int par8) {
this(par1World, par2, par4, par6);
}
public EntityLovePotion(World par1World, double par2, double par4, double par6) {
super(par1World, par2, par4, par6);
}
@Override
protected float getGravityVelocity() {
return 0.3F;
}
@Override
public void onUpdate() {
super.onUpdate();
ThaumicTinkerer.tcProxy.sparkle((float) posX, (float) posY, (float) posZ, 0);
}
@Override
protected void onImpact(MovingObjectPosition mop) {
spawnParticles();
AxisAlignedBB bb = boundingBox.expand(4.0D, 2.0D, 4.0D);
List<EntityAnimal> animals = worldObj.getEntitiesWithinAABB(EntityAnimal.class, bb);
for(EntityAnimal e : animals) {
if (e.getGrowingAge() < 0)
continue;
e.inLove = 600;
for (int i = 0; i < 7; i++) {
double var4 = rand.nextGaussian() * 0.02D;
double var6 = rand.nextGaussian() * 0.02D;
double var8 = rand.nextGaussian() * 0.02D;
worldObj.spawnParticle("heart", e.posX + rand.nextFloat() * e.width * 2.0F - e.width, e.posY + 0.5D + rand.nextFloat() * e.height, e.posZ + rand.nextFloat() * e.width * 2.0F - e.width, var4, var6, var8);
}
}
setDead();
}
private void spawnParticles() {
double var8 = posX;
double var10 = posY;
double var12 = posZ;
String var14 = "iconcrack_" + Item.potion.itemID;
Random var7 = rand;
for (int var15 = 0; var15 < 8; ++var15) {
worldObj.spawnParticle(var14, var8, var10, var12, var7.nextGaussian() * 0.15D, var7.nextDouble() * 0.2D, var7.nextGaussian() * 0.15D);
}
float red = 1.0F;
float green = 0.0F;
float blue = 0.0F;
String var19 = "spell";
for (int var20 = 0; var20 < 100; ++var20) {
double var39 = var7.nextDouble() * 4.0D;
double var23 = var7.nextDouble() * Math.PI * 2.0D;
double var25 = Math.cos(var23) * var39;
double var27 = 0.01D + var7.nextDouble() * 0.5D;
double var29 = Math.sin(var23) * var39;
if (worldObj.isRemote) {
EntityFX var31 = Minecraft.getMinecraft().renderGlobal.doSpawnParticle(var19, var8 + var25 * 0.1D, var10 + 0.3D, var12 + var29 * 0.1D, var25, var27, var29);
if (var31 != null) {
float var32 = 0.75F + var7.nextFloat() * 0.25F;
var31.setRBGColorF(red * var32, green * var32, blue * var32);
var31.multiplyVelocity((float)var39);
}
}
}
worldObj.playSoundEffect(posX + 0.5D, posY + 0.5D, posZ + 0.5D, "random.glass", 1.0F, worldObj.rand.nextFloat() * 0.1F + 0.9F);
}
}
@@ -0,0 +1,48 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 3.
* Thaumcraft 3 © Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [3 Jul 2013, 17:45:49 (GMT)]
*/
package vazkii.tinkerer.item;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import vazkii.tinkerer.entity.EntityLovePotion;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemLovePotion extends ItemMod {
public ItemLovePotion(int par1) {
super(par1);
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
if(!par2World.isRemote) {
EntityLovePotion entity = new EntityLovePotion(par2World, par3EntityPlayer);
par2World.spawnEntityInWorld(entity);
par1ItemStack.stackSize--;
}
return par1ItemStack;
}
@Override
@SideOnly(Side.CLIENT)
public EnumRarity getRarity(ItemStack par1ItemStack) {
return EnumRarity.rare;
}
}
@@ -0,0 +1,62 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 3.
* Thaumcraft 3 © Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [3 Jul 2013, 01:15:43 (GMT)]
*/
package vazkii.tinkerer.item;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import vazkii.tinkerer.util.handler.RainwaterBottleHandler;
public class ItemRainwaterBottle extends ItemMod {
public ItemRainwaterBottle(int par1) {
super(par1);
MinecraftForge.EVENT_BUS.register(new RainwaterBottleHandler());
}
@Override
public int getMaxItemUseDuration(ItemStack par1ItemStack) {
return 32;
}
@Override
public EnumAction getItemUseAction(ItemStack par1ItemStack) {
return EnumAction.drink;
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
par3EntityPlayer.setItemInUse(par1ItemStack, getMaxItemUseDuration(par1ItemStack));
return par1ItemStack;
}
@Override
public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
if (!par3EntityPlayer.capabilities.isCreativeMode) {
--par1ItemStack.stackSize;
if (par1ItemStack.stackSize <= 0)
return new ItemStack(Item.glassBottle);
par3EntityPlayer.inventory.addItemStackToInventory(new ItemStack(Item.glassBottle));
}
return par1ItemStack;
}
}
+90
View File
@@ -0,0 +1,90 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 3.
* Thaumcraft 3 © Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [29 Jun 2013, 20:45:47 (GMT)]
*/
package vazkii.tinkerer.item;
import java.util.List;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import thaumcraft.api.EnumTag;
import vazkii.tinkerer.client.util.helper.IconHelper;
import vazkii.tinkerer.lib.LibItemNames;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemRune extends ItemMod {
Icon crackIcon;
public ItemRune(int par1) {
super(par1);
setHasSubtypes(true);
}
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) {
for(EnumTag tag : EnumTag.class.getEnumConstants())
if(tag != EnumTag.UNKNOWN)
par3List.add(new ItemStack(par1, 1, tag.getId()));
}
@Override
@SideOnly(Side.CLIENT)
public boolean requiresMultipleRenderPasses() {
return true;
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister par1IconRegister) {
itemIcon = IconHelper.forItem(par1IconRegister, this, 0);
crackIcon = IconHelper.forItem(par1IconRegister, this, 1);
}
@Override
@SideOnly(Side.CLIENT)
public Icon getIconFromDamageForRenderPass(int par1, int par2) {
return par2 == 1 ? crackIcon : itemIcon;
}
@Override
@SideOnly(Side.CLIENT)
public int getColorFromItemStack(ItemStack par1ItemStack, int par2) {
return par2 == 0 ? 0xFFFFFF : EnumTag.get(par1ItemStack.getItemDamage()).color;
}
@Override
public String getItemDisplayName(ItemStack par1ItemStack) {
return LibItemNames.RUNE_D + EnumTag.get(par1ItemStack.getItemDamage()).name;
}
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
par3List.add(EnumTag.get(par1ItemStack.getItemDamage()).meaning);
par3List.add("Not Yet Implemented!");
}
@Override
@SideOnly(Side.CLIENT)
public EnumRarity getRarity(ItemStack par1ItemStack) {
return EnumRarity.uncommon;
}
}
+120
View File
@@ -0,0 +1,120 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 3.
* Thaumcraft 3 © Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [2 Jul 2013, 19:46:26 (GMT)]
*/
package vazkii.tinkerer.item;
import java.util.ArrayList;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import net.minecraft.world.World;
import thaumcraft.api.IVisRepairable;
import thaumcraft.api.ThaumcraftApi;
import thaumcraft.common.aura.AuraManager;
import vazkii.tinkerer.client.util.helper.IconHelper;
import vazkii.tinkerer.util.helper.ModCreativeTab;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemScythe extends ItemSword implements IVisRepairable {
public ItemScythe(int par1) {
super(par1, ThaumcraftApi.toolMatThaumium);
setCreativeTab(ModCreativeTab.INSTANCE);
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister par1IconRegister) {
itemIcon = IconHelper.forItem(par1IconRegister, this);
}
@Override
public void doRepair(ItemStack stack, Entity e) {
if (AuraManager.decreaseClosestAura(e.worldObj, e.posX, e.posY, e.posZ, 1))
stack.damageItem(-1, (EntityLiving) e);
}
@Override
@SideOnly(Side.CLIENT)
public EnumRarity getRarity(ItemStack par1ItemStack) {
return EnumRarity.rare;
}
@Override
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int id, int par4, int par5, int par6, EntityLiving par7EntityLiving) {
boolean target = false;
if(id == Block.tallGrass.blockID) {
for(int i = 0; i < 3; i++)
for(int j = 0; j < 3; j++) {
int x = par4 + i - 1;
int y = par5;
int z = par6 + j - 1;
int id1 = par2World.getBlockId(x, y, z);
int meta = par2World.getBlockMetadata(x, y, z);
if(id1 == Block.tallGrass.blockID && !par2World.isRemote) {
ArrayList<ItemStack> drops = Block.tallGrass.getBlockDropped(par2World, x, y, z, meta, 0);
for(ItemStack item : drops) {
EntityItem entityItem = new EntityItem(par2World, x + 0.5, y + 0.5, z + 0.5, item);
par2World.spawnEntityInWorld(entityItem);
}
par2World.setBlockToAir(x, y, z);
}
}
target = true;
}
if(Block.blocksList[id].isLeaves(par2World, par4, par5, par6)) {
Block block = Block.blocksList[id];
for(int i = 0; i < 3; i++)
for(int j = 0; j < 3; j++)
for(int k = 0; k < 3; k++) {
int x = par4 + i - 1;
int y = par5 + j - 1;
int z = par6 + k - 1;
int id1 = par2World.getBlockId(x, y, z);
int meta = par2World.getBlockMetadata(x, y, z);
if(id1 == id && block.isLeaves(par2World, x, y, z) && !par2World.isRemote) {
ArrayList<ItemStack> drops = block.getBlockDropped(par2World, x, y, z, meta, 0);
for(ItemStack item : drops) {
EntityItem entityItem = new EntityItem(par2World, x + 0.5, y + 0.5, z + 0.5, item);
par2World.spawnEntityInWorld(entityItem);
}
par2World.setBlockToAir(x, y, z);
}
}
target = true;
}
if (Block.blocksList[id].getBlockHardness(par2World, par4, par5, par6) != 0 && !target)
par1ItemStack.damageItem(1, par7EntityLiving);
return true;
}
@Override
public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) {
return par2Block.blockMaterial == Material.leaves ? 8F : super.getStrVsBlock(par1ItemStack, par2Block);
}
}
@@ -0,0 +1,86 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 3.
* Thaumcraft 3 © Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [3 Jul 2013, 13:25:14 (GMT)]
*/
package vazkii.tinkerer.item;
import java.util.List;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.world.World;
import vazkii.tinkerer.client.util.helper.IconHelper;
import vazkii.tinkerer.lib.LibItemNames;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemWeatherCrystal extends ItemMod {
Icon[] icons = new Icon[2];
public ItemWeatherCrystal(int par1) {
super(par1);
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister par1IconRegister) {
for(int i = 0; i < icons.length; i++)
icons[i] = IconHelper.forItem(par1IconRegister, this, i);
}
@Override
@SideOnly(Side.CLIENT)
public Icon getIconFromDamage(int par1) {
return par1 >= icons.length ? itemIcon : icons[par1];
}
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) {
for(int i = 0; i < icons.length; i++)
par3List.add(new ItemStack(par1, 1, i));
}
@Override
@SideOnly(Side.CLIENT)
public EnumRarity getRarity(ItemStack par1ItemStack) {
return EnumRarity.uncommon;
}
@Override
public String getItemDisplayName(ItemStack par1ItemStack) {
return par1ItemStack.getItemDamage() == 0 ? LibItemNames.WEATHER_CRYSTAL_D0 : LibItemNames.WEATHER_CRYSTAL_D1;
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
boolean raining = par2World.getWorldInfo().isRaining();
boolean removeRain = par1ItemStack.getItemDamage() == 0;
if(raining == removeRain) {
if(!par2World.isRemote)
par2World.getWorldInfo().setRaining(!removeRain);
par3EntityPlayer.renderBrokenItemStack(par1ItemStack);
par1ItemStack.stackSize--;
}
return par1ItemStack;
}
}
+21
View File
@@ -51,6 +51,11 @@ public final class ModItems {
public static Item dummyEnchantbook;
public static Item researchShareBook;
public static Item brightNitor;
public static Item rune;
public static Item scythe;
public static Item rainwaterBottle;
public static Item weatherCrystal;
public static Item lovePotion;
public static void initItems() {
wandTinkerer = new ItemWandTinkerer(LibItemIDs.idWandTinkerer).setUnlocalizedName(LibItemNames.WAND_TINKERER);
@@ -77,6 +82,11 @@ public final class ModItems {
dummyEnchantbook = new ItemDummyEnchantbook(LibItemIDs.idDummyEnchantbook).setUnlocalizedName(LibItemNames.DUMMY_ENCHANTBOOK);
researchShareBook = new ItemShareTome(LibItemIDs.idResearchShareBook).setUnlocalizedName(LibItemNames.RESEARCH_SHARE_BOOK);
brightNitor = new ItemBrightNitor(LibItemIDs.idBrightNitor).setUnlocalizedName(LibItemNames.BRIGHT_NITOR);
rune = new ItemRune(LibItemIDs.idRune).setUnlocalizedName(LibItemNames.RUNE);
scythe = new ItemScythe(LibItemIDs.idScythe).setUnlocalizedName(LibItemNames.SCYTHE);
rainwaterBottle = new ItemRainwaterBottle(LibItemIDs.idRainwaterBottle).setUnlocalizedName(LibItemNames.RAINWATER_BOTTLE);
weatherCrystal = new ItemWeatherCrystal(LibItemIDs.idWeatherCrystal).setUnlocalizedName(LibItemNames.WEATHER_CRYSTAL);
lovePotion = new ItemLovePotion(LibItemIDs.idLovePotion).setUnlocalizedName(LibItemNames.LOVE_POTION);
nameItems();
}
@@ -105,6 +115,9 @@ public final class ModItems {
LanguageRegistry.addName(fluxDetector, LibItemNames.FLUX_DETECTOR_D);
LanguageRegistry.addName(researchShareBook, LibItemNames.RESEARCH_SHARE_BOOK_D);
LanguageRegistry.addName(brightNitor, LibItemNames.BRIGHT_NITOR_D);
LanguageRegistry.addName(scythe, LibItemNames.SCYTHE_D);
LanguageRegistry.addName(rainwaterBottle, LibItemNames.RAINWATER_BOTTLE_D);
LanguageRegistry.addName(lovePotion, LibItemNames.LOVE_POTION_D);
}
public static void applyObjectTags() {
@@ -146,5 +159,13 @@ public final class ModItems {
tags = new ObjectTags().add(EnumTag.HEAL, 16).add(EnumTag.KNOWLEDGE, 18).add(EnumTag.WATER, 6).add(EnumTag.MAGIC, 10).add(EnumTag.TOOL, 12);
ThaumcraftApi.registerObjectTag(cleansingTalisman.itemID, LibMisc.TAG_META_WILDCARD, tags);
for(EnumTag tag : EnumTag.class.getEnumConstants()) {
tags = new ObjectTags().add(tag, 1);
ThaumcraftApi.registerObjectTag(rune.itemID, tag.id, tags);
}
tags = new ObjectTags().add(EnumTag.WEATHER, 2).add(EnumTag.WATER, 1).add(EnumTag.CRYSTAL, 1);
ThaumcraftApi.registerObjectTag(rainwaterBottle.itemID, LibMisc.TAG_META_WILDCARD, tags);
}
}
@@ -26,6 +26,11 @@ public final class LibItemIDs {
public static final int DEFAULT_DUMMY_ENCHANTBOOK = 21171;
public static final int DEFAULT_RESEARCH_SHARE_BOOK = 21172;
public static final int DEFAULT_BRIGHT_NITOR = 21173;
public static final int DEFAULT_RUNE = 21174;
public static final int DEFAULT_SCYTHE = 21175;
public static final int DEFAULT_RAINWATER_BOTTLE = 21176;
public static final int DEFAULT_WEATHER_CRYSTAL = 21177;
public static final int DEFAULT_LOVE_POTION = 21178;
public static int idWandTinkerer;
public static int idGlowstoneGas;
@@ -51,4 +56,10 @@ public final class LibItemIDs {
public static int idDummyEnchantbook;
public static int idResearchShareBook;
public static int idBrightNitor;
public static int idRune;
public static int idScythe;
public static int idRainwaterBottle;
public static int idWeatherCrystal;
public static int idLovePotion;
}
@@ -102,4 +102,27 @@ public final class LibItemNames {
public static final String BRIGHT_NITOR = "brightNitor";
public static final String BRIGHT_NITOR_R = "BRIGHT_NITOR";
public static final String BRIGHT_NITOR_D = "Hyperenergetic Nitor";
public static final String RUNE = "rune";
public static final String RUNE_D = "Rune ";
public static final String SCYTHE = "scythe";
public static final String SCYTHE_R = "SCYTHE";
public static final String SCYTHE_D = "Reaper's Scythe";
public static final String RAINWATER_BOTTLE = "rainwaterBottle";
public static final String RAINWATER_BOTTLE_R = "RAINWATER_BOTTLE";
public static final String RAINWATER_BOTTLE_D = "Bottle of Rain Water";
public static final String WEATHER_CRYSTAL = "weatherCrystal";
public static final String WEATHER_CRYSTAL_R = "WEATHER_CRYSTAL";
public static final String WEATHER_CRYSTAL_R0 = "WEATHER_CRYSTAL_0";
public static final String WEATHER_CRYSTAL_R1 = "WEATHER_CRYSTAL_1";
public static final String WEATHER_CRYSTAL_D0 = "Crystal of Sunlight";
public static final String WEATHER_CRYSTAL_D1 = "Crystal of Rainfall";
public static final String LOVE_POTION = "lovePotion";
public static final String LOVE_POTION_R = "LOVE_POTION";
public static final String LOVE_POTION_D = "Aphrodisiac Concoction";
}
+1 -1
View File
@@ -18,7 +18,7 @@ public final class LibMisc {
public static final String MOD_ID = "ThaumicTinkerer";
public static final String MOD_NAME = "Thaumic Tinkerer";
public static final String MOD_VERSION = "1.0.6";
public static final String MOD_VERSION = "1.0.7";
public static final String DEPENDENCIES = "required-after:Thaumcraft";
@@ -22,4 +22,5 @@ public final class LibNetwork {
public static final String SUBCHANNEL_TRANSMUTATOR_SYNC = "transmutatorSync";
public static final String SUBCHANNEL_ANIMATION_TABLET_SYNC = "tabletSync";
public static final String SUBCHANNEL_ANIMATION_TABLET_BUTTON = "tabletButton";
public static final String SUBCHANNEL_SOUL_HEART_SYNC = "soulHearts";
}
@@ -31,6 +31,7 @@ public final class LibResources {
public static final String GUI_TRANSMUTATOR = ROOT_GUI + "guiTransmutator.png";
public static final String GUI_ANIMATION_TABLET = ROOT_GUI + "guiAnimationTablet.png";
public static final String GUI_SOUL_HEARTS = ROOT_GUI + "soulHearts.png";
public static final String MODEL_WARD_CHEST = ROOT_MODEL + "chestWard.png";
public static final String MODEL_LEGS_GOLIATH = ROOT_MODEL + "armorGoliath.png";
@@ -16,6 +16,7 @@ package vazkii.tinkerer.network;
import net.minecraft.entity.player.EntityPlayer;
import vazkii.tinkerer.network.packet.PacketVerification;
import vazkii.tinkerer.util.handler.SoulHeartHandler;
import cpw.mods.fml.common.IPlayerTracker;
import cpw.mods.fml.common.network.Player;
@@ -24,6 +25,7 @@ public class PlayerTracker implements IPlayerTracker {
@Override
public void onPlayerLogin(EntityPlayer player) {
PacketManager.sendPacketToClient((Player) player, new PacketVerification());
SoulHeartHandler.updateClient(player);
}
@Override
@@ -0,0 +1,71 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 3.
* Thaumcraft 3 © Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [2 Jul 2013, 17:22:14 (GMT)]
*/
package vazkii.tinkerer.network.packet;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import net.minecraft.network.INetworkManager;
import net.minecraft.network.packet.Packet250CustomPayload;
import vazkii.tinkerer.client.util.handler.SoulHeartClientHandler;
import vazkii.tinkerer.lib.LibNetwork;
import vazkii.tinkerer.network.ModPacket;
import cpw.mods.fml.common.network.Player;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class PacketSoulHeartSync extends ModPacket {
int sync;
public PacketSoulHeartSync() { }
public PacketSoulHeartSync(int sync) {
this.sync = sync;
}
@Override
public ByteArrayOutputStream asOutputStream() throws IOException {
ByteArrayOutputStream stream = new ByteArrayOutputStream();
DataOutputStream data = new DataOutputStream(stream);
writeSubchannel(data);
data.writeInt(sync);
return stream;
}
@Override
@SideOnly(Side.CLIENT)
public boolean readPayload(Packet250CustomPayload packet, INetworkManager manager, Player player, String subchannel) throws IOException {
if(subchannel.equals(getSubchannel())) {
ByteArrayInputStream stream = new ByteArrayInputStream(packet.data);
DataInputStream inputStream = new DataInputStream(stream);
skipSubchannel(inputStream);
int hp = inputStream.readInt();
SoulHeartClientHandler.clientPlayerHP = hp;
return true;
}
return false;
}
@Override
public String getSubchannel() {
return LibNetwork.SUBCHANNEL_SOUL_HEART_SYNC;
}
}
@@ -204,7 +204,7 @@ public final class ModInfusionRecipes {
'A', new ItemStack(Config.itemResource, 1, 0),
'G', new ItemStack(ModItems.glowstoneGas),
'N', new ItemStack(Config.itemResource, 1, 1));
tags = new ObjectTags().add(EnumTag.POWER, 12).add(EnumTag.METAL, 16).add(EnumTag.CONTROL, 6);
ThaumcraftApi.addInfusionCraftingRecipe(LibBlockNames.MAGNET_R, LibBlockNames.MAGNET_R, 100, tags, new ItemStack(ModBlocks.magnet),
" I ", "SIs", "LWR",
@@ -214,5 +214,39 @@ public final class ModInfusionRecipes {
'W', new ItemStack(Config.blockWooden),
'L', new ItemStack(Item.dyePowder, 1, 4),
'R', new ItemStack(Item.redstone));
tags = new ObjectTags().add(EnumTag.LIFE, 12).add(EnumTag.DEATH, 24).add(EnumTag.EVIL, 6).add(EnumTag.SPIRIT, 30);
ThaumcraftApi.addInfusionCraftingRecipe(LibItemNames.SCYTHE_R, LibItemNames.SCYTHE_R, 200, tags, new ItemStack(ModItems.scythe),
"QQH", "Q I", " I",
'Q', new ItemStack(ModItems.darkQuartz),
'H', new ItemStack(Item.skull, 1, 1),
'I', new ItemStack(Config.itemResource, 1, 2));
tags = new ObjectTags().add(EnumTag.WEATHER, 6).add(EnumTag.FIRE, 12).add(EnumTag.CRYSTAL, 10);
ThaumcraftApi.addInfusionCraftingRecipe(LibItemNames.WEATHER_CRYSTAL_R, LibItemNames.WEATHER_CRYSTAL_R0, 25, tags, new ItemStack(ModItems.weatherCrystal, 3, 0),
"AQS",
'A', new ItemStack(Config.itemResource, 1, 6),
'Q', new ItemStack(Config.itemResource, 1, 3),
'S', new ItemStack(Config.itemShard, 1, 1));
tags = new ObjectTags().add(EnumTag.WEATHER, 6).add(EnumTag.WATER, 12).add(EnumTag.CRYSTAL, 10);
ThaumcraftApi.addInfusionCraftingRecipe(LibItemNames.WEATHER_CRYSTAL_R, LibItemNames.WEATHER_CRYSTAL_R1, 25, tags, new ItemStack(ModItems.weatherCrystal, 3, 1),
"AQS",
'A', new ItemStack(Config.itemResource, 1, 6),
'Q', new ItemStack(Config.itemResource, 1, 3),
'S', new ItemStack(Config.itemShard, 1, 2));
tags = new ObjectTags().add(EnumTag.LIFE, 12).add(EnumTag.EARTH, 6).add(EnumTag.CONTROL, 5);
ThaumcraftApi.addInfusionCraftingRecipe(LibItemNames.LOVE_POTION_R, LibItemNames.LOVE_POTION_R, 50, tags, new ItemStack(ModItems.lovePotion),
"PCW", "NBM", "RGZ",
'P', new ItemStack(Item.potato),
'C', new ItemStack(Item.carrot),
'W', new ItemStack(Item.wheat),
'N', new ItemStack(Item.netherStalkSeeds),
'B', new ItemStack(Item.potion, 1, 0),
'M', new ItemStack(Item.speckledMelon),
'R', new ItemStack(Item.redstone),
'G', new ItemStack(Item.lightStoneDust),
'Z', new ItemStack(Item.blazePowder));
}
}
@@ -57,6 +57,10 @@ public final class ModResearchItems {
public static ResearchItem phantomBlocks;
public static ResearchItem brightNitor;
public static ResearchItem magnet;
public static ResearchItem scythe;
public static ResearchItem rainwaterBottle;
public static ResearchItem weatherCrystals;
public static ResearchItem lovePotion;
public static void registerModResearchItems() {
ObjectTags tags = new ObjectTags().add(EnumTag.MAGIC, 16).add(EnumTag.VOID, 8);
@@ -141,8 +145,20 @@ public final class ModResearchItems {
tags = new ObjectTags().add(EnumTag.FIRE, 12).add(EnumTag.LIGHT, 24).add(EnumTag.POWER, 30).add(EnumTag.MOTION, 12).add(EnumTag.DESTRUCTION, 6).add(EnumTag.VISION, 16);
brightNitor = new ResearchItem(LibItemNames.BRIGHT_NITOR_R, tags, 2, 27, new ItemStack(ModItems.brightNitor)).setHidden().setParents(Config.researchTTOE).setParentsHidden(glowstoneGas).registerResearchItem();
tags = new ObjectTags().add(EnumTag.POWER, 6).add(EnumTag.CONTROL, 12).add(EnumTag.WIND, 6).add(EnumTag.METAL, 5).add(EnumTag.MECHANISM, 16);
magnet = new ResearchItem(LibBlockNames.MAGNET_R, tags, -4, 27, new ItemStack(ModBlocks.magnet)).setHidden().setParents(Config.researchHoverHarness).registerResearchItem();
tags = new ObjectTags().add(EnumTag.DARK, 12).add(EnumTag.DEATH, 24).add(EnumTag.ELDRITCH, 6).add(EnumTag.EVIL, 9).add(EnumTag.FLESH, 14).add(EnumTag.SPIRIT, 24).add(EnumTag.LIFE, 16);
scythe = new ResearchItem(LibItemNames.SCYTHE_R, tags, -2, 28, new ItemStack(ModItems.scythe)).setHidden().setParents(Config.researchTTOE).registerResearchItem();
tags = new ObjectTags();
rainwaterBottle = new ResearchItem(LibItemNames.RAINWATER_BOTTLE_R, tags, -7, -2, new ItemStack(ModItems.rainwaterBottle)).setAutoUnlock().registerResearchItem();
tags = new ObjectTags().add(EnumTag.WEATHER, 12).add(EnumTag.FIRE, 12).add(EnumTag.WATER, 12).add(EnumTag.CRYSTAL, 10).add(EnumTag.VISION, 6);
weatherCrystals = new ResearchItem(LibItemNames.WEATHER_CRYSTAL_R, tags, 2, 28, new ItemStack(ModItems.weatherCrystal)).setHidden().setParents(Config.researchTTOE).registerResearchItem();
tags = new ObjectTags().add(EnumTag.LIFE, 24).add(EnumTag.CONTROL, 10).add(EnumTag.EARTH, 5).add(EnumTag.HEAL, 4);
lovePotion = new ResearchItem(LibItemNames.LOVE_POTION_R, tags, 1, 20, new ItemStack(ModItems.lovePotion)).setHidden().setParents(Config.researchUTFT).registerResearchItem();
}
}
@@ -28,7 +28,8 @@ public class FakeInvPlayer extends InventoryPlayer {
@Override
public void setInventorySlotContents(int par1, ItemStack par2ItemStack) {
super.setInventorySlotContents(par1, par2ItemStack);
super.setInventorySlotContents(par1, par2ItemStack);
if(par1 == currentItem)
fakePlayer.tablet.setInventorySlotContents(0, getStackInSlot(currentItem));
}
@@ -189,7 +189,9 @@ public class TileEntityAnimationTablet extends TileEntity implements IInventory
}
if(done) {
setInventorySlotContents(0, stack.stackSize == 0 ? null : stack);
if(stack.stackSize == 0)
setInventorySlotContents(0, null);
PacketDispatcher.sendPacketToAllPlayers(getDescriptionPacket());
}
}
@@ -49,7 +49,7 @@ public class TileEntityMagnet extends TileEntity {
double y2 = item.posY;
double z2 = item.posZ;
float distanceSqrd = blue ? ((float) ((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2) + (z1 - z2) * (z1 - z2))) : 1.1F;
float distanceSqrd = blue ? (float) ((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2) + (z1 - z2) * (z1 - z2)) : 1.1F;
if(distanceSqrd > 1) {
setEntityMotionFromVector(item, x1, y1, z1, speedMod * 0.25F);
@@ -68,6 +68,11 @@ public final class ConfigurationHandler {
LibItemIDs.idDummyEnchantbook = loadItem(LibItemNames.DUMMY_ENCHANTBOOK, LibItemIDs.DEFAULT_DUMMY_ENCHANTBOOK);
LibItemIDs.idResearchShareBook = loadItem(LibItemNames.RESEARCH_SHARE_BOOK, LibItemIDs.DEFAULT_RESEARCH_SHARE_BOOK);
LibItemIDs.idBrightNitor = loadItem(LibItemNames.BRIGHT_NITOR, LibItemIDs.DEFAULT_BRIGHT_NITOR);
LibItemIDs.idRune = loadItem(LibItemNames.RUNE, LibItemIDs.DEFAULT_RUNE);
LibItemIDs.idScythe = loadItem(LibItemNames.SCYTHE, LibItemIDs.DEFAULT_SCYTHE);
LibItemIDs.idRainwaterBottle = loadItem(LibItemNames.RAINWATER_BOTTLE, LibItemIDs.DEFAULT_RAINWATER_BOTTLE);
LibItemIDs.idWeatherCrystal = loadItem(LibItemNames.WEATHER_CRYSTAL, LibItemIDs.DEFAULT_WEATHER_CRYSTAL);
LibItemIDs.idLovePotion = loadItem(LibItemNames.LOVE_POTION, LibItemIDs.DEFAULT_LOVE_POTION);
LibBlockIDs.idGlowstoneGas = loadBlock(LibBlockNames.GLOWSTONE_GAS, LibBlockIDs.DEFAULT_GLOWSTONE_GAS);
LibBlockIDs.idTransmutator = loadBlock(LibBlockNames.TRANSMUTATOR, LibBlockIDs.DEFAULT_TRANSMUTATOR);
@@ -0,0 +1,50 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 3.
* Thaumcraft 3 © Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [3 Jul 2013, 13:49:03 (GMT)]
*/
package vazkii.tinkerer.util.handler;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action;
import vazkii.tinkerer.item.ModItems;
public class RainwaterBottleHandler {
@ForgeSubscribe
public void onPlayerInteract(PlayerInteractEvent event) {
boolean rightEvent = event.action == Action.RIGHT_CLICK_AIR;
ItemStack stack = event.entityPlayer.getCurrentEquippedItem();
boolean correctStack = stack != null && stack.itemID == Item.glassBottle.itemID;
boolean raining = event.entityPlayer.worldObj.getWorldInfo().isRaining();
boolean canCatch = event.entityPlayer.worldObj.canBlockSeeTheSky((int) event.entityPlayer.posX, (int) event.entityPlayer.posY, (int) event.entityPlayer.posZ);
if(rightEvent && correctStack && raining && canCatch) {
if(stack.stackSize == 1 && !event.entityPlayer.inventory.hasItem(ModItems.rainwaterBottle.itemID)) {
stack.itemID = ModItems.rainwaterBottle.itemID;
} else {
ItemStack stack1 = new ItemStack(ModItems.rainwaterBottle);
if(!event.entityPlayer.inventory.addItemStackToInventory(stack1))
event.entityPlayer.dropPlayerItem(stack1);
stack.stackSize--;
if(stack.stackSize == 0)
event.entityPlayer.inventory.setInventorySlotContents(event.entityPlayer.inventory.currentItem, null);
}
}
}
}
@@ -0,0 +1,157 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 3.
* Thaumcraft 3 © Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [2 Jul 2013, 16:45:54 (GMT)]
*/
package vazkii.tinkerer.util.handler;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.monster.IMob;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.Potion;
import net.minecraft.util.DamageSource;
import net.minecraftforge.event.EventPriority;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.entity.living.LivingHurtEvent;
import vazkii.tinkerer.item.ModItems;
import vazkii.tinkerer.lib.LibMisc;
import vazkii.tinkerer.network.PacketManager;
import vazkii.tinkerer.network.packet.PacketSoulHeartSync;
import cpw.mods.fml.common.network.Player;
public class SoulHeartHandler {
private static final String COMPOUND = LibMisc.MOD_ID;
private static final String TAG_HP = "soulHearts";
private static final int MAX_HP = 20;
@ForgeSubscribe
public void onPlayerDamage(LivingHurtEvent event) {
if(event.entityLiving instanceof EntityPlayer && event.ammount > 0) {
EntityPlayer player = (EntityPlayer) event.entityLiving;
event.ammount = removeHP(player, event.ammount);
updateClient(player);
}
}
@ForgeSubscribe(priority = EventPriority.LOWEST)
public void onMobDamage(LivingHurtEvent event) {
Entity attacker = event.source.getEntity();
if(event.entityLiving instanceof IMob && attacker != null && attacker instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) attacker;
ItemStack stack = player.getCurrentEquippedItem();
if(stack != null && stack.itemID == ModItems.scythe.itemID) {
int actualDamage = event.ammount;
actualDamage = applyArmorCalculations(event.entityLiving, event.source, actualDamage);
actualDamage = applyPotionDamageCalculations(event.entityLiving, event.source, actualDamage);
if(actualDamage >= event.entityLiving.getHealth()) {
// The mob will die from this attack, calculate soul hearts now...
addHP(player, 2);
updateClient(player);
player.worldObj.playSoundAtEntity(player, "mob.blaze.death", 0.9F, 1F);
}
}
}
}
public static boolean addHP(EntityPlayer player, int hp) {
int current = getHP(player);
if(current >= MAX_HP)
return false;
setHP(player, Math.min(MAX_HP, current + hp));
return true;
}
// Returns overflow damage
public static int removeHP(EntityPlayer player, int hp) {
int current = getHP(player);
int newHp = current - hp;
setHP(player, Math.max(0, newHp));
return Math.max(0, -newHp);
}
public static void setHP(EntityPlayer player, int hp) {
NBTTagCompound cmp = getCompoundToSet(player);
cmp.setInteger(TAG_HP, hp);
}
public static int getHP(EntityPlayer player) {
NBTTagCompound cmp = getCompoundToSet(player);
return cmp.hasKey(TAG_HP) ? cmp.getInteger(TAG_HP) : 0;
}
private static NBTTagCompound getCompoundToSet(EntityPlayer player) {
NBTTagCompound cmp = player.getEntityData();
if(!cmp.hasKey(COMPOUND))
cmp.setCompoundTag(COMPOUND, new NBTTagCompound());
return cmp.getCompoundTag(COMPOUND);
}
public static void updateClient(EntityPlayer player) {
PacketManager.sendPacketToClient((Player) player, new PacketSoulHeartSync(getHP(player)));
}
// =============== METHODS COPIED FROM ENTITYLIVING ==================== //
private int applyArmorCalculations(EntityLiving entity, DamageSource par1DamageSource, int par2) {
if (!par1DamageSource.isUnblockable()) {
int j = 25 - entity.getTotalArmorValue();
int k = par2 * j + entity.carryoverDamage;
//entity.damageArmor(par2);
par2 = k / 25;
entity.carryoverDamage = k % 25;
}
return par2;
}
private int applyPotionDamageCalculations(EntityLiving entity, DamageSource par1DamageSource, int par2) {
int j;
int k;
int l;
if (entity.isPotionActive(Potion.resistance)) {
j = (entity.getActivePotionEffect(Potion.resistance).getAmplifier() + 1) * 5;
k = 25 - j;
l = par2 * k + entity.carryoverDamage;
par2 = l / 25;
entity.carryoverDamage = l % 25;
}
if (par2 <= 0)
return 0;
else {
j = EnchantmentHelper.getEnchantmentModifierDamage(entity.getLastActiveItems(), par1DamageSource);
if (j > 20)
j = 20;
if (j > 0 && j <= 20) {
k = 25 - j;
l = par2 * k + entity.carryoverDamage;
par2 = l / 25;
entity.carryoverDamage = l % 25;
}
return par2;
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 329 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

@@ -332,4 +332,54 @@ The light casted by this will shine closely behind the carrier, it seems to leav
This block acts as a magnet, it's state can be changed by right clicking it. While in south (blue) mode, it'll pull any nearby items towards it. While in north (red) mode, it'll do the opposite. Furthermore, the range of this attraction, or repulsion, is determined by the strength of the redstone signal applied to it.</page>
<page type = "infusioncrafting">MAGNET</page>
</project>
<!-- ======================================== Reaper Scythe /-->
<project id = "SCYTHE" version = "1">
<name>Reaper's Scythe</name>
<popupText>[TT] Soul Life</popupText>
<longText>You've been studying malicent knowledge, your objective is to possibly create a weapon that would do something with souls...</longText>
<page type = "text">You've studied malicent knowledge, and created a Scythe that reaps with pure evil.
This scythe pairs with a Thaumium Sword on all aspects, however, upon killing an hostile living being with it, the soul of that being will get reaped and converted into a Soul Heart, which acts as a shield, absorbing damage taken. Sadly, a soul heart will disapper entirely after protecting the bearer from any damage. Up to 20 soul hearts can be accumulated.
The Scythe also cuts tall grass and leaves with finesse without sustaining as much as a scratch.</page>
<page type = "infusioncrafting">SCYTHE</page>
</project>
<!-- ======================================== Bottle of Rain Water /-->
<project id = "RAINWATER_BOTTLE" version = "1">
<name>Bottle of Rain Water</name>
<popupText>[TT] Weather Studying</popupText>
<longText></longText>
<page type = "text">By right clicking with an empty bottle while raining you can collect rain water.
Sadly, rain water is impure and can not be put to the same uses as the spring water commonly used. On the other hand, it's the only way you know of studying the Aer aspect.
Weather is a complex subject, so this probably won't come in handy until later in your career.</page>
</project>
<!-- ======================================== Weather Crystals /-->
<project id = "WEATHER_CRYSTAL" version = "1">
<name>Crystals of Climate</name>
<popupText>[TT] Weather Management</popupText>
<longText>You think you've finally put to use the long standing knowledge of weather...</longText>
<page type = "text">By studying the element of weather, you managed to create a pair of crystals that will allow you to manipulate it.
These two crystals, of Sunlight and Rainfall, allow you to, respectivelly, halt and create rain, by shattering them.</page>
<page type = "infusioncrafting">WEATHER_CRYSTAL_0</page>
<page type = "infusioncrafting">WEATHER_CRYSTAL_1</page>
<page type = "text">asdf</page>
</project>
<!-- ======================================== Aphrodisiac Concoction /-->
<project id = "LOVE_POTION" version = "1">
<name>Aphrodisiac Concoction</name>
<popupText>[TT] Love's in the air</popupText>
<longText>The amount of times you had to waste your hard earned wheat or potatos on breeding livestock is your inspiration for what you're researching right now, the ultimate objective is a potion that will mimic those effects.</longText>
<page type = "text">You have forumalated a recipe for a concoction with the essence of love.
This potion-like item acts similar to a splash potion, simply tossing it near an area with livestock will cause the same effects as if these animals had been fed with their food of choice.</page>
<page type = "infusioncrafting">LOVE_POTION</page>
</project>
</research>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 610 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 838 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 167 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 360 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 356 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 83 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 265 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 358 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 581 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 557 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 343 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 351 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 562 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 615 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 612 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 351 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 369 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 613 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 254 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 253 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 274 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 354 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 480 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 393 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 265 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 447 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 307 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 529 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 425 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 575 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 413 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 462 B