mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-26 15:03:04 +00:00
Exposed TileEntityData packet to TileEntities. And added helper sender function.
This commit is contained in:
1 parent
722fe597b8
commit
bb7eaf867f
6 files changed
+124
-25
No files matched your search
@@ -16,6 +16,7 @@ import net.minecraft.src.ModLoader;
|
||||
import net.minecraft.src.NetworkManager;
|
||||
import net.minecraft.src.Packet;
|
||||
import net.minecraft.src.Packet131MapData;
|
||||
import net.minecraft.src.Packet132TileEntityData;
|
||||
import net.minecraft.src.World;
|
||||
|
||||
import java.util.*;
|
||||
@@ -1164,6 +1165,32 @@ public class MinecraftForge
|
||||
sendPacket(net, pkt);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function for wrapping and sending a Packet132TileEntityData packet,
|
||||
* useful so we don't have to edit the packet class itself to add the constructor on the client side.
|
||||
*
|
||||
* @param net The manager to send the packet to
|
||||
* @param x Position X
|
||||
* @param y Position Y
|
||||
* @param z Position Z
|
||||
* @param action Action ID
|
||||
* @param par1 Custom Parameter 1
|
||||
* @param par2 Custom Parameter 2
|
||||
* @param par3 Custom Parameter 3
|
||||
*/
|
||||
public static void sendTileEntityPacket(NetworkManager net, int x, short y, int z, byte action, int par1, int par2, int par3)
|
||||
{
|
||||
Packet132TileEntityData pkt = new Packet132TileEntityData();
|
||||
pkt.xPosition = x;
|
||||
pkt.yPosition = y;
|
||||
pkt.zPosition = z;
|
||||
pkt.actionType = action;
|
||||
pkt.customParam1 = par1;
|
||||
pkt.customParam2 = par2;
|
||||
pkt.customParam3 = par3;
|
||||
sendPacket(net, pkt);
|
||||
}
|
||||
|
||||
private static int isClient = -1;
|
||||
public static boolean isClient()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user