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 com.hbm.main.MainRegistry;
import com.hbm.world.HugeMush;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import net.minecraft.block.Block;
import net.minecraft.block.BlockMushroom;
import net.minecraft.block.IGrowable;
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.world.World;
import net.minecraft.world.gen.feature.WorldGenBigMushroom;
import net.minecraftforge.common.util.ForgeDirection;
public class BlockMush extends Block implements IGrowable {
@ -31,12 +24,14 @@ public class BlockMush extends Block implements IGrowable {
return p_149854_1_.func_149730_j();
}
public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
@Override
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_);
}
public boolean canBlockStay(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_)
@Override
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)
{
@ -61,16 +56,19 @@ public class BlockMush extends Block implements IGrowable {
return true;
}
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_)
@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_)
{
return true;
}
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_)
@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_)
{
return (double)p_149852_2_.nextFloat() < 0.4D;
return p_149852_2_.nextFloat() < 0.4D;
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_)
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_)
{
return null;
}
@ -79,7 +77,8 @@ 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
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
*/
public boolean isOpaqueCube()
@Override
public boolean isOpaqueCube()
{
return false;
}
@ -87,7 +86,8 @@ 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)
*/
public boolean renderAsNormalBlock()
@Override
public boolean renderAsNormalBlock()
{
return false;
}
@ -95,11 +95,13 @@ public class BlockMush extends Block implements IGrowable {
/**
* The type of render function that is called for this block
*/
public int getRenderType()
@Override
public int getRenderType()
{
return 1;
}
public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_)
@Override
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_);
this.checkAndDropBlock(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_);
@ -127,7 +129,8 @@ public class BlockMush extends Block implements IGrowable {
}
}
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_)
@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_)
{
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.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
@ -23,18 +22,21 @@ public class BlockMushHuge extends Block {
super(p_i45394_1_);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
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"));
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) {
return side == 1 ? this.iconTop : (side == 0 ? this.iconTop : this.blockIcon);
}
public int quantityDropped(Random p_149745_1_)
@Override
public int quantityDropped(Random p_149745_1_)
{
int i = p_149745_1_.nextInt(10) - 7;
@ -46,12 +48,14 @@ public class BlockMushHuge extends Block {
return i;
}
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{
return Item.getItemFromBlock(ModBlocks.mush);
}
@SideOnly(Side.CLIENT)
@Override
@SideOnly(Side.CLIENT)
public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_)
{
return Item.getItemFromBlock(ModBlocks.mush);

View File

@ -11,12 +11,9 @@ import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IEntityLivingData;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.potion.Potion;
@ -29,6 +26,7 @@ public class BlockOre extends Block {
super(p_i45394_1_);
}
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{
if(this == ModBlocks.ore_fluorite)
@ -63,7 +61,8 @@ public class BlockOre extends Block {
return Item.getItemFromBlock(this);
}
public int quantityDropped(Random p_149745_1_)
@Override
public int quantityDropped(Random p_149745_1_)
{
if(this == ModBlocks.ore_fluorite)
{
@ -81,12 +80,14 @@ public class BlockOre extends Block {
return 1;
}
public int damageDropped(int p_149692_1_)
@Override
public int damageDropped(int p_149692_1_)
{
return this == ModBlocks.waste_planks ? 1 : 0;
}
public void onEntityWalking(World p_149724_1_, int p_149724_2_, int p_149724_3_, int p_149724_4_, Entity entity)
@Override
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)
{
@ -159,14 +160,15 @@ public class BlockOre extends Block {
}
}
@SideOnly(Side.CLIENT)
@Override
@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_)
{
super.randomDisplayTick(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_, p_149734_5_);
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_);
}
@Override
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
{
this.worldObj = p_149695_1_;

View File

@ -23,17 +23,20 @@ public class BombFloat extends Block {
super(p_i45394_1_);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":bomb_float_top");
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":bomb_float");
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) {
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_)
{
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.material.Material;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityFallingBlock;
import net.minecraft.entity.item.EntityItem;
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.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@ -23,7 +20,6 @@ import net.minecraft.world.World;
import com.hbm.explosion.ExplosionChaos;
import com.hbm.explosion.ExplosionNukeGeneric;
import com.hbm.items.ModItems;
import com.hbm.main.MainRegistry;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
@ -52,11 +48,13 @@ public class BombMulti extends BlockContainer {
return new TileEntityBombMulti();
}
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{
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_)
{
if (!keepInventory)
@ -85,7 +83,7 @@ public class BombMulti extends BlockContainer {
}
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())
{
@ -93,9 +91,9 @@ public class BombMulti extends BlockContainer {
}
float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F);
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
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_);
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote)
{
@ -125,7 +124,8 @@ public class BombMulti extends BlockContainer {
}
}
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
@Override
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);
if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z))
@ -263,20 +263,24 @@ public class BombMulti extends BlockContainer {
return false;
}
@Override
public int getRenderType(){
return -1;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
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)
{
@ -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_)
{
float f = 0.0625F;

View File

@ -2,7 +2,6 @@ package com.hbm.blocks;
import java.util.Random;
import com.hbm.explosion.ExplosionChaos;
import com.hbm.explosion.ExplosionThermo;
import com.hbm.lib.RefStrings;
@ -27,12 +26,14 @@ public class BombThermo extends Block {
super(p_i45394_1_);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":therm_top");
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_)
{
if(this == ModBlocks.therm_endo)
@ -43,11 +44,13 @@ public class BombThermo extends Block {
return Item.getItemFromBlock(ModBlocks.therm_exo);
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) {
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_)
{
this.worldObj = p_149695_1_;

View File

@ -1,16 +1,10 @@
package com.hbm.blocks;
import java.util.List;
import org.lwjgl.opengl.GL11;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
@ -26,20 +20,24 @@ public class DecoBlock extends BlockContainer {
return new TileEntityDecoBlock();
}
@Override
public int getRenderType(){
return -1;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
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)
{
@ -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_)
{
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 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.SideOnly;
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.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
@ -29,6 +23,7 @@ public class DecoBlockAlt extends BlockContainer {
super(p_i45386_1_);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
this.blockIcon = iconRegister.registerIcon("stone");
@ -47,25 +42,30 @@ public class DecoBlockAlt extends BlockContainer {
return null;
}
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{
return Item.getItemFromBlock(ModBlocks.statue_elb);
}
@Override
public int getRenderType(){
return -1;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
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)
{
@ -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) {
if(world.isRemote)
{
@ -148,6 +149,7 @@ public class DecoBlockAlt extends BlockContainer {
return false;
}
@Override
public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_)
{
float f = 0.0625F;

View File

@ -6,7 +6,6 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class DecoPoleSatelliteReceiver extends BlockContainer {
@ -20,20 +19,24 @@ public class DecoPoleSatelliteReceiver extends BlockContainer {
return new TileEntityDecoPoleSatelliteReceiver();
}
@Override
public int getRenderType(){
return -1;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
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)
{

View File

@ -6,7 +6,6 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class DecoPoleTop extends BlockContainer {
@ -20,20 +19,24 @@ public class DecoPoleTop extends BlockContainer {
return new TileEntityDecoPoleTop();
}
@Override
public int getRenderType(){
return -1;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
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)
{

View File

@ -6,7 +6,6 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class DecoSteelPoles extends BlockContainer {
@ -20,20 +19,24 @@ public class DecoSteelPoles extends BlockContainer {
return new TileEntityDecoSteelPoles();
}
@Override
public int getRenderType(){
return -1;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
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)
{

View File

@ -19,20 +19,24 @@ public class DecoTapeRecorder extends BlockContainer{
return new TileEntityDecoTapeRecorder();
}
@Override
public int getRenderType(){
return -1;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
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)
{

View File

@ -14,7 +14,8 @@ public class DetCord extends Block {
super(p_i45394_1_);
}
public void onBlockDestroyedByExplosion(World p_149723_1_, int p_149723_2_, int p_149723_3_, int p_149723_4_, Explosion p_149723_5_)
@Override
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)
{
@ -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_)
{
if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z))
@ -30,7 +32,8 @@ public class DetCord extends Block {
}
}
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{
return null;
}

View File

@ -2,9 +2,6 @@ package com.hbm.blocks;
import com.hbm.lib.Library;
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.SideOnly;
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.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
@ -35,6 +31,7 @@ public class Guide extends Block {
super(p_i45394_1_);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
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");
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) {
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) {
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)
{
@ -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) {
if(!player.isSneaking())
{

View File

@ -19,9 +19,6 @@ import com.hbm.entity.EntityMissileMirv;
import com.hbm.entity.EntityMissileNuclear;
import com.hbm.entity.EntityMissileRain;
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.main.MainRegistry;
@ -55,11 +52,13 @@ public class LaunchPad extends BlockContainer {
return new TileEntityLaunchPad();
}
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{
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_)
{
if (!keepInventory)
@ -74,13 +73,13 @@ public class LaunchPad extends BlockContainer {
if (itemstack != null)
{
float f = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
float f1 = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
float f2 = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
float f = LaunchPad.field_149933_a.nextFloat() * 0.8F + 0.1F;
float f1 = LaunchPad.field_149933_a.nextFloat() * 0.8F + 0.1F;
float f2 = LaunchPad.field_149933_a.nextFloat() * 0.8F + 0.1F;
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)
{
@ -88,7 +87,7 @@ public class LaunchPad extends BlockContainer {
}
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())
{
@ -96,9 +95,9 @@ public class LaunchPad extends BlockContainer {
}
float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F);
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionX = (float)LaunchPad.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (float)LaunchPad.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float)LaunchPad.field_149933_a.nextGaussian() * f3;
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_);
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote)
{
@ -128,7 +128,8 @@ public class LaunchPad extends BlockContainer {
}
}
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
@Override
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);
if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z))
@ -283,20 +284,24 @@ public class LaunchPad extends BlockContainer {
}
}
@Override
public int getRenderType(){
return -1;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
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)
{
@ -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_)
{
float f = 0.0625F;

View File

@ -36,22 +36,26 @@ public class MachineBattery extends BlockContainer {
super(p_i45386_1_);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
this.iconFront = iconRegister.registerIcon(RefStrings.MODID + ":battery_front_alt");
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":battery_side_alt");
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) {
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_)
{
return Item.getItemFromBlock(ModBlocks.machine_battery);
}
@Override
public void onBlockAdded(World world, int x, int y, int z) {
super.onBlockAdded(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) {
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)
{
@ -119,7 +124,8 @@ public class MachineBattery extends BlockContainer {
return new TileEntityMachineBattery();
}
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
@Override
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);
if (p_149695_1_.isBlockIndirectlyGettingPowered(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) {
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_)
{
if (!keepInventory)
@ -177,7 +185,7 @@ public class MachineBattery extends BlockContainer {
}
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())
{
@ -185,9 +193,9 @@ public class MachineBattery extends BlockContainer {
}
float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F);
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
p_149749_1_.spawnEntityInWorld(entityitem);
}
}

View File

@ -31,18 +31,22 @@ public class MachineCentrifuge extends BlockContainer {
super(p_i45386_1_);
}
@Override
public int getRenderType(){
return -1;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconregister) {
this.blockIcon = iconregister.registerIcon(RefStrings.MODID + ":machine_centrifuge");
@ -53,13 +57,15 @@ public class MachineCentrifuge extends BlockContainer {
return new TileEntityMachineCentrifuge();
}
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{
return Item.getItemFromBlock(ModBlocks.machine_centrifuge);
}
@Override
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)
{
@ -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_)
{
if (!keepInventory)
@ -107,7 +114,7 @@ public class MachineCentrifuge extends BlockContainer {
}
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())
{
@ -115,9 +122,9 @@ public class MachineCentrifuge extends BlockContainer {
}
float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F);
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
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_);
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote)
{

View File

@ -40,12 +40,14 @@ public class MachineCoal extends BlockContainer {
isActive = blockState;
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
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");
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) {
//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);
}
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{
return Item.getItemFromBlock(ModBlocks.machine_coal_off);
}
@Override
public void onBlockAdded(World world, int x, int y, int z) {
super.onBlockAdded(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) {
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)
{
@ -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) {
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_)
{
if (!keepInventory)
@ -191,7 +198,7 @@ public class MachineCoal extends BlockContainer {
}
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())
{
@ -199,9 +206,9 @@ public class MachineCoal extends BlockContainer {
}
float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F);
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
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_);
}
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World p_149734_1_, int x, int y, int z, Random rand)
{
if (isActive)
{
int l = p_149734_1_.getBlockMetadata(x, y, z);
float f = (float)x + 0.5F;
float f1 = (float)y + 0.0F + rand.nextFloat() * 6.0F / 16.0F;
float f2 = (float)z + 0.5F;
float f = x + 0.5F;
float f1 = y + 0.0F + rand.nextFloat() * 6.0F / 16.0F;
float f2 = z + 0.5F;
float f3 = 0.52F;
float f4 = rand.nextFloat() * 0.6F - 0.3F;
float f5 = rand.nextFloat();
@ -230,23 +238,23 @@ public class MachineCoal extends BlockContainer {
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("flame", (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", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
}
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("flame", (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", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
}
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("flame", (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", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D);
}
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("flame", (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", 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_);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":machine_deuterium_side");
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":machine_deuterium_front");
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) {
return side == 1 ? this.iconTop : (side == 0 ? this.iconTop : this.blockIcon);
@ -50,11 +52,13 @@ public class MachineDeuterium extends BlockContainer {
return new TileEntityMachineDeuterium();
}
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{
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) {
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_)
{
if (!keepInventory)
@ -100,7 +105,7 @@ public class MachineDeuterium extends BlockContainer {
}
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())
{
@ -108,9 +113,9 @@ public class MachineDeuterium extends BlockContainer {
}
float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F);
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
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_);
}
@Override
@SideOnly(Side.CLIENT)
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())
{
int l = p_149734_1_.getBlockMetadata(x, y, z);
float f = (float)x + 0.5F;
float f1 = (float)y + 1.0F;
float f2 = (float)z + 0.5F;
float f = x + 0.5F;
float f1 = y + 1.0F;
float f2 = z + 0.5F;
p_149734_1_.spawnParticle("cloud", f, f1, f2, 0.0D, 0.1D, 0.0D);
}

View File

@ -1,6 +1,5 @@
package com.hbm.blocks;
import java.util.List;
import java.util.Random;
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.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityFurnace;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
@ -43,6 +40,7 @@ public class MachineDiFurnace extends BlockContainer {
isActive = blockState;
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
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");
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) {
//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));
}
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{
return Item.getItemFromBlock(ModBlocks.machine_difurnace_off);
}
@Override
public void onBlockAdded(World world, int x, int y, int z) {
super.onBlockAdded(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) {
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)
{
@ -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) {
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_)
{
if (!keepInventory)
@ -195,7 +199,7 @@ public class MachineDiFurnace extends BlockContainer {
}
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())
{
@ -203,9 +207,9 @@ public class MachineDiFurnace extends BlockContainer {
}
float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F);
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
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_);
}
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World p_149734_1_, int x, int y, int z, Random rand)
{
if (isActive)
{
int l = p_149734_1_.getBlockMetadata(x, y, z);
float f = (float)x + 0.5F;
float f1 = (float)y + 0.0F + rand.nextFloat() * 6.0F / 16.0F;
float f2 = (float)z + 0.5F;
float f = x + 0.5F;
float f1 = y + 0.0F + rand.nextFloat() * 6.0F / 16.0F;
float f2 = z + 0.5F;
float f3 = 0.52F;
float f4 = rand.nextFloat() * 0.6F - 0.3F;
float f5 = rand.nextFloat();
@ -234,27 +239,27 @@ public class MachineDiFurnace extends BlockContainer {
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("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)
{
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("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)
{
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("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)
{
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("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;
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
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");
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) {
//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);
}
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{
return Item.getItemFromBlock(ModBlocks.machine_electric_furnace_off);
}
@Override
public void onBlockAdded(World world, int x, int y, int z) {
super.onBlockAdded(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) {
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)
{
@ -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) {
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_)
{
if (!keepInventory)
@ -190,7 +197,7 @@ public class MachineElectricFurnace extends BlockContainer {
}
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())
{
@ -198,9 +205,9 @@ public class MachineElectricFurnace extends BlockContainer {
}
float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F);
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
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_);
}
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World p_149734_1_, int x, int y, int z, Random rand)
{
if (isActive)
{
int l = p_149734_1_.getBlockMetadata(x, y, z);
float f = (float)x + 0.5F;
float f1 = (float)y + 0.0F + rand.nextFloat() * 6.0F / 16.0F;
float f2 = (float)z + 0.5F;
float f = x + 0.5F;
float f1 = y + 0.0F + rand.nextFloat() * 6.0F / 16.0F;
float f2 = z + 0.5F;
float f3 = 0.52F;
float f4 = rand.nextFloat() * 0.6F - 0.3F;
float f5 = rand.nextFloat();
@ -229,23 +237,23 @@ public class MachineElectricFurnace extends BlockContainer {
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("flame", (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", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
}
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("flame", (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", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
}
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("flame", (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", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D);
}
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("flame", (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", 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.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.item.EntityTNTPrimed;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
@ -23,7 +21,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.Explosion;
import net.minecraft.world.World;
@ -44,22 +41,26 @@ public class MachineGenerator extends BlockContainer {
rand = new Random();
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
this.iconSide = iconRegister.registerIcon(RefStrings.MODID + ":machine_generator_side");
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":machine_generator");
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) {
return side == 0 ? blockIcon : (side == 1 ? blockIcon : iconSide);
}
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{
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) {
if(world.isRemote)
{
@ -82,6 +83,7 @@ public class MachineGenerator extends BlockContainer {
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_)
{
if (!keepInventory)
@ -110,7 +112,7 @@ public class MachineGenerator extends BlockContainer {
}
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())
{
@ -118,9 +120,9 @@ public class MachineGenerator extends BlockContainer {
}
float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F);
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
p_149749_1_.spawnEntityInWorld(entityitem);
}
}
@ -133,7 +135,8 @@ 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_);
}
public void onBlockDestroyedByExplosion(World p_149723_1_, int p_149723_2_, int p_149723_3_, int p_149723_4_, Explosion p_149723_5_)
@Override
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)
{

View File

@ -39,22 +39,26 @@ public class MachineNukeFurnace extends BlockContainer {
isActive = blockState;
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
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");
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) {
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_)
{
return Item.getItemFromBlock(ModBlocks.machine_nuke_furnace_off);
}
@Override
public void onBlockAdded(World world, int x, int y, int z) {
super.onBlockAdded(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) {
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)
{
@ -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) {
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_)
{
if (!keepInventory)
@ -188,7 +195,7 @@ public class MachineNukeFurnace extends BlockContainer {
}
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())
{
@ -196,9 +203,9 @@ public class MachineNukeFurnace extends BlockContainer {
}
float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F);
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
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_);
}
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World p_149734_1_, int x, int y, int z, Random rand)
{
if (isActive)
{
int l = p_149734_1_.getBlockMetadata(x, y, z);
float f = (float)x + 0.5F;
float f1 = (float)y + 0.0F + rand.nextFloat() * 6.0F / 16.0F;
float f2 = (float)z + 0.5F;
float f = x + 0.5F;
float f1 = y + 0.0F + rand.nextFloat() * 6.0F / 16.0F;
float f2 = z + 0.5F;
float f3 = 0.52F;
float f4 = rand.nextFloat() * 0.6F - 0.3F;
float f5 = rand.nextFloat();
@ -227,23 +235,23 @@ public class MachineNukeFurnace extends BlockContainer {
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("flame", (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", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
}
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("flame", (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", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
}
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("flame", (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", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D);
}
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("flame", (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", 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.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
@ -32,18 +31,22 @@ public class MachinePuF6Tank extends BlockContainer {
super(p_i45386_1_);
}
@Override
public int getRenderType(){
return -1;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconregister) {
this.blockIcon = iconregister.registerIcon(RefStrings.MODID + ":machine_puf6_tank");
@ -54,13 +57,15 @@ public class MachinePuF6Tank extends BlockContainer {
return new TileEntityMachinePuF6Tank();
}
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{
return Item.getItemFromBlock(ModBlocks.machine_puf6_tank);
}
@Override
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)
{
@ -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_)
{
if (!keepInventory)
@ -108,7 +114,7 @@ public class MachinePuF6Tank extends BlockContainer {
}
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())
{
@ -116,9 +122,9 @@ public class MachinePuF6Tank extends BlockContainer {
}
float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F);
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
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_);
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote)
{

View File

@ -1,6 +1,5 @@
package com.hbm.blocks;
import java.util.List;
import java.util.Random;
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.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityFurnace;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
@ -40,6 +37,7 @@ public class MachineReactor extends BlockContainer {
super(p_i45386_1_);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
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");
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) {
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_)
{
return Item.getItemFromBlock(ModBlocks.machine_reactor);
}
@Override
public void onBlockAdded(World world, int x, int y, int z) {
super.onBlockAdded(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) {
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)
{
@ -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) {
if(world.isRemote)
{
@ -142,6 +145,7 @@ public class MachineReactor extends BlockContainer {
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_)
{
if (true)
@ -170,7 +174,7 @@ public class MachineReactor extends BlockContainer {
}
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())
{
@ -178,9 +182,9 @@ public class MachineReactor extends BlockContainer {
}
float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F);
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
p_149749_1_.spawnEntityInWorld(entityitem);
}
}

View File

@ -40,22 +40,26 @@ public class MachineRtgFurnace extends BlockContainer {
isActive = blockState;
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
this.iconFront = iconRegister.registerIcon(RefStrings.MODID + (this.isActive ? ":machine_rtg_furnace_on" : ":machine_rtg_furnace_off"));
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":block_tungsten");
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) {
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_)
{
return Item.getItemFromBlock(ModBlocks.machine_rtg_furnace_off);
}
@Override
public void onBlockAdded(World world, int x, int y, int z) {
super.onBlockAdded(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) {
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)
{
@ -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) {
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_)
{
if (!keepInventory)
@ -189,7 +196,7 @@ public class MachineRtgFurnace extends BlockContainer {
}
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())
{
@ -197,9 +204,9 @@ public class MachineRtgFurnace extends BlockContainer {
}
float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F);
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
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_);
}
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World p_149734_1_, int x, int y, int z, Random rand)
{
if (isActive)
{
int l = p_149734_1_.getBlockMetadata(x, y, z);
float f = (float)x + 0.5F;
float f1 = (float)y + 0.0F + rand.nextFloat() * 6.0F / 16.0F;
float f2 = (float)z + 0.5F;
float f = x + 0.5F;
float f1 = y + 0.0F + rand.nextFloat() * 6.0F / 16.0F;
float f2 = z + 0.5F;
float f3 = 0.52F;
float f4 = rand.nextFloat() * 0.6F - 0.3F;
float f5 = rand.nextFloat();
@ -228,23 +236,23 @@ public class MachineRtgFurnace extends BlockContainer {
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("flame", (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", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
}
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("flame", (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", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
}
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("flame", (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", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D);
}
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("flame", (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", 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.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
@ -32,18 +31,22 @@ public class MachineUF6Tank extends BlockContainer {
super(p_i45386_1_);
}
@Override
public int getRenderType(){
return -1;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconregister) {
this.blockIcon = iconregister.registerIcon(RefStrings.MODID + ":machine_uf6_tank");
@ -54,13 +57,15 @@ public class MachineUF6Tank extends BlockContainer {
return new TileEntityMachineUF6Tank();
}
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{
return Item.getItemFromBlock(ModBlocks.machine_uf6_tank);
}
@Override
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)
{
@ -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_)
{
if (!keepInventory)
@ -108,7 +114,7 @@ public class MachineUF6Tank extends BlockContainer {
}
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())
{
@ -116,9 +122,9 @@ public class MachineUF6Tank extends BlockContainer {
}
float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F);
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
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_);
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote)
{

View File

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

View File

@ -1,38 +1,24 @@
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 com.hbm.entity.EntityNukeCloudSmall;
import com.hbm.entity.EntityNukeExplosion;
import com.hbm.entity.EntityNukeExplosionAdvanced;
import com.hbm.explosion.ExplosionNukeAdvanced;
import com.hbm.explosion.ExplosionNukeGeneric;
import com.hbm.main.MainRegistry;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
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.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
public class NukeBoy extends BlockContainer {
@ -51,11 +37,13 @@ public class NukeBoy extends BlockContainer {
return new TileEntityNukeBoy();
}
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{
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_)
{
if (!keepInventory)
@ -70,13 +58,13 @@ public class NukeBoy extends BlockContainer {
if (itemstack != null)
{
float f = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
float f1 = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
float f2 = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
float f = NukeBoy.field_149933_a.nextFloat() * 0.8F + 0.1F;
float f1 = NukeBoy.field_149933_a.nextFloat() * 0.8F + 0.1F;
float f2 = NukeBoy.field_149933_a.nextFloat() * 0.8F + 0.1F;
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)
{
@ -84,7 +72,7 @@ public class NukeBoy extends BlockContainer {
}
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())
{
@ -92,9 +80,9 @@ public class NukeBoy extends BlockContainer {
}
float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F);
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionX = (float)NukeBoy.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (float)NukeBoy.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float)NukeBoy.field_149933_a.nextGaussian() * f3;
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_);
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote)
{
@ -124,7 +113,8 @@ public class NukeBoy extends BlockContainer {
}
}
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
@Override
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);
if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z))
@ -183,20 +173,24 @@ public class NukeBoy extends BlockContainer {
return false;
}
@Override
public int getRenderType(){
return -1;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
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)
{

View File

@ -5,7 +5,6 @@ import java.util.Map;
import java.util.Random;
import com.hbm.entity.EntityNukeExplosionAdvanced;
import com.hbm.explosion.ExplosionNukeAdvanced;
import com.hbm.main.MainRegistry;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
@ -39,11 +38,13 @@ public class NukeFleija extends BlockContainer {
return new TileEntityNukeFleija();
}
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{
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_)
{
if (!keepInventory)
@ -72,7 +73,7 @@ public class NukeFleija extends BlockContainer {
}
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())
{
@ -80,9 +81,9 @@ public class NukeFleija extends BlockContainer {
}
float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F);
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
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_);
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote)
{
@ -112,7 +114,8 @@ public class NukeFleija extends BlockContainer {
}
}
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
@Override
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);
if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z))
@ -150,20 +153,24 @@ public class NukeFleija extends BlockContainer {
return false;
}
@Override
public int getRenderType(){
return -1;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
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)
{

View File

@ -1,39 +1,26 @@
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 com.hbm.entity.EntityNukeCloudSmall;
import com.hbm.entity.EntityNukeExplosion;
import com.hbm.entity.EntityNukeExplosionAdvanced;
import com.hbm.explosion.ExplosionNukeAdvanced;
import com.hbm.explosion.ExplosionNukeGeneric;
import com.hbm.main.MainRegistry;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
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.item.EntityItem;
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.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
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_)
{
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_)
{
if (!keepInventory)
@ -87,7 +76,7 @@ public class NukeGadget extends BlockContainer {
}
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())
{
@ -95,9 +84,9 @@ public class NukeGadget extends BlockContainer {
}
float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F);
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
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_);
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote)
{
@ -127,7 +117,8 @@ public class NukeGadget extends BlockContainer {
}
}
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
@Override
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);
if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z))
@ -376,20 +367,24 @@ public class NukeGadget extends BlockContainer {
}
}*/
@Override
public int getRenderType(){
return -1;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
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)
{

View File

@ -1,39 +1,26 @@
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 com.hbm.entity.EntityNukeCloudSmall;
import com.hbm.entity.EntityNukeExplosion;
import com.hbm.entity.EntityNukeExplosionAdvanced;
import com.hbm.explosion.ExplosionNukeAdvanced;
import com.hbm.explosion.ExplosionNukeGeneric;
import com.hbm.main.MainRegistry;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
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.item.EntityItem;
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.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
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_)
{
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_)
{
if (!keepInventory)
@ -86,7 +75,7 @@ public class NukeMan extends BlockContainer {
}
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())
{
@ -94,9 +83,9 @@ public class NukeMan extends BlockContainer {
}
float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F);
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
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_);
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote)
{
@ -126,7 +116,8 @@ public class NukeMan extends BlockContainer {
}
}
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
@Override
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);
if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z))
@ -375,20 +366,24 @@ public class NukeMan extends BlockContainer {
}
}*/
@Override
public int getRenderType(){
return -1;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
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)
{

View File

@ -5,7 +5,6 @@ import java.util.Map;
import java.util.Random;
import com.hbm.entity.EntityNukeExplosionAdvanced;
import com.hbm.explosion.ExplosionNukeAdvanced;
import com.hbm.main.MainRegistry;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
@ -39,11 +38,13 @@ public class NukeMike extends BlockContainer {
return new TileEntityNukeMike();
}
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{
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_)
{
if (!keepInventory)
@ -72,7 +73,7 @@ public class NukeMike extends BlockContainer {
}
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())
{
@ -80,9 +81,9 @@ public class NukeMike extends BlockContainer {
}
float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F);
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
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_);
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote)
{
@ -112,7 +114,8 @@ public class NukeMike extends BlockContainer {
}
}
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
@Override
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);
if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z))
@ -159,20 +162,24 @@ public class NukeMike extends BlockContainer {
return false;
}
@Override
public int getRenderType(){
return -1;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
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)
{

View File

@ -1,7 +1,6 @@
package com.hbm.blocks;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
@ -40,11 +39,13 @@ public class NukePrototype extends BlockContainer {
return new TileEntityNukePrototype();
}
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{
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_)
{
if (!keepInventory)
@ -73,7 +74,7 @@ public class NukePrototype extends BlockContainer {
}
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())
{
@ -81,9 +82,9 @@ public class NukePrototype extends BlockContainer {
}
float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F);
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
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_);
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote)
{
@ -123,7 +125,8 @@ public class NukePrototype extends BlockContainer {
}
}
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
@Override
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);
if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z))
@ -161,20 +164,24 @@ public class NukePrototype extends BlockContainer {
return false;
}
@Override
public int getRenderType(){
return -1;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
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)
{

View File

@ -5,7 +5,6 @@ import java.util.Map;
import java.util.Random;
import com.hbm.entity.EntityNukeExplosionAdvanced;
import com.hbm.explosion.ExplosionNukeAdvanced;
import com.hbm.main.MainRegistry;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
@ -39,11 +38,13 @@ public class NukeTsar extends BlockContainer {
return new TileEntityNukeTsar();
}
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{
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_)
{
if (!keepInventory)
@ -72,7 +73,7 @@ public class NukeTsar extends BlockContainer {
}
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())
{
@ -80,9 +81,9 @@ public class NukeTsar extends BlockContainer {
}
float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F);
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
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_);
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote)
{
@ -112,7 +114,8 @@ public class NukeTsar extends BlockContainer {
}
}
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
@Override
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);
if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z))
@ -159,20 +162,24 @@ public class NukeTsar extends BlockContainer {
return false;
}
@Override
public int getRenderType(){
return -1;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
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)
{

View File

@ -21,7 +21,8 @@ public class RedBarrel extends BlockContainer {
super(p_i45394_1_);
}
public void onBlockDestroyedByExplosion(World p_149723_1_, int p_149723_2_, int p_149723_3_, int p_149723_4_, Explosion p_149723_5_)
@Override
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)
{
@ -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_)
{
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,38 +41,45 @@ public class RedBarrel extends BlockContainer {
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(){
return -1;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
public TileEntity createNewTileEntity(World var1, int var2) {
return new TileEntityRedBarrel();
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconregister) {
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_)
{
float f = 0.0625F;
this.setBlockBounds(2*f, 0.0F, 2*f, 14*f, 1.0F, 14*f);
}
public boolean canDropFromExplosion(Explosion p_149659_1_)
@Override
public boolean canDropFromExplosion(Explosion p_149659_1_)
{
return false;
}

View File

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

View File

@ -6,7 +6,6 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
@ -27,7 +26,8 @@ public class ReinforcedLamp extends Block {
}
}
public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_)
@Override
public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_)
{
if (!p_149726_1_.isRemote)
{
@ -42,7 +42,8 @@ public class ReinforcedLamp extends Block {
}
}
public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_)
@Override
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)
{
@ -57,7 +58,8 @@ public class ReinforcedLamp extends Block {
}
}
public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_)
@Override
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_))
{
@ -65,18 +67,21 @@ public class ReinforcedLamp extends Block {
}
}
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{
return Item.getItemFromBlock(ModBlocks.reinforced_lamp_off);
}
@SideOnly(Side.CLIENT)
@Override
@SideOnly(Side.CLIENT)
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);
}
protected ItemStack createStackedBlock(int p_149644_1_)
@Override
protected ItemStack createStackedBlock(int p_149644_1_)
{
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.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.util.ChatComponentText;
import net.minecraft.world.Explosion;
import net.minecraft.world.World;
public class TestBomb extends Block {
@ -20,6 +16,7 @@ public class TestBomb extends Block {
super(p_i45394_1_);
}
@Override
public void onBlockAdded(World world, int x, int y, int z)
{
super.onBlockAdded(world, x, y, z);
@ -36,7 +33,8 @@ public class TestBomb extends Block {
* 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
*/
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
@Override
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))
{

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
@Override
public int getRenderType(){
return -1;
}
//Ob der Block transparent ist (Glas, Glowstone, Wasser, etc)
@Override
public boolean isOpaqueCube() {
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
@Override
public boolean renderAsNormalBlock() {
return false;
}
//Erstellen eines TileEntitys
@Override
public TileEntity createNewTileEntity(World var1, int var2) {
return new TileEntityTestBombAdvanced();
}
//GUI Blocktextur muss für Custommodel-Blocke nachträglich geändert werden
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconregister) {
this.blockIcon = iconregister.registerIcon(RefStrings.MODID + ":test_render");
}
//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_)
{
float f = 0.0625F;
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)
{
super.onBlockAdded(world, x, y, z);
@ -77,7 +84,8 @@ public class TestBombAdvanced extends BlockContainer {
}
}
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
@Override
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))
{

View File

@ -11,7 +11,6 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.BlockChest;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@ -35,6 +34,7 @@ public class TestContainer extends BlockChest {
private final Random field_149955_b = new Random();
//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_)
{
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 block3 = p_149689_1_.getBlock(p_149689_2_ + 1, p_149689_3_, p_149689_4_);
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)
{
@ -106,6 +106,7 @@ public class TestContainer extends BlockChest {
}
//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_)
{
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
@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_)
{
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;
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;
entityitem.motionX = (double)((float)this.field_149955_b.nextGaussian() * f3);
entityitem.motionY = (double)((float)this.field_149955_b.nextGaussian() * f3 + 0.2F);
entityitem.motionZ = (double)((float)this.field_149955_b.nextGaussian() * f3);
entityitem.motionX = (float)this.field_149955_b.nextGaussian() * f3;
entityitem.motionY = (float)this.field_149955_b.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float)this.field_149955_b.nextGaussian() * f3;
if (itemstack.hasTagCompound())
{
@ -165,9 +167,10 @@ public class TestContainer extends BlockChest {
}
//Allgemeine Inventarfunktion
@Override
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)
{
@ -226,7 +229,7 @@ public class TestContainer extends BlockChest {
//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_)
{
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;
do
@ -245,6 +248,7 @@ public class TestContainer extends BlockChest {
}
//Erzeugt ein neues Tileentity
@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_)
{
TileEntityTestContainer tileentitychest = new TileEntityTestContainer();
@ -252,6 +256,7 @@ public class TestContainer extends BlockChest {
}
//Registriert das Inventaricon
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister p_149651_1_)
{

View File

@ -6,32 +6,15 @@ import java.util.List;
import java.util.Map;
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.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.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EntitySmokeFX;
import net.minecraft.enchantment.EnchantmentProtection;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityFallingBlock;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.util.Vec3;
import net.minecraft.world.ChunkPosition;
import net.minecraft.world.World;
public class TestEventTester extends Block {
@ -44,7 +27,8 @@ public class TestEventTester extends Block {
protected static Random itemRand = new Random();
public World worldObj;
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
@Override
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
{
this.worldObj = p_149695_1_;
if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z))
@ -83,7 +67,8 @@ public class TestEventTester extends Block {
}
}*/
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
@Override
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 d1 = (float)par3 + 0.7F;
@ -133,7 +118,7 @@ public class TestEventTester extends Block {
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;
HashSet hashset = new HashSet();
int i;
@ -152,28 +137,28 @@ public class TestEventTester extends Block {
int i2 = MathHelper.floor_double(y + wat + 1.0D);
int l = 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 vec4 = Vec3.createVectorHelper(x, y + 1, z);
for (int i1 = 0; i1 < list.size(); ++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)
{
d5 = entity.posX - x;
d6 = entity.posY + (double)entity.getEyeHeight() - y;
d6 = entity.posY + entity.getEyeHeight() - y;
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)
{
d5 /= d9;
d6 /= d9;
d7 /= d9;
double d10 = (double)world.getBlockDensity(vec4, entity.boundingBox);
double d10 = world.getBlockDensity(vec4, entity.boundingBox);
double d11 = (1.0D - d4) * d10;
//entity.attackEntityFrom(DamageSource.generic, (float)(100 - d9/wat*100/d10));
@ -191,7 +176,7 @@ public class TestEventTester extends Block {
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;
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.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
public class TestMissile extends Block {
@ -15,7 +11,8 @@ public class TestMissile extends Block {
super(p_i45394_1_);
}
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
@Override
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);
if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z))

View File

@ -9,15 +9,12 @@ import java.util.Random;
import com.hbm.main.MainRegistry;
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.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.enchantment.EnchantmentProtection;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.passive.EntityOcelot;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
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_)
{
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_)
{
if (!keepInventory)
@ -84,7 +83,7 @@ public class TestNuke extends BlockContainer {
}
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())
{
@ -92,9 +91,9 @@ public class TestNuke extends BlockContainer {
}
float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F);
entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3);
entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
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_);
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote)
{
@ -124,7 +124,8 @@ public class TestNuke extends BlockContainer {
}
}
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
@Override
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);
if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z))
@ -203,29 +204,29 @@ public class TestNuke extends BlockContainer {
int i2 = MathHelper.floor_double(y + wat + 1.0D);
int l = 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);
for (int i1 = 0; i1 < list.size(); ++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)
{
d5 = entity.posX - x;
d6 = entity.posY + (double)entity.getEyeHeight() - y;
d6 = entity.posY + entity.getEyeHeight() - y;
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)
{
d5 /= d9;
d6 /= d9;
d7 /= d9;
double d10 = (double)world.getBlockDensity(vec3, entity.boundingBox);
double d10 = world.getBlockDensity(vec3, entity.boundingBox);
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);
entity.motionX += d5 * d8;
entity.motionY += d6 * d8;
@ -233,7 +234,7 @@ public class TestNuke extends BlockContainer {
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.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class TestObjTester extends BlockContainer{
@ -20,23 +19,28 @@ public class TestObjTester extends BlockContainer{
super(p_i45394_1_);
}
@Override
public int getRenderType(){
return -1;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
public TileEntity createNewTileEntity(World var1, int var2) {
return new TileEntityObjTester();
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconregister) {
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);
}*/
@Override
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)
{

View File

@ -3,7 +3,6 @@ package com.hbm.blocks;
import com.hbm.lib.RefStrings;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
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
@Override
public int getRenderType(){
return -1;
}
//Ob der Block transparent ist (Glas, Glowstone, Wasser, etc)
@Override
public boolean isOpaqueCube() {
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
@Override
public boolean renderAsNormalBlock() {
return false;
}
//Erstellen eines TileEntitys
@Override
public TileEntity createNewTileEntity(World var1, int var2) {
return new TileEntityTestRender();
}
//GUI Blocktextur muss für Custommodel-Blocke nachträglich geändert werden
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconregister) {
this.blockIcon = iconregister.registerIcon(RefStrings.MODID + ":test_render");
}
//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_)
{
float f = 0.0625F;

View File

@ -11,7 +11,6 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class TestRotationTester extends BlockContainer {
@ -20,30 +19,36 @@ public class TestRotationTester extends BlockContainer {
super(p_i45394_1_);
}
@Override
public int getRenderType(){
return -1;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
public TileEntity createNewTileEntity(World var1, int var2) {
return new TileEntityRotationTester();
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconregister) {
this.blockIcon = iconregister.registerIcon(RefStrings.MODID + ":test_render");
}
@Override
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)
{

View File

@ -2,12 +2,8 @@ package com.hbm.blocks;
import java.util.Random;
import com.hbm.particles.NukeSmokeFX;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
public class TestTicker extends Block {
@ -17,7 +13,8 @@ public class TestTicker extends Block {
this.setTickRandomly(true);
}
public void updateTick(World world, int x, int y, int z, Random rand) {
@Override
public void updateTick(World world, int x, int y, int z, Random rand) {
{
if(world.getBlock(x + 1, y, z) != ModBlocks.test_ticker) {

View File

@ -100,7 +100,7 @@ public class TileEntityBombMulti extends TileEntity implements ISidedInventory {
{
return false;
}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;
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
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++)
{
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i);
NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length)
{
@ -150,6 +151,7 @@ public class TileEntityBombMulti extends TileEntity implements ISidedInventory {
}
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
NBTTagList list = new NBTTagList();
@ -263,6 +265,6 @@ public class TileEntityBombMulti extends TileEntity implements ISidedInventory {
@Override
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
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
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.List;
import com.hbm.entity.EntityNuclearCreeper;
import com.hbm.lib.Library;
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.potion.Potion;
import net.minecraft.potion.PotionEffect;
@ -19,6 +14,7 @@ import net.minecraft.util.Vec3;
public class TileEntityDecoBlockAltF extends TileEntity {
@Override
public void updateEntity() {
int strength = 4;
float f = strength;
@ -40,20 +36,20 @@ public class TileEntityDecoBlockAltF extends TileEntity {
int i2 = MathHelper.floor_double(this.yCoord + wat + 1.0D);
int l = 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);
for (int i1 = 0; i1 < list.size(); ++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)
{
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;
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(entity instanceof EntityPlayer) {
@ -69,6 +65,6 @@ public class TileEntityDecoBlockAltF extends TileEntity {
@Override
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
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
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.items.ModItems;
import net.minecraft.block.BlockFurnace;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@ -91,12 +89,14 @@ public class TileEntityDiFurnace extends TileEntity implements ISidedInventory {
{
return false;
}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)
@Override
public void openInventory() {}
@Override
public void closeInventory() {}
@Override
@ -128,6 +128,7 @@ public class TileEntityDiFurnace extends TileEntity implements ISidedInventory {
}
}
@Override
public ItemStack decrStackSize(int i, int j) {
if(slots[i] != null)
{
@ -149,6 +150,7 @@ public class TileEntityDiFurnace extends TileEntity implements ISidedInventory {
}
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
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++)
{
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i);
NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length)
{
@ -169,6 +171,7 @@ public class TileEntityDiFurnace extends TileEntity implements ISidedInventory {
}
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
nbt.setShort("powerTime", (short) dualPower);
@ -275,6 +278,7 @@ public class TileEntityDiFurnace extends TileEntity implements ISidedInventory {
return this.dualCookTime > 0;
}
@Override
public void updateEntity() {
boolean flag = this.hasPower();
boolean flag1 = false;
@ -298,7 +302,7 @@ public class TileEntityDiFurnace extends TileEntity implements ISidedInventory {
//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]);
if(this.slots[2] != null)
@ -327,7 +331,7 @@ public class TileEntityDiFurnace extends TileEntity implements ISidedInventory {
{
dualCookTime++;
if(this.dualCookTime == this.processingSpeed)
if(this.dualCookTime == TileEntityDiFurnace.processingSpeed)
{
this.dualCookTime = 0;
this.processItem();

View File

@ -91,12 +91,14 @@ public class TileEntityLaunchPad extends TileEntity implements ISidedInventory {
{
return false;
}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)
@Override
public void openInventory() {}
@Override
public void closeInventory() {}
@Override
@ -104,6 +106,7 @@ public class TileEntityLaunchPad extends TileEntity implements ISidedInventory {
return true;
}
@Override
public ItemStack decrStackSize(int i, int j) {
if(slots[i] != null)
{
@ -125,6 +128,7 @@ public class TileEntityLaunchPad extends TileEntity implements ISidedInventory {
}
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
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++)
{
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i);
NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length)
{
@ -143,6 +147,7 @@ public class TileEntityLaunchPad extends TileEntity implements ISidedInventory {
}
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
NBTTagList list = new NBTTagList();
@ -182,6 +187,7 @@ public class TileEntityLaunchPad extends TileEntity implements ISidedInventory {
return (power * i) / maxPower;
}
@Override
public void updateEntity() {
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
public AxisAlignedBB getRenderBoundingBox() {
return this.INFINITE_EXTENT_AABB;
return TileEntity.INFINITE_EXTENT_AABB;
}
public World getThatWorld() {

View File

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

View File

@ -3,11 +3,9 @@ package com.hbm.blocks;
import com.hbm.gui.MachineRecipes;
import com.hbm.items.ModItems;
import net.minecraft.block.BlockFurnace;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@ -92,12 +90,14 @@ public class TileEntityMachineCentrifuge extends TileEntity implements ISidedInv
{
return false;
}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)
@Override
public void openInventory() {}
@Override
public void closeInventory() {}
@Override
@ -129,6 +129,7 @@ public class TileEntityMachineCentrifuge extends TileEntity implements ISidedInv
}
}
@Override
public ItemStack decrStackSize(int i, int j) {
if(slots[i] != null)
{
@ -150,6 +151,7 @@ public class TileEntityMachineCentrifuge extends TileEntity implements ISidedInv
}
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
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++)
{
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i);
NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length)
{
@ -170,6 +172,7 @@ public class TileEntityMachineCentrifuge extends TileEntity implements ISidedInv
}
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
nbt.setShort("powerTime", (short) dualPower);
@ -330,6 +333,7 @@ public class TileEntityMachineCentrifuge extends TileEntity implements ISidedInv
return this.dualCookTime > 0;
}
@Override
public void updateEntity() {
boolean flag = this.hasPower();
boolean flag1 = false;
@ -353,7 +357,7 @@ public class TileEntityMachineCentrifuge extends TileEntity implements ISidedInv
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]);
if(this.slots[1] != null)
@ -382,7 +386,7 @@ public class TileEntityMachineCentrifuge extends TileEntity implements ISidedInv
{
dualCookTime++;
if(this.dualCookTime == this.processingSpeed)
if(this.dualCookTime == TileEntityMachineCentrifuge.processingSpeed)
{
this.dualCookTime = 0;
this.processItem();
@ -412,6 +416,6 @@ public class TileEntityMachineCentrifuge extends TileEntity implements ISidedInv
@Override
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.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
@ -89,12 +88,14 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
{
return false;
}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)
@Override
public void openInventory() {}
@Override
public void closeInventory() {}
@Override
@ -102,6 +103,7 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
return true;
}
@Override
public ItemStack decrStackSize(int i, int j) {
if(slots[i] != null)
{
@ -123,6 +125,7 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
}
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
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++)
{
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i);
NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length)
{
@ -142,6 +145,7 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
}
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
nbt.setShort("powerTime", (short) power);
@ -185,6 +189,7 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
return (power * i) / maxPower;
}
@Override
public void updateEntity() {
//Water
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)
{
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;
this.power -= 100;
@ -254,7 +259,7 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
if(worldObj.getBlock(xCoord - 1, yCoord, zCoord) instanceof MachineElectricFurnace)
{
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;
this.power -= 100;
@ -263,7 +268,7 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
if(worldObj.getBlock(xCoord, yCoord + 1, zCoord) instanceof MachineElectricFurnace)
{
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;
this.power -= 100;
@ -272,7 +277,7 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
if(worldObj.getBlock(xCoord, yCoord - 1, zCoord) instanceof MachineElectricFurnace)
{
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;
this.power -= 100;
@ -281,7 +286,7 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
if(worldObj.getBlock(xCoord, yCoord, zCoord + 1) instanceof MachineElectricFurnace)
{
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;
this.power -= 100;
@ -290,7 +295,7 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
if(worldObj.getBlock(xCoord, yCoord, zCoord - 1) instanceof MachineElectricFurnace)
{
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;
this.power -= 100;
@ -301,54 +306,54 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
if(worldObj.getBlock(xCoord + 1, yCoord, zCoord) instanceof WireCoated)
{
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;
}
}
if(worldObj.getBlock(xCoord - 1, yCoord, zCoord) instanceof WireCoated)
{
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;
}
}
if(worldObj.getBlock(xCoord, yCoord + 1, zCoord) instanceof WireCoated)
{
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;
}
}
if(worldObj.getBlock(xCoord, yCoord - 1, zCoord) instanceof WireCoated)
{
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;
}
}
if(worldObj.getBlock(xCoord, yCoord, zCoord + 1) instanceof WireCoated)
{
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;
}
}
if(worldObj.getBlock(xCoord, yCoord, zCoord - 1) instanceof WireCoated)
{
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;
}
}
@ -357,7 +362,7 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
if(worldObj.getBlock(xCoord + 1, yCoord, zCoord) instanceof MachineDeuterium)
{
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;
this.power -= 100;
@ -366,7 +371,7 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
if(worldObj.getBlock(xCoord - 1, yCoord, zCoord) instanceof MachineDeuterium)
{
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;
this.power -= 100;
@ -375,7 +380,7 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
if(worldObj.getBlock(xCoord, yCoord + 1, zCoord) instanceof MachineDeuterium)
{
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;
this.power -= 100;
@ -384,7 +389,7 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
if(worldObj.getBlock(xCoord, yCoord - 1, zCoord) instanceof MachineDeuterium)
{
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;
this.power -= 100;
@ -393,7 +398,7 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
if(worldObj.getBlock(xCoord, yCoord, zCoord + 1) instanceof MachineDeuterium)
{
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;
this.power -= 100;
@ -402,7 +407,7 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
if(worldObj.getBlock(xCoord, yCoord, zCoord - 1) instanceof MachineDeuterium)
{
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;
this.power -= 100;

View File

@ -88,11 +88,13 @@ public class TileEntityMachineDeuterium extends TileEntity implements ISidedInve
{
return false;
}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() {}
@Override
public void closeInventory() {}
@Override
@ -100,6 +102,7 @@ public class TileEntityMachineDeuterium extends TileEntity implements ISidedInve
return false;
}
@Override
public ItemStack decrStackSize(int i, int j) {
if(slots[i] != null)
{
@ -121,6 +124,7 @@ public class TileEntityMachineDeuterium extends TileEntity implements ISidedInve
}
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
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++)
{
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i);
NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length)
{
@ -142,6 +146,7 @@ public class TileEntityMachineDeuterium extends TileEntity implements ISidedInve
}
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
nbt.setShort("power", (short) power);
@ -235,6 +240,7 @@ public class TileEntityMachineDeuterium extends TileEntity implements ISidedInve
}
}
@Override
public void updateEntity() {
if(slots[2] != null && slots[2].getItem() == ModItems.sulfur && sulfur + 125 <= maxFill)
{

View File

@ -1,13 +1,10 @@
package com.hbm.blocks;
import com.hbm.gui.MachineRecipes;
import com.hbm.items.ModItems;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.nbt.NBTTagCompound;
@ -89,12 +86,14 @@ public class TileEntityMachineElectricFurnace extends TileEntity implements ISid
{
return false;
}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)
@Override
public void openInventory() {}
@Override
public void closeInventory() {}
@Override
@ -102,6 +101,7 @@ public class TileEntityMachineElectricFurnace extends TileEntity implements ISid
return true;
}
@Override
public ItemStack decrStackSize(int i, int j) {
if(slots[i] != null)
{
@ -123,6 +123,7 @@ public class TileEntityMachineElectricFurnace extends TileEntity implements ISid
}
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
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++)
{
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i);
NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length)
{
@ -142,6 +143,7 @@ public class TileEntityMachineElectricFurnace extends TileEntity implements ISid
}
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
nbt.setShort("powerTime", (short) power);
@ -251,6 +253,7 @@ public class TileEntityMachineElectricFurnace extends TileEntity implements ISid
}
}
@Override
public void updateEntity() {
boolean flag = this.hasPower();
boolean flag1 = false;
@ -263,7 +266,7 @@ public class TileEntityMachineElectricFurnace extends TileEntity implements ISid
power -= 5;
if(this.dualCookTime == this.processingSpeed)
if(this.dualCookTime == TileEntityMachineElectricFurnace.processingSpeed)
{
this.dualCookTime = 0;
this.processItem();

View File

@ -9,7 +9,6 @@ import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
@ -93,12 +92,14 @@ public class TileEntityMachineGenerator extends TileEntity implements ISidedInve
{
return false;
}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)
@Override
public void openInventory() {}
@Override
public void closeInventory() {}
@Override
@ -106,6 +107,7 @@ public class TileEntityMachineGenerator extends TileEntity implements ISidedInve
return true;
}
@Override
public ItemStack decrStackSize(int i, int j) {
if(slots[i] != null)
{
@ -127,6 +129,7 @@ public class TileEntityMachineGenerator extends TileEntity implements ISidedInve
}
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
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++)
{
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i);
NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length)
{
@ -148,6 +151,7 @@ public class TileEntityMachineGenerator extends TileEntity implements ISidedInve
}
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
nbt.setShort("water", (short) water);
@ -218,6 +222,7 @@ public class TileEntityMachineGenerator extends TileEntity implements ISidedInve
return heat > 0;
}
@Override
public void updateEntity() {
if(!worldObj.isRemote)
@ -735,17 +740,17 @@ public class TileEntityMachineGenerator extends TileEntity implements ISidedInve
entity instanceof TileEntityMachineBattery ||
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;
this.power -= 100;
} 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;
} 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;
this.power -= 100;

View File

@ -3,10 +3,8 @@ package com.hbm.blocks;
import com.hbm.items.ModItems;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
@ -86,11 +84,13 @@ public class TileEntityMachinePuF6Tank extends TileEntity implements ISidedInven
{
return false;
}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() {}
@Override
public void closeInventory() {}
@Override
@ -98,6 +98,7 @@ public class TileEntityMachinePuF6Tank extends TileEntity implements ISidedInven
return false;
}
@Override
public ItemStack decrStackSize(int i, int j) {
if(slots[i] != null)
{
@ -119,6 +120,7 @@ public class TileEntityMachinePuF6Tank extends TileEntity implements ISidedInven
}
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
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++)
{
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i);
NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length)
{
@ -137,6 +139,7 @@ public class TileEntityMachinePuF6Tank extends TileEntity implements ISidedInven
}
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
nbt.setShort("fillState", (short) fillState);
@ -205,6 +208,7 @@ public class TileEntityMachinePuF6Tank extends TileEntity implements ISidedInven
return false;
}
@Override
public void updateEntity() {
if(!worldObj.isRemote)
@ -253,6 +257,6 @@ public class TileEntityMachinePuF6Tank extends TileEntity implements ISidedInven
@Override
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.items.ModItems;
import net.minecraft.block.BlockFurnace;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@ -91,12 +88,14 @@ public class TileEntityMachineReactor extends TileEntity implements ISidedInvent
{
return false;
}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)
@Override
public void openInventory() {}
@Override
public void closeInventory() {}
@Override
@ -141,6 +140,7 @@ public class TileEntityMachineReactor extends TileEntity implements ISidedInvent
}
}
@Override
public ItemStack decrStackSize(int i, int j) {
if(slots[i] != null)
{
@ -162,6 +162,7 @@ public class TileEntityMachineReactor extends TileEntity implements ISidedInvent
}
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
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++)
{
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i);
NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length)
{
@ -182,6 +183,7 @@ public class TileEntityMachineReactor extends TileEntity implements ISidedInvent
}
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
nbt.setShort("powerTime", (short) dualPower);
@ -293,6 +295,7 @@ public class TileEntityMachineReactor extends TileEntity implements ISidedInvent
return this.dualCookTime > 0;
}
@Override
public void updateEntity() {
boolean flag = this.hasPower();
boolean flag1 = false;
@ -330,7 +333,7 @@ public class TileEntityMachineReactor extends TileEntity implements ISidedInvent
{
dualCookTime++;
if(this.dualCookTime == this.processingSpeed)
if(this.dualCookTime == TileEntityMachineReactor.processingSpeed)
{
this.dualCookTime = 0;
this.processItem();

View File

@ -3,10 +3,8 @@ package com.hbm.blocks;
import com.hbm.items.ModItems;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
@ -86,11 +84,13 @@ public class TileEntityMachineUF6Tank extends TileEntity implements ISidedInvent
{
return false;
}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() {}
@Override
public void closeInventory() {}
@Override
@ -98,6 +98,7 @@ public class TileEntityMachineUF6Tank extends TileEntity implements ISidedInvent
return false;
}
@Override
public ItemStack decrStackSize(int i, int j) {
if(slots[i] != null)
{
@ -119,6 +120,7 @@ public class TileEntityMachineUF6Tank extends TileEntity implements ISidedInvent
}
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
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++)
{
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i);
NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length)
{
@ -137,6 +139,7 @@ public class TileEntityMachineUF6Tank extends TileEntity implements ISidedInvent
}
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
nbt.setShort("fillState", (short) fillState);
@ -205,6 +208,7 @@ public class TileEntityMachineUF6Tank extends TileEntity implements ISidedInvent
return false;
}
@Override
public void updateEntity() {
if(!worldObj.isRemote)
@ -253,6 +257,6 @@ public class TileEntityMachineUF6Tank extends TileEntity implements ISidedInvent
@Override
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;
}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;
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
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++)
{
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i);
NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length)
{
@ -148,6 +149,7 @@ public class TileEntityNukeBoy extends TileEntity implements ISidedInventory {
}
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
NBTTagList list = new NBTTagList();
@ -186,6 +188,6 @@ public class TileEntityNukeBoy extends TileEntity implements ISidedInventory {
@Override
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;
}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;
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
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++)
{
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i);
NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length)
{
@ -148,6 +149,7 @@ public class TileEntityNukeFleija extends TileEntity implements ISidedInventory
}
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
NBTTagList list = new NBTTagList();
@ -195,7 +197,7 @@ public class TileEntityNukeFleija extends TileEntity implements ISidedInventory
@Override
public AxisAlignedBB getRenderBoundingBox() {
return this.INFINITE_EXTENT_AABB;
return TileEntity.INFINITE_EXTENT_AABB;
}
}

View File

@ -1,11 +1,8 @@
package com.hbm.blocks;
import com.hbm.gui.MachineRecipes;
import com.hbm.items.ModItems;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@ -89,12 +86,14 @@ public class TileEntityNukeFurnace extends TileEntity implements ISidedInventory
{
return false;
}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)
@Override
public void openInventory() {}
@Override
public void closeInventory() {}
@Override
@ -139,6 +138,7 @@ public class TileEntityNukeFurnace extends TileEntity implements ISidedInventory
}
}
@Override
public ItemStack decrStackSize(int i, int j) {
if(slots[i] != null)
{
@ -160,6 +160,7 @@ public class TileEntityNukeFurnace extends TileEntity implements ISidedInventory
}
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
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++)
{
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i);
NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length)
{
@ -179,6 +180,7 @@ public class TileEntityNukeFurnace extends TileEntity implements ISidedInventory
}
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
nbt.setShort("powerTime", (short) dualPower);
@ -290,6 +292,7 @@ public class TileEntityNukeFurnace extends TileEntity implements ISidedInventory
return this.dualCookTime > 0;
}
@Override
public void updateEntity() {
boolean flag = this.hasPower();
boolean flag1 = false;
@ -314,7 +317,7 @@ public class TileEntityNukeFurnace extends TileEntity implements ISidedInventory
{
dualCookTime++;
if(this.dualCookTime == this.processingSpeed)
if(this.dualCookTime == TileEntityNukeFurnace.processingSpeed)
{
this.dualCookTime = 0;
this.processItem();

View File

@ -3,10 +3,8 @@ package com.hbm.blocks;
import com.hbm.items.ModItems;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
@ -100,7 +98,7 @@ public class TileEntityNukeGadget extends TileEntity implements ISidedInventory
{
return false;
}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;
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
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++)
{
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i);
NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length)
{
@ -150,6 +149,7 @@ public class TileEntityNukeGadget extends TileEntity implements ISidedInventory
}
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
NBTTagList list = new NBTTagList();
@ -250,6 +250,6 @@ public class TileEntityNukeGadget extends TileEntity implements ISidedInventory
@Override
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 net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
@ -100,7 +98,7 @@ public class TileEntityNukeMan extends TileEntity implements ISidedInventory {
{
return false;
}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;
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
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++)
{
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i);
NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length)
{
@ -150,6 +149,7 @@ public class TileEntityNukeMan extends TileEntity implements ISidedInventory {
}
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
NBTTagList list = new NBTTagList();
@ -224,6 +224,6 @@ public class TileEntityNukeMan extends TileEntity implements ISidedInventory {
@Override
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;
}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;
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
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++)
{
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i);
NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length)
{
@ -148,6 +149,7 @@ public class TileEntityNukeMike extends TileEntity implements ISidedInventory {
}
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
NBTTagList list = new NBTTagList();
@ -207,7 +209,7 @@ public class TileEntityNukeMike extends TileEntity implements ISidedInventory {
@Override
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;
}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;
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
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++)
{
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i);
NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length)
{
@ -148,6 +149,7 @@ public class TileEntityNukePrototype extends TileEntity implements ISidedInvento
}
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
NBTTagList list = new NBTTagList();
@ -198,6 +200,6 @@ public class TileEntityNukePrototype extends TileEntity implements ISidedInvento
@Override
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;
}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;
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
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++)
{
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i);
NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length)
{
@ -148,6 +149,7 @@ public class TileEntityNukeTsar extends TileEntity implements ISidedInventory {
}
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
NBTTagList list = new NBTTagList();
@ -205,6 +207,6 @@ public class TileEntityNukeTsar extends TileEntity implements ISidedInventory {
@Override
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 {
@Override
public int getBlockMetadata()
{
if (this.blockMetadata == -1)
@ -17,6 +18,6 @@ public class TileEntityObjTester extends TileEntity {
@Override
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 {
@Override
public int getBlockMetadata()
{
if (this.blockMetadata == -1)

View File

@ -3,7 +3,6 @@ package com.hbm.blocks;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.nbt.NBTTagCompound;
@ -85,12 +84,14 @@ public class TileEntityRtgFurnace extends TileEntity implements ISidedInventory
{
return false;
}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)
@Override
public void openInventory() {}
@Override
public void closeInventory() {}
@Override
@ -110,6 +111,7 @@ public class TileEntityRtgFurnace extends TileEntity implements ISidedInventory
return false;
}
@Override
public ItemStack decrStackSize(int i, int j) {
if(slots[i] != null)
{
@ -131,6 +133,7 @@ public class TileEntityRtgFurnace extends TileEntity implements ISidedInventory
}
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
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++)
{
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i);
NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length)
{
@ -149,6 +152,7 @@ public class TileEntityRtgFurnace extends TileEntity implements ISidedInventory
}
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
nbt.setShort("cookTime", (short) dualCookTime);
@ -249,6 +253,7 @@ public class TileEntityRtgFurnace extends TileEntity implements ISidedInventory
return this.dualCookTime > 0;
}
@Override
public void updateEntity() {
boolean flag = this.hasPower();
boolean flag1 = false;
@ -259,7 +264,7 @@ public class TileEntityRtgFurnace extends TileEntity implements ISidedInventory
{
dualCookTime++;
if(this.dualCookTime == this.processingSpeed)
if(this.dualCookTime == TileEntityRtgFurnace.processingSpeed)
{
this.dualCookTime = 0;
this.processItem();

View File

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

View File

@ -99,7 +99,7 @@ public class TileEntityTestNuke extends TileEntity implements ISidedInventory {
{
return false;
}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;
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
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++)
{
NBTTagCompound nbt1 = (NBTTagCompound) list.getCompoundTagAt(i);
NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length)
{
@ -149,6 +150,7 @@ public class TileEntityTestNuke extends TileEntity implements ISidedInventory {
}
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
NBTTagList list = new NBTTagList();

View File

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

View File

@ -4,15 +4,12 @@ import java.util.HashSet;
import java.util.List;
import com.hbm.entity.EntityNuclearCreeper;
import com.hbm.explosion.ExplosionChaos;
import com.hbm.lib.Library;
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.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.tileentity.TileEntity;
@ -22,6 +19,7 @@ import net.minecraft.util.Vec3;
public class TileEntityYellowBarrel extends TileEntity {
@Override
public void updateEntity() {
int strength = 4;
float f = strength;
@ -43,20 +41,20 @@ public class TileEntityYellowBarrel extends TileEntity {
int i2 = MathHelper.floor_double(this.yCoord + wat + 1.0D);
int l = 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);
for (int i1 = 0; i1 < list.size(); ++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)
{
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;
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(entity instanceof EntityPlayer && Library.checkForHazmat((EntityPlayer)entity))

View File

@ -3,7 +3,6 @@ package com.hbm.blocks;
import java.util.Random;
import com.hbm.entity.EntityNuclearCreeper;
import com.hbm.items.ModItems;
import com.hbm.lib.Library;
import com.hbm.lib.RefStrings;
@ -12,13 +11,11 @@ import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.BlockMushroom;
import net.minecraft.block.material.Material;
import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.client.renderer.texture.IIconRegister;
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.EntityPlayerMP;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
@ -38,6 +35,7 @@ public class WasteEarth extends Block {
this.setTickRandomly(true);
}
@Override
@SideOnly(Side.CLIENT)
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")));
@ -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")));
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) {
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_)
{
if(this == ModBlocks.waste_earth || this == ModBlocks.waste_earth)
@ -65,12 +65,14 @@ public class WasteEarth extends Block {
return null;
}
public int quantityDropped(Random p_149745_1_)
@Override
public int quantityDropped(Random p_149745_1_)
{
return 1;
}
public void onEntityWalking(World p_149724_1_, int p_149724_2_, int p_149724_3_, int p_149724_4_, Entity entity)
@Override
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)
{
@ -124,18 +126,19 @@ public class WasteEarth extends Block {
}
}
@SideOnly(Side.CLIENT)
@Override
@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_)
{
super.randomDisplayTick(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_, p_149734_5_);
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)
{
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 com.hbm.items.ModItems;
import com.hbm.lib.RefStrings;
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.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
public class WasteLog extends Block {
@ -25,17 +22,20 @@ public class WasteLog extends Block {
super(p_i45394_1_);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
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"));
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) {
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_)
{
if(this == ModBlocks.waste_log)
@ -50,12 +50,14 @@ public class WasteLog extends Block {
return null;
}
public int quantityDropped(Random p_149745_1_)
@Override
public int quantityDropped(Random p_149745_1_)
{
return 2 + p_149745_1_.nextInt(3);
}
public int damageDropped(int p_149692_1_)
@Override
public int damageDropped(int p_149692_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.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
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.world.Explosion;
import net.minecraft.world.IBlockAccess;
@ -29,7 +26,8 @@ public class YellowBarrel extends BlockContainer {
return new TileEntityYellowBarrel();
}
public void onBlockDestroyedByExplosion(World p_149723_1_, int p_149723_2_, int p_149723_3_, int p_149723_4_, Explosion p_149723_5_)
@Override
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)
{
@ -42,40 +40,47 @@ public class YellowBarrel extends BlockContainer {
ExplosionNukeGeneric.waste(p_149695_1_, x, y, z, 35);
}
@Override
public int getRenderType(){
return -1;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconregister) {
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_)
{
float f = 0.0625F;
this.setBlockBounds(2*f, 0.0F, 2*f, 14*f, 1.0F, 14*f);
}
public boolean canDropFromExplosion(Explosion p_149659_1_)
@Override
public boolean canDropFromExplosion(Explosion p_149659_1_)
{
return false;
}
@SideOnly(Side.CLIENT)
@Override
@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_)
{
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;
import com.hbm.blocks.ModBlocks;
import com.hbm.items.ModItems;
import net.minecraft.creativetab.CreativeTabs;

View File

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

View File

@ -83,11 +83,11 @@ public class EntityBullet extends Entity implements IProjectile
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 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 d3 = (double)MathHelper.sqrt_double(d0 * d0 + d2 * d2);
double d3 = MathHelper.sqrt_double(d0 * d0 + d2 * d2);
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.yOffset = 0.0F;
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.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.posX -= (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F);
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 -= MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F;
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.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.motionZ = (double)(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.motionX = -MathHelper.sin(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 = (-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.dmgMin = dmgMin;
@ -143,7 +143,8 @@ public class EntityBullet extends Entity implements IProjectile
this.gravity = grav;
}
protected void entityInit()
@Override
protected void entityInit()
{
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.
*/
public void setThrowableHeading(double p_70186_1_, double p_70186_3_, double p_70186_5_, float p_70186_7_, float p_70186_8_)
@Override
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_);
p_70186_1_ /= (double)f2;
p_70186_3_ /= (double)f2;
p_70186_5_ /= (double)f2;
p_70186_1_ += this.rand.nextGaussian() * (double)(this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double)p_70186_8_;
p_70186_3_ += this.rand.nextGaussian() * (double)(this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double)p_70186_8_;
p_70186_5_ += this.rand.nextGaussian() * (double)(this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double)p_70186_8_;
p_70186_1_ *= (double)p_70186_7_;
p_70186_3_ *= (double)p_70186_7_;
p_70186_5_ *= (double)p_70186_7_;
p_70186_1_ /= f2;
p_70186_3_ /= f2;
p_70186_5_ /= f2;
p_70186_1_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * 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() * (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * p_70186_8_;
p_70186_1_ *= p_70186_7_;
p_70186_3_ *= p_70186_7_;
p_70186_5_ *= p_70186_7_;
this.motionX = p_70186_1_;
this.motionY = p_70186_3_;
this.motionZ = 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.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;
}
@ -176,7 +178,8 @@ 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,
* posY, posZ, yaw, pitch
*/
@SideOnly(Side.CLIENT)
@Override
@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_)
{
this.setPosition(p_70056_1_, p_70056_3_, p_70056_5_);
@ -186,7 +189,8 @@ public class EntityBullet extends Entity implements IProjectile
/**
* Sets the velocity to the args. Args: x, y, z
*/
@SideOnly(Side.CLIENT)
@Override
@SideOnly(Side.CLIENT)
public void setVelocity(double p_70016_1_, double p_70016_3_, double p_70016_5_)
{
this.motionX = p_70016_1_;
@ -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_);
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.prevRotationYaw = this.rotationYaw;
this.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
@ -209,7 +213,8 @@ public class EntityBullet extends Entity implements IProjectile
* Called to update the entity's position/logic.
*/
//@Override
public void onUpdate()
@Override
public void onUpdate()
{
super.onUpdate();
@ -280,7 +285,7 @@ public class EntityBullet extends Entity implements IProjectile
if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5))
{
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);
if (movingobjectposition1 != null)
@ -320,7 +325,7 @@ public class EntityBullet extends Entity implements IProjectile
if (movingobjectposition.entityHit != null)
{
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())
{
@ -360,7 +365,7 @@ public class EntityBullet extends Entity implements IProjectile
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_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.motionX = (double)((float)(movingobjectposition.hitVec.xCoord - this.posX));
this.motionY = (double)((float)(movingobjectposition.hitVec.yCoord - this.posY));
this.motionZ = (double)((float)(movingobjectposition.hitVec.zCoord - this.posZ));
this.motionX = ((float)(movingobjectposition.hitVec.xCoord - this.posX));
this.motionY = ((float)(movingobjectposition.hitVec.yCoord - this.posY));
this.motionZ = ((float)(movingobjectposition.hitVec.zCoord - this.posZ));
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.posY -= this.motionY / (double)f2 * 0.05000000074505806D;
this.posZ -= this.motionZ / (double)f2 * 0.05000000074505806D;
this.posX -= this.motionX / f2 * 0.05000000074505806D;
this.posY -= this.motionY / f2 * 0.05000000074505806D;
this.posZ -= this.motionZ / f2 * 0.05000000074505806D;
this.inGround = true;
this.arrowShake = 7;
this.setIsCritical(false);
@ -462,7 +467,7 @@ public class EntityBullet extends Entity implements IProjectile
for (int l = 0; l < 4; ++l)
{
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;
@ -473,10 +478,10 @@ public class EntityBullet extends Entity implements IProjectile
this.extinguish();
}
this.motionX *= (double)f3;
this.motionY *= (double)f3;
this.motionZ *= (double)f3;
this.motionY -= (double)gravity;
this.motionX *= f3;
this.motionY *= f3;
this.motionZ *= f3;
this.motionY -= gravity;
this.setPosition(this.posX, this.posY, this.posZ);
this.func_145775_I();
}
@ -485,7 +490,8 @@ public class EntityBullet extends Entity implements IProjectile
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(NBTTagCompound p_70014_1_)
@Override
public void writeEntityToNBT(NBTTagCompound p_70014_1_)
{
p_70014_1_.setShort("xTile", (short)this.field_145791_d);
p_70014_1_.setShort("yTile", (short)this.field_145792_e);
@ -502,7 +508,8 @@ public class EntityBullet extends Entity implements IProjectile
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(NBTTagCompound p_70037_1_)
@Override
public void readEntityFromNBT(NBTTagCompound p_70037_1_)
{
this.field_145791_d = p_70037_1_.getShort("xTile");
this.field_145792_e = p_70037_1_.getShort("yTile");
@ -531,7 +538,8 @@ public class EntityBullet extends Entity implements IProjectile
/**
* Called by a player entity when they collide with an entity
*/
public void onCollideWithPlayer(EntityPlayer p_70100_1_)
@Override
public void onCollideWithPlayer(EntityPlayer p_70100_1_)
{
if (!this.worldObj.isRemote && this.inGround && this.arrowShake <= 0)
{
@ -554,12 +562,14 @@ 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
* prevent them from trampling crops
*/
protected boolean canTriggerWalking()
@Override
protected boolean canTriggerWalking()
{
return false;
}
@SideOnly(Side.CLIENT)
@Override
@SideOnly(Side.CLIENT)
public float getShadowSize()
{
return 0.0F;
@ -586,7 +596,8 @@ public class EntityBullet extends Entity implements IProjectile
/**
* If returns false, the item will not inflict any damage against entities.
*/
public boolean canAttackWithItem()
@Override
public boolean canAttackWithItem()
{
return false;
}

View File

@ -28,7 +28,8 @@ public class EntityGrenadeCluster extends EntityThrowable
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
}
protected void onImpact(MovingObjectPosition p_70184_1_)
@Override
protected void onImpact(MovingObjectPosition p_70184_1_)
{
if (p_70184_1_.entityHit != null)
{
@ -39,7 +40,7 @@ public class EntityGrenadeCluster extends EntityThrowable
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)

View File

@ -1,11 +1,9 @@
package com.hbm.entity;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.entity.monster.EntityBlaze;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
@ -29,7 +27,8 @@ public class EntityGrenadeElectric extends EntityThrowable
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
}
protected void onImpact(MovingObjectPosition p_70184_1_)
@Override
protected void onImpact(MovingObjectPosition p_70184_1_)
{
if (p_70184_1_.entityHit != null)
{
@ -40,7 +39,7 @@ public class EntityGrenadeElectric extends EntityThrowable
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)

View File

@ -30,7 +30,8 @@ public class EntityGrenadeFire extends EntityThrowable
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
}
protected void onImpact(MovingObjectPosition p_70184_1_)
@Override
protected void onImpact(MovingObjectPosition p_70184_1_)
{
if (p_70184_1_.entityHit != null)
{
@ -41,7 +42,7 @@ public class EntityGrenadeFire extends EntityThrowable
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)

View File

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

View File

@ -30,7 +30,8 @@ public class EntityGrenadeFrag extends EntityThrowable
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
}
protected void onImpact(MovingObjectPosition p_70184_1_)
@Override
protected void onImpact(MovingObjectPosition p_70184_1_)
{
if (p_70184_1_.entityHit != null)
{
@ -41,7 +42,7 @@ public class EntityGrenadeFrag extends EntityThrowable
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)

View File

@ -1,10 +1,8 @@
package com.hbm.entity;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityBlaze;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
@ -30,7 +28,8 @@ public class EntityGrenadeGas extends EntityThrowable
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
}
protected void onImpact(MovingObjectPosition p_70184_1_)
@Override
protected void onImpact(MovingObjectPosition p_70184_1_)
{
if (p_70184_1_.entityHit != null)
{
@ -41,7 +40,7 @@ public class EntityGrenadeGas extends EntityThrowable
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)

View File

@ -1,12 +1,8 @@
package com.hbm.entity;
import com.hbm.explosion.ExplosionChaos;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityBlaze;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
@ -30,7 +26,8 @@ public class EntityGrenadeGeneric extends EntityThrowable
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
}
protected void onImpact(MovingObjectPosition p_70184_1_)
@Override
protected void onImpact(MovingObjectPosition p_70184_1_)
{
if (p_70184_1_.entityHit != null)
{
@ -41,7 +38,7 @@ public class EntityGrenadeGeneric extends EntityThrowable
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)

View File

@ -1,12 +1,8 @@
package com.hbm.entity;
import com.hbm.explosion.ExplosionChaos;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityBlaze;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
@ -31,7 +27,8 @@ public class EntityGrenadeNuke extends EntityThrowable
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
}
protected void onImpact(MovingObjectPosition p_70184_1_)
@Override
protected void onImpact(MovingObjectPosition p_70184_1_)
{
if (p_70184_1_.entityHit != null)
{
@ -42,7 +39,7 @@ public class EntityGrenadeNuke extends EntityThrowable
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)

View File

@ -1,13 +1,10 @@
package com.hbm.entity;
import com.hbm.explosion.ExplosionChaos;
import com.hbm.explosion.ExplosionNukeGeneric;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityBlaze;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
@ -31,7 +28,8 @@ public class EntityGrenadePoison extends EntityThrowable
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
}
protected void onImpact(MovingObjectPosition p_70184_1_)
@Override
protected void onImpact(MovingObjectPosition p_70184_1_)
{
if (p_70184_1_.entityHit != null)
{
@ -42,7 +40,7 @@ public class EntityGrenadePoison extends EntityThrowable
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)

View File

@ -2,11 +2,9 @@ package com.hbm.entity;
import com.hbm.explosion.ExplosionChaos;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityBlaze;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
@ -30,7 +28,8 @@ public class EntityGrenadeSchrabidium extends EntityThrowable
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
}
protected void onImpact(MovingObjectPosition p_70184_1_)
@Override
protected void onImpact(MovingObjectPosition p_70184_1_)
{
if (p_70184_1_.entityHit != null)
{
@ -41,7 +40,7 @@ public class EntityGrenadeSchrabidium extends EntityThrowable
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)

View File

@ -7,8 +7,6 @@ import net.minecraft.util.DamageSource;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import com.hbm.explosion.ExplosionChaos;
public class EntityGrenadeStrong extends EntityThrowable
{
private static final String __OBFID = "CL_00001722";
@ -28,7 +26,8 @@ public class EntityGrenadeStrong extends EntityThrowable
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
}
protected void onImpact(MovingObjectPosition p_70184_1_)
@Override
protected void onImpact(MovingObjectPosition p_70184_1_)
{
if (p_70184_1_.entityHit != null)
{
@ -39,7 +38,7 @@ public class EntityGrenadeStrong extends EntityThrowable
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)

View File

@ -2,10 +2,8 @@ package com.hbm.entity;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.Entity;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.init.Blocks;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
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);
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,7 +77,8 @@ public class EntityMirv extends EntityThrowable {
}
@SideOnly(Side.CLIENT)
@Override
@SideOnly(Side.CLIENT)
public boolean isInRangeToRenderDist(double distance)
{
return distance < 25000;

View File

@ -31,7 +31,7 @@ public class EntityMissileAntiBallistic extends EntityMissileBase {
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)
{

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