net.minecraft.network.play.server.SPacketCustomPayload Java Examples
The following examples show how to use
net.minecraft.network.play.server.SPacketCustomPayload.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PayloadSpoofer.java From ForgeHax with MIT License | 6 votes |
@SubscribeEvent(priority = EventPriority.HIGHEST) public void onIncomingPacket(PacketEvent.Incoming.Pre event) { String channel; ByteBuf packetBuffer; final Packet packet = event.getPacket(); if (packet instanceof SPacketCustomPayload || packet instanceof FMLProxyPacket) { if (packet instanceof SPacketCustomPayload) { channel = ((SPacketCustomPayload) packet).getChannelName(); packetBuffer = ((SPacketCustomPayload) packet).getBufferData(); } else { channel = ((FMLProxyPacket) packet).channel(); packetBuffer = ((FMLProxyPacket) packet).payload(); } if (isBlockedPacket(channel, packetBuffer)) { event.setCanceled(true); } } }
Example #2
Source File: ScoreboardListenerService.java From ForgeHax with MIT License | 5 votes |
@SubscribeEvent public void onPacketIn(PacketEvent.Incoming.Pre event) { if (ignore && timer.isStarted() && timer.hasTimeElapsed(wait.get())) { ignore = false; } if (!ignore && event.getPacket() instanceof SPacketCustomPayload) { ignore = true; timer.start(); } else if (ignore && event.getPacket() instanceof SPacketChunkData) { ignore = false; timer.reset(); } }
Example #3
Source File: GPActor.java From GriefPrevention with MIT License | 5 votes |
@Override public void dispatchCUIEvent(CUIEvent event) { String[] params = event.getParameters(); String send = event.getTypeId(); if (params.length > 0) { send = send + "|" + StringUtil.joinString(params, "|"); } PacketBuffer buffer = new PacketBuffer(Unpooled.copiedBuffer(send.getBytes(UTF_8_CHARSET))); SPacketCustomPayload packet = new SPacketCustomPayload(CUI_PLUGIN_CHANNEL, buffer); this.player.connection.sendPacket(packet); }
Example #4
Source File: ForgePlayer.java From FastAsyncWorldedit with GNU General Public License v3.0 | 5 votes |
@Override public void dispatchCUIEvent(CUIEvent event) { String[] params = event.getParameters(); String send = event.getTypeId(); if (params.length > 0) { send = send + "|" + StringUtil.joinString(params, "|"); } PacketBuffer buffer = new PacketBuffer(Unpooled.copiedBuffer(send.getBytes(WECUIPacketHandler.UTF_8_CHARSET))); SPacketCustomPayload packet = new SPacketCustomPayload(ForgeWorldEdit.CUI_PLUGIN_CHANNEL, buffer); this.player.connection.sendPacket(packet); }
Example #5
Source File: ForgePlayer.java From FastAsyncWorldedit with GNU General Public License v3.0 | 5 votes |
@Override public void dispatchCUIEvent(CUIEvent event) { String[] params = event.getParameters(); String send = event.getTypeId(); if (params.length > 0) { send = send + "|" + StringUtil.joinString(params, "|"); } PacketBuffer buffer = new PacketBuffer(Unpooled.copiedBuffer(send.getBytes(WECUIPacketHandler.UTF_8_CHARSET))); SPacketCustomPayload packet = new SPacketCustomPayload(ForgeWorldEdit.CUI_PLUGIN_CHANNEL, buffer); this.player.connection.sendPacket(packet); }
Example #6
Source File: ForgePlayer.java From FastAsyncWorldedit with GNU General Public License v3.0 | 5 votes |
@Override public void dispatchCUIEvent(CUIEvent event) { String[] params = event.getParameters(); String send = event.getTypeId(); if (params.length > 0) { send = send + "|" + StringUtil.joinString(params, "|"); } PacketBuffer buffer = new PacketBuffer(Unpooled.copiedBuffer(send.getBytes(WECUIPacketHandler.UTF_8_CHARSET))); SPacketCustomPayload packet = new SPacketCustomPayload(ForgeWorldEdit.CUI_PLUGIN_CHANNEL, buffer); this.player.connection.sendPacket(packet); }
Example #7
Source File: ForgePlayer.java From FastAsyncWorldedit with GNU General Public License v3.0 | 5 votes |
@Override public void dispatchCUIEvent(CUIEvent event) { String[] params = event.getParameters(); String send = event.getTypeId(); if (params.length > 0) { send = send + "|" + StringUtil.joinString(params, "|"); } PacketBuffer buffer = new PacketBuffer(Unpooled.copiedBuffer(send.getBytes(WECUIPacketHandler.UTF_8_CHARSET))); SPacketCustomPayload packet = new SPacketCustomPayload(ForgeWorldEdit.CUI_PLUGIN_CHANNEL, buffer); this.player.connection.sendPacket(packet); }