Cleaned up heaps of useless crap.

This commit is contained in:
HbmMods 2016-01-15 12:15:44 +01:00
parent f515b6c207
commit 68973b9913
270 changed files with 1472 additions and 1216 deletions

View File

@ -2,20 +2,13 @@ package com.hbm.blocks;
import java.util.Random; import java.util.Random;
import com.hbm.main.MainRegistry;
import com.hbm.world.HugeMush; import com.hbm.world.HugeMush;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockMushroom;
import net.minecraft.block.IGrowable; import net.minecraft.block.IGrowable;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenBigMushroom;
import net.minecraftforge.common.util.ForgeDirection;
public class BlockMush extends Block implements IGrowable { public class BlockMush extends Block implements IGrowable {
@ -31,11 +24,13 @@ public class BlockMush extends Block implements IGrowable {
return p_149854_1_.func_149730_j(); return p_149854_1_.func_149730_j();
} }
@Override
public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
{ {
return super.canPlaceBlockAt(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && this.canBlockStay(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_); return super.canPlaceBlockAt(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && this.canBlockStay(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_);
} }
@Override
public boolean canBlockStay(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_) public boolean canBlockStay(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_)
{ {
if (p_149718_3_ >= 0 && p_149718_3_ < 256) if (p_149718_3_ >= 0 && p_149718_3_ < 256)
@ -61,15 +56,18 @@ public class BlockMush extends Block implements IGrowable {
return true; return true;
} }
@Override
public boolean func_149851_a(World p_149851_1_, int p_149851_2_, int p_149851_3_, int p_149851_4_, boolean p_149851_5_) public boolean func_149851_a(World p_149851_1_, int p_149851_2_, int p_149851_3_, int p_149851_4_, boolean p_149851_5_)
{ {
return true; return true;
} }
@Override
public boolean func_149852_a(World p_149852_1_, Random p_149852_2_, int p_149852_3_, int p_149852_4_, int p_149852_5_) public boolean func_149852_a(World p_149852_1_, Random p_149852_2_, int p_149852_3_, int p_149852_4_, int p_149852_5_)
{ {
return (double)p_149852_2_.nextFloat() < 0.4D; return p_149852_2_.nextFloat() < 0.4D;
} }
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_)
{ {
return null; return null;
@ -79,6 +77,7 @@ public class BlockMush extends Block implements IGrowable {
* Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
*/ */
@Override
public boolean isOpaqueCube() public boolean isOpaqueCube()
{ {
return false; return false;
@ -87,6 +86,7 @@ public class BlockMush extends Block implements IGrowable {
/** /**
* If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
*/ */
@Override
public boolean renderAsNormalBlock() public boolean renderAsNormalBlock()
{ {
return false; return false;
@ -95,10 +95,12 @@ public class BlockMush extends Block implements IGrowable {
/** /**
* The type of render function that is called for this block * The type of render function that is called for this block
*/ */
@Override
public int getRenderType() public int getRenderType()
{ {
return 1; return 1;
} }
@Override
public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_)
{ {
super.onNeighborBlockChange(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, p_149695_5_); super.onNeighborBlockChange(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, p_149695_5_);
@ -127,6 +129,7 @@ public class BlockMush extends Block implements IGrowable {
} }
} }
@Override
public void func_149853_b(World p_149853_1_, Random p_149853_2_, int p_149853_3_, int p_149853_4_, int p_149853_5_) public void func_149853_b(World p_149853_1_, Random p_149853_2_, int p_149853_3_, int p_149853_4_, int p_149853_5_)
{ {
this.func_149884_c(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_, p_149853_2_); this.func_149884_c(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_, p_149853_2_);

View File

@ -9,7 +9,6 @@ import cpw.mods.fml.relauncher.SideOnly;
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.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -23,17 +22,20 @@ public class BlockMushHuge extends Block {
super(p_i45394_1_); super(p_i45394_1_);
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) { public void registerBlockIcons(IIconRegister iconRegister) {
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + (this == ModBlocks.mush_block ? ":mush_block_skin" : ":mush_block_inside")); this.iconTop = iconRegister.registerIcon(RefStrings.MODID + (this == ModBlocks.mush_block ? ":mush_block_skin" : ":mush_block_inside"));
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + (this == ModBlocks.mush_block ? ":mush_block_skin" : ":mush_block_stem")); this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + (this == ModBlocks.mush_block ? ":mush_block_skin" : ":mush_block_stem"));
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) { public IIcon getIcon(int side, int metadata) {
return side == 1 ? this.iconTop : (side == 0 ? this.iconTop : this.blockIcon); return side == 1 ? this.iconTop : (side == 0 ? this.iconTop : this.blockIcon);
} }
@Override
public int quantityDropped(Random p_149745_1_) public int quantityDropped(Random p_149745_1_)
{ {
int i = p_149745_1_.nextInt(10) - 7; int i = p_149745_1_.nextInt(10) - 7;
@ -46,11 +48,13 @@ public class BlockMushHuge extends Block {
return i; return i;
} }
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{ {
return Item.getItemFromBlock(ModBlocks.mush); return Item.getItemFromBlock(ModBlocks.mush);
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_)
{ {

View File

@ -11,12 +11,9 @@ import cpw.mods.fml.relauncher.SideOnly;
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.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IEntityLivingData;
import net.minecraft.entity.monster.EntityCreeper; import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.potion.Potion; import net.minecraft.potion.Potion;
@ -29,6 +26,7 @@ public class BlockOre extends Block {
super(p_i45394_1_); super(p_i45394_1_);
} }
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{ {
if(this == ModBlocks.ore_fluorite) if(this == ModBlocks.ore_fluorite)
@ -63,6 +61,7 @@ public class BlockOre extends Block {
return Item.getItemFromBlock(this); return Item.getItemFromBlock(this);
} }
@Override
public int quantityDropped(Random p_149745_1_) public int quantityDropped(Random p_149745_1_)
{ {
if(this == ModBlocks.ore_fluorite) if(this == ModBlocks.ore_fluorite)
@ -81,11 +80,13 @@ public class BlockOre extends Block {
return 1; return 1;
} }
@Override
public int damageDropped(int p_149692_1_) public int damageDropped(int p_149692_1_)
{ {
return this == ModBlocks.waste_planks ? 1 : 0; return this == ModBlocks.waste_planks ? 1 : 0;
} }
@Override
public void onEntityWalking(World p_149724_1_, int p_149724_2_, int p_149724_3_, int p_149724_4_, Entity entity) public void onEntityWalking(World p_149724_1_, int p_149724_2_, int p_149724_3_, int p_149724_4_, Entity entity)
{ {
if (entity instanceof EntityLivingBase && this == ModBlocks.frozen_dirt) if (entity instanceof EntityLivingBase && this == ModBlocks.frozen_dirt)
@ -159,6 +160,7 @@ public class BlockOre extends Block {
} }
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_) public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_)
{ {
@ -166,7 +168,7 @@ public class BlockOre extends Block {
if (this == ModBlocks.waste_trinitite || this == ModBlocks.waste_trinitite_red || this == ModBlocks.block_trinitite || this == ModBlocks.block_waste) if (this == ModBlocks.waste_trinitite || this == ModBlocks.waste_trinitite_red || this == ModBlocks.block_trinitite || this == ModBlocks.block_waste)
{ {
p_149734_1_.spawnParticle("townaura", (double)((float)p_149734_2_ + p_149734_5_.nextFloat()), (double)((float)p_149734_3_ + 1.1F), (double)((float)p_149734_4_ + p_149734_5_.nextFloat()), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("townaura", p_149734_2_ + p_149734_5_.nextFloat(), p_149734_3_ + 1.1F, p_149734_4_ + p_149734_5_.nextFloat(), 0.0D, 0.0D, 0.0D);
} }
} }

View File

@ -14,6 +14,7 @@ public class BombFlameWar extends Block {
super(p_i45394_1_); super(p_i45394_1_);
} }
@Override
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_) public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
{ {
this.worldObj = p_149695_1_; this.worldObj = p_149695_1_;

View File

@ -23,17 +23,20 @@ public class BombFloat extends Block {
super(p_i45394_1_); super(p_i45394_1_);
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) { public void registerBlockIcons(IIconRegister iconRegister) {
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":bomb_float_top"); this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":bomb_float_top");
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":bomb_float"); this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":bomb_float");
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) { public IIcon getIcon(int side, int metadata) {
return side == 1 ? this.iconTop : (side == 0 ? this.iconTop : this.blockIcon); return side == 1 ? this.iconTop : (side == 0 ? this.iconTop : this.blockIcon);
} }
@Override
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_) public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
{ {
this.worldObj = p_149695_1_; this.worldObj = p_149695_1_;

View File

@ -8,11 +8,8 @@ import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer; import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityFallingBlock;
import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
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.nbt.NBTTagCompound;
@ -23,7 +20,6 @@ import net.minecraft.world.World;
import com.hbm.explosion.ExplosionChaos; import com.hbm.explosion.ExplosionChaos;
import com.hbm.explosion.ExplosionNukeGeneric; import com.hbm.explosion.ExplosionNukeGeneric;
import com.hbm.items.ModItems;
import com.hbm.main.MainRegistry; import com.hbm.main.MainRegistry;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler; import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
@ -52,11 +48,13 @@ public class BombMulti extends BlockContainer {
return new TileEntityBombMulti(); return new TileEntityBombMulti();
} }
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{ {
return Item.getItemFromBlock(ModBlocks.bomb_multi); return Item.getItemFromBlock(ModBlocks.bomb_multi);
} }
@Override
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
{ {
if (!keepInventory) if (!keepInventory)
@ -85,7 +83,7 @@ public class BombMulti extends BlockContainer {
} }
itemstack.stackSize -= j1; itemstack.stackSize -= j1;
EntityItem entityitem = new EntityItem(p_149749_1_, (double)((float)p_149749_2_ + f), (double)((float)p_149749_3_ + f1), (double)((float)p_149749_4_ + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage())); EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
if (itemstack.hasTagCompound()) if (itemstack.hasTagCompound())
{ {
@ -93,9 +91,9 @@ public class BombMulti extends BlockContainer {
} }
float f3 = 0.05F; float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F); entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
p_149749_1_.spawnEntityInWorld(entityitem); p_149749_1_.spawnEntityInWorld(entityitem);
} }
} }
@ -108,6 +106,7 @@ public class BombMulti extends BlockContainer {
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
} }
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote) if(world.isRemote)
{ {
@ -125,6 +124,7 @@ public class BombMulti extends BlockContainer {
} }
} }
@Override
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_) public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
{ {
TileEntityBombMulti entity = (TileEntityBombMulti) p_149695_1_.getTileEntity(x, y, z); TileEntityBombMulti entity = (TileEntityBombMulti) p_149695_1_.getTileEntity(x, y, z);
@ -263,20 +263,24 @@ public class BombMulti extends BlockContainer {
return false; return false;
} }
@Override
public int getRenderType(){ public int getRenderType(){
return -1; return -1;
} }
@Override
public boolean isOpaqueCube() { public boolean isOpaqueCube() {
return false; return false;
} }
@Override
public boolean renderAsNormalBlock() { public boolean renderAsNormalBlock() {
return false; return false;
} }
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) { public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int i = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
if(i == 0) if(i == 0)
{ {
@ -296,6 +300,7 @@ public class BombMulti extends BlockContainer {
} }
} }
@Override
public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_)
{ {
float f = 0.0625F; float f = 0.0625F;

View File

@ -2,7 +2,6 @@ package com.hbm.blocks;
import java.util.Random; import java.util.Random;
import com.hbm.explosion.ExplosionChaos;
import com.hbm.explosion.ExplosionThermo; import com.hbm.explosion.ExplosionThermo;
import com.hbm.lib.RefStrings; import com.hbm.lib.RefStrings;
@ -27,12 +26,14 @@ public class BombThermo extends Block {
super(p_i45394_1_); super(p_i45394_1_);
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) { public void registerBlockIcons(IIconRegister iconRegister) {
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":therm_top"); this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":therm_top");
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + (this == ModBlocks.therm_exo ? ":therm_exo" : ":therm_endo")); this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + (this == ModBlocks.therm_exo ? ":therm_exo" : ":therm_endo"));
} }
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{ {
if(this == ModBlocks.therm_endo) if(this == ModBlocks.therm_endo)
@ -43,11 +44,13 @@ public class BombThermo extends Block {
return Item.getItemFromBlock(ModBlocks.therm_exo); return Item.getItemFromBlock(ModBlocks.therm_exo);
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) { public IIcon getIcon(int side, int metadata) {
return side == 1 ? this.iconTop : (side == 0 ? this.iconTop : this.blockIcon); return side == 1 ? this.iconTop : (side == 0 ? this.iconTop : this.blockIcon);
} }
@Override
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_) public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
{ {
this.worldObj = p_149695_1_; this.worldObj = p_149695_1_;

View File

@ -1,16 +1,10 @@
package com.hbm.blocks; package com.hbm.blocks;
import java.util.List;
import org.lwjgl.opengl.GL11;
import net.minecraft.block.BlockContainer; import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -26,20 +20,24 @@ public class DecoBlock extends BlockContainer {
return new TileEntityDecoBlock(); return new TileEntityDecoBlock();
} }
@Override
public int getRenderType(){ public int getRenderType(){
return -1; return -1;
} }
@Override
public boolean isOpaqueCube() { public boolean isOpaqueCube() {
return false; return false;
} }
@Override
public boolean renderAsNormalBlock() { public boolean renderAsNormalBlock() {
return false; return false;
} }
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) { public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int i = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
if(i == 0) if(i == 0)
{ {
@ -59,6 +57,7 @@ public class DecoBlock extends BlockContainer {
} }
} }
@Override
public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_)
{ {
int te = p_149719_1_.getBlockMetadata(p_149719_2_, p_149719_3_, p_149719_4_); int te = p_149719_1_.getBlockMetadata(p_149719_2_, p_149719_3_, p_149719_4_);

View File

@ -3,10 +3,6 @@ package com.hbm.blocks;
import java.util.Random; import java.util.Random;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import com.hbm.lib.RefStrings;
import com.hbm.main.MainRegistry;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.BlockContainer; import net.minecraft.block.BlockContainer;
@ -14,11 +10,9 @@ import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -29,6 +23,7 @@ public class DecoBlockAlt extends BlockContainer {
super(p_i45386_1_); super(p_i45386_1_);
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) { public void registerBlockIcons(IIconRegister iconRegister) {
this.blockIcon = iconRegister.registerIcon("stone"); this.blockIcon = iconRegister.registerIcon("stone");
@ -47,25 +42,30 @@ public class DecoBlockAlt extends BlockContainer {
return null; return null;
} }
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{ {
return Item.getItemFromBlock(ModBlocks.statue_elb); return Item.getItemFromBlock(ModBlocks.statue_elb);
} }
@Override
public int getRenderType(){ public int getRenderType(){
return -1; return -1;
} }
@Override
public boolean isOpaqueCube() { public boolean isOpaqueCube() {
return false; return false;
} }
@Override
public boolean renderAsNormalBlock() { public boolean renderAsNormalBlock() {
return false; return false;
} }
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) { public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int i = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
if(i == 0) if(i == 0)
{ {
@ -85,6 +85,7 @@ public class DecoBlockAlt extends BlockContainer {
} }
} }
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote) if(world.isRemote)
{ {
@ -148,6 +149,7 @@ public class DecoBlockAlt extends BlockContainer {
return false; return false;
} }
@Override
public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_)
{ {
float f = 0.0625F; float f = 0.0625F;

View File

@ -6,7 +6,6 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
public class DecoPoleSatelliteReceiver extends BlockContainer { public class DecoPoleSatelliteReceiver extends BlockContainer {
@ -20,20 +19,24 @@ public class DecoPoleSatelliteReceiver extends BlockContainer {
return new TileEntityDecoPoleSatelliteReceiver(); return new TileEntityDecoPoleSatelliteReceiver();
} }
@Override
public int getRenderType(){ public int getRenderType(){
return -1; return -1;
} }
@Override
public boolean isOpaqueCube() { public boolean isOpaqueCube() {
return false; return false;
} }
@Override
public boolean renderAsNormalBlock() { public boolean renderAsNormalBlock() {
return false; return false;
} }
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) { public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int i = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
if(i == 0) if(i == 0)
{ {

View File

@ -6,7 +6,6 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
public class DecoPoleTop extends BlockContainer { public class DecoPoleTop extends BlockContainer {
@ -20,20 +19,24 @@ public class DecoPoleTop extends BlockContainer {
return new TileEntityDecoPoleTop(); return new TileEntityDecoPoleTop();
} }
@Override
public int getRenderType(){ public int getRenderType(){
return -1; return -1;
} }
@Override
public boolean isOpaqueCube() { public boolean isOpaqueCube() {
return false; return false;
} }
@Override
public boolean renderAsNormalBlock() { public boolean renderAsNormalBlock() {
return false; return false;
} }
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) { public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int i = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
if(i == 0) if(i == 0)
{ {

View File

@ -6,7 +6,6 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
public class DecoSteelPoles extends BlockContainer { public class DecoSteelPoles extends BlockContainer {
@ -20,20 +19,24 @@ public class DecoSteelPoles extends BlockContainer {
return new TileEntityDecoSteelPoles(); return new TileEntityDecoSteelPoles();
} }
@Override
public int getRenderType(){ public int getRenderType(){
return -1; return -1;
} }
@Override
public boolean isOpaqueCube() { public boolean isOpaqueCube() {
return false; return false;
} }
@Override
public boolean renderAsNormalBlock() { public boolean renderAsNormalBlock() {
return false; return false;
} }
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) { public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int i = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
if(i == 0) if(i == 0)
{ {

View File

@ -19,20 +19,24 @@ public class DecoTapeRecorder extends BlockContainer{
return new TileEntityDecoTapeRecorder(); return new TileEntityDecoTapeRecorder();
} }
@Override
public int getRenderType(){ public int getRenderType(){
return -1; return -1;
} }
@Override
public boolean isOpaqueCube() { public boolean isOpaqueCube() {
return false; return false;
} }
@Override
public boolean renderAsNormalBlock() { public boolean renderAsNormalBlock() {
return false; return false;
} }
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) { public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int i = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
if(i == 0) if(i == 0)
{ {

View File

@ -14,6 +14,7 @@ public class DetCord extends Block {
super(p_i45394_1_); super(p_i45394_1_);
} }
@Override
public void onBlockDestroyedByExplosion(World p_149723_1_, int p_149723_2_, int p_149723_3_, int p_149723_4_, Explosion p_149723_5_) public void onBlockDestroyedByExplosion(World p_149723_1_, int p_149723_2_, int p_149723_3_, int p_149723_4_, Explosion p_149723_5_)
{ {
if (!p_149723_1_.isRemote) if (!p_149723_1_.isRemote)
@ -22,6 +23,7 @@ public class DetCord extends Block {
} }
} }
@Override
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_) public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
{ {
if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z)) if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z))
@ -30,6 +32,7 @@ public class DetCord extends Block {
} }
} }
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{ {
return null; return null;

View File

@ -2,9 +2,6 @@ package com.hbm.blocks;
import com.hbm.lib.Library; import com.hbm.lib.Library;
import com.hbm.lib.RefStrings; import com.hbm.lib.RefStrings;
import com.hbm.main.MainRegistry;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block; import net.minecraft.block.Block;
@ -13,7 +10,6 @@ import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList; import net.minecraft.nbt.NBTTagList;
@ -35,6 +31,7 @@ public class Guide extends Block {
super(p_i45394_1_); super(p_i45394_1_);
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) { public void registerBlockIcons(IIconRegister iconRegister) {
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":guide_bottom"); this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":guide_bottom");
@ -45,6 +42,7 @@ public class Guide extends Block {
this.iconRight = iconRegister.registerIcon(RefStrings.MODID + ":guide_side_right"); this.iconRight = iconRegister.registerIcon(RefStrings.MODID + ":guide_side_right");
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) { public IIcon getIcon(int side, int metadata) {
if(metadata == 5) if(metadata == 5)
@ -125,8 +123,9 @@ public class Guide extends Block {
} }
} }
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) { public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int i = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
if(i == 0) if(i == 0)
{ {
@ -146,6 +145,7 @@ public class Guide extends Block {
} }
} }
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(!player.isSneaking()) if(!player.isSneaking())
{ {

View File

@ -19,9 +19,6 @@ import com.hbm.entity.EntityMissileMirv;
import com.hbm.entity.EntityMissileNuclear; import com.hbm.entity.EntityMissileNuclear;
import com.hbm.entity.EntityMissileRain; import com.hbm.entity.EntityMissileRain;
import com.hbm.entity.EntityMissileStrong; import com.hbm.entity.EntityMissileStrong;
import com.hbm.entity.EntityNukeCloudSmall;
import com.hbm.entity.EntityNukeExplosionAdvanced;
import com.hbm.entity.EntityTestMissile;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import com.hbm.main.MainRegistry; import com.hbm.main.MainRegistry;
@ -55,11 +52,13 @@ public class LaunchPad extends BlockContainer {
return new TileEntityLaunchPad(); return new TileEntityLaunchPad();
} }
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{ {
return Item.getItemFromBlock(ModBlocks.launch_pad); return Item.getItemFromBlock(ModBlocks.launch_pad);
} }
@Override
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
{ {
if (!keepInventory) if (!keepInventory)
@ -74,13 +73,13 @@ public class LaunchPad extends BlockContainer {
if (itemstack != null) if (itemstack != null)
{ {
float f = this.field_149933_a.nextFloat() * 0.8F + 0.1F; float f = LaunchPad.field_149933_a.nextFloat() * 0.8F + 0.1F;
float f1 = this.field_149933_a.nextFloat() * 0.8F + 0.1F; float f1 = LaunchPad.field_149933_a.nextFloat() * 0.8F + 0.1F;
float f2 = this.field_149933_a.nextFloat() * 0.8F + 0.1F; float f2 = LaunchPad.field_149933_a.nextFloat() * 0.8F + 0.1F;
while (itemstack.stackSize > 0) while (itemstack.stackSize > 0)
{ {
int j1 = this.field_149933_a.nextInt(21) + 10; int j1 = LaunchPad.field_149933_a.nextInt(21) + 10;
if (j1 > itemstack.stackSize) if (j1 > itemstack.stackSize)
{ {
@ -88,7 +87,7 @@ public class LaunchPad extends BlockContainer {
} }
itemstack.stackSize -= j1; itemstack.stackSize -= j1;
EntityItem entityitem = new EntityItem(p_149749_1_, (double)((float)p_149749_2_ + f), (double)((float)p_149749_3_ + f1), (double)((float)p_149749_4_ + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage())); EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
if (itemstack.hasTagCompound()) if (itemstack.hasTagCompound())
{ {
@ -96,9 +95,9 @@ public class LaunchPad extends BlockContainer {
} }
float f3 = 0.05F; float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionX = (float)LaunchPad.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F); entityitem.motionY = (float)LaunchPad.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionZ = (float)LaunchPad.field_149933_a.nextGaussian() * f3;
p_149749_1_.spawnEntityInWorld(entityitem); p_149749_1_.spawnEntityInWorld(entityitem);
} }
} }
@ -111,6 +110,7 @@ public class LaunchPad extends BlockContainer {
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
} }
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote) if(world.isRemote)
{ {
@ -128,6 +128,7 @@ public class LaunchPad extends BlockContainer {
} }
} }
@Override
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_) public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
{ {
TileEntityLaunchPad entity = (TileEntityLaunchPad) p_149695_1_.getTileEntity(x, y, z); TileEntityLaunchPad entity = (TileEntityLaunchPad) p_149695_1_.getTileEntity(x, y, z);
@ -283,20 +284,24 @@ public class LaunchPad extends BlockContainer {
} }
} }
@Override
public int getRenderType(){ public int getRenderType(){
return -1; return -1;
} }
@Override
public boolean isOpaqueCube() { public boolean isOpaqueCube() {
return false; return false;
} }
@Override
public boolean renderAsNormalBlock() { public boolean renderAsNormalBlock() {
return false; return false;
} }
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) { public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int i = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
if(i == 0) if(i == 0)
{ {
@ -381,6 +386,7 @@ public class LaunchPad extends BlockContainer {
} }
} }
@Override
public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_)
{ {
float f = 0.0625F; float f = 0.0625F;

View File

@ -36,22 +36,26 @@ public class MachineBattery extends BlockContainer {
super(p_i45386_1_); super(p_i45386_1_);
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) { public void registerBlockIcons(IIconRegister iconRegister) {
this.iconFront = iconRegister.registerIcon(RefStrings.MODID + ":battery_front_alt"); this.iconFront = iconRegister.registerIcon(RefStrings.MODID + ":battery_front_alt");
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":battery_side_alt"); this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":battery_side_alt");
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) { public IIcon getIcon(int side, int metadata) {
return metadata == 0 && side == 3 ? this.iconFront : (side == metadata ? this.iconFront : this.blockIcon); return metadata == 0 && side == 3 ? this.iconFront : (side == metadata ? this.iconFront : this.blockIcon);
} }
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{ {
return Item.getItemFromBlock(ModBlocks.machine_battery); return Item.getItemFromBlock(ModBlocks.machine_battery);
} }
@Override
public void onBlockAdded(World world, int x, int y, int z) { public void onBlockAdded(World world, int x, int y, int z) {
super.onBlockAdded(world, x, y, z); super.onBlockAdded(world, x, y, z);
this.setDefaultDirection(world, x, y, z); this.setDefaultDirection(world, x, y, z);
@ -88,8 +92,9 @@ public class MachineBattery extends BlockContainer {
} }
} }
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) { public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int i = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
if(i == 0) if(i == 0)
{ {
@ -119,6 +124,7 @@ public class MachineBattery extends BlockContainer {
return new TileEntityMachineBattery(); return new TileEntityMachineBattery();
} }
@Override
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_) public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
{ {
TileEntityMachineBattery entity = (TileEntityMachineBattery) p_149695_1_.getTileEntity(x, y, z); TileEntityMachineBattery entity = (TileEntityMachineBattery) p_149695_1_.getTileEntity(x, y, z);
@ -132,6 +138,7 @@ public class MachineBattery extends BlockContainer {
} }
} }
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote) if(world.isRemote)
{ {
@ -149,6 +156,7 @@ public class MachineBattery extends BlockContainer {
} }
} }
@Override
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
{ {
if (!keepInventory) if (!keepInventory)
@ -177,7 +185,7 @@ public class MachineBattery extends BlockContainer {
} }
itemstack.stackSize -= j1; itemstack.stackSize -= j1;
EntityItem entityitem = new EntityItem(p_149749_1_, (double)((float)p_149749_2_ + f), (double)((float)p_149749_3_ + f1), (double)((float)p_149749_4_ + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage())); EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
if (itemstack.hasTagCompound()) if (itemstack.hasTagCompound())
{ {
@ -185,9 +193,9 @@ public class MachineBattery extends BlockContainer {
} }
float f3 = 0.05F; float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F); entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
p_149749_1_.spawnEntityInWorld(entityitem); p_149749_1_.spawnEntityInWorld(entityitem);
} }
} }

View File

@ -31,18 +31,22 @@ public class MachineCentrifuge extends BlockContainer {
super(p_i45386_1_); super(p_i45386_1_);
} }
@Override
public int getRenderType(){ public int getRenderType(){
return -1; return -1;
} }
@Override
public boolean isOpaqueCube() { public boolean isOpaqueCube() {
return false; return false;
} }
@Override
public boolean renderAsNormalBlock() { public boolean renderAsNormalBlock() {
return false; return false;
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconregister) { public void registerBlockIcons(IIconRegister iconregister) {
this.blockIcon = iconregister.registerIcon(RefStrings.MODID + ":machine_centrifuge"); this.blockIcon = iconregister.registerIcon(RefStrings.MODID + ":machine_centrifuge");
@ -53,13 +57,15 @@ public class MachineCentrifuge extends BlockContainer {
return new TileEntityMachineCentrifuge(); return new TileEntityMachineCentrifuge();
} }
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{ {
return Item.getItemFromBlock(ModBlocks.machine_centrifuge); return Item.getItemFromBlock(ModBlocks.machine_centrifuge);
} }
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) { public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int i = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
if(i == 0) if(i == 0)
{ {
@ -79,6 +85,7 @@ public class MachineCentrifuge extends BlockContainer {
} }
} }
@Override
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
{ {
if (!keepInventory) if (!keepInventory)
@ -107,7 +114,7 @@ public class MachineCentrifuge extends BlockContainer {
} }
itemstack.stackSize -= j1; itemstack.stackSize -= j1;
EntityItem entityitem = new EntityItem(p_149749_1_, (double)((float)p_149749_2_ + f), (double)((float)p_149749_3_ + f1), (double)((float)p_149749_4_ + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage())); EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
if (itemstack.hasTagCompound()) if (itemstack.hasTagCompound())
{ {
@ -115,9 +122,9 @@ public class MachineCentrifuge extends BlockContainer {
} }
float f3 = 0.05F; float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F); entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
p_149749_1_.spawnEntityInWorld(entityitem); p_149749_1_.spawnEntityInWorld(entityitem);
} }
} }
@ -130,6 +137,7 @@ public class MachineCentrifuge extends BlockContainer {
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
} }
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote) if(world.isRemote)
{ {

View File

@ -40,12 +40,14 @@ public class MachineCoal extends BlockContainer {
isActive = blockState; isActive = blockState;
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) { public void registerBlockIcons(IIconRegister iconRegister) {
this.iconFront = iconRegister.registerIcon(RefStrings.MODID + (this.isActive ? ":machine_coal_front_on" : ":machine_coal_front_off")); this.iconFront = iconRegister.registerIcon(RefStrings.MODID + (this.isActive ? ":machine_coal_front_on" : ":machine_coal_front_off"));
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":machine_coal_side"); this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":machine_coal_side");
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) { public IIcon getIcon(int side, int metadata) {
//Reactivate in case of emergency //Reactivate in case of emergency
@ -53,11 +55,13 @@ public class MachineCoal extends BlockContainer {
return metadata == 0 && side == 3 ? this.iconFront : (side == metadata ? this.iconFront : this.blockIcon); return metadata == 0 && side == 3 ? this.iconFront : (side == metadata ? this.iconFront : this.blockIcon);
} }
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{ {
return Item.getItemFromBlock(ModBlocks.machine_coal_off); return Item.getItemFromBlock(ModBlocks.machine_coal_off);
} }
@Override
public void onBlockAdded(World world, int x, int y, int z) { public void onBlockAdded(World world, int x, int y, int z) {
super.onBlockAdded(world, x, y, z); super.onBlockAdded(world, x, y, z);
this.setDefaultDirection(world, x, y, z); this.setDefaultDirection(world, x, y, z);
@ -94,8 +98,9 @@ public class MachineCoal extends BlockContainer {
} }
} }
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) { public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int i = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
if(i == 0) if(i == 0)
{ {
@ -120,6 +125,7 @@ public class MachineCoal extends BlockContainer {
} }
} }
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote) if(world.isRemote)
{ {
@ -163,6 +169,7 @@ public class MachineCoal extends BlockContainer {
} }
} }
@Override
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
{ {
if (!keepInventory) if (!keepInventory)
@ -191,7 +198,7 @@ public class MachineCoal extends BlockContainer {
} }
itemstack.stackSize -= j1; itemstack.stackSize -= j1;
EntityItem entityitem = new EntityItem(p_149749_1_, (double)((float)p_149749_2_ + f), (double)((float)p_149749_3_ + f1), (double)((float)p_149749_4_ + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage())); EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
if (itemstack.hasTagCompound()) if (itemstack.hasTagCompound())
{ {
@ -199,9 +206,9 @@ public class MachineCoal extends BlockContainer {
} }
float f3 = 0.05F; float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F); entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
p_149749_1_.spawnEntityInWorld(entityitem); p_149749_1_.spawnEntityInWorld(entityitem);
} }
} }
@ -214,15 +221,16 @@ public class MachineCoal extends BlockContainer {
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void randomDisplayTick(World p_149734_1_, int x, int y, int z, Random rand) public void randomDisplayTick(World p_149734_1_, int x, int y, int z, Random rand)
{ {
if (isActive) if (isActive)
{ {
int l = p_149734_1_.getBlockMetadata(x, y, z); int l = p_149734_1_.getBlockMetadata(x, y, z);
float f = (float)x + 0.5F; float f = x + 0.5F;
float f1 = (float)y + 0.0F + rand.nextFloat() * 6.0F / 16.0F; float f1 = y + 0.0F + rand.nextFloat() * 6.0F / 16.0F;
float f2 = (float)z + 0.5F; float f2 = z + 0.5F;
float f3 = 0.52F; float f3 = 0.52F;
float f4 = rand.nextFloat() * 0.6F - 0.3F; float f4 = rand.nextFloat() * 0.6F - 0.3F;
float f5 = rand.nextFloat(); float f5 = rand.nextFloat();
@ -230,23 +238,23 @@ public class MachineCoal extends BlockContainer {
if (l == 4) if (l == 4)
{ {
p_149734_1_.spawnParticle("smoke", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("smoke", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
p_149734_1_.spawnParticle("flame", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("flame", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
} }
else if (l == 5) else if (l == 5)
{ {
p_149734_1_.spawnParticle("smoke", (double)(f + f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("smoke", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
p_149734_1_.spawnParticle("flame", (double)(f + f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("flame", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
} }
else if (l == 2) else if (l == 2)
{ {
p_149734_1_.spawnParticle("smoke", (double)(f + f4), (double)f1, (double)(f2 - f3), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("smoke", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D);
p_149734_1_.spawnParticle("flame", (double)(f + f4), (double)f1, (double)(f2 - f3), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("flame", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D);
} }
else if (l == 3) else if (l == 3)
{ {
p_149734_1_.spawnParticle("smoke", (double)(f + f4), (double)f1, (double)(f2 + f3), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("smoke", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D);
p_149734_1_.spawnParticle("flame", (double)(f + f4), (double)f1, (double)(f2 + f3), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("flame", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D);
} }
} }
} }

View File

@ -34,12 +34,14 @@ public class MachineDeuterium extends BlockContainer {
super(p_i45386_1_); super(p_i45386_1_);
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) { public void registerBlockIcons(IIconRegister iconRegister) {
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":machine_deuterium_side"); this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":machine_deuterium_side");
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":machine_deuterium_front"); this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":machine_deuterium_front");
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) { public IIcon getIcon(int side, int metadata) {
return side == 1 ? this.iconTop : (side == 0 ? this.iconTop : this.blockIcon); return side == 1 ? this.iconTop : (side == 0 ? this.iconTop : this.blockIcon);
@ -50,11 +52,13 @@ public class MachineDeuterium extends BlockContainer {
return new TileEntityMachineDeuterium(); return new TileEntityMachineDeuterium();
} }
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{ {
return Item.getItemFromBlock(ModBlocks.machine_deuterium); return Item.getItemFromBlock(ModBlocks.machine_deuterium);
} }
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote) if(world.isRemote)
{ {
@ -72,6 +76,7 @@ public class MachineDeuterium extends BlockContainer {
} }
} }
@Override
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
{ {
if (!keepInventory) if (!keepInventory)
@ -100,7 +105,7 @@ public class MachineDeuterium extends BlockContainer {
} }
itemstack.stackSize -= j1; itemstack.stackSize -= j1;
EntityItem entityitem = new EntityItem(p_149749_1_, (double)((float)p_149749_2_ + f), (double)((float)p_149749_3_ + f1), (double)((float)p_149749_4_ + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage())); EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
if (itemstack.hasTagCompound()) if (itemstack.hasTagCompound())
{ {
@ -108,9 +113,9 @@ public class MachineDeuterium extends BlockContainer {
} }
float f3 = 0.05F; float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F); entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
p_149749_1_.spawnEntityInWorld(entityitem); p_149749_1_.spawnEntityInWorld(entityitem);
} }
} }
@ -123,15 +128,16 @@ public class MachineDeuterium extends BlockContainer {
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void randomDisplayTick(World p_149734_1_, int x, int y, int z, Random rand) public void randomDisplayTick(World p_149734_1_, int x, int y, int z, Random rand)
{ {
if (((TileEntityMachineDeuterium) p_149734_1_.getTileEntity(x, y, z)).isProcessing()) if (((TileEntityMachineDeuterium) p_149734_1_.getTileEntity(x, y, z)).isProcessing())
{ {
int l = p_149734_1_.getBlockMetadata(x, y, z); int l = p_149734_1_.getBlockMetadata(x, y, z);
float f = (float)x + 0.5F; float f = x + 0.5F;
float f1 = (float)y + 1.0F; float f1 = y + 1.0F;
float f2 = (float)z + 0.5F; float f2 = z + 0.5F;
p_149734_1_.spawnParticle("cloud", f, f1, f2, 0.0D, 0.1D, 0.0D); p_149734_1_.spawnParticle("cloud", f, f1, f2, 0.0D, 0.1D, 0.0D);
} }

View File

@ -1,6 +1,5 @@
package com.hbm.blocks; package com.hbm.blocks;
import java.util.List;
import java.util.Random; import java.util.Random;
import com.hbm.lib.RefStrings; import com.hbm.lib.RefStrings;
@ -16,12 +15,10 @@ import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
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.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityFurnace;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -43,6 +40,7 @@ public class MachineDiFurnace extends BlockContainer {
isActive = blockState; isActive = blockState;
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) { public void registerBlockIcons(IIconRegister iconRegister) {
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + (this.isActive ? ":test_difurnace_top_on" : ":test_difurnace_top_off")); this.iconTop = iconRegister.registerIcon(RefStrings.MODID + (this.isActive ? ":test_difurnace_top_on" : ":test_difurnace_top_off"));
@ -50,6 +48,7 @@ public class MachineDiFurnace extends BlockContainer {
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":test_difurnace_side"); this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":test_difurnace_side");
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) { public IIcon getIcon(int side, int metadata) {
//Reactivate in case of emergency //Reactivate in case of emergency
@ -57,11 +56,13 @@ public class MachineDiFurnace extends BlockContainer {
return metadata == 0 && side == 3 ? this.iconFront : (side == metadata ? this.iconFront : (side == 1 ? this.iconTop : this.blockIcon)); return metadata == 0 && side == 3 ? this.iconFront : (side == metadata ? this.iconFront : (side == 1 ? this.iconTop : this.blockIcon));
} }
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{ {
return Item.getItemFromBlock(ModBlocks.machine_difurnace_off); return Item.getItemFromBlock(ModBlocks.machine_difurnace_off);
} }
@Override
public void onBlockAdded(World world, int x, int y, int z) { public void onBlockAdded(World world, int x, int y, int z) {
super.onBlockAdded(world, x, y, z); super.onBlockAdded(world, x, y, z);
this.setDefaultDirection(world, x, y, z); this.setDefaultDirection(world, x, y, z);
@ -98,8 +99,9 @@ public class MachineDiFurnace extends BlockContainer {
} }
} }
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) { public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int i = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
if(i == 0) if(i == 0)
{ {
@ -124,6 +126,7 @@ public class MachineDiFurnace extends BlockContainer {
} }
} }
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote) if(world.isRemote)
{ {
@ -167,6 +170,7 @@ public class MachineDiFurnace extends BlockContainer {
} }
} }
@Override
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
{ {
if (!keepInventory) if (!keepInventory)
@ -195,7 +199,7 @@ public class MachineDiFurnace extends BlockContainer {
} }
itemstack.stackSize -= j1; itemstack.stackSize -= j1;
EntityItem entityitem = new EntityItem(p_149749_1_, (double)((float)p_149749_2_ + f), (double)((float)p_149749_3_ + f1), (double)((float)p_149749_4_ + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage())); EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
if (itemstack.hasTagCompound()) if (itemstack.hasTagCompound())
{ {
@ -203,9 +207,9 @@ public class MachineDiFurnace extends BlockContainer {
} }
float f3 = 0.05F; float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F); entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
p_149749_1_.spawnEntityInWorld(entityitem); p_149749_1_.spawnEntityInWorld(entityitem);
} }
} }
@ -218,15 +222,16 @@ public class MachineDiFurnace extends BlockContainer {
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void randomDisplayTick(World p_149734_1_, int x, int y, int z, Random rand) public void randomDisplayTick(World p_149734_1_, int x, int y, int z, Random rand)
{ {
if (isActive) if (isActive)
{ {
int l = p_149734_1_.getBlockMetadata(x, y, z); int l = p_149734_1_.getBlockMetadata(x, y, z);
float f = (float)x + 0.5F; float f = x + 0.5F;
float f1 = (float)y + 0.0F + rand.nextFloat() * 6.0F / 16.0F; float f1 = y + 0.0F + rand.nextFloat() * 6.0F / 16.0F;
float f2 = (float)z + 0.5F; float f2 = z + 0.5F;
float f3 = 0.52F; float f3 = 0.52F;
float f4 = rand.nextFloat() * 0.6F - 0.3F; float f4 = rand.nextFloat() * 0.6F - 0.3F;
float f5 = rand.nextFloat(); float f5 = rand.nextFloat();
@ -234,27 +239,27 @@ public class MachineDiFurnace extends BlockContainer {
if (l == 4) if (l == 4)
{ {
p_149734_1_.spawnParticle("smoke", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("smoke", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
//p_149734_1_.spawnParticle("flame", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); //p_149734_1_.spawnParticle("flame", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D);
p_149734_1_.spawnParticle("reddust", (double)(x + f5), (double)f1 + 1, (double)(z + f6), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("reddust", x + f5, (double)f1 + 1, z + f6, 0.0D, 0.0D, 0.0D);
} }
else if (l == 5) else if (l == 5)
{ {
p_149734_1_.spawnParticle("smoke", (double)(f + f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("smoke", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
//p_149734_1_.spawnParticle("flame", (double)(f + f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); //p_149734_1_.spawnParticle("flame", (double)(f + f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D);
p_149734_1_.spawnParticle("reddust", (double)(x + f5), (double)f1 + 1, (double)(z + f6), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("reddust", x + f5, (double)f1 + 1, z + f6, 0.0D, 0.0D, 0.0D);
} }
else if (l == 2) else if (l == 2)
{ {
p_149734_1_.spawnParticle("smoke", (double)(f + f4), (double)f1, (double)(f2 - f3), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("smoke", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D);
//p_149734_1_.spawnParticle("flame", (double)(f + f4), (double)f1, (double)(f2 - f3), 0.0D, 0.0D, 0.0D) //p_149734_1_.spawnParticle("flame", (double)(f + f4), (double)f1, (double)(f2 - f3), 0.0D, 0.0D, 0.0D)
p_149734_1_.spawnParticle("reddust", (double)(x + f5), (double)f1 + 1, (double)(z + f6), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("reddust", x + f5, (double)f1 + 1, z + f6, 0.0D, 0.0D, 0.0D);
} }
else if (l == 3) else if (l == 3)
{ {
p_149734_1_.spawnParticle("smoke", (double)(f + f4), (double)f1, (double)(f2 + f3), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("smoke", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D);
//p_149734_1_.spawnParticle("flame", (double)(f + f4), (double)f1, (double)(f2 + f3), 0.0D, 0.0D, 0.0D); //p_149734_1_.spawnParticle("flame", (double)(f + f4), (double)f1, (double)(f2 + f3), 0.0D, 0.0D, 0.0D);
p_149734_1_.spawnParticle("reddust", (double)(x + f5), (double)f1 + 1, (double)(z + f6), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("reddust", x + f5, (double)f1 + 1, z + f6, 0.0D, 0.0D, 0.0D);
} }
} }
} }

View File

@ -39,12 +39,14 @@ public class MachineElectricFurnace extends BlockContainer {
isActive = blockState; isActive = blockState;
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) { public void registerBlockIcons(IIconRegister iconRegister) {
this.iconFront = iconRegister.registerIcon(RefStrings.MODID + (this.isActive ? ":machine_electric_furnace_front_on" : ":machine_electric_furnace_front_off")); this.iconFront = iconRegister.registerIcon(RefStrings.MODID + (this.isActive ? ":machine_electric_furnace_front_on" : ":machine_electric_furnace_front_off"));
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":machine_electric_furnace"); this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":machine_electric_furnace");
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) { public IIcon getIcon(int side, int metadata) {
//Reactivate in case of emergency //Reactivate in case of emergency
@ -52,11 +54,13 @@ public class MachineElectricFurnace extends BlockContainer {
return metadata == 0 && side == 3 ? this.iconFront : (side == metadata ? this.iconFront : this.blockIcon); return metadata == 0 && side == 3 ? this.iconFront : (side == metadata ? this.iconFront : this.blockIcon);
} }
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{ {
return Item.getItemFromBlock(ModBlocks.machine_electric_furnace_off); return Item.getItemFromBlock(ModBlocks.machine_electric_furnace_off);
} }
@Override
public void onBlockAdded(World world, int x, int y, int z) { public void onBlockAdded(World world, int x, int y, int z) {
super.onBlockAdded(world, x, y, z); super.onBlockAdded(world, x, y, z);
this.setDefaultDirection(world, x, y, z); this.setDefaultDirection(world, x, y, z);
@ -93,8 +97,9 @@ public class MachineElectricFurnace extends BlockContainer {
} }
} }
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) { public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int i = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
if(i == 0) if(i == 0)
{ {
@ -119,6 +124,7 @@ public class MachineElectricFurnace extends BlockContainer {
} }
} }
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote) if(world.isRemote)
{ {
@ -162,6 +168,7 @@ public class MachineElectricFurnace extends BlockContainer {
} }
} }
@Override
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
{ {
if (!keepInventory) if (!keepInventory)
@ -190,7 +197,7 @@ public class MachineElectricFurnace extends BlockContainer {
} }
itemstack.stackSize -= j1; itemstack.stackSize -= j1;
EntityItem entityitem = new EntityItem(p_149749_1_, (double)((float)p_149749_2_ + f), (double)((float)p_149749_3_ + f1), (double)((float)p_149749_4_ + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage())); EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
if (itemstack.hasTagCompound()) if (itemstack.hasTagCompound())
{ {
@ -198,9 +205,9 @@ public class MachineElectricFurnace extends BlockContainer {
} }
float f3 = 0.05F; float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F); entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
p_149749_1_.spawnEntityInWorld(entityitem); p_149749_1_.spawnEntityInWorld(entityitem);
} }
} }
@ -213,15 +220,16 @@ public class MachineElectricFurnace extends BlockContainer {
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void randomDisplayTick(World p_149734_1_, int x, int y, int z, Random rand) public void randomDisplayTick(World p_149734_1_, int x, int y, int z, Random rand)
{ {
if (isActive) if (isActive)
{ {
int l = p_149734_1_.getBlockMetadata(x, y, z); int l = p_149734_1_.getBlockMetadata(x, y, z);
float f = (float)x + 0.5F; float f = x + 0.5F;
float f1 = (float)y + 0.0F + rand.nextFloat() * 6.0F / 16.0F; float f1 = y + 0.0F + rand.nextFloat() * 6.0F / 16.0F;
float f2 = (float)z + 0.5F; float f2 = z + 0.5F;
float f3 = 0.52F; float f3 = 0.52F;
float f4 = rand.nextFloat() * 0.6F - 0.3F; float f4 = rand.nextFloat() * 0.6F - 0.3F;
float f5 = rand.nextFloat(); float f5 = rand.nextFloat();
@ -229,23 +237,23 @@ public class MachineElectricFurnace extends BlockContainer {
if (l == 4) if (l == 4)
{ {
p_149734_1_.spawnParticle("smoke", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("smoke", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
p_149734_1_.spawnParticle("flame", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("flame", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
} }
else if (l == 5) else if (l == 5)
{ {
p_149734_1_.spawnParticle("smoke", (double)(f + f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("smoke", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
p_149734_1_.spawnParticle("flame", (double)(f + f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("flame", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
} }
else if (l == 2) else if (l == 2)
{ {
p_149734_1_.spawnParticle("smoke", (double)(f + f4), (double)f1, (double)(f2 - f3), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("smoke", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D);
p_149734_1_.spawnParticle("flame", (double)(f + f4), (double)f1, (double)(f2 - f3), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("flame", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D);
} }
else if (l == 3) else if (l == 3)
{ {
p_149734_1_.spawnParticle("smoke", (double)(f + f4), (double)f1, (double)(f2 + f3), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("smoke", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D);
p_149734_1_.spawnParticle("flame", (double)(f + f4), (double)f1, (double)(f2 + f3), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("flame", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D);
} }
} }
} }

View File

@ -13,9 +13,7 @@ import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer; import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.item.EntityTNTPrimed;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.item.Item; import net.minecraft.item.Item;
@ -23,7 +21,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.Explosion; import net.minecraft.world.Explosion;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -44,22 +41,26 @@ public class MachineGenerator extends BlockContainer {
rand = new Random(); rand = new Random();
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) { public void registerBlockIcons(IIconRegister iconRegister) {
this.iconSide = iconRegister.registerIcon(RefStrings.MODID + ":machine_generator_side"); this.iconSide = iconRegister.registerIcon(RefStrings.MODID + ":machine_generator_side");
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":machine_generator"); this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":machine_generator");
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) { public IIcon getIcon(int side, int metadata) {
return side == 0 ? blockIcon : (side == 1 ? blockIcon : iconSide); return side == 0 ? blockIcon : (side == 1 ? blockIcon : iconSide);
} }
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{ {
return Item.getItemFromBlock(ModBlocks.machine_generator); return Item.getItemFromBlock(ModBlocks.machine_generator);
} }
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote) if(world.isRemote)
{ {
@ -82,6 +83,7 @@ public class MachineGenerator extends BlockContainer {
return new TileEntityMachineGenerator(); return new TileEntityMachineGenerator();
} }
@Override
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
{ {
if (!keepInventory) if (!keepInventory)
@ -110,7 +112,7 @@ public class MachineGenerator extends BlockContainer {
} }
itemstack.stackSize -= j1; itemstack.stackSize -= j1;
EntityItem entityitem = new EntityItem(p_149749_1_, (double)((float)p_149749_2_ + f), (double)((float)p_149749_3_ + f1), (double)((float)p_149749_4_ + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage())); EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
if (itemstack.hasTagCompound()) if (itemstack.hasTagCompound())
{ {
@ -118,9 +120,9 @@ public class MachineGenerator extends BlockContainer {
} }
float f3 = 0.05F; float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F); entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
p_149749_1_.spawnEntityInWorld(entityitem); p_149749_1_.spawnEntityInWorld(entityitem);
} }
} }
@ -133,6 +135,7 @@ public class MachineGenerator extends BlockContainer {
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
} }
@Override
public void onBlockDestroyedByExplosion(World p_149723_1_, int p_149723_2_, int p_149723_3_, int p_149723_4_, Explosion p_149723_5_) public void onBlockDestroyedByExplosion(World p_149723_1_, int p_149723_2_, int p_149723_3_, int p_149723_4_, Explosion p_149723_5_)
{ {
if (!p_149723_1_.isRemote) if (!p_149723_1_.isRemote)

View File

@ -39,22 +39,26 @@ public class MachineNukeFurnace extends BlockContainer {
isActive = blockState; isActive = blockState;
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) { public void registerBlockIcons(IIconRegister iconRegister) {
this.iconFront = iconRegister.registerIcon(RefStrings.MODID + (this.isActive ? ":machine_nuke_furnace_front_on" : ":machine_nuke_furnace_front_off")); this.iconFront = iconRegister.registerIcon(RefStrings.MODID + (this.isActive ? ":machine_nuke_furnace_front_on" : ":machine_nuke_furnace_front_off"));
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":block_steel"); this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":block_steel");
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) { public IIcon getIcon(int side, int metadata) {
return metadata == 0 && side == 3 ? this.iconFront : (side == metadata ? this.iconFront : this.blockIcon); return metadata == 0 && side == 3 ? this.iconFront : (side == metadata ? this.iconFront : this.blockIcon);
} }
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{ {
return Item.getItemFromBlock(ModBlocks.machine_nuke_furnace_off); return Item.getItemFromBlock(ModBlocks.machine_nuke_furnace_off);
} }
@Override
public void onBlockAdded(World world, int x, int y, int z) { public void onBlockAdded(World world, int x, int y, int z) {
super.onBlockAdded(world, x, y, z); super.onBlockAdded(world, x, y, z);
this.setDefaultDirection(world, x, y, z); this.setDefaultDirection(world, x, y, z);
@ -91,8 +95,9 @@ public class MachineNukeFurnace extends BlockContainer {
} }
} }
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) { public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int i = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
if(i == 0) if(i == 0)
{ {
@ -117,6 +122,7 @@ public class MachineNukeFurnace extends BlockContainer {
} }
} }
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote) if(world.isRemote)
{ {
@ -160,6 +166,7 @@ public class MachineNukeFurnace extends BlockContainer {
} }
} }
@Override
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
{ {
if (!keepInventory) if (!keepInventory)
@ -188,7 +195,7 @@ public class MachineNukeFurnace extends BlockContainer {
} }
itemstack.stackSize -= j1; itemstack.stackSize -= j1;
EntityItem entityitem = new EntityItem(p_149749_1_, (double)((float)p_149749_2_ + f), (double)((float)p_149749_3_ + f1), (double)((float)p_149749_4_ + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage())); EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
if (itemstack.hasTagCompound()) if (itemstack.hasTagCompound())
{ {
@ -196,9 +203,9 @@ public class MachineNukeFurnace extends BlockContainer {
} }
float f3 = 0.05F; float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F); entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
p_149749_1_.spawnEntityInWorld(entityitem); p_149749_1_.spawnEntityInWorld(entityitem);
} }
} }
@ -211,15 +218,16 @@ public class MachineNukeFurnace extends BlockContainer {
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void randomDisplayTick(World p_149734_1_, int x, int y, int z, Random rand) public void randomDisplayTick(World p_149734_1_, int x, int y, int z, Random rand)
{ {
if (isActive) if (isActive)
{ {
int l = p_149734_1_.getBlockMetadata(x, y, z); int l = p_149734_1_.getBlockMetadata(x, y, z);
float f = (float)x + 0.5F; float f = x + 0.5F;
float f1 = (float)y + 0.0F + rand.nextFloat() * 6.0F / 16.0F; float f1 = y + 0.0F + rand.nextFloat() * 6.0F / 16.0F;
float f2 = (float)z + 0.5F; float f2 = z + 0.5F;
float f3 = 0.52F; float f3 = 0.52F;
float f4 = rand.nextFloat() * 0.6F - 0.3F; float f4 = rand.nextFloat() * 0.6F - 0.3F;
float f5 = rand.nextFloat(); float f5 = rand.nextFloat();
@ -227,23 +235,23 @@ public class MachineNukeFurnace extends BlockContainer {
if (l == 4) if (l == 4)
{ {
p_149734_1_.spawnParticle("smoke", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("smoke", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
p_149734_1_.spawnParticle("flame", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("flame", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
} }
else if (l == 5) else if (l == 5)
{ {
p_149734_1_.spawnParticle("smoke", (double)(f + f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("smoke", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
p_149734_1_.spawnParticle("flame", (double)(f + f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("flame", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
} }
else if (l == 2) else if (l == 2)
{ {
p_149734_1_.spawnParticle("smoke", (double)(f + f4), (double)f1, (double)(f2 - f3), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("smoke", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D);
p_149734_1_.spawnParticle("flame", (double)(f + f4), (double)f1, (double)(f2 - f3), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("flame", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D);
} }
else if (l == 3) else if (l == 3)
{ {
p_149734_1_.spawnParticle("smoke", (double)(f + f4), (double)f1, (double)(f2 + f3), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("smoke", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D);
p_149734_1_.spawnParticle("flame", (double)(f + f4), (double)f1, (double)(f2 + f3), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("flame", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D);
} }
} }
} }

View File

@ -19,7 +19,6 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -32,18 +31,22 @@ public class MachinePuF6Tank extends BlockContainer {
super(p_i45386_1_); super(p_i45386_1_);
} }
@Override
public int getRenderType(){ public int getRenderType(){
return -1; return -1;
} }
@Override
public boolean isOpaqueCube() { public boolean isOpaqueCube() {
return false; return false;
} }
@Override
public boolean renderAsNormalBlock() { public boolean renderAsNormalBlock() {
return false; return false;
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconregister) { public void registerBlockIcons(IIconRegister iconregister) {
this.blockIcon = iconregister.registerIcon(RefStrings.MODID + ":machine_puf6_tank"); this.blockIcon = iconregister.registerIcon(RefStrings.MODID + ":machine_puf6_tank");
@ -54,13 +57,15 @@ public class MachinePuF6Tank extends BlockContainer {
return new TileEntityMachinePuF6Tank(); return new TileEntityMachinePuF6Tank();
} }
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{ {
return Item.getItemFromBlock(ModBlocks.machine_puf6_tank); return Item.getItemFromBlock(ModBlocks.machine_puf6_tank);
} }
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) { public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int i = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
if(i == 0) if(i == 0)
{ {
@ -80,6 +85,7 @@ public class MachinePuF6Tank extends BlockContainer {
} }
} }
@Override
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
{ {
if (!keepInventory) if (!keepInventory)
@ -108,7 +114,7 @@ public class MachinePuF6Tank extends BlockContainer {
} }
itemstack.stackSize -= j1; itemstack.stackSize -= j1;
EntityItem entityitem = new EntityItem(p_149749_1_, (double)((float)p_149749_2_ + f), (double)((float)p_149749_3_ + f1), (double)((float)p_149749_4_ + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage())); EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
if (itemstack.hasTagCompound()) if (itemstack.hasTagCompound())
{ {
@ -116,9 +122,9 @@ public class MachinePuF6Tank extends BlockContainer {
} }
float f3 = 0.05F; float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F); entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
p_149749_1_.spawnEntityInWorld(entityitem); p_149749_1_.spawnEntityInWorld(entityitem);
} }
} }
@ -131,6 +137,7 @@ public class MachinePuF6Tank extends BlockContainer {
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
} }
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote) if(world.isRemote)
{ {

View File

@ -1,6 +1,5 @@
package com.hbm.blocks; package com.hbm.blocks;
import java.util.List;
import java.util.Random; import java.util.Random;
import com.hbm.lib.RefStrings; import com.hbm.lib.RefStrings;
@ -16,12 +15,10 @@ import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
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.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityFurnace;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -40,6 +37,7 @@ public class MachineReactor extends BlockContainer {
super(p_i45386_1_); super(p_i45386_1_);
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) { public void registerBlockIcons(IIconRegister iconRegister) {
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + (":reactor_top")); this.iconTop = iconRegister.registerIcon(RefStrings.MODID + (":reactor_top"));
@ -48,16 +46,19 @@ public class MachineReactor extends BlockContainer {
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":reactor_side"); this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":reactor_side");
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) { public IIcon getIcon(int side, int metadata) {
return side == 1 ? this.iconTop : (side == 0 ? this.iconBottom : this.blockIcon); return side == 1 ? this.iconTop : (side == 0 ? this.iconBottom : this.blockIcon);
} }
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{ {
return Item.getItemFromBlock(ModBlocks.machine_reactor); return Item.getItemFromBlock(ModBlocks.machine_reactor);
} }
@Override
public void onBlockAdded(World world, int x, int y, int z) { public void onBlockAdded(World world, int x, int y, int z) {
super.onBlockAdded(world, x, y, z); super.onBlockAdded(world, x, y, z);
this.setDefaultDirection(world, x, y, z); this.setDefaultDirection(world, x, y, z);
@ -94,8 +95,9 @@ public class MachineReactor extends BlockContainer {
} }
} }
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) { public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int i = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
if(i == 0) if(i == 0)
{ {
@ -120,6 +122,7 @@ public class MachineReactor extends BlockContainer {
} }
} }
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote) if(world.isRemote)
{ {
@ -142,6 +145,7 @@ public class MachineReactor extends BlockContainer {
return new TileEntityMachineReactor(); return new TileEntityMachineReactor();
} }
@Override
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
{ {
if (true) if (true)
@ -170,7 +174,7 @@ public class MachineReactor extends BlockContainer {
} }
itemstack.stackSize -= j1; itemstack.stackSize -= j1;
EntityItem entityitem = new EntityItem(p_149749_1_, (double)((float)p_149749_2_ + f), (double)((float)p_149749_3_ + f1), (double)((float)p_149749_4_ + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage())); EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
if (itemstack.hasTagCompound()) if (itemstack.hasTagCompound())
{ {
@ -178,9 +182,9 @@ public class MachineReactor extends BlockContainer {
} }
float f3 = 0.05F; float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F); entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
p_149749_1_.spawnEntityInWorld(entityitem); p_149749_1_.spawnEntityInWorld(entityitem);
} }
} }

View File

@ -40,22 +40,26 @@ public class MachineRtgFurnace extends BlockContainer {
isActive = blockState; isActive = blockState;
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) { public void registerBlockIcons(IIconRegister iconRegister) {
this.iconFront = iconRegister.registerIcon(RefStrings.MODID + (this.isActive ? ":machine_rtg_furnace_on" : ":machine_rtg_furnace_off")); this.iconFront = iconRegister.registerIcon(RefStrings.MODID + (this.isActive ? ":machine_rtg_furnace_on" : ":machine_rtg_furnace_off"));
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":block_tungsten"); this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":block_tungsten");
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) { public IIcon getIcon(int side, int metadata) {
return metadata == 0 && side == 3 ? this.iconFront : (side == metadata ? this.iconFront : this.blockIcon); return metadata == 0 && side == 3 ? this.iconFront : (side == metadata ? this.iconFront : this.blockIcon);
} }
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{ {
return Item.getItemFromBlock(ModBlocks.machine_rtg_furnace_off); return Item.getItemFromBlock(ModBlocks.machine_rtg_furnace_off);
} }
@Override
public void onBlockAdded(World world, int x, int y, int z) { public void onBlockAdded(World world, int x, int y, int z) {
super.onBlockAdded(world, x, y, z); super.onBlockAdded(world, x, y, z);
this.setDefaultDirection(world, x, y, z); this.setDefaultDirection(world, x, y, z);
@ -92,8 +96,9 @@ public class MachineRtgFurnace extends BlockContainer {
} }
} }
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) { public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int i = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
if(i == 0) if(i == 0)
{ {
@ -118,6 +123,7 @@ public class MachineRtgFurnace extends BlockContainer {
} }
} }
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote) if(world.isRemote)
{ {
@ -161,6 +167,7 @@ public class MachineRtgFurnace extends BlockContainer {
} }
} }
@Override
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
{ {
if (!keepInventory) if (!keepInventory)
@ -189,7 +196,7 @@ public class MachineRtgFurnace extends BlockContainer {
} }
itemstack.stackSize -= j1; itemstack.stackSize -= j1;
EntityItem entityitem = new EntityItem(p_149749_1_, (double)((float)p_149749_2_ + f), (double)((float)p_149749_3_ + f1), (double)((float)p_149749_4_ + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage())); EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
if (itemstack.hasTagCompound()) if (itemstack.hasTagCompound())
{ {
@ -197,9 +204,9 @@ public class MachineRtgFurnace extends BlockContainer {
} }
float f3 = 0.05F; float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F); entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
p_149749_1_.spawnEntityInWorld(entityitem); p_149749_1_.spawnEntityInWorld(entityitem);
} }
} }
@ -212,15 +219,16 @@ public class MachineRtgFurnace extends BlockContainer {
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void randomDisplayTick(World p_149734_1_, int x, int y, int z, Random rand) public void randomDisplayTick(World p_149734_1_, int x, int y, int z, Random rand)
{ {
if (isActive) if (isActive)
{ {
int l = p_149734_1_.getBlockMetadata(x, y, z); int l = p_149734_1_.getBlockMetadata(x, y, z);
float f = (float)x + 0.5F; float f = x + 0.5F;
float f1 = (float)y + 0.0F + rand.nextFloat() * 6.0F / 16.0F; float f1 = y + 0.0F + rand.nextFloat() * 6.0F / 16.0F;
float f2 = (float)z + 0.5F; float f2 = z + 0.5F;
float f3 = 0.52F; float f3 = 0.52F;
float f4 = rand.nextFloat() * 0.6F - 0.3F; float f4 = rand.nextFloat() * 0.6F - 0.3F;
float f5 = rand.nextFloat(); float f5 = rand.nextFloat();
@ -228,23 +236,23 @@ public class MachineRtgFurnace extends BlockContainer {
if (l == 4) if (l == 4)
{ {
p_149734_1_.spawnParticle("smoke", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("smoke", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
p_149734_1_.spawnParticle("flame", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("flame", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
} }
else if (l == 5) else if (l == 5)
{ {
p_149734_1_.spawnParticle("smoke", (double)(f + f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("smoke", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
p_149734_1_.spawnParticle("flame", (double)(f + f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("flame", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
} }
else if (l == 2) else if (l == 2)
{ {
p_149734_1_.spawnParticle("smoke", (double)(f + f4), (double)f1, (double)(f2 - f3), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("smoke", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D);
p_149734_1_.spawnParticle("flame", (double)(f + f4), (double)f1, (double)(f2 - f3), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("flame", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D);
} }
else if (l == 3) else if (l == 3)
{ {
p_149734_1_.spawnParticle("smoke", (double)(f + f4), (double)f1, (double)(f2 + f3), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("smoke", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D);
p_149734_1_.spawnParticle("flame", (double)(f + f4), (double)f1, (double)(f2 + f3), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("flame", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D);
} }
} }
} }

View File

@ -19,7 +19,6 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -32,18 +31,22 @@ public class MachineUF6Tank extends BlockContainer {
super(p_i45386_1_); super(p_i45386_1_);
} }
@Override
public int getRenderType(){ public int getRenderType(){
return -1; return -1;
} }
@Override
public boolean isOpaqueCube() { public boolean isOpaqueCube() {
return false; return false;
} }
@Override
public boolean renderAsNormalBlock() { public boolean renderAsNormalBlock() {
return false; return false;
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconregister) { public void registerBlockIcons(IIconRegister iconregister) {
this.blockIcon = iconregister.registerIcon(RefStrings.MODID + ":machine_uf6_tank"); this.blockIcon = iconregister.registerIcon(RefStrings.MODID + ":machine_uf6_tank");
@ -54,13 +57,15 @@ public class MachineUF6Tank extends BlockContainer {
return new TileEntityMachineUF6Tank(); return new TileEntityMachineUF6Tank();
} }
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{ {
return Item.getItemFromBlock(ModBlocks.machine_uf6_tank); return Item.getItemFromBlock(ModBlocks.machine_uf6_tank);
} }
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) { public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int i = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
if(i == 0) if(i == 0)
{ {
@ -80,6 +85,7 @@ public class MachineUF6Tank extends BlockContainer {
} }
} }
@Override
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
{ {
if (!keepInventory) if (!keepInventory)
@ -108,7 +114,7 @@ public class MachineUF6Tank extends BlockContainer {
} }
itemstack.stackSize -= j1; itemstack.stackSize -= j1;
EntityItem entityitem = new EntityItem(p_149749_1_, (double)((float)p_149749_2_ + f), (double)((float)p_149749_3_ + f1), (double)((float)p_149749_4_ + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage())); EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
if (itemstack.hasTagCompound()) if (itemstack.hasTagCompound())
{ {
@ -116,9 +122,9 @@ public class MachineUF6Tank extends BlockContainer {
} }
float f3 = 0.05F; float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F); entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
p_149749_1_.spawnEntityInWorld(entityitem); p_149749_1_.spawnEntityInWorld(entityitem);
} }
} }
@ -131,6 +137,7 @@ public class MachineUF6Tank extends BlockContainer {
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
} }
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote) if(world.isRemote)
{ {

View File

@ -7,12 +7,7 @@ import com.hbm.main.MainRegistry;
import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockGlass;
import net.minecraft.block.BlockMushroom;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
public class ModBlocks { public class ModBlocks {

View File

@ -1,38 +1,24 @@
package com.hbm.blocks; package com.hbm.blocks;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Random; import java.util.Random;
import com.hbm.entity.EntityNukeCloudSmall; import com.hbm.entity.EntityNukeCloudSmall;
import com.hbm.entity.EntityNukeExplosion;
import com.hbm.entity.EntityNukeExplosionAdvanced; import com.hbm.entity.EntityNukeExplosionAdvanced;
import com.hbm.explosion.ExplosionNukeAdvanced;
import com.hbm.explosion.ExplosionNukeGeneric;
import com.hbm.main.MainRegistry; import com.hbm.main.MainRegistry;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler; import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer; import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.enchantment.EnchantmentProtection;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
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.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.util.Vec3;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
public class NukeBoy extends BlockContainer { public class NukeBoy extends BlockContainer {
@ -51,11 +37,13 @@ public class NukeBoy extends BlockContainer {
return new TileEntityNukeBoy(); return new TileEntityNukeBoy();
} }
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{ {
return Item.getItemFromBlock(ModBlocks.nuke_boy); return Item.getItemFromBlock(ModBlocks.nuke_boy);
} }
@Override
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
{ {
if (!keepInventory) if (!keepInventory)
@ -70,13 +58,13 @@ public class NukeBoy extends BlockContainer {
if (itemstack != null) if (itemstack != null)
{ {
float f = this.field_149933_a.nextFloat() * 0.8F + 0.1F; float f = NukeBoy.field_149933_a.nextFloat() * 0.8F + 0.1F;
float f1 = this.field_149933_a.nextFloat() * 0.8F + 0.1F; float f1 = NukeBoy.field_149933_a.nextFloat() * 0.8F + 0.1F;
float f2 = this.field_149933_a.nextFloat() * 0.8F + 0.1F; float f2 = NukeBoy.field_149933_a.nextFloat() * 0.8F + 0.1F;
while (itemstack.stackSize > 0) while (itemstack.stackSize > 0)
{ {
int j1 = this.field_149933_a.nextInt(21) + 10; int j1 = NukeBoy.field_149933_a.nextInt(21) + 10;
if (j1 > itemstack.stackSize) if (j1 > itemstack.stackSize)
{ {
@ -84,7 +72,7 @@ public class NukeBoy extends BlockContainer {
} }
itemstack.stackSize -= j1; itemstack.stackSize -= j1;
EntityItem entityitem = new EntityItem(p_149749_1_, (double)((float)p_149749_2_ + f), (double)((float)p_149749_3_ + f1), (double)((float)p_149749_4_ + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage())); EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
if (itemstack.hasTagCompound()) if (itemstack.hasTagCompound())
{ {
@ -92,9 +80,9 @@ public class NukeBoy extends BlockContainer {
} }
float f3 = 0.05F; float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionX = (float)NukeBoy.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F); entityitem.motionY = (float)NukeBoy.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionZ = (float)NukeBoy.field_149933_a.nextGaussian() * f3;
p_149749_1_.spawnEntityInWorld(entityitem); p_149749_1_.spawnEntityInWorld(entityitem);
} }
} }
@ -107,6 +95,7 @@ public class NukeBoy extends BlockContainer {
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
} }
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote) if(world.isRemote)
{ {
@ -124,6 +113,7 @@ public class NukeBoy extends BlockContainer {
} }
} }
@Override
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_) public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
{ {
TileEntityNukeBoy entity = (TileEntityNukeBoy) p_149695_1_.getTileEntity(x, y, z); TileEntityNukeBoy entity = (TileEntityNukeBoy) p_149695_1_.getTileEntity(x, y, z);
@ -183,20 +173,24 @@ public class NukeBoy extends BlockContainer {
return false; return false;
} }
@Override
public int getRenderType(){ public int getRenderType(){
return -1; return -1;
} }
@Override
public boolean isOpaqueCube() { public boolean isOpaqueCube() {
return false; return false;
} }
@Override
public boolean renderAsNormalBlock() { public boolean renderAsNormalBlock() {
return false; return false;
} }
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) { public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int i = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
if(i == 0) if(i == 0)
{ {

View File

@ -5,7 +5,6 @@ import java.util.Map;
import java.util.Random; import java.util.Random;
import com.hbm.entity.EntityNukeExplosionAdvanced; import com.hbm.entity.EntityNukeExplosionAdvanced;
import com.hbm.explosion.ExplosionNukeAdvanced;
import com.hbm.main.MainRegistry; import com.hbm.main.MainRegistry;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler; import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
@ -39,11 +38,13 @@ public class NukeFleija extends BlockContainer {
return new TileEntityNukeFleija(); return new TileEntityNukeFleija();
} }
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{ {
return Item.getItemFromBlock(ModBlocks.nuke_fleija); return Item.getItemFromBlock(ModBlocks.nuke_fleija);
} }
@Override
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
{ {
if (!keepInventory) if (!keepInventory)
@ -72,7 +73,7 @@ public class NukeFleija extends BlockContainer {
} }
itemstack.stackSize -= j1; itemstack.stackSize -= j1;
EntityItem entityitem = new EntityItem(p_149749_1_, (double)((float)p_149749_2_ + f), (double)((float)p_149749_3_ + f1), (double)((float)p_149749_4_ + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage())); EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
if (itemstack.hasTagCompound()) if (itemstack.hasTagCompound())
{ {
@ -80,9 +81,9 @@ public class NukeFleija extends BlockContainer {
} }
float f3 = 0.05F; float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F); entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
p_149749_1_.spawnEntityInWorld(entityitem); p_149749_1_.spawnEntityInWorld(entityitem);
} }
} }
@ -95,6 +96,7 @@ public class NukeFleija extends BlockContainer {
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
} }
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote) if(world.isRemote)
{ {
@ -112,6 +114,7 @@ public class NukeFleija extends BlockContainer {
} }
} }
@Override
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_) public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
{ {
TileEntityNukeFleija entity = (TileEntityNukeFleija) p_149695_1_.getTileEntity(x, y, z); TileEntityNukeFleija entity = (TileEntityNukeFleija) p_149695_1_.getTileEntity(x, y, z);
@ -150,20 +153,24 @@ public class NukeFleija extends BlockContainer {
return false; return false;
} }
@Override
public int getRenderType(){ public int getRenderType(){
return -1; return -1;
} }
@Override
public boolean isOpaqueCube() { public boolean isOpaqueCube() {
return false; return false;
} }
@Override
public boolean renderAsNormalBlock() { public boolean renderAsNormalBlock() {
return false; return false;
} }
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) { public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int i = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
if(i == 0) if(i == 0)
{ {

View File

@ -1,39 +1,26 @@
package com.hbm.blocks; package com.hbm.blocks;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Random; import java.util.Random;
import com.hbm.entity.EntityNukeCloudSmall; import com.hbm.entity.EntityNukeCloudSmall;
import com.hbm.entity.EntityNukeExplosion;
import com.hbm.entity.EntityNukeExplosionAdvanced; import com.hbm.entity.EntityNukeExplosionAdvanced;
import com.hbm.explosion.ExplosionNukeAdvanced;
import com.hbm.explosion.ExplosionNukeGeneric;
import com.hbm.main.MainRegistry; import com.hbm.main.MainRegistry;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler; import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer; import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.enchantment.EnchantmentProtection;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.inventory.ISidedInventory;
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.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.util.Vec3;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
public class NukeGadget extends BlockContainer { public class NukeGadget extends BlockContainer {
@ -54,11 +41,13 @@ public class NukeGadget extends BlockContainer {
} }
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{ {
return Item.getItemFromBlock(ModBlocks.nuke_gadget); return Item.getItemFromBlock(ModBlocks.nuke_gadget);
} }
@Override
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
{ {
if (!keepInventory) if (!keepInventory)
@ -87,7 +76,7 @@ public class NukeGadget extends BlockContainer {
} }
itemstack.stackSize -= j1; itemstack.stackSize -= j1;
EntityItem entityitem = new EntityItem(p_149749_1_, (double)((float)p_149749_2_ + f), (double)((float)p_149749_3_ + f1), (double)((float)p_149749_4_ + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage())); EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
if (itemstack.hasTagCompound()) if (itemstack.hasTagCompound())
{ {
@ -95,9 +84,9 @@ public class NukeGadget extends BlockContainer {
} }
float f3 = 0.05F; float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F); entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
p_149749_1_.spawnEntityInWorld(entityitem); p_149749_1_.spawnEntityInWorld(entityitem);
} }
} }
@ -110,6 +99,7 @@ public class NukeGadget extends BlockContainer {
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
} }
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote) if(world.isRemote)
{ {
@ -127,6 +117,7 @@ public class NukeGadget extends BlockContainer {
} }
} }
@Override
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_) public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
{ {
TileEntityNukeGadget entity = (TileEntityNukeGadget) p_149695_1_.getTileEntity(x, y, z); TileEntityNukeGadget entity = (TileEntityNukeGadget) p_149695_1_.getTileEntity(x, y, z);
@ -376,20 +367,24 @@ public class NukeGadget extends BlockContainer {
} }
}*/ }*/
@Override
public int getRenderType(){ public int getRenderType(){
return -1; return -1;
} }
@Override
public boolean isOpaqueCube() { public boolean isOpaqueCube() {
return false; return false;
} }
@Override
public boolean renderAsNormalBlock() { public boolean renderAsNormalBlock() {
return false; return false;
} }
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) { public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int i = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
if(i == 0) if(i == 0)
{ {

View File

@ -1,39 +1,26 @@
package com.hbm.blocks; package com.hbm.blocks;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Random; import java.util.Random;
import com.hbm.entity.EntityNukeCloudSmall; import com.hbm.entity.EntityNukeCloudSmall;
import com.hbm.entity.EntityNukeExplosion;
import com.hbm.entity.EntityNukeExplosionAdvanced; import com.hbm.entity.EntityNukeExplosionAdvanced;
import com.hbm.explosion.ExplosionNukeAdvanced;
import com.hbm.explosion.ExplosionNukeGeneric;
import com.hbm.main.MainRegistry; import com.hbm.main.MainRegistry;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler; import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer; import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.enchantment.EnchantmentProtection;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.inventory.ISidedInventory;
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.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.util.Vec3;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
public class NukeMan extends BlockContainer { public class NukeMan extends BlockContainer {
@ -53,11 +40,13 @@ public class NukeMan extends BlockContainer {
} }
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{ {
return Item.getItemFromBlock(ModBlocks.nuke_man); return Item.getItemFromBlock(ModBlocks.nuke_man);
} }
@Override
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
{ {
if (!keepInventory) if (!keepInventory)
@ -86,7 +75,7 @@ public class NukeMan extends BlockContainer {
} }
itemstack.stackSize -= j1; itemstack.stackSize -= j1;
EntityItem entityitem = new EntityItem(p_149749_1_, (double)((float)p_149749_2_ + f), (double)((float)p_149749_3_ + f1), (double)((float)p_149749_4_ + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage())); EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
if (itemstack.hasTagCompound()) if (itemstack.hasTagCompound())
{ {
@ -94,9 +83,9 @@ public class NukeMan extends BlockContainer {
} }
float f3 = 0.05F; float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F); entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
p_149749_1_.spawnEntityInWorld(entityitem); p_149749_1_.spawnEntityInWorld(entityitem);
} }
} }
@ -109,6 +98,7 @@ public class NukeMan extends BlockContainer {
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
} }
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote) if(world.isRemote)
{ {
@ -126,6 +116,7 @@ public class NukeMan extends BlockContainer {
} }
} }
@Override
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_) public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
{ {
TileEntityNukeMan entity = (TileEntityNukeMan) p_149695_1_.getTileEntity(x, y, z); TileEntityNukeMan entity = (TileEntityNukeMan) p_149695_1_.getTileEntity(x, y, z);
@ -375,20 +366,24 @@ public class NukeMan extends BlockContainer {
} }
}*/ }*/
@Override
public int getRenderType(){ public int getRenderType(){
return -1; return -1;
} }
@Override
public boolean isOpaqueCube() { public boolean isOpaqueCube() {
return false; return false;
} }
@Override
public boolean renderAsNormalBlock() { public boolean renderAsNormalBlock() {
return false; return false;
} }
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) { public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int i = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
if(i == 0) if(i == 0)
{ {

View File

@ -5,7 +5,6 @@ import java.util.Map;
import java.util.Random; import java.util.Random;
import com.hbm.entity.EntityNukeExplosionAdvanced; import com.hbm.entity.EntityNukeExplosionAdvanced;
import com.hbm.explosion.ExplosionNukeAdvanced;
import com.hbm.main.MainRegistry; import com.hbm.main.MainRegistry;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler; import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
@ -39,11 +38,13 @@ public class NukeMike extends BlockContainer {
return new TileEntityNukeMike(); return new TileEntityNukeMike();
} }
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{ {
return Item.getItemFromBlock(ModBlocks.nuke_mike); return Item.getItemFromBlock(ModBlocks.nuke_mike);
} }
@Override
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
{ {
if (!keepInventory) if (!keepInventory)
@ -72,7 +73,7 @@ public class NukeMike extends BlockContainer {
} }
itemstack.stackSize -= j1; itemstack.stackSize -= j1;
EntityItem entityitem = new EntityItem(p_149749_1_, (double)((float)p_149749_2_ + f), (double)((float)p_149749_3_ + f1), (double)((float)p_149749_4_ + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage())); EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
if (itemstack.hasTagCompound()) if (itemstack.hasTagCompound())
{ {
@ -80,9 +81,9 @@ public class NukeMike extends BlockContainer {
} }
float f3 = 0.05F; float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F); entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
p_149749_1_.spawnEntityInWorld(entityitem); p_149749_1_.spawnEntityInWorld(entityitem);
} }
} }
@ -95,6 +96,7 @@ public class NukeMike extends BlockContainer {
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
} }
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote) if(world.isRemote)
{ {
@ -112,6 +114,7 @@ public class NukeMike extends BlockContainer {
} }
} }
@Override
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_) public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
{ {
TileEntityNukeMike entity = (TileEntityNukeMike) p_149695_1_.getTileEntity(x, y, z); TileEntityNukeMike entity = (TileEntityNukeMike) p_149695_1_.getTileEntity(x, y, z);
@ -159,20 +162,24 @@ public class NukeMike extends BlockContainer {
return false; return false;
} }
@Override
public int getRenderType(){ public int getRenderType(){
return -1; return -1;
} }
@Override
public boolean isOpaqueCube() { public boolean isOpaqueCube() {
return false; return false;
} }
@Override
public boolean renderAsNormalBlock() { public boolean renderAsNormalBlock() {
return false; return false;
} }
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) { public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int i = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
if(i == 0) if(i == 0)
{ {

View File

@ -1,7 +1,6 @@
package com.hbm.blocks; package com.hbm.blocks;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Random; import java.util.Random;
@ -40,11 +39,13 @@ public class NukePrototype extends BlockContainer {
return new TileEntityNukePrototype(); return new TileEntityNukePrototype();
} }
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{ {
return Item.getItemFromBlock(ModBlocks.nuke_prototype); return Item.getItemFromBlock(ModBlocks.nuke_prototype);
} }
@Override
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
{ {
if (!keepInventory) if (!keepInventory)
@ -73,7 +74,7 @@ public class NukePrototype extends BlockContainer {
} }
itemstack.stackSize -= j1; itemstack.stackSize -= j1;
EntityItem entityitem = new EntityItem(p_149749_1_, (double)((float)p_149749_2_ + f), (double)((float)p_149749_3_ + f1), (double)((float)p_149749_4_ + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage())); EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
if (itemstack.hasTagCompound()) if (itemstack.hasTagCompound())
{ {
@ -81,9 +82,9 @@ public class NukePrototype extends BlockContainer {
} }
float f3 = 0.05F; float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F); entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
p_149749_1_.spawnEntityInWorld(entityitem); p_149749_1_.spawnEntityInWorld(entityitem);
} }
} }
@ -96,6 +97,7 @@ public class NukePrototype extends BlockContainer {
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
} }
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote) if(world.isRemote)
{ {
@ -123,6 +125,7 @@ public class NukePrototype extends BlockContainer {
} }
} }
@Override
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_) public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
{ {
TileEntityNukePrototype entity = (TileEntityNukePrototype) p_149695_1_.getTileEntity(x, y, z); TileEntityNukePrototype entity = (TileEntityNukePrototype) p_149695_1_.getTileEntity(x, y, z);
@ -161,20 +164,24 @@ public class NukePrototype extends BlockContainer {
return false; return false;
} }
@Override
public int getRenderType(){ public int getRenderType(){
return -1; return -1;
} }
@Override
public boolean isOpaqueCube() { public boolean isOpaqueCube() {
return false; return false;
} }
@Override
public boolean renderAsNormalBlock() { public boolean renderAsNormalBlock() {
return false; return false;
} }
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) { public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int i = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
if(i == 0) if(i == 0)
{ {

View File

@ -5,7 +5,6 @@ import java.util.Map;
import java.util.Random; import java.util.Random;
import com.hbm.entity.EntityNukeExplosionAdvanced; import com.hbm.entity.EntityNukeExplosionAdvanced;
import com.hbm.explosion.ExplosionNukeAdvanced;
import com.hbm.main.MainRegistry; import com.hbm.main.MainRegistry;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler; import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
@ -39,11 +38,13 @@ public class NukeTsar extends BlockContainer {
return new TileEntityNukeTsar(); return new TileEntityNukeTsar();
} }
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{ {
return Item.getItemFromBlock(ModBlocks.nuke_tsar); return Item.getItemFromBlock(ModBlocks.nuke_tsar);
} }
@Override
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
{ {
if (!keepInventory) if (!keepInventory)
@ -72,7 +73,7 @@ public class NukeTsar extends BlockContainer {
} }
itemstack.stackSize -= j1; itemstack.stackSize -= j1;
EntityItem entityitem = new EntityItem(p_149749_1_, (double)((float)p_149749_2_ + f), (double)((float)p_149749_3_ + f1), (double)((float)p_149749_4_ + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage())); EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
if (itemstack.hasTagCompound()) if (itemstack.hasTagCompound())
{ {
@ -80,9 +81,9 @@ public class NukeTsar extends BlockContainer {
} }
float f3 = 0.05F; float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F); entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
p_149749_1_.spawnEntityInWorld(entityitem); p_149749_1_.spawnEntityInWorld(entityitem);
} }
} }
@ -95,6 +96,7 @@ public class NukeTsar extends BlockContainer {
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
} }
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote) if(world.isRemote)
{ {
@ -112,6 +114,7 @@ public class NukeTsar extends BlockContainer {
} }
} }
@Override
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_) public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
{ {
TileEntityNukeTsar entity = (TileEntityNukeTsar) p_149695_1_.getTileEntity(x, y, z); TileEntityNukeTsar entity = (TileEntityNukeTsar) p_149695_1_.getTileEntity(x, y, z);
@ -159,20 +162,24 @@ public class NukeTsar extends BlockContainer {
return false; return false;
} }
@Override
public int getRenderType(){ public int getRenderType(){
return -1; return -1;
} }
@Override
public boolean isOpaqueCube() { public boolean isOpaqueCube() {
return false; return false;
} }
@Override
public boolean renderAsNormalBlock() { public boolean renderAsNormalBlock() {
return false; return false;
} }
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) { public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int i = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
if(i == 0) if(i == 0)
{ {

View File

@ -21,6 +21,7 @@ public class RedBarrel extends BlockContainer {
super(p_i45394_1_); super(p_i45394_1_);
} }
@Override
public void onBlockDestroyedByExplosion(World p_149723_1_, int p_149723_2_, int p_149723_3_, int p_149723_4_, Explosion p_149723_5_) public void onBlockDestroyedByExplosion(World p_149723_1_, int p_149723_2_, int p_149723_3_, int p_149723_4_, Explosion p_149723_5_)
{ {
if (!p_149723_1_.isRemote) if (!p_149723_1_.isRemote)
@ -29,6 +30,7 @@ public class RedBarrel extends BlockContainer {
} }
} }
@Override
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_) public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
{ {
if (p_149695_1_.getBlock(x + 1, y, z) == Blocks.fire || p_149695_1_.getBlock(x - 1, y, z) == Blocks.fire || p_149695_1_.getBlock(x, y + 1, z) == Blocks.fire || p_149695_1_.getBlock(x, y - 1, z) == Blocks.fire || p_149695_1_.getBlock(x, y, z + 1) == Blocks.fire || p_149695_1_.getBlock(x, y, z - 1) == Blocks.fire) if (p_149695_1_.getBlock(x + 1, y, z) == Blocks.fire || p_149695_1_.getBlock(x - 1, y, z) == Blocks.fire || p_149695_1_.getBlock(x, y + 1, z) == Blocks.fire || p_149695_1_.getBlock(x, y - 1, z) == Blocks.fire || p_149695_1_.getBlock(x, y, z + 1) == Blocks.fire || p_149695_1_.getBlock(x, y, z - 1) == Blocks.fire)
@ -39,37 +41,44 @@ public class RedBarrel extends BlockContainer {
public void explode(World p_149695_1_, int x, int y, int z) { public void explode(World p_149695_1_, int x, int y, int z) {
p_149695_1_.newExplosion((Entity)null, (double)((float)x + 0.5F), (double)((float)y + 0.5F), (double)((float)z + 0.5F), 2.5F, true, true); p_149695_1_.newExplosion((Entity)null, x + 0.5F, y + 0.5F, z + 0.5F, 2.5F, true, true);
} }
@Override
public int getRenderType(){ public int getRenderType(){
return -1; return -1;
} }
@Override
public boolean isOpaqueCube() { public boolean isOpaqueCube() {
return false; return false;
} }
@Override
public boolean renderAsNormalBlock() { public boolean renderAsNormalBlock() {
return false; return false;
} }
@Override
public TileEntity createNewTileEntity(World var1, int var2) { public TileEntity createNewTileEntity(World var1, int var2) {
return new TileEntityRedBarrel(); return new TileEntityRedBarrel();
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconregister) { public void registerBlockIcons(IIconRegister iconregister) {
this.blockIcon = iconregister.registerIcon(RefStrings.MODID + ":red_barrel"); this.blockIcon = iconregister.registerIcon(RefStrings.MODID + ":red_barrel");
} }
@Override
public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_)
{ {
float f = 0.0625F; float f = 0.0625F;
this.setBlockBounds(2*f, 0.0F, 2*f, 14*f, 1.0F, 14*f); this.setBlockBounds(2*f, 0.0F, 2*f, 14*f, 1.0F, 14*f);
} }
@Override
public boolean canDropFromExplosion(Explosion p_149659_1_) public boolean canDropFromExplosion(Explosion p_149659_1_)
{ {
return false; return false;

View File

@ -4,7 +4,6 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
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.init.Blocks;
import net.minecraft.util.Facing; import net.minecraft.util.Facing;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
@ -16,11 +15,13 @@ public class ReinforcedBlock extends Block {
super(p_i45394_1_); super(p_i45394_1_);
} }
@Override
public boolean isOpaqueCube() public boolean isOpaqueCube()
{ {
return false; return false;
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_)
{ {

View File

@ -6,7 +6,6 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
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.init.Blocks;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -27,6 +26,7 @@ public class ReinforcedLamp extends Block {
} }
} }
@Override
public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_)
{ {
if (!p_149726_1_.isRemote) if (!p_149726_1_.isRemote)
@ -42,6 +42,7 @@ public class ReinforcedLamp extends Block {
} }
} }
@Override
public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_)
{ {
if (!p_149695_1_.isRemote) if (!p_149695_1_.isRemote)
@ -57,6 +58,7 @@ public class ReinforcedLamp extends Block {
} }
} }
@Override
public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_)
{ {
if (!p_149674_1_.isRemote && this.field_150171_a && !p_149674_1_.isBlockIndirectlyGettingPowered(p_149674_2_, p_149674_3_, p_149674_4_)) if (!p_149674_1_.isRemote && this.field_150171_a && !p_149674_1_.isBlockIndirectlyGettingPowered(p_149674_2_, p_149674_3_, p_149674_4_))
@ -65,17 +67,20 @@ public class ReinforcedLamp extends Block {
} }
} }
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{ {
return Item.getItemFromBlock(ModBlocks.reinforced_lamp_off); return Item.getItemFromBlock(ModBlocks.reinforced_lamp_off);
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_)
{ {
return Item.getItemFromBlock(ModBlocks.reinforced_lamp_off); return Item.getItemFromBlock(ModBlocks.reinforced_lamp_off);
} }
@Override
protected ItemStack createStackedBlock(int p_149644_1_) protected ItemStack createStackedBlock(int p_149644_1_)
{ {
return new ItemStack(ModBlocks.reinforced_lamp_off); return new ItemStack(ModBlocks.reinforced_lamp_off);

View File

@ -2,11 +2,7 @@ package com.hbm.blocks;
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.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.util.ChatComponentText;
import net.minecraft.world.Explosion;
import net.minecraft.world.World; import net.minecraft.world.World;
public class TestBomb extends Block { public class TestBomb extends Block {
@ -20,6 +16,7 @@ public class TestBomb extends Block {
super(p_i45394_1_); super(p_i45394_1_);
} }
@Override
public void onBlockAdded(World world, int x, int y, int z) public void onBlockAdded(World world, int x, int y, int z)
{ {
super.onBlockAdded(world, x, y, z); super.onBlockAdded(world, x, y, z);
@ -36,6 +33,7 @@ public class TestBomb extends Block {
* Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are
* their own) Args: x, y, z, neighbor Block * their own) Args: x, y, z, neighbor Block
*/ */
@Override
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_) public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
{ {
if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z)) if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z))

View File

@ -32,39 +32,46 @@ public class TestBombAdvanced extends BlockContainer {
} }
//Nicht verfügbarer Rendertyp, setzt den Switch auf "Default" und ermöglicht einen Customrenderer //Nicht verfügbarer Rendertyp, setzt den Switch auf "Default" und ermöglicht einen Customrenderer
@Override
public int getRenderType(){ public int getRenderType(){
return -1; return -1;
} }
//Ob der Block transparent ist (Glas, Glowstone, Wasser, etc) //Ob der Block transparent ist (Glas, Glowstone, Wasser, etc)
@Override
public boolean isOpaqueCube() { public boolean isOpaqueCube() {
return false; return false;
} }
//"Default" beim Switch zum Rendern ermöglicht die Abfrage "renderAsNormalBlock", "true" um es als einen normalen Block rendern zu lassen, "false" für einen Customrenderer //"Default" beim Switch zum Rendern ermöglicht die Abfrage "renderAsNormalBlock", "true" um es als einen normalen Block rendern zu lassen, "false" für einen Customrenderer
@Override
public boolean renderAsNormalBlock() { public boolean renderAsNormalBlock() {
return false; return false;
} }
//Erstellen eines TileEntitys //Erstellen eines TileEntitys
@Override
public TileEntity createNewTileEntity(World var1, int var2) { public TileEntity createNewTileEntity(World var1, int var2) {
return new TileEntityTestBombAdvanced(); return new TileEntityTestBombAdvanced();
} }
//GUI Blocktextur muss für Custommodel-Blocke nachträglich geändert werden //GUI Blocktextur muss für Custommodel-Blocke nachträglich geändert werden
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconregister) { public void registerBlockIcons(IIconRegister iconregister) {
this.blockIcon = iconregister.registerIcon(RefStrings.MODID + ":test_render"); this.blockIcon = iconregister.registerIcon(RefStrings.MODID + ":test_render");
} }
//Setzt die Blockkollisionsbox (xMin, yMin, zMin, xMax, yMax, zMax) //Setzt die Blockkollisionsbox (xMin, yMin, zMin, xMax, yMax, zMax)
@Override
public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_)
{ {
float f = 0.0625F; float f = 0.0625F;
this.setBlockBounds(4*f, 0.0F, 0.0F, 12*f, 8*f, 1.0F); this.setBlockBounds(4*f, 0.0F, 0.0F, 12*f, 8*f, 1.0F);
} }
@Override
public void onBlockAdded(World world, int x, int y, int z) public void onBlockAdded(World world, int x, int y, int z)
{ {
super.onBlockAdded(world, x, y, z); super.onBlockAdded(world, x, y, z);
@ -77,6 +84,7 @@ public class TestBombAdvanced extends BlockContainer {
} }
} }
@Override
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_) public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
{ {
if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z)) if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z))

View File

@ -11,7 +11,6 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockChest; import net.minecraft.block.BlockChest;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@ -35,6 +34,7 @@ public class TestContainer extends BlockChest {
private final Random field_149955_b = new Random(); private final Random field_149955_b = new Random();
//Aktiviert durch: Platzieren. Bewirkt: Rotation des Blockes in Blickrichtung //Aktiviert durch: Platzieren. Bewirkt: Rotation des Blockes in Blickrichtung
@Override
public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_)
{ {
Block block = p_149689_1_.getBlock(p_149689_2_, p_149689_3_, p_149689_4_ - 1); Block block = p_149689_1_.getBlock(p_149689_2_, p_149689_3_, p_149689_4_ - 1);
@ -42,7 +42,7 @@ public class TestContainer extends BlockChest {
Block block2 = p_149689_1_.getBlock(p_149689_2_ - 1, p_149689_3_, p_149689_4_); Block block2 = p_149689_1_.getBlock(p_149689_2_ - 1, p_149689_3_, p_149689_4_);
Block block3 = p_149689_1_.getBlock(p_149689_2_ + 1, p_149689_3_, p_149689_4_); Block block3 = p_149689_1_.getBlock(p_149689_2_ + 1, p_149689_3_, p_149689_4_);
byte b0 = 0; byte b0 = 0;
int l = MathHelper.floor_double((double)(p_149689_5_.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; int l = MathHelper.floor_double(p_149689_5_.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
if (l == 0) if (l == 0)
{ {
@ -106,6 +106,7 @@ public class TestContainer extends BlockChest {
} }
//Aktiviert durch: Blockupdate. Bewirkt: Verbinden zweier Kisten //Aktiviert durch: Blockupdate. Bewirkt: Verbinden zweier Kisten
@Override
public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_)
{ {
super.onNeighborBlockChange(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, p_149695_5_); super.onNeighborBlockChange(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, p_149695_5_);
@ -118,6 +119,7 @@ public class TestContainer extends BlockChest {
} }
//Aktiviert durch: Zerstörung. Bewirkt: Droppt alle in ihm befindlichen Items //Aktiviert durch: Zerstörung. Bewirkt: Droppt alle in ihm befindlichen Items
@Override
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
{ {
TileEntityTestContainer tileentitychest = (TileEntityTestContainer)p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_); TileEntityTestContainer tileentitychest = (TileEntityTestContainer)p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_);
@ -144,11 +146,11 @@ public class TestContainer extends BlockChest {
} }
itemstack.stackSize -= j1; itemstack.stackSize -= j1;
entityitem = new EntityItem(p_149749_1_, (double)((float)p_149749_2_ + f), (double)((float)p_149749_3_ + f1), (double)((float)p_149749_4_ + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage())); entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
float f3 = 0.05F; float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149955_b.nextGaussian() * f3); entityitem.motionX = (float)this.field_149955_b.nextGaussian() * f3;
entityitem.motionY = (double)((float)this.field_149955_b.nextGaussian() * f3 + 0.2F); entityitem.motionY = (float)this.field_149955_b.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (double)((float)this.field_149955_b.nextGaussian() * f3); entityitem.motionZ = (float)this.field_149955_b.nextGaussian() * f3;
if (itemstack.hasTagCompound()) if (itemstack.hasTagCompound())
{ {
@ -165,9 +167,10 @@ public class TestContainer extends BlockChest {
} }
//Allgemeine Inventarfunktion //Allgemeine Inventarfunktion
@Override
public IInventory func_149951_m(World p_149951_1_, int p_149951_2_, int p_149951_3_, int p_149951_4_) public IInventory func_149951_m(World p_149951_1_, int p_149951_2_, int p_149951_3_, int p_149951_4_)
{ {
Object object = (TileEntityTestContainer)p_149951_1_.getTileEntity(p_149951_2_, p_149951_3_, p_149951_4_); Object object = p_149951_1_.getTileEntity(p_149951_2_, p_149951_3_, p_149951_4_);
if (object == null) if (object == null)
{ {
@ -226,7 +229,7 @@ public class TestContainer extends BlockChest {
//Bewirkt, dass sich Katzen draufsetzen //Bewirkt, dass sich Katzen draufsetzen
private static boolean func_149953_o(World p_149953_0_, int p_149953_1_, int p_149953_2_, int p_149953_3_) private static boolean func_149953_o(World p_149953_0_, int p_149953_1_, int p_149953_2_, int p_149953_3_)
{ {
Iterator iterator = p_149953_0_.getEntitiesWithinAABB(EntityOcelot.class, AxisAlignedBB.getBoundingBox((double)p_149953_1_, (double)(p_149953_2_ + 1), (double)p_149953_3_, (double)(p_149953_1_ + 1), (double)(p_149953_2_ + 2), (double)(p_149953_3_ + 1))).iterator(); Iterator iterator = p_149953_0_.getEntitiesWithinAABB(EntityOcelot.class, AxisAlignedBB.getBoundingBox(p_149953_1_, p_149953_2_ + 1, p_149953_3_, p_149953_1_ + 1, p_149953_2_ + 2, p_149953_3_ + 1)).iterator();
EntityOcelot entityocelot; EntityOcelot entityocelot;
do do
@ -245,6 +248,7 @@ public class TestContainer extends BlockChest {
} }
//Erzeugt ein neues Tileentity //Erzeugt ein neues Tileentity
@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_)
{ {
TileEntityTestContainer tileentitychest = new TileEntityTestContainer(); TileEntityTestContainer tileentitychest = new TileEntityTestContainer();
@ -252,6 +256,7 @@ public class TestContainer extends BlockChest {
} }
//Registriert das Inventaricon //Registriert das Inventaricon
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister p_149651_1_) public void registerBlockIcons(IIconRegister p_149651_1_)
{ {

View File

@ -6,32 +6,15 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Random; import java.util.Random;
import com.hbm.entity.EntityNuclearCreeper;
import com.hbm.entity.EntityNukeExplosion;
import com.hbm.entity.EntityNukeExplosionAdvanced;
import com.hbm.explosion.ExplosionChaos; import com.hbm.explosion.ExplosionChaos;
import com.hbm.explosion.ExplosionNukeAdvanced;
import com.hbm.main.MainRegistry;
import com.hbm.particles.NukeCloudFX;
import com.hbm.particles.NukeSmokeFX;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
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.client.Minecraft;
import net.minecraft.client.particle.EntitySmokeFX;
import net.minecraft.enchantment.EnchantmentProtection; import net.minecraft.enchantment.EnchantmentProtection;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityFallingBlock;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.util.Vec3; import net.minecraft.util.Vec3;
import net.minecraft.world.ChunkPosition;
import net.minecraft.world.World; import net.minecraft.world.World;
public class TestEventTester extends Block { public class TestEventTester extends Block {
@ -44,6 +27,7 @@ public class TestEventTester extends Block {
protected static Random itemRand = new Random(); protected static Random itemRand = new Random();
public World worldObj; public World worldObj;
@Override
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_) public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
{ {
this.worldObj = p_149695_1_; this.worldObj = p_149695_1_;
@ -83,6 +67,7 @@ public class TestEventTester extends Block {
} }
}*/ }*/
@Override
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{ {
/*double d = (float)par2 + 0.5F; /*double d = (float)par2 + 0.5F;
@ -133,7 +118,7 @@ public class TestEventTester extends Block {
public void killEvent(World world, int x, int y, int z) { public void killEvent(World world, int x, int y, int z) {
world.playSoundEffect((double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, "random.break", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F); world.playSoundEffect(x + 0.5D, y + 0.5D, z + 0.5D, "random.break", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
float f = this.explosionSize; float f = this.explosionSize;
HashSet hashset = new HashSet(); HashSet hashset = new HashSet();
int i; int i;
@ -152,28 +137,28 @@ public class TestEventTester extends Block {
int i2 = MathHelper.floor_double(y + wat + 1.0D); int i2 = MathHelper.floor_double(y + wat + 1.0D);
int l = MathHelper.floor_double(z - wat - 1.0D); int l = MathHelper.floor_double(z - wat - 1.0D);
int j2 = MathHelper.floor_double(z + wat + 1.0D); int j2 = MathHelper.floor_double(z + wat + 1.0D);
List list = world.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox((double)i, (double)k, (double)l, (double)j, (double)i2, (double)j2)); List list = world.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox(i, k, l, j, i2, j2));
Vec3 vec3 = Vec3.createVectorHelper(x, y, z); Vec3 vec3 = Vec3.createVectorHelper(x, y, z);
Vec3 vec4 = Vec3.createVectorHelper(x, y + 1, z); Vec3 vec4 = Vec3.createVectorHelper(x, y + 1, z);
for (int i1 = 0; i1 < list.size(); ++i1) for (int i1 = 0; i1 < list.size(); ++i1)
{ {
Entity entity = (Entity)list.get(i1); Entity entity = (Entity)list.get(i1);
double d4 = entity.getDistance(x, y, z) / (double)this.explosionSize; double d4 = entity.getDistance(x, y, z) / this.explosionSize;
if (d4 <= 1.0D) if (d4 <= 1.0D)
{ {
d5 = entity.posX - x; d5 = entity.posX - x;
d6 = entity.posY + (double)entity.getEyeHeight() - y; d6 = entity.posY + entity.getEyeHeight() - y;
d7 = entity.posZ - z; d7 = entity.posZ - z;
double d9 = (double)MathHelper.sqrt_double(d5 * d5 + d6 * d6 + d7 * d7); double d9 = MathHelper.sqrt_double(d5 * d5 + d6 * d6 + d7 * d7);
if (d9 < wat) if (d9 < wat)
{ {
d5 /= d9; d5 /= d9;
d6 /= d9; d6 /= d9;
d7 /= d9; d7 /= d9;
double d10 = (double)world.getBlockDensity(vec4, entity.boundingBox); double d10 = world.getBlockDensity(vec4, entity.boundingBox);
double d11 = (1.0D - d4) * d10; double d11 = (1.0D - d4) * d10;
//entity.attackEntityFrom(DamageSource.generic, (float)(100 - d9/wat*100/d10)); //entity.attackEntityFrom(DamageSource.generic, (float)(100 - d9/wat*100/d10));
@ -191,7 +176,7 @@ public class TestEventTester extends Block {
if (entity instanceof EntityPlayer) if (entity instanceof EntityPlayer)
{ {
this.field_77288_k.put((EntityPlayer)entity, Vec3.createVectorHelper(d5 * d11, d6 * d11, d7 * d11)); this.field_77288_k.put(entity, Vec3.createVectorHelper(d5 * d11, d6 * d11, d7 * d11));
} }
} }
} }

View File

@ -1,12 +1,8 @@
package com.hbm.blocks; package com.hbm.blocks;
import com.hbm.entity.EntityTestMissile; import com.hbm.entity.EntityTestMissile;
import com.hbm.main.MainRegistry;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
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.player.EntityPlayer;
import net.minecraft.world.World; import net.minecraft.world.World;
public class TestMissile extends Block { public class TestMissile extends Block {
@ -15,6 +11,7 @@ public class TestMissile extends Block {
super(p_i45394_1_); super(p_i45394_1_);
} }
@Override
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_) public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
{ {
TileEntityTestNuke entity = (TileEntityTestNuke) p_149695_1_.getTileEntity(x, y, z); TileEntityTestNuke entity = (TileEntityTestNuke) p_149695_1_.getTileEntity(x, y, z);

View File

@ -9,15 +9,12 @@ import java.util.Random;
import com.hbm.main.MainRegistry; import com.hbm.main.MainRegistry;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler; import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer; import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.enchantment.EnchantmentProtection; import net.minecraft.enchantment.EnchantmentProtection;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.passive.EntityOcelot;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.item.Item; import net.minecraft.item.Item;
@ -51,11 +48,13 @@ public class TestNuke extends BlockContainer {
} }
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{ {
return Item.getItemFromBlock(ModBlocks.test_nuke); return Item.getItemFromBlock(ModBlocks.test_nuke);
} }
@Override
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
{ {
if (!keepInventory) if (!keepInventory)
@ -84,7 +83,7 @@ public class TestNuke extends BlockContainer {
} }
itemstack.stackSize -= j1; itemstack.stackSize -= j1;
EntityItem entityitem = new EntityItem(p_149749_1_, (double)((float)p_149749_2_ + f), (double)((float)p_149749_3_ + f1), (double)((float)p_149749_4_ + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage())); EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
if (itemstack.hasTagCompound()) if (itemstack.hasTagCompound())
{ {
@ -92,9 +91,9 @@ public class TestNuke extends BlockContainer {
} }
float f3 = 0.05F; float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F); entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3); entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
p_149749_1_.spawnEntityInWorld(entityitem); p_149749_1_.spawnEntityInWorld(entityitem);
} }
} }
@ -107,6 +106,7 @@ public class TestNuke extends BlockContainer {
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
} }
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote) if(world.isRemote)
{ {
@ -124,6 +124,7 @@ public class TestNuke extends BlockContainer {
} }
} }
@Override
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_) public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
{ {
TileEntityTestNuke entity = (TileEntityTestNuke) p_149695_1_.getTileEntity(x, y, z); TileEntityTestNuke entity = (TileEntityTestNuke) p_149695_1_.getTileEntity(x, y, z);
@ -203,29 +204,29 @@ public class TestNuke extends BlockContainer {
int i2 = MathHelper.floor_double(y + wat + 1.0D); int i2 = MathHelper.floor_double(y + wat + 1.0D);
int l = MathHelper.floor_double(z - wat - 1.0D); int l = MathHelper.floor_double(z - wat - 1.0D);
int j2 = MathHelper.floor_double(z + wat + 1.0D); int j2 = MathHelper.floor_double(z + wat + 1.0D);
List list = world.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox((double)i, (double)k, (double)l, (double)j, (double)i2, (double)j2)); List list = world.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox(i, k, l, j, i2, j2));
Vec3 vec3 = Vec3.createVectorHelper(x, y, z); Vec3 vec3 = Vec3.createVectorHelper(x, y, z);
for (int i1 = 0; i1 < list.size(); ++i1) for (int i1 = 0; i1 < list.size(); ++i1)
{ {
Entity entity = (Entity)list.get(i1); Entity entity = (Entity)list.get(i1);
double d4 = entity.getDistance(x, y, z) / (double)bombStartStrength; double d4 = entity.getDistance(x, y, z) / bombStartStrength;
if (d4 <= 1.0D) if (d4 <= 1.0D)
{ {
d5 = entity.posX - x; d5 = entity.posX - x;
d6 = entity.posY + (double)entity.getEyeHeight() - y; d6 = entity.posY + entity.getEyeHeight() - y;
d7 = entity.posZ - z; d7 = entity.posZ - z;
double d9 = (double)MathHelper.sqrt_double(d5 * d5 + d6 * d6 + d7 * d7); double d9 = MathHelper.sqrt_double(d5 * d5 + d6 * d6 + d7 * d7);
if (d9 < wat) if (d9 < wat)
{ {
d5 /= d9; d5 /= d9;
d6 /= d9; d6 /= d9;
d7 /= d9; d7 /= d9;
double d10 = (double)world.getBlockDensity(vec3, entity.boundingBox); double d10 = world.getBlockDensity(vec3, entity.boundingBox);
double d11 = (1.0D - d4);// * d10; double d11 = (1.0D - d4);// * d10;
entity.attackEntityFrom(DamageSource.generic, (float)((int)((d11 * d11 + d11) / 2.0D * 8.0D * (double)bombStartStrength + 1.0D))); entity.attackEntityFrom(DamageSource.generic, ((int)((d11 * d11 + d11) / 2.0D * 8.0D * bombStartStrength + 1.0D)));
double d8 = EnchantmentProtection.func_92092_a(entity, d11); double d8 = EnchantmentProtection.func_92092_a(entity, d11);
entity.motionX += d5 * d8; entity.motionX += d5 * d8;
entity.motionY += d6 * d8; entity.motionY += d6 * d8;
@ -233,7 +234,7 @@ public class TestNuke extends BlockContainer {
if (entity instanceof EntityPlayer) if (entity instanceof EntityPlayer)
{ {
this.field_77288_k.put((EntityPlayer)entity, Vec3.createVectorHelper(d5 * d11, d6 * d11, d7 * d11)); this.field_77288_k.put(entity, Vec3.createVectorHelper(d5 * d11, d6 * d11, d7 * d11));
} }
} }
} }

View File

@ -11,7 +11,6 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
public class TestObjTester extends BlockContainer{ public class TestObjTester extends BlockContainer{
@ -20,23 +19,28 @@ public class TestObjTester extends BlockContainer{
super(p_i45394_1_); super(p_i45394_1_);
} }
@Override
public int getRenderType(){ public int getRenderType(){
return -1; return -1;
} }
@Override
public boolean isOpaqueCube() { public boolean isOpaqueCube() {
return false; return false;
} }
@Override
public boolean renderAsNormalBlock() { public boolean renderAsNormalBlock() {
return false; return false;
} }
@Override
public TileEntity createNewTileEntity(World var1, int var2) { public TileEntity createNewTileEntity(World var1, int var2) {
return new TileEntityObjTester(); return new TileEntityObjTester();
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconregister) { public void registerBlockIcons(IIconRegister iconregister) {
this.blockIcon = iconregister.registerIcon(RefStrings.MODID + ":test_render"); this.blockIcon = iconregister.registerIcon(RefStrings.MODID + ":test_render");
@ -48,8 +52,9 @@ public class TestObjTester extends BlockContainer{
this.setBlockBounds(2*f, 0.0F, 2*f, 14*f, 1.0F, 14*f); this.setBlockBounds(2*f, 0.0F, 2*f, 14*f, 1.0F, 14*f);
}*/ }*/
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) { public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int i = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
if(i == 0) if(i == 0)
{ {

View File

@ -3,7 +3,6 @@ package com.hbm.blocks;
import com.hbm.lib.RefStrings; import com.hbm.lib.RefStrings;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer; import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
@ -25,33 +24,39 @@ public class TestRender extends BlockContainer {
} }
//Nicht verfügbarer Rendertyp, setzt den Switch auf "Default" und ermöglicht einen Customrenderer //Nicht verfügbarer Rendertyp, setzt den Switch auf "Default" und ermöglicht einen Customrenderer
@Override
public int getRenderType(){ public int getRenderType(){
return -1; return -1;
} }
//Ob der Block transparent ist (Glas, Glowstone, Wasser, etc) //Ob der Block transparent ist (Glas, Glowstone, Wasser, etc)
@Override
public boolean isOpaqueCube() { public boolean isOpaqueCube() {
return false; return false;
} }
//"Default" beim Switch zum Rendern ermöglicht die Abfrage "renderAsNormalBlock", "true" um es als einen normalen Block rendern zu lassen, "false" für einen Customrenderer //"Default" beim Switch zum Rendern ermöglicht die Abfrage "renderAsNormalBlock", "true" um es als einen normalen Block rendern zu lassen, "false" für einen Customrenderer
@Override
public boolean renderAsNormalBlock() { public boolean renderAsNormalBlock() {
return false; return false;
} }
//Erstellen eines TileEntitys //Erstellen eines TileEntitys
@Override
public TileEntity createNewTileEntity(World var1, int var2) { public TileEntity createNewTileEntity(World var1, int var2) {
return new TileEntityTestRender(); return new TileEntityTestRender();
} }
//GUI Blocktextur muss für Custommodel-Blocke nachträglich geändert werden //GUI Blocktextur muss für Custommodel-Blocke nachträglich geändert werden
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconregister) { public void registerBlockIcons(IIconRegister iconregister) {
this.blockIcon = iconregister.registerIcon(RefStrings.MODID + ":test_render"); this.blockIcon = iconregister.registerIcon(RefStrings.MODID + ":test_render");
} }
//Setzt die Blockkollisionsbox (xMin, yMin, zMin, xMax, yMax, zMax) //Setzt die Blockkollisionsbox (xMin, yMin, zMin, xMax, yMax, zMax)
@Override
public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_)
{ {
float f = 0.0625F; float f = 0.0625F;

View File

@ -11,7 +11,6 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
public class TestRotationTester extends BlockContainer { public class TestRotationTester extends BlockContainer {
@ -20,30 +19,36 @@ public class TestRotationTester extends BlockContainer {
super(p_i45394_1_); super(p_i45394_1_);
} }
@Override
public int getRenderType(){ public int getRenderType(){
return -1; return -1;
} }
@Override
public boolean isOpaqueCube() { public boolean isOpaqueCube() {
return false; return false;
} }
@Override
public boolean renderAsNormalBlock() { public boolean renderAsNormalBlock() {
return false; return false;
} }
@Override
public TileEntity createNewTileEntity(World var1, int var2) { public TileEntity createNewTileEntity(World var1, int var2) {
return new TileEntityRotationTester(); return new TileEntityRotationTester();
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconregister) { public void registerBlockIcons(IIconRegister iconregister) {
this.blockIcon = iconregister.registerIcon(RefStrings.MODID + ":test_render"); this.blockIcon = iconregister.registerIcon(RefStrings.MODID + ":test_render");
} }
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) { public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int i = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
if(i == 0) if(i == 0)
{ {

View File

@ -2,12 +2,8 @@ package com.hbm.blocks;
import java.util.Random; import java.util.Random;
import com.hbm.particles.NukeSmokeFX;
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.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World; import net.minecraft.world.World;
public class TestTicker extends Block { public class TestTicker extends Block {
@ -17,6 +13,7 @@ public class TestTicker extends Block {
this.setTickRandomly(true); this.setTickRandomly(true);
} }
@Override
public void updateTick(World world, int x, int y, int z, Random rand) { public void updateTick(World world, int x, int y, int z, Random rand) {
{ {

View File

@ -100,7 +100,7 @@ public class TileEntityBombMulti extends TileEntity implements ISidedInventory {
{ {
return false; return false;
}else{ }else{
return player.getDistanceSq((double) xCoord + 0.5D, (double) yCoord + 0.5D, (double) zCoord + 0.5D) <=64; return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <=64;
} }
} }
@ -134,6 +134,7 @@ public class TileEntityBombMulti extends TileEntity implements ISidedInventory {
return j != 0 || i != 1 || itemStack.getItem() == Items.bucket; return j != 0 || i != 1 || itemStack.getItem() == Items.bucket;
} }
@Override
public void readFromNBT(NBTTagCompound nbt) { public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt); super.readFromNBT(nbt);
NBTTagList list = nbt.getTagList("items", 10); NBTTagList list = nbt.getTagList("items", 10);
@ -141,7 +142,7 @@ public class TileEntityBombMulti extends TileEntity implements ISidedInventory {
for(int i = 0; i < list.tagCount(); i++) for(int i = 0; i < list.tagCount(); i++)
{ {
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i); NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot"); byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length) if(b0 >= 0 && b0 < slots.length)
{ {
@ -150,6 +151,7 @@ public class TileEntityBombMulti extends TileEntity implements ISidedInventory {
} }
} }
@Override
public void writeToNBT(NBTTagCompound nbt) { public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt); super.writeToNBT(nbt);
NBTTagList list = new NBTTagList(); NBTTagList list = new NBTTagList();
@ -263,6 +265,6 @@ public class TileEntityBombMulti extends TileEntity implements ISidedInventory {
@Override @Override
public AxisAlignedBB getRenderBoundingBox() { public AxisAlignedBB getRenderBoundingBox() {
return this.INFINITE_EXTENT_AABB; return TileEntity.INFINITE_EXTENT_AABB;
} }
} }

View File

@ -7,7 +7,7 @@ public class TileEntityDecoBlock extends TileEntity {
@Override @Override
public AxisAlignedBB getRenderBoundingBox() { public AxisAlignedBB getRenderBoundingBox() {
return this.INFINITE_EXTENT_AABB; return TileEntity.INFINITE_EXTENT_AABB;
} }
} }

View File

@ -7,7 +7,7 @@ public class TileEntityDecoBlockAlt extends TileEntity {
@Override @Override
public AxisAlignedBB getRenderBoundingBox() { public AxisAlignedBB getRenderBoundingBox() {
return this.INFINITE_EXTENT_AABB; return TileEntity.INFINITE_EXTENT_AABB;
} }
} }

View File

@ -3,12 +3,7 @@ package com.hbm.blocks;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import com.hbm.entity.EntityNuclearCreeper;
import com.hbm.lib.Library;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.Potion; import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect; import net.minecraft.potion.PotionEffect;
@ -19,6 +14,7 @@ import net.minecraft.util.Vec3;
public class TileEntityDecoBlockAltF extends TileEntity { public class TileEntityDecoBlockAltF extends TileEntity {
@Override
public void updateEntity() { public void updateEntity() {
int strength = 4; int strength = 4;
float f = strength; float f = strength;
@ -40,20 +36,20 @@ public class TileEntityDecoBlockAltF extends TileEntity {
int i2 = MathHelper.floor_double(this.yCoord + wat + 1.0D); int i2 = MathHelper.floor_double(this.yCoord + wat + 1.0D);
int l = MathHelper.floor_double(this.zCoord - wat - 1.0D); int l = MathHelper.floor_double(this.zCoord - wat - 1.0D);
int j2 = MathHelper.floor_double(this.zCoord + wat + 1.0D); int j2 = MathHelper.floor_double(this.zCoord + wat + 1.0D);
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox((double)i, (double)k, (double)l, (double)j, (double)i2, (double)j2)); List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox(i, k, l, j, i2, j2));
Vec3 vec3 = Vec3.createVectorHelper(this.xCoord, this.yCoord, this.zCoord); Vec3 vec3 = Vec3.createVectorHelper(this.xCoord, this.yCoord, this.zCoord);
for (int i1 = 0; i1 < list.size(); ++i1) for (int i1 = 0; i1 < list.size(); ++i1)
{ {
Entity entity = (Entity)list.get(i1); Entity entity = (Entity)list.get(i1);
double d4 = entity.getDistance(this.xCoord, this.yCoord, this.zCoord) / (double)4; double d4 = entity.getDistance(this.xCoord, this.yCoord, this.zCoord) / 4;
if (d4 <= 1.0D) if (d4 <= 1.0D)
{ {
d5 = entity.posX - this.xCoord; d5 = entity.posX - this.xCoord;
d6 = entity.posY + (double)entity.getEyeHeight() - this.yCoord; d6 = entity.posY + entity.getEyeHeight() - this.yCoord;
d7 = entity.posZ - this.zCoord; d7 = entity.posZ - this.zCoord;
double d9 = (double)MathHelper.sqrt_double(d5 * d5 + d6 * d6 + d7 * d7); double d9 = MathHelper.sqrt_double(d5 * d5 + d6 * d6 + d7 * d7);
if (d9 < wat) if (d9 < wat)
{ {
if(entity instanceof EntityPlayer) { if(entity instanceof EntityPlayer) {
@ -69,6 +65,6 @@ public class TileEntityDecoBlockAltF extends TileEntity {
@Override @Override
public AxisAlignedBB getRenderBoundingBox() { public AxisAlignedBB getRenderBoundingBox() {
return this.INFINITE_EXTENT_AABB; return TileEntity.INFINITE_EXTENT_AABB;
} }
} }

View File

@ -7,7 +7,7 @@ public class TileEntityDecoBlockAltG extends TileEntity {
@Override @Override
public AxisAlignedBB getRenderBoundingBox() { public AxisAlignedBB getRenderBoundingBox() {
return this.INFINITE_EXTENT_AABB; return TileEntity.INFINITE_EXTENT_AABB;
} }
} }

View File

@ -7,7 +7,7 @@ public class TileEntityDecoBlockAltW extends TileEntity {
@Override @Override
public AxisAlignedBB getRenderBoundingBox() { public AxisAlignedBB getRenderBoundingBox() {
return this.INFINITE_EXTENT_AABB; return TileEntity.INFINITE_EXTENT_AABB;
} }
} }

View File

@ -3,11 +3,9 @@ package com.hbm.blocks;
import com.hbm.gui.MachineRecipes; import com.hbm.gui.MachineRecipes;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import net.minecraft.block.BlockFurnace;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory; import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -91,12 +89,14 @@ public class TileEntityDiFurnace extends TileEntity implements ISidedInventory {
{ {
return false; return false;
}else{ }else{
return player.getDistanceSq((double) xCoord + 0.5D, (double) yCoord + 0.5D, (double) zCoord + 0.5D) <=64; return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <=64;
} }
} }
//You scrubs aren't needed for anything (right now) //You scrubs aren't needed for anything (right now)
@Override
public void openInventory() {} public void openInventory() {}
@Override
public void closeInventory() {} public void closeInventory() {}
@Override @Override
@ -128,6 +128,7 @@ public class TileEntityDiFurnace extends TileEntity implements ISidedInventory {
} }
} }
@Override
public ItemStack decrStackSize(int i, int j) { public ItemStack decrStackSize(int i, int j) {
if(slots[i] != null) if(slots[i] != null)
{ {
@ -149,6 +150,7 @@ public class TileEntityDiFurnace extends TileEntity implements ISidedInventory {
} }
} }
@Override
public void readFromNBT(NBTTagCompound nbt) { public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt); super.readFromNBT(nbt);
NBTTagList list = nbt.getTagList("items", 10); NBTTagList list = nbt.getTagList("items", 10);
@ -160,7 +162,7 @@ public class TileEntityDiFurnace extends TileEntity implements ISidedInventory {
for(int i = 0; i < list.tagCount(); i++) for(int i = 0; i < list.tagCount(); i++)
{ {
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i); NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot"); byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length) if(b0 >= 0 && b0 < slots.length)
{ {
@ -169,6 +171,7 @@ public class TileEntityDiFurnace extends TileEntity implements ISidedInventory {
} }
} }
@Override
public void writeToNBT(NBTTagCompound nbt) { public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt); super.writeToNBT(nbt);
nbt.setShort("powerTime", (short) dualPower); nbt.setShort("powerTime", (short) dualPower);
@ -275,6 +278,7 @@ public class TileEntityDiFurnace extends TileEntity implements ISidedInventory {
return this.dualCookTime > 0; return this.dualCookTime > 0;
} }
@Override
public void updateEntity() { public void updateEntity() {
boolean flag = this.hasPower(); boolean flag = this.hasPower();
boolean flag1 = false; boolean flag1 = false;
@ -298,7 +302,7 @@ public class TileEntityDiFurnace extends TileEntity implements ISidedInventory {
//if(!worldObj.isRemote) //if(!worldObj.isRemote)
{ {
if(this.hasItemPower(this.slots[2]) && this.dualPower <= (this.maxPower - this.getItemPower(this.slots[2]))) if(this.hasItemPower(this.slots[2]) && this.dualPower <= (TileEntityDiFurnace.maxPower - TileEntityDiFurnace.getItemPower(this.slots[2])))
{ {
this.dualPower += getItemPower(this.slots[2]); this.dualPower += getItemPower(this.slots[2]);
if(this.slots[2] != null) if(this.slots[2] != null)
@ -327,7 +331,7 @@ public class TileEntityDiFurnace extends TileEntity implements ISidedInventory {
{ {
dualCookTime++; dualCookTime++;
if(this.dualCookTime == this.processingSpeed) if(this.dualCookTime == TileEntityDiFurnace.processingSpeed)
{ {
this.dualCookTime = 0; this.dualCookTime = 0;
this.processItem(); this.processItem();

View File

@ -91,12 +91,14 @@ public class TileEntityLaunchPad extends TileEntity implements ISidedInventory {
{ {
return false; return false;
}else{ }else{
return player.getDistanceSq((double) xCoord + 0.5D, (double) yCoord + 0.5D, (double) zCoord + 0.5D) <=64; return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <=64;
} }
} }
//You scrubs aren't needed for anything (right now) //You scrubs aren't needed for anything (right now)
@Override
public void openInventory() {} public void openInventory() {}
@Override
public void closeInventory() {} public void closeInventory() {}
@Override @Override
@ -104,6 +106,7 @@ public class TileEntityLaunchPad extends TileEntity implements ISidedInventory {
return true; return true;
} }
@Override
public ItemStack decrStackSize(int i, int j) { public ItemStack decrStackSize(int i, int j) {
if(slots[i] != null) if(slots[i] != null)
{ {
@ -125,6 +128,7 @@ public class TileEntityLaunchPad extends TileEntity implements ISidedInventory {
} }
} }
@Override
public void readFromNBT(NBTTagCompound nbt) { public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt); super.readFromNBT(nbt);
NBTTagList list = nbt.getTagList("items", 10); NBTTagList list = nbt.getTagList("items", 10);
@ -134,7 +138,7 @@ public class TileEntityLaunchPad extends TileEntity implements ISidedInventory {
for(int i = 0; i < list.tagCount(); i++) for(int i = 0; i < list.tagCount(); i++)
{ {
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i); NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot"); byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length) if(b0 >= 0 && b0 < slots.length)
{ {
@ -143,6 +147,7 @@ public class TileEntityLaunchPad extends TileEntity implements ISidedInventory {
} }
} }
@Override
public void writeToNBT(NBTTagCompound nbt) { public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt); super.writeToNBT(nbt);
NBTTagList list = new NBTTagList(); NBTTagList list = new NBTTagList();
@ -182,6 +187,7 @@ public class TileEntityLaunchPad extends TileEntity implements ISidedInventory {
return (power * i) / maxPower; return (power * i) / maxPower;
} }
@Override
public void updateEntity() { public void updateEntity() {
if(/*power + 100 <= maxPower && */slots[2] != null && slots[2].getItem() == ModItems.battery_creative) if(/*power + 100 <= maxPower && */slots[2] != null && slots[2].getItem() == ModItems.battery_creative)
@ -405,7 +411,7 @@ public class TileEntityLaunchPad extends TileEntity implements ISidedInventory {
@Override @Override
public AxisAlignedBB getRenderBoundingBox() { public AxisAlignedBB getRenderBoundingBox() {
return this.INFINITE_EXTENT_AABB; return TileEntity.INFINITE_EXTENT_AABB;
} }
public World getThatWorld() { public World getThatWorld() {

View File

@ -1,13 +1,10 @@
package com.hbm.blocks; package com.hbm.blocks;
import com.hbm.gui.MachineRecipes;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.inventory.ISidedInventory; import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList; import net.minecraft.nbt.NBTTagList;
@ -88,11 +85,13 @@ public class TileEntityMachineBattery extends TileEntity implements ISidedInvent
{ {
return false; return false;
}else{ }else{
return player.getDistanceSq((double) xCoord + 0.5D, (double) yCoord + 0.5D, (double) zCoord + 0.5D) <=64; return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <=64;
} }
} }
@Override
public void openInventory() {} public void openInventory() {}
@Override
public void closeInventory() {} public void closeInventory() {}
@Override @Override
@ -100,6 +99,7 @@ public class TileEntityMachineBattery extends TileEntity implements ISidedInvent
return true; return true;
} }
@Override
public ItemStack decrStackSize(int i, int j) { public ItemStack decrStackSize(int i, int j) {
if(slots[i] != null) if(slots[i] != null)
{ {
@ -121,6 +121,7 @@ public class TileEntityMachineBattery extends TileEntity implements ISidedInvent
} }
} }
@Override
public void readFromNBT(NBTTagCompound nbt) { public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt); super.readFromNBT(nbt);
NBTTagList list = nbt.getTagList("items", 10); NBTTagList list = nbt.getTagList("items", 10);
@ -130,7 +131,7 @@ public class TileEntityMachineBattery extends TileEntity implements ISidedInvent
for(int i = 0; i < list.tagCount(); i++) for(int i = 0; i < list.tagCount(); i++)
{ {
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i); NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot"); byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length) if(b0 >= 0 && b0 < slots.length)
{ {
@ -139,6 +140,7 @@ public class TileEntityMachineBattery extends TileEntity implements ISidedInvent
} }
} }
@Override
public void writeToNBT(NBTTagCompound nbt) { public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt); super.writeToNBT(nbt);
nbt.setShort("power", (short) power); nbt.setShort("power", (short) power);
@ -177,6 +179,7 @@ public class TileEntityMachineBattery extends TileEntity implements ISidedInvent
return (power * i) / maxPower; return (power * i) / maxPower;
} }
@Override
public void updateEntity() { public void updateEntity() {
if(this.conducts) if(this.conducts)
{ {
@ -430,17 +433,17 @@ public class TileEntityMachineBattery extends TileEntity implements ISidedInvent
entity instanceof TileEntityMachineBattery || entity instanceof TileEntityMachineBattery ||
entity instanceof TileEntityLaunchPad) entity instanceof TileEntityLaunchPad)
{ {
if(entity instanceof TileEntityMachineElectricFurnace && ((TileEntityMachineElectricFurnace)entity).power + 100 <= ((TileEntityMachineElectricFurnace)entity).maxPower) if(entity instanceof TileEntityMachineElectricFurnace && ((TileEntityMachineElectricFurnace)entity).power + 100 <= TileEntityMachineElectricFurnace.maxPower)
{ {
((TileEntityMachineElectricFurnace)entity).power += 100; ((TileEntityMachineElectricFurnace)entity).power += 100;
this.power -= 100; this.power -= 100;
} else } else
if(entity instanceof TileEntityWireCoated && ((TileEntityWireCoated)entity).power + 100 <= ((TileEntityWireCoated)entity).maxPower) if(entity instanceof TileEntityWireCoated && TileEntityWireCoated.power + 100 <= TileEntityWireCoated.maxPower)
{ {
((TileEntityWireCoated)entity).power += 100; TileEntityWireCoated.power += 100;
this.power -= 100; this.power -= 100;
} else } else
if(entity instanceof TileEntityMachineDeuterium && ((TileEntityMachineDeuterium)entity).power + 100 <= ((TileEntityMachineDeuterium)entity).maxPower) if(entity instanceof TileEntityMachineDeuterium && ((TileEntityMachineDeuterium)entity).power + 100 <= TileEntityMachineDeuterium.maxPower)
{ {
((TileEntityMachineDeuterium)entity).power += 100; ((TileEntityMachineDeuterium)entity).power += 100;
this.power -= 100; this.power -= 100;

View File

@ -3,11 +3,9 @@ package com.hbm.blocks;
import com.hbm.gui.MachineRecipes; import com.hbm.gui.MachineRecipes;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import net.minecraft.block.BlockFurnace;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory; import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -92,12 +90,14 @@ public class TileEntityMachineCentrifuge extends TileEntity implements ISidedInv
{ {
return false; return false;
}else{ }else{
return player.getDistanceSq((double) xCoord + 0.5D, (double) yCoord + 0.5D, (double) zCoord + 0.5D) <=64; return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <=64;
} }
} }
//You scrubs aren't needed for anything (right now) //You scrubs aren't needed for anything (right now)
@Override
public void openInventory() {} public void openInventory() {}
@Override
public void closeInventory() {} public void closeInventory() {}
@Override @Override
@ -129,6 +129,7 @@ public class TileEntityMachineCentrifuge extends TileEntity implements ISidedInv
} }
} }
@Override
public ItemStack decrStackSize(int i, int j) { public ItemStack decrStackSize(int i, int j) {
if(slots[i] != null) if(slots[i] != null)
{ {
@ -150,6 +151,7 @@ public class TileEntityMachineCentrifuge extends TileEntity implements ISidedInv
} }
} }
@Override
public void readFromNBT(NBTTagCompound nbt) { public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt); super.readFromNBT(nbt);
NBTTagList list = nbt.getTagList("items", 10); NBTTagList list = nbt.getTagList("items", 10);
@ -161,7 +163,7 @@ public class TileEntityMachineCentrifuge extends TileEntity implements ISidedInv
for(int i = 0; i < list.tagCount(); i++) for(int i = 0; i < list.tagCount(); i++)
{ {
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i); NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot"); byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length) if(b0 >= 0 && b0 < slots.length)
{ {
@ -170,6 +172,7 @@ public class TileEntityMachineCentrifuge extends TileEntity implements ISidedInv
} }
} }
@Override
public void writeToNBT(NBTTagCompound nbt) { public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt); super.writeToNBT(nbt);
nbt.setShort("powerTime", (short) dualPower); nbt.setShort("powerTime", (short) dualPower);
@ -330,6 +333,7 @@ public class TileEntityMachineCentrifuge extends TileEntity implements ISidedInv
return this.dualCookTime > 0; return this.dualCookTime > 0;
} }
@Override
public void updateEntity() { public void updateEntity() {
boolean flag = this.hasPower(); boolean flag = this.hasPower();
boolean flag1 = false; boolean flag1 = false;
@ -353,7 +357,7 @@ public class TileEntityMachineCentrifuge extends TileEntity implements ISidedInv
if(!worldObj.isRemote) if(!worldObj.isRemote)
{ {
if(this.hasItemPower(this.slots[1]) && this.dualPower <= (this.maxPower - this.getItemPower(this.slots[1]))) if(this.hasItemPower(this.slots[1]) && this.dualPower <= (TileEntityMachineCentrifuge.maxPower - TileEntityMachineCentrifuge.getItemPower(this.slots[1])))
{ {
this.dualPower += getItemPower(this.slots[1]); this.dualPower += getItemPower(this.slots[1]);
if(this.slots[1] != null) if(this.slots[1] != null)
@ -382,7 +386,7 @@ public class TileEntityMachineCentrifuge extends TileEntity implements ISidedInv
{ {
dualCookTime++; dualCookTime++;
if(this.dualCookTime == this.processingSpeed) if(this.dualCookTime == TileEntityMachineCentrifuge.processingSpeed)
{ {
this.dualCookTime = 0; this.dualCookTime = 0;
this.processItem(); this.processItem();
@ -412,6 +416,6 @@ public class TileEntityMachineCentrifuge extends TileEntity implements ISidedInv
@Override @Override
public AxisAlignedBB getRenderBoundingBox() { public AxisAlignedBB getRenderBoundingBox() {
return this.INFINITE_EXTENT_AABB; return TileEntity.INFINITE_EXTENT_AABB;
} }
} }

View File

@ -6,7 +6,6 @@ import net.minecraft.init.Items;
import net.minecraft.inventory.ISidedInventory; import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.Item; import net.minecraft.item.Item;
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.nbt.NBTTagList; import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
@ -89,12 +88,14 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
{ {
return false; return false;
}else{ }else{
return player.getDistanceSq((double) xCoord + 0.5D, (double) yCoord + 0.5D, (double) zCoord + 0.5D) <=64; return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <=64;
} }
} }
//You scrubs aren't needed for anything (right now) //You scrubs aren't needed for anything (right now)
@Override
public void openInventory() {} public void openInventory() {}
@Override
public void closeInventory() {} public void closeInventory() {}
@Override @Override
@ -102,6 +103,7 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
return true; return true;
} }
@Override
public ItemStack decrStackSize(int i, int j) { public ItemStack decrStackSize(int i, int j) {
if(slots[i] != null) if(slots[i] != null)
{ {
@ -123,6 +125,7 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
} }
} }
@Override
public void readFromNBT(NBTTagCompound nbt) { public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt); super.readFromNBT(nbt);
NBTTagList list = nbt.getTagList("items", 10); NBTTagList list = nbt.getTagList("items", 10);
@ -133,7 +136,7 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
for(int i = 0; i < list.tagCount(); i++) for(int i = 0; i < list.tagCount(); i++)
{ {
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i); NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot"); byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length) if(b0 >= 0 && b0 < slots.length)
{ {
@ -142,6 +145,7 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
} }
} }
@Override
public void writeToNBT(NBTTagCompound nbt) { public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt); super.writeToNBT(nbt);
nbt.setShort("powerTime", (short) power); nbt.setShort("powerTime", (short) power);
@ -185,6 +189,7 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
return (power * i) / maxPower; return (power * i) / maxPower;
} }
@Override
public void updateEntity() { public void updateEntity() {
//Water //Water
if(slots[0] != null && slots[0].getItem() == Items.water_bucket && this.water + 2500 <= maxWater) if(slots[0] != null && slots[0].getItem() == Items.water_bucket && this.water + 2500 <= maxWater)
@ -245,7 +250,7 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
if(worldObj.getBlock(xCoord + 1, yCoord, zCoord) instanceof MachineElectricFurnace) if(worldObj.getBlock(xCoord + 1, yCoord, zCoord) instanceof MachineElectricFurnace)
{ {
TileEntityMachineElectricFurnace entity = (TileEntityMachineElectricFurnace) worldObj.getTileEntity(xCoord + 1, yCoord, zCoord); TileEntityMachineElectricFurnace entity = (TileEntityMachineElectricFurnace) worldObj.getTileEntity(xCoord + 1, yCoord, zCoord);
if(entity.power + 100 <= entity.maxPower && this.power - 100 >= 0) if(entity.power + 100 <= TileEntityMachineElectricFurnace.maxPower && this.power - 100 >= 0)
{ {
entity.power += 100; entity.power += 100;
this.power -= 100; this.power -= 100;
@ -254,7 +259,7 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
if(worldObj.getBlock(xCoord - 1, yCoord, zCoord) instanceof MachineElectricFurnace) if(worldObj.getBlock(xCoord - 1, yCoord, zCoord) instanceof MachineElectricFurnace)
{ {
TileEntityMachineElectricFurnace entity = (TileEntityMachineElectricFurnace) worldObj.getTileEntity(xCoord - 1, yCoord, zCoord); TileEntityMachineElectricFurnace entity = (TileEntityMachineElectricFurnace) worldObj.getTileEntity(xCoord - 1, yCoord, zCoord);
if(entity.power + 100 <= entity.maxPower && this.power - 100 >= 0) if(entity.power + 100 <= TileEntityMachineElectricFurnace.maxPower && this.power - 100 >= 0)
{ {
entity.power += 100; entity.power += 100;
this.power -= 100; this.power -= 100;
@ -263,7 +268,7 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
if(worldObj.getBlock(xCoord, yCoord + 1, zCoord) instanceof MachineElectricFurnace) if(worldObj.getBlock(xCoord, yCoord + 1, zCoord) instanceof MachineElectricFurnace)
{ {
TileEntityMachineElectricFurnace entity = (TileEntityMachineElectricFurnace) worldObj.getTileEntity(xCoord, yCoord + 1, zCoord); TileEntityMachineElectricFurnace entity = (TileEntityMachineElectricFurnace) worldObj.getTileEntity(xCoord, yCoord + 1, zCoord);
if(entity.power + 100 <= entity.maxPower && this.power - 100 >= 0) if(entity.power + 100 <= TileEntityMachineElectricFurnace.maxPower && this.power - 100 >= 0)
{ {
entity.power += 100; entity.power += 100;
this.power -= 100; this.power -= 100;
@ -272,7 +277,7 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
if(worldObj.getBlock(xCoord, yCoord - 1, zCoord) instanceof MachineElectricFurnace) if(worldObj.getBlock(xCoord, yCoord - 1, zCoord) instanceof MachineElectricFurnace)
{ {
TileEntityMachineElectricFurnace entity = (TileEntityMachineElectricFurnace) worldObj.getTileEntity(xCoord, yCoord - 1, zCoord); TileEntityMachineElectricFurnace entity = (TileEntityMachineElectricFurnace) worldObj.getTileEntity(xCoord, yCoord - 1, zCoord);
if(entity.power + 100 <= entity.maxPower && this.power - 100 >= 0) if(entity.power + 100 <= TileEntityMachineElectricFurnace.maxPower && this.power - 100 >= 0)
{ {
entity.power += 100; entity.power += 100;
this.power -= 100; this.power -= 100;
@ -281,7 +286,7 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
if(worldObj.getBlock(xCoord, yCoord, zCoord + 1) instanceof MachineElectricFurnace) if(worldObj.getBlock(xCoord, yCoord, zCoord + 1) instanceof MachineElectricFurnace)
{ {
TileEntityMachineElectricFurnace entity = (TileEntityMachineElectricFurnace) worldObj.getTileEntity(xCoord, yCoord, zCoord + 1); TileEntityMachineElectricFurnace entity = (TileEntityMachineElectricFurnace) worldObj.getTileEntity(xCoord, yCoord, zCoord + 1);
if(entity.power + 100 <= entity.maxPower && this.power - 100 >= 0) if(entity.power + 100 <= TileEntityMachineElectricFurnace.maxPower && this.power - 100 >= 0)
{ {
entity.power += 100; entity.power += 100;
this.power -= 100; this.power -= 100;
@ -290,7 +295,7 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
if(worldObj.getBlock(xCoord, yCoord, zCoord - 1) instanceof MachineElectricFurnace) if(worldObj.getBlock(xCoord, yCoord, zCoord - 1) instanceof MachineElectricFurnace)
{ {
TileEntityMachineElectricFurnace entity = (TileEntityMachineElectricFurnace) worldObj.getTileEntity(xCoord, yCoord, zCoord - 1); TileEntityMachineElectricFurnace entity = (TileEntityMachineElectricFurnace) worldObj.getTileEntity(xCoord, yCoord, zCoord - 1);
if(entity.power + 100 <= entity.maxPower && this.power - 100 >= 0) if(entity.power + 100 <= TileEntityMachineElectricFurnace.maxPower && this.power - 100 >= 0)
{ {
entity.power += 100; entity.power += 100;
this.power -= 100; this.power -= 100;
@ -301,54 +306,54 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
if(worldObj.getBlock(xCoord + 1, yCoord, zCoord) instanceof WireCoated) if(worldObj.getBlock(xCoord + 1, yCoord, zCoord) instanceof WireCoated)
{ {
TileEntityWireCoated entity = (TileEntityWireCoated) worldObj.getTileEntity(xCoord + 1, yCoord, zCoord); TileEntityWireCoated entity = (TileEntityWireCoated) worldObj.getTileEntity(xCoord + 1, yCoord, zCoord);
if(entity.power + 100 <= entity.maxPower && this.power - 100 >= 0) if(TileEntityWireCoated.power + 100 <= TileEntityWireCoated.maxPower && this.power - 100 >= 0)
{ {
entity.power += 100; TileEntityWireCoated.power += 100;
this.power -= 100; this.power -= 100;
} }
} }
if(worldObj.getBlock(xCoord - 1, yCoord, zCoord) instanceof WireCoated) if(worldObj.getBlock(xCoord - 1, yCoord, zCoord) instanceof WireCoated)
{ {
TileEntityWireCoated entity = (TileEntityWireCoated) worldObj.getTileEntity(xCoord - 1, yCoord, zCoord); TileEntityWireCoated entity = (TileEntityWireCoated) worldObj.getTileEntity(xCoord - 1, yCoord, zCoord);
if(entity.power + 100 <= entity.maxPower && this.power - 100 >= 0) if(TileEntityWireCoated.power + 100 <= TileEntityWireCoated.maxPower && this.power - 100 >= 0)
{ {
entity.power += 100; TileEntityWireCoated.power += 100;
this.power -= 100; this.power -= 100;
} }
} }
if(worldObj.getBlock(xCoord, yCoord + 1, zCoord) instanceof WireCoated) if(worldObj.getBlock(xCoord, yCoord + 1, zCoord) instanceof WireCoated)
{ {
TileEntityWireCoated entity = (TileEntityWireCoated) worldObj.getTileEntity(xCoord, yCoord + 1, zCoord); TileEntityWireCoated entity = (TileEntityWireCoated) worldObj.getTileEntity(xCoord, yCoord + 1, zCoord);
if(entity.power + 100 <= entity.maxPower && this.power - 100 >= 0) if(TileEntityWireCoated.power + 100 <= TileEntityWireCoated.maxPower && this.power - 100 >= 0)
{ {
entity.power += 100; TileEntityWireCoated.power += 100;
this.power -= 100; this.power -= 100;
} }
} }
if(worldObj.getBlock(xCoord, yCoord - 1, zCoord) instanceof WireCoated) if(worldObj.getBlock(xCoord, yCoord - 1, zCoord) instanceof WireCoated)
{ {
TileEntityWireCoated entity = (TileEntityWireCoated) worldObj.getTileEntity(xCoord, yCoord - 1, zCoord); TileEntityWireCoated entity = (TileEntityWireCoated) worldObj.getTileEntity(xCoord, yCoord - 1, zCoord);
if(entity.power + 100 <= entity.maxPower && this.power - 100 >= 0) if(TileEntityWireCoated.power + 100 <= TileEntityWireCoated.maxPower && this.power - 100 >= 0)
{ {
entity.power += 100; TileEntityWireCoated.power += 100;
this.power -= 100; this.power -= 100;
} }
} }
if(worldObj.getBlock(xCoord, yCoord, zCoord + 1) instanceof WireCoated) if(worldObj.getBlock(xCoord, yCoord, zCoord + 1) instanceof WireCoated)
{ {
TileEntityWireCoated entity = (TileEntityWireCoated) worldObj.getTileEntity(xCoord, yCoord, zCoord + 1); TileEntityWireCoated entity = (TileEntityWireCoated) worldObj.getTileEntity(xCoord, yCoord, zCoord + 1);
if(entity.power + 100 <= entity.maxPower && this.power - 100 >= 0) if(TileEntityWireCoated.power + 100 <= TileEntityWireCoated.maxPower && this.power - 100 >= 0)
{ {
entity.power += 100; TileEntityWireCoated.power += 100;
this.power -= 100; this.power -= 100;
} }
} }
if(worldObj.getBlock(xCoord, yCoord, zCoord - 1) instanceof WireCoated) if(worldObj.getBlock(xCoord, yCoord, zCoord - 1) instanceof WireCoated)
{ {
TileEntityWireCoated entity = (TileEntityWireCoated) worldObj.getTileEntity(xCoord, yCoord, zCoord - 1); TileEntityWireCoated entity = (TileEntityWireCoated) worldObj.getTileEntity(xCoord, yCoord, zCoord - 1);
if(entity.power + 100 <= entity.maxPower && this.power - 100 >= 0) if(TileEntityWireCoated.power + 100 <= TileEntityWireCoated.maxPower && this.power - 100 >= 0)
{ {
entity.power += 100; TileEntityWireCoated.power += 100;
this.power -= 100; this.power -= 100;
} }
} }
@ -357,7 +362,7 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
if(worldObj.getBlock(xCoord + 1, yCoord, zCoord) instanceof MachineDeuterium) if(worldObj.getBlock(xCoord + 1, yCoord, zCoord) instanceof MachineDeuterium)
{ {
TileEntityMachineDeuterium entity = (TileEntityMachineDeuterium) worldObj.getTileEntity(xCoord + 1, yCoord, zCoord); TileEntityMachineDeuterium entity = (TileEntityMachineDeuterium) worldObj.getTileEntity(xCoord + 1, yCoord, zCoord);
if(entity.power + 100 <= entity.maxPower && this.power - 100 >= 0) if(entity.power + 100 <= TileEntityMachineDeuterium.maxPower && this.power - 100 >= 0)
{ {
entity.power += 100; entity.power += 100;
this.power -= 100; this.power -= 100;
@ -366,7 +371,7 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
if(worldObj.getBlock(xCoord - 1, yCoord, zCoord) instanceof MachineDeuterium) if(worldObj.getBlock(xCoord - 1, yCoord, zCoord) instanceof MachineDeuterium)
{ {
TileEntityMachineDeuterium entity = (TileEntityMachineDeuterium) worldObj.getTileEntity(xCoord - 1, yCoord, zCoord); TileEntityMachineDeuterium entity = (TileEntityMachineDeuterium) worldObj.getTileEntity(xCoord - 1, yCoord, zCoord);
if(entity.power + 100 <= entity.maxPower && this.power - 100 >= 0) if(entity.power + 100 <= TileEntityMachineDeuterium.maxPower && this.power - 100 >= 0)
{ {
entity.power += 100; entity.power += 100;
this.power -= 100; this.power -= 100;
@ -375,7 +380,7 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
if(worldObj.getBlock(xCoord, yCoord + 1, zCoord) instanceof MachineDeuterium) if(worldObj.getBlock(xCoord, yCoord + 1, zCoord) instanceof MachineDeuterium)
{ {
TileEntityMachineDeuterium entity = (TileEntityMachineDeuterium) worldObj.getTileEntity(xCoord, yCoord + 1, zCoord); TileEntityMachineDeuterium entity = (TileEntityMachineDeuterium) worldObj.getTileEntity(xCoord, yCoord + 1, zCoord);
if(entity.power + 100 <= entity.maxPower && this.power - 100 >= 0) if(entity.power + 100 <= TileEntityMachineDeuterium.maxPower && this.power - 100 >= 0)
{ {
entity.power += 100; entity.power += 100;
this.power -= 100; this.power -= 100;
@ -384,7 +389,7 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
if(worldObj.getBlock(xCoord, yCoord - 1, zCoord) instanceof MachineDeuterium) if(worldObj.getBlock(xCoord, yCoord - 1, zCoord) instanceof MachineDeuterium)
{ {
TileEntityMachineDeuterium entity = (TileEntityMachineDeuterium) worldObj.getTileEntity(xCoord, yCoord - 1, zCoord); TileEntityMachineDeuterium entity = (TileEntityMachineDeuterium) worldObj.getTileEntity(xCoord, yCoord - 1, zCoord);
if(entity.power + 100 <= entity.maxPower && this.power - 100 >= 0) if(entity.power + 100 <= TileEntityMachineDeuterium.maxPower && this.power - 100 >= 0)
{ {
entity.power += 100; entity.power += 100;
this.power -= 100; this.power -= 100;
@ -393,7 +398,7 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
if(worldObj.getBlock(xCoord, yCoord, zCoord + 1) instanceof MachineDeuterium) if(worldObj.getBlock(xCoord, yCoord, zCoord + 1) instanceof MachineDeuterium)
{ {
TileEntityMachineDeuterium entity = (TileEntityMachineDeuterium) worldObj.getTileEntity(xCoord, yCoord, zCoord + 1); TileEntityMachineDeuterium entity = (TileEntityMachineDeuterium) worldObj.getTileEntity(xCoord, yCoord, zCoord + 1);
if(entity.power + 100 <= entity.maxPower && this.power - 100 >= 0) if(entity.power + 100 <= TileEntityMachineDeuterium.maxPower && this.power - 100 >= 0)
{ {
entity.power += 100; entity.power += 100;
this.power -= 100; this.power -= 100;
@ -402,7 +407,7 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
if(worldObj.getBlock(xCoord, yCoord, zCoord - 1) instanceof MachineDeuterium) if(worldObj.getBlock(xCoord, yCoord, zCoord - 1) instanceof MachineDeuterium)
{ {
TileEntityMachineDeuterium entity = (TileEntityMachineDeuterium) worldObj.getTileEntity(xCoord, yCoord, zCoord - 1); TileEntityMachineDeuterium entity = (TileEntityMachineDeuterium) worldObj.getTileEntity(xCoord, yCoord, zCoord - 1);
if(entity.power + 100 <= entity.maxPower && this.power - 100 >= 0) if(entity.power + 100 <= TileEntityMachineDeuterium.maxPower && this.power - 100 >= 0)
{ {
entity.power += 100; entity.power += 100;
this.power -= 100; this.power -= 100;

View File

@ -88,11 +88,13 @@ public class TileEntityMachineDeuterium extends TileEntity implements ISidedInve
{ {
return false; return false;
}else{ }else{
return player.getDistanceSq((double) xCoord + 0.5D, (double) yCoord + 0.5D, (double) zCoord + 0.5D) <=64; return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <=64;
} }
} }
@Override
public void openInventory() {} public void openInventory() {}
@Override
public void closeInventory() {} public void closeInventory() {}
@Override @Override
@ -100,6 +102,7 @@ public class TileEntityMachineDeuterium extends TileEntity implements ISidedInve
return false; return false;
} }
@Override
public ItemStack decrStackSize(int i, int j) { public ItemStack decrStackSize(int i, int j) {
if(slots[i] != null) if(slots[i] != null)
{ {
@ -121,6 +124,7 @@ public class TileEntityMachineDeuterium extends TileEntity implements ISidedInve
} }
} }
@Override
public void readFromNBT(NBTTagCompound nbt) { public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt); super.readFromNBT(nbt);
NBTTagList list = nbt.getTagList("items", 10); NBTTagList list = nbt.getTagList("items", 10);
@ -133,7 +137,7 @@ public class TileEntityMachineDeuterium extends TileEntity implements ISidedInve
for(int i = 0; i < list.tagCount(); i++) for(int i = 0; i < list.tagCount(); i++)
{ {
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i); NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot"); byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length) if(b0 >= 0 && b0 < slots.length)
{ {
@ -142,6 +146,7 @@ public class TileEntityMachineDeuterium extends TileEntity implements ISidedInve
} }
} }
@Override
public void writeToNBT(NBTTagCompound nbt) { public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt); super.writeToNBT(nbt);
nbt.setShort("power", (short) power); nbt.setShort("power", (short) power);
@ -235,6 +240,7 @@ public class TileEntityMachineDeuterium extends TileEntity implements ISidedInve
} }
} }
@Override
public void updateEntity() { public void updateEntity() {
if(slots[2] != null && slots[2].getItem() == ModItems.sulfur && sulfur + 125 <= maxFill) if(slots[2] != null && slots[2].getItem() == ModItems.sulfur && sulfur + 125 <= maxFill)
{ {

View File

@ -1,13 +1,10 @@
package com.hbm.blocks; package com.hbm.blocks;
import com.hbm.gui.MachineRecipes;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.inventory.ISidedInventory; import net.minecraft.inventory.ISidedInventory;
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;
@ -89,12 +86,14 @@ public class TileEntityMachineElectricFurnace extends TileEntity implements ISid
{ {
return false; return false;
}else{ }else{
return player.getDistanceSq((double) xCoord + 0.5D, (double) yCoord + 0.5D, (double) zCoord + 0.5D) <=64; return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <=64;
} }
} }
//You scrubs aren't needed for anything (right now) //You scrubs aren't needed for anything (right now)
@Override
public void openInventory() {} public void openInventory() {}
@Override
public void closeInventory() {} public void closeInventory() {}
@Override @Override
@ -102,6 +101,7 @@ public class TileEntityMachineElectricFurnace extends TileEntity implements ISid
return true; return true;
} }
@Override
public ItemStack decrStackSize(int i, int j) { public ItemStack decrStackSize(int i, int j) {
if(slots[i] != null) if(slots[i] != null)
{ {
@ -123,6 +123,7 @@ public class TileEntityMachineElectricFurnace extends TileEntity implements ISid
} }
} }
@Override
public void readFromNBT(NBTTagCompound nbt) { public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt); super.readFromNBT(nbt);
NBTTagList list = nbt.getTagList("items", 10); NBTTagList list = nbt.getTagList("items", 10);
@ -133,7 +134,7 @@ public class TileEntityMachineElectricFurnace extends TileEntity implements ISid
for(int i = 0; i < list.tagCount(); i++) for(int i = 0; i < list.tagCount(); i++)
{ {
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i); NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot"); byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length) if(b0 >= 0 && b0 < slots.length)
{ {
@ -142,6 +143,7 @@ public class TileEntityMachineElectricFurnace extends TileEntity implements ISid
} }
} }
@Override
public void writeToNBT(NBTTagCompound nbt) { public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt); super.writeToNBT(nbt);
nbt.setShort("powerTime", (short) power); nbt.setShort("powerTime", (short) power);
@ -251,6 +253,7 @@ public class TileEntityMachineElectricFurnace extends TileEntity implements ISid
} }
} }
@Override
public void updateEntity() { public void updateEntity() {
boolean flag = this.hasPower(); boolean flag = this.hasPower();
boolean flag1 = false; boolean flag1 = false;
@ -263,7 +266,7 @@ public class TileEntityMachineElectricFurnace extends TileEntity implements ISid
power -= 5; power -= 5;
if(this.dualCookTime == this.processingSpeed) if(this.dualCookTime == TileEntityMachineElectricFurnace.processingSpeed)
{ {
this.dualCookTime = 0; this.dualCookTime = 0;
this.processItem(); this.processItem();

View File

@ -9,7 +9,6 @@ import net.minecraft.init.Blocks;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.inventory.ISidedInventory; import net.minecraft.inventory.ISidedInventory;
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.nbt.NBTTagList; import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
@ -93,12 +92,14 @@ public class TileEntityMachineGenerator extends TileEntity implements ISidedInve
{ {
return false; return false;
}else{ }else{
return player.getDistanceSq((double) xCoord + 0.5D, (double) yCoord + 0.5D, (double) zCoord + 0.5D) <=64; return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <=64;
} }
} }
//You scrubs aren't needed for anything (right now) //You scrubs aren't needed for anything (right now)
@Override
public void openInventory() {} public void openInventory() {}
@Override
public void closeInventory() {} public void closeInventory() {}
@Override @Override
@ -106,6 +107,7 @@ public class TileEntityMachineGenerator extends TileEntity implements ISidedInve
return true; return true;
} }
@Override
public ItemStack decrStackSize(int i, int j) { public ItemStack decrStackSize(int i, int j) {
if(slots[i] != null) if(slots[i] != null)
{ {
@ -127,6 +129,7 @@ public class TileEntityMachineGenerator extends TileEntity implements ISidedInve
} }
} }
@Override
public void readFromNBT(NBTTagCompound nbt) { public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt); super.readFromNBT(nbt);
NBTTagList list = nbt.getTagList("items", 10); NBTTagList list = nbt.getTagList("items", 10);
@ -139,7 +142,7 @@ public class TileEntityMachineGenerator extends TileEntity implements ISidedInve
for(int i = 0; i < list.tagCount(); i++) for(int i = 0; i < list.tagCount(); i++)
{ {
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i); NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot"); byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length) if(b0 >= 0 && b0 < slots.length)
{ {
@ -148,6 +151,7 @@ public class TileEntityMachineGenerator extends TileEntity implements ISidedInve
} }
} }
@Override
public void writeToNBT(NBTTagCompound nbt) { public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt); super.writeToNBT(nbt);
nbt.setShort("water", (short) water); nbt.setShort("water", (short) water);
@ -218,6 +222,7 @@ public class TileEntityMachineGenerator extends TileEntity implements ISidedInve
return heat > 0; return heat > 0;
} }
@Override
public void updateEntity() { public void updateEntity() {
if(!worldObj.isRemote) if(!worldObj.isRemote)
@ -735,17 +740,17 @@ public class TileEntityMachineGenerator extends TileEntity implements ISidedInve
entity instanceof TileEntityMachineBattery || entity instanceof TileEntityMachineBattery ||
entity instanceof TileEntityLaunchPad) entity instanceof TileEntityLaunchPad)
{ {
if(entity instanceof TileEntityMachineElectricFurnace && ((TileEntityMachineElectricFurnace)entity).power + 100 <= ((TileEntityMachineElectricFurnace)entity).maxPower) if(entity instanceof TileEntityMachineElectricFurnace && ((TileEntityMachineElectricFurnace)entity).power + 100 <= TileEntityMachineElectricFurnace.maxPower)
{ {
((TileEntityMachineElectricFurnace)entity).power += 100; ((TileEntityMachineElectricFurnace)entity).power += 100;
this.power -= 100; this.power -= 100;
} else } else
if(entity instanceof TileEntityWireCoated && ((TileEntityWireCoated)entity).power + 100 <= ((TileEntityWireCoated)entity).maxPower) if(entity instanceof TileEntityWireCoated && TileEntityWireCoated.power + 100 <= TileEntityWireCoated.maxPower)
{ {
((TileEntityWireCoated)entity).power += 100; TileEntityWireCoated.power += 100;
this.power -= 100; this.power -= 100;
} else } else
if(entity instanceof TileEntityMachineDeuterium && ((TileEntityMachineDeuterium)entity).power + 100 <= ((TileEntityMachineDeuterium)entity).maxPower) if(entity instanceof TileEntityMachineDeuterium && ((TileEntityMachineDeuterium)entity).power + 100 <= TileEntityMachineDeuterium.maxPower)
{ {
((TileEntityMachineDeuterium)entity).power += 100; ((TileEntityMachineDeuterium)entity).power += 100;
this.power -= 100; this.power -= 100;

View File

@ -3,10 +3,8 @@ package com.hbm.blocks;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.inventory.ISidedInventory; import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList; import net.minecraft.nbt.NBTTagList;
@ -86,11 +84,13 @@ public class TileEntityMachinePuF6Tank extends TileEntity implements ISidedInven
{ {
return false; return false;
}else{ }else{
return player.getDistanceSq((double) xCoord + 0.5D, (double) yCoord + 0.5D, (double) zCoord + 0.5D) <=64; return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <=64;
} }
} }
@Override
public void openInventory() {} public void openInventory() {}
@Override
public void closeInventory() {} public void closeInventory() {}
@Override @Override
@ -98,6 +98,7 @@ public class TileEntityMachinePuF6Tank extends TileEntity implements ISidedInven
return false; return false;
} }
@Override
public ItemStack decrStackSize(int i, int j) { public ItemStack decrStackSize(int i, int j) {
if(slots[i] != null) if(slots[i] != null)
{ {
@ -119,6 +120,7 @@ public class TileEntityMachinePuF6Tank extends TileEntity implements ISidedInven
} }
} }
@Override
public void readFromNBT(NBTTagCompound nbt) { public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt); super.readFromNBT(nbt);
NBTTagList list = nbt.getTagList("items", 10); NBTTagList list = nbt.getTagList("items", 10);
@ -128,7 +130,7 @@ public class TileEntityMachinePuF6Tank extends TileEntity implements ISidedInven
for(int i = 0; i < list.tagCount(); i++) for(int i = 0; i < list.tagCount(); i++)
{ {
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i); NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot"); byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length) if(b0 >= 0 && b0 < slots.length)
{ {
@ -137,6 +139,7 @@ public class TileEntityMachinePuF6Tank extends TileEntity implements ISidedInven
} }
} }
@Override
public void writeToNBT(NBTTagCompound nbt) { public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt); super.writeToNBT(nbt);
nbt.setShort("fillState", (short) fillState); nbt.setShort("fillState", (short) fillState);
@ -205,6 +208,7 @@ public class TileEntityMachinePuF6Tank extends TileEntity implements ISidedInven
return false; return false;
} }
@Override
public void updateEntity() { public void updateEntity() {
if(!worldObj.isRemote) if(!worldObj.isRemote)
@ -253,6 +257,6 @@ public class TileEntityMachinePuF6Tank extends TileEntity implements ISidedInven
@Override @Override
public AxisAlignedBB getRenderBoundingBox() { public AxisAlignedBB getRenderBoundingBox() {
return this.INFINITE_EXTENT_AABB; return TileEntity.INFINITE_EXTENT_AABB;
} }
} }

View File

@ -3,11 +3,8 @@ package com.hbm.blocks;
import com.hbm.gui.MachineRecipes; import com.hbm.gui.MachineRecipes;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import net.minecraft.block.BlockFurnace;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory; import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -91,12 +88,14 @@ public class TileEntityMachineReactor extends TileEntity implements ISidedInvent
{ {
return false; return false;
}else{ }else{
return player.getDistanceSq((double) xCoord + 0.5D, (double) yCoord + 0.5D, (double) zCoord + 0.5D) <=64; return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <=64;
} }
} }
//You scrubs aren't needed for anything (right now) //You scrubs aren't needed for anything (right now)
@Override
public void openInventory() {} public void openInventory() {}
@Override
public void closeInventory() {} public void closeInventory() {}
@Override @Override
@ -141,6 +140,7 @@ public class TileEntityMachineReactor extends TileEntity implements ISidedInvent
} }
} }
@Override
public ItemStack decrStackSize(int i, int j) { public ItemStack decrStackSize(int i, int j) {
if(slots[i] != null) if(slots[i] != null)
{ {
@ -162,6 +162,7 @@ public class TileEntityMachineReactor extends TileEntity implements ISidedInvent
} }
} }
@Override
public void readFromNBT(NBTTagCompound nbt) { public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt); super.readFromNBT(nbt);
NBTTagList list = nbt.getTagList("items", 10); NBTTagList list = nbt.getTagList("items", 10);
@ -173,7 +174,7 @@ public class TileEntityMachineReactor extends TileEntity implements ISidedInvent
for(int i = 0; i < list.tagCount(); i++) for(int i = 0; i < list.tagCount(); i++)
{ {
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i); NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot"); byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length) if(b0 >= 0 && b0 < slots.length)
{ {
@ -182,6 +183,7 @@ public class TileEntityMachineReactor extends TileEntity implements ISidedInvent
} }
} }
@Override
public void writeToNBT(NBTTagCompound nbt) { public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt); super.writeToNBT(nbt);
nbt.setShort("powerTime", (short) dualPower); nbt.setShort("powerTime", (short) dualPower);
@ -293,6 +295,7 @@ public class TileEntityMachineReactor extends TileEntity implements ISidedInvent
return this.dualCookTime > 0; return this.dualCookTime > 0;
} }
@Override
public void updateEntity() { public void updateEntity() {
boolean flag = this.hasPower(); boolean flag = this.hasPower();
boolean flag1 = false; boolean flag1 = false;
@ -330,7 +333,7 @@ public class TileEntityMachineReactor extends TileEntity implements ISidedInvent
{ {
dualCookTime++; dualCookTime++;
if(this.dualCookTime == this.processingSpeed) if(this.dualCookTime == TileEntityMachineReactor.processingSpeed)
{ {
this.dualCookTime = 0; this.dualCookTime = 0;
this.processItem(); this.processItem();

View File

@ -3,10 +3,8 @@ package com.hbm.blocks;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.inventory.ISidedInventory; import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList; import net.minecraft.nbt.NBTTagList;
@ -86,11 +84,13 @@ public class TileEntityMachineUF6Tank extends TileEntity implements ISidedInvent
{ {
return false; return false;
}else{ }else{
return player.getDistanceSq((double) xCoord + 0.5D, (double) yCoord + 0.5D, (double) zCoord + 0.5D) <=64; return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <=64;
} }
} }
@Override
public void openInventory() {} public void openInventory() {}
@Override
public void closeInventory() {} public void closeInventory() {}
@Override @Override
@ -98,6 +98,7 @@ public class TileEntityMachineUF6Tank extends TileEntity implements ISidedInvent
return false; return false;
} }
@Override
public ItemStack decrStackSize(int i, int j) { public ItemStack decrStackSize(int i, int j) {
if(slots[i] != null) if(slots[i] != null)
{ {
@ -119,6 +120,7 @@ public class TileEntityMachineUF6Tank extends TileEntity implements ISidedInvent
} }
} }
@Override
public void readFromNBT(NBTTagCompound nbt) { public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt); super.readFromNBT(nbt);
NBTTagList list = nbt.getTagList("items", 10); NBTTagList list = nbt.getTagList("items", 10);
@ -128,7 +130,7 @@ public class TileEntityMachineUF6Tank extends TileEntity implements ISidedInvent
for(int i = 0; i < list.tagCount(); i++) for(int i = 0; i < list.tagCount(); i++)
{ {
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i); NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot"); byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length) if(b0 >= 0 && b0 < slots.length)
{ {
@ -137,6 +139,7 @@ public class TileEntityMachineUF6Tank extends TileEntity implements ISidedInvent
} }
} }
@Override
public void writeToNBT(NBTTagCompound nbt) { public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt); super.writeToNBT(nbt);
nbt.setShort("fillState", (short) fillState); nbt.setShort("fillState", (short) fillState);
@ -205,6 +208,7 @@ public class TileEntityMachineUF6Tank extends TileEntity implements ISidedInvent
return false; return false;
} }
@Override
public void updateEntity() { public void updateEntity() {
if(!worldObj.isRemote) if(!worldObj.isRemote)
@ -253,6 +257,6 @@ public class TileEntityMachineUF6Tank extends TileEntity implements ISidedInvent
@Override @Override
public AxisAlignedBB getRenderBoundingBox() { public AxisAlignedBB getRenderBoundingBox() {
return this.INFINITE_EXTENT_AABB; return TileEntity.INFINITE_EXTENT_AABB;
} }
} }

View File

@ -98,7 +98,7 @@ public class TileEntityNukeBoy extends TileEntity implements ISidedInventory {
{ {
return false; return false;
}else{ }else{
return player.getDistanceSq((double) xCoord + 0.5D, (double) yCoord + 0.5D, (double) zCoord + 0.5D) <=64; return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <=64;
} }
} }
@ -132,6 +132,7 @@ public class TileEntityNukeBoy extends TileEntity implements ISidedInventory {
return j != 0 || i != 1 || itemStack.getItem() == Items.bucket; return j != 0 || i != 1 || itemStack.getItem() == Items.bucket;
} }
@Override
public void readFromNBT(NBTTagCompound nbt) { public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt); super.readFromNBT(nbt);
NBTTagList list = nbt.getTagList("items", 10); NBTTagList list = nbt.getTagList("items", 10);
@ -139,7 +140,7 @@ public class TileEntityNukeBoy extends TileEntity implements ISidedInventory {
for(int i = 0; i < list.tagCount(); i++) for(int i = 0; i < list.tagCount(); i++)
{ {
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i); NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot"); byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length) if(b0 >= 0 && b0 < slots.length)
{ {
@ -148,6 +149,7 @@ public class TileEntityNukeBoy extends TileEntity implements ISidedInventory {
} }
} }
@Override
public void writeToNBT(NBTTagCompound nbt) { public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt); super.writeToNBT(nbt);
NBTTagList list = new NBTTagList(); NBTTagList list = new NBTTagList();
@ -186,6 +188,6 @@ public class TileEntityNukeBoy extends TileEntity implements ISidedInventory {
@Override @Override
public AxisAlignedBB getRenderBoundingBox() { public AxisAlignedBB getRenderBoundingBox() {
return this.INFINITE_EXTENT_AABB; return TileEntity.INFINITE_EXTENT_AABB;
} }
} }

View File

@ -98,7 +98,7 @@ public class TileEntityNukeFleija extends TileEntity implements ISidedInventory
{ {
return false; return false;
}else{ }else{
return player.getDistanceSq((double) xCoord + 0.5D, (double) yCoord + 0.5D, (double) zCoord + 0.5D) <=64; return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <=64;
} }
} }
@ -132,6 +132,7 @@ public class TileEntityNukeFleija extends TileEntity implements ISidedInventory
return j != 0 || i != 1 || itemStack.getItem() == Items.bucket; return j != 0 || i != 1 || itemStack.getItem() == Items.bucket;
} }
@Override
public void readFromNBT(NBTTagCompound nbt) { public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt); super.readFromNBT(nbt);
NBTTagList list = nbt.getTagList("items", 10); NBTTagList list = nbt.getTagList("items", 10);
@ -139,7 +140,7 @@ public class TileEntityNukeFleija extends TileEntity implements ISidedInventory
for(int i = 0; i < list.tagCount(); i++) for(int i = 0; i < list.tagCount(); i++)
{ {
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i); NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot"); byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length) if(b0 >= 0 && b0 < slots.length)
{ {
@ -148,6 +149,7 @@ public class TileEntityNukeFleija extends TileEntity implements ISidedInventory
} }
} }
@Override
public void writeToNBT(NBTTagCompound nbt) { public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt); super.writeToNBT(nbt);
NBTTagList list = new NBTTagList(); NBTTagList list = new NBTTagList();
@ -195,7 +197,7 @@ public class TileEntityNukeFleija extends TileEntity implements ISidedInventory
@Override @Override
public AxisAlignedBB getRenderBoundingBox() { public AxisAlignedBB getRenderBoundingBox() {
return this.INFINITE_EXTENT_AABB; return TileEntity.INFINITE_EXTENT_AABB;
} }
} }

View File

@ -1,11 +1,8 @@
package com.hbm.blocks; package com.hbm.blocks;
import com.hbm.gui.MachineRecipes;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.inventory.ISidedInventory; import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -89,12 +86,14 @@ public class TileEntityNukeFurnace extends TileEntity implements ISidedInventory
{ {
return false; return false;
}else{ }else{
return player.getDistanceSq((double) xCoord + 0.5D, (double) yCoord + 0.5D, (double) zCoord + 0.5D) <=64; return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <=64;
} }
} }
//You scrubs aren't needed for anything (right now) //You scrubs aren't needed for anything (right now)
@Override
public void openInventory() {} public void openInventory() {}
@Override
public void closeInventory() {} public void closeInventory() {}
@Override @Override
@ -139,6 +138,7 @@ public class TileEntityNukeFurnace extends TileEntity implements ISidedInventory
} }
} }
@Override
public ItemStack decrStackSize(int i, int j) { public ItemStack decrStackSize(int i, int j) {
if(slots[i] != null) if(slots[i] != null)
{ {
@ -160,6 +160,7 @@ public class TileEntityNukeFurnace extends TileEntity implements ISidedInventory
} }
} }
@Override
public void readFromNBT(NBTTagCompound nbt) { public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt); super.readFromNBT(nbt);
NBTTagList list = nbt.getTagList("items", 10); NBTTagList list = nbt.getTagList("items", 10);
@ -170,7 +171,7 @@ public class TileEntityNukeFurnace extends TileEntity implements ISidedInventory
for(int i = 0; i < list.tagCount(); i++) for(int i = 0; i < list.tagCount(); i++)
{ {
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i); NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot"); byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length) if(b0 >= 0 && b0 < slots.length)
{ {
@ -179,6 +180,7 @@ public class TileEntityNukeFurnace extends TileEntity implements ISidedInventory
} }
} }
@Override
public void writeToNBT(NBTTagCompound nbt) { public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt); super.writeToNBT(nbt);
nbt.setShort("powerTime", (short) dualPower); nbt.setShort("powerTime", (short) dualPower);
@ -290,6 +292,7 @@ public class TileEntityNukeFurnace extends TileEntity implements ISidedInventory
return this.dualCookTime > 0; return this.dualCookTime > 0;
} }
@Override
public void updateEntity() { public void updateEntity() {
boolean flag = this.hasPower(); boolean flag = this.hasPower();
boolean flag1 = false; boolean flag1 = false;
@ -314,7 +317,7 @@ public class TileEntityNukeFurnace extends TileEntity implements ISidedInventory
{ {
dualCookTime++; dualCookTime++;
if(this.dualCookTime == this.processingSpeed) if(this.dualCookTime == TileEntityNukeFurnace.processingSpeed)
{ {
this.dualCookTime = 0; this.dualCookTime = 0;
this.processItem(); this.processItem();

View File

@ -3,10 +3,8 @@ package com.hbm.blocks;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.inventory.ISidedInventory; import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList; import net.minecraft.nbt.NBTTagList;
@ -100,7 +98,7 @@ public class TileEntityNukeGadget extends TileEntity implements ISidedInventory
{ {
return false; return false;
}else{ }else{
return player.getDistanceSq((double) xCoord + 0.5D, (double) yCoord + 0.5D, (double) zCoord + 0.5D) <=64; return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <=64;
} }
} }
@ -134,6 +132,7 @@ public class TileEntityNukeGadget extends TileEntity implements ISidedInventory
return j != 0 || i != 1 || itemStack.getItem() == Items.bucket; return j != 0 || i != 1 || itemStack.getItem() == Items.bucket;
} }
@Override
public void readFromNBT(NBTTagCompound nbt) { public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt); super.readFromNBT(nbt);
NBTTagList list = nbt.getTagList("items", 10); NBTTagList list = nbt.getTagList("items", 10);
@ -141,7 +140,7 @@ public class TileEntityNukeGadget extends TileEntity implements ISidedInventory
for(int i = 0; i < list.tagCount(); i++) for(int i = 0; i < list.tagCount(); i++)
{ {
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i); NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot"); byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length) if(b0 >= 0 && b0 < slots.length)
{ {
@ -150,6 +149,7 @@ public class TileEntityNukeGadget extends TileEntity implements ISidedInventory
} }
} }
@Override
public void writeToNBT(NBTTagCompound nbt) { public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt); super.writeToNBT(nbt);
NBTTagList list = new NBTTagList(); NBTTagList list = new NBTTagList();
@ -250,6 +250,6 @@ public class TileEntityNukeGadget extends TileEntity implements ISidedInventory
@Override @Override
public AxisAlignedBB getRenderBoundingBox() { public AxisAlignedBB getRenderBoundingBox() {
return this.INFINITE_EXTENT_AABB; return TileEntity.INFINITE_EXTENT_AABB;
} }
} }

View File

@ -3,10 +3,8 @@ package com.hbm.blocks;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.inventory.ISidedInventory; import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList; import net.minecraft.nbt.NBTTagList;
@ -100,7 +98,7 @@ public class TileEntityNukeMan extends TileEntity implements ISidedInventory {
{ {
return false; return false;
}else{ }else{
return player.getDistanceSq((double) xCoord + 0.5D, (double) yCoord + 0.5D, (double) zCoord + 0.5D) <=64; return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <=64;
} }
} }
@ -134,6 +132,7 @@ public class TileEntityNukeMan extends TileEntity implements ISidedInventory {
return j != 0 || i != 1 || itemStack.getItem() == Items.bucket; return j != 0 || i != 1 || itemStack.getItem() == Items.bucket;
} }
@Override
public void readFromNBT(NBTTagCompound nbt) { public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt); super.readFromNBT(nbt);
NBTTagList list = nbt.getTagList("items", 10); NBTTagList list = nbt.getTagList("items", 10);
@ -141,7 +140,7 @@ public class TileEntityNukeMan extends TileEntity implements ISidedInventory {
for(int i = 0; i < list.tagCount(); i++) for(int i = 0; i < list.tagCount(); i++)
{ {
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i); NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot"); byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length) if(b0 >= 0 && b0 < slots.length)
{ {
@ -150,6 +149,7 @@ public class TileEntityNukeMan extends TileEntity implements ISidedInventory {
} }
} }
@Override
public void writeToNBT(NBTTagCompound nbt) { public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt); super.writeToNBT(nbt);
NBTTagList list = new NBTTagList(); NBTTagList list = new NBTTagList();
@ -224,6 +224,6 @@ public class TileEntityNukeMan extends TileEntity implements ISidedInventory {
@Override @Override
public AxisAlignedBB getRenderBoundingBox() { public AxisAlignedBB getRenderBoundingBox() {
return this.INFINITE_EXTENT_AABB; return TileEntity.INFINITE_EXTENT_AABB;
} }
} }

View File

@ -98,7 +98,7 @@ public class TileEntityNukeMike extends TileEntity implements ISidedInventory {
{ {
return false; return false;
}else{ }else{
return player.getDistanceSq((double) xCoord + 0.5D, (double) yCoord + 0.5D, (double) zCoord + 0.5D) <=64; return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <=64;
} }
} }
@ -132,6 +132,7 @@ public class TileEntityNukeMike extends TileEntity implements ISidedInventory {
return j != 0 || i != 1 || itemStack.getItem() == Items.bucket; return j != 0 || i != 1 || itemStack.getItem() == Items.bucket;
} }
@Override
public void readFromNBT(NBTTagCompound nbt) { public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt); super.readFromNBT(nbt);
NBTTagList list = nbt.getTagList("items", 10); NBTTagList list = nbt.getTagList("items", 10);
@ -139,7 +140,7 @@ public class TileEntityNukeMike extends TileEntity implements ISidedInventory {
for(int i = 0; i < list.tagCount(); i++) for(int i = 0; i < list.tagCount(); i++)
{ {
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i); NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot"); byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length) if(b0 >= 0 && b0 < slots.length)
{ {
@ -148,6 +149,7 @@ public class TileEntityNukeMike extends TileEntity implements ISidedInventory {
} }
} }
@Override
public void writeToNBT(NBTTagCompound nbt) { public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt); super.writeToNBT(nbt);
NBTTagList list = new NBTTagList(); NBTTagList list = new NBTTagList();
@ -207,7 +209,7 @@ public class TileEntityNukeMike extends TileEntity implements ISidedInventory {
@Override @Override
public AxisAlignedBB getRenderBoundingBox() { public AxisAlignedBB getRenderBoundingBox() {
return this.INFINITE_EXTENT_AABB; return TileEntity.INFINITE_EXTENT_AABB;
} }
} }

View File

@ -98,7 +98,7 @@ public class TileEntityNukePrototype extends TileEntity implements ISidedInvento
{ {
return false; return false;
}else{ }else{
return player.getDistanceSq((double) xCoord + 0.5D, (double) yCoord + 0.5D, (double) zCoord + 0.5D) <=64; return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <=64;
} }
} }
@ -132,6 +132,7 @@ public class TileEntityNukePrototype extends TileEntity implements ISidedInvento
return j != 0 || i != 1 || itemStack.getItem() == Items.bucket; return j != 0 || i != 1 || itemStack.getItem() == Items.bucket;
} }
@Override
public void readFromNBT(NBTTagCompound nbt) { public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt); super.readFromNBT(nbt);
NBTTagList list = nbt.getTagList("items", 10); NBTTagList list = nbt.getTagList("items", 10);
@ -139,7 +140,7 @@ public class TileEntityNukePrototype extends TileEntity implements ISidedInvento
for(int i = 0; i < list.tagCount(); i++) for(int i = 0; i < list.tagCount(); i++)
{ {
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i); NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot"); byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length) if(b0 >= 0 && b0 < slots.length)
{ {
@ -148,6 +149,7 @@ public class TileEntityNukePrototype extends TileEntity implements ISidedInvento
} }
} }
@Override
public void writeToNBT(NBTTagCompound nbt) { public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt); super.writeToNBT(nbt);
NBTTagList list = new NBTTagList(); NBTTagList list = new NBTTagList();
@ -198,6 +200,6 @@ public class TileEntityNukePrototype extends TileEntity implements ISidedInvento
@Override @Override
public AxisAlignedBB getRenderBoundingBox() { public AxisAlignedBB getRenderBoundingBox() {
return this.INFINITE_EXTENT_AABB; return TileEntity.INFINITE_EXTENT_AABB;
} }
} }

View File

@ -98,7 +98,7 @@ public class TileEntityNukeTsar extends TileEntity implements ISidedInventory {
{ {
return false; return false;
}else{ }else{
return player.getDistanceSq((double) xCoord + 0.5D, (double) yCoord + 0.5D, (double) zCoord + 0.5D) <=64; return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <=64;
} }
} }
@ -132,6 +132,7 @@ public class TileEntityNukeTsar extends TileEntity implements ISidedInventory {
return j != 0 || i != 1 || itemStack.getItem() == Items.bucket; return j != 0 || i != 1 || itemStack.getItem() == Items.bucket;
} }
@Override
public void readFromNBT(NBTTagCompound nbt) { public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt); super.readFromNBT(nbt);
NBTTagList list = nbt.getTagList("items", 10); NBTTagList list = nbt.getTagList("items", 10);
@ -139,7 +140,7 @@ public class TileEntityNukeTsar extends TileEntity implements ISidedInventory {
for(int i = 0; i < list.tagCount(); i++) for(int i = 0; i < list.tagCount(); i++)
{ {
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i); NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot"); byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length) if(b0 >= 0 && b0 < slots.length)
{ {
@ -148,6 +149,7 @@ public class TileEntityNukeTsar extends TileEntity implements ISidedInventory {
} }
} }
@Override
public void writeToNBT(NBTTagCompound nbt) { public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt); super.writeToNBT(nbt);
NBTTagList list = new NBTTagList(); NBTTagList list = new NBTTagList();
@ -205,6 +207,6 @@ public class TileEntityNukeTsar extends TileEntity implements ISidedInventory {
@Override @Override
public AxisAlignedBB getRenderBoundingBox() { public AxisAlignedBB getRenderBoundingBox() {
return this.INFINITE_EXTENT_AABB; return TileEntity.INFINITE_EXTENT_AABB;
} }
} }

View File

@ -5,6 +5,7 @@ import net.minecraft.util.AxisAlignedBB;
public class TileEntityObjTester extends TileEntity { public class TileEntityObjTester extends TileEntity {
@Override
public int getBlockMetadata() public int getBlockMetadata()
{ {
if (this.blockMetadata == -1) if (this.blockMetadata == -1)
@ -17,6 +18,6 @@ public class TileEntityObjTester extends TileEntity {
@Override @Override
public AxisAlignedBB getRenderBoundingBox() { public AxisAlignedBB getRenderBoundingBox() {
return this.INFINITE_EXTENT_AABB; return TileEntity.INFINITE_EXTENT_AABB;
} }
} }

View File

@ -4,6 +4,7 @@ import net.minecraft.tileentity.TileEntity;
public class TileEntityRotationTester extends TileEntity { public class TileEntityRotationTester extends TileEntity {
@Override
public int getBlockMetadata() public int getBlockMetadata()
{ {
if (this.blockMetadata == -1) if (this.blockMetadata == -1)

View File

@ -3,7 +3,6 @@ package com.hbm.blocks;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.inventory.ISidedInventory; import net.minecraft.inventory.ISidedInventory;
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;
@ -85,12 +84,14 @@ public class TileEntityRtgFurnace extends TileEntity implements ISidedInventory
{ {
return false; return false;
}else{ }else{
return player.getDistanceSq((double) xCoord + 0.5D, (double) yCoord + 0.5D, (double) zCoord + 0.5D) <=64; return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <=64;
} }
} }
//You scrubs aren't needed for anything (right now) //You scrubs aren't needed for anything (right now)
@Override
public void openInventory() {} public void openInventory() {}
@Override
public void closeInventory() {} public void closeInventory() {}
@Override @Override
@ -110,6 +111,7 @@ public class TileEntityRtgFurnace extends TileEntity implements ISidedInventory
return false; return false;
} }
@Override
public ItemStack decrStackSize(int i, int j) { public ItemStack decrStackSize(int i, int j) {
if(slots[i] != null) if(slots[i] != null)
{ {
@ -131,6 +133,7 @@ public class TileEntityRtgFurnace extends TileEntity implements ISidedInventory
} }
} }
@Override
public void readFromNBT(NBTTagCompound nbt) { public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt); super.readFromNBT(nbt);
NBTTagList list = nbt.getTagList("items", 10); NBTTagList list = nbt.getTagList("items", 10);
@ -140,7 +143,7 @@ public class TileEntityRtgFurnace extends TileEntity implements ISidedInventory
for(int i = 0; i < list.tagCount(); i++) for(int i = 0; i < list.tagCount(); i++)
{ {
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i); NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot"); byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length) if(b0 >= 0 && b0 < slots.length)
{ {
@ -149,6 +152,7 @@ public class TileEntityRtgFurnace extends TileEntity implements ISidedInventory
} }
} }
@Override
public void writeToNBT(NBTTagCompound nbt) { public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt); super.writeToNBT(nbt);
nbt.setShort("cookTime", (short) dualCookTime); nbt.setShort("cookTime", (short) dualCookTime);
@ -249,6 +253,7 @@ public class TileEntityRtgFurnace extends TileEntity implements ISidedInventory
return this.dualCookTime > 0; return this.dualCookTime > 0;
} }
@Override
public void updateEntity() { public void updateEntity() {
boolean flag = this.hasPower(); boolean flag = this.hasPower();
boolean flag1 = false; boolean flag1 = false;
@ -259,7 +264,7 @@ public class TileEntityRtgFurnace extends TileEntity implements ISidedInventory
{ {
dualCookTime++; dualCookTime++;
if(this.dualCookTime == this.processingSpeed) if(this.dualCookTime == TileEntityRtgFurnace.processingSpeed)
{ {
this.dualCookTime = 0; this.dualCookTime = 0;
this.processItem(); this.processItem();

View File

@ -20,21 +20,25 @@ public class TileEntityTestContainer extends TileEntityChest {
public TileEntityTestContainer adjacentChestXNeg; public TileEntityTestContainer adjacentChestXNeg;
public TileEntityTestContainer adjacentChestZPos; public TileEntityTestContainer adjacentChestZPos;
@Override
public String getInventoryName() public String getInventoryName()
{ {
return this.hasCustomInventoryName() ? this.customName : "container.testContainer"; return this.hasCustomInventoryName() ? this.customName : "container.testContainer";
} }
@Override
public boolean hasCustomInventoryName() public boolean hasCustomInventoryName()
{ {
return this.customName != null && this.customName.length() > 0; return this.customName != null && this.customName.length() > 0;
} }
@Override
public void func_145976_a(String p_145976_1_) public void func_145976_a(String p_145976_1_)
{ {
this.customName = p_145976_1_; this.customName = p_145976_1_;
} }
@Override
public void readFromNBT(NBTTagCompound p_145839_1_) public void readFromNBT(NBTTagCompound p_145839_1_)
{ {
super.readFromNBT(p_145839_1_); super.readFromNBT(p_145839_1_);
@ -58,6 +62,7 @@ public class TileEntityTestContainer extends TileEntityChest {
} }
} }
@Override
public void writeToNBT(NBTTagCompound p_145841_1_) public void writeToNBT(NBTTagCompound p_145841_1_)
{ {
super.writeToNBT(p_145841_1_); super.writeToNBT(p_145841_1_);
@ -122,6 +127,7 @@ public class TileEntityTestContainer extends TileEntityChest {
} }
} }
@Override
public void checkForAdjacentChests() public void checkForAdjacentChests()
{ {
if (!this.adjacentChestChecked) if (!this.adjacentChestChecked)
@ -187,6 +193,7 @@ public class TileEntityTestContainer extends TileEntityChest {
} }
} }
@Override
public int func_145980_j() public int func_145980_j()
{ {
if (this.cachedChestType == -1) if (this.cachedChestType == -1)

View File

@ -99,7 +99,7 @@ public class TileEntityTestNuke extends TileEntity implements ISidedInventory {
{ {
return false; return false;
}else{ }else{
return player.getDistanceSq((double) xCoord + 0.5D, (double) yCoord + 0.5D, (double) zCoord + 0.5D) <=64; return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <=64;
} }
} }
@ -133,6 +133,7 @@ public class TileEntityTestNuke extends TileEntity implements ISidedInventory {
return j != 0 || i != 1 || itemStack.getItem() == Items.bucket; return j != 0 || i != 1 || itemStack.getItem() == Items.bucket;
} }
@Override
public void readFromNBT(NBTTagCompound nbt) { public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt); super.readFromNBT(nbt);
NBTTagList list = nbt.getTagList("items", 10); NBTTagList list = nbt.getTagList("items", 10);
@ -140,7 +141,7 @@ public class TileEntityTestNuke extends TileEntity implements ISidedInventory {
for(int i = 0; i < list.tagCount(); i++) for(int i = 0; i < list.tagCount(); i++)
{ {
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i); NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot"); byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length) if(b0 >= 0 && b0 < slots.length)
{ {
@ -149,6 +150,7 @@ public class TileEntityTestNuke extends TileEntity implements ISidedInventory {
} }
} }
@Override
public void writeToNBT(NBTTagCompound nbt) { public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt); super.writeToNBT(nbt);
NBTTagList list = new NBTTagList(); NBTTagList list = new NBTTagList();

View File

@ -9,6 +9,7 @@ public class TileEntityWireCoated extends TileEntity {
public static int power; public static int power;
public static final int maxPower = 600; public static final int maxPower = 600;
@Override
public void updateEntity() { public void updateEntity() {
//Energy distribution algorithm //Energy distribution algorithm

View File

@ -4,15 +4,12 @@ import java.util.HashSet;
import java.util.List; import java.util.List;
import com.hbm.entity.EntityNuclearCreeper; import com.hbm.entity.EntityNuclearCreeper;
import com.hbm.explosion.ExplosionChaos;
import com.hbm.lib.Library; import com.hbm.lib.Library;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityCreeper; import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.potion.Potion; import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect; import net.minecraft.potion.PotionEffect;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
@ -22,6 +19,7 @@ import net.minecraft.util.Vec3;
public class TileEntityYellowBarrel extends TileEntity { public class TileEntityYellowBarrel extends TileEntity {
@Override
public void updateEntity() { public void updateEntity() {
int strength = 4; int strength = 4;
float f = strength; float f = strength;
@ -43,20 +41,20 @@ public class TileEntityYellowBarrel extends TileEntity {
int i2 = MathHelper.floor_double(this.yCoord + wat + 1.0D); int i2 = MathHelper.floor_double(this.yCoord + wat + 1.0D);
int l = MathHelper.floor_double(this.zCoord - wat - 1.0D); int l = MathHelper.floor_double(this.zCoord - wat - 1.0D);
int j2 = MathHelper.floor_double(this.zCoord + wat + 1.0D); int j2 = MathHelper.floor_double(this.zCoord + wat + 1.0D);
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox((double)i, (double)k, (double)l, (double)j, (double)i2, (double)j2)); List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox(i, k, l, j, i2, j2));
Vec3 vec3 = Vec3.createVectorHelper(this.xCoord, this.yCoord, this.zCoord); Vec3 vec3 = Vec3.createVectorHelper(this.xCoord, this.yCoord, this.zCoord);
for (int i1 = 0; i1 < list.size(); ++i1) for (int i1 = 0; i1 < list.size(); ++i1)
{ {
Entity entity = (Entity)list.get(i1); Entity entity = (Entity)list.get(i1);
double d4 = entity.getDistance(this.xCoord, this.yCoord, this.zCoord) / (double)4; double d4 = entity.getDistance(this.xCoord, this.yCoord, this.zCoord) / 4;
if (d4 <= 1.0D) if (d4 <= 1.0D)
{ {
d5 = entity.posX - this.xCoord; d5 = entity.posX - this.xCoord;
d6 = entity.posY + (double)entity.getEyeHeight() - this.yCoord; d6 = entity.posY + entity.getEyeHeight() - this.yCoord;
d7 = entity.posZ - this.zCoord; d7 = entity.posZ - this.zCoord;
double d9 = (double)MathHelper.sqrt_double(d5 * d5 + d6 * d6 + d7 * d7); double d9 = MathHelper.sqrt_double(d5 * d5 + d6 * d6 + d7 * d7);
if (d9 < wat) if (d9 < wat)
{ {
if(entity instanceof EntityPlayer && Library.checkForHazmat((EntityPlayer)entity)) if(entity instanceof EntityPlayer && Library.checkForHazmat((EntityPlayer)entity))

View File

@ -3,7 +3,6 @@ package com.hbm.blocks;
import java.util.Random; import java.util.Random;
import com.hbm.entity.EntityNuclearCreeper; import com.hbm.entity.EntityNuclearCreeper;
import com.hbm.items.ModItems;
import com.hbm.lib.Library; import com.hbm.lib.Library;
import com.hbm.lib.RefStrings; import com.hbm.lib.RefStrings;
@ -12,13 +11,11 @@ import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockMushroom; import net.minecraft.block.BlockMushroom;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityCreeper; import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.item.Item; import net.minecraft.item.Item;
@ -38,6 +35,7 @@ public class WasteEarth extends Block {
this.setTickRandomly(true); this.setTickRandomly(true);
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) { public void registerBlockIcons(IIconRegister iconRegister) {
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + (this == ModBlocks.waste_earth ? ":waste_earth_top" : (this == ModBlocks.waste_mycelium ? ":waste_mycelium_top" : ":frozen_grass_top"))); this.iconTop = iconRegister.registerIcon(RefStrings.MODID + (this == ModBlocks.waste_earth ? ":waste_earth_top" : (this == ModBlocks.waste_mycelium ? ":waste_mycelium_top" : ":frozen_grass_top")));
@ -45,11 +43,13 @@ public class WasteEarth extends Block {
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + (this == ModBlocks.waste_earth ? ":waste_earth_side" : (this == ModBlocks.waste_mycelium ? ":waste_mycelium_side" : ":frozen_grass_side"))); this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + (this == ModBlocks.waste_earth ? ":waste_earth_side" : (this == ModBlocks.waste_mycelium ? ":waste_mycelium_side" : ":frozen_grass_side")));
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) { public IIcon getIcon(int side, int metadata) {
return side == 1 ? this.iconTop : (side == 0 ? this.iconBottom : this.blockIcon); return side == 1 ? this.iconTop : (side == 0 ? this.iconBottom : this.blockIcon);
} }
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{ {
if(this == ModBlocks.waste_earth || this == ModBlocks.waste_earth) if(this == ModBlocks.waste_earth || this == ModBlocks.waste_earth)
@ -65,11 +65,13 @@ public class WasteEarth extends Block {
return null; return null;
} }
@Override
public int quantityDropped(Random p_149745_1_) public int quantityDropped(Random p_149745_1_)
{ {
return 1; return 1;
} }
@Override
public void onEntityWalking(World p_149724_1_, int p_149724_2_, int p_149724_3_, int p_149724_4_, Entity entity) public void onEntityWalking(World p_149724_1_, int p_149724_2_, int p_149724_3_, int p_149724_4_, Entity entity)
{ {
if (entity instanceof EntityLivingBase && this == ModBlocks.waste_earth) if (entity instanceof EntityLivingBase && this == ModBlocks.waste_earth)
@ -124,6 +126,7 @@ public class WasteEarth extends Block {
} }
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_) public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_)
{ {
@ -131,11 +134,11 @@ public class WasteEarth extends Block {
if (this == ModBlocks.waste_earth) if (this == ModBlocks.waste_earth)
{ {
p_149734_1_.spawnParticle("townaura", (double)((float)p_149734_2_ + p_149734_5_.nextFloat()), (double)((float)p_149734_3_ + 1.1F), (double)((float)p_149734_4_ + p_149734_5_.nextFloat()), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("townaura", p_149734_2_ + p_149734_5_.nextFloat(), p_149734_3_ + 1.1F, p_149734_4_ + p_149734_5_.nextFloat(), 0.0D, 0.0D, 0.0D);
} }
if (this == ModBlocks.waste_mycelium) if (this == ModBlocks.waste_mycelium)
{ {
p_149734_1_.spawnParticle("townaura", (double)((float)p_149734_2_ + p_149734_5_.nextFloat()), (double)((float)p_149734_3_ + 1.1F), (double)((float)p_149734_4_ + p_149734_5_.nextFloat()), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("townaura", p_149734_2_ + p_149734_5_.nextFloat(), p_149734_3_ + 1.1F, p_149734_4_ + p_149734_5_.nextFloat(), 0.0D, 0.0D, 0.0D);
} }
} }

View File

@ -2,7 +2,6 @@ package com.hbm.blocks;
import java.util.Random; import java.util.Random;
import com.hbm.items.ModItems;
import com.hbm.lib.RefStrings; import com.hbm.lib.RefStrings;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
@ -10,10 +9,8 @@ import cpw.mods.fml.relauncher.SideOnly;
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.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
public class WasteLog extends Block { public class WasteLog extends Block {
@ -25,17 +22,20 @@ public class WasteLog extends Block {
super(p_i45394_1_); super(p_i45394_1_);
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) { public void registerBlockIcons(IIconRegister iconRegister) {
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + (this == ModBlocks.waste_log ? ":waste_log_top" : ":frozen_log_top")); this.iconTop = iconRegister.registerIcon(RefStrings.MODID + (this == ModBlocks.waste_log ? ":waste_log_top" : ":frozen_log_top"));
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + (this == ModBlocks.waste_log ? ":waste_log_side" : ":frozen_log")); this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + (this == ModBlocks.waste_log ? ":waste_log_side" : ":frozen_log"));
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) { public IIcon getIcon(int side, int metadata) {
return side == 1 ? this.iconTop : (side == 0 ? this.iconTop : this.blockIcon); return side == 1 ? this.iconTop : (side == 0 ? this.iconTop : this.blockIcon);
} }
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{ {
if(this == ModBlocks.waste_log) if(this == ModBlocks.waste_log)
@ -50,11 +50,13 @@ public class WasteLog extends Block {
return null; return null;
} }
@Override
public int quantityDropped(Random p_149745_1_) public int quantityDropped(Random p_149745_1_)
{ {
return 2 + p_149745_1_.nextInt(3); return 2 + p_149745_1_.nextInt(3);
} }
@Override
public int damageDropped(int p_149692_1_) public int damageDropped(int p_149692_1_)
{ {
return 1; return 1;

View File

@ -7,12 +7,9 @@ import com.hbm.lib.RefStrings;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer; import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.init.Blocks;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.Explosion; import net.minecraft.world.Explosion;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
@ -29,6 +26,7 @@ public class YellowBarrel extends BlockContainer {
return new TileEntityYellowBarrel(); return new TileEntityYellowBarrel();
} }
@Override
public void onBlockDestroyedByExplosion(World p_149723_1_, int p_149723_2_, int p_149723_3_, int p_149723_4_, Explosion p_149723_5_) public void onBlockDestroyedByExplosion(World p_149723_1_, int p_149723_2_, int p_149723_3_, int p_149723_4_, Explosion p_149723_5_)
{ {
if (!p_149723_1_.isRemote) if (!p_149723_1_.isRemote)
@ -42,40 +40,47 @@ public class YellowBarrel extends BlockContainer {
ExplosionNukeGeneric.waste(p_149695_1_, x, y, z, 35); ExplosionNukeGeneric.waste(p_149695_1_, x, y, z, 35);
} }
@Override
public int getRenderType(){ public int getRenderType(){
return -1; return -1;
} }
@Override
public boolean isOpaqueCube() { public boolean isOpaqueCube() {
return false; return false;
} }
@Override
public boolean renderAsNormalBlock() { public boolean renderAsNormalBlock() {
return false; return false;
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconregister) { public void registerBlockIcons(IIconRegister iconregister) {
this.blockIcon = iconregister.registerIcon(RefStrings.MODID + ":yellow_barrel"); this.blockIcon = iconregister.registerIcon(RefStrings.MODID + ":yellow_barrel");
} }
@Override
public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_)
{ {
float f = 0.0625F; float f = 0.0625F;
this.setBlockBounds(2*f, 0.0F, 2*f, 14*f, 1.0F, 14*f); this.setBlockBounds(2*f, 0.0F, 2*f, 14*f, 1.0F, 14*f);
} }
@Override
public boolean canDropFromExplosion(Explosion p_149659_1_) public boolean canDropFromExplosion(Explosion p_149659_1_)
{ {
return false; return false;
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_) public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_)
{ {
super.randomDisplayTick(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_, p_149734_5_); super.randomDisplayTick(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_, p_149734_5_);
p_149734_1_.spawnParticle("townaura", (double)((float)p_149734_2_ + p_149734_5_.nextFloat()), (double)((float)p_149734_3_ + 1.1F), (double)((float)p_149734_4_ + p_149734_5_.nextFloat()), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("townaura", p_149734_2_ + p_149734_5_.nextFloat(), p_149734_3_ + 1.1F, p_149734_4_ + p_149734_5_.nextFloat(), 0.0D, 0.0D, 0.0D);
} }
} }

View File

@ -1,6 +1,5 @@
package com.hbm.creativetabs; package com.hbm.creativetabs;
import com.hbm.blocks.ModBlocks;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;

View File

@ -2,7 +2,6 @@ package com.hbm.entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.ai.EntityAIBase; import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.entity.monster.EntityCreeper;
public class EntityAINuclearCreeperSwell extends EntityAIBase { public class EntityAINuclearCreeperSwell extends EntityAIBase {
/** The creeper that is swelling. */ /** The creeper that is swelling. */
@ -20,6 +19,7 @@ public class EntityAINuclearCreeperSwell extends EntityAIBase {
/** /**
* Returns whether the EntityAIBase should begin execution. * Returns whether the EntityAIBase should begin execution.
*/ */
@Override
public boolean shouldExecute() public boolean shouldExecute()
{ {
EntityLivingBase entitylivingbase = this.swellingCreeper.getAttackTarget(); EntityLivingBase entitylivingbase = this.swellingCreeper.getAttackTarget();
@ -29,6 +29,7 @@ public class EntityAINuclearCreeperSwell extends EntityAIBase {
/** /**
* Execute a one shot task or start executing a continuous task * Execute a one shot task or start executing a continuous task
*/ */
@Override
public void startExecuting() public void startExecuting()
{ {
this.swellingCreeper.getNavigator().clearPathEntity(); this.swellingCreeper.getNavigator().clearPathEntity();
@ -38,6 +39,7 @@ public class EntityAINuclearCreeperSwell extends EntityAIBase {
/** /**
* Resets the task * Resets the task
*/ */
@Override
public void resetTask() public void resetTask()
{ {
this.creeperAttackTarget = null; this.creeperAttackTarget = null;
@ -46,6 +48,7 @@ public class EntityAINuclearCreeperSwell extends EntityAIBase {
/** /**
* Updates the task * Updates the task
*/ */
@Override
public void updateTask() public void updateTask()
{ {
if (this.creeperAttackTarget == null) if (this.creeperAttackTarget == null)

View File

@ -83,11 +83,11 @@ public class EntityBullet extends Entity implements IProjectile
this.canBePickedUp = 1; this.canBePickedUp = 1;
} }
this.posY = p_i1755_2_.posY + (double)p_i1755_2_.getEyeHeight() - 0.10000000149011612D; this.posY = p_i1755_2_.posY + p_i1755_2_.getEyeHeight() - 0.10000000149011612D;
double d0 = p_i1755_3_.posX - p_i1755_2_.posX; double d0 = p_i1755_3_.posX - p_i1755_2_.posX;
double d1 = p_i1755_3_.boundingBox.minY + (double)(p_i1755_3_.height / 3.0F) - this.posY; double d1 = p_i1755_3_.boundingBox.minY + p_i1755_3_.height / 3.0F - this.posY;
double d2 = p_i1755_3_.posZ - p_i1755_2_.posZ; double d2 = p_i1755_3_.posZ - p_i1755_2_.posZ;
double d3 = (double)MathHelper.sqrt_double(d0 * d0 + d2 * d2); double d3 = MathHelper.sqrt_double(d0 * d0 + d2 * d2);
if (d3 >= 1.0E-7D) if (d3 >= 1.0E-7D)
{ {
@ -98,7 +98,7 @@ public class EntityBullet extends Entity implements IProjectile
this.setLocationAndAngles(p_i1755_2_.posX + d4, this.posY, p_i1755_2_.posZ + d5, f2, f3); this.setLocationAndAngles(p_i1755_2_.posX + d4, this.posY, p_i1755_2_.posZ + d5, f2, f3);
this.yOffset = 0.0F; this.yOffset = 0.0F;
float f4 = (float)d3 * 0.2F; float f4 = (float)d3 * 0.2F;
this.setThrowableHeading(d0, d1 + (double)f4, d2, p_i1755_4_, p_i1755_5_); this.setThrowableHeading(d0, d1 + f4, d2, p_i1755_4_, p_i1755_5_);
} }
} }
@ -114,15 +114,15 @@ public class EntityBullet extends Entity implements IProjectile
} }
this.setSize(0.5F, 0.5F); this.setSize(0.5F, 0.5F);
this.setLocationAndAngles(p_i1756_2_.posX, p_i1756_2_.posY + (double)p_i1756_2_.getEyeHeight(), p_i1756_2_.posZ, p_i1756_2_.rotationYaw, p_i1756_2_.rotationPitch); this.setLocationAndAngles(p_i1756_2_.posX, p_i1756_2_.posY + p_i1756_2_.getEyeHeight(), p_i1756_2_.posZ, p_i1756_2_.rotationYaw, p_i1756_2_.rotationPitch);
this.posX -= (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F); this.posX -= MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F;
this.posY -= 0.10000000149011612D; this.posY -= 0.10000000149011612D;
this.posZ -= (double)(MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F); this.posZ -= MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F;
this.setPosition(this.posX, this.posY, this.posZ); this.setPosition(this.posX, this.posY, this.posZ);
this.yOffset = 0.0F; this.yOffset = 0.0F;
this.motionX = (double)(-MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI)); this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI);
this.motionZ = (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI)); this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI);
this.motionY = (double)(-MathHelper.sin(this.rotationPitch / 180.0F * (float)Math.PI)); this.motionY = (-MathHelper.sin(this.rotationPitch / 180.0F * (float)Math.PI));
this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, p_i1756_3_ * 1.5F, 1.0F); this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, p_i1756_3_ * 1.5F, 1.0F);
//this.dmgMin = dmgMin; //this.dmgMin = dmgMin;
@ -143,6 +143,7 @@ public class EntityBullet extends Entity implements IProjectile
this.gravity = grav; this.gravity = grav;
} }
@Override
protected void entityInit() protected void entityInit()
{ {
this.dataWatcher.addObject(16, Byte.valueOf((byte)0)); this.dataWatcher.addObject(16, Byte.valueOf((byte)0));
@ -151,24 +152,25 @@ public class EntityBullet extends Entity implements IProjectile
/** /**
* Similar to setArrowHeading, it's point the throwable entity to a x, y, z direction. * Similar to setArrowHeading, it's point the throwable entity to a x, y, z direction.
*/ */
@Override
public void setThrowableHeading(double p_70186_1_, double p_70186_3_, double p_70186_5_, float p_70186_7_, float p_70186_8_) public void setThrowableHeading(double p_70186_1_, double p_70186_3_, double p_70186_5_, float p_70186_7_, float p_70186_8_)
{ {
float f2 = MathHelper.sqrt_double(p_70186_1_ * p_70186_1_ + p_70186_3_ * p_70186_3_ + p_70186_5_ * p_70186_5_); float f2 = MathHelper.sqrt_double(p_70186_1_ * p_70186_1_ + p_70186_3_ * p_70186_3_ + p_70186_5_ * p_70186_5_);
p_70186_1_ /= (double)f2; p_70186_1_ /= f2;
p_70186_3_ /= (double)f2; p_70186_3_ /= f2;
p_70186_5_ /= (double)f2; p_70186_5_ /= f2;
p_70186_1_ += this.rand.nextGaussian() * (double)(this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double)p_70186_8_; p_70186_1_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * p_70186_8_;
p_70186_3_ += this.rand.nextGaussian() * (double)(this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double)p_70186_8_; p_70186_3_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * p_70186_8_;
p_70186_5_ += this.rand.nextGaussian() * (double)(this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double)p_70186_8_; p_70186_5_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * p_70186_8_;
p_70186_1_ *= (double)p_70186_7_; p_70186_1_ *= p_70186_7_;
p_70186_3_ *= (double)p_70186_7_; p_70186_3_ *= p_70186_7_;
p_70186_5_ *= (double)p_70186_7_; p_70186_5_ *= p_70186_7_;
this.motionX = p_70186_1_; this.motionX = p_70186_1_;
this.motionY = p_70186_3_; this.motionY = p_70186_3_;
this.motionZ = p_70186_5_; this.motionZ = p_70186_5_;
float f3 = MathHelper.sqrt_double(p_70186_1_ * p_70186_1_ + p_70186_5_ * p_70186_5_); float f3 = MathHelper.sqrt_double(p_70186_1_ * p_70186_1_ + p_70186_5_ * p_70186_5_);
this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(p_70186_1_, p_70186_5_) * 180.0D / Math.PI); this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(p_70186_1_, p_70186_5_) * 180.0D / Math.PI);
this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(p_70186_3_, (double)f3) * 180.0D / Math.PI); this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(p_70186_3_, f3) * 180.0D / Math.PI);
this.ticksInGround = 0; this.ticksInGround = 0;
} }
@ -176,6 +178,7 @@ public class EntityBullet extends Entity implements IProjectile
* Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX,
* posY, posZ, yaw, pitch * posY, posZ, yaw, pitch
*/ */
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void setPositionAndRotation2(double p_70056_1_, double p_70056_3_, double p_70056_5_, float p_70056_7_, float p_70056_8_, int p_70056_9_) public void setPositionAndRotation2(double p_70056_1_, double p_70056_3_, double p_70056_5_, float p_70056_7_, float p_70056_8_, int p_70056_9_)
{ {
@ -186,6 +189,7 @@ public class EntityBullet extends Entity implements IProjectile
/** /**
* Sets the velocity to the args. Args: x, y, z * Sets the velocity to the args. Args: x, y, z
*/ */
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void setVelocity(double p_70016_1_, double p_70016_3_, double p_70016_5_) public void setVelocity(double p_70016_1_, double p_70016_3_, double p_70016_5_)
{ {
@ -197,7 +201,7 @@ public class EntityBullet extends Entity implements IProjectile
{ {
float f = MathHelper.sqrt_double(p_70016_1_ * p_70016_1_ + p_70016_5_ * p_70016_5_); float f = MathHelper.sqrt_double(p_70016_1_ * p_70016_1_ + p_70016_5_ * p_70016_5_);
this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(p_70016_1_, p_70016_5_) * 180.0D / Math.PI); this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(p_70016_1_, p_70016_5_) * 180.0D / Math.PI);
this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(p_70016_3_, (double)f) * 180.0D / Math.PI); this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(p_70016_3_, f) * 180.0D / Math.PI);
this.prevRotationPitch = this.rotationPitch; this.prevRotationPitch = this.rotationPitch;
this.prevRotationYaw = this.rotationYaw; this.prevRotationYaw = this.rotationYaw;
this.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); this.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
@ -209,6 +213,7 @@ public class EntityBullet extends Entity implements IProjectile
* Called to update the entity's position/logic. * Called to update the entity's position/logic.
*/ */
//@Override //@Override
@Override
public void onUpdate() public void onUpdate()
{ {
super.onUpdate(); super.onUpdate();
@ -280,7 +285,7 @@ public class EntityBullet extends Entity implements IProjectile
if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5)) if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5))
{ {
f1 = 0.3F; f1 = 0.3F;
AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand((double)f1, (double)f1, (double)f1); AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand(f1, f1, f1);
MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec31, vec3); MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec31, vec3);
if (movingobjectposition1 != null) if (movingobjectposition1 != null)
@ -320,7 +325,7 @@ public class EntityBullet extends Entity implements IProjectile
if (movingobjectposition.entityHit != null) if (movingobjectposition.entityHit != null)
{ {
f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
int k = MathHelper.ceiling_double_int((double)f2 * this.damage); int k = MathHelper.ceiling_double_int(f2 * this.damage);
if (this.getIsCritical()) if (this.getIsCritical())
{ {
@ -360,7 +365,7 @@ public class EntityBullet extends Entity implements IProjectile
if (f4 > 0.0F) if (f4 > 0.0F)
{ {
movingobjectposition.entityHit.addVelocity(this.motionX * (double)this.knockbackStrength * 0.6000000238418579D / (double)f4, 0.1D, this.motionZ * (double)this.knockbackStrength * 0.6000000238418579D / (double)f4); movingobjectposition.entityHit.addVelocity(this.motionX * this.knockbackStrength * 0.6000000238418579D / f4, 0.1D, this.motionZ * this.knockbackStrength * 0.6000000238418579D / f4);
} }
} }
@ -408,13 +413,13 @@ public class EntityBullet extends Entity implements IProjectile
this.field_145789_f = movingobjectposition.blockZ; this.field_145789_f = movingobjectposition.blockZ;
this.field_145790_g = this.worldObj.getBlock(this.field_145791_d, this.field_145792_e, this.field_145789_f); this.field_145790_g = this.worldObj.getBlock(this.field_145791_d, this.field_145792_e, this.field_145789_f);
this.inData = this.worldObj.getBlockMetadata(this.field_145791_d, this.field_145792_e, this.field_145789_f); this.inData = this.worldObj.getBlockMetadata(this.field_145791_d, this.field_145792_e, this.field_145789_f);
this.motionX = (double)((float)(movingobjectposition.hitVec.xCoord - this.posX)); this.motionX = ((float)(movingobjectposition.hitVec.xCoord - this.posX));
this.motionY = (double)((float)(movingobjectposition.hitVec.yCoord - this.posY)); this.motionY = ((float)(movingobjectposition.hitVec.yCoord - this.posY));
this.motionZ = (double)((float)(movingobjectposition.hitVec.zCoord - this.posZ)); this.motionZ = ((float)(movingobjectposition.hitVec.zCoord - this.posZ));
f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
this.posX -= this.motionX / (double)f2 * 0.05000000074505806D; this.posX -= this.motionX / f2 * 0.05000000074505806D;
this.posY -= this.motionY / (double)f2 * 0.05000000074505806D; this.posY -= this.motionY / f2 * 0.05000000074505806D;
this.posZ -= this.motionZ / (double)f2 * 0.05000000074505806D; this.posZ -= this.motionZ / f2 * 0.05000000074505806D;
this.inGround = true; this.inGround = true;
this.arrowShake = 7; this.arrowShake = 7;
this.setIsCritical(false); this.setIsCritical(false);
@ -462,7 +467,7 @@ public class EntityBullet extends Entity implements IProjectile
for (int l = 0; l < 4; ++l) for (int l = 0; l < 4; ++l)
{ {
f4 = 0.25F; f4 = 0.25F;
this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)f4, this.posY - this.motionY * (double)f4, this.posZ - this.motionZ * (double)f4, this.motionX, this.motionY, this.motionZ); this.worldObj.spawnParticle("bubble", this.posX - this.motionX * f4, this.posY - this.motionY * f4, this.posZ - this.motionZ * f4, this.motionX, this.motionY, this.motionZ);
} }
f3 = 0.8F; f3 = 0.8F;
@ -473,10 +478,10 @@ public class EntityBullet extends Entity implements IProjectile
this.extinguish(); this.extinguish();
} }
this.motionX *= (double)f3; this.motionX *= f3;
this.motionY *= (double)f3; this.motionY *= f3;
this.motionZ *= (double)f3; this.motionZ *= f3;
this.motionY -= (double)gravity; this.motionY -= gravity;
this.setPosition(this.posX, this.posY, this.posZ); this.setPosition(this.posX, this.posY, this.posZ);
this.func_145775_I(); this.func_145775_I();
} }
@ -485,6 +490,7 @@ public class EntityBullet extends Entity implements IProjectile
/** /**
* (abstract) Protected helper method to write subclass entity data to NBT. * (abstract) Protected helper method to write subclass entity data to NBT.
*/ */
@Override
public void writeEntityToNBT(NBTTagCompound p_70014_1_) public void writeEntityToNBT(NBTTagCompound p_70014_1_)
{ {
p_70014_1_.setShort("xTile", (short)this.field_145791_d); p_70014_1_.setShort("xTile", (short)this.field_145791_d);
@ -502,6 +508,7 @@ public class EntityBullet extends Entity implements IProjectile
/** /**
* (abstract) Protected helper method to read subclass entity data from NBT. * (abstract) Protected helper method to read subclass entity data from NBT.
*/ */
@Override
public void readEntityFromNBT(NBTTagCompound p_70037_1_) public void readEntityFromNBT(NBTTagCompound p_70037_1_)
{ {
this.field_145791_d = p_70037_1_.getShort("xTile"); this.field_145791_d = p_70037_1_.getShort("xTile");
@ -531,6 +538,7 @@ public class EntityBullet extends Entity implements IProjectile
/** /**
* Called by a player entity when they collide with an entity * Called by a player entity when they collide with an entity
*/ */
@Override
public void onCollideWithPlayer(EntityPlayer p_70100_1_) public void onCollideWithPlayer(EntityPlayer p_70100_1_)
{ {
if (!this.worldObj.isRemote && this.inGround && this.arrowShake <= 0) if (!this.worldObj.isRemote && this.inGround && this.arrowShake <= 0)
@ -554,11 +562,13 @@ public class EntityBullet extends Entity implements IProjectile
* returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to
* prevent them from trampling crops * prevent them from trampling crops
*/ */
@Override
protected boolean canTriggerWalking() protected boolean canTriggerWalking()
{ {
return false; return false;
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public float getShadowSize() public float getShadowSize()
{ {
@ -586,6 +596,7 @@ public class EntityBullet extends Entity implements IProjectile
/** /**
* If returns false, the item will not inflict any damage against entities. * If returns false, the item will not inflict any damage against entities.
*/ */
@Override
public boolean canAttackWithItem() public boolean canAttackWithItem()
{ {
return false; return false;

View File

@ -28,6 +28,7 @@ public class EntityGrenadeCluster extends EntityThrowable
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_); super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
} }
@Override
protected void onImpact(MovingObjectPosition p_70184_1_) protected void onImpact(MovingObjectPosition p_70184_1_)
{ {
if (p_70184_1_.entityHit != null) if (p_70184_1_.entityHit != null)
@ -39,7 +40,7 @@ public class EntityGrenadeCluster extends EntityThrowable
b0 = 3; b0 = 3;
} }
p_70184_1_.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), (float)b0); p_70184_1_.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), b0);
} }
if (!this.worldObj.isRemote) if (!this.worldObj.isRemote)

View File

@ -1,11 +1,9 @@
package com.hbm.entity; package com.hbm.entity;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.effect.EntityLightningBolt; import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.entity.monster.EntityBlaze; import net.minecraft.entity.monster.EntityBlaze;
import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -29,6 +27,7 @@ public class EntityGrenadeElectric extends EntityThrowable
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_); super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
} }
@Override
protected void onImpact(MovingObjectPosition p_70184_1_) protected void onImpact(MovingObjectPosition p_70184_1_)
{ {
if (p_70184_1_.entityHit != null) if (p_70184_1_.entityHit != null)
@ -40,7 +39,7 @@ public class EntityGrenadeElectric extends EntityThrowable
b0 = 3; b0 = 3;
} }
p_70184_1_.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), (float)b0); p_70184_1_.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), b0);
} }
if (!this.worldObj.isRemote) if (!this.worldObj.isRemote)

View File

@ -30,6 +30,7 @@ public class EntityGrenadeFire extends EntityThrowable
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_); super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
} }
@Override
protected void onImpact(MovingObjectPosition p_70184_1_) protected void onImpact(MovingObjectPosition p_70184_1_)
{ {
if (p_70184_1_.entityHit != null) if (p_70184_1_.entityHit != null)
@ -41,7 +42,7 @@ public class EntityGrenadeFire extends EntityThrowable
b0 = 3; b0 = 3;
} }
p_70184_1_.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), (float)b0); p_70184_1_.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), b0);
} }
if (!this.worldObj.isRemote) if (!this.worldObj.isRemote)

View File

@ -1,13 +1,8 @@
package com.hbm.entity; package com.hbm.entity;
import com.hbm.explosion.ExplosionChaos;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityBlaze;
import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -31,6 +26,7 @@ public class EntityGrenadeFlare extends EntityThrowable
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_); super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
} }
@Override
public void onUpdate() { public void onUpdate() {
super.onUpdate(); super.onUpdate();
if(this.ticksExisted > 250) if(this.ticksExisted > 250)
@ -39,6 +35,7 @@ public class EntityGrenadeFlare extends EntityThrowable
} }
} }
@Override
protected void onImpact(MovingObjectPosition p_70184_1_) protected void onImpact(MovingObjectPosition p_70184_1_)
{ {
this.motionX = 0; this.motionX = 0;

View File

@ -30,6 +30,7 @@ public class EntityGrenadeFrag extends EntityThrowable
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_); super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
} }
@Override
protected void onImpact(MovingObjectPosition p_70184_1_) protected void onImpact(MovingObjectPosition p_70184_1_)
{ {
if (p_70184_1_.entityHit != null) if (p_70184_1_.entityHit != null)
@ -41,7 +42,7 @@ public class EntityGrenadeFrag extends EntityThrowable
b0 = 3; b0 = 3;
} }
p_70184_1_.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), (float)b0); p_70184_1_.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), b0);
} }
if (!this.worldObj.isRemote) if (!this.worldObj.isRemote)

View File

@ -1,10 +1,8 @@
package com.hbm.entity; package com.hbm.entity;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityBlaze; import net.minecraft.entity.monster.EntityBlaze;
import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -30,6 +28,7 @@ public class EntityGrenadeGas extends EntityThrowable
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_); super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
} }
@Override
protected void onImpact(MovingObjectPosition p_70184_1_) protected void onImpact(MovingObjectPosition p_70184_1_)
{ {
if (p_70184_1_.entityHit != null) if (p_70184_1_.entityHit != null)
@ -41,7 +40,7 @@ public class EntityGrenadeGas extends EntityThrowable
b0 = 3; b0 = 3;
} }
p_70184_1_.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), (float)b0); p_70184_1_.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), b0);
} }
if (!this.worldObj.isRemote) if (!this.worldObj.isRemote)

View File

@ -1,12 +1,8 @@
package com.hbm.entity; package com.hbm.entity;
import com.hbm.explosion.ExplosionChaos;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityBlaze; import net.minecraft.entity.monster.EntityBlaze;
import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -30,6 +26,7 @@ public class EntityGrenadeGeneric extends EntityThrowable
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_); super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
} }
@Override
protected void onImpact(MovingObjectPosition p_70184_1_) protected void onImpact(MovingObjectPosition p_70184_1_)
{ {
if (p_70184_1_.entityHit != null) if (p_70184_1_.entityHit != null)
@ -41,7 +38,7 @@ public class EntityGrenadeGeneric extends EntityThrowable
b0 = 3; b0 = 3;
} }
p_70184_1_.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), (float)b0); p_70184_1_.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), b0);
} }
if (!this.worldObj.isRemote) if (!this.worldObj.isRemote)

View File

@ -1,12 +1,8 @@
package com.hbm.entity; package com.hbm.entity;
import com.hbm.explosion.ExplosionChaos;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityBlaze; import net.minecraft.entity.monster.EntityBlaze;
import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -31,6 +27,7 @@ public class EntityGrenadeNuke extends EntityThrowable
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_); super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
} }
@Override
protected void onImpact(MovingObjectPosition p_70184_1_) protected void onImpact(MovingObjectPosition p_70184_1_)
{ {
if (p_70184_1_.entityHit != null) if (p_70184_1_.entityHit != null)
@ -42,7 +39,7 @@ public class EntityGrenadeNuke extends EntityThrowable
b0 = 3; b0 = 3;
} }
p_70184_1_.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), (float)b0); p_70184_1_.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), b0);
} }
if (!this.worldObj.isRemote) if (!this.worldObj.isRemote)

View File

@ -1,13 +1,10 @@
package com.hbm.entity; package com.hbm.entity;
import com.hbm.explosion.ExplosionChaos;
import com.hbm.explosion.ExplosionNukeGeneric; import com.hbm.explosion.ExplosionNukeGeneric;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityBlaze; import net.minecraft.entity.monster.EntityBlaze;
import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -31,6 +28,7 @@ public class EntityGrenadePoison extends EntityThrowable
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_); super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
} }
@Override
protected void onImpact(MovingObjectPosition p_70184_1_) protected void onImpact(MovingObjectPosition p_70184_1_)
{ {
if (p_70184_1_.entityHit != null) if (p_70184_1_.entityHit != null)
@ -42,7 +40,7 @@ public class EntityGrenadePoison extends EntityThrowable
b0 = 3; b0 = 3;
} }
p_70184_1_.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), (float)b0); p_70184_1_.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), b0);
} }
if (!this.worldObj.isRemote) if (!this.worldObj.isRemote)

View File

@ -2,11 +2,9 @@ package com.hbm.entity;
import com.hbm.explosion.ExplosionChaos; import com.hbm.explosion.ExplosionChaos;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityBlaze; import net.minecraft.entity.monster.EntityBlaze;
import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -30,6 +28,7 @@ public class EntityGrenadeSchrabidium extends EntityThrowable
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_); super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
} }
@Override
protected void onImpact(MovingObjectPosition p_70184_1_) protected void onImpact(MovingObjectPosition p_70184_1_)
{ {
if (p_70184_1_.entityHit != null) if (p_70184_1_.entityHit != null)
@ -41,7 +40,7 @@ public class EntityGrenadeSchrabidium extends EntityThrowable
b0 = 3; b0 = 3;
} }
p_70184_1_.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), (float)b0); p_70184_1_.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), b0);
} }
if (!this.worldObj.isRemote) if (!this.worldObj.isRemote)

View File

@ -7,8 +7,6 @@ import net.minecraft.util.DamageSource;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World; import net.minecraft.world.World;
import com.hbm.explosion.ExplosionChaos;
public class EntityGrenadeStrong extends EntityThrowable public class EntityGrenadeStrong extends EntityThrowable
{ {
private static final String __OBFID = "CL_00001722"; private static final String __OBFID = "CL_00001722";
@ -28,6 +26,7 @@ public class EntityGrenadeStrong extends EntityThrowable
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_); super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
} }
@Override
protected void onImpact(MovingObjectPosition p_70184_1_) protected void onImpact(MovingObjectPosition p_70184_1_)
{ {
if (p_70184_1_.entityHit != null) if (p_70184_1_.entityHit != null)
@ -39,7 +38,7 @@ public class EntityGrenadeStrong extends EntityThrowable
b0 = 3; b0 = 3;
} }
p_70184_1_.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), (float)b0); p_70184_1_.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), b0);
} }
if (!this.worldObj.isRemote) if (!this.worldObj.isRemote)

View File

@ -2,10 +2,8 @@ package com.hbm.entity;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.Entity;
import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -53,7 +51,7 @@ public class EntityMirv extends EntityThrowable {
float f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); float f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
for (this.rotationPitch = (float)(Math.atan2(this.motionY, (double)f2) * 180.0D / Math.PI) - 90; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) for (this.rotationPitch = (float)(Math.atan2(this.motionY, f2) * 180.0D / Math.PI) - 90; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F)
{ {
; ;
} }
@ -79,6 +77,7 @@ public class EntityMirv extends EntityThrowable {
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public boolean isInRangeToRenderDist(double distance) public boolean isInRangeToRenderDist(double distance)
{ {

View File

@ -31,7 +31,7 @@ public class EntityMissileAntiBallistic extends EntityMissileBase {
if(missile0 == null) if(missile0 == null)
{ {
missile0 = ExplosionChaos.getHomingTarget(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 25, (Entity)this); missile0 = ExplosionChaos.getHomingTarget(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 25, this);
} }
if(missile0 != null && missile == null) if(missile0 != null && missile == null)
{ {

Some files were not shown because too many files have changed in this diff Show More