Skip to content

Commit

Permalink
fix alarm sound pitch | fix config value not affecting game
Browse files Browse the repository at this point in the history
  • Loading branch information
bl4ckscor3 committed Jan 31, 2018
1 parent 10c7f7c commit 2898ec8
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class ConfigHandler
public int usernameLoggerSearchRadius;
public int laserBlockRange;
public int alarmTickDelay;
public double alarmSoundVolume;
public float alarmSoundVolume;
public int cageTrapTextureIndex;
public int empRadius;
public int portableRadarDelay;
Expand Down Expand Up @@ -102,9 +102,9 @@ public void setupConfiguration()
dummyProp.setLanguageKey("config.alarmTickDelay");
alarmTickDelay = dummyProp.getInt(2);

dummyProp = SecurityCraft.configFile.get("options", "Alarm sound volume:", 0.8D);
dummyProp = SecurityCraft.configFile.get("options", "Alarm sound volume:", 0.3D);
dummyProp.setLanguageKey("config.alarmSoundVolume");
alarmSoundVolume = dummyProp.getDouble(0.8D);
alarmSoundVolume = (float)dummyProp.getDouble(0.3D);

dummyProp = SecurityCraft.configFile.get("options", "Portable radar delay (seconds):", 4);
dummyProp.setLanguageKey("config.portableRadarDelay");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public void update(){

if(isPowered && cooldown == 0){
TileEntityAlarm TEA = (TileEntityAlarm) worldObj.getTileEntity(pos);
getWorld().playSound(null, new BlockPos(pos.getX() + 0.5D, pos.getY() + 0.5D, pos.getZ() + 0.5D), SCSounds.ALARM.event, SoundCategory.BLOCKS, 0.3F, 0.6F);
getWorld().playSound(null, new BlockPos(pos.getX() + 0.5D, pos.getY() + 0.5D, pos.getZ() + 0.5D), SCSounds.ALARM.event, SoundCategory.BLOCKS, SecurityCraft.config.alarmSoundVolume, 1.0F);
TEA.setCooldown((SecurityCraft.config.alarmTickDelay * 20));
worldObj.setBlockState(pos, worldObj.getBlockState(pos).withProperty(BlockAlarm.FACING, worldObj.getBlockState(pos).getValue(BlockAlarm.FACING)), 2); //TODO
worldObj.setTileEntity(pos, TEA);
Expand Down
Binary file modified 1.10.2/src/main/resources/assets/securitycraft/sounds/alarm.ogg
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class ConfigHandler
public int usernameLoggerSearchRadius;
public int laserBlockRange;
public int alarmTickDelay;
public double alarmSoundVolume;
public float alarmSoundVolume;
public int cageTrapTextureIndex;
public int empRadius;
public int portableRadarDelay;
Expand Down Expand Up @@ -102,9 +102,9 @@ public void setupConfiguration()
dummyProp.setLanguageKey("config.alarmTickDelay");
alarmTickDelay = dummyProp.getInt(2);

dummyProp = SecurityCraft.configFile.get("options", "Alarm sound volume:", 0.8D);
dummyProp = SecurityCraft.configFile.get("options", "Alarm sound volume:", 0.3D);
dummyProp.setLanguageKey("config.alarmSoundVolume");
alarmSoundVolume = dummyProp.getDouble(0.8D);
alarmSoundVolume = (float)dummyProp.getDouble(0.3D);

dummyProp = SecurityCraft.configFile.get("options", "Portable radar delay (seconds):", 4);
dummyProp.setLanguageKey("config.portableRadarDelay");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public void update(){

if(isPowered && cooldown == 0){
TileEntityAlarm TEA = (TileEntityAlarm) world.getTileEntity(pos);
getWorld().playSound(null, new BlockPos(pos.getX() + 0.5D, pos.getY() + 0.5D, pos.getZ() + 0.5D), SCSounds.ALARM.event, SoundCategory.PLAYERS, 0.3F, 0.6F);
getWorld().playSound(null, new BlockPos(pos.getX() + 0.5D, pos.getY() + 0.5D, pos.getZ() + 0.5D), SCSounds.ALARM.event, SoundCategory.PLAYERS, SecurityCraft.config.alarmSoundVolume, 1.0F);
TEA.setCooldown((SecurityCraft.config.alarmTickDelay * 20));
world.setBlockState(pos, world.getBlockState(pos).withProperty(BlockAlarm.FACING, world.getBlockState(pos).getValue(BlockAlarm.FACING)), 2); //TODO
world.setTileEntity(pos, TEA);
Expand Down
Binary file modified 1.11.2/src/main/resources/assets/securitycraft/sounds/alarm.ogg
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class ConfigHandler
public int usernameLoggerSearchRadius;
public int laserBlockRange;
public int alarmTickDelay;
public double alarmSoundVolume;
public float alarmSoundVolume;
public int cageTrapTextureIndex;
public int empRadius;
public int portableRadarDelay;
Expand Down Expand Up @@ -101,9 +101,9 @@ public void setupConfiguration()
dummyProp.setLanguageKey("config.alarmTickDelay");
alarmTickDelay = dummyProp.getInt(2);

dummyProp = SecurityCraft.configFile.get("options", "Alarm sound volume:", 0.8D);
dummyProp = SecurityCraft.configFile.get("options", "Alarm sound volume:", 0.3D);
dummyProp.setLanguageKey("config.alarmSoundVolume");
alarmSoundVolume = dummyProp.getDouble(0.8D);
alarmSoundVolume = (float)dummyProp.getDouble(0.3D);

dummyProp = SecurityCraft.configFile.get("options", "Portable radar delay (seconds):", 4);
dummyProp.setLanguageKey("config.portableRadarDelay");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public void update(){

if(isPowered && cooldown == 0){
TileEntityAlarm TEA = (TileEntityAlarm) world.getTileEntity(pos);
getWorld().playSound(null, new BlockPos(pos.getX() + 0.5D, pos.getY() + 0.5D, pos.getZ() + 0.5D), SCSounds.ALARM.event, SoundCategory.PLAYERS, 0.3F, 0.6F);
getWorld().playSound(null, new BlockPos(pos.getX() + 0.5D, pos.getY() + 0.5D, pos.getZ() + 0.5D), SCSounds.ALARM.event, SoundCategory.PLAYERS, SecurityCraft.config.alarmSoundVolume, 1.0F);
TEA.setCooldown((SecurityCraft.config.alarmTickDelay * 20));
world.setBlockState(pos, world.getBlockState(pos).withProperty(BlockAlarm.FACING, world.getBlockState(pos).getValue(BlockAlarm.FACING)), 2); //TODO
world.setTileEntity(pos, TEA);
Expand Down
Binary file modified 1.12.2/src/main/resources/assets/securitycraft/sounds/alarm.ogg
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 3 additions & 0 deletions Changelog v1.8.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@
- Fix: Reinforced Iron Trapdoor can be broken by any player (Thanks shaiapouf!)
- Fix: Portable Radar can be broken by any player
- Fix: Username Logger can be broken by any player
- Fix: Alarm sound pitch is incorrect
- Fix: [1.8-1.8.8/9] Reinforced Iron Fence Gate is not craftable
- Fix: [1.8-1.8.8/9] Disguised Keypad doesn't respect biome colors (Gray grass etc.)
- Fix: [1.8+] Password-protected Furnace doesn't drop items when being broken
- Fix: [1.8+] Security Camera doesn't update Redstone correctly when the Redstone Module is removed/added/turned on/turned off
- Fix: [1.10.2+] SecurityCraft Tile Entity data doesn't get synchronized correctly with clients on world load [1]
- Fix: [1.10.2+] Module GUI cannot be accessed
- Fix: [1.10.2+] Crashes
- Fix: [1.10.2+] Alarm sound volume config option does not affect the ingame sound
- Fix: [1.11.2+] Incorrect string in Password-protected Furnace GUI
- Fix: [1.11.2+] Some SecurityCraft sounds don't play at all (Taser/Camera)
- Removed: Tip for /sc connect
Expand Down

0 comments on commit 2898ec8

Please sign in to comment.