mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Formatting fix attempt 5 fsdiofhsdioufhvuisdhviuo9ds
This commit is contained in:
parent
841869149c
commit
fc04909508
1 changed files with 34 additions and 34 deletions
|
|
@ -661,7 +661,7 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
|
||||||
// Default move speed
|
// Default move speed
|
||||||
// Bedrock clients move very fast by default until they get an attribute packet correcting the speed
|
// Bedrock clients move very fast by default until they get an attribute packet correcting the speed
|
||||||
attributesPacket.setAttributes(Collections.singletonList(
|
attributesPacket.setAttributes(Collections.singletonList(
|
||||||
GeyserAttributeType.MOVEMENT_SPEED.getAttribute()));
|
GeyserAttributeType.MOVEMENT_SPEED.getAttribute()));
|
||||||
upstream.sendPacket(attributesPacket);
|
upstream.sendPacket(attributesPacket);
|
||||||
|
|
||||||
GameRulesChangedPacket gamerulePacket = new GameRulesChangedPacket();
|
GameRulesChangedPacket gamerulePacket = new GameRulesChangedPacket();
|
||||||
|
|
@ -764,7 +764,7 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
|
||||||
sendUpstreamPacket(packet);
|
sendUpstreamPacket(packet);
|
||||||
|
|
||||||
final PendingMicrosoftAuthentication.AuthenticationTask task = geyser.getPendingMicrosoftAuthentication().getOrCreateTask(
|
final PendingMicrosoftAuthentication.AuthenticationTask task = geyser.getPendingMicrosoftAuthentication().getOrCreateTask(
|
||||||
getAuthData().xuid()
|
getAuthData().xuid()
|
||||||
);
|
);
|
||||||
task.setOnline(true);
|
task.setOnline(true);
|
||||||
task.resetTimer();
|
task.resetTimer();
|
||||||
|
|
@ -805,13 +805,13 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
|
||||||
GameProfile selectedProfile = service.getSelectedProfile();
|
GameProfile selectedProfile = service.getSelectedProfile();
|
||||||
if (selectedProfile == null) {
|
if (selectedProfile == null) {
|
||||||
disconnect(GeyserLocale.getPlayerLocaleString(
|
disconnect(GeyserLocale.getPlayerLocaleString(
|
||||||
"geyser.network.remote.invalid_account",
|
"geyser.network.remote.invalid_account",
|
||||||
clientData.getLanguageCode()
|
clientData.getLanguageCode()
|
||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
this.protocol = new MinecraftProtocol(
|
this.protocol = new MinecraftProtocol(
|
||||||
selectedProfile,
|
selectedProfile,
|
||||||
service.getAccessToken()
|
service.getAccessToken()
|
||||||
);
|
);
|
||||||
try {
|
try {
|
||||||
connectDownstream();
|
connectDownstream();
|
||||||
|
|
@ -836,7 +836,7 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
|
||||||
GeyserImpl.getInstance().eventBus().fire(loginEvent);
|
GeyserImpl.getInstance().eventBus().fire(loginEvent);
|
||||||
if (loginEvent.isCancelled()) {
|
if (loginEvent.isCancelled()) {
|
||||||
String disconnectReason = loginEvent.disconnectReason() == null ?
|
String disconnectReason = loginEvent.disconnectReason() == null ?
|
||||||
BedrockDisconnectReasons.DISCONNECTED : loginEvent.disconnectReason();
|
BedrockDisconnectReasons.DISCONNECTED : loginEvent.disconnectReason();
|
||||||
disconnect(disconnectReason);
|
disconnect(disconnectReason);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -854,8 +854,8 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
|
||||||
if (geyser.getBootstrap().getSocketAddress() != null) {
|
if (geyser.getBootstrap().getSocketAddress() != null) {
|
||||||
// We're going to connect through the JVM and not through TCP
|
// We're going to connect through the JVM and not through TCP
|
||||||
downstream = new LocalSession(this.remoteServer.address(), this.remoteServer.port(),
|
downstream = new LocalSession(this.remoteServer.address(), this.remoteServer.port(),
|
||||||
geyser.getBootstrap().getSocketAddress(), upstream.getAddress().getAddress().getHostAddress(),
|
geyser.getBootstrap().getSocketAddress(), upstream.getAddress().getAddress().getHostAddress(),
|
||||||
this.protocol, this.protocol.createHelper());
|
this.protocol, this.protocol.createHelper());
|
||||||
this.downstream = new DownstreamSession(downstream);
|
this.downstream = new DownstreamSession(downstream);
|
||||||
} else {
|
} else {
|
||||||
downstream = new TcpClientSession(this.remoteServer.address(), this.remoteServer.port(), this.protocol);
|
downstream = new TcpClientSession(this.remoteServer.address(), this.remoteServer.port(), this.protocol);
|
||||||
|
|
@ -922,16 +922,16 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
|
||||||
}
|
}
|
||||||
|
|
||||||
encryptedData = cipher.encryptFromString(BedrockData.of(
|
encryptedData = cipher.encryptFromString(BedrockData.of(
|
||||||
clientData.getGameVersion(),
|
clientData.getGameVersion(),
|
||||||
authData.name(),
|
authData.name(),
|
||||||
authData.xuid(),
|
authData.xuid(),
|
||||||
clientData.getDeviceOs().ordinal(),
|
clientData.getDeviceOs().ordinal(),
|
||||||
clientData.getLanguageCode(),
|
clientData.getLanguageCode(),
|
||||||
clientData.getUiProfile().ordinal(),
|
clientData.getUiProfile().ordinal(),
|
||||||
clientData.getCurrentInputMode().ordinal(),
|
clientData.getCurrentInputMode().ordinal(),
|
||||||
bedrockAddress,
|
bedrockAddress,
|
||||||
skinUploader.getId(),
|
skinUploader.getId(),
|
||||||
skinUploader.getVerifyCode()
|
skinUploader.getVerifyCode()
|
||||||
).toString());
|
).toString());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
geyser.getLogger().error(GeyserLocale.getLocaleStringLog("geyser.auth.floodgate.encrypt_fail"), e);
|
geyser.getLogger().error(GeyserLocale.getLocaleStringLog("geyser.auth.floodgate.encrypt_fail"), e);
|
||||||
|
|
@ -965,11 +965,11 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
|
||||||
if (downstream instanceof LocalSession) {
|
if (downstream instanceof LocalSession) {
|
||||||
// Connected directly to the server
|
// Connected directly to the server
|
||||||
geyser.getLogger().info(GeyserLocale.getLocaleStringLog("geyser.network.remote.connect_internal",
|
geyser.getLogger().info(GeyserLocale.getLocaleStringLog("geyser.network.remote.connect_internal",
|
||||||
authData.name(), protocol.getProfile().getName()));
|
authData.name(), protocol.getProfile().getName()));
|
||||||
} else {
|
} else {
|
||||||
// Connected to an IP address
|
// Connected to an IP address
|
||||||
geyser.getLogger().info(GeyserLocale.getLocaleStringLog("geyser.network.remote.connect",
|
geyser.getLogger().info(GeyserLocale.getLocaleStringLog("geyser.network.remote.connect",
|
||||||
authData.name(), protocol.getProfile().getName(), remoteServer.address()));
|
authData.name(), protocol.getProfile().getName(), remoteServer.address()));
|
||||||
}
|
}
|
||||||
|
|
||||||
UUID uuid = protocol.getProfile().getId();
|
UUID uuid = protocol.getProfile().getId();
|
||||||
|
|
@ -1009,10 +1009,10 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
|
||||||
disconnectMessage = GeyserLocale.getPlayerLocaleString("geyser.network.remote.authentication_type_mismatch", locale());
|
disconnectMessage = GeyserLocale.getPlayerLocaleString("geyser.network.remote.authentication_type_mismatch", locale());
|
||||||
// Explain that they may be looking for Floodgate.
|
// Explain that they may be looking for Floodgate.
|
||||||
geyser.getLogger().warning(GeyserLocale.getLocaleStringLog(
|
geyser.getLogger().warning(GeyserLocale.getLocaleStringLog(
|
||||||
geyser.getPlatformType() == PlatformType.STANDALONE ?
|
geyser.getPlatformType() == PlatformType.STANDALONE ?
|
||||||
"geyser.network.remote.floodgate_explanation_standalone"
|
"geyser.network.remote.floodgate_explanation_standalone"
|
||||||
: "geyser.network.remote.floodgate_explanation_plugin",
|
: "geyser.network.remote.floodgate_explanation_plugin",
|
||||||
Constants.FLOODGATE_DOWNLOAD_LOCATION
|
Constants.FLOODGATE_DOWNLOAD_LOCATION
|
||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
// Likely that Floodgate is not configured correctly.
|
// Likely that Floodgate is not configured correctly.
|
||||||
|
|
@ -1183,7 +1183,7 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
|
||||||
// A null return value cancels the packet
|
// A null return value cancels the packet
|
||||||
if (position != null) {
|
if (position != null) {
|
||||||
ServerboundMovePlayerPosPacket packet = new ServerboundMovePlayerPosPacket(playerEntity.isOnGround(),
|
ServerboundMovePlayerPosPacket packet = new ServerboundMovePlayerPosPacket(playerEntity.isOnGround(),
|
||||||
position.getX(), position.getY(), position.getZ());
|
position.getX(), position.getY(), position.getZ());
|
||||||
sendDownstreamGamePacket(packet);
|
sendDownstreamGamePacket(packet);
|
||||||
}
|
}
|
||||||
lastMovementTimestamp = System.currentTimeMillis();
|
lastMovementTimestamp = System.currentTimeMillis();
|
||||||
|
|
@ -1328,7 +1328,7 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
|
||||||
*/
|
*/
|
||||||
public void useItem(Hand hand) {
|
public void useItem(Hand hand) {
|
||||||
sendDownstreamGamePacket(new ServerboundUseItemPacket(
|
sendDownstreamGamePacket(new ServerboundUseItemPacket(
|
||||||
hand, worldCache.nextPredictionSequence(), playerEntity.getYaw(), playerEntity.getPitch()));
|
hand, worldCache.nextPredictionSequence(), playerEntity.getYaw(), playerEntity.getPitch()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -1377,7 +1377,7 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
|
||||||
private boolean disableBlocking() {
|
private boolean disableBlocking() {
|
||||||
if (playerEntity.getFlag(EntityFlag.BLOCKING)) {
|
if (playerEntity.getFlag(EntityFlag.BLOCKING)) {
|
||||||
ServerboundPlayerActionPacket releaseItemPacket = new ServerboundPlayerActionPacket(PlayerAction.RELEASE_USE_ITEM,
|
ServerboundPlayerActionPacket releaseItemPacket = new ServerboundPlayerActionPacket(PlayerAction.RELEASE_USE_ITEM,
|
||||||
Vector3i.ZERO, Direction.DOWN, 0);
|
Vector3i.ZERO, Direction.DOWN, 0);
|
||||||
sendDownstreamGamePacket(releaseItemPacket);
|
sendDownstreamGamePacket(releaseItemPacket);
|
||||||
playerEntity.setFlag(EntityFlag.BLOCKING, false);
|
playerEntity.setFlag(EntityFlag.BLOCKING, false);
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -1387,7 +1387,7 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
|
||||||
|
|
||||||
public void requestOffhandSwap() {
|
public void requestOffhandSwap() {
|
||||||
ServerboundPlayerActionPacket swapHandsPacket = new ServerboundPlayerActionPacket(PlayerAction.SWAP_HANDS, Vector3i.ZERO,
|
ServerboundPlayerActionPacket swapHandsPacket = new ServerboundPlayerActionPacket(PlayerAction.SWAP_HANDS, Vector3i.ZERO,
|
||||||
Direction.DOWN, 0);
|
Direction.DOWN, 0);
|
||||||
sendDownstreamGamePacket(swapHandsPacket);
|
sendDownstreamGamePacket(swapHandsPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1596,7 +1596,7 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
|
||||||
unconfirmedTeleport.resetUnconfirmedFor();
|
unconfirmedTeleport.resetUnconfirmedFor();
|
||||||
geyser.getLogger().debug("Resending teleport " + unconfirmedTeleport.getTeleportConfirmId());
|
geyser.getLogger().debug("Resending teleport " + unconfirmedTeleport.getTeleportConfirmId());
|
||||||
getPlayerEntity().moveAbsolute(Vector3f.from(unconfirmedTeleport.getX(), unconfirmedTeleport.getY(), unconfirmedTeleport.getZ()),
|
getPlayerEntity().moveAbsolute(Vector3f.from(unconfirmedTeleport.getX(), unconfirmedTeleport.getY(), unconfirmedTeleport.getZ()),
|
||||||
unconfirmedTeleport.getYaw(), unconfirmedTeleport.getPitch(), playerEntity.isOnGround(), true);
|
unconfirmedTeleport.getYaw(), unconfirmedTeleport.getPitch(), playerEntity.isOnGround(), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1862,8 +1862,8 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
|
||||||
*/
|
*/
|
||||||
public void sendJavaClientSettings() {
|
public void sendJavaClientSettings() {
|
||||||
ServerboundClientInformationPacket clientSettingsPacket = new ServerboundClientInformationPacket(locale(),
|
ServerboundClientInformationPacket clientSettingsPacket = new ServerboundClientInformationPacket(locale(),
|
||||||
getRenderDistance(), ChatVisibility.FULL, true, SKIN_PARTS,
|
getRenderDistance(), ChatVisibility.FULL, true, SKIN_PARTS,
|
||||||
HandPreference.RIGHT_HAND, false, true);
|
HandPreference.RIGHT_HAND, false, true);
|
||||||
sendDownstreamPacket(clientSettingsPacket);
|
sendDownstreamPacket(clientSettingsPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1916,8 +1916,8 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
|
||||||
return switch (pose) {
|
return switch (pose) {
|
||||||
case SNEAKING -> 1.27f;
|
case SNEAKING -> 1.27f;
|
||||||
case SWIMMING,
|
case SWIMMING,
|
||||||
FALL_FLYING, // Elytra
|
FALL_FLYING, // Elytra
|
||||||
SPIN_ATTACK -> 0.4f; // Trident spin attack
|
SPIN_ATTACK -> 0.4f; // Trident spin attack
|
||||||
case SLEEPING -> 0.2f;
|
case SLEEPING -> 0.2f;
|
||||||
default -> EntityDefinitions.PLAYER.offset();
|
default -> EntityDefinitions.PLAYER.offset();
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue