Skip to content

Commit

Permalink
Deprecate all the API classes that will be removed in Floodgate 3.0
Browse files Browse the repository at this point in the history
See #536 for more information
  • Loading branch information
Tim203 committed Sep 1, 2024
1 parent 49bd564 commit e7e40f5
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 25 deletions.
33 changes: 30 additions & 3 deletions api/src/main/java/org/geysermc/floodgate/api/InstanceHolder.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ public final class InstanceHolder {
@Getter private static PlayerLink playerLink;
@Getter private static FloodgateEventBus eventBus;

@Getter private static PlatformInjector injector;
@Getter private static PacketHandlers packetHandlers;
@Getter private static HandshakeHandlers handshakeHandlers;
private static PlatformInjector injector;
private static PacketHandlers packetHandlers;
private static HandshakeHandlers handshakeHandlers;
private static UUID storedKey;

public static boolean set(
Expand Down Expand Up @@ -68,4 +68,31 @@ public static boolean set(
InstanceHolder.handshakeHandlers = handshakeHandlers;
return true;
}

/**
* @deprecated Injector addons will be removed with the launch of Floodgate 3.0. Please look at
* <a href="https://github.com/GeyserMC/Floodgate/issues/536">#536</a> for additional context.
*/
@Deprecated
public static PlatformInjector getInjector() {
return InstanceHolder.injector;
}

/**
* @deprecated Packet handlers will be removed with the launch of Floodgate 3.0. Please look at
* <a href="https://github.com/GeyserMC/Floodgate/issues/536">#536</a> for additional context.
*/
@Deprecated
public static PacketHandlers getPacketHandlers() {
return InstanceHolder.packetHandlers;
}

/**
* @deprecated Handshake handlers will be removed with the launch of Floodgate 3.0. Please look at
* <a href="https://github.com/GeyserMC/Floodgate/issues/536">#536</a> for additional context.
*/
@Deprecated
public static HandshakeHandlers getHandshakeHandlers() {
return InstanceHolder.handshakeHandlers;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,8 @@
import org.geysermc.floodgate.util.LinkedPlayer;

/**
* For advanced users only! You shouldn't play with this unless you know what you're doing.<br>
* <br>
* This class allows you change specific things of a Bedrock player before it is applied to the
* server. Note that at the time I'm writing this that the HandshakeData is created after requesting
* the player link. So the link is present here, if applicable.
* @deprecated Handshake handlers will be removed with the launch of Floodgate 3.0. Please look at
* <a href="https://github.com/GeyserMC/Floodgate/issues/536">#536</a> for additional context.
*/
@Deprecated
public interface HandshakeData {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,8 @@
package org.geysermc.floodgate.api.handshake;

/**
* This class allows you to change and/or get specific data of the Bedrock client before Floodgate
* does something with this data. This means that Floodgate decrypts the data, then calls the
* handshake handlers and then applies the data to the connection.<br>
* <br>
* /!\ Note that this class will be called for both Java and Bedrock connections, but {@link
* HandshakeData#isFloodgatePlayer()} will be false and Floodgate related methods will return null
* for Java players
* @deprecated Handshake handlers will be removed with the launch of Floodgate 3.0. Please look at
* <a href="https://github.com/GeyserMC/Floodgate/issues/536">#536</a> for additional context.
*/
@Deprecated
@FunctionalInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@
package org.geysermc.floodgate.api.handshake;

/**
* @deprecated This system has been deprecated and will not be available in the new API that will be
* introduced when Geyser will include Floodgate (and thus will have some common base API).
* <br>
* It might be replaced with an event (probably internal), but that isn't certain yet.
* @deprecated Handshake handlers will be removed with the launch of Floodgate 3.0. Please look at
* <a href="https://github.com/GeyserMC/Floodgate/issues/536">#536</a> for additional context.
*/
@Deprecated
public interface HandshakeHandlers {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@

import io.netty.channel.Channel;

/**
* @deprecated Injector addons will be removed with the launch of Floodgate 3.0. Please look at
* <a href="https://github.com/GeyserMC/Floodgate/issues/536">#536</a> for additional context.
*/
@Deprecated
public interface InjectorAddon {
/**
* Called when injecting a specific channel (every client that is connected to the server has
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,10 @@
package org.geysermc.floodgate.api.inject;

/**
* The global interface of all the Platform Injectors. The injector can be used for various things.
* It is used internally for getting Floodgate data out of the handshake packet and for debug mode,
* but there is also an option to add your own addons. Note that every Floodgate platform that
* supports netty should implement this, but the platform implementation isn't required to implement
* this.
* @deprecated Injector addons will be removed with the launch of Floodgate 3.0. Please look at
* <a href="https://github.com/GeyserMC/Floodgate/issues/536">#536</a> for additional context.
*/
@Deprecated
public interface PlatformInjector {
/**
* Injects the server connection. This will allow various addons (like getting the Floodgate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@
import io.netty.channel.ChannelHandlerContext;

/**
* For advanced users only! You shouldn't play with this unless you know what you're doing.
* @deprecated Packet handlers will be removed with the launch of Floodgate 3.0. Please look at
* <a href="https://github.com/GeyserMC/Floodgate/issues/536">#536</a> for additional context.
*/
@Deprecated
public interface PacketHandler {
/**
* Called when a registered packet has been seen.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
import io.netty.channel.ChannelHandlerContext;
import org.geysermc.floodgate.api.util.TriFunction;

/**
* @deprecated Packet handlers will be removed with the launch of Floodgate 3.0. Please look at
* <a href="https://github.com/GeyserMC/Floodgate/issues/536">#536</a> for additional context.
*/
@Deprecated
public interface PacketHandlers {
/**
* Register a specific class for a specific consumer.
Expand Down

0 comments on commit e7e40f5

Please sign in to comment.