Phantomface Particles

This commit is contained in:
Ellpeck 2015-10-26 22:47:26 +01:00
parent f520c87d94
commit ad5698dcd6
2 changed files with 16 additions and 0 deletions

View file

@ -53,6 +53,21 @@ public class TileEntityPhantomface extends TileEntityInventoryBase implements IP
WorldUtil.updateTileAndTilesAround(this); WorldUtil.updateTileAndTilesAround(this);
} }
} }
else{
if(this.boundPosition != null){
if(this.worldObj.rand.nextInt(2) == 0){
double d1 = (double)((float)this.boundPosition.getY()+worldObj.rand.nextFloat());
int i1 = worldObj.rand.nextInt(2)*2-1;
int j1 = worldObj.rand.nextInt(2)*2-1;
double d4 = ((double)worldObj.rand.nextFloat()-0.5D)*0.125D;
double d2 = (double)this.boundPosition.getZ()+0.5D+0.25D*(double)j1;
double d5 = (double)(worldObj.rand.nextFloat()*1.0F*(float)j1);
double d0 = (double)this.boundPosition.getX()+0.5D+0.25D*(double)i1;
double d3 = (double)(worldObj.rand.nextFloat()*1.0F*(float)i1);
worldObj.spawnParticle("portal", d0, d1, d2, d3, d4, d5);
}
}
}
} }
public static int upgradeRange(int defaultRange, World world, int x, int y, int z){ public static int upgradeRange(int defaultRange, World world, int x, int y, int z){

View file

@ -116,6 +116,7 @@ public class WorldUtil{
tile.getWorldObj().markBlockForUpdate(tile.xCoord, tile.yCoord-1, tile.zCoord); tile.getWorldObj().markBlockForUpdate(tile.xCoord, tile.yCoord-1, tile.zCoord);
tile.getWorldObj().markBlockForUpdate(tile.xCoord, tile.yCoord, tile.zCoord+1); tile.getWorldObj().markBlockForUpdate(tile.xCoord, tile.yCoord, tile.zCoord+1);
tile.getWorldObj().markBlockForUpdate(tile.xCoord, tile.yCoord, tile.zCoord-1); tile.getWorldObj().markBlockForUpdate(tile.xCoord, tile.yCoord, tile.zCoord-1);
tile.getWorldObj().markBlockForUpdate(tile.xCoord, tile.yCoord, tile.zCoord);
tile.markDirty(); tile.markDirty();
} }