mob tweaks
This commit is contained in:
@@ -2,6 +2,9 @@ package StevenDimDoors.mod_pocketDim.blocks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.Point3D;
|
||||
import StevenDimDoors.mod_pocketDim.dimHelper;
|
||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||
@@ -13,10 +16,17 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockLimbo extends Block
|
||||
{
|
||||
Random rand= new Random();
|
||||
Icon blockIcon0;
|
||||
Icon blockIcon1;
|
||||
Icon blockIcon2;
|
||||
Icon blockIcon3;
|
||||
|
||||
public BlockLimbo(int i, int j, Material par2Material)
|
||||
{
|
||||
@@ -27,24 +37,47 @@ public class BlockLimbo extends Block
|
||||
|
||||
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
/**
|
||||
* Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side
|
||||
*/
|
||||
public Icon getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
||||
{
|
||||
return this.getIcon(par5, par1IBlockAccess.getBlockMetadata(par2, par3, par4));
|
||||
}
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
{
|
||||
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName2());
|
||||
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName2()+0);
|
||||
this.blockIcon0 = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName2()+0);
|
||||
this.blockIcon1 = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName2()+1);
|
||||
this.blockIcon2 = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName2()+2);
|
||||
this.blockIcon3 = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName2()+3);
|
||||
|
||||
}
|
||||
|
||||
public Icon getIcon(int par1, int par2)
|
||||
{
|
||||
/**
|
||||
switch(par2)
|
||||
{
|
||||
case 0: return this.blockIcon0;
|
||||
case 1: return this.blockIcon1;
|
||||
|
||||
case 2: return this.blockIcon2;
|
||||
case 3: return this.blockIcon3;
|
||||
}
|
||||
**/
|
||||
|
||||
|
||||
return this.blockIcon;
|
||||
}
|
||||
|
||||
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) {}
|
||||
|
||||
//part of the decay mech, if a block has fallen onto it, when it turns, it makes sure any block above it gets added too.
|
||||
@Override
|
||||
public void onBlockAdded(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
if(par1World.getBlockId(par2, par3+1, par4)==Block.gravel.blockID)
|
||||
{
|
||||
Point3D point = new Point3D(par2,par3+1,par4);
|
||||
dimHelper.blocksToDecay.add(point);
|
||||
}
|
||||
}
|
||||
|
||||
public int quantityDropped(Random par1Random)
|
||||
{
|
||||
|
||||
@@ -52,6 +85,7 @@ public class BlockLimbo extends Block
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9)
|
||||
{
|
||||
|
||||
@@ -69,6 +103,19 @@ public class BlockLimbo extends Block
|
||||
}
|
||||
|
||||
}
|
||||
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
|
||||
{
|
||||
if(par1World.getBlockId(par2, par3+1, par4)==Block.gravel.blockID)
|
||||
{
|
||||
Point3D point = new Point3D(par2,par3+1,par4);
|
||||
dimHelper.blocksToDecay.add(point);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onBlockAdded(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
// par1World.setBlockMetadataWithNotify(par2, par3, par4, this.rand.nextInt(4), 0);
|
||||
}
|
||||
|
||||
|
||||
//TODO set render color!!
|
||||
|
||||
Reference in New Issue
Block a user