Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-27 16:40:10 +01:00
Expose PacketTypesProvider in Protocol
Dieser Commit ist enthalten in:
Ursprung
a6e1cb6534
Commit
5cad29c754
@ -404,6 +404,11 @@ public abstract class AbstractProtocol<CU extends ClientboundPacketType, CM exte
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PacketTypesProvider<CU, CM, SM, SU> getPacketTypesProvider() {
|
||||||
|
return packetTypesProvider;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @Nullable <T> T get(Class<T> objectClass) {
|
public @Nullable <T> T get(Class<T> objectClass) {
|
||||||
//noinspection unchecked
|
//noinspection unchecked
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.viaversion.viaversion.api.protocol;
|
package com.viaversion.viaversion.api.protocol;
|
||||||
|
|
||||||
|
import com.google.common.annotations.Beta;
|
||||||
import com.viaversion.viaversion.api.connection.UserConnection;
|
import com.viaversion.viaversion.api.connection.UserConnection;
|
||||||
import com.viaversion.viaversion.api.data.MappingData;
|
import com.viaversion.viaversion.api.data.MappingData;
|
||||||
import com.viaversion.viaversion.api.platform.providers.ViaProviders;
|
import com.viaversion.viaversion.api.platform.providers.ViaProviders;
|
||||||
@ -30,6 +31,7 @@ import com.viaversion.viaversion.api.protocol.packet.Direction;
|
|||||||
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
|
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
|
||||||
import com.viaversion.viaversion.api.protocol.packet.ServerboundPacketType;
|
import com.viaversion.viaversion.api.protocol.packet.ServerboundPacketType;
|
||||||
import com.viaversion.viaversion.api.protocol.packet.State;
|
import com.viaversion.viaversion.api.protocol.packet.State;
|
||||||
|
import com.viaversion.viaversion.api.protocol.packet.provider.PacketTypesProvider;
|
||||||
import com.viaversion.viaversion.api.protocol.remapper.PacketHandler;
|
import com.viaversion.viaversion.api.protocol.remapper.PacketHandler;
|
||||||
import com.viaversion.viaversion.api.protocol.remapper.PacketRemapper;
|
import com.viaversion.viaversion.api.protocol.remapper.PacketRemapper;
|
||||||
import com.viaversion.viaversion.api.rewriter.EntityRewriter;
|
import com.viaversion.viaversion.api.rewriter.EntityRewriter;
|
||||||
@ -236,6 +238,15 @@ public interface Protocol<CU extends ClientboundPacketType, CM extends Clientbou
|
|||||||
*/
|
*/
|
||||||
void transform(Direction direction, State state, PacketWrapper packetWrapper) throws Exception;
|
void transform(Direction direction, State state, PacketWrapper packetWrapper) throws Exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a packet type provider for this protocol to get packet types by id.
|
||||||
|
* Depending on the Protocol, not every state may be populated.
|
||||||
|
*
|
||||||
|
* @return the packet types provider
|
||||||
|
*/
|
||||||
|
@Beta
|
||||||
|
PacketTypesProvider<CU, CM, SM, SU> getPacketTypesProvider();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a cached object by the given type if present.
|
* Returns a cached object by the given type if present.
|
||||||
*
|
*
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren