diff --git a/src/minecraft/dark/assembly/client/SoundHandler.java b/src/minecraft/dark/assembly/client/SoundHandler.java index 75074fcc6..5e645157b 100644 --- a/src/minecraft/dark/assembly/client/SoundHandler.java +++ b/src/minecraft/dark/assembly/client/SoundHandler.java @@ -1,9 +1,9 @@ package dark.assembly.client; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraftforge.client.event.sound.SoundLoadEvent; import net.minecraftforge.event.ForgeSubscribe; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import dark.assembly.common.AssemblyLine; @SideOnly(Side.CLIENT) public class SoundHandler diff --git a/src/minecraft/dark/assembly/client/gui/GuiEncoder.java b/src/minecraft/dark/assembly/client/gui/GuiEncoder.java index 158bd40aa..e04ea3f2a 100644 --- a/src/minecraft/dark/assembly/client/gui/GuiEncoder.java +++ b/src/minecraft/dark/assembly/client/gui/GuiEncoder.java @@ -22,7 +22,6 @@ import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.GL11; import universalelectricity.prefab.TranslationHelper; -import universalelectricity.prefab.network.PacketManager; import cpw.mods.fml.common.network.PacketDispatcher; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -31,6 +30,9 @@ import dark.assembly.common.machine.encoder.ContainerEncoder; import dark.assembly.common.machine.encoder.IInventoryWatcher; import dark.assembly.common.machine.encoder.ItemDisk; import dark.assembly.common.machine.encoder.TileEntityEncoder; +import dark.core.common.DarkMain; +import dark.core.network.PacketHandler; + @SideOnly(Side.CLIENT) public class GuiEncoder extends GuiContainer implements IInventoryWatcher { @@ -103,7 +105,7 @@ public class GuiEncoder extends GuiContainer implements IInventoryWatcher if (disk != null) { - PacketDispatcher.sendPacketToServer(PacketManager.getPacket(AssemblyLine.CHANNEL, this.tileEntity, true, (String) this.commandField.getText())); + PacketDispatcher.sendPacketToServer(PacketHandler.instance().getPacket(DarkMain.CHANNEL, this.tileEntity, true, (String) this.commandField.getText())); } } @@ -124,7 +126,7 @@ public class GuiEncoder extends GuiContainer implements IInventoryWatcher if (disk != null && this.selCommand >= 0 && this.selCommand < this.commands.size()) { - PacketDispatcher.sendPacketToServer(PacketManager.getPacket(AssemblyLine.CHANNEL, this.tileEntity, false, this.selCommand)); + PacketDispatcher.sendPacketToServer(PacketHandler.instance().getPacket(DarkMain.CHANNEL, this.tileEntity, false, this.selCommand)); } this.selCommand = -1; diff --git a/src/minecraft/dark/assembly/client/gui/GuiImprinter.java b/src/minecraft/dark/assembly/client/gui/GuiImprinter.java index b4936563f..f069c8303 100644 --- a/src/minecraft/dark/assembly/client/gui/GuiImprinter.java +++ b/src/minecraft/dark/assembly/client/gui/GuiImprinter.java @@ -6,10 +6,9 @@ import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; +import universalelectricity.prefab.TranslationHelper; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; - -import universalelectricity.prefab.TranslationHelper; import dark.assembly.common.AssemblyLine; import dark.assembly.common.imprinter.ContainerImprinter; import dark.assembly.common.imprinter.TileEntityImprinter; diff --git a/src/minecraft/dark/assembly/client/model/ModelAngledBelt.java b/src/minecraft/dark/assembly/client/model/ModelAngledBelt.java index 5d1050ded..62445f642 100644 --- a/src/minecraft/dark/assembly/client/model/ModelAngledBelt.java +++ b/src/minecraft/dark/assembly/client/model/ModelAngledBelt.java @@ -6,10 +6,10 @@ package dark.assembly.client.model; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class ModelAngledBelt extends ModelBase { diff --git a/src/minecraft/dark/assembly/client/model/ModelConveyorBelt.java b/src/minecraft/dark/assembly/client/model/ModelConveyorBelt.java index 54f27b92f..808fab11a 100644 --- a/src/minecraft/dark/assembly/client/model/ModelConveyorBelt.java +++ b/src/minecraft/dark/assembly/client/model/ModelConveyorBelt.java @@ -1,9 +1,9 @@ package dark.assembly.client.model; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class ModelConveyorBelt extends ModelBase { diff --git a/src/minecraft/dark/assembly/client/model/ModelCraneArmMount.java b/src/minecraft/dark/assembly/client/model/ModelCraneArmMount.java index b3bf7282b..1f1dc1ad9 100644 --- a/src/minecraft/dark/assembly/client/model/ModelCraneArmMount.java +++ b/src/minecraft/dark/assembly/client/model/ModelCraneArmMount.java @@ -1,9 +1,9 @@ package dark.assembly.client.model; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class ModelCraneArmMount extends ModelBase { diff --git a/src/minecraft/dark/assembly/client/model/ModelCraneController.java b/src/minecraft/dark/assembly/client/model/ModelCraneController.java index a3b940662..940e3a700 100644 --- a/src/minecraft/dark/assembly/client/model/ModelCraneController.java +++ b/src/minecraft/dark/assembly/client/model/ModelCraneController.java @@ -6,10 +6,10 @@ package dark.assembly.client.model; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class ModelCraneController extends ModelBase { diff --git a/src/minecraft/dark/assembly/client/model/ModelCraneRail.java b/src/minecraft/dark/assembly/client/model/ModelCraneRail.java index b9fb45d26..784003012 100644 --- a/src/minecraft/dark/assembly/client/model/ModelCraneRail.java +++ b/src/minecraft/dark/assembly/client/model/ModelCraneRail.java @@ -1,9 +1,9 @@ package dark.assembly.client.model; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class ModelCraneRail extends ModelBase { diff --git a/src/minecraft/dark/assembly/client/model/ModelDropBox.java b/src/minecraft/dark/assembly/client/model/ModelDropBox.java index cc876b946..165844649 100644 --- a/src/minecraft/dark/assembly/client/model/ModelDropBox.java +++ b/src/minecraft/dark/assembly/client/model/ModelDropBox.java @@ -1,9 +1,9 @@ package dark.assembly.client.model; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class ModelDropBox extends ModelBase { diff --git a/src/minecraft/dark/assembly/client/model/ModelHelper.java b/src/minecraft/dark/assembly/client/model/ModelHelper.java index ded231c14..7a1bcb882 100644 --- a/src/minecraft/dark/assembly/client/model/ModelHelper.java +++ b/src/minecraft/dark/assembly/client/model/ModelHelper.java @@ -5,10 +5,10 @@ import static org.lwjgl.opengl.GL11.glBegin; import static org.lwjgl.opengl.GL11.glEnd; import static org.lwjgl.opengl.GL11.glTexCoord2f; import static org.lwjgl.opengl.GL11.glVertex3d; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.util.Vec3; import net.minecraftforge.common.ForgeDirection; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class ModelHelper { diff --git a/src/minecraft/dark/assembly/client/model/ModelLaserDrill.java b/src/minecraft/dark/assembly/client/model/ModelLaserDrill.java index c54262325..6d161309b 100644 --- a/src/minecraft/dark/assembly/client/model/ModelLaserDrill.java +++ b/src/minecraft/dark/assembly/client/model/ModelLaserDrill.java @@ -1,9 +1,9 @@ package dark.assembly.client.model; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class ModelLaserDrill extends ModelBase { diff --git a/src/minecraft/dark/assembly/client/model/ModelManipulator.java b/src/minecraft/dark/assembly/client/model/ModelManipulator.java index 2d5eee1e9..dc9112415 100644 --- a/src/minecraft/dark/assembly/client/model/ModelManipulator.java +++ b/src/minecraft/dark/assembly/client/model/ModelManipulator.java @@ -1,9 +1,9 @@ package dark.assembly.client.model; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class ModelManipulator extends ModelBase { diff --git a/src/minecraft/dark/assembly/client/model/ModelRejectorPiston.java b/src/minecraft/dark/assembly/client/model/ModelRejectorPiston.java index 05feda942..03866db91 100644 --- a/src/minecraft/dark/assembly/client/model/ModelRejectorPiston.java +++ b/src/minecraft/dark/assembly/client/model/ModelRejectorPiston.java @@ -6,10 +6,10 @@ package dark.assembly.client.model; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class ModelRejectorPiston extends ModelBase { diff --git a/src/minecraft/dark/assembly/client/render/RenderArmbot.java b/src/minecraft/dark/assembly/client/render/RenderArmbot.java index c37bb19b2..e99e0bac3 100644 --- a/src/minecraft/dark/assembly/client/render/RenderArmbot.java +++ b/src/minecraft/dark/assembly/client/render/RenderArmbot.java @@ -14,10 +14,9 @@ import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; +import universalelectricity.core.vector.Vector3; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; - -import universalelectricity.core.vector.Vector3; import dark.assembly.client.model.ModelArmbot; import dark.assembly.common.AssemblyLine; import dark.assembly.common.armbot.TileEntityArmbot; diff --git a/src/minecraft/dark/assembly/client/render/RenderCraneController.java b/src/minecraft/dark/assembly/client/render/RenderCraneController.java index 763f51604..16758664f 100644 --- a/src/minecraft/dark/assembly/client/render/RenderCraneController.java +++ b/src/minecraft/dark/assembly/client/render/RenderCraneController.java @@ -6,11 +6,11 @@ import static org.lwjgl.opengl.GL11.glPopMatrix; import static org.lwjgl.opengl.GL11.glPushMatrix; import static org.lwjgl.opengl.GL11.glRotatef; import static org.lwjgl.opengl.GL11.glTranslated; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.ForgeDirection; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import dark.assembly.client.model.ModelCraneController; import dark.assembly.common.AssemblyLine; import dark.assembly.common.machine.crane.CraneHelper; diff --git a/src/minecraft/dark/assembly/client/render/RenderCraneFrame.java b/src/minecraft/dark/assembly/client/render/RenderCraneFrame.java index 93a328dbd..d94c00979 100644 --- a/src/minecraft/dark/assembly/client/render/RenderCraneFrame.java +++ b/src/minecraft/dark/assembly/client/render/RenderCraneFrame.java @@ -6,12 +6,12 @@ import static org.lwjgl.opengl.GL11.glPopMatrix; import static org.lwjgl.opengl.GL11.glPushMatrix; import static org.lwjgl.opengl.GL11.glRotatef; import static org.lwjgl.opengl.GL11.glTranslated; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.ForgeDirection; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import dark.assembly.client.model.ModelCraneRail; import dark.assembly.common.AssemblyLine; import dark.assembly.common.machine.crane.CraneHelper; diff --git a/src/minecraft/dark/assembly/client/render/RenderCrate.java b/src/minecraft/dark/assembly/client/render/RenderCrate.java index 7708a526e..511bff84b 100644 --- a/src/minecraft/dark/assembly/client/render/RenderCrate.java +++ b/src/minecraft/dark/assembly/client/render/RenderCrate.java @@ -17,10 +17,9 @@ import net.minecraftforge.common.ForgeDirection; import org.lwjgl.opengl.GL11; +import universalelectricity.core.vector.Vector3; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; - -import universalelectricity.core.vector.Vector3; import dark.assembly.common.machine.TileEntityCrate; @SideOnly(Side.CLIENT) public class RenderCrate extends TileEntitySpecialRenderer diff --git a/src/minecraft/dark/assembly/client/render/RenderImprintable.java b/src/minecraft/dark/assembly/client/render/RenderImprintable.java index 2ad431b0f..d4ef3c513 100644 --- a/src/minecraft/dark/assembly/client/render/RenderImprintable.java +++ b/src/minecraft/dark/assembly/client/render/RenderImprintable.java @@ -2,15 +2,14 @@ package dark.assembly.client.render; import java.util.ArrayList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MovingObjectPosition; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import dark.assembly.common.imprinter.ItemImprinter; import dark.assembly.common.imprinter.prefab.TileEntityFilterable; diff --git a/src/minecraft/dark/assembly/client/render/RenderManipulator.java b/src/minecraft/dark/assembly/client/render/RenderManipulator.java index 860658f9e..efb84957c 100644 --- a/src/minecraft/dark/assembly/client/render/RenderManipulator.java +++ b/src/minecraft/dark/assembly/client/render/RenderManipulator.java @@ -7,7 +7,6 @@ import org.lwjgl.opengl.GL11; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; - import dark.assembly.client.model.ModelManipulator; import dark.assembly.common.AssemblyLine; import dark.assembly.common.machine.TileEntityManipulator; diff --git a/src/minecraft/dark/assembly/client/render/RenderRejector.java b/src/minecraft/dark/assembly/client/render/RenderRejector.java index 81530ab79..74f378fd5 100644 --- a/src/minecraft/dark/assembly/client/render/RenderRejector.java +++ b/src/minecraft/dark/assembly/client/render/RenderRejector.java @@ -7,7 +7,6 @@ import org.lwjgl.opengl.GL11; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; - import dark.assembly.client.model.ModelRejectorPiston; import dark.assembly.common.AssemblyLine; import dark.assembly.common.machine.TileEntityRejector; diff --git a/src/minecraft/dark/assembly/common/AssemblyLine.java b/src/minecraft/dark/assembly/common/AssemblyLine.java index 53001af36..69454c2f9 100644 --- a/src/minecraft/dark/assembly/common/AssemblyLine.java +++ b/src/minecraft/dark/assembly/common/AssemblyLine.java @@ -12,7 +12,6 @@ import net.minecraftforge.common.Configuration; import org.modstats.ModstatInfo; import universalelectricity.prefab.TranslationHelper; -import universalelectricity.prefab.network.PacketManager; import cpw.mods.fml.common.FMLLog; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; @@ -51,13 +50,13 @@ import dark.assembly.common.machine.crane.TileEntityCraneRail; import dark.assembly.common.machine.encoder.BlockEncoder; import dark.assembly.common.machine.encoder.ItemDisk; import dark.assembly.common.machine.encoder.TileEntityEncoder; -import dark.core.common.DarkMain; import dark.core.common.BlockRegistry.BlockData; +import dark.core.common.DarkMain; import dark.core.prefab.ModPrefab; @ModstatInfo(prefix = "asmline") -@Mod(modid = AssemblyLine.CHANNEL, name = AssemblyLine.MOD_NAME, version = DarkMain.VERSION, dependencies = "required-after:DarkCore", useMetadata = true) -@NetworkMod(channels = { AssemblyLine.CHANNEL }, clientSideRequired = true, serverSideRequired = false, packetHandler = PacketManager.class) +@Mod(modid = AssemblyLine.MOD_ID, name = AssemblyLine.MOD_NAME, version = DarkMain.VERSION, dependencies = "required-after:DarkCore", useMetadata = true) +@NetworkMod( clientSideRequired = true, serverSideRequired = false) public class AssemblyLine extends ModPrefab { @@ -65,13 +64,11 @@ public class AssemblyLine extends ModPrefab public static final String MOD_ID = "AssemblyLine"; public static final String MOD_NAME = "Assembly Line"; - // @NetworkMod - public static final String CHANNEL = "AssemblyLine"; @SidedProxy(clientSide = "dark.assembly.client.ClientProxy", serverSide = "dark.assembly.common.CommonProxy") public static CommonProxy proxy; - @Instance(AssemblyLine.CHANNEL) + @Instance(AssemblyLine.MOD_ID) public static AssemblyLine instance; public static ALRecipeLoader recipeLoader; diff --git a/src/minecraft/dark/assembly/common/armbot/TileEntityArmbot.java b/src/minecraft/dark/assembly/common/armbot/TileEntityArmbot.java index 3cb04d64f..66da5b704 100644 --- a/src/minecraft/dark/assembly/common/armbot/TileEntityArmbot.java +++ b/src/minecraft/dark/assembly/common/armbot/TileEntityArmbot.java @@ -8,20 +8,16 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.EntityList; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; -import net.minecraft.network.packet.Packet; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.MathHelper; import net.minecraftforge.common.ForgeDirection; -import universalelectricity.core.grid.IElectricityNetwork; import universalelectricity.core.vector.Vector3; import universalelectricity.prefab.TranslationHelper; import universalelectricity.prefab.network.IPacketReceiver; -import universalelectricity.prefab.network.PacketManager; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.relauncher.Side; import dan200.computer.api.IComputerAccess; @@ -41,6 +37,7 @@ import dark.assembly.common.armbot.command.CommandUse; import dark.assembly.common.machine.TileEntityAssembly; import dark.assembly.common.machine.encoder.ItemDisk; import dark.core.common.DarkMain; +import dark.core.network.PacketHandler; import dark.core.prefab.IMultiBlock; import dark.core.prefab.helpers.ItemWorldHelper; @@ -253,7 +250,7 @@ public class TileEntityArmbot extends TileEntityAssembly implements IMultiBlock, if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER && this.ticks % 20 == 0) { - PacketManager.sendPacketToClients(this.getDescriptionPacket(), this.worldObj, new Vector3(this), 50); + PacketHandler.instance().sendPacketToClients(this.getDescriptionPacket(), this.worldObj, new Vector3(this), 50); } } @@ -570,7 +567,7 @@ public class TileEntityArmbot extends TileEntityAssembly implements IMultiBlock, this.commandManager.addCommand(this, command); if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER) { - PacketManager.sendPacketToClients(this.getDescriptionPacket(), this.worldObj, new Vector3(this), 50); + PacketHandler.instance().sendPacketToClients(this.getDescriptionPacket(), this.worldObj, new Vector3(this), 50); } } @@ -579,7 +576,7 @@ public class TileEntityArmbot extends TileEntityAssembly implements IMultiBlock, this.commandManager.addCommand(this, command, parameters); if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER) { - PacketManager.sendPacketToClients(this.getDescriptionPacket(), this.worldObj, new Vector3(this), 50); + PacketHandler.instance().sendPacketToClients(this.getDescriptionPacket(), this.worldObj, new Vector3(this), 50); } } diff --git a/src/minecraft/dark/assembly/common/imprinter/TileEntityImprinter.java b/src/minecraft/dark/assembly/common/imprinter/TileEntityImprinter.java index 807256241..e5bf56d8f 100644 --- a/src/minecraft/dark/assembly/common/imprinter/TileEntityImprinter.java +++ b/src/minecraft/dark/assembly/common/imprinter/TileEntityImprinter.java @@ -19,18 +19,18 @@ import universalelectricity.core.vector.Vector3; import universalelectricity.core.vector.VectorHelper; import universalelectricity.prefab.TranslationHelper; import universalelectricity.prefab.network.IPacketReceiver; -import universalelectricity.prefab.network.PacketManager; import universalelectricity.prefab.tile.TileEntityAdvanced; import com.google.common.io.ByteArrayDataInput; import dark.assembly.api.IArmbot; import dark.assembly.api.IArmbotUseable; -import dark.assembly.common.AssemblyLine; +import dark.core.common.DarkMain; +import dark.core.network.PacketHandler; import dark.core.prefab.TileEntityMulti; import dark.core.prefab.helpers.AutoCraftingManager; -import dark.core.prefab.helpers.Pair; import dark.core.prefab.helpers.AutoCraftingManager.IAutoCrafter; +import dark.core.prefab.helpers.Pair; import dark.core.prefab.invgui.ISlotPickResult; public class TileEntityImprinter extends TileEntityAdvanced implements ISidedInventory, IArmbotUseable, IPacketReceiver, ISlotPickResult, IAutoCrafter @@ -190,7 +190,7 @@ public class TileEntityImprinter extends TileEntityAdvanced implements ISidedInv } /** Construct an InventoryCrafting Matrix on the fly. - * + * * @return */ public InventoryCrafting getCraftingMatrix() { @@ -467,7 +467,7 @@ public class TileEntityImprinter extends TileEntityAdvanced implements ISidedInv @Override public Packet getDescriptionPacket() { - return PacketManager.getPacket(AssemblyLine.CHANNEL, this, this.searchInventories); + return PacketHandler.instance().getPacket(DarkMain.CHANNEL, this, this.searchInventories); } // /////////////////////////////////////// diff --git a/src/minecraft/dark/assembly/common/imprinter/prefab/TileEntityFilterable.java b/src/minecraft/dark/assembly/common/imprinter/prefab/TileEntityFilterable.java index d26c01388..d2b64e441 100644 --- a/src/minecraft/dark/assembly/common/imprinter/prefab/TileEntityFilterable.java +++ b/src/minecraft/dark/assembly/common/imprinter/prefab/TileEntityFilterable.java @@ -4,13 +4,10 @@ import java.util.ArrayList; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.packet.Packet; import net.minecraftforge.common.ForgeDirection; import universalelectricity.prefab.network.IPacketReceiver; -import universalelectricity.prefab.network.PacketManager; import universalelectricity.prefab.tile.IRotatable; import dark.assembly.api.IFilterable; -import dark.assembly.common.AssemblyLine; import dark.assembly.common.imprinter.ItemImprinter; import dark.assembly.common.machine.TileEntityAssembly; diff --git a/src/minecraft/dark/assembly/common/machine/TileEntityAssembly.java b/src/minecraft/dark/assembly/common/machine/TileEntityAssembly.java index ce5070fea..a8ea08336 100644 --- a/src/minecraft/dark/assembly/common/machine/TileEntityAssembly.java +++ b/src/minecraft/dark/assembly/common/machine/TileEntityAssembly.java @@ -17,7 +17,7 @@ import dark.core.prefab.tilenetwork.NetworkTileEntities; /** A class to be inherited by all machines on the assembly line. This class acts as a single peace * in a network of similar tiles allowing all to share power from one or more sources - * + * * @author DarkGuardsman */ public abstract class TileEntityAssembly extends TileEntityMachine implements INetworkEnergyPart { @@ -73,12 +73,6 @@ public abstract class TileEntityAssembly extends TileEntityMachine implements IN this.onUpdate(); } - @Override - public String getChannel() - { - return AssemblyLine.CHANNEL; - } - @Override public boolean canRun() { diff --git a/src/minecraft/dark/assembly/common/machine/TileEntityCrate.java b/src/minecraft/dark/assembly/common/machine/TileEntityCrate.java index 7fba7e412..4ce026278 100644 --- a/src/minecraft/dark/assembly/common/machine/TileEntityCrate.java +++ b/src/minecraft/dark/assembly/common/machine/TileEntityCrate.java @@ -8,14 +8,14 @@ import net.minecraft.network.packet.Packet; import net.minecraft.network.packet.Packet250CustomPayload; import net.minecraftforge.common.ForgeDirection; import universalelectricity.prefab.network.IPacketReceiver; -import universalelectricity.prefab.network.PacketManager; import com.google.common.io.ByteArrayDataInput; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.relauncher.Side; -import dark.assembly.common.AssemblyLine; +import dark.core.common.DarkMain; import dark.core.interfaces.IExternalInv; +import dark.core.network.PacketHandler; import dark.core.prefab.TileEntityInv; public class TileEntityCrate extends TileEntityInv implements IPacketReceiver, IExternalInv @@ -51,7 +51,7 @@ public class TileEntityCrate extends TileEntityInv implements IPacketReceiver, I /** Turns the inventory array into a single stack of matching items. This assumes that all items * in the crate are the same TODO eject minority items and only keep the majority that are the * same to prevent duplication issues - * + * * @param force - force a rebuild of the inventory from the single stack created */ public void buildSampleStack() { @@ -137,7 +137,7 @@ public class TileEntityCrate extends TileEntityInv implements IPacketReceiver, I { if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER) { - PacketManager.sendPacketToClients(this.getDescriptionPacket(), this.worldObj); + PacketHandler.instance().sendPacketToClients(this.getDescriptionPacket(), this.worldObj); } } } @@ -197,7 +197,7 @@ public class TileEntityCrate extends TileEntityInv implements IPacketReceiver, I { if (dataStream.readBoolean()) { - this.sampleStack = ItemStack.loadItemStackFromNBT(PacketManager.readNBTTagCompound(dataStream)); + this.sampleStack = ItemStack.loadItemStackFromNBT(PacketHandler.instance().readNBTTagCompound(dataStream)); this.sampleStack.stackSize = dataStream.readInt(); } else @@ -219,11 +219,11 @@ public class TileEntityCrate extends TileEntityInv implements IPacketReceiver, I ItemStack stack = this.getSampleStack(); if (stack != null) { - return PacketManager.getPacket(AssemblyLine.CHANNEL, this, true, stack.writeToNBT(new NBTTagCompound()), stack.stackSize); + return PacketHandler.instance().getPacket(DarkMain.CHANNEL, this, true, stack.writeToNBT(new NBTTagCompound()), stack.stackSize); } else { - return PacketManager.getPacket(AssemblyLine.CHANNEL, this, false); + return PacketHandler.instance().getPacket(DarkMain.CHANNEL, this, false); } } diff --git a/src/minecraft/dark/assembly/common/machine/TileEntityDetector.java b/src/minecraft/dark/assembly/common/machine/TileEntityDetector.java index e225275e6..6116c94dd 100644 --- a/src/minecraft/dark/assembly/common/machine/TileEntityDetector.java +++ b/src/minecraft/dark/assembly/common/machine/TileEntityDetector.java @@ -8,9 +8,9 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.AxisAlignedBB; import net.minecraftforge.common.ForgeDirection; -import universalelectricity.prefab.network.PacketManager; import dark.assembly.common.AssemblyLine; import dark.assembly.common.imprinter.prefab.TileEntityFilterable; +import dark.core.network.PacketHandler; public class TileEntityDetector extends TileEntityFilterable { @@ -71,7 +71,7 @@ public class TileEntityDetector extends TileEntityFilterable } } - PacketManager.sendPacketToClients(getDescriptionPacket()); + PacketHandler.instance().sendPacketToClients(getDescriptionPacket()); } } } diff --git a/src/minecraft/dark/assembly/common/machine/belt/TileEntityConveyorBelt.java b/src/minecraft/dark/assembly/common/machine/belt/TileEntityConveyorBelt.java index e55e5a1d8..deef3b10f 100644 --- a/src/minecraft/dark/assembly/common/machine/belt/TileEntityConveyorBelt.java +++ b/src/minecraft/dark/assembly/common/machine/belt/TileEntityConveyorBelt.java @@ -14,14 +14,14 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraftforge.common.ForgeDirection; import universalelectricity.core.vector.Vector3; import universalelectricity.prefab.network.IPacketReceiver; -import universalelectricity.prefab.network.PacketManager; import universalelectricity.prefab.tile.IRotatable; import dark.assembly.api.IBelt; import dark.assembly.common.AssemblyLine; import dark.assembly.common.machine.TileEntityAssembly; +import dark.core.network.PacketHandler; /** Conveyer belt TileEntity that allows entities of all kinds to be moved - * + * * @author DarkGuardsman */ public class TileEntityConveyorBelt extends TileEntityAssembly implements IPacketReceiver, IBelt, IRotatable { @@ -109,7 +109,7 @@ public class TileEntityConveyorBelt extends TileEntityAssembly implements IPacke @Override public Packet getDescriptionPacket() { - return PacketManager.getPacket(AssemblyLine.CHANNEL, this, slantPacketID, this.slantType.ordinal()); + return PacketHandler.instance().getPacket(this.getChannel(), this, slantPacketID, this.slantType.ordinal()); } public SlantType getSlant() diff --git a/src/minecraft/dark/assembly/common/machine/crane/TileEntityCraneRail.java b/src/minecraft/dark/assembly/common/machine/crane/TileEntityCraneRail.java index b97899129..194789b5c 100644 --- a/src/minecraft/dark/assembly/common/machine/crane/TileEntityCraneRail.java +++ b/src/minecraft/dark/assembly/common/machine/crane/TileEntityCraneRail.java @@ -1,9 +1,8 @@ package dark.assembly.common.machine.crane; -import universalelectricity.prefab.tile.TileEntityAdvanced; import net.minecraftforge.common.ForgeDirection; +import universalelectricity.prefab.tile.TileEntityAdvanced; import dark.assembly.api.ICraneStructure; -import dark.assembly.common.machine.TileEntityAssembly; public class TileEntityCraneRail extends TileEntityAdvanced implements ICraneStructure {