From 7d90ae8ddfa40fdf35d66a2a5e0f591f1fe23d16 Mon Sep 17 00:00:00 2001 From: Brian Ricketts Date: Fri, 18 Jan 2013 21:55:22 -0600 Subject: [PATCH] Fixed more sounds -.- --- .../common/machine/armbot/TileEntityArmbot.java | 2 +- .../common/machine/belt/TileEntityConveyorBelt.java | 9 ++++----- .../assemblyline/common/machine/command/CommandDrop.java | 3 ++- .../assemblyline/common/machine/command/CommandGrab.java | 7 ++++--- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/minecraft/assemblyline/common/machine/armbot/TileEntityArmbot.java b/src/minecraft/assemblyline/common/machine/armbot/TileEntityArmbot.java index ddd455d6..d502a610 100644 --- a/src/minecraft/assemblyline/common/machine/armbot/TileEntityArmbot.java +++ b/src/minecraft/assemblyline/common/machine/armbot/TileEntityArmbot.java @@ -198,7 +198,7 @@ public class TileEntityArmbot extends TileEntityAssemblyNetwork implements IMult this.renderYaw -= 360; } - if (this.ticks % 5 == 0) // sound is 0.5 seconds long (20 ticks/second) + if (this.ticks % 5 == 0 && FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) // sound is 0.5 seconds long (20 ticks/second) Minecraft.getMinecraft().sndManager.playSound("assemblyline.conveyor", this.xCoord, this.yCoord, this.zCoord, 2f, 1.7f); if (Math.abs(this.renderYaw - this.rotationYaw) < this.ROTATION_SPEED + 0.1f) { diff --git a/src/minecraft/assemblyline/common/machine/belt/TileEntityConveyorBelt.java b/src/minecraft/assemblyline/common/machine/belt/TileEntityConveyorBelt.java index 95db6ad2..41f7da43 100644 --- a/src/minecraft/assemblyline/common/machine/belt/TileEntityConveyorBelt.java +++ b/src/minecraft/assemblyline/common/machine/belt/TileEntityConveyorBelt.java @@ -53,8 +53,7 @@ public class TileEntityConveyorBelt extends TileEntityAssemblyNetwork implements } /** - * This function is overriden to allow conveyor belts to power belts that are diagonally going - * up. + * This function is overriden to allow conveyor belts to power belts that are diagonally going up. */ @Override public void updatePowerTransferRange() @@ -118,11 +117,11 @@ public class TileEntityConveyorBelt extends TileEntityAssemblyNetwork implements PacketManager.sendPacketToClients(this.getDescriptionPacket()); } - if (this.isRunning()&& this.worldObj.isRemote) + if (this.isRunning()) { - if (this.ticks % (10) == 0 ) //sound is 0.5 seconds long (20 ticks/second) + if (this.ticks % (10) == 0 && this.worldObj.isRemote) // sound is 0.5 seconds long (20 ticks/second) Minecraft.getMinecraft().sndManager.playSound("assemblyline.conveyor", this.xCoord, this.yCoord, this.zCoord, 0.125f, 0.3f); - + this.wheelRotation += 40; if (this.wheelRotation > 360) diff --git a/src/minecraft/assemblyline/common/machine/command/CommandDrop.java b/src/minecraft/assemblyline/common/machine/command/CommandDrop.java index b799ec78..3bad7982 100644 --- a/src/minecraft/assemblyline/common/machine/command/CommandDrop.java +++ b/src/minecraft/assemblyline/common/machine/command/CommandDrop.java @@ -20,7 +20,8 @@ public class CommandDrop extends Command entity.worldObj = this.tileEntity.worldObj; if (entity instanceof EntityItem) world.spawnEntityInWorld(entity); //items don't move right, so we render them manually - Minecraft.getMinecraft().sndManager.playSound("random.pop", this.tileEntity.xCoord, this.tileEntity.yCoord, this.tileEntity.zCoord, 0.2F, ((this.tileEntity.worldObj.rand.nextFloat() - this.tileEntity.worldObj.rand.nextFloat()) * 0.7F + 1.0F) * 1.0F); + if (this.world.isRemote) + Minecraft.getMinecraft().sndManager.playSound("random.pop", this.tileEntity.xCoord, this.tileEntity.yCoord, this.tileEntity.zCoord, 0.2F, ((this.tileEntity.worldObj.rand.nextFloat() - this.tileEntity.worldObj.rand.nextFloat()) * 0.7F + 1.0F) * 1.0F); } } this.tileEntity.grabbedEntities.clear(); diff --git a/src/minecraft/assemblyline/common/machine/command/CommandGrab.java b/src/minecraft/assemblyline/common/machine/command/CommandGrab.java index 278e62ab..d5b15295 100644 --- a/src/minecraft/assemblyline/common/machine/command/CommandGrab.java +++ b/src/minecraft/assemblyline/common/machine/command/CommandGrab.java @@ -41,12 +41,13 @@ public class CommandGrab extends Command { for (int i = 0; i < found.size(); i++) { - if (found.get(i) != null && !(found.get(i) instanceof EntityPlayer) && found.get(i).ridingEntity == null) //isn't null, isn't a player, and isn't riding anything + if (found.get(i) != null && !(found.get(i) instanceof EntityPlayer) && found.get(i).ridingEntity == null) // isn't null, isn't a player, and isn't riding anything { this.tileEntity.grabbedEntities.add(found.get(i)); if (found.get(i) instanceof EntityItem) - this.tileEntity.worldObj.removeEntity(found.get(i)); //items don't move right, so we render them manually - Minecraft.getMinecraft().sndManager.playSound("random.pop", this.tileEntity.xCoord, this.tileEntity.yCoord, this.tileEntity.zCoord, 0.2F, ((this.tileEntity.worldObj.rand.nextFloat() - this.tileEntity.worldObj.rand.nextFloat()) * 0.7F + 1.0F) * 1.0F); + this.tileEntity.worldObj.removeEntity(found.get(i)); // items don't move right, so we render them manually + if (this.world.isRemote) + Minecraft.getMinecraft().sndManager.playSound("random.pop", this.tileEntity.xCoord, this.tileEntity.yCoord, this.tileEntity.zCoord, 0.2F, ((this.tileEntity.worldObj.rand.nextFloat() - this.tileEntity.worldObj.rand.nextFloat()) * 0.7F + 1.0F) * 1.0F); found.get(i).isDead = false; return false; }