Removed sync blocks.

This commit is contained in:
CrazyPants committed 2014-07-08 15:00:31 +08:00
1 parent 31aa8bce21
commit 5695b95954
2 files changed
+11 -16

No files matched your search

@@ -173,6 +173,7 @@ public final class Config {
public static int darkSteelSoundLocatorCost = 10;
public static int darkSteelSoundLocatorRange = 40;
public static int darkSteelSoundLocatorLifespan = 40;
public static int hootchPowerPerCycle = 6;
public static int hootchPowerTotalBurnTime = 6000;
@@ -460,6 +461,8 @@ public final class Config {
"Number of levels required for the 'Sound Locator' upgrade.").getInt(darkSteelSoundLocatorCost);
darkSteelSoundLocatorRange = config.get(sectionDarkSteel.name, "darkSteelSoundLocatorRange", darkSteelSoundLocatorRange,
"Range of the 'Sound Locator' upgrade.").getInt(darkSteelSoundLocatorRange);
darkSteelSoundLocatorLifespan = config.get(sectionDarkSteel.name, "darkSteelSoundLocatorLifespan", darkSteelSoundLocatorLifespan,
"Number of ticks the 'Sound Locator' icons are displayed for.").getInt(darkSteelSoundLocatorLifespan);
darkSteelSwordSkullLootingModifier = (float) config.get(sectionDarkSteel.name, "darkSteelSwordSkullLootingModifier", darkSteelSwordSkullLootingModifier,
"The chance per looting level that a skull will be dropped when using a powered dark steel sword (0 = no chance, 1 = 100% chance)").getDouble(
@@ -60,19 +60,15 @@ public class SoundDetector {
@SubscribeEvent
public void onSound(PlaySoundAtEntityEvent evt) {
if(enabled && evt.entity != null && evt.entity != Minecraft.getMinecraft().thePlayer) {
synchronized (soundQueue) {
soundQueue.add(new SoundSource(evt.entity, evt.volume));
}
if(enabled && evt.entity != null && evt.entity != Minecraft.getMinecraft().thePlayer) {
soundQueue.add(new SoundSource(evt.entity, evt.volume));
}
}
@SubscribeEvent
public void onSound(PlaySoundSourceEvent evt) {
if(enabled) {
synchronized (soundQueue) {
soundQueue.add(new SoundSource(evt.sound.getXPosF(),evt.sound.getYPosF(),evt.sound.getZPosF(), evt.sound.getVolume()));
}
soundQueue.add(new SoundSource(evt.sound.getXPosF(),evt.sound.getYPosF(),evt.sound.getZPosF(), evt.sound.getVolume()));
}
}
@@ -80,18 +76,14 @@ public class SoundDetector {
@SubscribeEvent
public void onClientTick(TickEvent.ClientTickEvent event) {
if(!enabled) {
if(!enabled || mc.thePlayer == null || mc.thePlayer.worldObj == null) {
return;
}
synchronized (soundQueue) {
sounds.addAll(soundQueue);
soundQueue.clear();
}
if(mc.thePlayer == null || mc.thePlayer.worldObj == null) {
return;
}
List<SoundSource> tmp = soundQueue;
soundQueue = sounds;
sounds = tmp;
Vector3d eye = Util.getEyePositionEio(mc.thePlayer);
for(SoundSource ss : sounds) {
if(ss.pos.distanceSquared(eye) <= maxRangeSq) {