diff --git a/resources/assemblyline/client/sound/conveyor.wav b/resources/assemblyline/client/sound/conveyor.wav deleted file mode 100644 index 1501a9cd..00000000 Binary files a/resources/assemblyline/client/sound/conveyor.wav and /dev/null differ diff --git a/resources/assemblyline/conveyor.ogg b/resources/assemblyline/conveyor.ogg new file mode 100644 index 00000000..4767c47b Binary files /dev/null and b/resources/assemblyline/conveyor.ogg differ diff --git a/src/minecraft/assemblyline/client/ClientProxy.java b/src/minecraft/assemblyline/client/ClientProxy.java index a8fce04e..15affa72 100644 --- a/src/minecraft/assemblyline/client/ClientProxy.java +++ b/src/minecraft/assemblyline/client/ClientProxy.java @@ -15,7 +15,6 @@ import assemblyline.client.render.RenderCrate; import assemblyline.client.render.RenderDetector; import assemblyline.client.render.RenderManipulator; import assemblyline.client.render.RenderRejector; -import assemblyline.client.sound.SoundManager; import assemblyline.common.AssemblyLine; import assemblyline.common.CommonProxy; import assemblyline.common.block.TileEntityCrate; @@ -38,7 +37,7 @@ public class ClientProxy extends CommonProxy MinecraftForgeClient.preloadTexture(AssemblyLine.BLOCK_TEXTURE_PATH); MinecraftForgeClient.preloadTexture(AssemblyLine.ITEM_TEXTURE_PATH); RenderingRegistry.registerBlockHandler(new BlockRenderingHandler()); - MinecraftForge.EVENT_BUS.register(new SoundManager()); + MinecraftForge.EVENT_BUS.register(SoundManager.INSTANCE); } @Override diff --git a/src/minecraft/assemblyline/client/SoundManager.java b/src/minecraft/assemblyline/client/SoundManager.java new file mode 100644 index 00000000..38f0f387 --- /dev/null +++ b/src/minecraft/assemblyline/client/SoundManager.java @@ -0,0 +1,30 @@ +package assemblyline.client; + +import java.net.URL; + +import net.minecraftforge.client.event.sound.SoundLoadEvent; +import net.minecraftforge.event.ForgeSubscribe; +import assemblyline.common.AssemblyLine; + +public class SoundManager +{ + public static final SoundManager INSTANCE = new SoundManager(); + + public static final String[] SOUND_FILES = { "conveyor.ogg" }; + + @ForgeSubscribe + public void loadSoundEvents(SoundLoadEvent event) + { + for (int i = 0; i < SOUND_FILES.length; i++) + { + URL url = this.getClass().getResource(AssemblyLine.DIRECTORY + SOUND_FILES[i]); + + event.manager.soundPoolSounds.addSound(AssemblyLine.DIRECTORY + SOUND_FILES[i], url); + + if (url == null) + { + System.out.println("Invalid sound file: " + SOUND_FILES[i]); + } + } + } +} diff --git a/src/minecraft/assemblyline/client/render/RenderArmbot.java b/src/minecraft/assemblyline/client/render/RenderArmbot.java index a0041588..31b8f571 100644 --- a/src/minecraft/assemblyline/client/render/RenderArmbot.java +++ b/src/minecraft/assemblyline/client/render/RenderArmbot.java @@ -16,7 +16,6 @@ import universalelectricity.core.vector.Vector3; import assemblyline.client.model.ModelArmbot; import assemblyline.common.AssemblyLine; import assemblyline.common.machine.armbot.TileEntityArmbot; -import assemblyline.common.machine.command.Command; public class RenderArmbot extends TileEntitySpecialRenderer { diff --git a/src/minecraft/assemblyline/client/sound/SoundManager.java b/src/minecraft/assemblyline/client/sound/SoundManager.java deleted file mode 100644 index 3b93af4e..00000000 --- a/src/minecraft/assemblyline/client/sound/SoundManager.java +++ /dev/null @@ -1,21 +0,0 @@ -package assemblyline.client.sound; - -import net.minecraftforge.client.event.sound.SoundLoadEvent; -import net.minecraftforge.event.ForgeSubscribe; - -public class SoundManager -{ - @ForgeSubscribe - public void onSound(SoundLoadEvent event) - { - try - { - event.manager.soundPoolSounds.addSound("assemblyline/conveyor.wav", getClass().getResource("conveyor.wav")); - - } - catch (Exception e) - { - System.err.println("Failed to register one or more sounds."); - } - } -} diff --git a/src/minecraft/assemblyline/client/sound/conveyor.wav b/src/minecraft/assemblyline/client/sound/conveyor.wav deleted file mode 100644 index 1501a9cd..00000000 Binary files a/src/minecraft/assemblyline/client/sound/conveyor.wav and /dev/null differ diff --git a/src/minecraft/assemblyline/common/AssemblyLine.java b/src/minecraft/assemblyline/common/AssemblyLine.java index 0b4d1329..e4983ba5 100644 --- a/src/minecraft/assemblyline/common/AssemblyLine.java +++ b/src/minecraft/assemblyline/common/AssemblyLine.java @@ -55,9 +55,10 @@ public class AssemblyLine public static final String CHANNEL = "AssemblyLine"; - public static final String RESOURCE_PATH = "/assemblyline/"; - public static final String TEXTURE_PATH = RESOURCE_PATH + "textures/"; - public static final String LANGUAGE_PATH = RESOURCE_PATH + "language/"; + public static final String DIRECTORY_NO_SLASH = "assemblyline/"; + public static final String DIRECTORY = "/" + DIRECTORY_NO_SLASH; + public static final String TEXTURE_PATH = DIRECTORY + "textures/"; + public static final String LANGUAGE_PATH = DIRECTORY + "language/"; public static final String BLOCK_TEXTURE_PATH = TEXTURE_PATH + "blocks.png"; public static final String ITEM_TEXTURE_PATH = TEXTURE_PATH + "items.png"; @@ -156,8 +157,6 @@ public class AssemblyLine // Manipulator GameRegistry.addRecipe(new ShapelessOreRecipe(blockManipulator, new Object[] { Block.dispenser, "basicCircuit" })); - - UETab.setItemStack(new ItemStack(blockConveyorBelt)); } public static void printSidedData(String data) diff --git a/src/minecraft/assemblyline/common/machine/armbot/TileEntityArmbot.java b/src/minecraft/assemblyline/common/machine/armbot/TileEntityArmbot.java index f74b6819..ed7bdf2f 100644 --- a/src/minecraft/assemblyline/common/machine/armbot/TileEntityArmbot.java +++ b/src/minecraft/assemblyline/common/machine/armbot/TileEntityArmbot.java @@ -8,7 +8,6 @@ import java.util.EnumSet; import java.util.List; import net.minecraft.block.Block; -import net.minecraft.client.Minecraft; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityList; import net.minecraft.entity.item.EntityItem; @@ -22,7 +21,6 @@ import net.minecraft.network.packet.Packet; import net.minecraft.network.packet.Packet250CustomPayload; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MovingObjectPosition; import net.minecraftforge.common.ForgeDirection; import universalelectricity.core.electricity.ElectricityConnections; import universalelectricity.core.implement.IJouleStorage; @@ -32,7 +30,6 @@ import universalelectricity.prefab.multiblock.IMultiBlock; import universalelectricity.prefab.network.IPacketReceiver; import universalelectricity.prefab.network.PacketManager; import assemblyline.api.IArmbotUseable; -import assemblyline.client.render.RenderHelper; import assemblyline.common.AssemblyLine; import assemblyline.common.machine.TileEntityAssemblyNetwork; import assemblyline.common.machine.command.Command; diff --git a/src/minecraft/assemblyline/common/machine/belt/TileEntityConveyorBelt.java b/src/minecraft/assemblyline/common/machine/belt/TileEntityConveyorBelt.java index 73cbed80..1707f253 100644 --- a/src/minecraft/assemblyline/common/machine/belt/TileEntityConveyorBelt.java +++ b/src/minecraft/assemblyline/common/machine/belt/TileEntityConveyorBelt.java @@ -121,8 +121,7 @@ public class TileEntityConveyorBelt extends TileEntityAssemblyNetwork implements { if (this.ticks % 10 == 0 && this.worldObj.isRemote && this.worldObj.getBlockId(xCoord - 1, yCoord, zCoord) != AssemblyLine.blockConveyorBelt.blockID && this.worldObj.getBlockId(xCoord, yCoord, zCoord - 1) != AssemblyLine.blockConveyorBelt.blockID) { - // Sound is 0.5 seconds long (20 ticks/second) - this.worldObj.playSound(this.xCoord, this.yCoord, this.zCoord, "assemblyline.conveyor", 0.3f, 0.3f, true); + this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "assemblyline.conveyor", 1.3f, 0.3f); } this.wheelRotation += 40; diff --git a/src/minecraft/assemblyline/common/machine/command/Command.java b/src/minecraft/assemblyline/common/machine/command/Command.java index 0bd95504..737686b3 100644 --- a/src/minecraft/assemblyline/common/machine/command/Command.java +++ b/src/minecraft/assemblyline/common/machine/command/Command.java @@ -3,8 +3,6 @@ package assemblyline.common.machine.command; import java.util.HashMap; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.nbt.NBTTagString; import net.minecraft.world.World; import assemblyline.common.machine.armbot.TileEntityArmbot; diff --git a/src/minecraft/assemblyline/common/machine/command/CommandManager.java b/src/minecraft/assemblyline/common/machine/command/CommandManager.java index 15c170f0..2681228a 100644 --- a/src/minecraft/assemblyline/common/machine/command/CommandManager.java +++ b/src/minecraft/assemblyline/common/machine/command/CommandManager.java @@ -6,7 +6,6 @@ import java.util.List; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.nbt.NBTTagString; -import assemblyline.common.AssemblyLine; import assemblyline.common.machine.armbot.TileEntityArmbot; import cpw.mods.fml.common.FMLLog; diff --git a/src/minecraft/assemblyline/common/machine/command/CommandRepeat.java b/src/minecraft/assemblyline/common/machine/command/CommandRepeat.java index ac80fad6..89513360 100644 --- a/src/minecraft/assemblyline/common/machine/command/CommandRepeat.java +++ b/src/minecraft/assemblyline/common/machine/command/CommandRepeat.java @@ -1,7 +1,6 @@ package assemblyline.common.machine.command; import net.minecraft.nbt.NBTTagCompound; -import assemblyline.common.machine.armbot.TileEntityArmbot; /** * This task resets all previous tasks and does them again in a loop.