mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Made the destruction of weak blocks safe. More sound tweaks
This commit is contained in:
parent
f87a23d494
commit
c3c0be94e3
@ -27,6 +27,9 @@ public class EntityMeteor extends Entity {
|
|||||||
this.ignoreFrustumCheck = true;
|
this.ignoreFrustumCheck = true;
|
||||||
this.isImmuneToFire = true;
|
this.isImmuneToFire = true;
|
||||||
this.setSize(4F, 4F);
|
this.setSize(4F, 4F);
|
||||||
|
|
||||||
|
this.audioFly = MainRegistry.proxy.getLoopedSound("hbm:entity.meteoriteFallingLoop", 0, 0, 0, 0F, 100F, 0.9F + this.rand.nextFloat() * 0.2F, 0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean destroyWeakBlocks(World world, int x, int y, int z, int radius) {
|
public boolean destroyWeakBlocks(World world, int x, int y, int z, int radius) {
|
||||||
@ -48,7 +51,7 @@ public class EntityMeteor extends Entity {
|
|||||||
float hardness = block.getBlockHardness(world, blockX, blockY, blockZ);
|
float hardness = block.getBlockHardness(world, blockX, blockY, blockZ);
|
||||||
|
|
||||||
if (block == Blocks.leaves || block == Blocks.log || hardness <= 0.3F || block == Blocks.water) {
|
if (block == Blocks.leaves || block == Blocks.log || hardness <= 0.3F || block == Blocks.water) {
|
||||||
world.setBlockToAir(blockX, blockY, blockZ);
|
if(!safe) world.setBlockToAir(blockX, blockY, blockZ);
|
||||||
} else {
|
} else {
|
||||||
foundSolidBlock = true;
|
foundSolidBlock = true;
|
||||||
}
|
}
|
||||||
@ -62,13 +65,6 @@ public class EntityMeteor extends Entity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUpdate() {
|
public void onUpdate() {
|
||||||
if(!soundStarted) {
|
|
||||||
this.audioFly = MainRegistry.proxy.getLoopedSound("hbm:entity.meteoriteFallingLoop", (int)this.posX, 5000, (int)this.posZ, 1F, 150F, 1F, 2);
|
|
||||||
this.audioFly.startSound();
|
|
||||||
|
|
||||||
soundStarted = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!worldObj.isRemote && !WorldConfig.enableMeteorStrikes) {
|
if(!worldObj.isRemote && !WorldConfig.enableMeteorStrikes) {
|
||||||
this.setDead();
|
this.setDead();
|
||||||
return;
|
return;
|
||||||
@ -84,7 +80,6 @@ public class EntityMeteor extends Entity {
|
|||||||
|
|
||||||
this.moveEntity(motionX, motionY, motionZ);
|
this.moveEntity(motionX, motionY, motionZ);
|
||||||
this.audioFly.updatePosition((int)this.posX, (int)this.posY, (int)this.posZ);
|
this.audioFly.updatePosition((int)this.posX, (int)this.posY, (int)this.posZ);
|
||||||
this.audioFly.keepAlive();
|
|
||||||
|
|
||||||
if(!this.worldObj.isRemote && this.posY < 260) {
|
if(!this.worldObj.isRemote && this.posY < 260) {
|
||||||
if(destroyWeakBlocks(worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 6) && this.onGround) {
|
if(destroyWeakBlocks(worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 6) && this.onGround) {
|
||||||
@ -104,6 +99,17 @@ public class EntityMeteor extends Entity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(this.motionY <= -2){
|
||||||
|
if(this.audioFly.isPlaying()) {
|
||||||
|
//this.audioFly.keepAlive();
|
||||||
|
//this.audioFly.updateVolume(1F);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//this.audioFly.startSound();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(WorldConfig.enableMeteorTails && worldObj.isRemote) {
|
if(WorldConfig.enableMeteorTails && worldObj.isRemote) {
|
||||||
|
|
||||||
NBTTagCompound data = new NBTTagCompound();
|
NBTTagCompound data = new NBTTagCompound();
|
||||||
|
|||||||
@ -328,7 +328,7 @@
|
|||||||
"entity.siegeIdle": {"category": "hostile", "sounds": ["entity/siegeIdle1"]},
|
"entity.siegeIdle": {"category": "hostile", "sounds": ["entity/siegeIdle1"]},
|
||||||
"entity.siegeHurt": {"category": "hostile", "sounds": ["entity/siegeHurt1", "entity/siegeHurt2"]},
|
"entity.siegeHurt": {"category": "hostile", "sounds": ["entity/siegeHurt1", "entity/siegeHurt2"]},
|
||||||
"entity.siegeDeath": {"category": "hostile", "sounds": ["entity/siegeDeath1", "entity/siegeDeath2", "entity/siegeDeath3"]},
|
"entity.siegeDeath": {"category": "hostile", "sounds": ["entity/siegeDeath1", "entity/siegeDeath2", "entity/siegeDeath3"]},
|
||||||
"entity.meteoriteFallingLoop": {"category": "block", "sounds": ["entity/meteoriteFallingLoop"]},
|
"entity.meteoriteFallingLoop": {"category": "block", "sounds": [{"name": "entity/meteoriteFallingLoop", "stream": false}]},
|
||||||
|
|
||||||
|
|
||||||
"step.metal": {"category": "player", "sounds": [{"name": "footsteps/metal", "stream": false}]},
|
"step.metal": {"category": "player", "sounds": [{"name": "footsteps/metal", "stream": false}]},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user