Tweaked rapier and living drops

master
mDiyo 2013-05-11 10:52:09 -07:00
parent 1b5a237c95
commit 979d876e0b
21 changed files with 138 additions and 65 deletions

View File

@ -64,6 +64,8 @@
<entry key="block.brick.bone.name">Bone Brick</entry>
<entry key="block.brick.slime.name">Slime Brick</entry>
<entry key="block.brick.blueslime.name">Slime Brick</entry>
<entry key="block.brick.endstone.name">Endstone Brick</entry>
<entry key="block.brick.obsidian.ingot.name">Obsidian Brick</entry>
<entry key="item.oreberry.iron.name">Iron Oreberry</entry>
<entry key="item.oreberry.gold.name">Gold Oreberry</entry>

View File

@ -71,13 +71,13 @@ Effective on: Dirt, sand, gravel, and snow.</text>
</page>
<page type="toolpage">
<title>Axe</title>
<text>The Axe is a basic chopping tool. It is the simplest way to shape lumber.</text>
<title>Hatchet</title>
<text>The Hatchet is a basic chopping tool. It is the simplest way to shape lumber.</text>
<text>Class: Precision Tool
Effective on: Wood, Leaves, and Trees.</text>
<icon>axeicon</icon>
<item>
<text>Axe Head</text>
<text>Hatchet Head</text>
<icon>axehead</icon>
</item>
<item>
@ -249,8 +249,8 @@ Class: Lethal Joke Weapon</text>
</page>
<page type="sectionpage">
<title>Material Abilities</title>
<text>Some materials have abilities that augment their natural uses.
<title>Material Traits</title>
<text>Some materials have traits that augment their natural uses.
- Reinforced: 10% chance per level of not using durability
- Stonebound: The tool mines faster as it wears out, but does less damage

View File

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

View File

@ -94,7 +94,7 @@ public class Landmine extends Block
if (var6)
{
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
//par1World.setBlockWithNotify(par2, par3, par4, 0);
//par1World.setBlock(par2, par3, par4, 0);
}
}
@ -169,7 +169,7 @@ public class Landmine extends Block
if (var6 && !var5)
{
//world.setBlockWithNotify(posX, posY, posZ, 0);
//world.setBlock(posX, posY, posZ, 0);
world.createExplosion((Entity)null, posX, posY, posZ, 2.0F, true);
/*par1World.setBlockMetadataWithNotify(posX, posY, posZ, 1);
par1World.notifyBlocksOfNeighborChange(posX, posY, posZ, this.blockID);

View File

@ -144,11 +144,11 @@ public class LiquidMetalStill extends LiquidMetalBase implements ILiquid
if (var6 == 0)
{
par1World.setBlockWithNotify(par2, par3, par4, Block.obsidian.blockID);
par1World.setBlock(par2, par3, par4, Block.obsidian.blockID);
}
else if (var6 <= 4)
{
par1World.setBlockWithNotify(par2, par3, par4, Block.cobblestone.blockID);
par1World.setBlock(par2, par3, par4, Block.cobblestone.blockID);
}*/
this.triggerLavaMixEffects(par1World, par2, par3, par4);

View File

@ -15,7 +15,7 @@ import cpw.mods.fml.relauncher.SideOnly;
public class MultiBrick extends TConstructBlock
{
static String blockTextures[] = { "brick_obsidian", "brick_sandstone", "brick_netherrack", "brick_stone_refined", "brick_iron", "brick_gold", "brick_lapis", "brick_diamond", "brick_redstone",
"brick_bone", "brick_slime", "brick_blueslime" };
"brick_bone", "brick_slime", "brick_blueslime", "brick_endstone", "brick_obsidian_ingot" };
public MultiBrick(int id)
{
@ -40,6 +40,8 @@ public class MultiBrick extends TConstructBlock
case 9: return 1.0F;
case 10: return 1.5F;
case 11: return 1.5F;
case 12: return Block.whiteStone.getBlockHardness(world, x, y, z);
case 13: return Block.obsidian.getBlockHardness(world, x, y, z);
default: return blockHardness;
}
}
@ -61,6 +63,8 @@ public class MultiBrick extends TConstructBlock
case 9: return 1.0F;
case 10: return 1.5F;
case 11: return 1.5F;
case 12: return Block.whiteStone.getExplosionResistance(entity);
case 13: return Block.obsidian.getExplosionResistance(entity);
default: return getExplosionResistance(entity);
}
}

View File

@ -190,15 +190,6 @@ public class TProxyClient extends TProxyCommon
RenderingRegistry.registerEntityRenderingHandler(LaunchedPotion.class, new LaunchedItemRender(Item.potion, 16384));
//RenderingRegistry.registerEntityRenderingHandler(net.minecraft.entity.player.EntityPlayer.class, new PlayerArmorRender()); // <-- Works, woo!
if (PHConstruct.clearWater)
{
Block.waterMoving.setLightOpacity(1);
Block.waterStill.setLightOpacity(1);
}
DimensionManager.unregisterProviderType(0);
DimensionManager.registerProviderType(0, OverworldProvider.class, true);
addRenderMappings();
addToolButtons();
}
@ -472,7 +463,7 @@ public class TProxyClient extends TProxyCommon
"The main way to repair or change your tools. Place a tool and a material on the left to get started.",
"The Pickaxe is a basic mining tool. It is effective on stone and ores.\n\nRequired parts:\n- Pickaxe Head\n- Tool Binding\n- Handle",
"The Shovel is a basic digging tool. It is effective on dirt, sand, and snow.\n\nRequired parts:\n- Shovel Head\n- Handle",
"The Axe is a basic chopping tool. It is effective on wood and leaves.\n\nRequired parts:\n- Axe Head\n- Handle",
"The Hatchet is a basic chopping tool. It is effective on wood and leaves.\n\nRequired parts:\n- Axe Head\n- Handle",
//"The Lumber Axe is a broad chopping tool. It harvests wood in a wide range and can fell entire trees.\n\nRequired parts:\n- Broad Axe Head\n- Handle",
//"The Ice Axe is a tool for harvesting ice, mining, and attacking foes.\n\nSpecial Ability:\n- Wall Climb\nNatural Ability:\n- Ice Harvest\nDamage: Moderate\n\nRequired parts:\n- Pickaxe Head\n- Spike\n- Handle",
"The Cutter Mattock is a versatile farming tool. It is effective on wood, dirt, and plants.\n\nSpecial Ability: Hoe\n\nRequired parts:\n- Axe Head\n- Shovel Head\n- Handle",

View File

@ -184,7 +184,7 @@ public class ToolStationGui extends NewContainerGui
int maxDur = tags.getInteger("TotalDurability");
dur = maxDur - dur;
fontRenderer.drawString("Durability: " + dur + "/" + maxDur, xSize + 8, 24, 0xffffff);
int attack = tags.getInteger("Attack");
int attack = (int) (tags.getInteger("Attack") * tool.getDamageModifier());
String heart = attack == 2 ? " Heart" : " Hearts";
if (attack % 2 == 0)

View File

@ -601,7 +601,7 @@ public class TContent implements IFuelHandler
Smeltery.addMelting(Block.oreIron, 0, 600, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 0));
Smeltery.addMelting(Block.oreGold, 0, 400, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 1));
Smeltery.addMelting(oreGravel, 0, 600, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 0));
Smeltery.addMelting(oreGravel, 1, 400, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 1));
//Smeltery.addMelting(oreGravel, 1, 400, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 1));
//Items
Smeltery.addMelting(new ItemStack(Item.ingotIron, 4), Block.blockIron.blockID, 0, 500, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 0));
@ -610,6 +610,7 @@ public class TContent implements IFuelHandler
Smeltery.addMelting(new ItemStack(Item.bucketEmpty), Block.blockIron.blockID, 0, 600, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 3, 0));
Smeltery.addMelting(new ItemStack(Item.minecartEmpty), Block.blockIron.blockID, 0, 600, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 5, 0));
Smeltery.addMelting(new ItemStack(materials, 1, 18), Block.obsidian.blockID, 0, 750, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 11));//obsidian
//Blocks
Smeltery.addMelting(Block.blockIron, 0, 600, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 0));
@ -654,6 +655,8 @@ public class TContent implements IFuelHandler
chiseling.addDetailing(Item.bone, 0, multiBrick, 9, chisel);
chiseling.addDetailing(Item.slimeBall, 0, multiBrick, 10, chisel);
chiseling.addDetailing(strangeFood, 0, multiBrick, 11, chisel);
chiseling.addDetailing(Block.whiteStone, 0, multiBrick, 12, chisel);
chiseling.addDetailing(materials, 18, multiBrick, 13, chisel);
/*static String blockTextures[] = { "brick_obsidian", "brick_sandstone", "brick_netherrack", "brick_stone_refined", "brick_iron", "brick_gold", "brick_lapis", "brick_diamond",
"brick_redstone", "brick_slime", "brick_bone" };*/
@ -798,7 +801,7 @@ public class TContent implements IFuelHandler
OreDictionary.registerOre("oreNaturalAluminum", new ItemStack(oreSlag, 1, 5));
OreDictionary.registerOre("oreIron", new ItemStack(oreGravel, 1, 0));
OreDictionary.registerOre("oreGold", new ItemStack(oreGravel, 1, 1));
//OreDictionary.registerOre("oreGold", new ItemStack(oreGravel, 1, 1));
OreDictionary.registerOre("oreCobalt", new ItemStack(oreGravel, 1, 5));
OreDictionary.registerOre("oreCopper", new ItemStack(oreGravel, 1, 2));
OreDictionary.registerOre("oreTin", new ItemStack(oreGravel, 1, 3));

View File

@ -132,7 +132,7 @@ public class TProxyCommon implements IGuiHandler
//LanguageRegistry.addName(TContent.blankPattern, "Blank Pattern");
LanguageRegistry.addName(TContent.pickaxe, "Pickaxe");
LanguageRegistry.addName(TContent.shovel, "Shovel");
LanguageRegistry.addName(TContent.axe, "Axe");
LanguageRegistry.addName(TContent.axe, "Hatchet");
LanguageRegistry.addName(TContent.broadsword, "Broadsword");
LanguageRegistry.addName(TContent.longsword, "Longsword");
LanguageRegistry.addName(TContent.rapier, "Rapier");

View File

@ -12,7 +12,7 @@ import net.minecraft.util.MathHelper;
public class MultiBrickItem extends ItemBlock
{
static String blockType[] = { "obsidian", "sandstone", "netherrack", "stone.refined", "iron", "gold", "lapis", "diamond",
"redstone", "bone", "slime", "blueslime" };
"redstone", "bone", "slime", "blueslime", "endstone", "obsidian.ingot" };
public MultiBrickItem(int id)
{

View File

@ -42,22 +42,29 @@ public class Rapier extends Weapon
public boolean hitEntity (ItemStack stack, EntityLiving mob, EntityLiving player)
{
//AbilityHelper.hitEntity(stack, mob, player, damageVsEntity);
AbilityHelper.knockbackEntity(mob, 0.8f);
mob.motionY *= 0.5;
if (mob.hurtResistantTime > 16)
mob.hurtResistantTime -= 6;
//AbilityHelper.knockbackEntity(mob, 0.8f);
mob.motionY *= 0.8;
if (mob.hurtResistantTime > 18)
mob.hurtResistantTime -= 5;
return true;
}
@Override
public float getDurabilityModifier ()
{
return 0.7f;
}
@Override
public float getDamageModifier ()
{
return 0.8f;
}
public float chargeAttack ()
/*public float chargeAttack ()
{
return 1.5f;
}
return 1.0f;
}*/
public boolean pierceArmor ()
{

View File

@ -8,6 +8,7 @@ import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.ShapelessRecipes;
import net.minecraft.nbt.NBTTagCompound;
import cpw.mods.fml.common.registry.GameRegistry;
public class Detailing
@ -48,7 +49,16 @@ public class Detailing
public void addDetailing (DetailInput details, ToolCore tool)
{
detailing.add(details);
addShapelessToolRecipe(new ItemStack(details.outputID, 1, details.outputMeta), new ItemStack(tool, 1, Short.MAX_VALUE), new ItemStack(details.inputID, 1, details.inputMeta));
ItemStack toolstack = new ItemStack(tool, 1, Short.MAX_VALUE);
NBTTagCompound compound = new NBTTagCompound();
NBTTagCompound toolTag = new NBTTagCompound();
toolTag.setInteger("RenderHandle", 0);
toolTag.setInteger("RenderHead", 2);
toolTag.setInteger("RenderAccessory", 2);
compound.setCompoundTag("InfiTool", toolTag);
toolstack.setTagCompound(compound);
addShapelessToolRecipe(new ItemStack(details.outputID, 1, details.outputMeta), toolstack, new ItemStack(details.inputID, 1, details.inputMeta));
}
public void addShapelessToolRecipe (ItemStack par1ItemStack, Object... par2ArrayOfObj)

View File

@ -113,6 +113,11 @@ public class AbilityHelper
}
damage += enchantDamage;
if (tool.getDamageModifier() != 1f)
{
damage *= tool.getDamageModifier();
}
boolean var6 = false;
int fireAspect = EnchantmentHelper.getFireAspectModifier(player);
@ -135,7 +140,7 @@ public class AbilityHelper
damageTool(stack, 1, player, false);
int drain = toolTags.getInteger("Necrotic") * 2;
if (drain > 0)
player.heal(drain);
player.heal(random.nextInt(drain));
if (knockback > 0)
{
@ -386,7 +391,8 @@ public class AbilityHelper
if (stack.getMaxDamage() > 2)
{
stack.setItemDamage(1 + (ielectricitem.getMaxCharge(stack) - charge) * (stack.getMaxDamage() - 2) / ielectricitem.getMaxCharge(stack));
if (stack.getItemDamage() + 1 < stack.getMaxDamage())
stack.setItemDamage(1 + (ielectricitem.getMaxCharge(stack) - charge) * (stack.getMaxDamage() - 2) / ielectricitem.getMaxCharge(stack));
}
else
{

View File

@ -430,7 +430,7 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
}
/* Creative mode tools */
static String[] toolMaterialNames = { "Wooden ", "Stone ", "Iron ", "Flint ", "Cactus ", "Bone ", "Obsidian ", "Nethrrack ", "Slime ", "Paper ", "Cobalt ", "Ardite ", "Manyullyn ", "Copper ",
static String[] toolMaterialNames = { "Wooden ", "Stone ", "Iron ", "Flint ", "Cactus ", "Bone ", "Obsidian ", "Netherrack ", "Slime ", "Paper ", "Cobalt ", "Ardite ", "Manyullyn ", "Copper ",
"Bronze ", "Alumite ", "Steel ", "Slime " };
public void getSubItems (int id, CreativeTabs tab, List list)
@ -458,7 +458,7 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
public void onUpdate (ItemStack stack, World world, Entity entity, int par4, boolean par5)
{
if (!world.isRemote && entity instanceof EntityLiving)
if (!world.isRemote && entity instanceof EntityLiving && !((EntityLiving) entity).isSwingInProgress)
{
NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool");
if (tags.hasKey("Moss"))
@ -467,7 +467,7 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
int check = world.canBlockSeeTheSky((int) entity.posX, (int) entity.posY, (int) entity.posZ) ? 750 : 1500;
if (random.nextInt(check) < chance)
{
AbilityHelper.healTool(stack, 1, (EntityLiving) entity, true, !((EntityLiving) entity).isSwingInProgress);
AbilityHelper.healTool(stack, 1, (EntityLiving) entity, true, false);
}
}
}
@ -593,6 +593,11 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
{
return 1f;
}
public float getDamageModifier ()
{
return 1.0f;
}
//Right-click
public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float clickX, float clickY, float clickZ)

View File

@ -223,7 +223,7 @@ public class PHConstruct
tinBushMinY = config.get("Worldgen", "Tin Bush Min Y", 0).getInt(0);
tinBushMaxY = config.get("Worldgen", "Tin Bush Max Y", 40).getInt(40);
aluminumBushMinY = config.get("Worldgen", "Aluminum Bush Min Y", 0).getInt(0);
aluminumBushMaxY = config.get("Worldgen", "Aluminum Bush Max Y", 64).getInt(64);
aluminumBushMaxY = config.get("Worldgen", "Aluminum Bush Max Y", 60).getInt(60);
seaLevel = config.get("general", "Sea level", 64).getInt(64);

View File

@ -14,22 +14,26 @@ public class TCraftingHandler implements ICraftingHandler
@Override
public void onCrafting (EntityPlayer player, ItemStack item, IInventory craftMatrix)
{
if (item.getItem().itemID == TContent.toolStationWood.blockID)
if (!player.worldObj.isRemote)
{
NBTTagCompound tags = player.getEntityData().getCompoundTag("TConstruct");
if (!tags.getBoolean("materialManual"))
int itemID = item.getItem().itemID;
if (itemID == TContent.toolStationWood.blockID)
{
tags.setBoolean("materialManual", true);
AbilityHelper.spawnItemAtPlayer(player, new ItemStack(TContent.manualBook, 1, 1));
NBTTagCompound tags = player.getEntityData().getCompoundTag("TConstruct");
if (!tags.getBoolean("materialManual"))
{
tags.setBoolean("materialManual", true);
AbilityHelper.spawnItemAtPlayer(player, new ItemStack(TContent.manualBook, 1, 1));
}
}
}
if (item.getItem().itemID == TContent.smeltery.blockID)
{
NBTTagCompound tags = player.getEntityData().getCompoundTag("TConstruct");
if (!tags.getBoolean("smelteryManual"))
if (itemID == TContent.smeltery.blockID || itemID == TContent.lavaTank.blockID)
{
tags.setBoolean("smelteryManual", true);
AbilityHelper.spawnItemAtPlayer(player, new ItemStack(TContent.manualBook, 1, 2));
NBTTagCompound tags = player.getEntityData().getCompoundTag("TConstruct");
if (!tags.getBoolean("smelteryManual"))
{
tags.setBoolean("smelteryManual", true);
AbilityHelper.spawnItemAtPlayer(player, new ItemStack(TContent.manualBook, 1, 2));
}
}
}
}

View File

@ -10,17 +10,19 @@ import mods.tinker.tconstruct.entity.NitroCreeper;
import mods.tinker.tconstruct.library.crafting.PatternBuilder;
import mods.tinker.tconstruct.library.crafting.Smeltery;
import mods.tinker.tconstruct.library.crafting.ToolBuilder;
import mods.tinker.tconstruct.library.tools.ToolCore;
import mods.tinker.tconstruct.library.util.IFacingLogic;
import mods.tinker.tconstruct.modifiers.ModAttack;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.monster.EntityGhast;
import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.entity.passive.EntityChicken;
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.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EntityDamageSource;
import net.minecraft.util.EnumMovingObjectType;
import net.minecraft.world.World;
@ -30,9 +32,8 @@ import net.minecraftforge.event.Event.Result;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.entity.living.LivingDropsEvent;
import net.minecraftforge.event.entity.living.LivingHurtEvent;
import net.minecraftforge.event.entity.living.LivingSpawnEvent;
import net.minecraftforge.event.entity.player.FillBucketEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action;
import net.minecraftforge.liquids.LiquidStack;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.OreDictionary.OreRegisterEvent;
@ -97,7 +98,10 @@ public class TEventHandler
for (int iter = 0; iter < amount; ++iter)
{
event.entityLiving.dropItem(Item.leather.itemID, 1);
ItemStack dropStack = new ItemStack(Item.leather, 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);
}
}
@ -107,7 +111,11 @@ public class TEventHandler
for (int iter = 0; iter < amount; ++iter)
{
event.entityLiving.dropItem(Item.feather.itemID, 1);
ItemStack dropStack = new ItemStack(Item.feather, 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);
//event.entityLiving.dropItem(Item.feather.itemID, 1);
}
}
}
@ -117,13 +125,41 @@ public class TEventHandler
EntitySkeleton skeleton = (EntitySkeleton) event.entityLiving;
if (skeleton.getSkeletonType() == 1 && random.nextInt(Math.max(1, 5 - event.lootingLevel)) == 0)
{
skeleton.entityDropItem(new ItemStack(TContent.materials, 1, 8), 0f);
ItemStack dropStack = new ItemStack(TContent.materials, 1, 8);
EntityItem entityitem = new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, dropStack);
entityitem.delayBeforeCanPickup = 10;
event.drops.add(entityitem);
}
}
else if (event.entityLiving.getClass() == EntityGhast.class)
{
event.entityLiving.entityDropItem(new ItemStack(Item.ghastTear), 0);
ItemStack dropStack = new ItemStack(Item.ghastTear, 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);
}
}
@ForgeSubscribe
public void onLivingSpawn (LivingSpawnEvent.SpecialSpawn event)
{
if (event.entityLiving instanceof EntityCreeper && random.nextInt(500) == 0)
{
EntityPig pig = new EntityPig(event.entityLiving.worldObj);
spawnEntity(event.entityLiving.posX, event.entityLiving.posY+1, event.entityLiving.posZ, pig, event.entityLiving.worldObj);
event.entityLiving.mountEntity(pig);
}
}
public static void spawnEntity (double x, double y, double z, Entity entity, World world)
{
if (!world.isRemote)
{
entity.setPosition(x, y, z);
//entity.setAngles(player.cameraYaw, player.cameraYaw);
((EntityLiving) entity).initCreature();
world.spawnEntityInWorld(entity);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 622 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 616 B

View File

@ -1,10 +1,11 @@
package test;
import mods.tinker.tconstruct.entity.GolemBase;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.passive.EntityPig;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@ -32,10 +33,14 @@ public class XinStick extends Item
@Override
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
{
spawnEntity(player.posX, player.posY+1, player.posZ, new GolemBase(world), world, player);
EntityCreeper creeper = new EntityCreeper(world);
EntityPig pig = new EntityPig(world);
spawnEntity(player.posX, player.posY+1, player.posZ, creeper, world, player);
spawnEntity(player.posX, player.posY+1, player.posZ, pig, world, player);
creeper.mountEntity(pig);
//System.out.println("Health! "+player.getHealth());
//healPlayer(player);
removeChunk(world, player.posX, player.posZ);
//removeChunk(world, player.posX, player.posZ);
return stack;
}