mob tweaks

This commit is contained in:
StevenRS11
2013-05-29 01:22:50 -04:00
parent 8365d4353f
commit f14cde7186
12 changed files with 86 additions and 37 deletions

View File

@@ -142,6 +142,8 @@ public class CommonTickHandler implements ITickHandler
if(blockID==Block.gravel.blockID&&!dimHelper.getWorld(mod_pocketDim.limboDimID).isAirBlock(point.getX(), point.getY()-1, point.getZ())) if(blockID==Block.gravel.blockID&&!dimHelper.getWorld(mod_pocketDim.limboDimID).isAirBlock(point.getX(), point.getY()-1, point.getZ()))
{ {
idToSet=mod_pocketDim.blockLimboID; idToSet=mod_pocketDim.blockLimboID;
dimHelper.getWorld(mod_pocketDim.limboDimID).scheduleBlockUpdate(point.getX(), point.getY(), point.getZ(),10, idToSet);
} }
else if(blockID==Block.gravel.blockID) else if(blockID==Block.gravel.blockID)
{ {

View File

@@ -137,7 +137,7 @@ public class SchematicLoader
} }
} }
if(blockID== Block.lever.blockID||blockID== Block.torchWood.blockID||blockID== Block.torchRedstoneIdle.blockID||blockID== Block.torchRedstoneActive.blockID) else if(blockID== Block.lever.blockID||blockID== Block.torchWood.blockID||blockID== Block.torchRedstoneIdle.blockID||blockID== Block.torchRedstoneActive.blockID)
{ {
switch (metadata) switch (metadata)
{ {
@@ -171,7 +171,7 @@ public class SchematicLoader
} }
if(blockID== Block.pistonBase.blockID||blockID==Block.pistonStickyBase.blockID||blockID==Block.dispenser.blockID) else if(blockID== Block.pistonBase.blockID||blockID==Block.pistonStickyBase.blockID||blockID==Block.dispenser.blockID)
{ {
switch (metadata) switch (metadata)
{ {
@@ -207,7 +207,7 @@ public class SchematicLoader
} }
if(blockID== Block.redstoneRepeaterActive.blockID||blockID==Block.redstoneRepeaterIdle.blockID||blockID== Block.tripWireSource.blockID||blockID== Block.doorIron.blockID||blockID==Block.doorWood.blockID) else if(blockID== Block.redstoneRepeaterActive.blockID||blockID==Block.redstoneRepeaterIdle.blockID||blockID== Block.tripWireSource.blockID||blockID== Block.doorIron.blockID||blockID==Block.doorWood.blockID)
{ {
switch (metadata) switch (metadata)
{ {
@@ -308,7 +308,7 @@ public class SchematicLoader
} }
} }
if(blockID== Block.lever.blockID||blockID== Block.torchWood.blockID||blockID== Block.torchRedstoneIdle.blockID||blockID== Block.torchRedstoneActive.blockID) else if(blockID== Block.lever.blockID||blockID== Block.torchWood.blockID||blockID== Block.torchRedstoneIdle.blockID||blockID== Block.torchRedstoneActive.blockID)
{ {
switch (metadata) switch (metadata)
{ {
@@ -342,7 +342,7 @@ public class SchematicLoader
} }
if(blockID== Block.pistonBase.blockID||blockID==Block.pistonStickyBase.blockID||blockID==Block.dispenser.blockID) else if(blockID== Block.pistonBase.blockID||blockID==Block.pistonStickyBase.blockID||blockID==Block.dispenser.blockID)
{ {
switch (metadata) switch (metadata)
{ {
@@ -377,7 +377,7 @@ public class SchematicLoader
} }
if(blockID== Block.redstoneRepeaterActive.blockID||blockID==Block.redstoneRepeaterIdle.blockID||blockID== Block.tripWireSource.blockID||blockID== Block.doorIron.blockID||blockID==Block.doorWood.blockID) else if(blockID== Block.redstoneRepeaterActive.blockID||blockID==Block.redstoneRepeaterIdle.blockID||blockID== Block.tripWireSource.blockID||blockID== Block.doorIron.blockID||blockID==Block.doorWood.blockID)
{ {
switch (metadata) switch (metadata)
{ {
@@ -473,7 +473,7 @@ public class SchematicLoader
} }
} }
if(blockID== Block.lever.blockID||blockID== Block.torchWood.blockID||blockID== Block.torchRedstoneIdle.blockID||blockID== Block.torchRedstoneActive.blockID) else if(blockID== Block.lever.blockID||blockID== Block.torchWood.blockID||blockID== Block.torchRedstoneIdle.blockID||blockID== Block.torchRedstoneActive.blockID)
{ {
switch (metadata) switch (metadata)
{ {
@@ -507,7 +507,7 @@ public class SchematicLoader
} }
if(blockID== Block.pistonBase.blockID||blockID==Block.pistonStickyBase.blockID||blockID==Block.dispenser.blockID) else if(blockID== Block.pistonBase.blockID||blockID==Block.pistonStickyBase.blockID||blockID==Block.dispenser.blockID)
{ {
switch (metadata) switch (metadata)
{ {
@@ -543,7 +543,7 @@ public class SchematicLoader
} }
if(blockID== Block.redstoneRepeaterActive.blockID||blockID==Block.redstoneRepeaterIdle.blockID||blockID== Block.tripWireSource.blockID||blockID== Block.doorIron.blockID||blockID==Block.doorWood.blockID) else if(blockID== Block.redstoneRepeaterActive.blockID||blockID==Block.redstoneRepeaterIdle.blockID||blockID== Block.tripWireSource.blockID||blockID== Block.doorIron.blockID||blockID==Block.doorWood.blockID)
{ {
switch (metadata) switch (metadata)
{ {

View File

@@ -2,6 +2,9 @@ package StevenDimDoors.mod_pocketDim.blocks;
import java.util.Random; 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.Point3D;
import StevenDimDoors.mod_pocketDim.dimHelper; import StevenDimDoors.mod_pocketDim.dimHelper;
import StevenDimDoors.mod_pocketDim.mod_pocketDim; import StevenDimDoors.mod_pocketDim.mod_pocketDim;
@@ -13,10 +16,17 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.Icon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
public class BlockLimbo extends Block 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) public BlockLimbo(int i, int j, Material par2Material)
{ {
@@ -26,25 +36,48 @@ 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) 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) {} 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. //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 @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) public int quantityDropped(Random par1Random)
{ {
@@ -52,6 +85,7 @@ public class BlockLimbo extends Block
return 1; return 1;
} }
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9) 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!! //TODO set render color!!

View File

@@ -68,6 +68,8 @@ public class pocketGenerator extends ChunkProviderGenerate implements IChunkProv
{ {
DimData data = dimHelper.dimList.get(this.worldObj.provider.dimensionId); DimData data = dimHelper.dimList.get(this.worldObj.provider.dimensionId);
if(data!=null) if(data!=null)
{
if(data.dungeonGenerator!=null)
{ {
if(data.isDimRandomRift&&data.isPocket&&!data.dungeonGenerator.isOpen) if(data.isDimRandomRift&&data.isPocket&&!data.dungeonGenerator.isOpen)
{ {
@@ -76,6 +78,7 @@ public class pocketGenerator extends ChunkProviderGenerate implements IChunkProv
return this.worldObj.getBiomeGenForCoords(var2, var3).getSpawnableList(var1); return this.worldObj.getBiomeGenForCoords(var2, var3).getSpawnableList(var1);
} }
} }
}
// TODO Auto-generated method stub // TODO Auto-generated method stub
return null; return null;
} }

View File

@@ -13,6 +13,7 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.world.World; import net.minecraft.world.World;
import StevenDimDoors.mod_pocketDim.LimboProvider;
import StevenDimDoors.mod_pocketDim.LinkData; import StevenDimDoors.mod_pocketDim.LinkData;
import StevenDimDoors.mod_pocketDim.dimHelper; import StevenDimDoors.mod_pocketDim.dimHelper;
import StevenDimDoors.mod_pocketDim.mod_pocketDim; import StevenDimDoors.mod_pocketDim.mod_pocketDim;
@@ -140,32 +141,22 @@ public class MobObelisk extends EntityFlying implements IMob
} }
if(aggro<470) if(aggro<470)
{ {
if(rand.nextBoolean()) if(rand.nextInt(11)>this.textureState)
{
aggro++;
}
else if (rand.nextBoolean())
{
aggro++;
aggro++;
}
else if (rand.nextBoolean())
{ {
aggro++; aggro++;
} }
if(this.worldObj.provider instanceof pocketProvider) if(this.worldObj.provider instanceof pocketProvider)
{ {
aggro++;
aggro++;
if(rand.nextBoolean()) if(rand.nextBoolean())
{ {
aggro++; aggro++;
} }
else if(rand.nextBoolean())
{
aggro++;
}
} }
if(aggro>430) if(aggro>430)
@@ -198,11 +189,14 @@ public class MobObelisk extends EntityFlying implements IMob
} }
if(!(this.worldObj.provider instanceof LimboProvider))
{
for (int i = 0; i < -1+this.textureState/3; ++i) for (int i = 0; i < -1+this.textureState/3; ++i)
{ {
entityPlayer.worldObj.spawnParticle("portal", entityPlayer.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width, entityPlayer.posY + this.rand.nextDouble() * (double)entityPlayer.height - 0.75D, entityPlayer.posZ + (this.rand.nextDouble() - 0.5D) * (double)entityPlayer.width, (this.rand.nextDouble() - 0.5D) * 2.0D, -this.rand.nextDouble(), (this.rand.nextDouble() - 0.5D) * 2.0D); entityPlayer.worldObj.spawnParticle("portal", entityPlayer.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width, entityPlayer.posY + this.rand.nextDouble() * (double)entityPlayer.height - 0.75D, entityPlayer.posZ + (this.rand.nextDouble() - 0.5D) * (double)entityPlayer.width, (this.rand.nextDouble() - 0.5D) * 2.0D, -this.rand.nextDouble(), (this.rand.nextDouble() - 0.5D) * 2.0D);
} }
}
@@ -291,7 +285,7 @@ public class MobObelisk extends EntityFlying implements IMob
{ {
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this,AxisAlignedBB.getBoundingBox( this.posX-15, posY-4, this.posZ-15, this.posX+15, this.posY+15, this.posZ+15)); List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this,AxisAlignedBB.getBoundingBox( this.posX-15, posY-4, this.posZ-15, this.posX+15, this.posY+15, this.posZ+15));
if(list.size()>0) if(list.size()>0&&this.worldObj.provider.dimensionId==mod_pocketDim.limboDimID)
{ {
return false; return false;
} }
@@ -348,6 +342,9 @@ public class MobObelisk extends EntityFlying implements IMob
double d3 = (double)MathHelper.sqrt_double(d0 * d0 + d1 * d1); double d3 = (double)MathHelper.sqrt_double(d0 * d0 + d1 * d1);
float f2 = (float)(Math.atan2(d1, d0) * 180.0D / Math.PI) - 90.0F; float f2 = (float)(Math.atan2(d1, d0) * 180.0D / Math.PI) - 90.0F;
float f3 = (float)(-(Math.atan2(d2, d3) * 180.0D / Math.PI)); float f3 = (float)(-(Math.atan2(d2, d3) * 180.0D / Math.PI));
this.rotationPitch = f3;
this.rotationYaw = f2;
this.rotationYaw = f2; this.rotationYaw = f2;
this.rotationYawHead=f2; this.rotationYawHead=f2;
this.renderYawOffset=this.rotationYaw; this.renderYawOffset=this.rotationYaw;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB