Improved cloaking core and force field projector sound effects
This commit is contained in:
parent
6dfac959c1
commit
07ce6eb774
2 changed files with 7 additions and 4 deletions
|
@ -24,6 +24,9 @@ import cpw.mods.fml.common.Optional;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
public class TileEntityCloakingCore extends TileEntityAbstractEnergy {
|
public class TileEntityCloakingCore extends TileEntityAbstractEnergy {
|
||||||
|
|
||||||
|
private static final int CLOAKING_CORE_SOUND_UPDATE_TICKS = 40;
|
||||||
|
|
||||||
public boolean isEnabled = false;
|
public boolean isEnabled = false;
|
||||||
public byte tier = 1; // cloaking field tier, 1 or 2
|
public byte tier = 1; // cloaking field tier, 1 or 2
|
||||||
|
|
||||||
|
@ -71,9 +74,9 @@ public class TileEntityCloakingCore extends TileEntityAbstractEnergy {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset sound timer
|
// Reset sound timer
|
||||||
soundTicks++;
|
soundTicks--;
|
||||||
if (soundTicks >= 40) {
|
if (soundTicks < 0) {
|
||||||
soundTicks = 0;
|
soundTicks = CLOAKING_CORE_SOUND_UPDATE_TICKS;
|
||||||
soundPlayed = false;
|
soundPlayed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -213,7 +213,7 @@ public class TileEntityForceFieldProjector extends TileEntityAbstractForceField
|
||||||
}
|
}
|
||||||
|
|
||||||
soundTicks--;
|
soundTicks--;
|
||||||
if (soundTicks <= 0) {
|
if (soundTicks < 0) {
|
||||||
soundTicks = PROJECTOR_SOUND_UPDATE_TICKS;
|
soundTicks = PROJECTOR_SOUND_UPDATE_TICKS;
|
||||||
if (!hasUpgrade(EnumForceFieldUpgrade.SILENCER)) {
|
if (!hasUpgrade(EnumForceFieldUpgrade.SILENCER)) {
|
||||||
worldObj.playSoundEffect(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D, "warpdrive:projecting", 1.0F, 0.85F + 0.15F * worldObj.rand.nextFloat());
|
worldObj.playSoundEffect(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D, "warpdrive:projecting", 1.0F, 0.85F + 0.15F * worldObj.rand.nextFloat());
|
||||||
|
|
Loading…
Reference in a new issue