diff --git a/bootstrap/spigot/src/main/resources/plugin.yml b/bootstrap/spigot/src/main/resources/plugin.yml index ea655f902..0cd78ebe3 100644 --- a/bootstrap/spigot/src/main/resources/plugin.yml +++ b/bootstrap/spigot/src/main/resources/plugin.yml @@ -8,4 +8,23 @@ api-version: 1.13 commands: geyser: description: The main command for Geyser. - usage: /geyser help \ No newline at end of file + usage: /geyser help +permissions: + geyser.command.help: + description: Shows help for all registered commands. + geyser.command.advancement: + description: Shows the advancements of the player on the server. + geyser.command.dump: + description: Dumps Geyser debug information for bug reports. + geyser.command.list: + description: List all players connected through Geyser. + geyser.command.offhand: + description: Puts an items in your offhand. + geyser.command.reload: + description: Reloads the Geyser configurations. Kicks all players when used! + geyser.command.shutdown: + description: Shuts down Geyser. + geyser.command.statistics: + description: Shows the statistics of the player on the server. + geyser.command.version: + description: Shows the current Geyser version and checks for updates. \ No newline at end of file diff --git a/connector/src/main/java/org/geysermc/connector/GeyserConnector.java b/connector/src/main/java/org/geysermc/connector/GeyserConnector.java index fc3aaaeb9..2ba6182ef 100644 --- a/connector/src/main/java/org/geysermc/connector/GeyserConnector.java +++ b/connector/src/main/java/org/geysermc/connector/GeyserConnector.java @@ -106,6 +106,12 @@ public class GeyserConnector { private static GeyserConnector instance; + /** + * This is used in GeyserConnect to stop the bedrock server binding to a port + */ + @Setter + private static boolean shouldStartListener = true; + @Setter private AuthType defaultAuthType; @@ -261,14 +267,17 @@ public class GeyserConnector { } bedrockServer.setHandler(new ConnectorServerEventHandler(this)); - bedrockServer.bind().whenComplete((avoid, throwable) -> { - if (throwable == null) { - logger.info(LanguageUtils.getLocaleStringLog("geyser.core.start", config.getBedrock().getAddress(), String.valueOf(config.getBedrock().getPort()))); - } else { - logger.severe(LanguageUtils.getLocaleStringLog("geyser.core.fail", config.getBedrock().getAddress(), String.valueOf(config.getBedrock().getPort()))); - throwable.printStackTrace(); - } - }).join(); + + if (shouldStartListener) { + bedrockServer.bind().whenComplete((avoid, throwable) -> { + if (throwable == null) { + logger.info(LanguageUtils.getLocaleStringLog("geyser.core.start", config.getBedrock().getAddress(), String.valueOf(config.getBedrock().getPort()))); + } else { + logger.severe(LanguageUtils.getLocaleStringLog("geyser.core.fail", config.getBedrock().getAddress(), String.valueOf(config.getBedrock().getPort()))); + throwable.printStackTrace(); + } + }).join(); + } if (config.getMetrics().isEnabled()) { metrics = new Metrics(this, "GeyserMC", config.getMetrics().getUniqueId(), false, java.util.logging.Logger.getLogger("")); diff --git a/connector/src/main/java/org/geysermc/connector/entity/BoatEntity.java b/connector/src/main/java/org/geysermc/connector/entity/BoatEntity.java index a933b61b8..bc7ad2330 100644 --- a/connector/src/main/java/org/geysermc/connector/entity/BoatEntity.java +++ b/connector/src/main/java/org/geysermc/connector/entity/BoatEntity.java @@ -29,6 +29,7 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadat import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.packet.AnimatePacket; +import com.nukkitx.protocol.bedrock.packet.MoveEntityAbsolutePacket; import org.geysermc.connector.entity.type.EntityType; import org.geysermc.connector.network.session.GeyserSession; @@ -65,7 +66,19 @@ public class BoatEntity extends Entity { @Override public void moveAbsolute(GeyserSession session, Vector3f position, Vector3f rotation, boolean isOnGround, boolean teleported) { // We don't include the rotation (y) as it causes the boat to appear sideways - super.moveAbsolute(session, position.add(0d, this.entityType.getOffset(), 0d), Vector3f.from(rotation.getX() + 90, 0, rotation.getX() + 90), isOnGround, teleported); + setPosition(position.add(0d, this.entityType.getOffset(), 0d)); + setRotation(Vector3f.from(rotation.getX() + 90, 0, rotation.getX() + 90)); + setOnGround(isOnGround); + + MoveEntityAbsolutePacket moveEntityPacket = new MoveEntityAbsolutePacket(); + moveEntityPacket.setRuntimeEntityId(geyserId); + // Minimal glitching when ServerVehicleMovePacket is sent + moveEntityPacket.setPosition(session.getRidingVehicleEntity() == this ? position.up(EntityType.PLAYER.getOffset() - this.entityType.getOffset()) : this.position); + moveEntityPacket.setRotation(getBedrockRotation()); + moveEntityPacket.setOnGround(isOnGround); + moveEntityPacket.setTeleported(teleported); + + session.sendUpstreamPacket(moveEntityPacket); } @Override @@ -85,7 +98,6 @@ public class BoatEntity extends Entity { @Override public void updateBedrockMetadata(EntityMetadata entityMetadata, GeyserSession session) { - // Time since last hit if (entityMetadata.getId() == 8) { metadata.put(EntityData.HURT_TIME, entityMetadata.getValue()); diff --git a/connector/src/main/java/org/geysermc/connector/entity/type/EntityType.java b/connector/src/main/java/org/geysermc/connector/entity/type/EntityType.java index b4292c608..4ca9470b0 100644 --- a/connector/src/main/java/org/geysermc/connector/entity/type/EntityType.java +++ b/connector/src/main/java/org/geysermc/connector/entity/type/EntityType.java @@ -130,7 +130,7 @@ public enum EntityType { THROWN_ENDERPEARL(ThrowableEntity.class, 87, 0.25f, 0.25f, 0.25f, 0f, "minecraft:ender_pearl"), LEASH_KNOT(LeashKnotEntity.class, 88, 0.5f, 0.375f), WITHER_SKULL(WitherSkullEntity.class, 89, 0.3125f), - BOAT(BoatEntity.class, 90, 0.7f, 1.6f, 1.6f, 0.35f), + BOAT(BoatEntity.class, 90, 0.6f, 1.6f, 1.6f, 0.35f), WITHER_SKULL_DANGEROUS(WitherSkullEntity.class, 91, 0f), LIGHTNING_BOLT(Entity.class, 93, 0f), SMALL_FIREBALL(ItemedFireballEntity.class, 94, 0.3125f), diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockMoveEntityAbsoluteTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockMoveEntityAbsoluteTranslator.java index b053a204c..fbfaafb43 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockMoveEntityAbsoluteTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockMoveEntityAbsoluteTranslator.java @@ -45,9 +45,8 @@ public class BedrockMoveEntityAbsoluteTranslator extends PacketTranslator org.projectlombok lombok - 1.18.4 + 1.18.20 provided