cleanup && Packet handler work
This commit is contained in:
parent
78b4ab1514
commit
0bb1c1bc6c
29 changed files with 63 additions and 83 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
// ///////////////////////////////////////
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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()
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue