Merge branch 'master' of https://github.com/calclavia/Resonant-Induction
This commit is contained in:
commit
ec8e259d0b
2 changed files with 8 additions and 2 deletions
|
@ -8,6 +8,7 @@ import java.io.DataOutputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
import net.minecraft.network.INetworkManager;
|
import net.minecraft.network.INetworkManager;
|
||||||
import net.minecraft.network.packet.Packet250CustomPayload;
|
import net.minecraft.network.packet.Packet250CustomPayload;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
@ -30,7 +31,7 @@ public class PacketHandler implements IPacketHandler
|
||||||
@Override
|
@Override
|
||||||
public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player)
|
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);
|
ByteArrayDataInput dataStream = ByteStreams.newDataInput(packet.data);
|
||||||
EntityPlayer entityplayer = (EntityPlayer) player;
|
EntityPlayer entityplayer = (EntityPlayer) player;
|
||||||
|
@ -148,6 +149,11 @@ public class PacketHandler implements IPacketHandler
|
||||||
{
|
{
|
||||||
PacketDispatcher.sendPacketToAllPlayers(getTileEntityPacket(tileEntity, dataValues));
|
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)
|
public static Packet250CustomPayload getTileEntityPacket(TileEntity tileEntity, Object... dataValues)
|
||||||
{
|
{
|
||||||
|
|
|
@ -51,7 +51,7 @@ public class ResonantInduction
|
||||||
*/
|
*/
|
||||||
public static final String ID = "resonantinduction";
|
public static final String ID = "resonantinduction";
|
||||||
public static final String NAME = "Resonant Induction";
|
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 MAJOR_VERSION = "@MAJOR@";
|
||||||
public static final String MINOR_VERSION = "@MINOR@";
|
public static final String MINOR_VERSION = "@MINOR@";
|
||||||
|
|
Loading…
Reference in a new issue