Permalink
Browse files

Changed the blast door sounds and added an additional sound event tri…

…gger.
  • Loading branch information...
Ri5ux committed Nov 5, 2017
1 parent 6f0226c commit ab2f8c6d00383b1caee1f33aa88c5e5fe5ff72ba
@@ -49,9 +49,13 @@
public static final Sound WEAPON_M56SG = sound("weapon.m56sg");
public static final Sound MOTIONTRACKER_PING = sound("motiontracker.ping");
public static final Sound MOTIONTRACKER_PONG = sound("motiontracker.pong");
public static final Sound BLASTDOOR_SEVASTOPOL_OPEN = sound("blocks.blastdoor.open");
public static final Sound BLASTDOOR_SEVASTOPOL_CLOSE = sound("blocks.blastdoor.close");
public static final Sound BLASTDOOR_OPEN = sound("blocks.blastdoor.open");
public static final Sound BLASTDOOR_CLOSE = sound("blocks.blastdoor.close");
public static final Sound BLASTDOOR_UNLOCK = sound("blocks.blastdoor.unlock");
public static final Sound BLASTDOOR_LOCK = sound("blocks.blastdoor.lock");
public static final Sound BLASTDOOR_PASSWORD_DENIED = sound("blocks.blastdoor.pass_deny");
public static final Sound ALARM_ACCESS = sound("blocks.alarm.access");
public static final Sound ALARM_BUZZER = sound("blocks.alarm.buzzer");
public static final Sound ALARM_EMERGENCY = sound("blocks.alarm.emergency");
@@ -12,7 +12,7 @@
import com.arisux.mdx.lib.game.Game;
import com.arisux.mdx.lib.world.block.IMultiBlock;
import com.arisux.mdx.lib.world.tile.IRotatable;
import com.arisux.mdx.lib.world.tile.IRotatableYAxis;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
@@ -28,7 +28,7 @@
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextComponentString;
public class TileEntityBlastdoor extends TileEntityElectrical implements IVoltageReceiver, IRotatable, IOpenable, IMultiBlock
public class TileEntityBlastdoor extends TileEntityElectrical implements IVoltageReceiver, IRotatableYAxis, IOpenable, IMultiBlock
{
private EnumFacing direction;
private float doorProgress;
@@ -189,7 +189,7 @@ public void update()
{
int scanRange = 1;
List<EntityPlayer> players = world.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(pos.getX(), pos.getY(), pos.getZ(), pos.getX() + 1, pos.getY() + 1, pos.getZ() + 1).expand(scanRange * 2, 5, scanRange * 2));
for (EntityPlayer player : players)
{
if (this.playerHoldingRequiredSecurityTuner(player))
@@ -328,7 +328,14 @@ else if (this.isParent())
{
if (this.doorOpen != doorOpen)
{
this.playOpenSound();
if (doorOpen)
{
this.playOpenSound();
}
else
{
this.playCloseSound();
}
}
this.doorOpen = doorOpen;
@@ -452,13 +459,13 @@ public boolean setup(boolean placedByPlayer)
}
@Override
public EnumFacing getDirection()
public EnumFacing getRotationYAxis()
{
return direction;
}
@Override
public void setDirection(EnumFacing direction)
public void setRotationYAxis(EnumFacing direction)
{
this.direction = direction;
}
@@ -564,20 +571,25 @@ public void playOpenSound()
{
AliensVsPredator.sounds().BLASTDOOR_OPEN.playSound(world, pos, 1F, 1F);
}
public void playCloseSound()
{
AliensVsPredator.sounds().BLASTDOOR_CLOSE.playSound(world, pos, 1F, 1F);
}
public void playUnlockSound()
{
AliensVsPredator.sounds().BLASTDOOR_UNLOCK.playSound(world, pos.getX(), pos.getY(), pos.getZ(), 1F, 1F, false);
}
public void playLockSound()
{
AliensVsPredator.sounds().BLASTDOOR_LOCK.playSound(world, pos.getX(), pos.getY(), pos.getZ(), 1F, 1F, false);
}
public void playIncorrectPasswordSound()
{
AliensVsPredator.sounds().ALARM_BUZZER.playSound(world, pos.getX(), pos.getY(), pos.getZ(), 1F, 1F, false);
AliensVsPredator.sounds().BLASTDOOR_PASSWORD_DENIED.playSound(world, pos.getX(), pos.getY(), pos.getZ(), 1F, 1F, false);
}
public boolean authenticate(String key)
@@ -40,6 +40,12 @@ public float getDoorSpeed()
@Override
public void playOpenSound()
{
AliensVsPredator.sounds().BLASTDOOR_OPEN.playSound(world, pos, 1F, 2F);
AliensVsPredator.sounds().BLASTDOOR_SEVASTOPOL_OPEN.playSound(world, pos, 1F, 1F);
}
@Override
public void playCloseSound()
{
AliensVsPredator.sounds().BLASTDOOR_SEVASTOPOL_CLOSE.playSound(world, pos, 1F, 1F);
}
}
@@ -46,9 +46,13 @@
"motiontracker.ping": { "sounds": [ "avp:items/motiontracker/ping" ] },
"motiontracker.pong": { "sounds": [ "avp:items/motiontracker/pong" ] },
"blocks.turret.shoot": { "sounds": [ "avp:blocks/turret/shoot" ] },
"blocks.blastdoor.sevastopol.open": { "sounds": [ "avp:blocks/blastdoor/sevastopol/open" ] },
"blocks.blastdoor.sevastopol.close": { "sounds": [ "avp:blocks/blastdoor/sevastopol/close" ] },
"blocks.blastdoor.open": { "sounds": [ "avp:blocks/blastdoor/open" ] },
"blocks.blastdoor.close": { "sounds": [ "avp:blocks/blastdoor/close" ] },
"blocks.blastdoor.lock": { "sounds": [ "avp:blocks/blastdoor/lock" ] },
"blocks.blastdoor.unlock": { "sounds": [ "avp:blocks/blastdoor/unlock" ] },
"blocks.blastdoor.pass_deny": { "sounds": [ "avp:blocks/blastdoor/password_deny" ] },
"blocks.hive.step": { "sounds": [ "avp:blocks/hive/step0", "avp:blocks/hive/step1", "avp:blocks/hive/step2", "avp:blocks/hive/step3" ] },
"blocks.newglass.step": { "sounds": [ "avp:blocks/newglass/step0", "avp:blocks/newglass/step1", "avp:blocks/newglass/step2", "avp:blocks/newglass/step3" ] },
"blocks.alarm.access": { "sounds": [ "avp:blocks/alarm/access" ] },
Binary file not shown.

0 comments on commit ab2f8c6

Please sign in to comment.