Skip to content

Commit

Permalink
soo many errors
Browse files Browse the repository at this point in the history
  • Loading branch information
progwml6 committed Dec 31, 2013
1 parent b9cdef8 commit c0599dc
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 42 deletions.
31 changes: 16 additions & 15 deletions src/main/java/tconstruct/util/landmine/behavior/Behavior.java
Expand Up @@ -6,16 +6,17 @@
import java.util.List;

import tconstruct.util.landmine.Helper;

import net.minecraft.block.Block;
import net.minecraft.block.ITileEntityProvider;
import net.minecraft.entity.Entity;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.common.util.ForgeDirection;

/**
*
Expand Down Expand Up @@ -44,19 +45,19 @@ public static void registerBuiltInBehaviors ()
{
defaultBehavior = new BehaviorDefault();

addBehavior(new ItemStack(Item.stick), dummy);
addBehavior(new ItemStack(Item.redstone), utilityMode);
addBehavior(new ItemStack(Block.torchWood), blockThrow);
addBehavior(new ItemStack(Item.gunpowder), explosive);
addBehavior(new ItemStack(Block.tnt), explosive);
addBehavior(new ItemStack(Item.firework), firework);
addBehavior(new ItemStack(Item.potion), potion);
addBehavior(new ItemStack(Item.fireballCharge), fireball);
addBehavior(new ItemStack(Item.monsterPlacer), spawn);
addBehavior(new ItemStack(Item.arrow), shoot);
addBehavior(new ItemStack(Item.snowball), shoot);
addBehavior(new ItemStack(Item.enderPearl), shoot);
addBehavior(new ItemStack(Item.shears), shear);
addBehavior(new ItemStack(Items.stick), dummy);
addBehavior(new ItemStack(Items.redstone), utilityMode);
addBehavior(new ItemStack(Blocks.torch), blockThrow);
addBehavior(new ItemStack(Items.gunpowder), explosive);
addBehavior(new ItemStack(Blocks.tnt), explosive);
addBehavior(new ItemStack(Items.firework), firework);
addBehavior(new ItemStack(Items.potion), potion);
addBehavior(new ItemStack(Items.fireballCharge), fireball);
addBehavior(new ItemStack(Items.monsterPlacer), spawn);
addBehavior(new ItemStack(Items.arrow), shoot);
addBehavior(new ItemStack(Items.snowball), shoot);
addBehavior(new ItemStack(Items.ender_pearl), shoot);
addBehavior(new ItemStack(Items.shears), shear);

//Make sure the part below this comment is executed last(to avoid conflicts)
for (int i = 1; i < Block.blocksList.length; i++)
Expand Down
Expand Up @@ -6,6 +6,8 @@
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityTNTPrimed;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
Expand All @@ -22,11 +24,11 @@ public class BehaviorExplosive extends Behavior
public void executeLogic (World par1World, int par2, int par3, int par4, ItemStack par5ItemStack, Entity triggerer, boolean willBlockBeRemoved)
{
float explodeStrenght = 0;
if (par5ItemStack.itemID == Block.tnt.blockID)
if (par5ItemStack.itemID == Blocks.tnt.blockID)
{
explodeStrenght = 4.0F * par5ItemStack.stackSize;
}
else if (par5ItemStack.itemID == Item.gunpowder.itemID)
else if (par5ItemStack.itemID == Items.gunpowder.itemID)
{
explodeStrenght = 0.8F * par5ItemStack.stackSize;
}
Expand All @@ -38,11 +40,11 @@ else if (par5ItemStack.itemID == Item.gunpowder.itemID)
public void getInformation (ItemStack par1ItemStack, List par2List)
{
String str = "UNDEFINED";
if (par1ItemStack.itemID == Block.tnt.blockID)
if (par1ItemStack.itemID == Blocks.tnt.blockID)
{
str = "medium";
}
else if (par1ItemStack.itemID == Item.gunpowder.itemID)
else if (par1ItemStack.itemID == Items.gunpowder.itemID)
{
str = "small";
}
Expand Down
Expand Up @@ -4,10 +4,10 @@
import java.util.Random;

import tconstruct.items.blocks.ItemBlockLandmine;

import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.projectile.EntitySmallFireball;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumFacing;
Expand Down Expand Up @@ -46,7 +46,7 @@ public void executeLogic (World par1World, int par2, int par3, int par4, ItemSta
if ((par1World.getBlockId(i, par3, j) == 0 || (Block.blocksList[par1World.getBlockId(i, par3, j)] != null && Block.blocksList[par1World.getBlockId(i, par3, j)].isBlockReplaceable(
par1World, i, par3, j))) && ItemBlockLandmine.getRandom().nextInt(5) == 0 && Block.fire.canPlaceBlockAt(par1World, i, par3, j))
{
par1World.setBlock(i, par3, j, Block.fire.blockID);
par1World.setBlock(i, par3, j, Blocks.fire.blockID);
}
}
}
Expand Down
Expand Up @@ -4,11 +4,11 @@
import java.util.List;

import tconstruct.items.blocks.ItemBlockLandmine;

import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityPotion;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemPotion;
import net.minecraft.item.ItemStack;
Expand Down Expand Up @@ -46,13 +46,13 @@ public void executeLogic (World par1World, int par2, int par3, int par4, ItemSta
{
if (triggerer instanceof EntityPlayer)
{
Item.potion.onEaten(par5ItemStack, par1World, (EntityPlayer) triggerer);
Items.potion.onEaten(par5ItemStack, par1World, (EntityPlayer) triggerer);
}
else if (triggerer instanceof EntityLivingBase)
{
if (!par1World.isRemote)
{
List list = Item.potion.getEffects(par5ItemStack);
List list = Items.potion.getEffects(par5ItemStack);

if (list != null)
{
Expand Down
Expand Up @@ -6,6 +6,7 @@
import net.minecraft.entity.item.EntityEnderPearl;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.entity.projectile.EntitySnowball;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
Expand All @@ -26,16 +27,16 @@ public void executeLogic (World par1World, int par2, int par3, int par4, ItemSta

EnumFacing enumfacing = getFacing(par1World, par2, par3, par4);

if (par5ItemStack.itemID == Item.arrow.itemID)
if (par5ItemStack.itemID == Items.arrow.itemID)
{
entity = new EntityArrow(par1World, par2, par3, par4);
((EntityArrow) entity).canBePickedUp = 1;
}
else if (par5ItemStack.itemID == Item.snowball.itemID)
else if (par5ItemStack.itemID == Items.snowball.itemID)
{
entity = new EntitySnowball(par1World, par2, par3, par4);
}
else if (par5ItemStack.itemID == Item.enderPearl.itemID)
else if (par5ItemStack.itemID == Items.ender_pearl.itemID)
{
if (triggerer instanceof EntityLivingBase)
{
Expand Down
Expand Up @@ -11,7 +11,7 @@
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.common.util.ForgeDirection;

/**
*
Expand Down
Expand Up @@ -8,6 +8,7 @@
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityFireball;
import net.minecraft.entity.projectile.EntityLargeFireball;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
Expand All @@ -24,10 +25,10 @@ public void checkStack (World par1World, int par2, int par3, int par4, Entity tr
return;
}

if (this.arrayContainsEqualStack(stacks, new ItemStack(Item.firework)) && this.arrayContainsEqualStack(stacks, new ItemStack(Item.fireballCharge)))
if (this.arrayContainsEqualStack(stacks, new ItemStack(Items.fireworks)) && this.arrayContainsEqualStack(stacks, new ItemStack(Items.fire_charge)))
{
int index0 = this.arrayIndexOfStack(stacks, new ItemStack(Item.firework));
int index1 = this.arrayIndexOfStack(stacks, new ItemStack(Item.fireballCharge));
int index0 = this.arrayIndexOfStack(stacks, new ItemStack(Items.fireworks));
int index1 = this.arrayIndexOfStack(stacks, new ItemStack(Items.fire_charge));
EnumFacing face = getFacing(par1World, par2, par3, par4);

while (stacks.get(index0).stackSize > 0 && stacks.get(index1).stackSize > 0)
Expand Down Expand Up @@ -62,9 +63,9 @@ public void checkStack (World par1World, int par2, int par3, int par4, Entity tr
}
}

this.removeItemFromInventory(par1World, par2, par3, par4, new ItemStack(Item.firework, 1));
this.removeItemFromInventory(par1World, par2, par3, par4, new ItemStack(Items.fireworks, 1));
stacks.get(index0).stackSize--;
this.removeItemFromInventory(par1World, par2, par3, par4, new ItemStack(Item.fireballCharge, 1));
this.removeItemFromInventory(par1World, par2, par3, par4, new ItemStack(Items.fire_charge, 1));
stacks.get(index1).stackSize--;
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/tconstruct/util/player/ArmorExtended.java
Expand Up @@ -4,8 +4,8 @@
import java.lang.ref.WeakReference;

import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeInstance;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.entity.ai.attributes.IAttributeInstance;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
Expand Down Expand Up @@ -176,7 +176,7 @@ public void recalculateHealth (EntityPlayer player, TPlayerStats stats)
//TConstruct.logger.info("healthChange: "+healthChange+" on side "+FMLCommonHandler.instance().getEffectiveSide());
if (healthChange != 0)
{
AttributeInstance attributeinstance = player.getAttributeMap().getAttributeInstance(SharedMonsterAttributes.maxHealth);
IAttributeInstance attributeinstance = player.getAttributeMap().getAttributeInstance(SharedMonsterAttributes.maxHealth);
try
{
attributeinstance.removeModifier(attributeinstance.getModifier(globalID));
Expand All @@ -202,7 +202,7 @@ else if (parent != null && parent.get() != null)
int healthChange = bonusHP - prevHealth;
if (healthChange != 0)
{
AttributeInstance attributeinstance = player.getAttributeMap().getAttributeInstance(SharedMonsterAttributes.maxHealth);
IAttributeInstance attributeinstance = player.getAttributeMap().getAttributeInstance(SharedMonsterAttributes.maxHealth);
try
{
attributeinstance.removeModifier(attributeinstance.getModifier(globalID));
Expand Down
13 changes: 7 additions & 6 deletions src/main/java/tconstruct/util/player/TPlayerHandler.java
Expand Up @@ -6,8 +6,9 @@
import java.util.concurrent.ConcurrentHashMap;

import net.minecraft.entity.Entity;
import net.minecraft.entity.EnumEntitySize;
import net.minecraft.entity.Entity.EnumEntitySize;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
Expand Down Expand Up @@ -41,7 +42,7 @@ public void onPlayerLogin (EntityPlayer entityplayer)
NBTTagCompound tags = entityplayer.getEntityData();
if (!tags.hasKey("TConstruct"))
{
tags.setCompoundTag("TConstruct", new NBTTagCompound());
tags.setTag("TConstruct", new NBTTagCompound());
}
TPlayerStats stats = new TPlayerStats();
stats.player = new WeakReference<EntityPlayer>(entityplayer);
Expand Down Expand Up @@ -79,7 +80,7 @@ public void onPlayerLogin (EntityPlayer entityplayer)
ItemStack pattern = new ItemStack(TRepo.woodPattern, 1, 22);

NBTTagCompound compound = new NBTTagCompound();
compound.setCompoundTag("display", new NBTTagCompound());
compound.setTag("display", new NBTTagCompound());
compound.getCompoundTag("display").setString("Name", "\u00A7f" + "Fudgy_Fetus' Full Guard Pattern");
NBTTagList list = new NBTTagList();
list.appendTag(new NBTTagString("Lore", "\u00A72\u00A7o" + "The creator and the creation"));
Expand All @@ -92,10 +93,10 @@ public void onPlayerLogin (EntityPlayer entityplayer)

if (entityplayer.username.toLowerCase().equals("zerokyuuni"))
{
ItemStack pattern = new ItemStack(Item.stick);
ItemStack pattern = new ItemStack(Items.stick);

NBTTagCompound compound = new NBTTagCompound();
compound.setCompoundTag("display", new NBTTagCompound());
compound.setTag("display", new NBTTagCompound());
compound.getCompoundTag("display").setString("Name", "\u00A78" + "Cheaty Inventory");
NBTTagList list = new NBTTagList();
list.appendTag(new NBTTagString("Lore", "\u00A72\u00A7o" + "Nyaa~"));
Expand Down Expand Up @@ -189,7 +190,7 @@ public void onPlayerRespawn (EntityPlayer entityplayer)
tTag.setBoolean("beginnerManual", stats.beginnerManual);
tTag.setBoolean("materialManual", stats.materialManual);
tTag.setBoolean("smelteryManual", stats.smelteryManual);
tags.setCompoundTag("TConstruct", tTag);
tags.setTag("TConstruct", tTag);

Side side = FMLCommonHandler.instance().getEffectiveSide();
if (side == Side.CLIENT)
Expand Down

0 comments on commit c0599dc

Please sign in to comment.