mirror of
https://github.com/GeyserMC/Floodgate.git
synced 2025-12-19 14:59:20 +00:00
Removed the 'should encrypt' argument from the 'packet' plugin message
This commit is contained in:
@@ -29,15 +29,6 @@ import java.util.UUID;
|
|||||||
import org.geysermc.floodgate.api.player.FloodgatePlayer;
|
import org.geysermc.floodgate.api.player.FloodgatePlayer;
|
||||||
|
|
||||||
public interface Unsafe {
|
public interface Unsafe {
|
||||||
void sendPacket(UUID bedrockPlayer, byte[] packetData, boolean encrypt);
|
void sendPacket(UUID bedrockPlayer, byte[] packetData);
|
||||||
|
void sendPacket(FloodgatePlayer player, byte[] packetData);
|
||||||
default void sendPacket(UUID bedrockPlayer, byte[] packetData) {
|
|
||||||
sendPacket(bedrockPlayer, packetData, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
void sendPacket(FloodgatePlayer player, byte[] packetData, boolean encrypt);
|
|
||||||
|
|
||||||
default void sendPacket(FloodgatePlayer player, byte[] packetData) {
|
|
||||||
sendPacket(player, packetData, true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,12 +44,12 @@ public final class UnsafeFloodgateApi implements Unsafe {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendPacket(UUID bedrockPlayer, byte[] packetData, boolean encrypt) {
|
public void sendPacket(UUID bedrockPlayer, byte[] packetData) {
|
||||||
packetChannel.sendPacket(bedrockPlayer, packetData, encrypt, this);
|
packetChannel.sendPacket(bedrockPlayer, packetData, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendPacket(FloodgatePlayer player, byte[] packetData, boolean encrypt) {
|
public void sendPacket(FloodgatePlayer player, byte[] packetData) {
|
||||||
sendPacket(player.getCorrectUniqueId(), packetData, encrypt);
|
sendPacket(player.getCorrectUniqueId(), packetData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,15 +60,10 @@ public final class PacketChannel implements PluginMessageChannel {
|
|||||||
return Result.kick("Cannot send packets from Geyser/Floodgate to Floodgate");
|
return Result.kick("Cannot send packets from Geyser/Floodgate to Floodgate");
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean sendPacket(UUID player, byte[] packet, boolean encrypt, UnsafeFloodgateApi api) {
|
public boolean sendPacket(UUID player, byte[] packet, UnsafeFloodgateApi api) {
|
||||||
if (api == null) {
|
if (api == null) {
|
||||||
throw new IllegalArgumentException("Can only send a packet using the unsafe api");
|
throw new IllegalArgumentException("Can only send a packet using the unsafe api");
|
||||||
}
|
}
|
||||||
|
return pluginMessageUtils.sendMessage(player, getIdentifier(), packet);
|
||||||
byte[] finalData = new byte[packet.length + 1];
|
|
||||||
finalData[0] = (byte) (encrypt ? 1 : 0);
|
|
||||||
System.arraycopy(packet, 0, finalData, 1, packet.length);
|
|
||||||
|
|
||||||
return pluginMessageUtils.sendMessage(player, getIdentifier(), finalData);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user