Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-11-04 15:20:09 +01:00
Bump version to try and fix deploying; other nitpicks
Dieser Commit ist enthalten in:
Ursprung
ea8f4b854b
Commit
b9541505af
4
Jenkinsfile
vendored
4
Jenkinsfile
vendored
@ -20,7 +20,7 @@ pipeline {
|
||||
}
|
||||
}
|
||||
|
||||
/*stage ('Deploy') {
|
||||
stage ('Deploy') {
|
||||
when {
|
||||
branch "master"
|
||||
}
|
||||
@ -48,7 +48,7 @@ pipeline {
|
||||
serverId: "opencollab-artifactory"
|
||||
)
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
|
@ -6,9 +6,9 @@
|
||||
<parent>
|
||||
<groupId>org.geysermc</groupId>
|
||||
<artifactId>geyser-parent</artifactId>
|
||||
<version>1.4.1-SNAPSHOT</version>
|
||||
<version>1.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ap</artifactId>
|
||||
<version>1.4.1-SNAPSHOT</version>
|
||||
<version>1.4.2-SNAPSHOT</version>
|
||||
</project>
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.geysermc</groupId>
|
||||
<artifactId>bootstrap-parent</artifactId>
|
||||
<version>1.4.1-SNAPSHOT</version>
|
||||
<version>1.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>bootstrap-bungeecord</artifactId>
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
<dependency>
|
||||
<groupId>org.geysermc</groupId>
|
||||
<artifactId>connector</artifactId>
|
||||
<version>1.4.1-SNAPSHOT</version>
|
||||
<version>1.4.2-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<!-- Used for better working with internals without reflection -->
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.geysermc</groupId>
|
||||
<artifactId>geyser-parent</artifactId>
|
||||
<version>1.4.1-SNAPSHOT</version>
|
||||
<version>1.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>bootstrap-parent</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
@ -34,7 +34,7 @@
|
||||
<dependency>
|
||||
<groupId>org.geysermc</groupId>
|
||||
<artifactId>ap</artifactId>
|
||||
<version>1.4.1-SNAPSHOT</version>
|
||||
<version>1.4.2-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.geysermc</groupId>
|
||||
<artifactId>bootstrap-parent</artifactId>
|
||||
<version>1.4.1-SNAPSHOT</version>
|
||||
<version>1.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>bootstrap-spigot</artifactId>
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
<dependency>
|
||||
<groupId>org.geysermc</groupId>
|
||||
<artifactId>connector</artifactId>
|
||||
<version>1.4.1-SNAPSHOT</version>
|
||||
<version>1.4.2-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.geysermc</groupId>
|
||||
<artifactId>bootstrap-parent</artifactId>
|
||||
<version>1.4.1-SNAPSHOT</version>
|
||||
<version>1.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>bootstrap-sponge</artifactId>
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
<dependency>
|
||||
<groupId>org.geysermc</groupId>
|
||||
<artifactId>connector</artifactId>
|
||||
<version>1.4.1-SNAPSHOT</version>
|
||||
<version>1.4.2-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.geysermc</groupId>
|
||||
<artifactId>bootstrap-parent</artifactId>
|
||||
<version>1.4.1-SNAPSHOT</version>
|
||||
<version>1.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>bootstrap-standalone</artifactId>
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
<dependency>
|
||||
<groupId>org.geysermc</groupId>
|
||||
<artifactId>connector</artifactId>
|
||||
<version>1.4.1-SNAPSHOT</version>
|
||||
<version>1.4.2-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.geysermc</groupId>
|
||||
<artifactId>bootstrap-parent</artifactId>
|
||||
<version>1.4.1-SNAPSHOT</version>
|
||||
<version>1.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>bootstrap-velocity</artifactId>
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
<dependency>
|
||||
<groupId>org.geysermc</groupId>
|
||||
<artifactId>connector</artifactId>
|
||||
<version>1.4.1-SNAPSHOT</version>
|
||||
<version>1.4.2-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.geysermc</groupId>
|
||||
<artifactId>geyser-parent</artifactId>
|
||||
<version>1.4.1-SNAPSHOT</version>
|
||||
<version>1.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>common</artifactId>
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.geysermc</groupId>
|
||||
<artifactId>geyser-parent</artifactId>
|
||||
<version>1.4.1-SNAPSHOT</version>
|
||||
<version>1.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>connector</artifactId>
|
||||
|
||||
@ -21,13 +21,13 @@
|
||||
<dependency>
|
||||
<groupId>org.geysermc</groupId>
|
||||
<artifactId>ap</artifactId>
|
||||
<version>1.4.1-SNAPSHOT</version>
|
||||
<version>1.4.2-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.geysermc</groupId>
|
||||
<artifactId>common</artifactId>
|
||||
<version>1.4.1-SNAPSHOT</version>
|
||||
<version>1.4.2-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<!-- Jackson JSON and YAML serialization -->
|
||||
@ -115,7 +115,7 @@
|
||||
<dependency>
|
||||
<groupId>com.github.CloudburstMC.Protocol</groupId>
|
||||
<artifactId>bedrock-v448</artifactId>
|
||||
<version>690a545d</version>
|
||||
<version>6ce2f6e</version>
|
||||
<scope>compile</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
|
@ -80,7 +80,7 @@ public class UpstreamPacketHandler extends LoggingPacketHandler {
|
||||
session.setBlockMappings(BlockRegistries.BLOCKS.forVersion(loginPacket.getProtocolVersion()));
|
||||
session.setItemMappings(Registries.ITEMS.forVersion(loginPacket.getProtocolVersion()));
|
||||
|
||||
LoginEncryptionUtils.encryptPlayerConnection(connector, session, loginPacket);
|
||||
LoginEncryptionUtils.encryptPlayerConnection(session, loginPacket);
|
||||
|
||||
PlayStatusPacket playStatus = new PlayStatusPacket();
|
||||
playStatus.setStatus(PlayStatusPacket.Status.LOGIN_SUCCESS);
|
||||
|
@ -29,6 +29,6 @@ import org.geysermc.connector.network.session.GeyserSession;
|
||||
|
||||
public abstract class PacketTranslator<T> {
|
||||
|
||||
public abstract void translate(T packet, GeyserSession session);
|
||||
public abstract void translate(GeyserSession session, T packet);
|
||||
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ public class PacketTranslatorRegistry<T> {
|
||||
}
|
||||
|
||||
try {
|
||||
translator.translate(packet, session);
|
||||
translator.translate(session, packet);
|
||||
} catch (Throwable ex) {
|
||||
GeyserConnector.getInstance().getLogger().error(LanguageUtils.getLocaleStringLog("geyser.network.translator.packet.failed", packet.getClass().getSimpleName()), ex);
|
||||
ex.printStackTrace();
|
||||
|
@ -38,7 +38,7 @@ import org.geysermc.connector.network.translators.Translator;
|
||||
public class BedrockAdventureSettingsTranslator extends PacketTranslator<AdventureSettingsPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(AdventureSettingsPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, AdventureSettingsPacket packet) {
|
||||
boolean isFlying = packet.getSettings().contains(AdventureSetting.FLYING);
|
||||
if (!isFlying && session.getGameMode() == GameMode.SPECTATOR) {
|
||||
// We should always be flying in spectator mode
|
||||
|
@ -39,7 +39,7 @@ import java.util.concurrent.TimeUnit;
|
||||
public class BedrockAnimateTranslator extends PacketTranslator<AnimatePacket> {
|
||||
|
||||
@Override
|
||||
public void translate(AnimatePacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, AnimatePacket packet) {
|
||||
// Stop the player sending animations before they have fully spawned into the server
|
||||
if (!session.isSpawned()) {
|
||||
return;
|
||||
|
@ -39,7 +39,7 @@ import org.geysermc.connector.utils.SignUtils;
|
||||
public class BedrockBlockEntityDataTranslator extends PacketTranslator<BlockEntityDataPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(BlockEntityDataPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, BlockEntityDataPacket packet) {
|
||||
NbtMap tag = packet.getData();
|
||||
if (tag.getString("id").equals("Sign")) {
|
||||
// This is the reason why this all works - Bedrock sends packets every time you update the sign, Java only wants the final packet
|
||||
|
@ -40,7 +40,7 @@ import org.geysermc.connector.utils.InventoryUtils;
|
||||
public class BedrockBlockPickRequestTranslator extends PacketTranslator<BlockPickRequestPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(BlockPickRequestPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, BlockPickRequestPacket packet) {
|
||||
Vector3i vector = packet.getBlockPosition();
|
||||
int blockToPick = session.getConnector().getWorldManager().getBlockAt(session, vector.getX(), vector.getY(), vector.getZ());
|
||||
|
||||
|
@ -49,7 +49,7 @@ public class BedrockBookEditTranslator extends PacketTranslator<BookEditPacket>
|
||||
private static final int MAXIMUM_TITLE_LENGTH = 128 * 4;
|
||||
|
||||
@Override
|
||||
public void translate(BookEditPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, BookEditPacket packet) {
|
||||
if (packet.getText() != null && !packet.getText().isEmpty() && packet.getText().getBytes(StandardCharsets.UTF_8).length > MAXIMUM_PAGE_LENGTH) {
|
||||
session.getConnector().getLogger().warning("Page length greater than server allowed!");
|
||||
return;
|
||||
|
@ -38,7 +38,7 @@ import org.geysermc.connector.network.translators.Translator;
|
||||
public class BedrockCommandBlockUpdateTranslator extends PacketTranslator<CommandBlockUpdatePacket> {
|
||||
|
||||
@Override
|
||||
public void translate(CommandBlockUpdatePacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, CommandBlockUpdatePacket packet) {
|
||||
String command = packet.getCommand();
|
||||
boolean outputTracked = packet.isOutputTracked();
|
||||
if (packet.isBlock()) {
|
||||
|
@ -40,7 +40,7 @@ import org.geysermc.connector.network.translators.chat.MessageTranslator;
|
||||
public class BedrockCommandRequestTranslator extends PacketTranslator<CommandRequestPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(CommandRequestPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, CommandRequestPacket packet) {
|
||||
String command = packet.getCommand().replace("/", "");
|
||||
CommandManager commandManager = GeyserConnector.getInstance().getCommandManager();
|
||||
if (session.getConnector().getPlatformType() == PlatformType.STANDALONE && command.trim().startsWith("geyser ") && commandManager.getCommands().containsKey(command.split(" ")[1])) {
|
||||
|
@ -38,7 +38,7 @@ import org.geysermc.connector.utils.InventoryUtils;
|
||||
public class BedrockContainerCloseTranslator extends PacketTranslator<ContainerClosePacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ContainerClosePacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ContainerClosePacket packet) {
|
||||
byte windowId = packet.getId();
|
||||
|
||||
//Client wants close confirmation
|
||||
|
@ -35,7 +35,7 @@ import org.geysermc.connector.network.translators.Translator;
|
||||
public class BedrockEmoteListTranslator extends PacketTranslator<EmoteListPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(EmoteListPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, EmoteListPacket packet) {
|
||||
if (session.getConnector().getConfig().getEmoteOffhandWorkaround() == EmoteOffhandWorkaroundOption.NO_EMOTES) {
|
||||
return;
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ import org.geysermc.connector.utils.InventoryUtils;
|
||||
public class BedrockEntityPickRequestTranslator extends PacketTranslator<EntityPickRequestPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(EntityPickRequestPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, EntityPickRequestPacket packet) {
|
||||
if (session.getGameMode() != GameMode.CREATIVE) return; // Apparently Java behavior
|
||||
Entity entity = session.getEntityCache().getEntityByGeyserId(packet.getRuntimeEntityId());
|
||||
if (entity == null) return;
|
||||
|
@ -41,7 +41,7 @@ import org.geysermc.connector.network.translators.Translator;
|
||||
public class BedrockFilterTextTranslator extends PacketTranslator<FilterTextPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(FilterTextPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, FilterTextPacket packet) {
|
||||
if (session.getOpenInventory() instanceof CartographyContainer) {
|
||||
// We don't want to be able to rename in the cartography table
|
||||
return;
|
||||
|
@ -70,7 +70,7 @@ public class BedrockInventoryTransactionTranslator extends PacketTranslator<Inve
|
||||
private static final float MAXIMUM_BLOCK_DESTROYING_DISTANCE = 36f;
|
||||
|
||||
@Override
|
||||
public void translate(InventoryTransactionPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, InventoryTransactionPacket packet) {
|
||||
// Send book updates before opening inventories
|
||||
session.getBookEditCache().checkForSend();
|
||||
|
||||
|
@ -44,7 +44,7 @@ import org.geysermc.connector.network.translators.Translator;
|
||||
public class BedrockItemFrameDropItemTranslator extends PacketTranslator<ItemFrameDropItemPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ItemFrameDropItemPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ItemFrameDropItemPacket packet) {
|
||||
Entity entity = ItemFrameEntity.getItemFrameEntity(session, packet.getBlockPosition());
|
||||
if (entity != null) {
|
||||
ClientPlayerInteractEntityPacket interactPacket = new ClientPlayerInteractEntityPacket((int) entity.getEntityId(),
|
||||
|
@ -39,7 +39,7 @@ import org.geysermc.connector.network.translators.inventory.InventoryTranslator;
|
||||
public class BedrockItemStackRequestTranslator extends PacketTranslator<ItemStackRequestPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ItemStackRequestPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ItemStackRequestPacket packet) {
|
||||
Inventory inventory = session.getOpenInventory();
|
||||
if (inventory == null)
|
||||
return;
|
||||
|
@ -45,7 +45,7 @@ import org.geysermc.connector.utils.InventoryUtils;
|
||||
public class BedrockLecternUpdateTranslator extends PacketTranslator<LecternUpdatePacket> {
|
||||
|
||||
@Override
|
||||
public void translate(LecternUpdatePacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, LecternUpdatePacket packet) {
|
||||
if (packet.isDroppingBook()) {
|
||||
// Bedrock drops the book outside of the GUI. Java drops it in the GUI
|
||||
// So, we enter the GUI and then drop it! :)
|
||||
|
@ -38,7 +38,7 @@ import java.util.concurrent.TimeUnit;
|
||||
public class BedrockMapInfoRequestTranslator extends PacketTranslator<MapInfoRequestPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(MapInfoRequestPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, MapInfoRequestPacket packet) {
|
||||
long mapId = packet.getUniqueMapId();
|
||||
|
||||
ClientboundMapItemDataPacket mapPacket = session.getStoredMaps().remove(mapId);
|
||||
|
@ -42,7 +42,7 @@ import java.util.concurrent.TimeUnit;
|
||||
public class BedrockMobEquipmentTranslator extends PacketTranslator<MobEquipmentPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(MobEquipmentPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, MobEquipmentPacket packet) {
|
||||
if (!session.isSpawned() || packet.getHotbarSlot() > 8 ||
|
||||
packet.getContainerId() != ContainerId.INVENTORY || session.getPlayerInventory().getHeldItemSlot() == packet.getHotbarSlot()) {
|
||||
// For the last condition - Don't update the slot if the slot is the same - not Java Edition behavior and messes with plugins such as Grief Prevention
|
||||
|
@ -40,7 +40,7 @@ import org.geysermc.connector.network.translators.Translator;
|
||||
public class BedrockMoveEntityAbsoluteTranslator extends PacketTranslator<MoveEntityAbsolutePacket> {
|
||||
|
||||
@Override
|
||||
public void translate(MoveEntityAbsolutePacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, MoveEntityAbsolutePacket packet) {
|
||||
session.setLastVehicleMoveTimestamp(System.currentTimeMillis());
|
||||
|
||||
float y = packet.getPosition().getY();
|
||||
|
@ -45,7 +45,7 @@ import java.util.concurrent.TimeUnit;
|
||||
public class BedrockNetworkStackLatencyTranslator extends PacketTranslator<NetworkStackLatencyPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(NetworkStackLatencyPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, NetworkStackLatencyPacket packet) {
|
||||
long pingId;
|
||||
// so apparently, as of 1.16.200
|
||||
// PS4 divides the network stack latency timestamp FOR US!!!
|
||||
|
@ -34,7 +34,7 @@ import org.geysermc.connector.network.translators.Translator;
|
||||
public class BedrockPacketViolationWarningTranslator extends PacketTranslator<PacketViolationWarningPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(PacketViolationWarningPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, PacketViolationWarningPacket packet) {
|
||||
// Not translated since this is something that the developers need to know
|
||||
session.getConnector().getLogger().error("Packet violation warning sent from client! " + packet.toString());
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ import org.geysermc.connector.network.translators.Translator;
|
||||
public class BedrockPlayerInputTranslator extends PacketTranslator<PlayerInputPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(PlayerInputPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, PlayerInputPacket packet) {
|
||||
ClientSteerVehiclePacket clientSteerVehiclePacket = new ClientSteerVehiclePacket(
|
||||
packet.getInputMotion().getX(), packet.getInputMotion().getY(), packet.isJumping(), packet.isSneaking()
|
||||
);
|
||||
|
@ -42,7 +42,7 @@ import org.geysermc.connector.utils.LoadstoneTracker;
|
||||
public class BedrockPositionTrackingDBClientRequestTranslator extends PacketTranslator<PositionTrackingDBClientRequestPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(PositionTrackingDBClientRequestPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, PositionTrackingDBClientRequestPacket packet) {
|
||||
PositionTrackingDBServerBroadcastPacket broadcastPacket = new PositionTrackingDBServerBroadcastPacket();
|
||||
broadcastPacket.setTrackingId(packet.getTrackingId());
|
||||
|
||||
|
@ -40,7 +40,7 @@ import org.geysermc.connector.network.translators.Translator;
|
||||
public class BedrockRespawnTranslator extends PacketTranslator<RespawnPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(RespawnPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, RespawnPacket packet) {
|
||||
if (packet.getState() == RespawnPacket.State.CLIENT_READY) {
|
||||
// Previously we only sent the respawn packet before the server finished loading
|
||||
// The message included was 'Otherwise when immediate respawn is on the client never loads'
|
||||
|
@ -38,7 +38,7 @@ import java.util.concurrent.TimeUnit;
|
||||
@Translator(packet = ServerSettingsRequestPacket.class)
|
||||
public class BedrockServerSettingsRequestTranslator extends PacketTranslator<ServerSettingsRequestPacket> {
|
||||
@Override
|
||||
public void translate(ServerSettingsRequestPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerSettingsRequestPacket packet) {
|
||||
CustomForm window = SettingsUtils.buildForm(session);
|
||||
int windowId = session.getFormCache().addForm(window);
|
||||
|
||||
|
@ -37,7 +37,7 @@ import org.geysermc.connector.skin.SkullSkinManager;
|
||||
@Translator(packet = SetLocalPlayerAsInitializedPacket.class)
|
||||
public class BedrockSetLocalPlayerAsInitializedTranslator extends PacketTranslator<SetLocalPlayerAsInitializedPacket> {
|
||||
@Override
|
||||
public void translate(SetLocalPlayerAsInitializedPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, SetLocalPlayerAsInitializedPacket packet) {
|
||||
if (session.getPlayerEntity().getGeyserId() == packet.getRuntimeEntityId()) {
|
||||
if (!session.getUpstream().isInitialized()) {
|
||||
session.getUpstream().setInitialized(true);
|
||||
|
@ -37,7 +37,7 @@ import com.nukkitx.protocol.bedrock.packet.ShowCreditsPacket;
|
||||
public class BedrockShowCreditsTranslator extends PacketTranslator<ShowCreditsPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ShowCreditsPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ShowCreditsPacket packet) {
|
||||
if (packet.getStatus() == ShowCreditsPacket.Status.END_CREDITS) {
|
||||
ClientRequestPacket javaRespawnPacket = new ClientRequestPacket(ClientRequest.RESPAWN);
|
||||
session.sendDownstreamPacket(javaRespawnPacket);
|
||||
|
@ -37,7 +37,7 @@ import org.geysermc.connector.network.translators.chat.MessageTranslator;
|
||||
public class BedrockTextTranslator extends PacketTranslator<TextPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(TextPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, TextPacket packet) {
|
||||
String message = packet.getMessage();
|
||||
|
||||
if (MessageTranslator.isTooLong(message, session)) {
|
||||
|
@ -43,7 +43,7 @@ import java.util.concurrent.TimeUnit;
|
||||
public class BedrockEntityEventTranslator extends PacketTranslator<EntityEventPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(EntityEventPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, EntityEventPacket packet) {
|
||||
switch (packet.getType()) {
|
||||
case EATING_ITEM:
|
||||
// Resend the packet so we get the eating sounds
|
||||
|
@ -54,7 +54,7 @@ import java.util.ArrayList;
|
||||
public class BedrockActionTranslator extends PacketTranslator<PlayerActionPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(PlayerActionPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, PlayerActionPacket packet) {
|
||||
SessionPlayerEntity entity = session.getPlayerEntity();
|
||||
|
||||
// Send book update before any player action
|
||||
|
@ -40,7 +40,7 @@ import org.geysermc.connector.utils.BlockUtils;
|
||||
public class BedrockEmoteTranslator extends PacketTranslator<EmotePacket> {
|
||||
|
||||
@Override
|
||||
public void translate(EmotePacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, EmotePacket packet) {
|
||||
if (session.getConnector().getConfig().getEmoteOffhandWorkaround() != EmoteOffhandWorkaroundOption.DISABLED) {
|
||||
// Activate the workaround - we should trigger the offhand now
|
||||
ClientPlayerActionPacket swapHandsPacket = new ClientPlayerActionPacket(PlayerAction.SWAP_HANDS, BlockUtils.POSITION_ZERO,
|
||||
|
@ -46,7 +46,7 @@ import org.geysermc.connector.utils.InteractiveTagManager;
|
||||
public class BedrockInteractTranslator extends PacketTranslator<InteractPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(InteractPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, InteractPacket packet) {
|
||||
Entity entity;
|
||||
if (packet.getRuntimeEntityId() == session.getPlayerEntity().getGeyserId()) {
|
||||
//Player is not in entity cache
|
||||
|
@ -53,7 +53,7 @@ public class BedrockMovePlayerTranslator extends PacketTranslator<MovePlayerPack
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translate(MovePlayerPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, MovePlayerPacket packet) {
|
||||
SessionPlayerEntity entity = session.getPlayerEntity();
|
||||
if (!session.isSpawned()) return;
|
||||
|
||||
|
@ -37,7 +37,7 @@ import org.geysermc.connector.network.translators.Translator;
|
||||
@Translator(packet = RiderJumpPacket.class)
|
||||
public class BedrockRiderJumpTranslator extends PacketTranslator<RiderJumpPacket> {
|
||||
@Override
|
||||
public void translate(RiderJumpPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, RiderJumpPacket packet) {
|
||||
Entity vehicle = session.getRidingVehicleEntity();
|
||||
if (vehicle instanceof AbstractHorseEntity) {
|
||||
ClientPlayerStatePacket playerStatePacket = new ClientPlayerStatePacket((int) vehicle.getEntityId(), PlayerState.START_HORSE_JUMP, packet.getJumpStrength());
|
||||
|
@ -38,7 +38,7 @@ import org.geysermc.connector.network.translators.Translator;
|
||||
public class BedrockSetPlayerGameTypeTranslator extends PacketTranslator<SetPlayerGameTypePacket> {
|
||||
|
||||
@Override
|
||||
public void translate(SetPlayerGameTypePacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, SetPlayerGameTypePacket packet) {
|
||||
// no
|
||||
SetPlayerGameTypePacket playerGameTypePacket = new SetPlayerGameTypePacket();
|
||||
playerGameTypePacket.setGamemode(session.getGameMode().ordinal());
|
||||
|
@ -36,7 +36,7 @@ import org.geysermc.connector.utils.CooldownUtils;
|
||||
public class BedrockLevelSoundEventTranslator extends PacketTranslator<LevelSoundEventPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(LevelSoundEventPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, LevelSoundEventPacket packet) {
|
||||
// lol what even :thinking:
|
||||
session.sendUpstreamPacket(packet);
|
||||
|
||||
|
@ -37,7 +37,7 @@ import org.geysermc.connector.network.translators.Translator;
|
||||
@Translator(packet = ServerAdvancementTabPacket.class)
|
||||
public class JavaAdvancementsTabTranslator extends PacketTranslator<ServerAdvancementTabPacket> {
|
||||
@Override
|
||||
public void translate(ServerAdvancementTabPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerAdvancementTabPacket packet) {
|
||||
AdvancementsCache advancementsCache = session.getAdvancementsCache();
|
||||
advancementsCache.setCurrentAdvancementCategoryId(packet.getTabId());
|
||||
advancementsCache.buildAndShowListForm();
|
||||
|
@ -42,7 +42,7 @@ import java.util.Map;
|
||||
public class JavaAdvancementsTranslator extends PacketTranslator<ServerAdvancementsPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ServerAdvancementsPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerAdvancementsPacket packet) {
|
||||
AdvancementsCache advancementsCache = session.getAdvancementsCache();
|
||||
if (packet.isReset()) {
|
||||
advancementsCache.getStoredAdvancements().clear();
|
||||
|
@ -35,7 +35,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.server.ServerBossBarPacke
|
||||
@Translator(packet = ServerBossBarPacket.class)
|
||||
public class JavaBossBarTranslator extends PacketTranslator<ServerBossBarPacket> {
|
||||
@Override
|
||||
public void translate(ServerBossBarPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerBossBarPacket packet) {
|
||||
BossBar bossBar = session.getEntityCache().getBossBar(packet.getUuid());
|
||||
switch (packet.getAction()) {
|
||||
case ADD:
|
||||
|
@ -36,7 +36,7 @@ import org.geysermc.connector.network.translators.chat.MessageTranslator;
|
||||
public class JavaChatTranslator extends PacketTranslator<ServerChatPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ServerChatPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerChatPacket packet) {
|
||||
TextPacket textPacket = new TextPacket();
|
||||
textPacket.setPlatformChatId("");
|
||||
textPacket.setSourceName("");
|
||||
|
@ -96,7 +96,7 @@ public class JavaDeclareCommandsTranslator extends PacketTranslator<ServerDeclar
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translate(ServerDeclareCommandsPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerDeclareCommandsPacket packet) {
|
||||
// Don't send command suggestions if they are disabled
|
||||
if (!session.getConnector().getConfig().isCommandSuggestions()) {
|
||||
session.getConnector().getLogger().debug("Not sending translated command suggestions as they are disabled.");
|
||||
|
@ -71,7 +71,7 @@ public class JavaDeclareRecipesTranslator extends PacketTranslator<ServerDeclare
|
||||
);
|
||||
|
||||
@Override
|
||||
public void translate(ServerDeclareRecipesPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerDeclareRecipesPacket packet) {
|
||||
Map<RecipeType, List<CraftingData>> recipeTypes = Registries.CRAFTING_DATA.forVersion(session.getUpstream().getProtocolVersion());
|
||||
// Get the last known network ID (first used for the pregenerated recipes) and increment from there.
|
||||
int netId = InventoryUtils.LAST_RECIPE_NET_ID + 1;
|
||||
|
@ -34,7 +34,7 @@ import org.geysermc.connector.network.translators.Translator;
|
||||
public class JavaDeclareTagsTranslator extends PacketTranslator<ServerDeclareTagsPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ServerDeclareTagsPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerDeclareTagsPacket packet) {
|
||||
session.getTagCache().loadPacket(packet);
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ import com.nukkitx.protocol.bedrock.packet.SetDifficultyPacket;
|
||||
public class JavaDifficultyTranslator extends PacketTranslator<ServerDifficultyPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ServerDifficultyPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerDifficultyPacket packet) {
|
||||
SetDifficultyPacket setDifficultyPacket = new SetDifficultyPacket();
|
||||
setDifficultyPacket.setDifficulty(packet.getDifficulty().ordinal());
|
||||
session.sendUpstreamPacket(setDifficultyPacket);
|
||||
|
@ -35,7 +35,7 @@ import org.geysermc.connector.network.translators.chat.MessageTranslator;
|
||||
public class JavaDisconnectPacket extends PacketTranslator<ServerDisconnectPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ServerDisconnectPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerDisconnectPacket packet) {
|
||||
session.disconnect(MessageTranslator.convertMessage(packet.getReason(), session.getLocale()));
|
||||
}
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ public class JavaJoinGameTranslator extends PacketTranslator<ServerJoinGamePacke
|
||||
private static final List<SkinPart> SKIN_PART_VALUES = Arrays.asList(SkinPart.values());
|
||||
|
||||
@Override
|
||||
public void translate(ServerJoinGamePacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerJoinGamePacket packet) {
|
||||
PlayerEntity entity = session.getPlayerEntity();
|
||||
entity.setEntityId(packet.getEntityId());
|
||||
|
||||
|
@ -38,7 +38,7 @@ import org.geysermc.connector.network.translators.Translator;
|
||||
public class JavaKeepAliveTranslator extends PacketTranslator<ServerKeepAlivePacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ServerKeepAlivePacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerKeepAlivePacket packet) {
|
||||
if (!session.getConnector().getConfig().isForwardPlayerPing()) {
|
||||
return;
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ import org.geysermc.connector.network.translators.chat.MessageTranslator;
|
||||
public class JavaLoginDisconnectTranslator extends PacketTranslator<LoginDisconnectPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(LoginDisconnectPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, LoginDisconnectPacket packet) {
|
||||
// The client doesn't manually get disconnected so we have to do it ourselves
|
||||
session.disconnect(MessageTranslator.convertMessage(packet.getReason(), session.getLocale()));
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ import com.github.steveice10.mc.protocol.packet.login.server.LoginPluginRequestP
|
||||
@Translator(packet = LoginPluginRequestPacket.class)
|
||||
public class JavaLoginPluginRequestTranslator extends PacketTranslator<LoginPluginRequestPacket> {
|
||||
@Override
|
||||
public void translate(LoginPluginRequestPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, LoginPluginRequestPacket packet) {
|
||||
// A vanilla client doesn't know any PluginMessage in the Login state, so we don't know any either.
|
||||
// Note: Fabric Networking API v1 will not let the client log in without sending this
|
||||
session.sendDownstreamPacket(
|
||||
|
@ -38,7 +38,7 @@ import org.geysermc.connector.skin.SkinManager;
|
||||
public class JavaLoginSuccessTranslator extends PacketTranslator<LoginSuccessPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(LoginSuccessPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, LoginSuccessPacket packet) {
|
||||
PlayerEntity playerEntity = session.getPlayerEntity();
|
||||
AuthType remoteAuthType = session.getRemoteAuthType();
|
||||
|
||||
|
@ -36,7 +36,7 @@ import org.geysermc.connector.network.translators.Translator;
|
||||
public class JavaPingPacket extends PacketTranslator<ServerPingPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ServerPingPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerPingPacket packet) {
|
||||
session.sendDownstreamPacket(new ClientPongPacket(packet.getId()));
|
||||
}
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ import java.nio.charset.StandardCharsets;
|
||||
@Translator(packet = ServerPluginMessagePacket.class)
|
||||
public class JavaPluginMessageTranslator extends PacketTranslator<ServerPluginMessagePacket> {
|
||||
@Override
|
||||
public void translate(ServerPluginMessagePacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerPluginMessagePacket packet) {
|
||||
// The only plugin messages it has to listen for are Floodgate plugin messages
|
||||
if (session.getRemoteAuthType() != AuthType.FLOODGATE) {
|
||||
return;
|
||||
|
@ -43,7 +43,7 @@ import org.geysermc.connector.utils.DimensionUtils;
|
||||
public class JavaRespawnTranslator extends PacketTranslator<ServerRespawnPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ServerRespawnPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerRespawnPacket packet) {
|
||||
SessionPlayerEntity entity = session.getPlayerEntity();
|
||||
|
||||
entity.setHealth(entity.getMaxHealth());
|
||||
|
@ -35,7 +35,7 @@ import org.geysermc.connector.utils.StatisticsUtils;
|
||||
public class JavaStatisticsTranslator extends PacketTranslator<ServerStatisticsPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ServerStatisticsPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerStatisticsPacket packet) {
|
||||
session.updateStatistics(packet.getStatistics());
|
||||
|
||||
if (session.isWaitingForStatistics()) {
|
||||
|
@ -40,7 +40,7 @@ import java.util.Arrays;
|
||||
public class JavaUnlockRecipesTranslator extends PacketTranslator<ServerUnlockRecipesPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ServerUnlockRecipesPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerUnlockRecipesPacket packet) {
|
||||
if (packet.getAction() == UnlockRecipesAction.REMOVE) {
|
||||
session.getUnlockedRecipes().removeAll(Arrays.asList(packet.getRecipes()));
|
||||
} else {
|
||||
|
@ -40,7 +40,7 @@ import org.geysermc.connector.utils.DimensionUtils;
|
||||
public class JavaEntityAnimationTranslator extends PacketTranslator<ServerEntityAnimationPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ServerEntityAnimationPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerEntityAnimationPacket packet) {
|
||||
Entity entity;
|
||||
if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) {
|
||||
entity = session.getPlayerEntity();
|
||||
|
@ -42,7 +42,7 @@ import org.geysermc.connector.network.translators.Translator;
|
||||
public class JavaEntityAttachTranslator extends PacketTranslator<ServerEntityAttachPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ServerEntityAttachPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerEntityAttachPacket packet) {
|
||||
|
||||
Entity holderId;
|
||||
if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) {
|
||||
|
@ -44,7 +44,7 @@ import org.geysermc.connector.network.translators.Translator;
|
||||
public class JavaEntityCollectItemTranslator extends PacketTranslator<ServerEntityCollectItemPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ServerEntityCollectItemPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerEntityCollectItemPacket packet) {
|
||||
// Collected entity is the other entity
|
||||
Entity collectedEntity = session.getEntityCache().getEntityByJavaId(packet.getCollectedEntityId());
|
||||
if (collectedEntity == null) return;
|
||||
|
@ -37,7 +37,7 @@ import org.geysermc.connector.utils.EntityUtils;
|
||||
public class JavaEntityEffectTranslator extends PacketTranslator<ServerEntityEffectPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ServerEntityEffectPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerEntityEffectPacket packet) {
|
||||
Entity entity;
|
||||
if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) {
|
||||
entity = session.getPlayerEntity();
|
||||
|
@ -39,7 +39,7 @@ import org.geysermc.connector.network.translators.item.ItemTranslator;
|
||||
public class JavaEntityEquipmentTranslator extends PacketTranslator<ServerEntityEquipmentPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ServerEntityEquipmentPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerEntityEquipmentPacket packet) {
|
||||
Entity entity;
|
||||
if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) {
|
||||
entity = session.getPlayerEntity();
|
||||
|
@ -35,7 +35,7 @@ import org.geysermc.connector.network.translators.Translator;
|
||||
public class JavaEntityHeadLookTranslator extends PacketTranslator<ServerEntityHeadLookPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ServerEntityHeadLookPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerEntityHeadLookPacket packet) {
|
||||
Entity entity = session.getEntityCache().getEntityByJavaId(packet.getEntityId());
|
||||
if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) {
|
||||
entity = session.getPlayerEntity();
|
||||
|
@ -39,7 +39,7 @@ import org.geysermc.connector.utils.LanguageUtils;
|
||||
public class JavaEntityMetadataTranslator extends PacketTranslator<ServerEntityMetadataPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ServerEntityMetadataPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerEntityMetadataPacket packet) {
|
||||
Entity entity;
|
||||
if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) {
|
||||
entity = session.getPlayerEntity();
|
||||
|
@ -35,7 +35,7 @@ import org.geysermc.connector.network.translators.Translator;
|
||||
public class JavaEntityPositionRotationTranslator extends PacketTranslator<ServerEntityPositionRotationPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ServerEntityPositionRotationPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerEntityPositionRotationPacket packet) {
|
||||
Entity entity = session.getEntityCache().getEntityByJavaId(packet.getEntityId());
|
||||
if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) {
|
||||
entity = session.getPlayerEntity();
|
||||
|
@ -35,7 +35,7 @@ import org.geysermc.connector.network.translators.Translator;
|
||||
public class JavaEntityPositionTranslator extends PacketTranslator<ServerEntityPositionPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ServerEntityPositionPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerEntityPositionPacket packet) {
|
||||
Entity entity = session.getEntityCache().getEntityByJavaId(packet.getEntityId());
|
||||
if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) {
|
||||
entity = session.getPlayerEntity();
|
||||
|
@ -36,7 +36,7 @@ import org.geysermc.connector.network.translators.Translator;
|
||||
public class JavaEntityPropertiesTranslator extends PacketTranslator<ServerEntityPropertiesPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ServerEntityPropertiesPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerEntityPropertiesPacket packet) {
|
||||
Entity entity;
|
||||
if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) {
|
||||
entity = session.getPlayerEntity();
|
||||
|
@ -37,7 +37,7 @@ import org.geysermc.connector.utils.EntityUtils;
|
||||
public class JavaEntityRemoveEffectTranslator extends PacketTranslator<ServerEntityRemoveEffectPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ServerEntityRemoveEffectPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerEntityRemoveEffectPacket packet) {
|
||||
Entity entity;
|
||||
if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) {
|
||||
entity = session.getPlayerEntity();
|
||||
|
@ -35,7 +35,7 @@ import org.geysermc.connector.network.translators.Translator;
|
||||
public class JavaEntityRotationTranslator extends PacketTranslator<ServerEntityRotationPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ServerEntityRotationPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerEntityRotationPacket packet) {
|
||||
Entity entity = session.getEntityCache().getEntityByJavaId(packet.getEntityId());
|
||||
if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) {
|
||||
entity = session.getPlayerEntity();
|
||||
|
@ -43,7 +43,7 @@ import java.util.Arrays;
|
||||
public class JavaEntitySetPassengersTranslator extends PacketTranslator<ServerEntitySetPassengersPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ServerEntitySetPassengersPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerEntitySetPassengersPacket packet) {
|
||||
Entity entity;
|
||||
if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) {
|
||||
entity = session.getPlayerEntity();
|
||||
|
@ -43,7 +43,7 @@ import org.geysermc.connector.network.translators.Translator;
|
||||
public class JavaEntityStatusTranslator extends PacketTranslator<ServerEntityStatusPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ServerEntityStatusPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerEntityStatusPacket packet) {
|
||||
Entity entity;
|
||||
if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) {
|
||||
entity = session.getPlayerEntity();
|
||||
|
@ -37,7 +37,7 @@ import com.nukkitx.math.vector.Vector3f;
|
||||
public class JavaEntityTeleportTranslator extends PacketTranslator<ServerEntityTeleportPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ServerEntityTeleportPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerEntityTeleportPacket packet) {
|
||||
Entity entity = session.getEntityCache().getEntityByJavaId(packet.getEntityId());
|
||||
if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) {
|
||||
entity = session.getPlayerEntity();
|
||||
|
@ -40,7 +40,7 @@ import com.nukkitx.protocol.bedrock.packet.SetEntityMotionPacket;
|
||||
public class JavaEntityVelocityTranslator extends PacketTranslator<ServerEntityVelocityPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ServerEntityVelocityPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerEntityVelocityPacket packet) {
|
||||
Entity entity = session.getEntityCache().getEntityByJavaId(packet.getEntityId());
|
||||
if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) {
|
||||
entity = session.getPlayerEntity();
|
||||
|
@ -35,7 +35,7 @@ import org.geysermc.connector.network.translators.Translator;
|
||||
public class JavaRemoveEntitiesTranslator extends PacketTranslator<ServerRemoveEntitiesPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ServerRemoveEntitiesPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerRemoveEntitiesPacket packet) {
|
||||
for (int entityId : packet.getEntityIds()) {
|
||||
Entity entity = session.getEntityCache().getEntityByJavaId(entityId);
|
||||
if (entity != null) {
|
||||
|
@ -34,7 +34,7 @@ import org.geysermc.connector.network.translators.Translator;
|
||||
public class JavaPlayerAbilitiesTranslator extends PacketTranslator<ServerPlayerAbilitiesPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ServerPlayerAbilitiesPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerPlayerAbilitiesPacket packet) {
|
||||
session.setCanFly(packet.isCanFly());
|
||||
session.setFlying(packet.isFlying());
|
||||
session.sendAdventureSettings();
|
||||
|
@ -40,7 +40,7 @@ import org.geysermc.connector.utils.ChunkUtils;
|
||||
public class JavaPlayerActionAckTranslator extends PacketTranslator<ServerPlayerActionAckPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ServerPlayerActionAckPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerPlayerActionAckPacket packet) {
|
||||
ChunkUtils.updateBlock(session, packet.getNewState(), packet.getPosition());
|
||||
if (packet.getAction() == PlayerAction.START_DIGGING && !packet.isSuccessful()) {
|
||||
LevelEventPacket stopBreak = new LevelEventPacket();
|
||||
|
@ -35,7 +35,7 @@ import org.geysermc.connector.network.translators.Translator;
|
||||
public class JavaPlayerChangeHeldItemTranslator extends PacketTranslator<ServerPlayerChangeHeldItemPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ServerPlayerChangeHeldItemPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerPlayerChangeHeldItemPacket packet) {
|
||||
PlayerHotbarPacket hotbarPacket = new PlayerHotbarPacket();
|
||||
hotbarPacket.setContainerId(0);
|
||||
hotbarPacket.setSelectedHotbarSlot(packet.getSlot());
|
||||
|
@ -41,7 +41,7 @@ import java.util.List;
|
||||
public class JavaPlayerHealthTranslator extends PacketTranslator<ServerPlayerHealthPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ServerPlayerHealthPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerPlayerHealthPacket packet) {
|
||||
SessionPlayerEntity entity = session.getPlayerEntity();
|
||||
|
||||
int health = (int) Math.ceil(packet.getHealth());
|
||||
|
@ -40,7 +40,7 @@ import org.geysermc.connector.skin.SkinManager;
|
||||
@Translator(packet = ServerPlayerListEntryPacket.class)
|
||||
public class JavaPlayerListEntryTranslator extends PacketTranslator<ServerPlayerListEntryPacket> {
|
||||
@Override
|
||||
public void translate(ServerPlayerListEntryPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerPlayerListEntryPacket packet) {
|
||||
if (packet.getAction() != PlayerListEntryAction.ADD_PLAYER && packet.getAction() != PlayerListEntryAction.REMOVE_PLAYER)
|
||||
return;
|
||||
|
||||
|
@ -50,7 +50,7 @@ import org.geysermc.connector.utils.LanguageUtils;
|
||||
public class JavaPlayerPositionRotationTranslator extends PacketTranslator<ServerPlayerPositionRotationPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ServerPlayerPositionRotationPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerPlayerPositionRotationPacket packet) {
|
||||
if (!session.isLoggedIn())
|
||||
return;
|
||||
|
||||
|
@ -40,7 +40,7 @@ import java.util.Arrays;
|
||||
public class JavaPlayerSetExperienceTranslator extends PacketTranslator<ServerPlayerSetExperiencePacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ServerPlayerSetExperiencePacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerPlayerSetExperiencePacket packet) {
|
||||
SessionPlayerEntity entity = session.getPlayerEntity();
|
||||
|
||||
AttributeData experience = GeyserAttributeType.EXPERIENCE.getAttribute(packet.getExperience());
|
||||
|
@ -46,7 +46,7 @@ import java.lang.reflect.InvocationTargetException;
|
||||
public class JavaSpawnEntityTranslator extends PacketTranslator<ServerSpawnEntityPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ServerSpawnEntityPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerSpawnEntityPacket packet) {
|
||||
|
||||
Vector3f position = Vector3f.from(packet.getX(), packet.getY(), packet.getZ());
|
||||
Vector3f motion = Vector3f.from(packet.getMotionX(), packet.getMotionY(), packet.getMotionZ());
|
||||
|
@ -39,7 +39,7 @@ import com.nukkitx.math.vector.Vector3f;
|
||||
public class JavaSpawnExpOrbTranslator extends PacketTranslator<ServerSpawnExpOrbPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ServerSpawnExpOrbPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerSpawnExpOrbPacket packet) {
|
||||
Vector3f position = Vector3f.from(packet.getX(), packet.getY(), packet.getZ());
|
||||
|
||||
Entity entity = new ExpOrbEntity(
|
||||
|
@ -42,7 +42,7 @@ import java.lang.reflect.InvocationTargetException;
|
||||
public class JavaSpawnLivingEntityTranslator extends PacketTranslator<ServerSpawnLivingEntityPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ServerSpawnLivingEntityPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerSpawnLivingEntityPacket packet) {
|
||||
Vector3f position = Vector3f.from(packet.getX(), packet.getY(), packet.getZ());
|
||||
Vector3f motion = Vector3f.from(packet.getMotionX(), packet.getMotionY(), packet.getMotionZ());
|
||||
Vector3f rotation = Vector3f.from(packet.getYaw(), packet.getPitch(), packet.getHeadYaw());
|
||||
|
@ -37,7 +37,7 @@ import org.geysermc.connector.utils.PaintingType;
|
||||
public class JavaSpawnPaintingTranslator extends PacketTranslator<ServerSpawnPaintingPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ServerSpawnPaintingPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerSpawnPaintingPacket packet) {
|
||||
Vector3f position = Vector3f.from(packet.getPosition().getX(), packet.getPosition().getY(), packet.getPosition().getZ());
|
||||
|
||||
PaintingEntity entity = new PaintingEntity(packet.getEntityId(),
|
||||
|
@ -39,7 +39,7 @@ import org.geysermc.connector.skin.SkinManager;
|
||||
public class JavaSpawnPlayerTranslator extends PacketTranslator<ServerSpawnPlayerPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ServerSpawnPlayerPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerSpawnPlayerPacket packet) {
|
||||
Vector3f position = Vector3f.from(packet.getX(), packet.getY(), packet.getZ());
|
||||
Vector3f rotation = Vector3f.from(packet.getYaw(), packet.getPitch(), packet.getYaw());
|
||||
|
||||
|
@ -35,7 +35,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.server.scoreboard.ServerD
|
||||
public class JavaDisplayScoreboardTranslator extends PacketTranslator<ServerDisplayScoreboardPacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ServerDisplayScoreboardPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerDisplayScoreboardPacket packet) {
|
||||
session.getWorldCache().getScoreboard()
|
||||
.displayObjective(packet.getName(), packet.getPosition());
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.server.scoreboard.ServerS
|
||||
public class JavaScoreboardObjectiveTranslator extends PacketTranslator<ServerScoreboardObjectivePacket> {
|
||||
|
||||
@Override
|
||||
public void translate(ServerScoreboardObjectivePacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerScoreboardObjectivePacket packet) {
|
||||
WorldCache worldCache = session.getWorldCache();
|
||||
Scoreboard scoreboard = worldCache.getScoreboard();
|
||||
Objective objective = scoreboard.getObjective(packet.getName());
|
||||
|
@ -47,7 +47,7 @@ public class JavaTeamTranslator extends PacketTranslator<ServerTeamPacket> {
|
||||
private static final GeyserLogger LOGGER = GeyserConnector.getInstance().getLogger();
|
||||
|
||||
@Override
|
||||
public void translate(ServerTeamPacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerTeamPacket packet) {
|
||||
if (LOGGER.isDebug()) {
|
||||
LOGGER.debug("Team packet " + packet.getTeamName() + " " + packet.getAction() + " " + Arrays.toString(packet.getPlayers()));
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ public class JavaUpdateScoreTranslator extends PacketTranslator<ServerUpdateScor
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translate(ServerUpdateScorePacket packet, GeyserSession session) {
|
||||
public void translate(GeyserSession session, ServerUpdateScorePacket packet) {
|
||||
WorldCache worldCache = session.getWorldCache();
|
||||
Scoreboard scoreboard = worldCache.getScoreboard();
|
||||
int pps = worldCache.increaseAndGetScoreboardPacketsPerSecond();
|
||||
|
Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden Mehr anzeigen
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren