Fixed packets :)
This commit is contained in:
parent
cbb670370f
commit
a726314370
2 changed files with 8 additions and 2 deletions
|
@ -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();
|
||||
|
|
|
@ -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@";
|
||||
|
|
Loading…
Reference in a new issue