mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-06-13 22:31:45 +00:00
bd98e98698
Including: * Update to new MCP names * Adding of an build script (see maven 'forge' profile) * Adding of an regeneration code * Simplifying of the command registration * Added command usage description to avoid empty help pages * Added missing raw information * Used a WeakReference as world reference to avoid keeping a world in memory * Added mcmod.info * Fixed player orientation * Fixed printRaw not splitting the message correct
29 lines
1000 B
Java
29 lines
1000 B
Java
package com.sk89q.worldedit.forge;
|
|
|
|
import java.nio.charset.Charset;
|
|
|
|
import net.minecraft.entity.player.EntityPlayerMP;
|
|
import net.minecraft.network.INetworkManager;
|
|
import net.minecraft.network.packet.Packet250CustomPayload;
|
|
|
|
import com.sk89q.worldedit.LocalSession;
|
|
|
|
import cpw.mods.fml.common.network.IPacketHandler;
|
|
import cpw.mods.fml.common.network.Player;
|
|
|
|
public class WECUIPacketHandler implements IPacketHandler {
|
|
public static final Charset UTF_8_CHARSET = Charset.forName("UTF-8");
|
|
|
|
public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player) {
|
|
if (player instanceof EntityPlayerMP) {
|
|
LocalSession session = WorldEditMod.inst.getSession((EntityPlayerMP) player);
|
|
|
|
if (session.hasCUISupport()) {
|
|
return;
|
|
}
|
|
|
|
String text = new String(packet.data, UTF_8_CHARSET);
|
|
session.handleCUIInitializationMessage(text);
|
|
}
|
|
}
|
|
} |