Fixed packets :)

This commit is contained in:
Aidan Brady 2013-08-05 15:53:54 -04:00
parent cbb670370f
commit a726314370
2 changed files with 8 additions and 2 deletions

View file

@ -8,6 +8,7 @@ import java.io.DataOutputStream;
import java.util.ArrayList;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.network.INetworkManager;
import net.minecraft.network.packet.Packet250CustomPayload;
import net.minecraft.tileentity.TileEntity;
@ -30,7 +31,7 @@ public class PacketHandler implements IPacketHandler
@Override
public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player)
{
if (packet.channel == ResonantInduction.CHANNEL)
if (packet.channel.equals(ResonantInduction.CHANNEL))
{
ByteArrayDataInput dataStream = ByteStreams.newDataInput(packet.data);
EntityPlayer entityplayer = (EntityPlayer) player;
@ -149,6 +150,11 @@ public class PacketHandler implements IPacketHandler
PacketDispatcher.sendPacketToAllPlayers(getTileEntityPacket(tileEntity, dataValues));
}
public static void sendTileEntityPacketToPlayer(TileEntity tileEntity, EntityPlayer player, Object... dataValues)
{
((EntityPlayerMP)player).playerNetServerHandler.sendPacketToPlayer(getTileEntityPacket(tileEntity, dataValues));
}
public static Packet250CustomPayload getTileEntityPacket(TileEntity tileEntity, Object... dataValues)
{
ByteArrayOutputStream bytes = new ByteArrayOutputStream();

View file

@ -50,7 +50,7 @@ public class ResonantInduction
*/
public static final String ID = "resonantinduction";
public static final String NAME = "Resonant Induction";
public static final String CHANNEL = "R_INDUC";
public static final String CHANNEL = "RESIND";
public static final String MAJOR_VERSION = "@MAJOR@";
public static final String MINOR_VERSION = "@MINOR@";