Heart Canisters

This commit is contained in:
mDiyo 2013-05-29 17:56:05 -07:00
parent 5f6990edaf
commit 14edf4c2cf
54 changed files with 2023 additions and 1295 deletions

View File

@ -74,6 +74,8 @@
<entry key="item.oreberry.aluminum.name">Aluminum Oreberry</entry> <entry key="item.oreberry.aluminum.name">Aluminum Oreberry</entry>
<entry key="item.oreberry.silver.name">Silver Oreberry</entry> <entry key="item.oreberry.silver.name">Silver Oreberry</entry>
<entry key="item.tconstruct.titleicon.name">Spawn </entry>
<entry key="item.tconstruct.Materials.PaperStack.name">Paper Stack</entry> <entry key="item.tconstruct.Materials.PaperStack.name">Paper Stack</entry>
<entry key="item.tconstruct.Materials.SlimeCrystal.name">Slime Crystal</entry> <entry key="item.tconstruct.Materials.SlimeCrystal.name">Slime Crystal</entry>
<entry key="item.tconstruct.Materials.SearedBrick.name">Seared Brick</entry> <entry key="item.tconstruct.Materials.SearedBrick.name">Seared Brick</entry>
@ -165,15 +167,18 @@
<entry key="LiquidMetal.DSteel.name">Liquid Damascus Steel</entry> <entry key="LiquidMetal.DSteel.name">Liquid Damascus Steel</entry>
<entry key="LiquidMetal.Angmallen.name">Liquid Angmallen</entry> <entry key="LiquidMetal.Angmallen.name">Liquid Angmallen</entry>
<entry key="item.food.apple.diamond.name">Jeweled Apple</entry>
<entry key="item.tconstruct.strangefood.edibleslime.name">Gelatinous Slime</entry> <entry key="item.tconstruct.strangefood.edibleslime.name">Gelatinous Slime</entry>
<entry key="item.tconstruct.canister.empty.name">Empty Canister</entry> <entry key="item.tconstruct.canister.empty.name">Empty Canister</entry>
<entry key="item.tconstruct.canister.heart.name">Heart Container</entry> <entry key="item.tconstruct.canister.miniheart.red.name">Miniature Red Heart</entry>
<entry key="item.tconstruct.canister.heart.name">Heart Canister</entry>
<entry key="SearedBlock.Table.name">Casting Table</entry> <entry key="SearedBlock.Table.name">Casting Table</entry>
<entry key="SearedBlock.Faucet.name">Seared Faucet</entry> <entry key="SearedBlock.Faucet.name">Seared Faucet</entry>
<entry key="SearedBlock.Basin.name">Casting Basin</entry> <entry key="SearedBlock.Basin.name">Casting Basin</entry>
<entry key="entity.TConstruct.EdibleSlime.name">Blue Slime</entry> <entry key="entity.TConstruct.EdibleSlime.name">Blue Slime</entry>
<entry key="entity.TConstruct.KingSlime.name">King Slime</entry>
<entry key="entity.TConstruct.UnstableCreeper.name">Nitro Creeper</entry> <entry key="entity.TConstruct.UnstableCreeper.name">Nitro Creeper</entry>
<entry key="entity.TConstruct.EdibleSlime">Blue Slime</entry> <entry key="entity.TConstruct.EdibleSlime">Blue Slime</entry>
<entry key="entity.TConstruct.UnstableCreeper">Nitro Creeper</entry> <entry key="entity.TConstruct.UnstableCreeper">Nitro Creeper</entry>

View File

@ -37,7 +37,7 @@ import cpw.mods.fml.common.registry.VillagerRegistry;
* @dependencies: IC2 API * @dependencies: IC2 API
*/ */
@Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.3.dev.43", dependencies = "required-after:Forge@[7.7.1.675,)") @Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.3.dev.48", dependencies = "required-after:Forge@[7.7.1.675,)")
@NetworkMod(serverSideRequired = false, clientSideRequired = true, channels = { "TConstruct" }, packetHandler = mods.tinker.tconstruct.util.network.TPacketHandler.class) @NetworkMod(serverSideRequired = false, clientSideRequired = true, channels = { "TConstruct" }, packetHandler = mods.tinker.tconstruct.util.network.TPacketHandler.class)
public class TConstruct public class TConstruct
{ {

View File

@ -1,9 +1,73 @@
package mods.tinker.tconstruct.blocks.logic; package mods.tinker.tconstruct.blocks.logic;
import mods.tinker.tconstruct.library.util.CoordTuple;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.INetworkManager;
import net.minecraft.network.packet.Packet;
import net.minecraft.network.packet.Packet132TileEntityData;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
public class RedwireLogic extends TileEntity public class RedwireLogic extends TileEntity
{ {
byte facesUsed; byte facesUsed;
byte type; byte type;
byte distanceTravelled;
byte maxDistance;
public void readCustomNBT (NBTTagCompound tags)
{
/*hasMaster = tags.getBoolean("HasMaster");
if (hasMaster)
{
int xCenter = tags.getInteger("xCenter");
int yCenter = tags.getInteger("yCenter");
int zCenter = tags.getInteger("zCenter");
master = new CoordTuple(xCenter, yCenter, zCenter);
masterID = tags.getShort("MasterID");
masterMeat = tags.getByte("masterMeat");
}*/
}
public void writeCustomNBT (NBTTagCompound tags)
{
/*tags.setBoolean("HasMaster", hasMaster);
if (hasMaster)
{
tags.setInteger("xCenter", master.x);
tags.setInteger("yCenter", master.y);
tags.setInteger("zCenter", master.z);
tags.setShort("MasterID", masterID);
tags.setByte("masterMeat", masterMeat);
}*/
}
@Override
public void readFromNBT (NBTTagCompound tags)
{
super.readFromNBT(tags);
readCustomNBT(tags);
}
@Override
public void writeToNBT (NBTTagCompound tags)
{
super.writeToNBT(tags);
writeCustomNBT(tags);
}
/* Packets */
@Override
public Packet getDescriptionPacket ()
{
NBTTagCompound tag = new NBTTagCompound();
writeCustomNBT(tag);
return new Packet132TileEntityData(xCoord, yCoord, zCoord, 1, tag);
}
@Override
public void onDataPacket (INetworkManager net, Packet132TileEntityData packet)
{
readCustomNBT(packet.customParam1);
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
}
} }

View File

@ -0,0 +1,22 @@
package mods.tinker.tconstruct.blocks.traps;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.world.World;
public class Punji extends Block
{
public Punji(int id)
{
super(id, Material.circuits);
}
@Override
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity)
{
entity.fallDistance *= 2.0F;
}
}

View File

@ -3,25 +3,25 @@ package mods.tinker.tconstruct.client;
import mods.tinker.tconstruct.TConstruct; import mods.tinker.tconstruct.TConstruct;
import mods.tinker.tconstruct.client.armor.WingModel; import mods.tinker.tconstruct.client.armor.WingModel;
import mods.tinker.tconstruct.common.TContent; import mods.tinker.tconstruct.common.TContent;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.model.ModelBiped; import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.entity.RenderPlayer; import net.minecraft.client.renderer.Tessellator;
import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.client.event.RenderPlayerEvent; import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.client.event.TextureStitchEvent; import net.minecraftforge.client.event.TextureStitchEvent;
import net.minecraftforge.client.event.sound.SoundLoadEvent; import net.minecraftforge.client.event.sound.SoundLoadEvent;
import net.minecraftforge.event.ForgeSubscribe; import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.liquids.LiquidStack; import net.minecraftforge.liquids.LiquidStack;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class TClientEvents public class TClientEvents
{ {
Minecraft mc = Minecraft.getMinecraft();
EntityPlayer player;
/* Sounds */ /* Sounds */
@ForgeSubscribe @ForgeSubscribe
public void onSound (SoundLoadEvent event) public void onSound (SoundLoadEvent event)
@ -51,6 +51,58 @@ public class TClientEvents
} }
} }
/* Health */
@ForgeSubscribe
public void renderHealthbar (RenderGameOverlayEvent.Post event)
{
if (event.type == RenderGameOverlayEvent.ElementType.HEALTH)
{
if (player == null)
player = mc.thePlayer;
ScaledResolution scaledresolution = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight);
int scaledWidth = scaledresolution.getScaledWidth();
int scaledHeight = scaledresolution.getScaledHeight();
int xBasePos = scaledWidth / 2 - 91;
int yBasePos = scaledHeight - 39;
this.mc.renderEngine.bindTexture("/mods/tinker/textures/gui/newhearts.png");
int hp = player.getHealth();
for (int iter = 0; iter < hp / 20; iter++)
{
int renderHearts = (hp - 20*(iter+1)) / 2;
if (renderHearts > 10)
renderHearts = 10;
for (int i = 0; i < renderHearts; i++)
{
this.drawTexturedModalRect(xBasePos + 8*i, yBasePos, 0 + 18*iter, 0, 8, 8);
}
if (hp % 2 == 1 && renderHearts < 10)
{
this.drawTexturedModalRect(xBasePos + 8*renderHearts, yBasePos, 9 + 18*iter, 0, 8, 8);
}
}
this.mc.renderEngine.bindTexture("/gui/icons.png");
}
}
public void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6)
{
float f = 0.00390625F;
float f1 = 0.00390625F;
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.addVertexWithUV((double)(par1 + 0), (double)(par2 + par6), (double)this.zLevel, (double)((float)(par3 + 0) * f), (double)((float)(par4 + par6) * f1));
tessellator.addVertexWithUV((double)(par1 + par5), (double)(par2 + par6), (double)this.zLevel, (double)((float)(par3 + par5) * f), (double)((float)(par4 + par6) * f1));
tessellator.addVertexWithUV((double)(par1 + par5), (double)(par2 + 0), (double)this.zLevel, (double)((float)(par3 + par5) * f), (double)((float)(par4 + 0) * f1));
tessellator.addVertexWithUV((double)(par1 + 0), (double)(par2 + 0), (double)this.zLevel, (double)((float)(par3 + 0) * f), (double)((float)(par4 + 0) * f1));
tessellator.draw();
}
double zLevel = 0;
/* Armor */ /* Armor */
ModelBiped model = new ModelBiped(5f); ModelBiped model = new ModelBiped(5f);
WingModel wings = new WingModel(); WingModel wings = new WingModel();

View File

@ -521,7 +521,7 @@ public class TProxyClient extends TProxyCommon
new int[] { 7, 0, 13 }, new int[] { 3, 3, 13 } //Chisel new int[] { 7, 0, 13 }, new int[] { 3, 3, 13 } //Chisel
}; };
static String[] toolNames = { "Repair and Modification", "Pickaxe", "Shovel", "Axe", static String[] toolNames = { "Repair and Modification", "Pickaxe", "Shovel", "Hatchet",
//"Lumber Axe", //"Lumber Axe",
//"Ice Axe", //"Ice Axe",
"Mattock", "Broadsword", "Longsword", "Rapier", "Dagger", "Frying Pan", "Battlesign", "Chisel" }; "Mattock", "Broadsword", "Longsword", "Rapier", "Dagger", "Frying Pan", "Battlesign", "Chisel" };

View File

@ -21,11 +21,11 @@ public class CrystalModel extends ModelBase
body.setRotationPoint(0F, 0F, 0F); body.setRotationPoint(0F, 0F, 0F);
setRotation(body, 0, 0.7853982F, 0); setRotation(body, 0, 0.7853982F, 0);
top = new ModelRendererTurbo(this, 0, 0, 32, 32); top = new ModelRendererTurbo(this, 0, 0, 32, 32);
top.addCone(0, 0, 0, 2.8F, 4, 4, 0, ModelRendererTurbo.MR_BOTTOM, 4, 4); top.addCone(0, 0, 0, 2.8F, 4, 4, 0, ModelRendererTurbo.MR_BOTTOM, 4, 8);
top.setRotationPoint(0F, -4F, 0F); top.setRotationPoint(0F, -4F, 0F);
setRotation(top, 0F, 0F, 0F); setRotation(top, 0F, 0F, 0F);
bottom = new ModelRendererTurbo(this, 0, 18, 32, 32); bottom = new ModelRendererTurbo(this, 0, 18, 32, 32);
top.addCone(0, 10, 0, 2.8F, 4, 4, 0, ModelRendererTurbo.MR_TOP, 4, 4); top.addCone(0, 10, 0, 2.8F, 4, 4, 0, ModelRendererTurbo.MR_TOP, 4, 8);
bottom.setRotationPoint(0F, 6F, 0F); bottom.setRotationPoint(0F, 6F, 0F);
//setRotation(bottom, 0F, 0F, 0F); //setRotation(bottom, 0F, 0F, 0F);
} }

View File

@ -4,6 +4,8 @@ import mods.tinker.tconstruct.entity.BlueSlime;
import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.boss.BossStatus;
import net.minecraft.entity.boss.IBossDisplayData;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
@ -21,6 +23,18 @@ public class SlimeRender extends RenderLiving
this.scaleAmount = par2ModelBase; this.scaleAmount = par2ModelBase;
} }
public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9)
{
super.doRenderLiving(par1EntityLiving, par2, par4, par6, par8, par9);
renderBossHealth((BlueSlime) par1EntityLiving);
}
public void renderBossHealth(BlueSlime slime)
{
if (slime.getSlimeSize() >= 8)
BossStatus.func_82824_a(slime, true);
}
/** /**
* Determines whether Slime Render should pass or not. * Determines whether Slime Render should pass or not.
*/ */

View File

@ -1,22 +1,102 @@
package mods.tinker.tconstruct.common; package mods.tinker.tconstruct.common;
import mods.tinker.tconstruct.*; import mods.tinker.tconstruct.TConstruct;
import mods.tinker.tconstruct.blocks.*; import mods.tinker.tconstruct.blocks.EquipBlock;
import mods.tinker.tconstruct.blocks.logic.*; import mods.tinker.tconstruct.blocks.GravelOre;
import mods.tinker.tconstruct.entity.*; import mods.tinker.tconstruct.blocks.LavaTankBlock;
import mods.tinker.tconstruct.entity.projectile.*; import mods.tinker.tconstruct.blocks.LiquidMetalFlowing;
import mods.tinker.tconstruct.items.*; import mods.tinker.tconstruct.blocks.LiquidMetalStill;
import mods.tinker.tconstruct.items.blocks.*; import mods.tinker.tconstruct.blocks.MetalOre;
import mods.tinker.tconstruct.items.tools.*; import mods.tinker.tconstruct.blocks.MultiBrick;
import mods.tinker.tconstruct.items.armor.*; import mods.tinker.tconstruct.blocks.OreberryBush;
import mods.tinker.tconstruct.library.*; import mods.tinker.tconstruct.blocks.SearedBlock;
import mods.tinker.tconstruct.blocks.SmelteryBlock;
import mods.tinker.tconstruct.blocks.SpeedBlock;
import mods.tinker.tconstruct.blocks.StoneTorch;
import mods.tinker.tconstruct.blocks.TConstructBlock;
import mods.tinker.tconstruct.blocks.TMetalBlock;
import mods.tinker.tconstruct.blocks.ToolStationBlock;
import mods.tinker.tconstruct.blocks.logic.CastingBasinLogic;
import mods.tinker.tconstruct.blocks.logic.CastingTableLogic;
import mods.tinker.tconstruct.blocks.logic.FaucetLogic;
import mods.tinker.tconstruct.blocks.logic.FrypanLogic;
import mods.tinker.tconstruct.blocks.logic.LavaTankLogic;
import mods.tinker.tconstruct.blocks.logic.LiquidTextureLogic;
import mods.tinker.tconstruct.blocks.logic.MultiServantLogic;
import mods.tinker.tconstruct.blocks.logic.PartCrafterLogic;
import mods.tinker.tconstruct.blocks.logic.PatternChestLogic;
import mods.tinker.tconstruct.blocks.logic.PatternShaperLogic;
import mods.tinker.tconstruct.blocks.logic.SmelteryDrainLogic;
import mods.tinker.tconstruct.blocks.logic.SmelteryLogic;
import mods.tinker.tconstruct.blocks.logic.ToolStationLogic;
import mods.tinker.tconstruct.entity.BlueSlime;
import mods.tinker.tconstruct.entity.Crystal;
import mods.tinker.tconstruct.entity.FancyEntityItem;
import mods.tinker.tconstruct.entity.NitroCreeper;
import mods.tinker.tconstruct.entity.projectile.DaggerEntity;
import mods.tinker.tconstruct.items.CraftingItem;
import mods.tinker.tconstruct.items.DiamondApple;
import mods.tinker.tconstruct.items.FilledBucket;
import mods.tinker.tconstruct.items.HeartCanister;
import mods.tinker.tconstruct.items.Manual;
import mods.tinker.tconstruct.items.MaterialItem;
import mods.tinker.tconstruct.items.MetalPattern;
import mods.tinker.tconstruct.items.OreBerries;
import mods.tinker.tconstruct.items.Pattern;
import mods.tinker.tconstruct.items.StrangeFood;
import mods.tinker.tconstruct.items.TitleIcon;
import mods.tinker.tconstruct.items.ToolPart;
import mods.tinker.tconstruct.items.ToolShard;
import mods.tinker.tconstruct.items.armor.TArmorBase;
import mods.tinker.tconstruct.items.blocks.CraftedSoilItemBlock;
import mods.tinker.tconstruct.items.blocks.GravelOreItem;
import mods.tinker.tconstruct.items.blocks.LavaTankItemBlock;
import mods.tinker.tconstruct.items.blocks.LiquidItemBlock;
import mods.tinker.tconstruct.items.blocks.MetalItemBlock;
import mods.tinker.tconstruct.items.blocks.MetalOreItemBlock;
import mods.tinker.tconstruct.items.blocks.MultiBrickItem;
import mods.tinker.tconstruct.items.blocks.OreberryBushItem;
import mods.tinker.tconstruct.items.blocks.OreberryBushSecondItem;
import mods.tinker.tconstruct.items.blocks.SearedTableItemBlock;
import mods.tinker.tconstruct.items.blocks.SmelteryItemBlock;
import mods.tinker.tconstruct.items.blocks.SpeedBlockItem;
import mods.tinker.tconstruct.items.blocks.ToolStationItemBlock;
import mods.tinker.tconstruct.items.tools.BattleSign;
import mods.tinker.tconstruct.items.tools.Broadsword;
import mods.tinker.tconstruct.items.tools.Chisel;
import mods.tinker.tconstruct.items.tools.Dagger;
import mods.tinker.tconstruct.items.tools.FryingPan;
import mods.tinker.tconstruct.items.tools.Hatchet;
import mods.tinker.tconstruct.items.tools.Longsword;
import mods.tinker.tconstruct.items.tools.Mattock;
import mods.tinker.tconstruct.items.tools.Pickaxe;
import mods.tinker.tconstruct.items.tools.PotionLauncher;
import mods.tinker.tconstruct.items.tools.Rapier;
import mods.tinker.tconstruct.items.tools.Shovel;
import mods.tinker.tconstruct.library.TConstructRegistry;
import mods.tinker.tconstruct.library.client.TConstructClientRegistry; import mods.tinker.tconstruct.library.client.TConstructClientRegistry;
import mods.tinker.tconstruct.library.crafting.*; import mods.tinker.tconstruct.library.crafting.Detailing;
import mods.tinker.tconstruct.library.tools.*; import mods.tinker.tconstruct.library.crafting.LiquidCasting;
import mods.tinker.tconstruct.library.util.*; import mods.tinker.tconstruct.library.crafting.PatternBuilder;
import mods.tinker.tconstruct.modifiers.*; import mods.tinker.tconstruct.library.crafting.Smeltery;
import mods.tinker.tconstruct.util.*; import mods.tinker.tconstruct.library.crafting.ToolBuilder;
import mods.tinker.tconstruct.library.tools.ToolCore;
import mods.tinker.tconstruct.library.util.IPattern;
import mods.tinker.tconstruct.modifiers.ModAttack;
import mods.tinker.tconstruct.modifiers.ModAutoSmelt;
import mods.tinker.tconstruct.modifiers.ModBlaze;
import mods.tinker.tconstruct.modifiers.ModButtertouch;
import mods.tinker.tconstruct.modifiers.ModDurability;
import mods.tinker.tconstruct.modifiers.ModElectric;
import mods.tinker.tconstruct.modifiers.ModExtraModifier;
import mods.tinker.tconstruct.modifiers.ModInteger;
import mods.tinker.tconstruct.modifiers.ModLapis;
import mods.tinker.tconstruct.modifiers.ModRedstone;
import mods.tinker.tconstruct.modifiers.ModRepair;
import mods.tinker.tconstruct.modifiers.TActiveOmniMod;
import mods.tinker.tconstruct.util.PHConstruct;
import mods.tinker.tconstruct.util.RecipeRemover;
import mods.tinker.tconstruct.worldgen.OverworldProvider;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.MapColor; import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
@ -26,8 +106,11 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.WeightedRandomChestContent;
import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.BiomeDictionary; import net.minecraftforge.common.BiomeDictionary;
import net.minecraftforge.common.ChestGenHooks;
import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.liquids.LiquidContainerData; import net.minecraftforge.liquids.LiquidContainerData;
import net.minecraftforge.liquids.LiquidContainerRegistry; import net.minecraftforge.liquids.LiquidContainerRegistry;
@ -56,6 +139,7 @@ public class TContent implements IFuelHandler
public static Item titleIcon; public static Item titleIcon;
public static Item strangeFood; public static Item strangeFood;
public static Item diamondApple;
//public static Item stonePattern; //public static Item stonePattern;
//public static Item netherPattern; //public static Item netherPattern;
@ -156,7 +240,11 @@ public class TContent implements IFuelHandler
public static Item heavyPants; public static Item heavyPants;
public static Item heavyBoots; public static Item heavyBoots;
public static Item heartContainer; public static Item heartCanister;
//Chest hooks
public static ChestGenHooks tinkerHouseChest;
public static ChestGenHooks tinkerHousePatterns;
public TContent() public TContent()
{ {
@ -165,16 +253,17 @@ public class TContent implements IFuelHandler
registerMaterials(); registerMaterials();
addCraftingRecipes(); addCraftingRecipes();
setupToolTabs(); setupToolTabs();
addLoot();
} }
public void createEntities () public void createEntities ()
{ {
EntityRegistry.registerModEntity(FancyEntityItem.class, "Fancy Item", 0, TConstruct.instance, 32, 5, true); EntityRegistry.registerModEntity(FancyEntityItem.class, "Fancy Item", 0, TConstruct.instance, 32, 5, true);
EntityRegistry.registerModEntity(DaggerEntity.class, "Dagger", 1, TConstruct.instance, 32, 5, true); EntityRegistry.registerModEntity(DaggerEntity.class, "Dagger", 1, TConstruct.instance, 32, 5, true);
EntityRegistry.registerModEntity(SlimeClone.class, "SlimeClone", 2, TConstruct.instance, 32, 5, true); EntityRegistry.registerModEntity(Crystal.class, "Crystal", 2, TConstruct.instance, 32, 5, true);
//EntityRegistry.registerModEntity(SlimeClone.class, "SlimeClone", 2, TConstruct.instance, 32, 5, true);
//EntityRegistry.registerModEntity(LaunchedPotion.class, "Launched Potion", 1, TConstruct.instance, 32, 3, true); //EntityRegistry.registerModEntity(LaunchedPotion.class, "Launched Potion", 1, TConstruct.instance, 32, 3, true);
//EntityRegistry.registerModEntity(CartEntity.class, "Small Wagon", 1, TConstruct.instance, 32, 5, true); //EntityRegistry.registerModEntity(CartEntity.class, "Small Wagon", 1, TConstruct.instance, 32, 5, true);
//EntityRegistry.registerModEntity(Crystal.class, "Crystal", 2, TConstruct.instance, 32, 5, true);
//EntityRegistry.registerModEntity(Skyla.class, "Skyla", 10, TConstruct.instance, 32, 5, true); //EntityRegistry.registerModEntity(Skyla.class, "Skyla", 10, TConstruct.instance, 32, 5, true);
EntityRegistry.registerModEntity(NitroCreeper.class, "UnstableCreeper", 11, TConstruct.instance, 64, 5, true); EntityRegistry.registerModEntity(NitroCreeper.class, "UnstableCreeper", 11, TConstruct.instance, 64, 5, true);
@ -192,6 +281,20 @@ public class TContent implements IFuelHandler
BiomeGenBase[] nether = BiomeDictionary.getBiomesForType(BiomeDictionary.Type.NETHER); BiomeGenBase[] nether = BiomeDictionary.getBiomesForType(BiomeDictionary.Type.NETHER);
if (PHConstruct.superfunWorld)
{
EntityRegistry.addSpawn(NitroCreeper.class, 1000, 100, 100, EnumCreatureType.monster, plains);
EntityRegistry.addSpawn(NitroCreeper.class, 1000, 100, 100, EnumCreatureType.monster, mountain);
EntityRegistry.addSpawn(NitroCreeper.class, 1000, 100, 100, EnumCreatureType.monster, hills);
EntityRegistry.addSpawn(NitroCreeper.class, 1000, 100, 100, EnumCreatureType.monster, swamp);
EntityRegistry.addSpawn(NitroCreeper.class, 1000, 100, 100, EnumCreatureType.monster, desert);
EntityRegistry.addSpawn(NitroCreeper.class, 1000, 100, 100, EnumCreatureType.monster, frozen);
EntityRegistry.addSpawn(NitroCreeper.class, 1000, 100, 100, EnumCreatureType.monster, jungle);
EntityRegistry.addSpawn(NitroCreeper.class, 1000, 100, 100, EnumCreatureType.monster, wasteland);
DimensionManager.unregisterProviderType(0);
DimensionManager.registerProviderType(0, OverworldProvider.class, true);
}
if (PHConstruct.redCreeper) if (PHConstruct.redCreeper)
{ {
EntityRegistry.addSpawn(NitroCreeper.class, PHConstruct.redCreeperWeight, 4, 6, EnumCreatureType.monster, nether); EntityRegistry.addSpawn(NitroCreeper.class, PHConstruct.redCreeperWeight, 4, 6, EnumCreatureType.monster, nether);
@ -367,13 +470,19 @@ public class TContent implements IFuelHandler
signHead = new ToolPart(PHConstruct.signHead, "SignHead", "_battlesign_head").setUnlocalizedName("tconstruct.SignHead"); signHead = new ToolPart(PHConstruct.signHead, "SignHead", "_battlesign_head").setUnlocalizedName("tconstruct.SignHead");
chiselHead = new ToolPart(PHConstruct.chiselHead, "ChiselHead", "_chisel_head").setUnlocalizedName("tconstruct.ChiselHead"); chiselHead = new ToolPart(PHConstruct.chiselHead, "ChiselHead", "_chisel_head").setUnlocalizedName("tconstruct.ChiselHead");
diamondApple = new DiamondApple(PHConstruct.diamondApple).setUnlocalizedName("tconstruct.apple.diamond");
strangeFood = new StrangeFood(PHConstruct.slimefood).setUnlocalizedName("tconstruct.strangefood"); strangeFood = new StrangeFood(PHConstruct.slimefood).setUnlocalizedName("tconstruct.strangefood");
oreBerries = new OreBerries(PHConstruct.oreChunks).setUnlocalizedName("oreberry"); oreBerries = new OreBerries(PHConstruct.oreChunks).setUnlocalizedName("oreberry");
//lumberHead = new ToolPart(PHConstruct.lumberHead, 0, broadheads).setUnlocalizedName("tconstruct.LumberHead"); //lumberHead = new ToolPart(PHConstruct.lumberHead, 0, broadheads).setUnlocalizedName("tconstruct.LumberHead");
//Wearables //Wearables
//heavyHelmet = new TArmorBase(PHConstruct.heavyHelmet, 0).setUnlocalizedName("tconstruct.HeavyHelmet"); //heavyHelmet = new TArmorBase(PHConstruct.heavyHelmet, 0).setUnlocalizedName("tconstruct.HeavyHelmet");
//heartContainer = new HeartContainer(PHConstruct.heartContainer).setUnlocalizedName("tconstruct.canister"); heartCanister = new HeartCanister(PHConstruct.heartCanister).setUnlocalizedName("tconstruct.canister");
heavyBoots = new TArmorBase(PHConstruct.heavyBoots, 3).setUnlocalizedName("tconstruct.HeavyBoots");
/*public static Item heavyHelmet;
public static Item heavyChestplate;
public static Item heavyPants;
public static Item heavyBoots;*/
//Vanilla stack sizes //Vanilla stack sizes
Item.doorWood.setMaxStackSize(16); Item.doorWood.setMaxStackSize(16);
@ -802,6 +911,12 @@ public class TContent implements IFuelHandler
ItemStack aluBrass = new ItemStack(materials, 1, 14); ItemStack aluBrass = new ItemStack(materials, 1, 14);
GameRegistry.addRecipe(new ItemStack(Item.pocketSundial), " i ", "iri", " i ", 'i', aluBrass, 'r', new ItemStack(Item.redstone)); GameRegistry.addRecipe(new ItemStack(Item.pocketSundial), " i ", "iri", " i ", 'i', aluBrass, 'r', new ItemStack(Item.redstone));
GameRegistry.addRecipe(new ItemStack(Block.pressurePlateGold), "ii", 'i', aluBrass); GameRegistry.addRecipe(new ItemStack(Block.pressurePlateGold), "ii", 'i', aluBrass);
ItemStack necroticBone = new ItemStack(materials, 1, 8);
//Accessories
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(heartCanister, 1, 0), "##", "##", '#', "ingotNaturalAluminum"));
GameRegistry.addRecipe(new ItemStack(diamondApple), " d ", "d#d", " d ", 'd', new ItemStack(Item.diamond), '#', new ItemStack(Item.appleRed));
GameRegistry.addShapelessRecipe(new ItemStack(heartCanister, 1, 2), new ItemStack(diamondApple), necroticBone, new ItemStack(heartCanister, 1, 0), new ItemStack(heartCanister, 1, 1));
} }
void setupToolTabs () void setupToolTabs ()
@ -821,6 +936,33 @@ public class TContent implements IFuelHandler
TConstructRegistry.toolTab.init(tool); TConstructRegistry.toolTab.init(tool);
} }
public void addLoot ()
{
//Item, min, max, weight
ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(new WeightedRandomChestContent(new ItemStack(heartCanister, 1, 1), 1, 1, 5));
ChestGenHooks.getInfo(ChestGenHooks.PYRAMID_DESERT_CHEST).addItem(new WeightedRandomChestContent(new ItemStack(heartCanister, 1, 1), 1, 1, 10));
ChestGenHooks.getInfo(ChestGenHooks.PYRAMID_JUNGLE_CHEST).addItem(new WeightedRandomChestContent(new ItemStack(heartCanister, 1, 1), 1, 1, 10));
tinkerHouseChest = new ChestGenHooks("TinkerHouse", new WeightedRandomChestContent[0], 3, 27);
tinkerHouseChest.addItem(new WeightedRandomChestContent(new ItemStack(heartCanister, 1, 1), 1, 1, 1));
int[] validTypes = { 0, 1, 2, 3, 4, 5, 6, 8, 9, 13, 14, 17};
Item[] partTypes = { pickaxeHead, shovelHead, axeHead, binding, swordBlade, wideGuard, handGuard, crossbar, knifeBlade, frypanHead, signHead, chiselHead};
for (int partIter = 0; partIter < partTypes.length; partIter++)
{
for (int typeIter = 0; typeIter < validTypes.length; typeIter++)
{
tinkerHouseChest.addItem(new WeightedRandomChestContent(new ItemStack(partTypes[partIter], 1, validTypes[typeIter]), 1, 1, 15));
}
}
tinkerHousePatterns = new ChestGenHooks("TinkerPatterns", new WeightedRandomChestContent[0], 5, 30);
for (int i = 0; i < 13; i++)
{
tinkerHousePatterns.addItem(new WeightedRandomChestContent(new ItemStack(woodPattern, 1, i+1), 1, 3, 20));
}
}
public static LiquidStack[] liquidIcons = new LiquidStack[0]; public static LiquidStack[] liquidIcons = new LiquidStack[0];
public static String[] liquidNames; public static String[] liquidNames;

View File

@ -2,19 +2,28 @@ package mods.tinker.tconstruct.entity;
import mods.tinker.tconstruct.TConstruct; import mods.tinker.tconstruct.TConstruct;
import mods.tinker.tconstruct.common.TContent; import mods.tinker.tconstruct.common.TContent;
import mods.tinker.tconstruct.library.TConstructRegistry;
import mods.tinker.tconstruct.library.crafting.ToolBuilder;
import mods.tinker.tconstruct.library.tools.ToolCore;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.boss.IBossDisplayData;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.monster.EntitySkeleton; import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.entity.monster.IMob; import net.minecraft.entity.monster.IMob;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.Potion; import net.minecraft.potion.Potion;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.util.StatCollector;
import net.minecraft.world.EnumSkyBlock; import net.minecraft.world.EnumSkyBlock;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks; import net.minecraftforge.common.ForgeHooks;
public class BlueSlime extends EntityLiving implements IMob public class BlueSlime extends EntityLiving implements IMob, IBossDisplayData
{ {
private static final float[] field_100000_e = new float[] { 1.0F, 0.75F, 0.5F, 0.25F, 0.0F, 0.25F, 0.5F, 0.75F }; private static final float[] field_100000_e = new float[] { 1.0F, 0.75F, 0.5F, 0.25F, 0.0F, 0.25F, 0.5F, 0.75F };
public float sizeOffset; public float sizeOffset;
@ -28,10 +37,10 @@ public class BlueSlime extends EntityLiving implements IMob
{ {
super(world); super(world);
this.texture = "/mods/tinker/textures/mob/slimeedible.png"; this.texture = "/mods/tinker/textures/mob/slimeedible.png";
int offset = this.rand.nextInt(99); int offset = this.rand.nextInt(199);
if (offset < 49) if (offset < 99)
offset = 1; offset = 1;
else if (offset < 98) else if (offset < 198)
offset = 2; offset = 2;
else else
offset = 3; offset = 3;
@ -50,12 +59,20 @@ public class BlueSlime extends EntityLiving implements IMob
super.damageEntity(damageSource, damage); super.damageEntity(damageSource, damage);
} }
/*public boolean attackEntityFrom(DamageSource damageSource, int damage) public String getEntityName ()
{ {
if (damageSource.damageType.equals("arrow") && rand.nextInt(5) == 0) String s = EntityList.getEntityString(this);
return false;
return super.attackEntityFrom(damageSource, damage); if (s == null)
}*/ {
s = "generic";
}
if (getSlimeSize() >= 8)
s = "TConstruct.KingSlime";
return StatCollector.translateToLocal("entity." + s + ".name");
}
@Override @Override
public void initCreature () public void initCreature ()
@ -68,7 +85,35 @@ public class BlueSlime extends EntityLiving implements IMob
this.worldObj.spawnEntityInWorld(entityskeleton); this.worldObj.spawnEntityInWorld(entityskeleton);
entityskeleton.mountEntity(this); entityskeleton.mountEntity(this);
} }
if (getSlimeSize() == 4 && rand.nextInt(12) == 0)
{
EntityCreeper creeper = new EntityCreeper(this.worldObj);
creeper.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F);
creeper.initCreature();
this.worldObj.spawnEntityInWorld(creeper);
creeper.mountEntity(this);
}
if (getSlimeSize() == 8)
{
for (int i = 0; i < 5; i++)
{
BlueSlime slime = new BlueSlime(this.worldObj);
slime.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F);
slime.initCreature();
this.worldObj.spawnEntityInWorld(slime);
}
BlueSlime slime = new BlueSlime(this.worldObj);
slime.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F);
slime.setSlimeSize(2);
this.worldObj.spawnEntityInWorld(slime);
EntitySkeleton skelton = new EntitySkeleton(this.worldObj);
skelton.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F);
skelton.initCreature();
this.worldObj.spawnEntityInWorld(skelton);
skelton.mountEntity(slime);
}
} }
@Override @Override
@ -93,14 +138,18 @@ public class BlueSlime extends EntityLiving implements IMob
this.motionZ += (double) (MathHelper.cos(f) * 0.2F); this.motionZ += (double) (MathHelper.cos(f) * 0.2F);
} }
if (this.getBrightness(1.0F) > 0.9F && rand.nextInt(5) == 0 && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ))) if (this.getBrightness(1.0F) > 0.9F && rand.nextInt(5) == 0
&& this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)))
{ {
int size = this.getSlimeSize() - 1; int size = this.getSlimeSize() - 1;
if (size < 7)
{
if (size <= 0) if (size <= 0)
this.kill(); this.kill();
else else
this.setSlimeSize(size); this.setSlimeSize(size);
} }
}
this.isAirBorne = true; this.isAirBorne = true;
ForgeHooks.onLivingJump(this); ForgeHooks.onLivingJump(this);
@ -157,15 +206,18 @@ public class BlueSlime extends EntityLiving implements IMob
{ {
super.entityInit(); super.entityInit();
this.dataWatcher.addObject(16, new Byte((byte) 1)); this.dataWatcher.addObject(16, new Byte((byte) 1));
this.dataWatcher.addObject(17, new Integer(100));
} }
protected void setSlimeSize (int size) public void setSlimeSize (int size)
{ {
this.dataWatcher.updateObject(16, new Byte((byte) size)); this.dataWatcher.updateObject(16, new Byte((byte) size));
this.setSize(0.6F * size, 0.6F * size); this.setSize(0.6F * size, 0.6F * size);
this.setPosition(this.posX, this.posY, this.posZ); this.setPosition(this.posX, this.posY, this.posZ);
this.setEntityHealth(this.getMaxHealth()); this.setEntityHealth(this.getMaxHealth());
this.experienceValue = size + 2; this.experienceValue = size + 2;
if (size >= 8)
this.experienceValue = 500;
} }
public int getMaxHealth () public int getMaxHealth ()
@ -173,6 +225,8 @@ public class BlueSlime extends EntityLiving implements IMob
int i = this.getSlimeSize(); int i = this.getSlimeSize();
if (i == 1) if (i == 1)
return 4; return 4;
if (i == 8)
return 100;
return (int) Math.min(i * i + 8, 49); return (int) Math.min(i * i + 8, 49);
} }
@ -200,6 +254,7 @@ public class BlueSlime extends EntityLiving implements IMob
{ {
super.readEntityFromNBT(par1NBTTagCompound); super.readEntityFromNBT(par1NBTTagCompound);
this.setSlimeSize(par1NBTTagCompound.getInteger("Size") + 1); this.setSlimeSize(par1NBTTagCompound.getInteger("Size") + 1);
this.dataWatcher.updateObject(17, Integer.valueOf(this.health));
} }
/** /**
@ -220,6 +275,11 @@ public class BlueSlime extends EntityLiving implements IMob
this.isDead = true; this.isDead = true;
} }
if (!this.worldObj.isRemote)
{
this.dataWatcher.updateObject(17, Integer.valueOf(this.health));
}
this.sizeFactor += (this.sizeOffset - this.sizeFactor) * 0.5F; this.sizeFactor += (this.sizeOffset - this.sizeFactor) * 0.5F;
this.sizeHeight = this.sizeFactor; this.sizeHeight = this.sizeFactor;
boolean flag = this.onGround; boolean flag = this.onGround;
@ -332,14 +392,14 @@ public class BlueSlime extends EntityLiving implements IMob
*/ */
public void setDead () public void setDead ()
{ {
int i = this.getSlimeSize(); int size = this.getSlimeSize();
if (!this.worldObj.isRemote && i > 1 && this.getHealth() <= 0) if (!this.worldObj.isRemote && size > 1 && this.getHealth() <= 0 && size < 8)
{ {
float f = (-0.5F) * (float) i / 4.0F; float f = (-0.5F) * (float) size / 4.0F;
float f1 = (-0.5F) * (float) i / 4.0F; float f1 = (-0.5F) * (float) size / 4.0F;
BlueSlime entityslime = this.createInstance(); BlueSlime entityslime = this.createInstance();
entityslime.setSlimeSize(i / 2); entityslime.setSlimeSize(size / 2);
entityslime.setLocationAndAngles(this.posX + (double) f, this.posY + 0.5D, this.posZ + (double) f1, this.rand.nextFloat() * 360.0F, 0.0F); entityslime.setLocationAndAngles(this.posX + (double) f, this.posY + 0.5D, this.posZ + (double) f1, this.rand.nextFloat() * 360.0F, 0.0F);
this.worldObj.spawnEntityInWorld(entityslime); this.worldObj.spawnEntityInWorld(entityslime);
} }
@ -349,9 +409,10 @@ public class BlueSlime extends EntityLiving implements IMob
protected void dropFewItems (boolean par1, int par2) protected void dropFewItems (boolean par1, int par2)
{ {
int size = this.getSlimeSize();
int j = this.getDropItemId(); int j = this.getDropItemId();
if (j > 0 && rand.nextInt(2) == 0) if (j > 0 && (rand.nextInt(2) == 0) || size >= 8)
{ {
int k = rand.nextInt(3) + rand.nextInt(this.getSlimeSize()); int k = rand.nextInt(3) + rand.nextInt(this.getSlimeSize());
@ -365,6 +426,24 @@ public class BlueSlime extends EntityLiving implements IMob
this.dropItem(j, 1); this.dropItem(j, 1);
} }
} }
if (size == 8)
{
ToolCore tool = TConstructRegistry.tools.get(rand.nextInt(TConstructRegistry.tools.size()));
Item accessory = tool.getAccessoryItem();
ItemStack accessoryStack = accessory != null ? new ItemStack(tool.getAccessoryItem(), 1, 17) : null;
ItemStack toolStack = ToolBuilder.instance.buildTool(new ItemStack(tool.getHeadItem(), 1, 17), new ItemStack(tool.getHandleItem(), 1, 17), accessoryStack,
"King Slime " + tool.getToolName());
NBTTagCompound tags = toolStack.getTagCompound().getCompoundTag("InfiTool");
tags.setInteger("Attack", 3 + tool.getDamageVsEntity(null));
tags.setInteger("TotalDurability", 1500);
tags.setInteger("BaseDurability", 1500);
tags.setInteger("MiningSpeed", 800);
this.entityDropItem(toolStack, 0f);
}
} }
/** /**
@ -456,4 +535,10 @@ public class BlueSlime extends EntityLiving implements IMob
{ {
return this.getSlimeSize() > 2; return this.getSlimeSize() > 2;
} }
@Override
public int getBossHealth ()
{
return this.dataWatcher.getWatchableObjectInt(17);
}
} }

View File

@ -9,7 +9,7 @@ public class Crystal extends EntityCreeper
public Crystal(World par1World) public Crystal(World par1World)
{ {
super(par1World); super(par1World);
this.texture = "/tinkertextures/mob/crystalwater.png"; this.texture = "/mods/tinker/textures/mob/crystalwater.png";
} }
@Override @Override

View File

@ -0,0 +1,77 @@
package mods.tinker.tconstruct.items;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.Icon;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class DiamondApple extends ItemFood
{
public Icon[] icons;
public String[] textureNames = new String[] { "apple_diamond" };
public String[] itemNames = new String[] { "apple.diamond" };
public DiamondApple(int id)
{
super(id, 4, 2.0F, false);
setHasSubtypes(true);
setMaxDamage(0);
this.setAlwaysEdible();
}
protected void onFoodEaten(ItemStack stack, World world, EntityPlayer player)
{
if (!world.isRemote)
{
int duration = 0;
PotionEffect potion;
potion = player.getActivePotionEffect(Potion.resistance);
if (potion != null)
duration = potion.duration;
player.addPotionEffect(new PotionEffect(Potion.resistance.id, duration + 60*20, 0));
potion = player.getActivePotionEffect(Potion.digSpeed);
if (potion != null)
duration = potion.duration;
player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, duration + 60*20, 0));
potion = player.getActivePotionEffect(Potion.damageBoost);
if (potion != null)
duration = potion.duration;
player.addPotionEffect(new PotionEffect(Potion.damageBoost.id, duration + 60*20, 0));
}
}
@SideOnly(Side.CLIENT)
@Override
public Icon getIconFromDamage(int meta)
{
return icons[meta];
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IconRegister iconRegister)
{
this.icons = new Icon[textureNames.length];
for (int i = 0; i < this.icons.length; ++i)
{
this.icons[i] = iconRegister.registerIcon("tinker:"+textureNames[i]);
}
}
/* Name override */
@Override
public String getUnlocalizedName(ItemStack itemstack)
{
return (new StringBuilder()).append("item.food.").append(itemNames[itemstack.getItemDamage()]).toString();
}
}

View File

@ -0,0 +1,69 @@
package mods.tinker.tconstruct.items;
import java.util.List;
import mods.tinker.tconstruct.TConstruct;
import mods.tinker.tconstruct.util.player.ArmorExtended;
import mods.tinker.tconstruct.util.player.TPlayerStats;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class HeartCanister extends CraftingItem
{
public HeartCanister(int id)
{
super(id, new String[] { "empty", "miniheart.red", "heart" }, new String[] { "canister_empty", "miniheart_red", "canister_heart" }, "");
this.setMaxStackSize(10);
}
@Override
public ItemStack onItemRightClick (ItemStack stack, World world, EntityPlayer player)
{
if (!world.isRemote && stack.getItemDamage() == 2)
{
TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.username);
if (stats != null)
{
ArmorExtended armor = stats.armor;
ItemStack slotStack = armor.getStackInSlot(6);
if (slotStack == null)// || slotStack.getItem() == this)
{
armor.setInventorySlotContents(6, new ItemStack(this, 1, 2));
stack.stackSize--;
}
else if (slotStack.getItem() == this && slotStack.stackSize < this.maxStackSize)
{
slotStack.stackSize++;
stack.stackSize--;
}
armor.recalculateHealth();
}
}
return stack;
}
@Override
@SideOnly(Side.CLIENT)
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
{
switch (stack.getItemDamage())
{
case 0:
list.add("Crafting Item");
break;
case 1:
list.add("Crafting Item");
list.add("Part of low-level Heart Canisters");
break;
case 2:
list.add("Accessory");
list.add("Permanent health increase");
break;
}
}
}

View File

@ -1,26 +0,0 @@
package mods.tinker.tconstruct.items;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class HeartContainer extends CraftingItem
{
public HeartContainer(int id)
{
super(id, new String[] {"empty", "heart"}, new String[] {"canister_empty", "canister_heart"}, "");
}
@Override
@SideOnly(Side.CLIENT)
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
{
list.add("Test Item");
}
}

View File

@ -1,15 +1,37 @@
package mods.tinker.tconstruct.items; package mods.tinker.tconstruct.items;
import java.util.List;
import mods.tinker.tconstruct.client.TProxyClient; import mods.tinker.tconstruct.client.TProxyClient;
import mods.tinker.tconstruct.entity.BlueSlime;
import mods.tinker.tconstruct.entity.NitroCreeper;
import mods.tinker.tconstruct.library.tools.ToolCore; import mods.tinker.tconstruct.library.tools.ToolCore;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Facing;
import net.minecraft.util.Icon;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class TitleIcon extends Item public class TitleIcon extends Item
{ {
int[] primaryColor = { 0x66BBE8, 0x66BBE8, 0xF73E6C };
int[] secondaryColor = { 0x1567BF, 0x1567BF, 0x9B5004 };
String[] mobNames = { "TConstruct.EdibleSlime", "TConstruct.KingSlime", "TConstruct.UnstableCreeper" };
public TitleIcon(int par1) public TitleIcon(int par1)
{ {
super(par1); super(par1);
this.setCreativeTab(CreativeTabs.tabMisc);
} }
@Override @Override
@ -19,4 +41,103 @@ public class TitleIcon extends Item
TProxyClient.metalBall = iconRegister.registerIcon("tinker:metalball"); TProxyClient.metalBall = iconRegister.registerIcon("tinker:metalball");
itemIcon = iconRegister.registerIcon("tinker:tparts"); itemIcon = iconRegister.registerIcon("tinker:tparts");
} }
@SideOnly(Side.CLIENT)
public boolean requiresMultipleRenderPasses ()
{
return true;
}
@SideOnly(Side.CLIENT)
public Icon getIconFromDamageForRenderPass (int par1, int par2)
{
return Item.monsterPlacer.getIconFromDamageForRenderPass(par1, par2);
}
@Override
public String getItemDisplayName (ItemStack par1ItemStack)
{
String s = ("" + StatCollector.translateToLocal(this.getUnlocalizedName() + ".name")).trim();
String s1 = mobNames[par1ItemStack.getItemDamage()];
if (s1 != null)
{
s = s + " " + StatCollector.translateToLocal("entity." + s1 + ".name");
}
return s;
}
@Override
public void getSubItems(int id, CreativeTabs tab, List list)
{
for (int i = 0; i < mobNames.length; i++)
list.add(new ItemStack(id, 1, i));
}
@SideOnly(Side.CLIENT)
public int getColorFromItemStack (ItemStack stack, int pass)
{
int damage = stack.getItemDamage();
return pass == 0 ? primaryColor[damage] : secondaryColor[damage];
}
public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int posX, int posY, int posZ, int par7, float par8, float par9, float par10)
{
if (!world.isRemote)
{
int i1 = world.getBlockId(posX, posY, posZ);
posX += Facing.offsetsXForSide[par7];
posY += Facing.offsetsYForSide[par7];
posZ += Facing.offsetsZForSide[par7];
double d0 = 0.0D;
if (par7 == 1 && Block.blocksList[i1] != null && Block.blocksList[i1].getRenderType() == 11)
{
d0 = 0.5D;
}
int damage = stack.getItemDamage();
switch (damage)
{
case 0:
spawnEntity(posX, posY, posZ, new BlueSlime(world), world, player);
break;
case 1:
spawnBossSlime(posX, posY, posZ, new BlueSlime(world), world, player);
break;
case 2:
spawnEntity(posX, posY, posZ, new NitroCreeper(world), world, player);
break;
}
if (!player.capabilities.isCreativeMode)
{
--stack.stackSize;
}
}
return true;
}
public static void spawnEntity (double x, double y, double z, Entity entity, World world, EntityPlayer player)
{
if (!world.isRemote)
{
entity.setPosition(x, y, z);
entity.setAngles(player.cameraYaw, player.cameraYaw);
((EntityLiving) entity).initCreature();
world.spawnEntityInWorld(entity);
}
}
public static void spawnBossSlime (double x, double y, double z, BlueSlime entity, World world, EntityPlayer player)
{
if (!world.isRemote)
{
entity.setPosition(x, y, z);
entity.setAngles(player.cameraYaw, player.cameraYaw);
entity.setSlimeSize(8);
entity.initCreature();
world.spawnEntityInWorld(entity);
}
}
} }

View File

@ -22,7 +22,7 @@ public class TArmorBase extends ItemArmor
//implements ISpecialArmor //implements ISpecialArmor
{ {
Icon[] icons; Icon[] icons;
String[] iconNames = { "wood_helmet" }; String[] iconNames = { "wood_boots" };
//static Minecraft mc = Minecraft.getMinecraft(); //static Minecraft mc = Minecraft.getMinecraft();
//private ModelBiped modelArmor; //private ModelBiped modelArmor;

View File

@ -23,7 +23,7 @@ public class BattleSign extends Weapon
public String getToolName () public String getToolName ()
{ {
return "Battle Sign"; return "Battlesign";
} }
/*public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer player, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) /*public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer player, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
@ -97,13 +97,13 @@ public class BattleSign extends Weapon
}*/ }*/
@Override @Override
protected Item getHeadItem () public Item getHeadItem ()
{ {
return TContent.signHead; return TContent.signHead;
} }
@Override @Override
protected Item getAccessoryItem () public Item getAccessoryItem ()
{ {
return null; return null;
} }

View File

@ -13,13 +13,13 @@ public class Broadsword extends Weapon
} }
@Override @Override
protected Item getHeadItem () public Item getHeadItem ()
{ {
return TContent.swordBlade; return TContent.swordBlade;
} }
@Override @Override
protected Item getAccessoryItem () public Item getAccessoryItem ()
{ {
return TContent.wideGuard; return TContent.wideGuard;
} }

View File

@ -166,13 +166,13 @@ public class Chisel extends ToolCore
} }
@Override @Override
protected Item getHeadItem () public Item getHeadItem ()
{ {
return TContent.chiselHead; return TContent.chiselHead;
} }
@Override @Override
protected Item getAccessoryItem () public Item getAccessoryItem ()
{ {
return null; return null;
} }

View File

@ -89,13 +89,13 @@ public class Dagger extends Weapon
} }
@Override @Override
protected Item getHeadItem () public Item getHeadItem ()
{ {
return TContent.knifeBlade; return TContent.knifeBlade;
} }
@Override @Override
protected Item getAccessoryItem () public Item getAccessoryItem ()
{ {
return TContent.crossbar; return TContent.crossbar;
} }

View File

@ -1,14 +1,19 @@
package mods.tinker.tconstruct.items.tools; package mods.tinker.tconstruct.items.tools;
import java.util.List;
import mods.tinker.tconstruct.blocks.logic.EquipLogic; import mods.tinker.tconstruct.blocks.logic.EquipLogic;
import mods.tinker.tconstruct.common.TContent; import mods.tinker.tconstruct.common.TContent;
import mods.tinker.tconstruct.library.crafting.ToolBuilder;
import mods.tinker.tconstruct.library.tools.AbilityHelper; import mods.tinker.tconstruct.library.tools.AbilityHelper;
import mods.tinker.tconstruct.library.tools.Weapon; import mods.tinker.tconstruct.library.tools.Weapon;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.Potion; import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect; import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -49,6 +54,29 @@ public class FryingPan extends Weapon
return "Frying Pan"; return "Frying Pan";
} }
public void getSubItems (int id, CreativeTabs tab, List list)
{
super.getSubItems(id, tab, list);
Item accessory = getAccessoryItem();
ItemStack tool = ToolBuilder.instance.buildTool(new ItemStack(getHeadItem(), 1, 2), new ItemStack(getHandleItem(), 1, 16), null, "Bane of Pigs");
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
tags.setInteger("Modifiers", 0);
tags.setInteger("Attack", Integer.MAX_VALUE/100);
tags.setInteger("TotalDurability", Integer.MAX_VALUE/100);
tags.setInteger("BaseDurability", Integer.MAX_VALUE/100);
tags.setInteger("MiningSpeed", Integer.MAX_VALUE/100);
int[] keyPair = new int[] { Integer.MAX_VALUE/100, 0, 0 };
tags.setIntArray("Blaze", keyPair);
tags.setInteger("Necrotic", Integer.MAX_VALUE/100);
tags.setInteger("Effect1", 7);
tags.setBoolean("Built", true);
list.add(tool);
}
public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float clickX, float clickY, float clickZ) public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float clickX, float clickY, float clickZ)
{ {
if (side == 0 || !player.isSneaking()) if (side == 0 || !player.isSneaking())
@ -109,13 +137,13 @@ public class FryingPan extends Weapon
} }
@Override @Override
protected Item getHeadItem () public Item getHeadItem ()
{ {
return TContent.frypanHead; return TContent.frypanHead;
} }
@Override @Override
protected Item getAccessoryItem () public Item getAccessoryItem ()
{ {
return null; return null;
} }

View File

@ -80,13 +80,13 @@ public class Hammer extends HarvestTool
}*/ }*/
@Override @Override
protected Item getHeadItem () public Item getHeadItem ()
{ {
return null; return null;
} }
@Override @Override
protected Item getAccessoryItem () public Item getAccessoryItem ()
{ {
return null; return null;
} }

View File

@ -51,13 +51,13 @@ public class Hatchet extends HarvestTool
static Material[] materials = { Material.wood, Material.leaves, Material.vine, Material.circuits, Material.cactus, Material.pumpkin }; static Material[] materials = { Material.wood, Material.leaves, Material.vine, Material.circuits, Material.cactus, Material.pumpkin };
@Override @Override
protected Item getHeadItem () public Item getHeadItem ()
{ {
return TContent.axeHead; return TContent.axeHead;
} }
@Override @Override
protected Item getAccessoryItem () public Item getAccessoryItem ()
{ {
return null; return null;
} }

View File

@ -62,13 +62,13 @@ public class Longsword extends Weapon
} }
@Override @Override
protected Item getHeadItem () public Item getHeadItem ()
{ {
return TContent.swordBlade; return TContent.swordBlade;
} }
@Override @Override
protected Item getAccessoryItem () public Item getAccessoryItem ()
{ {
return TContent.handGuard; return TContent.handGuard;
} }

View File

@ -168,13 +168,13 @@ public class LumberAxe extends HarvestTool
} }
@Override @Override
protected Item getHeadItem () public Item getHeadItem ()
{ {
return TContent.lumberHead; return TContent.lumberHead;
} }
@Override @Override
protected Item getAccessoryItem () public Item getAccessoryItem ()
{ {
return null; return null;
} }

View File

@ -63,13 +63,13 @@ public class Mattock extends DualHarvestTool
} }
@Override @Override
protected Item getHeadItem () public Item getHeadItem ()
{ {
return TContent.axeHead; return TContent.axeHead;
} }
@Override @Override
protected Item getAccessoryItem () public Item getAccessoryItem ()
{ {
return TContent.shovelHead; return TContent.shovelHead;
} }

View File

@ -34,13 +34,13 @@ public class Pickaxe extends HarvestTool
static Material[] materials = new Material[] { Material.rock, Material.iron, Material.ice, Material.glass, Material.piston, Material.anvil, Material.circuits }; static Material[] materials = new Material[] { Material.rock, Material.iron, Material.ice, Material.glass, Material.piston, Material.anvil, Material.circuits };
@Override @Override
protected Item getHeadItem () public Item getHeadItem ()
{ {
return TContent.pickaxeHead; return TContent.pickaxeHead;
} }
@Override @Override
protected Item getAccessoryItem () public Item getAccessoryItem ()
{ {
return TContent.binding; return TContent.binding;
} }

View File

@ -32,13 +32,13 @@ public abstract class RangedWeapon extends ToolCore
} }
@Override @Override
protected Item getHeadItem () public Item getHeadItem ()
{ {
return TContent.toolRod; return TContent.toolRod;
} }
@Override @Override
protected Item getAccessoryItem () public Item getAccessoryItem ()
{ {
return TContent.toolRod; return TContent.toolRod;
} }

View File

@ -72,13 +72,13 @@ public class Rapier extends Weapon
} }
@Override @Override
protected Item getHeadItem () public Item getHeadItem ()
{ {
return TContent.swordBlade; return TContent.swordBlade;
} }
@Override @Override
protected Item getAccessoryItem () public Item getAccessoryItem ()
{ {
return TContent.crossbar; return TContent.crossbar;
} }

View File

@ -36,13 +36,13 @@ public class Shovel extends HarvestTool
static Material[] materials = { Material.grass, Material.ground, Material.sand, Material.snow, Material.craftedSnow, Material.clay }; static Material[] materials = { Material.grass, Material.ground, Material.sand, Material.snow, Material.craftedSnow, Material.clay };
@Override @Override
protected Item getHeadItem () public Item getHeadItem ()
{ {
return TContent.shovelHead; return TContent.shovelHead;
} }
@Override @Override
protected Item getAccessoryItem () public Item getAccessoryItem ()
{ {
return null; return null;
} }

View File

@ -21,7 +21,7 @@ public class ActiveToolMod
return false; return false;
} }
public boolean afterBlockBreak() public boolean afterBlockBreak() //Unfinished, not called
{ {
return false; return false;
} }
@ -44,7 +44,7 @@ public class ActiveToolMod
return 0; return 0;
} }
public void lateAttackEntity() public void lateAttackEntity() //Unfinished, not called
{ {
} }

View File

@ -5,7 +5,6 @@ import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import mods.tinker.tconstruct.TConstruct;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.liquids.LiquidStack; import net.minecraftforge.liquids.LiquidStack;

View File

@ -288,11 +288,16 @@ public class AbilityHelper
if (ignoreCharge || !damageElectricTool(stack, tags, entity)) if (ignoreCharge || !damageElectricTool(stack, tags, entity))
{ {
boolean damagedTool = false;
for (ActiveToolMod mod : TConstructRegistry.activeModifiers) for (ActiveToolMod mod : TConstructRegistry.activeModifiers)
{ {
if (mod.damageTool(stack, dam, entity)); if (mod.damageTool(stack, dam, entity))
return; damagedTool = true;
} }
if (damagedTool)
return;
int damage = tags.getCompoundTag("InfiTool").getInteger("Damage"); int damage = tags.getCompoundTag("InfiTool").getInteger("Damage");
int damageTrue = damage + dam; int damageTrue = damage + dam;
int maxDamage = tags.getCompoundTag("InfiTool").getInteger("TotalDurability"); int maxDamage = tags.getCompoundTag("InfiTool").getInteger("TotalDurability");

View File

@ -4,13 +4,8 @@ import mods.tinker.tconstruct.library.ActiveToolMod;
import mods.tinker.tconstruct.library.TConstructRegistry; import mods.tinker.tconstruct.library.TConstructRegistry;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;
@ -48,7 +43,7 @@ public abstract class DualHarvestTool extends HarvestTool
boolean cancelHarvest = false; boolean cancelHarvest = false;
for (ActiveToolMod mod : TConstructRegistry.activeModifiers) for (ActiveToolMod mod : TConstructRegistry.activeModifiers)
{ {
if (mod.beforeBlockBreak(this, stack, x, y, z, player)); if (mod.beforeBlockBreak(this, stack, x, y, z, player))
cancelHarvest = true; cancelHarvest = true;
} }

View File

@ -1,17 +1,11 @@
package mods.tinker.tconstruct.library.tools; package mods.tinker.tconstruct.library.tools;
import mods.tinker.tconstruct.common.TContent;
import mods.tinker.tconstruct.library.ActiveToolMod; import mods.tinker.tconstruct.library.ActiveToolMod;
import mods.tinker.tconstruct.library.TConstructRegistry; import mods.tinker.tconstruct.library.TConstructRegistry;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;

View File

@ -15,16 +15,12 @@ import mods.tinker.tconstruct.library.crafting.ToolBuilder;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.Icon; import net.minecraft.util.Icon;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -453,11 +449,11 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
} }
} }
protected abstract Item getHeadItem (); public abstract Item getHeadItem ();
protected abstract Item getAccessoryItem (); public abstract Item getAccessoryItem ();
protected Item getHandleItem () public Item getHandleItem ()
{ {
return TConstructRegistry.toolRod; return TConstructRegistry.toolRod;
} }
@ -484,7 +480,7 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
boolean cancelHarvest = false; boolean cancelHarvest = false;
for (ActiveToolMod mod : TConstructRegistry.activeModifiers) for (ActiveToolMod mod : TConstructRegistry.activeModifiers)
{ {
if (mod.beforeBlockBreak(this, stack, x, y, z, player)); if (mod.beforeBlockBreak(this, stack, x, y, z, player))
cancelHarvest = true; cancelHarvest = true;
} }

View File

@ -1,12 +1,9 @@
package mods.tinker.tconstruct.library.tools; package mods.tinker.tconstruct.library.tools;
import mods.tinker.tconstruct.common.TContent;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction; import net.minecraft.item.EnumAction;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.world.World; import net.minecraft.world.World;

View File

@ -35,7 +35,7 @@ public class TActiveOmniMod extends ActiveToolMod
if (tags.hasKey("Moss")) if (tags.hasKey("Moss"))
{ {
int chance = tags.getInteger("Moss"); int chance = tags.getInteger("Moss");
int check = world.canBlockSeeTheSky((int) entity.posX, (int) entity.posY, (int) entity.posZ) ? 750 : 1500; int check = world.canBlockSeeTheSky((int) entity.posX, (int) entity.posY, (int) entity.posZ) ? 350 : 1150;
if (random.nextInt(check) < chance) if (random.nextInt(check) < chance)
{ {
AbilityHelper.healTool(stack, 1, (EntityLiving) entity, true); AbilityHelper.healTool(stack, 1, (EntityLiving) entity, true);

View File

@ -144,8 +144,12 @@ public class PHConstruct
slimefood = config.getItem("Patterns and Misc", "Strange Food", 14103).getInt(14103); slimefood = config.getItem("Patterns and Misc", "Strange Food", 14103).getInt(14103);
oreChunks = config.getItem("Patterns and Misc", "Ore Chunks", 14104).getInt(14104); oreChunks = config.getItem("Patterns and Misc", "Ore Chunks", 14104).getInt(14104);
heartContainer = config.getItem("Equipables", "Heart Canister", 14105).getInt(14105); heartCanister = config.getItem("Equipables", "Heart Canister", 14105).getInt(14105);
heavyHelmet = config.getItem("Equipables", "Heavy Helmet", 14106).getInt(14106); heavyHelmet = config.getItem("Equipables", "Heavy Helmet", 14106).getInt(14106);
diamondApple = config.getItem("Patterns and Misc", "Jeweled Apple", 14107).getInt(14107);
heavyChestplate = config.getItem("Equipables", "Heavy Chestplate", 14108).getInt(14108);
heavyPants = config.getItem("Equipables", "Heavy Pants", 14109).getInt(14109);
heavyBoots = config.getItem("Equipables", "Heavy Boots", 14110).getInt(14110);
boolean ic2 = true; boolean ic2 = true;
boolean xycraft = true; boolean xycraft = true;
@ -282,6 +286,7 @@ public class PHConstruct
public static int oreChunks; public static int oreChunks;
//Food //Food
public static int diamondApple;
public static int slimefood; public static int slimefood;
//Tools //Tools
@ -332,7 +337,7 @@ public class PHConstruct
public static int heavyPants; public static int heavyPants;
public static int heavyBoots; public static int heavyBoots;
public static int heartContainer; public static int heartCanister;
//Ore values //Ore values
public static boolean generateCopper; public static boolean generateCopper;

View File

@ -1,7 +1,9 @@
package mods.tinker.tconstruct.util; package mods.tinker.tconstruct.util;
import mods.tinker.tconstruct.TConstruct;
import mods.tinker.tconstruct.common.TContent; import mods.tinker.tconstruct.common.TContent;
import mods.tinker.tconstruct.library.tools.AbilityHelper; import mods.tinker.tconstruct.library.tools.AbilityHelper;
import mods.tinker.tconstruct.util.player.TPlayerStats;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory; import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -19,18 +21,22 @@ public class TCraftingHandler implements ICraftingHandler
int itemID = item.getItem().itemID; int itemID = item.getItem().itemID;
if (itemID == TContent.toolStationWood.blockID) if (itemID == TContent.toolStationWood.blockID)
{ {
TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.username);
NBTTagCompound tags = player.getEntityData().getCompoundTag("TConstruct"); NBTTagCompound tags = player.getEntityData().getCompoundTag("TConstruct");
if (!tags.getBoolean("materialManual")) if (!tags.getBoolean("materialManual") || !stats.materialManual)
{ {
stats.materialManual = true;
tags.setBoolean("materialManual", true); tags.setBoolean("materialManual", true);
AbilityHelper.spawnItemAtPlayer(player, new ItemStack(TContent.manualBook, 1, 1)); AbilityHelper.spawnItemAtPlayer(player, new ItemStack(TContent.manualBook, 1, 1));
} }
} }
if (itemID == TContent.smeltery.blockID || itemID == TContent.lavaTank.blockID) if (itemID == TContent.smeltery.blockID || itemID == TContent.lavaTank.blockID)
{ {
TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.username);
NBTTagCompound tags = player.getEntityData().getCompoundTag("TConstruct"); NBTTagCompound tags = player.getEntityData().getCompoundTag("TConstruct");
if (!tags.getBoolean("smelteryManual")) if (!tags.getBoolean("smelteryManual") || !stats.smelteryManual)
{ {
stats.smelteryManual = true;
tags.setBoolean("smelteryManual", true); tags.setBoolean("smelteryManual", true);
AbilityHelper.spawnItemAtPlayer(player, new ItemStack(TContent.manualBook, 1, 2)); AbilityHelper.spawnItemAtPlayer(player, new ItemStack(TContent.manualBook, 1, 2));
} }

View File

@ -17,17 +17,15 @@ import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.monster.EntityCreeper; import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.monster.EntityGhast; import net.minecraft.entity.monster.EntityGhast;
import net.minecraft.entity.monster.EntitySkeleton; import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.entity.monster.EntitySpider;
import net.minecraft.entity.monster.IMob;
import net.minecraft.entity.passive.EntityChicken; import net.minecraft.entity.passive.EntityChicken;
import net.minecraft.entity.passive.EntityCow; import net.minecraft.entity.passive.EntityCow;
import net.minecraft.entity.passive.EntityPig;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.EntityDamageSource; import net.minecraft.util.EntityDamageSource;
import net.minecraft.util.EnumMovingObjectType; import net.minecraft.util.EnumMovingObjectType;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.client.event.TextureStitchEvent;
import net.minecraftforge.client.event.sound.SoundLoadEvent;
import net.minecraftforge.event.Event.Result; import net.minecraftforge.event.Event.Result;
import net.minecraftforge.event.ForgeSubscribe; import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.entity.living.LivingDropsEvent; import net.minecraftforge.event.entity.living.LivingDropsEvent;
@ -37,8 +35,6 @@ import net.minecraftforge.event.entity.player.FillBucketEvent;
import net.minecraftforge.liquids.LiquidStack; import net.minecraftforge.liquids.LiquidStack;
import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.OreDictionary.OreRegisterEvent; import net.minecraftforge.oredict.OreDictionary.OreRegisterEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class TEventHandler public class TEventHandler
{ {
@ -60,6 +56,14 @@ public class TEventHandler
@ForgeSubscribe @ForgeSubscribe
public void onLivingDrop (LivingDropsEvent event) public void onLivingDrop (LivingDropsEvent event)
{ {
if (random.nextInt(500) == 0 && event.entityLiving instanceof IMob && event.entityLiving.dimension == 0)
{
ItemStack dropStack = new ItemStack(TContent.heartCanister, 1, 1);
EntityItem entityitem = new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, dropStack);
entityitem.delayBeforeCanPickup = 10;
event.drops.add(entityitem);
}
if (!event.entityLiving.isChild()) if (!event.entityLiving.isChild())
{ {
if (event.entityLiving.getClass() == EntityCow.class) if (event.entityLiving.getClass() == EntityCow.class)
@ -113,11 +117,14 @@ public class TEventHandler
@ForgeSubscribe @ForgeSubscribe
public void onLivingSpawn (LivingSpawnEvent.SpecialSpawn event) public void onLivingSpawn (LivingSpawnEvent.SpecialSpawn event)
{ {
if (event.entityLiving instanceof EntityCreeper && random.nextInt(500) == 0) if (event.entityLiving.getClass() == EntitySpider.class && random.nextInt(100) == 0)
{ {
EntityPig pig = new EntityPig(event.entityLiving.worldObj); EntityCreeper creeper = new EntityCreeper(event.entityLiving.worldObj);
spawnEntity(event.entityLiving.posX, event.entityLiving.posY+1, event.entityLiving.posZ, pig, event.entityLiving.worldObj); spawnEntity(event.entityLiving.posX, event.entityLiving.posY+1, event.entityLiving.posZ, creeper, event.entityLiving.worldObj);
event.entityLiving.mountEntity(pig); EntitySkeleton skeleton = new EntitySkeleton(event.entityLiving.worldObj);
spawnEntity(event.entityLiving.posX, event.entityLiving.posY+1, event.entityLiving.posZ, skeleton, event.entityLiving.worldObj);
skeleton.mountEntity(creeper);
creeper.mountEntity(event.entityLiving);
} }
} }
@ -126,7 +133,6 @@ public class TEventHandler
if (!world.isRemote) if (!world.isRemote)
{ {
entity.setPosition(x, y, z); entity.setPosition(x, y, z);
//entity.setAngles(player.cameraYaw, player.cameraYaw);
((EntityLiving) entity).initCreature(); ((EntityLiving) entity).initCreature();
world.spawnEntityInWorld(entity); world.spawnEntityInWorld(entity);
} }

View File

@ -2,6 +2,7 @@ package mods.tinker.tconstruct.util.player;
import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;
import mods.tinker.tconstruct.TConstruct;
import mods.tinker.tconstruct.common.TContent; import mods.tinker.tconstruct.common.TContent;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory; import net.minecraft.inventory.IInventory;
@ -54,6 +55,7 @@ public class ArmorExtended implements IInventory
{ {
inventory[slot] = null; inventory[slot] = null;
} }
recalculateHealth();
return split; return split;
} }
else else
@ -77,6 +79,7 @@ public class ArmorExtended implements IInventory
{ {
itemstack.stackSize = getInventoryStackLimit(); itemstack.stackSize = getInventoryStackLimit();
} }
recalculateHealth();
} }
@Override @Override
@ -100,9 +103,23 @@ public class ArmorExtended implements IInventory
@Override @Override
public void onInventoryChanged () public void onInventoryChanged ()
{ {
if (inventory[6] != null && inventory[6].getItem() == TContent.heartContainer) recalculateHealth();
}
public void recalculateHealth()
{ {
parent.get().maxHealth = 40; if (inventory[6] != null && inventory[6].getItem() == TContent.heartCanister)
{
ItemStack stack = inventory[6];
int meta = stack.getItemDamage();
if (meta == 2)
{
EntityPlayer player = parent.get();
TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.username);
int bonusHP = stack.stackSize * 2;
stats.bonusHealth = bonusHP;
player.maxHealth = 20 + bonusHP;
}
} }
else else
{ {

View File

@ -70,7 +70,6 @@ public class TFoodStats extends FoodStats
if (this.foodTimer >= 80) if (this.foodTimer >= 80)
{ {
player.heal(1); player.heal(1);
//player.setEntityHealth(player.getHealth() + 1);
this.foodTimer = 0; this.foodTimer = 0;
} }
} }

View File

@ -44,13 +44,13 @@ public class TPlayerHandler implements IPlayerTracker
stats.armor.loadFromNBT(entityplayer); stats.armor.loadFromNBT(entityplayer);
stats.level = entityplayer.experienceLevel; stats.level = entityplayer.experienceLevel;
stats.health = entityplayer.maxHealth;
stats.hunger = entityplayer.getFoodStats().getFoodLevel(); stats.hunger = entityplayer.getFoodStats().getFoodLevel();
stats.beginnerManual = tags.getCompoundTag("TConstruct").getBoolean("beginnerManual"); stats.beginnerManual = tags.getCompoundTag("TConstruct").getBoolean("beginnerManual");
stats.materialManual = tags.getCompoundTag("TConstruct").getBoolean("materialManual"); stats.materialManual = tags.getCompoundTag("TConstruct").getBoolean("materialManual");
stats.smelteryManual = tags.getCompoundTag("TConstruct").getBoolean("smelteryManual"); stats.smelteryManual = tags.getCompoundTag("TConstruct").getBoolean("smelteryManual");
if (!stats.beginnerManual) if (!stats.beginnerManual)
{ {
stats.beginnerManual = true;
tags.getCompoundTag("TConstruct").setBoolean("beginnerManual", true); tags.getCompoundTag("TConstruct").setBoolean("beginnerManual", true);
ItemStack diary = new ItemStack(TContent.manualBook); ItemStack diary = new ItemStack(TContent.manualBook);
if (!entityplayer.inventory.addItemStackToInventory(diary)) if (!entityplayer.inventory.addItemStackToInventory(diary))
@ -79,7 +79,7 @@ public class TPlayerHandler implements IPlayerTracker
if (player != null) if (player != null)
{ {
TPlayerStats stats = getPlayerStats(player.username); TPlayerStats stats = getPlayerStats(player.username);
if (stats != null) if (stats != null && stats.armor != null)
{ {
stats.armor.saveToNBT(player); stats.armor.saveToNBT(player);
if (clean) if (clean)
@ -98,6 +98,7 @@ public class TPlayerHandler implements IPlayerTracker
//Boom! //Boom!
TPlayerStats stats = getPlayerStats(entityplayer.username); TPlayerStats stats = getPlayerStats(entityplayer.username);
stats.player = new WeakReference<EntityPlayer>(entityplayer); stats.player = new WeakReference<EntityPlayer>(entityplayer);
stats.armor.recalculateHealth();
TFoodStats food = new TFoodStats(); TFoodStats food = new TFoodStats();
entityplayer.foodStats = food; entityplayer.foodStats = food;

View File

@ -11,7 +11,8 @@ public class TPlayerStats
{ {
public WeakReference<EntityPlayer> player; public WeakReference<EntityPlayer> player;
public int level; public int level;
public int health; public int levelHealth;
public int bonusHealth;
public int hunger; public int hunger;
public boolean beginnerManual; public boolean beginnerManual;
public boolean materialManual; public boolean materialManual;

View File

@ -19,6 +19,27 @@ public class OverworldProvider extends WorldProvider
return this.terrainType.hasVoidParticles(this.hasNoSky); return this.terrainType.hasVoidParticles(this.hasNoSky);
} }
public float calculateCelestialAngle(long worldtime, float par3)
{
int timeOfDay = 18000;
float f1 = ((float)timeOfDay + par3) / 24000.0F - 0.25F;
if (f1 < 0.0F)
{
++f1;
}
if (f1 > 1.0F)
{
--f1;
}
float f2 = f1;
f1 = 1.0F - (float)((Math.cos((double)f1 * Math.PI) + 1.0D) / 2.0D);
f1 = f2 + (f1 - f2) / 3.0F;
return f1;
}
/*public float calculateCelestialAngle(long worldtime, float par3) /*public float calculateCelestialAngle(long worldtime, float par3)
{ {
int timeOfDay = (int)(worldtime % 43200L); int timeOfDay = (int)(worldtime % 43200L);

View File

@ -3,8 +3,10 @@ package mods.tinker.tconstruct.worldgen.village;
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Random;
import mods.tinker.tconstruct.blocks.logic.PatternChestLogic;
import mods.tinker.tconstruct.common.TContent; import mods.tinker.tconstruct.common.TContent;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.util.WeightedRandomChestContent;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.gen.structure.ComponentVillage; import net.minecraft.world.gen.structure.ComponentVillage;
import net.minecraft.world.gen.structure.ComponentVillageStartPiece; import net.minecraft.world.gen.structure.ComponentVillageStartPiece;
@ -25,7 +27,8 @@ public class ComponentToolWorkshop extends ComponentVillage
public static ComponentToolWorkshop buildComponent (ComponentVillageStartPiece villagePiece, List pieces, Random random, int p1, int p2, int p3, int p4, int p5) public static ComponentToolWorkshop buildComponent (ComponentVillageStartPiece villagePiece, List pieces, Random random, int p1, int p2, int p3, int p4, int p5)
{ {
StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p1, p2, p3, 0, 0, 0, 7, 6, 7, p4); StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p1, p2, p3, 0, 0, 0, 7, 6, 7, p4);
return canVillageGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(pieces, structureboundingbox) == null ? new ComponentToolWorkshop(villagePiece, p5, random, structureboundingbox, p4) : null; return canVillageGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(pieces, structureboundingbox) == null ? new ComponentToolWorkshop(villagePiece, p5, random,
structureboundingbox, p4) : null;
} }
/** /**
@ -113,12 +116,16 @@ public class ComponentToolWorkshop extends ComponentVillage
this.placeBlockAtCurrentPosition(world, Block.ladder.blockID, i, 3, 4, 5, sbb); this.placeBlockAtCurrentPosition(world, Block.ladder.blockID, i, 3, 4, 5, sbb);
this.placeBlockAtCurrentPosition(world, TContent.toolStationWood.blockID, 0, 1, 1, 1, sbb); //Inside this.placeBlockAtCurrentPosition(world, TContent.toolStationWood.blockID, 0, 1, 1, 1, sbb); //Inside
this.placeBlockAtCurrentPosition(world, TContent.toolStationWood.blockID, 5, 1, 1, 2, sbb); this.generateStructureChestContents(world, sbb, random, 1, 1, 2, TContent.tinkerHousePatterns.getItems(random), TContent.tinkerHousePatterns.getCount(random));
//this.placeBlockAtCurrentPosition(world, TContent.toolStationWood.blockID, 5, 1, 1, 2, sbb);
this.placeBlockAtCurrentPosition(world, TContent.toolStationWood.blockID, 1, 1, 1, 3, sbb); this.placeBlockAtCurrentPosition(world, TContent.toolStationWood.blockID, 1, 1, 1, 3, sbb);
this.placeBlockAtCurrentPosition(world, Block.workbench.blockID, 0, 1, 1, 4, sbb); this.placeBlockAtCurrentPosition(world, Block.workbench.blockID, 0, 1, 1, 4, sbb);
this.placeBlockAtCurrentPosition(world, TContent.toolStationWood.blockID, 10, 1, 1, 5, sbb); this.placeBlockAtCurrentPosition(world, TContent.toolStationWood.blockID, 10, 1, 1, 5, sbb);
this.placeBlockAtCurrentPosition(world, Block.chest.blockID, i, 4, 1, 5, sbb); //ChestGenHooks info = ChestGenHooks.getInfo("TinkerHouse");
this.generateStructureChestContents(world, sbb, random, 4, 1, 5, TContent.tinkerHouseChest.getItems(random), TContent.tinkerHouseChest.getCount(random));
//this.placeBlockAtCurrentPosition(world, Block.chest.blockID, i, 4, 1, 5, sbb);
i = this.getMetadataWithOffset(Block.pistonBase.blockID, 3); i = this.getMetadataWithOffset(Block.pistonBase.blockID, 3);
this.placeBlockAtCurrentPosition(world, Block.pistonBase.blockID, i, 5, 1, 5, sbb); this.placeBlockAtCurrentPosition(world, Block.pistonBase.blockID, i, 5, 1, 5, sbb);
@ -135,6 +142,31 @@ public class ComponentToolWorkshop extends ComponentVillage
return true; return true;
} }
protected boolean generateStructurePatternChestContents (World world, StructureBoundingBox par2StructureBoundingBox, Random random, int x, int y, int z,
WeightedRandomChestContent[] content, int par8)
{
int posX = this.getXWithOffset(x, z);
int posY = this.getYWithOffset(y);
int posZ = this.getZWithOffset(x, z);
if (par2StructureBoundingBox.isVecInside(posX, posY, posZ) && world.getBlockId(posX, posY, posZ) != Block.chest.blockID)
{
world.setBlock(posX, posY, posZ, TContent.toolStationWood.blockID, 5, 2);
PatternChestLogic logic = (PatternChestLogic) world.getBlockTileEntity(posX, posY, posZ);
if (logic != null)
{
WeightedRandomChestContent.generateChestContents(random, content, logic, par8);
}
return true;
}
else
{
return false;
}
}
/** /**
* Returns the villager type to spawn in this component, based on the number of villagers already spawned. * Returns the villager type to spawn in this component, based on the number of villagers already spawned.
*/ */

View File

@ -13,7 +13,7 @@ public class VillageSmelteryHandler implements IVillageCreationHandler
@Override @Override
public StructureVillagePieceWeight getVillagePieceWeight (Random random, int i) public StructureVillagePieceWeight getVillagePieceWeight (Random random, int i)
{ {
return new StructureVillagePieceWeight(ComponentSmeltery.class, 9, i + 1); return new StructureVillagePieceWeight(ComponentSmeltery.class, 9, i + random.nextInt(10) == 0 ? 1 : 0);
} }
@Override @Override

View File

@ -13,7 +13,7 @@ public class VillageToolStationHandler implements IVillageCreationHandler
@Override @Override
public StructureVillagePieceWeight getVillagePieceWeight (Random random, int i) public StructureVillagePieceWeight getVillagePieceWeight (Random random, int i)
{ {
return new StructureVillagePieceWeight(ComponentToolWorkshop.class, 30, i + 2); return new StructureVillagePieceWeight(ComponentToolWorkshop.class, 30, i + random.nextInt(4));
} }
@Override @Override

Binary file not shown.

After

Width:  |  Height:  |  Size: 451 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 419 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 407 B

BIN
spritesheets/arrows.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

@ -1,6 +1,6 @@
package test; package test;
import mods.tinker.tconstruct.entity.SlimeClone; import mods.tinker.tconstruct.entity.Crystal;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLiving;
@ -37,7 +37,7 @@ public class XinStick extends Item
spawnEntity(player.posX, player.posY+1, player.posZ, creeper, world, player); spawnEntity(player.posX, player.posY+1, player.posZ, creeper, world, player);
spawnEntity(player.posX, player.posY+1, player.posZ, pig, world, player); spawnEntity(player.posX, player.posY+1, player.posZ, pig, world, player);
creeper.mountEntity(pig);*/ creeper.mountEntity(pig);*/
spawnEntity(player.posX, player.posY+1, player.posZ, new SlimeClone(world, "Minalien"), world, player); spawnEntity(player.posX, player.posY+1, player.posZ, new Crystal(world), world, player);
//System.out.println("Health! "+player.getHealth()); //System.out.println("Health! "+player.getHealth());
//healPlayer(player); //healPlayer(player);
//removeChunk(world, player.posX, player.posZ); //removeChunk(world, player.posX, player.posZ);
@ -79,6 +79,7 @@ public class XinStick extends Item
{ {
entity.setPosition(x, y, z); entity.setPosition(x, y, z);
entity.setAngles(player.cameraYaw, player.cameraYaw); entity.setAngles(player.cameraYaw, player.cameraYaw);
//((BlueSlime) entity).setSlimeSize(8);
((EntityLiving) entity).initCreature(); ((EntityLiving) entity).initCreature();
world.spawnEntityInWorld(entity); world.spawnEntityInWorld(entity);
} }