From 966c2155adbb5980637c7072d17a38b7be03771d Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Mon, 22 Nov 2021 14:52:26 -0500 Subject: [PATCH] API: change player class to Connection --- .../main/java/org/geysermc/api/Geyser.java | 26 +------- .../geysermc/api/{Api.java => GeyserApi.java} | 41 +++++++++--- .../api/geyser/GeyserConnection.java} | 6 +- .../api/geyser/GeyserExtensionApi.java} | 47 ++----------- .../org/geysermc/api/geyser/package-info.java | 29 ++++++++ .../session/{Session.java => Connection.java} | 19 +++--- .../command/GeyserBungeeCommandExecutor.java | 4 +- .../command/GeyserSpigotCommandExecutor.java | 4 +- .../spigot/world/GeyserPistonListener.java | 6 +- .../GeyserSpigot1_11CraftingListener.java | 10 +-- .../world/GeyserSpigotBlockPlaceListener.java | 4 +- .../GeyserSpigot1_12NativeWorldManager.java | 4 +- .../manager/GeyserSpigot1_12WorldManager.java | 4 +- .../GeyserSpigotFallbackWorldManager.java | 6 +- .../GeyserSpigotLegacyNativeWorldManager.java | 4 +- .../GeyserSpigotNativeWorldManager.java | 4 +- .../manager/GeyserSpigotWorldManager.java | 12 ++-- .../command/GeyserSpongeCommandExecutor.java | 4 +- .../standalone/gui/GeyserStandaloneGUI.java | 4 +- .../GeyserVelocityCommandExecutor.java | 4 +- .../geysermc/connector/GeyserConnector.java | 4 +- .../network/session/GeyserSession.java | 5 +- .../java/org/geysermc/geyser/GeyserImpl.java | 66 +++++++++---------- .../geyser/command/CommandExecutor.java | 6 +- .../geyser/command/CommandManager.java | 6 +- .../geyser/command/GeyserCommand.java | 4 +- .../command/defaults/AdvancementsCommand.java | 4 +- .../geyser/command/defaults/DumpCommand.java | 4 +- .../geyser/command/defaults/HelpCommand.java | 4 +- .../geyser/command/defaults/ListCommand.java | 6 +- .../command/defaults/OffhandCommand.java | 4 +- .../command/defaults/ReloadCommand.java | 4 +- .../command/defaults/SettingsCommand.java | 4 +- .../command/defaults/StatisticsCommand.java | 4 +- .../geyser/command/defaults/StopCommand.java | 4 +- .../command/defaults/VersionCommand.java | 4 +- .../org/geysermc/geyser/dump/DumpInfo.java | 4 +- .../geyser/entity/InteractiveTagManager.java | 4 +- .../entity/factory/BaseEntityFactory.java | 4 +- .../factory/ExperienceOrbEntityFactory.java | 4 +- .../entity/factory/PaintingEntityFactory.java | 4 +- .../entity/type/AbstractArrowEntity.java | 4 +- .../entity/type/AreaEffectCloudEntity.java | 4 +- .../geyser/entity/type/BoatEntity.java | 10 +-- .../type/CommandBlockMinecartEntity.java | 4 +- .../type/DefaultBlockMinecartEntity.java | 4 +- .../entity/type/EnderCrystalEntity.java | 4 +- .../geysermc/geyser/entity/type/Entity.java | 6 +- .../geyser/entity/type/ExpOrbEntity.java | 4 +- .../entity/type/FallingBlockEntity.java | 4 +- .../geyser/entity/type/FireworkEntity.java | 4 +- .../geyser/entity/type/FishingHookEntity.java | 6 +- .../entity/type/FurnaceMinecartEntity.java | 4 +- .../geyser/entity/type/ItemEntity.java | 4 +- .../geyser/entity/type/ItemFrameEntity.java | 8 +-- .../entity/type/ItemedFireballEntity.java | 4 +- .../geyser/entity/type/LeashKnotEntity.java | 4 +- .../geyser/entity/type/LightningEntity.java | 4 +- .../geyser/entity/type/LivingEntity.java | 12 ++-- .../geyser/entity/type/MinecartEntity.java | 4 +- .../geyser/entity/type/PaintingEntity.java | 4 +- .../entity/type/SpawnerMinecartEntity.java | 4 +- .../geyser/entity/type/TNTEntity.java | 4 +- .../geyser/entity/type/ThrowableEntity.java | 4 +- .../entity/type/ThrowableItemEntity.java | 4 +- .../entity/type/ThrownPotionEntity.java | 4 +- .../geyser/entity/type/TippedArrowEntity.java | 4 +- .../geyser/entity/type/TridentEntity.java | 4 +- .../geyser/entity/type/WitherSkullEntity.java | 4 +- .../type/living/AbstractFishEntity.java | 4 +- .../entity/type/living/AgeableEntity.java | 4 +- .../entity/type/living/AmbientEntity.java | 4 +- .../entity/type/living/ArmorStandEntity.java | 4 +- .../geyser/entity/type/living/BatEntity.java | 4 +- .../entity/type/living/CreatureEntity.java | 4 +- .../entity/type/living/FlyingEntity.java | 4 +- .../entity/type/living/GlowSquidEntity.java | 4 +- .../entity/type/living/GolemEntity.java | 4 +- .../entity/type/living/IronGolemEntity.java | 4 +- .../entity/type/living/MagmaCubeEntity.java | 4 +- .../geyser/entity/type/living/MobEntity.java | 4 +- .../entity/type/living/SlimeEntity.java | 4 +- .../entity/type/living/SnowGolemEntity.java | 4 +- .../entity/type/living/SquidEntity.java | 4 +- .../entity/type/living/WaterEntity.java | 4 +- .../type/living/animal/AnimalEntity.java | 4 +- .../type/living/animal/AxolotlEntity.java | 4 +- .../entity/type/living/animal/BeeEntity.java | 4 +- .../type/living/animal/ChickenEntity.java | 4 +- .../entity/type/living/animal/FoxEntity.java | 4 +- .../entity/type/living/animal/GoatEntity.java | 4 +- .../type/living/animal/HoglinEntity.java | 4 +- .../type/living/animal/MooshroomEntity.java | 4 +- .../type/living/animal/OcelotEntity.java | 4 +- .../type/living/animal/PandaEntity.java | 4 +- .../entity/type/living/animal/PigEntity.java | 4 +- .../type/living/animal/PolarBearEntity.java | 4 +- .../type/living/animal/PufferFishEntity.java | 4 +- .../type/living/animal/RabbitEntity.java | 4 +- .../type/living/animal/SheepEntity.java | 4 +- .../type/living/animal/StriderEntity.java | 4 +- .../living/animal/TropicalFishEntity.java | 4 +- .../type/living/animal/TurtleEntity.java | 4 +- .../animal/horse/AbstractHorseEntity.java | 4 +- .../animal/horse/ChestedHorseEntity.java | 4 +- .../type/living/animal/horse/HorseEntity.java | 4 +- .../type/living/animal/horse/LlamaEntity.java | 4 +- .../animal/horse/TraderLlamaEntity.java | 4 +- .../living/animal/tameable/CatEntity.java | 4 +- .../living/animal/tameable/ParrotEntity.java | 4 +- .../animal/tameable/TameableEntity.java | 4 +- .../living/animal/tameable/WolfEntity.java | 4 +- .../merchant/AbstractMerchantEntity.java | 4 +- .../type/living/merchant/VillagerEntity.java | 4 +- .../monster/AbstractSkeletonEntity.java | 4 +- .../type/living/monster/BasePiglinEntity.java | 4 +- .../type/living/monster/BlazeEntity.java | 4 +- .../type/living/monster/CreeperEntity.java | 4 +- .../living/monster/ElderGuardianEntity.java | 4 +- .../living/monster/EnderDragonEntity.java | 4 +- .../living/monster/EnderDragonPartEntity.java | 4 +- .../type/living/monster/EndermanEntity.java | 4 +- .../type/living/monster/GhastEntity.java | 4 +- .../type/living/monster/GiantEntity.java | 4 +- .../type/living/monster/GuardianEntity.java | 4 +- .../type/living/monster/MonsterEntity.java | 4 +- .../type/living/monster/PhantomEntity.java | 4 +- .../type/living/monster/PiglinEntity.java | 6 +- .../type/living/monster/ShulkerEntity.java | 4 +- .../type/living/monster/SkeletonEntity.java | 4 +- .../type/living/monster/SpiderEntity.java | 4 +- .../entity/type/living/monster/VexEntity.java | 4 +- .../type/living/monster/WitherEntity.java | 4 +- .../type/living/monster/ZoglinEntity.java | 4 +- .../type/living/monster/ZombieEntity.java | 4 +- .../living/monster/ZombieVillagerEntity.java | 4 +- .../living/monster/ZombifiedPiglinEntity.java | 4 +- .../monster/raid/AbstractIllagerEntity.java | 4 +- .../living/monster/raid/PillagerEntity.java | 8 +-- .../monster/raid/RaidParticipantEntity.java | 4 +- .../raid/SpellcasterIllagerEntity.java | 4 +- .../living/monster/raid/VindicatorEntity.java | 4 +- .../entity/type/player/PlayerEntity.java | 4 +- .../type/player/SessionPlayerEntity.java | 8 +-- .../entity/type/player/SkullPlayerEntity.java | 4 +- .../geysermc/geyser/inventory/Container.java | 4 +- .../geyser/inventory/EnchantingContainer.java | 2 +- .../geyser/inventory/Generic3X3Container.java | 4 +- .../geyser/inventory/GeyserEnchantOption.java | 4 +- .../geyser/inventory/GeyserItemStack.java | 6 +- .../geysermc/geyser/inventory/Inventory.java | 6 +- .../geyser/inventory/PlayerInventory.java | 4 +- .../inventory/StonecutterContainer.java | 4 +- .../geyser/inventory/click/ClickPlan.java | 6 +- .../holder/BlockInventoryHolder.java | 12 ++-- .../inventory/holder/InventoryHolder.java | 8 +-- .../updater/AnvilInventoryUpdater.java | 34 +++++----- .../updater/ChestInventoryUpdater.java | 6 +- .../updater/ContainerInventoryUpdater.java | 6 +- .../updater/HorseInventoryUpdater.java | 6 +- .../inventory/updater/InventoryUpdater.java | 6 +- .../inventory/updater/UIInventoryUpdater.java | 6 +- .../geyser/level/GeyserWorldManager.java | 18 ++--- .../geysermc/geyser/level/WorldManager.java | 22 +++---- .../level/physics/CollisionManager.java | 8 +-- .../network/ConnectorServerEventHandler.java | 4 +- .../geyser/network/LoggingPacketHandler.java | 6 +- .../geyser/network/UpstreamPacketHandler.java | 4 +- .../geyser/network/netty/LocalSession.java | 2 +- .../registry/PacketTranslatorRegistry.java | 6 +- .../geyser/registry/type/ParticleMapping.java | 4 +- .../geyser/scoreboard/Scoreboard.java | 6 +- .../geyser/scoreboard/ScoreboardUpdater.java | 10 +-- ...serSessionImpl.java => GeyserSession.java} | 12 ++-- .../geyser/session/SessionManager.java | 20 +++--- .../session/cache/AdvancementsCache.java | 6 +- .../geyser/session/cache/BookEditCache.java | 6 +- .../geyser/session/cache/BossBar.java | 4 +- .../geyser/session/cache/ChunkCache.java | 4 +- .../geyser/session/cache/EntityCache.java | 4 +- .../geyser/session/cache/FormCache.java | 4 +- .../geyser/session/cache/PistonCache.java | 6 +- .../session/cache/PreferencesCache.java | 8 +-- .../geyser/session/cache/WorldBorder.java | 10 +-- .../geyser/session/cache/WorldCache.java | 6 +- .../geyser/skin/FloodgateSkinUploader.java | 4 +- .../org/geysermc/geyser/skin/SkinManager.java | 12 ++-- .../geysermc/geyser/skin/SkinProvider.java | 4 +- .../geyser/skin/SkullSkinManager.java | 4 +- .../translator/collision/BlockCollision.java | 4 +- .../translator/collision/DoorCollision.java | 4 +- .../collision/ScaffoldingCollision.java | 4 +- .../translator/collision/SnowCollision.java | 4 +- .../collision/TrapdoorCollision.java | 4 +- .../AbstractBlockInventoryTranslator.java | 12 ++-- .../inventory/AnvilInventoryTranslator.java | 4 +- .../inventory/BaseInventoryTranslator.java | 4 +- .../inventory/BeaconInventoryTranslator.java | 10 +-- .../inventory/BrewingInventoryTranslator.java | 6 +- .../CartographyInventoryTranslator.java | 4 +- .../EnchantingInventoryTranslator.java | 6 +- .../Generic3X3InventoryTranslator.java | 4 +- .../inventory/InventoryTranslator.java | 36 +++++----- .../inventory/LecternInventoryTranslator.java | 16 ++--- .../inventory/LoomInventoryTranslator.java | 6 +- .../MerchantInventoryTranslator.java | 14 ++-- .../inventory/PlayerInventoryTranslator.java | 24 +++---- .../inventory/ShulkerInventoryTranslator.java | 4 +- .../StonecutterInventoryTranslator.java | 4 +- .../chest/ChestInventoryTranslator.java | 8 +-- .../chest/DoubleChestInventoryTranslator.java | 8 +-- .../chest/SingleChestInventoryTranslator.java | 8 +-- .../AbstractFurnaceInventoryTranslator.java | 4 +- .../AbstractHorseInventoryTranslator.java | 12 ++-- .../ChestedHorseInventoryTranslator.java | 4 +- .../inventory/item/ItemTranslator.java | 8 +-- .../item/NbtItemStackTranslator.java | 4 +- .../item/nbt/AxolotlBucketTranslator.java | 4 +- .../item/nbt/BasicItemTranslator.java | 4 +- .../item/nbt/BookPagesTranslator.java | 4 +- .../item/nbt/CrossbowTranslator.java | 4 +- .../item/nbt/EnchantedBookTranslator.java | 4 +- .../item/nbt/EnchantmentTranslator.java | 4 +- .../item/nbt/FireworkRocketTranslator.java | 4 +- .../item/nbt/FireworkStarTranslator.java | 4 +- .../item/nbt/LeatherArmorTranslator.java | 4 +- .../item/nbt/LodestoneCompassTranslator.java | 4 +- .../inventory/item/nbt/MapItemTranslator.java | 4 +- .../item/nbt/PlayerHeadTranslator.java | 4 +- .../item/nbt/ShulkerBoxItemTranslator.java | 4 +- .../nbt/TropicalFishBucketTranslator.java | 4 +- .../translator/level/BiomeTranslator.java | 6 +- .../block/entity/BedrockOnlyBlockEntity.java | 8 +-- .../DoubleChestBlockEntityTranslator.java | 4 +- .../FlowerPotBlockEntityTranslator.java | 6 +- .../NoteblockBlockEntityTranslator.java | 4 +- .../level/block/entity/PistonBlockEntity.java | 6 +- .../entity/SkullBlockEntityTranslator.java | 6 +- .../level/event/LevelEventTranslator.java | 6 +- .../level/event/PlaySoundEventTranslator.java | 4 +- .../event/SoundEventEventTranslator.java | 4 +- .../event/SoundLevelEventTranslator.java | 4 +- .../translator/protocol/PacketTranslator.java | 4 +- .../BedrockAdventureSettingsTranslator.java | 4 +- .../bedrock/BedrockAnimateTranslator.java | 4 +- .../BedrockBlockEntityDataTranslator.java | 4 +- .../BedrockBlockPickRequestTranslator.java | 4 +- .../bedrock/BedrockBookEditTranslator.java | 4 +- .../BedrockCommandBlockUpdateTranslator.java | 4 +- .../BedrockCommandRequestTranslator.java | 4 +- .../BedrockContainerCloseTranslator.java | 4 +- .../bedrock/BedrockEmoteListTranslator.java | 4 +- .../BedrockEntityPickRequestTranslator.java | 4 +- .../bedrock/BedrockFilterTextTranslator.java | 4 +- ...BedrockInventoryTransactionTranslator.java | 6 +- .../BedrockItemFrameDropItemTranslator.java | 4 +- .../BedrockItemStackRequestTranslator.java | 4 +- .../BedrockLecternUpdateTranslator.java | 4 +- .../BedrockMapInfoRequestTranslator.java | 4 +- .../BedrockMobEquipmentTranslator.java | 4 +- .../BedrockMoveEntityAbsoluteTranslator.java | 4 +- .../BedrockNetworkStackLatencyTranslator.java | 4 +- ...drockPacketViolationWarningTranslator.java | 4 +- .../bedrock/BedrockPlayerInputTranslator.java | 4 +- ...tionTrackingDBClientRequestTranslator.java | 4 +- .../bedrock/BedrockRespawnTranslator.java | 4 +- ...edrockServerSettingsRequestTranslator.java | 4 +- ...SetLocalPlayerAsInitializedTranslator.java | 4 +- .../bedrock/BedrockShowCreditsTranslator.java | 4 +- .../bedrock/BedrockTextTranslator.java | 4 +- .../entity/BedrockEntityEventTranslator.java | 4 +- .../player/BedrockActionTranslator.java | 4 +- .../entity/player/BedrockEmoteTranslator.java | 8 +-- .../player/BedrockInteractTranslator.java | 4 +- .../player/BedrockMovePlayerTranslator.java | 6 +- .../player/BedrockRiderJumpTranslator.java | 4 +- .../BedrockSetPlayerGameTypeTranslator.java | 4 +- .../BedrockLevelSoundEventTranslator.java | 4 +- .../java/JavaAwardStatsTranslator.java | 4 +- .../java/JavaBossEventTranslator.java | 4 +- .../java/JavaChangeDifficultyTranslator.java | 4 +- .../protocol/java/JavaChatTranslator.java | 4 +- .../protocol/java/JavaCommandsTranslator.java | 10 +-- .../java/JavaCustomPayloadTranslator.java | 4 +- .../java/JavaCustomQueryTranslator.java | 4 +- .../java/JavaDisconnectTranslator.java | 4 +- .../java/JavaGameProfileTranslator.java | 4 +- .../java/JavaKeepAliveTranslator.java | 4 +- .../java/JavaLoginDisconnectTranslator.java | 4 +- .../protocol/java/JavaLoginTranslator.java | 4 +- .../protocol/java/JavaPingTranslator.java | 4 +- .../protocol/java/JavaRecipeTranslator.java | 4 +- .../protocol/java/JavaRespawnTranslator.java | 4 +- .../JavaSelectAdvancementsTabTranslator.java | 4 +- .../JavaUpdateAdvancementsTranslator.java | 6 +- .../java/JavaUpdateRecipesTranslator.java | 6 +- .../java/JavaUpdateTagsTranslator.java | 4 +- .../java/entity/JavaAnimateTranslator.java | 4 +- .../entity/JavaEntityEventTranslator.java | 4 +- .../JavaMoveEntityPosRotTranslator.java | 4 +- .../entity/JavaMoveEntityPosTranslator.java | 4 +- .../entity/JavaMoveEntityRotTranslator.java | 4 +- .../entity/JavaMoveVehicleTranslator.java | 4 +- .../entity/JavaRemoveEntitiesTranslator.java | 4 +- .../entity/JavaRemoveMobEffectTranslator.java | 4 +- .../java/entity/JavaRotateHeadTranslator.java | 4 +- .../entity/JavaSetEntityDataTranslator.java | 4 +- .../entity/JavaSetEntityLinkTranslator.java | 4 +- .../entity/JavaSetEntityMotionTranslator.java | 4 +- .../entity/JavaSetEquipmentTranslator.java | 4 +- .../entity/JavaSetPassengersTranslator.java | 4 +- .../entity/JavaTakeItemEntityTranslator.java | 4 +- .../entity/JavaTeleportEntityTranslator.java | 4 +- .../JavaUpdateAttributesTranslator.java | 4 +- .../entity/JavaUpdateMobEffectTranslator.java | 4 +- .../player/JavaBlockBreakAckTranslator.java | 4 +- .../player/JavaPlayerAbilitiesTranslator.java | 4 +- .../player/JavaPlayerInfoTranslator.java | 4 +- .../player/JavaPlayerPositionTranslator.java | 4 +- .../player/JavaSetCarriedItemTranslator.java | 4 +- .../player/JavaSetExperienceTranslator.java | 4 +- .../player/JavaSetHealthTranslator.java | 4 +- .../entity/spawn/JavaAddEntityTranslator.java | 4 +- .../spawn/JavaAddExperienceOrbTranslator.java | 4 +- .../entity/spawn/JavaAddMobTranslator.java | 4 +- .../spawn/JavaAddPaintingTranslator.java | 4 +- .../entity/spawn/JavaAddPlayerTranslator.java | 4 +- .../JavaContainerCloseTranslator.java | 4 +- .../JavaContainerSetContentTranslator.java | 4 +- .../JavaContainerSetDataTranslator.java | 4 +- .../JavaContainerSetSlotTranslator.java | 6 +- .../JavaHorseScreenOpenTranslator.java | 4 +- .../JavaMerchantOffersTranslator.java | 6 +- .../inventory/JavaOpenScreenTranslator.java | 4 +- .../level/JavaBlockDestructionTranslator.java | 4 +- .../level/JavaBlockEntityDataTranslator.java | 4 +- .../java/level/JavaBlockEventTranslator.java | 4 +- .../java/level/JavaBlockUpdateTranslator.java | 8 +-- .../java/level/JavaCustomSoundTranslator.java | 4 +- .../java/level/JavaExplodeTranslator.java | 4 +- .../level/JavaForgetLevelChunkTranslator.java | 4 +- .../java/level/JavaGameEventTranslator.java | 4 +- .../JavaLevelChunkWithLightTranslator.java | 4 +- .../java/level/JavaLevelEventTranslator.java | 4 +- .../level/JavaLevelParticlesTranslator.java | 6 +- .../java/level/JavaMapItemDataTranslator.java | 4 +- .../JavaSectionBlocksUpdateTranslator.java | 4 +- .../JavaSetChunkCacheCenterTranslator.java | 4 +- .../JavaSetChunkCacheRadiusTranslator.java | 4 +- ...JavaSetDefaultSpawnPositionTranslator.java | 4 +- .../java/level/JavaSetTimeTranslator.java | 4 +- .../java/level/JavaSoundTranslator.java | 4 +- .../java/level/JavaStopSoundTranslator.java | 4 +- .../JavaInitializeBorderTranslator.java | 4 +- .../border/JavaSetBorderCenterTranslator.java | 4 +- .../JavaSetBorderLerpSizeTranslator.java | 4 +- .../border/JavaSetBorderSizeTranslator.java | 4 +- .../JavaSetBorderWarningDelayTranslator.java | 4 +- ...avaSetBorderWarningDistanceTranslator.java | 4 +- .../JavaSetDisplayObjectiveTranslator.java | 4 +- .../JavaSetObjectiveTranslator.java | 4 +- .../JavaSetPlayerTeamTranslator.java | 4 +- .../scoreboard/JavaSetScoreTranslator.java | 8 +-- .../java/title/JavaClearTitlesTranslator.java | 4 +- .../title/JavaSetActionBarTextTranslator.java | 4 +- .../title/JavaSetSubtitleTextTranslator.java | 4 +- .../title/JavaSetTitleTextTranslator.java | 4 +- .../JavaSetTitlesAnimationTranslator.java | 4 +- .../BlockSoundInteractionTranslator.java | 6 +- .../EntitySoundInteractionTranslator.java | 4 +- .../sound/SoundInteractionTranslator.java | 4 +- .../BucketSoundInteractionTranslator.java | 4 +- .../ComparatorSoundInteractionTranslator.java | 4 +- .../block/DoorSoundInteractionTranslator.java | 4 +- .../FlintAndSteelInteractionTranslator.java | 4 +- .../block/GrassPathInteractionTranslator.java | 4 +- .../sound/block/HoeInteractionTranslator.java | 4 +- .../LeverSoundInteractionTranslator.java | 4 +- .../FeedBabySoundInteractionTranslator.java | 4 +- .../MilkEntitySoundInteractionTranslator.java | 4 +- .../translator/text/MessageTranslator.java | 6 +- .../geyser/util/BlockEntityUtils.java | 6 +- .../org/geysermc/geyser/util/BlockUtils.java | 14 ++-- .../org/geysermc/geyser/util/ChunkUtils.java | 12 ++-- .../geysermc/geyser/util/CooldownUtils.java | 10 +-- .../geysermc/geyser/util/DimensionUtils.java | 4 +- .../geysermc/geyser/util/InventoryUtils.java | 20 +++--- .../org/geysermc/geyser/util/ItemUtils.java | 4 +- .../geyser/util/LoginEncryptionUtils.java | 16 ++--- .../org/geysermc/geyser/util/NewsHandler.java | 8 +-- .../geyser/util/PluginMessageUtils.java | 4 +- .../geysermc/geyser/util/SettingsUtils.java | 4 +- .../geysermc/geyser/util/StatisticsUtils.java | 4 +- .../util/collection/LecternHasBookMap.java | 4 +- 394 files changed, 1103 insertions(+), 1114 deletions(-) rename api/base/src/main/java/org/geysermc/api/{Api.java => GeyserApi.java} (66%) rename api/{geyser/src/main/java/org/geysermc/geyser/api/session/GeyserSession.java => base/src/main/java/org/geysermc/api/geyser/GeyserConnection.java} (90%) rename api/{geyser/src/main/java/org/geysermc/geyser/api/GeyserApi.java => base/src/main/java/org/geysermc/api/geyser/GeyserExtensionApi.java} (63%) create mode 100644 api/base/src/main/java/org/geysermc/api/geyser/package-info.java rename api/base/src/main/java/org/geysermc/api/session/{Session.java => Connection.java} (82%) rename core/src/main/java/org/geysermc/geyser/session/{GeyserSessionImpl.java => GeyserSession.java} (99%) diff --git a/api/base/src/main/java/org/geysermc/api/Geyser.java b/api/base/src/main/java/org/geysermc/api/Geyser.java index 99f343274..64b4f02b5 100644 --- a/api/base/src/main/java/org/geysermc/api/Geyser.java +++ b/api/base/src/main/java/org/geysermc/api/Geyser.java @@ -32,14 +32,14 @@ import org.checkerframework.checker.nullness.qual.NonNull; */ @NonNull public class Geyser { - private static Api api; + private static GeyserApi api; /** * Returns the base api. * * @return the base api */ - public static Api api() { + public static GeyserApi api() { if (api == null) { throw new RuntimeException("Api has not been registered yet!"); } @@ -47,26 +47,6 @@ public class Geyser { return api; } - /** - * Returns the api of the given type. - * - * @param apiClass the api class - * @param the type - * @return the api of the given type - */ - @SuppressWarnings("unchecked") - public static T api(@NonNull Class apiClass) { - if (apiClass.isInstance(api)) { - return (T) api; - } - - if (api == null) { - throw new RuntimeException("Api has not been registered yet!"); - } else { - throw new RuntimeException("Api was not an instance of " + apiClass + "! Was " + api.getClass().getCanonicalName()); - } - } - /** * Registers the given api type. The api cannot be * registered if {@link #registered()} is true as @@ -74,7 +54,7 @@ public class Geyser { * * @param api the api */ - public static void set(@NonNull Api api) { + public static void set(@NonNull GeyserApi api) { if (Geyser.api != null) { throw new RuntimeException("Cannot redefine already registered api!"); } diff --git a/api/base/src/main/java/org/geysermc/api/Api.java b/api/base/src/main/java/org/geysermc/api/GeyserApi.java similarity index 66% rename from api/base/src/main/java/org/geysermc/api/Api.java rename to api/base/src/main/java/org/geysermc/api/GeyserApi.java index 30d5dc134..fec8cbb3c 100644 --- a/api/base/src/main/java/org/geysermc/api/Api.java +++ b/api/base/src/main/java/org/geysermc/api/GeyserApi.java @@ -27,7 +27,8 @@ package org.geysermc.api; import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; -import org.geysermc.api.session.Session; +import org.geysermc.api.geyser.GeyserExtensionApi; +import org.geysermc.api.session.Connection; import java.util.List; import java.util.UUID; @@ -35,17 +36,16 @@ import java.util.UUID; /** * The base API class. */ -public interface Api { - +public interface GeyserApi { /** - * Gets the session from the given - * UUID, if applicable. + * Gets the session from the given UUID, if applicable. The player must be logged in to the Java server + * for this to return a non-null value. * * @param uuid the UUID of the session * @return the session from the given UUID, if applicable */ @Nullable - Session sessionByUuid(@NonNull UUID uuid); + Connection connectionByUuid(@NonNull UUID uuid); /** * Gets the session from the given @@ -55,7 +55,7 @@ public interface Api { * @return the session from the given UUID, if applicable */ @Nullable - Session sessionByXuid(@NonNull String xuid); + Connection connectionByXuid(@NonNull String xuid); /** * Gets the session from the given @@ -65,7 +65,7 @@ public interface Api { * @return the session from the given name, if applicable */ @Nullable - Session sessionByName(@NonNull String name); + Connection connectionByName(@NonNull String name); /** * Gets all the online sessions. @@ -73,5 +73,28 @@ public interface Api { * @return all the online sessions */ @NonNull - List onlineSessions(); + List onlineConnections(); + + /** + * Returns this as the Geyser extension API, if the platform supports it. + * + * @return the extension API, if this platform supports it. + */ + default GeyserExtensionApi asExtensionApi() { + return null; + } + + /** + * @return the major API version. Bumped whenever a significant breaking change or feature addition is added. + */ + default int majorApiVersion() { + return 0; + } + + /** + * @return the minor API version. May be bumped for new API additions. + */ + default int minorApiVersion() { + return 0; + } } diff --git a/api/geyser/src/main/java/org/geysermc/geyser/api/session/GeyserSession.java b/api/base/src/main/java/org/geysermc/api/geyser/GeyserConnection.java similarity index 90% rename from api/geyser/src/main/java/org/geysermc/geyser/api/session/GeyserSession.java rename to api/base/src/main/java/org/geysermc/api/geyser/GeyserConnection.java index 16f6f5366..5c21fa1de 100644 --- a/api/geyser/src/main/java/org/geysermc/geyser/api/session/GeyserSession.java +++ b/api/base/src/main/java/org/geysermc/api/geyser/GeyserConnection.java @@ -23,12 +23,12 @@ * @link https://github.com/GeyserMC/Geyser */ -package org.geysermc.geyser.api.session; +package org.geysermc.api.geyser; -import org.geysermc.api.session.Session; +import org.geysermc.api.session.Connection; /** * Represents a player session used in Geyser. */ -public interface GeyserSession extends Session { +public interface GeyserConnection extends Connection { } diff --git a/api/geyser/src/main/java/org/geysermc/geyser/api/GeyserApi.java b/api/base/src/main/java/org/geysermc/api/geyser/GeyserExtensionApi.java similarity index 63% rename from api/geyser/src/main/java/org/geysermc/geyser/api/GeyserApi.java rename to api/base/src/main/java/org/geysermc/api/geyser/GeyserExtensionApi.java index 31981914d..2a1266d04 100644 --- a/api/geyser/src/main/java/org/geysermc/geyser/api/GeyserApi.java +++ b/api/base/src/main/java/org/geysermc/api/geyser/GeyserExtensionApi.java @@ -23,23 +23,14 @@ * @link https://github.com/GeyserMC/Geyser */ -package org.geysermc.geyser.api; +package org.geysermc.api.geyser; -import org.checkerframework.checker.nullness.qual.NonNull; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.geysermc.api.Api; -import org.geysermc.api.Geyser; -import org.geysermc.api.session.Session; -import org.geysermc.geyser.api.session.GeyserSession; - -import java.util.List; -import java.util.UUID; +import org.geysermc.api.GeyserApi; /** * Represents the API used in Geyser. */ -public interface GeyserApi extends Api { - +public interface GeyserExtensionApi extends GeyserApi { /** * Shuts down the current Geyser instance. */ @@ -58,36 +49,8 @@ public interface GeyserApi extends Api { */ boolean productionEnvironment(); - /** - * {@inheritDoc} - */ @Override - @Nullable GeyserSession sessionByUuid(@NonNull UUID uuid); - - /** - * {@inheritDoc} - */ - @Override - @Nullable GeyserSession sessionByXuid(@NonNull String xuid); - - /** - * {@inheritDoc} - */ - @Override - @Nullable GeyserSession sessionByName(@NonNull String name); - - /** - * {@inheritDoc} - */ - @NonNull - List onlineSessions(); - - /** - * Gets the {@link GeyserApi}. - * - * @return the Geyser API - */ - static GeyserApi api() { - return Geyser.api(GeyserApi.class); + default GeyserExtensionApi asExtensionApi() { + return this; } } diff --git a/api/base/src/main/java/org/geysermc/api/geyser/package-info.java b/api/base/src/main/java/org/geysermc/api/geyser/package-info.java new file mode 100644 index 000000000..d36f70d6b --- /dev/null +++ b/api/base/src/main/java/org/geysermc/api/geyser/package-info.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2019-2021 GeyserMC. http://geysermc.org + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * @author GeyserMC + * @link https://github.com/GeyserMC/Geyser + */ + +/** + * + */ +package org.geysermc.api.geyser; \ No newline at end of file diff --git a/api/base/src/main/java/org/geysermc/api/session/Session.java b/api/base/src/main/java/org/geysermc/api/session/Connection.java similarity index 82% rename from api/base/src/main/java/org/geysermc/api/session/Session.java rename to api/base/src/main/java/org/geysermc/api/session/Connection.java index 7862f1e70..dc4fb4701 100644 --- a/api/base/src/main/java/org/geysermc/api/session/Session.java +++ b/api/base/src/main/java/org/geysermc/api/session/Connection.java @@ -30,29 +30,30 @@ import org.checkerframework.checker.nullness.qual.NonNull; import java.util.UUID; /** - * Represents a player session. + * Represents a player connection. */ @NonNull -public interface Session { - +public interface Connection { /** - * Gets the name of the session. + * Gets the name of the connection. * - * @return the name of the session + * @return the name of the connection */ String name(); /** - * Gets the {@link UUID} of the session. + * Gets the {@link UUID} of the connection. * - * @return the UUID of the session + * @return the UUID of the connection */ UUID uuid(); /** - * Gets the XUID of the session. + * Gets the XUID of the connection. * - * @return the XUID of the session + * @return the XUID of the connection */ String xuid(); + + } diff --git a/bootstrap/bungeecord/src/main/java/org/geysermc/geyser/platform/bungeecord/command/GeyserBungeeCommandExecutor.java b/bootstrap/bungeecord/src/main/java/org/geysermc/geyser/platform/bungeecord/command/GeyserBungeeCommandExecutor.java index 5b137c61c..f0a05687c 100644 --- a/bootstrap/bungeecord/src/main/java/org/geysermc/geyser/platform/bungeecord/command/GeyserBungeeCommandExecutor.java +++ b/bootstrap/bungeecord/src/main/java/org/geysermc/geyser/platform/bungeecord/command/GeyserBungeeCommandExecutor.java @@ -32,7 +32,7 @@ import net.md_5.bungee.api.plugin.TabExecutor; import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.command.CommandExecutor; import org.geysermc.geyser.command.GeyserCommand; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.text.GeyserLocale; import java.util.Arrays; @@ -50,7 +50,7 @@ public class GeyserBungeeCommandExecutor extends Command implements TabExecutor @Override public void execute(CommandSender sender, String[] args) { BungeeCommandSender commandSender = new BungeeCommandSender(sender); - GeyserSessionImpl session = this.commandExecutor.getGeyserSession(commandSender); + GeyserSession session = this.commandExecutor.getGeyserSession(commandSender); if (args.length > 0) { GeyserCommand command = this.commandExecutor.getCommand(args[0]); diff --git a/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/command/GeyserSpigotCommandExecutor.java b/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/command/GeyserSpigotCommandExecutor.java index b6386dfee..af92091e5 100644 --- a/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/command/GeyserSpigotCommandExecutor.java +++ b/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/command/GeyserSpigotCommandExecutor.java @@ -32,7 +32,7 @@ import org.bukkit.command.TabExecutor; import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.command.CommandExecutor; import org.geysermc.geyser.command.GeyserCommand; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.text.GeyserLocale; import java.util.Arrays; @@ -48,7 +48,7 @@ public class GeyserSpigotCommandExecutor extends CommandExecutor implements TabE @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { SpigotCommandSender commandSender = new SpigotCommandSender(sender); - GeyserSessionImpl session = getGeyserSession(commandSender); + GeyserSession session = getGeyserSession(commandSender); if (args.length > 0) { GeyserCommand geyserCommand = getCommand(args[0]); diff --git a/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/GeyserPistonListener.java b/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/GeyserPistonListener.java index a77afec09..4d504bcf5 100644 --- a/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/GeyserPistonListener.java +++ b/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/GeyserPistonListener.java @@ -41,7 +41,7 @@ import org.bukkit.event.block.BlockPistonEvent; import org.bukkit.event.block.BlockPistonExtendEvent; import org.bukkit.event.block.BlockPistonRetractEvent; import org.geysermc.geyser.GeyserImpl; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.session.cache.PistonCache; import org.geysermc.geyser.level.block.BlockStateValues; import org.geysermc.geyser.translator.level.block.entity.PistonBlockEntity; @@ -88,12 +88,12 @@ public class GeyserPistonListener implements Listener { Object2IntMap attachedBlocks = new Object2IntOpenHashMap<>(); boolean blocksFilled = false; - for (Map.Entry entry : geyser.getSessionManager().getSessions().entrySet()) { + for (Map.Entry entry : geyser.getSessionManager().getSessions().entrySet()) { Player player = Bukkit.getPlayer(entry.getKey()); if (player == null || !player.getWorld().equals(world)) { continue; } - GeyserSessionImpl session = entry.getValue(); + GeyserSession session = entry.getValue(); int dX = Math.abs(location.getBlockX() - player.getLocation().getBlockX()) >> 4; int dZ = Math.abs(location.getBlockZ() - player.getLocation().getBlockZ()) >> 4; diff --git a/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/GeyserSpigot1_11CraftingListener.java b/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/GeyserSpigot1_11CraftingListener.java index 68c6fc413..b6aea9a37 100644 --- a/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/GeyserSpigot1_11CraftingListener.java +++ b/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/GeyserSpigot1_11CraftingListener.java @@ -48,7 +48,7 @@ import org.bukkit.inventory.ShapedRecipe; import org.bukkit.inventory.ShapelessRecipe; import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.network.MinecraftProtocol; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.inventory.item.ItemTranslator; import org.geysermc.geyser.util.InventoryUtils; @@ -79,8 +79,8 @@ public class GeyserSpigot1_11CraftingListener implements Listener { @EventHandler public void onPlayerJoin(PlayerJoinEvent event) { - GeyserSessionImpl session = null; - for (GeyserSessionImpl otherSession : geyser.getSessionManager().getSessions().values()) { + GeyserSession session = null; + for (GeyserSession otherSession : geyser.getSessionManager().getSessions().values()) { if (otherSession.name().equals(event.getPlayer().getName())) { session = otherSession; break; @@ -93,7 +93,7 @@ public class GeyserSpigot1_11CraftingListener implements Listener { sendServerRecipes(session); } - public void sendServerRecipes(GeyserSessionImpl session) { + public void sendServerRecipes(GeyserSession session) { int netId = InventoryUtils.LAST_RECIPE_NET_ID; CraftingDataPacket craftingDataPacket = new CraftingDataPacket(); @@ -161,7 +161,7 @@ public class GeyserSpigot1_11CraftingListener implements Listener { } @SuppressWarnings("deprecation") - private Pair translateToBedrock(GeyserSessionImpl session, org.bukkit.inventory.ItemStack itemStack) { + private Pair translateToBedrock(GeyserSession session, org.bukkit.inventory.ItemStack itemStack) { if (itemStack != null && itemStack.getData() != null) { if (itemStack.getType().getId() == 0) { return new Pair<>(null, ItemData.AIR); diff --git a/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/GeyserSpigotBlockPlaceListener.java b/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/GeyserSpigotBlockPlaceListener.java index 8f0d6e2db..a8fcee3e5 100644 --- a/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/GeyserSpigotBlockPlaceListener.java +++ b/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/GeyserSpigotBlockPlaceListener.java @@ -33,7 +33,7 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.block.BlockPlaceEvent; import org.geysermc.geyser.GeyserImpl; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.level.block.BlockStateValues; import org.geysermc.geyser.registry.BlockRegistries; import org.geysermc.geyser.platform.spigot.world.manager.GeyserSpigotWorldManager; @@ -45,7 +45,7 @@ public class GeyserSpigotBlockPlaceListener implements Listener { @EventHandler public void place(final BlockPlaceEvent event) { - GeyserSessionImpl session = geyser.sessionByUuid(event.getPlayer().getUniqueId()); + GeyserSession session = geyser.connectionByUuid(event.getPlayer().getUniqueId()); if (session == null) { return; } diff --git a/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/manager/GeyserSpigot1_12NativeWorldManager.java b/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/manager/GeyserSpigot1_12NativeWorldManager.java index 12f197f24..ea1fadd0e 100644 --- a/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/manager/GeyserSpigot1_12NativeWorldManager.java +++ b/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/manager/GeyserSpigot1_12NativeWorldManager.java @@ -30,7 +30,7 @@ import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.storage.BlockSto import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.level.block.BlockStateValues; import org.geysermc.geyser.adapters.spigot.SpigotAdapters; import org.geysermc.geyser.adapters.spigot.SpigotWorldAdapter; @@ -48,7 +48,7 @@ public class GeyserSpigot1_12NativeWorldManager extends GeyserSpigot1_12WorldMan } @Override - public int getBlockAt(GeyserSessionImpl session, int x, int y, int z) { + public int getBlockAt(GeyserSession session, int x, int y, int z) { Player player = Bukkit.getPlayer(session.getPlayerEntity().getUsername()); if (player == null) { return BlockStateValues.JAVA_AIR_ID; diff --git a/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/manager/GeyserSpigot1_12WorldManager.java b/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/manager/GeyserSpigot1_12WorldManager.java index b1072b847..f12968b1f 100644 --- a/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/manager/GeyserSpigot1_12WorldManager.java +++ b/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/manager/GeyserSpigot1_12WorldManager.java @@ -36,7 +36,7 @@ import org.bukkit.Bukkit; import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.level.block.BlockStateValues; import java.util.List; @@ -66,7 +66,7 @@ public class GeyserSpigot1_12WorldManager extends GeyserSpigotWorldManager { } @Override - public int getBlockAt(GeyserSessionImpl session, int x, int y, int z) { + public int getBlockAt(GeyserSession session, int x, int y, int z) { Player player = Bukkit.getPlayer(session.getPlayerEntity().getUsername()); if (player == null) { return BlockStateValues.JAVA_AIR_ID; diff --git a/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/manager/GeyserSpigotFallbackWorldManager.java b/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/manager/GeyserSpigotFallbackWorldManager.java index f3071ecdd..1aacb73e7 100644 --- a/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/manager/GeyserSpigotFallbackWorldManager.java +++ b/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/manager/GeyserSpigotFallbackWorldManager.java @@ -26,11 +26,11 @@ package org.geysermc.geyser.platform.spigot.world.manager; import org.bukkit.plugin.Plugin; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.level.block.BlockStateValues; /** - * Should only be used when we know {@link GeyserSpigotWorldManager#getBlockAt(GeyserSessionImpl, int, int, int)} + * Should only be used when we know {@link GeyserSpigotWorldManager#getBlockAt(GeyserSession, int, int, int)} * cannot be accurate. Typically, this is when ViaVersion is not installed but a client still manages to connect. * If this occurs to you somehow, please let us know!! */ @@ -40,7 +40,7 @@ public class GeyserSpigotFallbackWorldManager extends GeyserSpigotWorldManager { } @Override - public int getBlockAt(GeyserSessionImpl session, int x, int y, int z) { + public int getBlockAt(GeyserSession session, int x, int y, int z) { return BlockStateValues.JAVA_AIR_ID; } diff --git a/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/manager/GeyserSpigotLegacyNativeWorldManager.java b/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/manager/GeyserSpigotLegacyNativeWorldManager.java index 242d7ea23..caeb257f7 100644 --- a/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/manager/GeyserSpigotLegacyNativeWorldManager.java +++ b/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/manager/GeyserSpigotLegacyNativeWorldManager.java @@ -33,7 +33,7 @@ import it.unimi.dsi.fastutil.ints.Int2IntMap; import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap; import it.unimi.dsi.fastutil.ints.IntList; import org.geysermc.geyser.network.MinecraftProtocol; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.platform.spigot.GeyserSpigotPlugin; import java.util.List; @@ -66,7 +66,7 @@ public class GeyserSpigotLegacyNativeWorldManager extends GeyserSpigotNativeWorl } @Override - public int getBlockAt(GeyserSessionImpl session, int x, int y, int z) { + public int getBlockAt(GeyserSession session, int x, int y, int z) { int nativeBlockId = super.getBlockAt(session, x, y, z); return oldToNewBlockId.getOrDefault(nativeBlockId, nativeBlockId); } diff --git a/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/manager/GeyserSpigotNativeWorldManager.java b/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/manager/GeyserSpigotNativeWorldManager.java index 0c3e21c01..b1032671a 100644 --- a/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/manager/GeyserSpigotNativeWorldManager.java +++ b/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/manager/GeyserSpigotNativeWorldManager.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.platform.spigot.world.manager; import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.level.block.BlockStateValues; import org.geysermc.geyser.adapters.spigot.SpigotAdapters; import org.geysermc.geyser.adapters.spigot.SpigotWorldAdapter; @@ -42,7 +42,7 @@ public class GeyserSpigotNativeWorldManager extends GeyserSpigotWorldManager { } @Override - public int getBlockAt(GeyserSessionImpl session, int x, int y, int z) { + public int getBlockAt(GeyserSession session, int x, int y, int z) { Player player = Bukkit.getPlayer(session.getPlayerEntity().getUsername()); if (player == null) { return BlockStateValues.JAVA_AIR_ID; diff --git a/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/manager/GeyserSpigotWorldManager.java b/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/manager/GeyserSpigotWorldManager.java index 35eb292a6..8972b0ac6 100644 --- a/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/manager/GeyserSpigotWorldManager.java +++ b/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/manager/GeyserSpigotWorldManager.java @@ -39,7 +39,7 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.BookMeta; import org.bukkit.plugin.Plugin; import org.geysermc.geyser.network.MinecraftProtocol; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.inventory.LecternInventoryTranslator; import org.geysermc.geyser.level.GeyserWorldManager; import org.geysermc.geyser.level.block.BlockStateValues; @@ -66,7 +66,7 @@ public class GeyserSpigotWorldManager extends GeyserWorldManager { } @Override - public int getBlockAt(GeyserSessionImpl session, int x, int y, int z) { + public int getBlockAt(GeyserSession session, int x, int y, int z) { Player bukkitPlayer; if ((bukkitPlayer = Bukkit.getPlayer(session.getPlayerEntity().getUsername())) == null) { return BlockStateValues.JAVA_AIR_ID; @@ -90,7 +90,7 @@ public class GeyserSpigotWorldManager extends GeyserWorldManager { } @Override - public NbtMap getLecternDataAt(GeyserSessionImpl session, int x, int y, int z, boolean isChunkLoad) { + public NbtMap getLecternDataAt(GeyserSession session, int x, int y, int z, boolean isChunkLoad) { // Run as a task to prevent async issues Runnable lecternInfoGet = () -> { Player bukkitPlayer; @@ -158,7 +158,7 @@ public class GeyserSpigotWorldManager extends GeyserWorldManager { return true; } - public Boolean getGameRuleBool(GeyserSessionImpl session, GameRule gameRule) { + public Boolean getGameRuleBool(GeyserSession session, GameRule gameRule) { String value = Bukkit.getPlayer(session.getPlayerEntity().getUsername()).getWorld().getGameRuleValue(gameRule.getJavaID()); if (!value.isEmpty()) { return Boolean.parseBoolean(value); @@ -167,7 +167,7 @@ public class GeyserSpigotWorldManager extends GeyserWorldManager { } @Override - public int getGameRuleInt(GeyserSessionImpl session, GameRule gameRule) { + public int getGameRuleInt(GeyserSession session, GameRule gameRule) { String value = Bukkit.getPlayer(session.getPlayerEntity().getUsername()).getWorld().getGameRuleValue(gameRule.getJavaID()); if (!value.isEmpty()) { return Integer.parseInt(value); @@ -176,7 +176,7 @@ public class GeyserSpigotWorldManager extends GeyserWorldManager { } @Override - public boolean hasPermission(GeyserSessionImpl session, String permission) { + public boolean hasPermission(GeyserSession session, String permission) { return Bukkit.getPlayer(session.getPlayerEntity().getUsername()).hasPermission(permission); } diff --git a/bootstrap/sponge/src/main/java/org/geysermc/geyser/platform/sponge/command/GeyserSpongeCommandExecutor.java b/bootstrap/sponge/src/main/java/org/geysermc/geyser/platform/sponge/command/GeyserSpongeCommandExecutor.java index 6fbd3e219..5b8496680 100644 --- a/bootstrap/sponge/src/main/java/org/geysermc/geyser/platform/sponge/command/GeyserSpongeCommandExecutor.java +++ b/bootstrap/sponge/src/main/java/org/geysermc/geyser/platform/sponge/command/GeyserSpongeCommandExecutor.java @@ -30,7 +30,7 @@ import org.geysermc.geyser.command.CommandExecutor; import org.geysermc.geyser.command.CommandSender; import org.geysermc.geyser.command.GeyserCommand; import org.geysermc.geyser.text.ChatColor; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.text.GeyserLocale; import org.spongepowered.api.command.CommandCallable; import org.spongepowered.api.command.CommandResult; @@ -54,7 +54,7 @@ public class GeyserSpongeCommandExecutor extends CommandExecutor implements Comm @Override public CommandResult process(CommandSource source, String arguments) { CommandSender commandSender = new SpongeCommandSender(source); - GeyserSessionImpl session = getGeyserSession(commandSender); + GeyserSession session = getGeyserSession(commandSender); String[] args = arguments.split(" "); if (args.length > 0) { diff --git a/bootstrap/standalone/src/main/java/org/geysermc/geyser/platform/standalone/gui/GeyserStandaloneGUI.java b/bootstrap/standalone/src/main/java/org/geysermc/geyser/platform/standalone/gui/GeyserStandaloneGUI.java index e0d957d4f..56d211986 100644 --- a/bootstrap/standalone/src/main/java/org/geysermc/geyser/platform/standalone/gui/GeyserStandaloneGUI.java +++ b/bootstrap/standalone/src/main/java/org/geysermc/geyser/platform/standalone/gui/GeyserStandaloneGUI.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.platform.standalone.gui; import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.command.GeyserCommand; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.text.GeyserLocale; import org.geysermc.geyser.platform.standalone.GeyserStandaloneLogger; import org.geysermc.geyser.platform.standalone.command.GeyserCommandManager; @@ -306,7 +306,7 @@ public class GeyserStandaloneGUI { // Update player table playerTableModel.getDataVector().removeAllElements(); - for (GeyserSessionImpl player : GeyserImpl.getInstance().getSessionManager().getSessions().values()) { + for (GeyserSession player : GeyserImpl.getInstance().getSessionManager().getSessions().values()) { Vector row = new Vector<>(); row.add(player.getSocketAddress().getHostName()); row.add(player.getPlayerEntity().getUsername()); diff --git a/bootstrap/velocity/src/main/java/org/geysermc/geyser/platform/velocity/command/GeyserVelocityCommandExecutor.java b/bootstrap/velocity/src/main/java/org/geysermc/geyser/platform/velocity/command/GeyserVelocityCommandExecutor.java index ecc9641c9..1034d6062 100644 --- a/bootstrap/velocity/src/main/java/org/geysermc/geyser/platform/velocity/command/GeyserVelocityCommandExecutor.java +++ b/bootstrap/velocity/src/main/java/org/geysermc/geyser/platform/velocity/command/GeyserVelocityCommandExecutor.java @@ -31,7 +31,7 @@ import org.geysermc.geyser.command.CommandExecutor; import org.geysermc.geyser.command.CommandSender; import org.geysermc.geyser.command.GeyserCommand; import org.geysermc.geyser.text.ChatColor; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.text.GeyserLocale; import java.util.Arrays; @@ -47,7 +47,7 @@ public class GeyserVelocityCommandExecutor extends CommandExecutor implements Si @Override public void execute(Invocation invocation) { CommandSender sender = new VelocityCommandSender(invocation.source()); - GeyserSessionImpl session = getGeyserSession(sender); + GeyserSession session = getGeyserSession(sender); if (invocation.arguments().length > 0) { GeyserCommand command = getCommand(invocation.arguments()[0]); diff --git a/core/src/main/java/org/geysermc/connector/GeyserConnector.java b/core/src/main/java/org/geysermc/connector/GeyserConnector.java index d2d493ecf..8a1103834 100644 --- a/core/src/main/java/org/geysermc/connector/GeyserConnector.java +++ b/core/src/main/java/org/geysermc/connector/GeyserConnector.java @@ -73,11 +73,11 @@ public class GeyserConnector { } public GeyserSession getPlayerByXuid(String xuid) { - return new GeyserSession(GeyserImpl.getInstance().sessionByXuid(xuid)); + return new GeyserSession(GeyserImpl.getInstance().connectionByXuid(xuid)); } public GeyserSession getPlayerByUuid(UUID uuid) { - return new GeyserSession(GeyserImpl.getInstance().sessionByUuid(uuid)); + return new GeyserSession(GeyserImpl.getInstance().connectionByUuid(uuid)); } public boolean isProductionEnvironment() { diff --git a/core/src/main/java/org/geysermc/connector/network/session/GeyserSession.java b/core/src/main/java/org/geysermc/connector/network/session/GeyserSession.java index 27c0ce5e0..05f9de722 100644 --- a/core/src/main/java/org/geysermc/connector/network/session/GeyserSession.java +++ b/core/src/main/java/org/geysermc/connector/network/session/GeyserSession.java @@ -28,7 +28,6 @@ package org.geysermc.connector.network.session; import com.github.steveice10.packetlib.packet.Packet; import com.nukkitx.protocol.bedrock.BedrockPacket; import org.geysermc.connector.network.session.auth.AuthData; -import org.geysermc.geyser.session.GeyserSessionImpl; /** * Deprecated, legacy code. Serves as a wrapper around @@ -38,9 +37,9 @@ import org.geysermc.geyser.session.GeyserSessionImpl; */ @Deprecated public class GeyserSession { - private final GeyserSessionImpl handle; + private final org.geysermc.geyser.session.GeyserSession handle; - public GeyserSession(GeyserSessionImpl handle) { + public GeyserSession(org.geysermc.geyser.session.GeyserSession handle) { this.handle = handle; } diff --git a/core/src/main/java/org/geysermc/geyser/GeyserImpl.java b/core/src/main/java/org/geysermc/geyser/GeyserImpl.java index a12a1c6d0..2e30a123a 100644 --- a/core/src/main/java/org/geysermc/geyser/GeyserImpl.java +++ b/core/src/main/java/org/geysermc/geyser/GeyserImpl.java @@ -41,35 +41,33 @@ import lombok.Getter; import lombok.Setter; import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; -import org.geysermc.common.PlatformType; import org.geysermc.api.Geyser; -import org.geysermc.geyser.api.GeyserApi; -import org.geysermc.geyser.api.session.GeyserSession; -import org.geysermc.geyser.command.CommandManager; -import org.geysermc.geyser.session.auth.AuthType; -import org.geysermc.geyser.configuration.GeyserConfiguration; -import org.geysermc.geyser.entity.EntityDefinitions; -import org.geysermc.geyser.pack.ResourcePack; -import org.geysermc.geyser.session.SessionManager; -import org.geysermc.geyser.text.GeyserLocale; -import org.geysermc.geyser.text.MinecraftLocale; -import org.geysermc.geyser.util.Metrics; -import org.geysermc.geyser.network.ConnectorServerEventHandler; -import org.geysermc.geyser.session.GeyserSessionImpl; -import org.geysermc.geyser.translator.text.MessageTranslator; -import org.geysermc.geyser.translator.inventory.item.ItemTranslator; -import org.geysermc.geyser.level.WorldManager; -import org.geysermc.geyser.registry.BlockRegistries; -import org.geysermc.geyser.registry.Registries; -import org.geysermc.geyser.scoreboard.ScoreboardUpdater; -import org.geysermc.geyser.skin.FloodgateSkinUploader; -import org.geysermc.geyser.util.*; +import org.geysermc.api.geyser.GeyserExtensionApi; +import org.geysermc.common.PlatformType; import org.geysermc.floodgate.crypto.AesCipher; import org.geysermc.floodgate.crypto.AesKeyProducer; import org.geysermc.floodgate.crypto.Base64Topping; import org.geysermc.floodgate.crypto.FloodgateCipher; import org.geysermc.floodgate.news.NewsItemAction; import org.geysermc.floodgate.time.TimeSyncer; +import org.geysermc.geyser.command.CommandManager; +import org.geysermc.geyser.configuration.GeyserConfiguration; +import org.geysermc.geyser.entity.EntityDefinitions; +import org.geysermc.geyser.level.WorldManager; +import org.geysermc.geyser.network.ConnectorServerEventHandler; +import org.geysermc.geyser.pack.ResourcePack; +import org.geysermc.geyser.registry.BlockRegistries; +import org.geysermc.geyser.registry.Registries; +import org.geysermc.geyser.scoreboard.ScoreboardUpdater; +import org.geysermc.geyser.session.GeyserSession; +import org.geysermc.geyser.session.SessionManager; +import org.geysermc.geyser.session.auth.AuthType; +import org.geysermc.geyser.skin.FloodgateSkinUploader; +import org.geysermc.geyser.text.GeyserLocale; +import org.geysermc.geyser.text.MinecraftLocale; +import org.geysermc.geyser.translator.inventory.item.ItemTranslator; +import org.geysermc.geyser.translator.text.MessageTranslator; +import org.geysermc.geyser.util.*; import javax.naming.directory.Attribute; import javax.naming.directory.InitialDirContext; @@ -78,18 +76,14 @@ import java.net.InetSocketAddress; import java.net.UnknownHostException; import java.security.Key; import java.text.DecimalFormat; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.UUID; +import java.util.*; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.regex.Matcher; import java.util.regex.Pattern; @Getter -public class GeyserImpl implements GeyserApi { +public class GeyserImpl implements GeyserExtensionApi { public static final ObjectMapper JSON_MAPPER = new ObjectMapper() .enable(JsonParser.Feature.IGNORE_UNDEFINED) .enable(JsonParser.Feature.ALLOW_COMMENTS) @@ -297,7 +291,7 @@ public class GeyserImpl implements GeyserApi { metrics.addCustomChart(new Metrics.SimplePie("version", () -> GeyserImpl.VERSION)); metrics.addCustomChart(new Metrics.AdvancedPie("playerPlatform", () -> { Map valueMap = new HashMap<>(); - for (GeyserSessionImpl session : sessionManager.getAllSessions()) { + for (GeyserSession session : sessionManager.getAllSessions()) { if (session == null) continue; if (session.getClientData() == null) continue; String os = session.getClientData().getDeviceOs().toString(); @@ -311,7 +305,7 @@ public class GeyserImpl implements GeyserApi { })); metrics.addCustomChart(new Metrics.AdvancedPie("playerVersion", () -> { Map valueMap = new HashMap<>(); - for (GeyserSessionImpl session : sessionManager.getAllSessions()) { + for (GeyserSession session : sessionManager.getAllSessions()) { if (session == null) continue; if (session.getClientData() == null) continue; String version = session.getClientData().getGameVersion(); @@ -403,8 +397,8 @@ public class GeyserImpl implements GeyserApi { } @Override - public @Nullable GeyserSessionImpl sessionByName(@NonNull String name) { - for (GeyserSessionImpl session : sessionManager.getAllSessions()) { + public @Nullable GeyserSession connectionByName(@NonNull String name) { + for (GeyserSession session : sessionManager.getAllSessions()) { if (session.name().equals(name) || session.getProtocol().getProfile().getName().equals(name)) { return session; } @@ -414,18 +408,18 @@ public class GeyserImpl implements GeyserApi { } @Override - public @NonNull List onlineSessions() { + public @NonNull List onlineConnections() { return this.sessionManager.getAllSessions(); } @Override - public @Nullable GeyserSessionImpl sessionByUuid(@NonNull UUID uuid) { + public @Nullable GeyserSession connectionByUuid(@NonNull UUID uuid) { return this.sessionManager.getSessions().get(uuid); } @Override - public @Nullable GeyserSessionImpl sessionByXuid(@NonNull String xuid) { - for (GeyserSessionImpl session : sessionManager.getAllSessions()) { + public @Nullable GeyserSession connectionByXuid(@NonNull String xuid) { + for (GeyserSession session : sessionManager.getAllSessions()) { if (session.xuid().equals(xuid)) { return session; } diff --git a/core/src/main/java/org/geysermc/geyser/command/CommandExecutor.java b/core/src/main/java/org/geysermc/geyser/command/CommandExecutor.java index c30a1df56..a2f3441f4 100644 --- a/core/src/main/java/org/geysermc/geyser/command/CommandExecutor.java +++ b/core/src/main/java/org/geysermc/geyser/command/CommandExecutor.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.command; import lombok.AllArgsConstructor; import org.geysermc.geyser.GeyserImpl; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import javax.annotation.Nullable; import java.util.ArrayList; @@ -48,12 +48,12 @@ public class CommandExecutor { } @Nullable - public GeyserSessionImpl getGeyserSession(CommandSender sender) { + public GeyserSession getGeyserSession(CommandSender sender) { if (sender.isConsole()) { return null; } - for (GeyserSessionImpl session : geyser.getSessionManager().getSessions().values()) { + for (GeyserSession session : geyser.getSessionManager().getSessions().values()) { if (sender.name().equals(session.getPlayerEntity().getUsername())) { return session; } diff --git a/core/src/main/java/org/geysermc/geyser/command/CommandManager.java b/core/src/main/java/org/geysermc/geyser/command/CommandManager.java index 791ddd548..19b521ed6 100644 --- a/core/src/main/java/org/geysermc/geyser/command/CommandManager.java +++ b/core/src/main/java/org/geysermc/geyser/command/CommandManager.java @@ -30,7 +30,7 @@ import lombok.Getter; import org.geysermc.common.PlatformType; import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.command.defaults.*; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.text.GeyserLocale; import java.util.*; @@ -93,8 +93,8 @@ public abstract class CommandManager { return; } - if (sender instanceof GeyserSessionImpl) { - cmd.execute((GeyserSessionImpl) sender, sender, args); + if (sender instanceof GeyserSession) { + cmd.execute((GeyserSession) sender, sender, args); } else { if (!cmd.isBedrockOnly()) { cmd.execute(null, sender, args); diff --git a/core/src/main/java/org/geysermc/geyser/command/GeyserCommand.java b/core/src/main/java/org/geysermc/geyser/command/GeyserCommand.java index 593c17fe8..6971ad44d 100644 --- a/core/src/main/java/org/geysermc/geyser/command/GeyserCommand.java +++ b/core/src/main/java/org/geysermc/geyser/command/GeyserCommand.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.command; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.Setter; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import javax.annotation.Nullable; import java.util.ArrayList; @@ -49,7 +49,7 @@ public abstract class GeyserCommand { @Setter private List aliases = new ArrayList<>(); - public abstract void execute(@Nullable GeyserSessionImpl session, CommandSender sender, String[] args); + public abstract void execute(@Nullable GeyserSession session, CommandSender sender, String[] args); /** * If false, hides the command from being shown on the Geyser Standalone GUI. diff --git a/core/src/main/java/org/geysermc/geyser/command/defaults/AdvancementsCommand.java b/core/src/main/java/org/geysermc/geyser/command/defaults/AdvancementsCommand.java index e9da5a2a0..41bb8e6cd 100644 --- a/core/src/main/java/org/geysermc/geyser/command/defaults/AdvancementsCommand.java +++ b/core/src/main/java/org/geysermc/geyser/command/defaults/AdvancementsCommand.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.command.defaults; import org.geysermc.geyser.command.CommandSender; import org.geysermc.geyser.command.GeyserCommand; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; public class AdvancementsCommand extends GeyserCommand { public AdvancementsCommand(String name, String description, String permission) { @@ -35,7 +35,7 @@ public class AdvancementsCommand extends GeyserCommand { } @Override - public void execute(GeyserSessionImpl session, CommandSender sender, String[] args) { + public void execute(GeyserSession session, CommandSender sender, String[] args) { if (session != null) { session.getAdvancementsCache().buildAndShowMenuForm(); } diff --git a/core/src/main/java/org/geysermc/geyser/command/defaults/DumpCommand.java b/core/src/main/java/org/geysermc/geyser/command/defaults/DumpCommand.java index 24ff41a60..1b69f48fb 100644 --- a/core/src/main/java/org/geysermc/geyser/command/defaults/DumpCommand.java +++ b/core/src/main/java/org/geysermc/geyser/command/defaults/DumpCommand.java @@ -36,7 +36,7 @@ import org.geysermc.geyser.command.GeyserCommand; import org.geysermc.geyser.text.ChatColor; import org.geysermc.geyser.text.AsteriskSerializer; import org.geysermc.geyser.dump.DumpInfo; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.text.GeyserLocale; import org.geysermc.geyser.util.WebUtils; @@ -58,7 +58,7 @@ public class DumpCommand extends GeyserCommand { } @Override - public void execute(GeyserSessionImpl session, CommandSender sender, String[] args) { + public void execute(GeyserSession session, CommandSender sender, String[] args) { // Only allow the console to create dumps on Geyser Standalone if (!sender.isConsole() && geyser.getPlatformType() == PlatformType.STANDALONE) { sender.sendMessage(GeyserLocale.getPlayerLocaleString("geyser.bootstrap.command.permission_fail", sender.getLocale())); diff --git a/core/src/main/java/org/geysermc/geyser/command/defaults/HelpCommand.java b/core/src/main/java/org/geysermc/geyser/command/defaults/HelpCommand.java index 8ca115007..4d4a21319 100644 --- a/core/src/main/java/org/geysermc/geyser/command/defaults/HelpCommand.java +++ b/core/src/main/java/org/geysermc/geyser/command/defaults/HelpCommand.java @@ -29,7 +29,7 @@ import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.command.CommandSender; import org.geysermc.geyser.command.GeyserCommand; import org.geysermc.geyser.text.ChatColor; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.text.GeyserLocale; import java.util.Collections; @@ -53,7 +53,7 @@ public class HelpCommand extends GeyserCommand { * @param args Not used. */ @Override - public void execute(GeyserSessionImpl session, CommandSender sender, String[] args) { + public void execute(GeyserSession session, CommandSender sender, String[] args) { int page = 1; int maxPage = 1; String header = GeyserLocale.getPlayerLocaleString("geyser.commands.help.header", sender.getLocale(), page, maxPage); diff --git a/core/src/main/java/org/geysermc/geyser/command/defaults/ListCommand.java b/core/src/main/java/org/geysermc/geyser/command/defaults/ListCommand.java index a5a5df000..3ff648570 100644 --- a/core/src/main/java/org/geysermc/geyser/command/defaults/ListCommand.java +++ b/core/src/main/java/org/geysermc/geyser/command/defaults/ListCommand.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.command.defaults; import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.command.CommandSender; import org.geysermc.geyser.command.GeyserCommand; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.text.GeyserLocale; import java.util.stream.Collectors; @@ -44,10 +44,10 @@ public class ListCommand extends GeyserCommand { } @Override - public void execute(GeyserSessionImpl session, CommandSender sender, String[] args) { + public void execute(GeyserSession session, CommandSender sender, String[] args) { String message = GeyserLocale.getPlayerLocaleString("geyser.commands.list.message", sender.getLocale(), geyser.getSessionManager().size(), - geyser.getSessionManager().getAllSessions().stream().map(GeyserSessionImpl::name).collect(Collectors.joining(" "))); + geyser.getSessionManager().getAllSessions().stream().map(GeyserSession::name).collect(Collectors.joining(" "))); sender.sendMessage(message); } diff --git a/core/src/main/java/org/geysermc/geyser/command/defaults/OffhandCommand.java b/core/src/main/java/org/geysermc/geyser/command/defaults/OffhandCommand.java index 24a8c8f22..934cd8c87 100644 --- a/core/src/main/java/org/geysermc/geyser/command/defaults/OffhandCommand.java +++ b/core/src/main/java/org/geysermc/geyser/command/defaults/OffhandCommand.java @@ -31,7 +31,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.serverbound.player.Server import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.command.CommandSender; import org.geysermc.geyser.command.GeyserCommand; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.util.BlockUtils; public class OffhandCommand extends GeyserCommand { @@ -41,7 +41,7 @@ public class OffhandCommand extends GeyserCommand { } @Override - public void execute(GeyserSessionImpl session, CommandSender sender, String[] args) { + public void execute(GeyserSession session, CommandSender sender, String[] args) { if (session == null) { return; } diff --git a/core/src/main/java/org/geysermc/geyser/command/defaults/ReloadCommand.java b/core/src/main/java/org/geysermc/geyser/command/defaults/ReloadCommand.java index 9ea44577b..1a72e1734 100644 --- a/core/src/main/java/org/geysermc/geyser/command/defaults/ReloadCommand.java +++ b/core/src/main/java/org/geysermc/geyser/command/defaults/ReloadCommand.java @@ -29,7 +29,7 @@ import org.geysermc.common.PlatformType; import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.command.CommandSender; import org.geysermc.geyser.command.GeyserCommand; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.text.GeyserLocale; public class ReloadCommand extends GeyserCommand { @@ -42,7 +42,7 @@ public class ReloadCommand extends GeyserCommand { } @Override - public void execute(GeyserSessionImpl session, CommandSender sender, String[] args) { + public void execute(GeyserSession session, CommandSender sender, String[] args) { if (!sender.isConsole() && geyser.getPlatformType() == PlatformType.STANDALONE) { return; } diff --git a/core/src/main/java/org/geysermc/geyser/command/defaults/SettingsCommand.java b/core/src/main/java/org/geysermc/geyser/command/defaults/SettingsCommand.java index fd9460255..349f7288b 100644 --- a/core/src/main/java/org/geysermc/geyser/command/defaults/SettingsCommand.java +++ b/core/src/main/java/org/geysermc/geyser/command/defaults/SettingsCommand.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.command.defaults; import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.command.CommandSender; import org.geysermc.geyser.command.GeyserCommand; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.util.SettingsUtils; public class SettingsCommand extends GeyserCommand { @@ -37,7 +37,7 @@ public class SettingsCommand extends GeyserCommand { } @Override - public void execute(GeyserSessionImpl session, CommandSender sender, String[] args) { + public void execute(GeyserSession session, CommandSender sender, String[] args) { if (session != null) { session.sendForm(SettingsUtils.buildForm(session)); } diff --git a/core/src/main/java/org/geysermc/geyser/command/defaults/StatisticsCommand.java b/core/src/main/java/org/geysermc/geyser/command/defaults/StatisticsCommand.java index 39cbfce7e..c570770b7 100644 --- a/core/src/main/java/org/geysermc/geyser/command/defaults/StatisticsCommand.java +++ b/core/src/main/java/org/geysermc/geyser/command/defaults/StatisticsCommand.java @@ -30,7 +30,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.serverbound.ServerboundCl import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.command.CommandSender; import org.geysermc.geyser.command.GeyserCommand; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; public class StatisticsCommand extends GeyserCommand { @@ -39,7 +39,7 @@ public class StatisticsCommand extends GeyserCommand { } @Override - public void execute(GeyserSessionImpl session, CommandSender sender, String[] args) { + public void execute(GeyserSession session, CommandSender sender, String[] args) { if (session == null) return; session.setWaitingForStatistics(true); diff --git a/core/src/main/java/org/geysermc/geyser/command/defaults/StopCommand.java b/core/src/main/java/org/geysermc/geyser/command/defaults/StopCommand.java index 6ef26f121..6b74f9c8b 100644 --- a/core/src/main/java/org/geysermc/geyser/command/defaults/StopCommand.java +++ b/core/src/main/java/org/geysermc/geyser/command/defaults/StopCommand.java @@ -29,7 +29,7 @@ import org.geysermc.common.PlatformType; import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.command.CommandSender; import org.geysermc.geyser.command.GeyserCommand; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.text.GeyserLocale; import java.util.Collections; @@ -46,7 +46,7 @@ public class StopCommand extends GeyserCommand { } @Override - public void execute(GeyserSessionImpl session, CommandSender sender, String[] args) { + public void execute(GeyserSession session, CommandSender sender, String[] args) { if (!sender.isConsole() && geyser.getPlatformType() == PlatformType.STANDALONE) { sender.sendMessage(GeyserLocale.getPlayerLocaleString("geyser.bootstrap.command.permission_fail", sender.getLocale())); return; diff --git a/core/src/main/java/org/geysermc/geyser/command/defaults/VersionCommand.java b/core/src/main/java/org/geysermc/geyser/command/defaults/VersionCommand.java index 164ddea92..706395d5d 100644 --- a/core/src/main/java/org/geysermc/geyser/command/defaults/VersionCommand.java +++ b/core/src/main/java/org/geysermc/geyser/command/defaults/VersionCommand.java @@ -32,7 +32,7 @@ import org.geysermc.geyser.command.CommandSender; import org.geysermc.geyser.command.GeyserCommand; import org.geysermc.geyser.text.ChatColor; import org.geysermc.geyser.network.MinecraftProtocol; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.util.FileUtils; import org.geysermc.geyser.text.GeyserLocale; import org.geysermc.geyser.util.WebUtils; @@ -54,7 +54,7 @@ public class VersionCommand extends GeyserCommand { } @Override - public void execute(GeyserSessionImpl session, CommandSender sender, String[] args) { + public void execute(GeyserSession session, CommandSender sender, String[] args) { String bedrockVersions; List supportedCodecs = MinecraftProtocol.SUPPORTED_BEDROCK_CODECS; if (supportedCodecs.size() > 1) { diff --git a/core/src/main/java/org/geysermc/geyser/dump/DumpInfo.java b/core/src/main/java/org/geysermc/geyser/dump/DumpInfo.java index b4c1f7f6b..5a77b84fb 100644 --- a/core/src/main/java/org/geysermc/geyser/dump/DumpInfo.java +++ b/core/src/main/java/org/geysermc/geyser/dump/DumpInfo.java @@ -39,7 +39,7 @@ import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.text.AsteriskSerializer; import org.geysermc.geyser.configuration.GeyserConfiguration; import org.geysermc.geyser.network.MinecraftProtocol; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.util.FileUtils; import org.geysermc.geyser.util.WebUtils; import org.geysermc.floodgate.util.DeviceOs; @@ -113,7 +113,7 @@ public class DumpInfo { } this.userPlatforms = new Object2IntOpenHashMap<>(); - for (GeyserSessionImpl session : GeyserImpl.getInstance().getSessionManager().getAllSessions()) { + for (GeyserSession session : GeyserImpl.getInstance().getSessionManager().getAllSessions()) { DeviceOs device = session.getClientData().getDeviceOs(); userPlatforms.put(device, userPlatforms.getOrDefault(device, 0) + 1); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/InteractiveTagManager.java b/core/src/main/java/org/geysermc/geyser/entity/InteractiveTagManager.java index 132194711..b51f83f2c 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/InteractiveTagManager.java +++ b/core/src/main/java/org/geysermc/geyser/entity/InteractiveTagManager.java @@ -36,7 +36,7 @@ import org.geysermc.geyser.entity.type.living.animal.horse.HorseEntity; import org.geysermc.geyser.entity.type.living.animal.tameable.CatEntity; import org.geysermc.geyser.entity.type.living.animal.tameable.WolfEntity; import org.geysermc.geyser.entity.type.living.merchant.VillagerEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.type.ItemMapping; import java.util.EnumSet; @@ -62,7 +62,7 @@ public class InteractiveTagManager { * @param session the Bedrock client session * @param interactEntity the entity that the client is currently facing. */ - public static void updateTag(GeyserSessionImpl session, Entity interactEntity) { + public static void updateTag(GeyserSession session, Entity interactEntity) { ItemMapping mapping = session.getPlayerInventory().getItemInHand().getMapping(session); String javaIdentifierStripped = mapping.getJavaIdentifier().replace("minecraft:", ""); EntityType entityType = interactEntity.getDefinition().entityType(); diff --git a/core/src/main/java/org/geysermc/geyser/entity/factory/BaseEntityFactory.java b/core/src/main/java/org/geysermc/geyser/entity/factory/BaseEntityFactory.java index 13a3140f2..dff1617f9 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/factory/BaseEntityFactory.java +++ b/core/src/main/java/org/geysermc/geyser/entity/factory/BaseEntityFactory.java @@ -28,12 +28,12 @@ package org.geysermc.geyser.entity.factory; import com.nukkitx.math.vector.Vector3f; import org.geysermc.geyser.entity.type.Entity; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; @FunctionalInterface public interface BaseEntityFactory extends EntityFactory { - T create(GeyserSessionImpl session, long javaId, long bedrockId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw); + T create(GeyserSession session, long javaId, long bedrockId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/factory/ExperienceOrbEntityFactory.java b/core/src/main/java/org/geysermc/geyser/entity/factory/ExperienceOrbEntityFactory.java index 1c8800172..40a93c08b 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/factory/ExperienceOrbEntityFactory.java +++ b/core/src/main/java/org/geysermc/geyser/entity/factory/ExperienceOrbEntityFactory.java @@ -27,10 +27,10 @@ package org.geysermc.geyser.entity.factory; import com.nukkitx.math.vector.Vector3f; import org.geysermc.geyser.entity.type.ExpOrbEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; @FunctionalInterface public interface ExperienceOrbEntityFactory extends EntityFactory { - ExpOrbEntity create(GeyserSessionImpl session, int amount, long entityId, long geyserId, Vector3f position); + ExpOrbEntity create(GeyserSession session, int amount, long entityId, long geyserId, Vector3f position); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/factory/PaintingEntityFactory.java b/core/src/main/java/org/geysermc/geyser/entity/factory/PaintingEntityFactory.java index 2d5ff63b3..2990b0ac5 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/factory/PaintingEntityFactory.java +++ b/core/src/main/java/org/geysermc/geyser/entity/factory/PaintingEntityFactory.java @@ -27,12 +27,12 @@ package org.geysermc.geyser.entity.factory; import com.nukkitx.math.vector.Vector3f; import org.geysermc.geyser.entity.type.PaintingEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.level.PaintingType; import java.util.UUID; public interface PaintingEntityFactory extends EntityFactory { - PaintingEntity create(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, Vector3f position, PaintingType paintingName, int direction); + PaintingEntity create(GeyserSession session, long entityId, long geyserId, UUID uuid, Vector3f position, PaintingType paintingName, int direction); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/AbstractArrowEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/AbstractArrowEntity.java index c8fc72eb2..b80db2570 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/AbstractArrowEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/AbstractArrowEntity.java @@ -30,13 +30,13 @@ import com.github.steveice10.mc.protocol.data.game.entity.type.EntityType; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class AbstractArrowEntity extends Entity { - public AbstractArrowEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public AbstractArrowEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); // Set the correct texture if using the resource pack diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/AreaEffectCloudEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/AreaEffectCloudEntity.java index a9c6bf11a..6063c81f9 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/AreaEffectCloudEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/AreaEffectCloudEntity.java @@ -32,14 +32,14 @@ import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.Registries; import java.util.UUID; public class AreaEffectCloudEntity extends Entity { - public AreaEffectCloudEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public AreaEffectCloudEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/BoatEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/BoatEntity.java index 85113ba2c..ac1b3fcbd 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/BoatEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/BoatEntity.java @@ -34,7 +34,7 @@ import com.nukkitx.protocol.bedrock.packet.MoveEntityAbsolutePacket; import lombok.Getter; import org.geysermc.geyser.entity.EntityDefinition; import org.geysermc.geyser.entity.EntityDefinitions; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; import java.util.concurrent.TimeUnit; @@ -65,7 +65,7 @@ public class BoatEntity extends Entity { // Looks too fast and too choppy with 0.1f, which is how I believe the Microsoftian client handles it private final float ROWING_SPEED = 0.05f; - public BoatEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public BoatEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { // Initial rotation is incorrect super(session, entityId, geyserId, uuid, definition, position.add(0d, definition.offset(), 0d), motion, yaw + 90, 0, yaw + 90); @@ -154,7 +154,7 @@ public class BoatEntity extends Entity { } } - private void updateLeftPaddle(GeyserSessionImpl session, Entity rower) { + private void updateLeftPaddle(GeyserSession session, Entity rower) { if (isPaddlingLeft) { paddleTimeLeft += ROWING_SPEED; sendAnimationPacket(session, rower, AnimatePacket.Action.ROW_LEFT, paddleTimeLeft); @@ -167,7 +167,7 @@ public class BoatEntity extends Entity { } } - private void updateRightPaddle(GeyserSessionImpl session, Entity rower) { + private void updateRightPaddle(GeyserSession session, Entity rower) { if (isPaddlingRight) { paddleTimeRight += ROWING_SPEED; sendAnimationPacket(session, rower, AnimatePacket.Action.ROW_RIGHT, paddleTimeRight); @@ -180,7 +180,7 @@ public class BoatEntity extends Entity { } } - private void sendAnimationPacket(GeyserSessionImpl session, Entity rower, AnimatePacket.Action action, float rowTime) { + private void sendAnimationPacket(GeyserSession session, Entity rower, AnimatePacket.Action action, float rowTime) { AnimatePacket packet = new AnimatePacket(); packet.setRuntimeEntityId(rower.getGeyserId()); packet.setAction(action); diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/CommandBlockMinecartEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/CommandBlockMinecartEntity.java index 0b755f114..1764c721e 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/CommandBlockMinecartEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/CommandBlockMinecartEntity.java @@ -28,13 +28,13 @@ package org.geysermc.geyser.entity.type; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class CommandBlockMinecartEntity extends DefaultBlockMinecartEntity { - public CommandBlockMinecartEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public CommandBlockMinecartEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/DefaultBlockMinecartEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/DefaultBlockMinecartEntity.java index 5e6a15198..ec00c30be 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/DefaultBlockMinecartEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/DefaultBlockMinecartEntity.java @@ -30,7 +30,7 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.IntEntit import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; @@ -43,7 +43,7 @@ public class DefaultBlockMinecartEntity extends MinecartEntity { public int customBlockOffset = 0; public boolean showCustomBlock = false; - public DefaultBlockMinecartEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public DefaultBlockMinecartEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); dirtyMetadata.put(EntityData.CUSTOM_DISPLAY, (byte) 1); diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/EnderCrystalEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/EnderCrystalEntity.java index 421043ff6..aa907b7c6 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/EnderCrystalEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/EnderCrystalEntity.java @@ -32,14 +32,14 @@ import com.nukkitx.math.vector.Vector3i; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.Optional; import java.util.UUID; public class EnderCrystalEntity extends Entity { - public EnderCrystalEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public EnderCrystalEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/Entity.java b/core/src/main/java/org/geysermc/geyser/entity/type/Entity.java index 7935566e8..3b01c428f 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/Entity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/Entity.java @@ -45,7 +45,7 @@ import lombok.Setter; import net.kyori.adventure.text.Component; import org.geysermc.geyser.entity.EntityDefinition; import org.geysermc.geyser.entity.GeyserDirtyMetadata; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.text.MessageTranslator; import org.geysermc.geyser.util.MathUtils; @@ -55,7 +55,7 @@ import java.util.UUID; @Getter @Setter public class Entity { - protected final GeyserSessionImpl session; + protected final GeyserSession session; protected long entityId; protected final long geyserId; @@ -108,7 +108,7 @@ public class Entity { @Setter(AccessLevel.PROTECTED) // For players private boolean flagsDirty = false; - public Entity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public Entity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { this.session = session; this.entityId = entityId; diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/ExpOrbEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/ExpOrbEntity.java index 1bd059e95..25135d0b5 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/ExpOrbEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/ExpOrbEntity.java @@ -28,13 +28,13 @@ package org.geysermc.geyser.entity.type; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import org.geysermc.geyser.entity.EntityDefinitions; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; public class ExpOrbEntity extends Entity { private final int amount; - public ExpOrbEntity(GeyserSessionImpl session, int amount, long entityId, long geyserId, Vector3f position) { + public ExpOrbEntity(GeyserSession session, int amount, long entityId, long geyserId, Vector3f position) { super(session, entityId, geyserId, null, EntityDefinitions.EXPERIENCE_ORB, position, Vector3f.ZERO, 0, 0, 0); this.amount = amount; diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/FallingBlockEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/FallingBlockEntity.java index f6106f3b0..346861f96 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/FallingBlockEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/FallingBlockEntity.java @@ -30,14 +30,14 @@ import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import org.geysermc.geyser.entity.EntityDefinitions; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class FallingBlockEntity extends Entity { private final int javaId; - public FallingBlockEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, Vector3f position, Vector3f motion, float yaw, float pitch, int javaId) { + public FallingBlockEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, Vector3f position, Vector3f motion, float yaw, float pitch, int javaId) { super(session, entityId, geyserId, uuid, EntityDefinitions.FALLING_BLOCK, position, motion, yaw, pitch, 0f); this.javaId = javaId; } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/FireworkEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/FireworkEntity.java index b6b383dcb..075178b55 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/FireworkEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/FireworkEntity.java @@ -38,7 +38,7 @@ import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.packet.SetEntityMotionPacket; import org.geysermc.geyser.entity.EntityDefinition; import org.geysermc.geyser.entity.type.player.PlayerEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.level.FireworkColor; import org.geysermc.geyser.util.MathUtils; import org.geysermc.floodgate.util.DeviceOs; @@ -50,7 +50,7 @@ import java.util.UUID; public class FireworkEntity extends Entity { - public FireworkEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public FireworkEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/FishingHookEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/FishingHookEntity.java index bac3b9bb8..b5774bd78 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/FishingHookEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/FishingHookEntity.java @@ -33,7 +33,7 @@ import com.nukkitx.protocol.bedrock.packet.PlaySoundPacket; import lombok.Getter; import org.geysermc.geyser.entity.EntityDefinitions; import org.geysermc.geyser.entity.type.player.PlayerEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.level.physics.BoundingBox; import org.geysermc.geyser.translator.collision.BlockCollision; import org.geysermc.geyser.level.block.BlockStateValues; @@ -56,7 +56,7 @@ public class FishingHookEntity extends ThrowableEntity { private final BoundingBox boundingBox; - public FishingHookEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, Vector3f position, Vector3f motion, float yaw, float pitch, PlayerEntity owner) { + public FishingHookEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, Vector3f position, Vector3f motion, float yaw, float pitch, PlayerEntity owner) { super(session, entityId, geyserId, uuid, EntityDefinitions.FISHING_BOBBER, position, motion, yaw, pitch, 0f); this.boundingBox = new BoundingBox(0.125, 0.125, 0.125, 0.25, 0.25, 0.25); @@ -140,7 +140,7 @@ public class FishingHookEntity extends ThrowableEntity { } } - private void sendSplashSound(GeyserSessionImpl session) { + private void sendSplashSound(GeyserSession session) { if (!getFlag(EntityFlag.SILENT)) { float volume = (float) (0.2f * Math.sqrt(0.2 * (motion.getX() * motion.getX() + motion.getZ() * motion.getZ()) + motion.getY() * motion.getY())); if (volume > 1) { diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/FurnaceMinecartEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/FurnaceMinecartEntity.java index b9134e7e5..ab34cb751 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/FurnaceMinecartEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/FurnaceMinecartEntity.java @@ -29,7 +29,7 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanE import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.level.block.BlockStateValues; import java.util.UUID; @@ -37,7 +37,7 @@ import java.util.UUID; public class FurnaceMinecartEntity extends DefaultBlockMinecartEntity { private boolean hasFuel = false; - public FurnaceMinecartEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public FurnaceMinecartEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/ItemEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/ItemEntity.java index f3732a83d..dd98f9aba 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/ItemEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/ItemEntity.java @@ -35,7 +35,7 @@ import com.nukkitx.protocol.bedrock.data.inventory.ItemData; import com.nukkitx.protocol.bedrock.packet.AddItemEntityPacket; import com.nukkitx.protocol.bedrock.packet.EntityEventPacket; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.inventory.item.ItemTranslator; import org.geysermc.geyser.level.block.BlockStateValues; @@ -46,7 +46,7 @@ public class ItemEntity extends ThrowableEntity { private int waterLevel = -1; - public ItemEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ItemEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/ItemFrameEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/ItemFrameEntity.java index 53094bdf3..0f73de739 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/ItemFrameEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/ItemFrameEntity.java @@ -40,7 +40,7 @@ import com.nukkitx.protocol.bedrock.packet.UpdateBlockPacket; import com.nukkitx.protocol.bedrock.v465.Bedrock_v465; import lombok.Getter; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.inventory.item.ItemTranslator; import org.geysermc.geyser.registry.type.ItemMapping; @@ -77,7 +77,7 @@ public class ItemFrameEntity extends Entity { */ private boolean changed = true; - public ItemFrameEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, Direction direction) { + public ItemFrameEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, Direction direction) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, 0f); NbtMapBuilder blockBuilder = NbtMap.builder() @@ -211,10 +211,10 @@ public class ItemFrameEntity extends Entity { /** * Finds the Java entity ID of an item frame from its Bedrock position. * @param position position of item frame in Bedrock. - * @param session GeyserSession. + * @param session GeyserConnection. * @return Java entity ID or -1 if not found. */ - public static ItemFrameEntity getItemFrameEntity(GeyserSessionImpl session, Vector3i position) { + public static ItemFrameEntity getItemFrameEntity(GeyserSession session, Vector3i position) { return session.getItemFrameCache().get(position); } } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/ItemedFireballEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/ItemedFireballEntity.java index 8d45d84ae..49548ec2a 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/ItemedFireballEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/ItemedFireballEntity.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.entity.type; import com.nukkitx.math.vector.Vector3f; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; @@ -39,7 +39,7 @@ public class ItemedFireballEntity extends ThrowableEntity { */ protected int futureTicks = 3; - public ItemedFireballEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ItemedFireballEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, Vector3f.ZERO, yaw, pitch, headYaw); float magnitude = motion.length(); diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/LeashKnotEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/LeashKnotEntity.java index 3443814bf..63e964a55 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/LeashKnotEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/LeashKnotEntity.java @@ -27,13 +27,13 @@ package org.geysermc.geyser.entity.type; import com.nukkitx.math.vector.Vector3f; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class LeashKnotEntity extends Entity { - public LeashKnotEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public LeashKnotEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { // Position is incorrect by default super(session, entityId, geyserId, uuid, definition, position.add(0.5f, 0.25f, 0.5f), motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/LightningEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/LightningEntity.java index 8830117e6..1f5af0492 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/LightningEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/LightningEntity.java @@ -28,14 +28,14 @@ package org.geysermc.geyser.entity.type; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.packet.PlaySoundPacket; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; import java.util.concurrent.ThreadLocalRandom; public class LightningEntity extends Entity { - public LightningEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public LightningEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/LivingEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/LivingEntity.java index 63d481182..678741424 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/LivingEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/LivingEntity.java @@ -47,7 +47,7 @@ import lombok.Getter; import lombok.Setter; import org.geysermc.geyser.entity.EntityDefinition; import org.geysermc.geyser.entity.attribute.GeyserAttributeType; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.type.ItemMapping; import org.geysermc.geyser.util.AttributeUtils; import org.geysermc.geyser.util.ChunkUtils; @@ -79,7 +79,7 @@ public class LivingEntity extends Entity { */ private boolean isMaxFrozenState = false; - public LivingEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public LivingEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } @@ -168,7 +168,7 @@ public class LivingEntity extends Entity { return new AttributeData(GeyserAttributeType.HEALTH.getBedrockIdentifier(), 0f, this.maxHealth, (float) Math.ceil(this.health), this.maxHealth); } - public void updateArmor(GeyserSessionImpl session) { + public void updateArmor(GeyserSession session) { if (!valid) return; ItemData helmet = this.helmet; @@ -194,7 +194,7 @@ public class LivingEntity extends Entity { session.sendUpstreamPacket(armorEquipmentPacket); } - public void updateMainHand(GeyserSessionImpl session) { + public void updateMainHand(GeyserSession session) { if (!valid) return; MobEquipmentPacket handPacket = new MobEquipmentPacket(); @@ -207,7 +207,7 @@ public class LivingEntity extends Entity { session.sendUpstreamPacket(handPacket); } - public void updateOffHand(GeyserSessionImpl session) { + public void updateOffHand(GeyserSession session) { if (!valid) return; MobEquipmentPacket offHandPacket = new MobEquipmentPacket(); @@ -226,7 +226,7 @@ public class LivingEntity extends Entity { * * @param attributes the Java list of attributes sent from the server */ - public void updateBedrockAttributes(GeyserSessionImpl session, List attributes) { + public void updateBedrockAttributes(GeyserSession session, List attributes) { if (!valid) return; List newAttributes = new ArrayList<>(); diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/MinecartEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/MinecartEntity.java index d71895466..ffb5e4018 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/MinecartEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/MinecartEntity.java @@ -30,13 +30,13 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.IntEntit import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class MinecartEntity extends Entity { - public MinecartEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public MinecartEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position.add(0d, definition.offset(), 0d), motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/PaintingEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/PaintingEntity.java index 32c0da71b..e97bb7090 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/PaintingEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/PaintingEntity.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.entity.type; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.packet.AddPaintingPacket; import org.geysermc.geyser.entity.EntityDefinitions; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.level.PaintingType; import java.util.UUID; @@ -38,7 +38,7 @@ public class PaintingEntity extends Entity { private final PaintingType paintingName; private final int direction; - public PaintingEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, Vector3f position, PaintingType paintingName, int direction) { + public PaintingEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, Vector3f position, PaintingType paintingName, int direction) { super(session, entityId, geyserId, uuid, EntityDefinitions.PAINTING, position, Vector3f.ZERO, 0f, 0f, 0f); this.paintingName = paintingName; this.direction = direction; diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/SpawnerMinecartEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/SpawnerMinecartEntity.java index 2ca179be0..2cd4cf3f6 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/SpawnerMinecartEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/SpawnerMinecartEntity.java @@ -28,14 +28,14 @@ package org.geysermc.geyser.entity.type; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.level.block.BlockStateValues; import java.util.UUID; public class SpawnerMinecartEntity extends DefaultBlockMinecartEntity { - public SpawnerMinecartEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public SpawnerMinecartEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/TNTEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/TNTEntity.java index 31b06d4c4..e7edd32d5 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/TNTEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/TNTEntity.java @@ -31,14 +31,14 @@ import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import com.nukkitx.protocol.bedrock.packet.SetEntityDataPacket; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class TNTEntity extends Entity implements Tickable { private int currentTick; - public TNTEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public TNTEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/ThrowableEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/ThrowableEntity.java index 5b0ff57fb..67aa09794 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/ThrowableEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/ThrowableEntity.java @@ -32,7 +32,7 @@ import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import com.nukkitx.protocol.bedrock.packet.LevelEventPacket; import com.nukkitx.protocol.bedrock.packet.MoveEntityDeltaPacket; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.level.block.BlockStateValues; import java.util.UUID; @@ -44,7 +44,7 @@ public class ThrowableEntity extends Entity implements Tickable { protected Vector3f lastJavaPosition; - public ThrowableEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ThrowableEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); this.lastJavaPosition = position; } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/ThrowableItemEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/ThrowableItemEntity.java index ae2de746c..7abffd0bf 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/ThrowableItemEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/ThrowableItemEntity.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.entity.type; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; @@ -42,7 +42,7 @@ public class ThrowableItemEntity extends ThrowableEntity { private int age; private boolean invisible; - public ThrowableItemEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ThrowableItemEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); setFlag(EntityFlag.INVISIBLE, true); invisible = false; diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/ThrownPotionEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/ThrownPotionEntity.java index 19d2b09b4..c4cd5d54a 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/ThrownPotionEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/ThrownPotionEntity.java @@ -34,7 +34,7 @@ import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.inventory.item.Potion; import org.geysermc.geyser.registry.type.ItemMapping; @@ -44,7 +44,7 @@ import java.util.UUID; public class ThrownPotionEntity extends ThrowableItemEntity { private static final EnumSet NON_ENCHANTED_POTIONS = EnumSet.of(Potion.WATER, Potion.MUNDANE, Potion.THICK, Potion.AWKWARD); - public ThrownPotionEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ThrownPotionEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/TippedArrowEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/TippedArrowEntity.java index cb3e2471d..a60c0ab33 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/TippedArrowEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/TippedArrowEntity.java @@ -29,7 +29,7 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.IntEntit import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.inventory.item.TippedArrowPotion; import java.util.UUID; @@ -39,7 +39,7 @@ import java.util.UUID; */ public class TippedArrowEntity extends AbstractArrowEntity { - public TippedArrowEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public TippedArrowEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/TridentEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/TridentEntity.java index 5e1151db6..65591fb50 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/TridentEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/TridentEntity.java @@ -27,13 +27,13 @@ package org.geysermc.geyser.entity.type; import com.nukkitx.math.vector.Vector3f; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class TridentEntity extends AbstractArrowEntity { - public TridentEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public TridentEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/WitherSkullEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/WitherSkullEntity.java index fb40862cc..fbed041fe 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/WitherSkullEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/WitherSkullEntity.java @@ -29,14 +29,14 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanE import com.nukkitx.math.vector.Vector3f; import org.geysermc.geyser.entity.EntityDefinition; import org.geysermc.geyser.entity.EntityDefinitions; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class WitherSkullEntity extends ItemedFireballEntity { private boolean isCharged; - public WitherSkullEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public WitherSkullEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); this.futureTicks = 1; diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/AbstractFishEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/AbstractFishEntity.java index 1a97bfb12..8fedce1e7 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/AbstractFishEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/AbstractFishEntity.java @@ -28,13 +28,13 @@ package org.geysermc.geyser.entity.type.living; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class AbstractFishEntity extends WaterEntity { - public AbstractFishEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public AbstractFishEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); setFlag(EntityFlag.CAN_SWIM, true); diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/AgeableEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/AgeableEntity.java index 6fb687f47..b250f3e8e 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/AgeableEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/AgeableEntity.java @@ -30,13 +30,13 @@ import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class AgeableEntity extends CreatureEntity { - public AgeableEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public AgeableEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/AmbientEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/AmbientEntity.java index 0c15fa95c..693a0cd46 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/AmbientEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/AmbientEntity.java @@ -27,13 +27,13 @@ package org.geysermc.geyser.entity.type.living; import com.nukkitx.math.vector.Vector3f; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class AmbientEntity extends MobEntity { - public AmbientEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public AmbientEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/ArmorStandEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/ArmorStandEntity.java index 7f5ccd306..fb459bf54 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/ArmorStandEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/ArmorStandEntity.java @@ -38,7 +38,7 @@ import net.kyori.adventure.text.Component; import org.geysermc.geyser.entity.EntityDefinition; import org.geysermc.geyser.entity.EntityDefinitions; import org.geysermc.geyser.entity.type.LivingEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.Optional; import java.util.UUID; @@ -78,7 +78,7 @@ public class ArmorStandEntity extends LivingEntity { */ private boolean positionUpdateRequired = false; - public ArmorStandEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ArmorStandEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/BatEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/BatEntity.java index 07853429a..0a72a431e 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/BatEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/BatEntity.java @@ -29,13 +29,13 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.ByteEnti import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class BatEntity extends AmbientEntity { - public BatEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public BatEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/CreatureEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/CreatureEntity.java index cef93a7a6..b5e7557da 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/CreatureEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/CreatureEntity.java @@ -27,13 +27,13 @@ package org.geysermc.geyser.entity.type.living; import com.nukkitx.math.vector.Vector3f; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class CreatureEntity extends MobEntity { - public CreatureEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public CreatureEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/FlyingEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/FlyingEntity.java index 3a6581d2f..91f839bc3 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/FlyingEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/FlyingEntity.java @@ -27,13 +27,13 @@ package org.geysermc.geyser.entity.type.living; import com.nukkitx.math.vector.Vector3f; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class FlyingEntity extends MobEntity { - public FlyingEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public FlyingEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/GlowSquidEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/GlowSquidEntity.java index dc49ec765..b5950b7bc 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/GlowSquidEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/GlowSquidEntity.java @@ -27,12 +27,12 @@ package org.geysermc.geyser.entity.type.living; import com.nukkitx.math.vector.Vector3f; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class GlowSquidEntity extends SquidEntity { - public GlowSquidEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public GlowSquidEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/GolemEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/GolemEntity.java index a6cec0788..eb94e1406 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/GolemEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/GolemEntity.java @@ -27,13 +27,13 @@ package org.geysermc.geyser.entity.type.living; import com.nukkitx.math.vector.Vector3f; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class GolemEntity extends CreatureEntity { - public GolemEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public GolemEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/IronGolemEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/IronGolemEntity.java index 9a28d7032..f86392ed3 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/IronGolemEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/IronGolemEntity.java @@ -29,13 +29,13 @@ import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class IronGolemEntity extends GolemEntity { - public IronGolemEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public IronGolemEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); // Indicate that we should show cracks through a resource pack setFlag(EntityFlag.BRIBED, true); diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/MagmaCubeEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/MagmaCubeEntity.java index 1610ee6e5..03cf9f3dc 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/MagmaCubeEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/MagmaCubeEntity.java @@ -28,13 +28,13 @@ package org.geysermc.geyser.entity.type.living; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class MagmaCubeEntity extends SlimeEntity { - public MagmaCubeEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public MagmaCubeEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/MobEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/MobEntity.java index 0a06f67c6..e82b813d7 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/MobEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/MobEntity.java @@ -32,7 +32,7 @@ import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import lombok.Getter; import org.geysermc.geyser.entity.EntityDefinition; import org.geysermc.geyser.entity.type.LivingEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; @@ -43,7 +43,7 @@ public class MobEntity extends LivingEntity { @Getter private long leashHolderBedrockId; - public MobEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public MobEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/SlimeEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/SlimeEntity.java index 5d9a4604c..100ed764d 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/SlimeEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/SlimeEntity.java @@ -29,13 +29,13 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.IntEntit import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class SlimeEntity extends MobEntity { - public SlimeEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public SlimeEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/SnowGolemEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/SnowGolemEntity.java index c8bf1d67a..1d8375529 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/SnowGolemEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/SnowGolemEntity.java @@ -29,13 +29,13 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.ByteEnti import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class SnowGolemEntity extends GolemEntity { - public SnowGolemEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public SnowGolemEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/SquidEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/SquidEntity.java index ada353196..b0e2fcb9e 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/SquidEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/SquidEntity.java @@ -30,7 +30,7 @@ import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import com.nukkitx.protocol.bedrock.packet.MoveEntityDeltaPacket; import org.geysermc.geyser.entity.EntityDefinition; import org.geysermc.geyser.entity.type.Tickable; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.level.block.BlockStateValues; import java.util.UUID; @@ -41,7 +41,7 @@ public class SquidEntity extends WaterEntity implements Tickable { private boolean inWater; - public SquidEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public SquidEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/WaterEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/WaterEntity.java index c1940d043..acacd1f52 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/WaterEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/WaterEntity.java @@ -27,13 +27,13 @@ package org.geysermc.geyser.entity.type.living; import com.nukkitx.math.vector.Vector3f; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class WaterEntity extends CreatureEntity { - public WaterEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public WaterEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/AnimalEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/AnimalEntity.java index 01e3b7a80..c7c15b288 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/AnimalEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/AnimalEntity.java @@ -28,14 +28,14 @@ package org.geysermc.geyser.entity.type.living.animal; import com.nukkitx.math.vector.Vector3f; import org.geysermc.geyser.entity.EntityDefinition; import org.geysermc.geyser.entity.type.living.AgeableEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.type.ItemMapping; import java.util.UUID; public class AnimalEntity extends AgeableEntity { - public AnimalEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public AnimalEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/AxolotlEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/AxolotlEntity.java index d8026d378..4dfa5fa8d 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/AxolotlEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/AxolotlEntity.java @@ -31,13 +31,13 @@ import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.type.ItemMapping; import java.util.UUID; public class AxolotlEntity extends AnimalEntity { - public AxolotlEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public AxolotlEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/BeeEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/BeeEntity.java index de761167d..7f9ec4255 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/BeeEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/BeeEntity.java @@ -33,14 +33,14 @@ import com.nukkitx.protocol.bedrock.data.entity.EntityEventType; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import com.nukkitx.protocol.bedrock.packet.EntityEventPacket; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.type.ItemMapping; import java.util.UUID; public class BeeEntity extends AnimalEntity { - public BeeEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public BeeEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/ChickenEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/ChickenEntity.java index 051c53eae..506714dbc 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/ChickenEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/ChickenEntity.java @@ -27,14 +27,14 @@ package org.geysermc.geyser.entity.type.living.animal; import com.nukkitx.math.vector.Vector3f; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.type.ItemMapping; import java.util.UUID; public class ChickenEntity extends AnimalEntity { - public ChickenEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ChickenEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/FoxEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/FoxEntity.java index cf7e83108..127a70a0f 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/FoxEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/FoxEntity.java @@ -31,14 +31,14 @@ import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.type.ItemMapping; import java.util.UUID; public class FoxEntity extends AnimalEntity { - public FoxEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public FoxEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/GoatEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/GoatEntity.java index a0701503f..708a95134 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/GoatEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/GoatEntity.java @@ -30,7 +30,7 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanE import com.nukkitx.math.vector.Vector3f; import lombok.Getter; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; @@ -41,7 +41,7 @@ public class GoatEntity extends AnimalEntity { @Getter private boolean isScreamer; - public GoatEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public GoatEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/HoglinEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/HoglinEntity.java index 9456361ee..ed0feed97 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/HoglinEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/HoglinEntity.java @@ -29,7 +29,7 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanE import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.type.ItemMapping; import org.geysermc.geyser.util.DimensionUtils; @@ -38,7 +38,7 @@ import java.util.UUID; public class HoglinEntity extends AnimalEntity { private boolean isImmuneToZombification; - public HoglinEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public HoglinEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/MooshroomEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/MooshroomEntity.java index ffd7c138b..15473c8ac 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/MooshroomEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/MooshroomEntity.java @@ -27,13 +27,13 @@ package org.geysermc.geyser.entity.type.living.animal; import com.nukkitx.math.vector.Vector3f; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class MooshroomEntity extends AnimalEntity { - public MooshroomEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public MooshroomEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/OcelotEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/OcelotEntity.java index a769324c5..5244e3538 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/OcelotEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/OcelotEntity.java @@ -27,14 +27,14 @@ package org.geysermc.geyser.entity.type.living.animal; import com.nukkitx.math.vector.Vector3f; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.type.ItemMapping; import java.util.UUID; public class OcelotEntity extends AnimalEntity { - public OcelotEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public OcelotEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/PandaEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/PandaEntity.java index 74a4b85c0..7548ccef1 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/PandaEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/PandaEntity.java @@ -33,7 +33,7 @@ import com.nukkitx.protocol.bedrock.data.entity.EntityEventType; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import com.nukkitx.protocol.bedrock.packet.EntityEventPacket; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.type.ItemMapping; import java.util.UUID; @@ -42,7 +42,7 @@ public class PandaEntity extends AnimalEntity { private int mainGene; private int hiddenGene; - public PandaEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public PandaEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/PigEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/PigEntity.java index 000ace4b3..0be4c78f1 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/PigEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/PigEntity.java @@ -27,14 +27,14 @@ package org.geysermc.geyser.entity.type.living.animal; import com.nukkitx.math.vector.Vector3f; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.type.ItemMapping; import java.util.UUID; public class PigEntity extends AnimalEntity { - public PigEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public PigEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/PolarBearEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/PolarBearEntity.java index bf4991119..727804dbc 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/PolarBearEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/PolarBearEntity.java @@ -27,14 +27,14 @@ package org.geysermc.geyser.entity.type.living.animal; import com.nukkitx.math.vector.Vector3f; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.type.ItemMapping; import java.util.UUID; public class PolarBearEntity extends AnimalEntity { - public PolarBearEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public PolarBearEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/PufferFishEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/PufferFishEntity.java index 39fecff46..66853babf 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/PufferFishEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/PufferFishEntity.java @@ -30,13 +30,13 @@ import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import org.geysermc.geyser.entity.EntityDefinition; import org.geysermc.geyser.entity.type.living.AbstractFishEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class PufferFishEntity extends AbstractFishEntity { - public PufferFishEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public PufferFishEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/RabbitEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/RabbitEntity.java index 0db826ecb..a1d80ac72 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/RabbitEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/RabbitEntity.java @@ -31,14 +31,14 @@ import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.type.ItemMapping; import java.util.UUID; public class RabbitEntity extends AnimalEntity { - public RabbitEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public RabbitEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/SheepEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/SheepEntity.java index a494df017..757c5b574 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/SheepEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/SheepEntity.java @@ -30,13 +30,13 @@ import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class SheepEntity extends AnimalEntity { - public SheepEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public SheepEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/StriderEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/StriderEntity.java index db4a44ede..d684fba06 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/StriderEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/StriderEntity.java @@ -30,7 +30,7 @@ import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import org.geysermc.geyser.entity.type.Entity; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.type.ItemMapping; import java.util.UUID; @@ -39,7 +39,7 @@ public class StriderEntity extends AnimalEntity { private boolean isCold = false; - public StriderEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public StriderEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); setFlag(EntityFlag.FIRE_IMMUNE, true); diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/TropicalFishEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/TropicalFishEntity.java index 08a204804..b883c91a9 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/TropicalFishEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/TropicalFishEntity.java @@ -32,7 +32,7 @@ import com.nukkitx.protocol.bedrock.data.entity.EntityData; import it.unimi.dsi.fastutil.ints.IntList; import org.geysermc.geyser.entity.EntityDefinition; import org.geysermc.geyser.entity.type.living.AbstractFishEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.List; import java.util.UUID; @@ -48,7 +48,7 @@ public class TropicalFishEntity extends AbstractFishEntity { private static final List VARIANT_NAMES = ImmutableList.of("kob", "sunstreak", "snooper", "dasher", "brinely", "spotty", "flopper", "stripey", "glitter", "blockfish", "betty", "clayfish"); private static final List COLOR_NAMES = ImmutableList.of("white", "orange", "magenta", "light_blue", "yellow", "lime", "pink", "gray", "light_gray", "cyan", "purple", "blue", "brown", "green", "red", "black"); - public TropicalFishEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public TropicalFishEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/TurtleEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/TurtleEntity.java index 8a70f9605..e892d7d5e 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/TurtleEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/TurtleEntity.java @@ -29,14 +29,14 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanE import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.type.ItemMapping; import java.util.UUID; public class TurtleEntity extends AnimalEntity { - public TurtleEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public TurtleEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/AbstractHorseEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/AbstractHorseEntity.java index 6a7391461..7d0a3cf9a 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/AbstractHorseEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/AbstractHorseEntity.java @@ -37,7 +37,7 @@ import com.nukkitx.protocol.bedrock.packet.UpdateAttributesPacket; import org.geysermc.geyser.entity.EntityDefinition; import org.geysermc.geyser.entity.attribute.GeyserAttributeType; import org.geysermc.geyser.entity.type.living.animal.AnimalEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.type.ItemMapping; import java.util.Set; @@ -51,7 +51,7 @@ public class AbstractHorseEntity extends AnimalEntity { private static final Set DONKEY_AND_HORSE_FOODS = ImmutableSet.of("golden_apple", "enchanted_golden_apple", "golden_carrot", "sugar", "apple", "wheat", "hay_block"); - public AbstractHorseEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public AbstractHorseEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); // Specifies the size of the entity's inventory. Required to place slots in the entity. diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/ChestedHorseEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/ChestedHorseEntity.java index 5389d0236..ccf30dbc8 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/ChestedHorseEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/ChestedHorseEntity.java @@ -27,13 +27,13 @@ package org.geysermc.geyser.entity.type.living.animal.horse; import com.nukkitx.math.vector.Vector3f; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class ChestedHorseEntity extends AbstractHorseEntity { - public ChestedHorseEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ChestedHorseEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/HorseEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/HorseEntity.java index 77f25bc8a..31b5b7890 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/HorseEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/HorseEntity.java @@ -29,13 +29,13 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.IntEntit import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class HorseEntity extends AbstractHorseEntity { - public HorseEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public HorseEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/LlamaEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/LlamaEntity.java index 7883a564d..c18778c81 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/LlamaEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/LlamaEntity.java @@ -31,14 +31,14 @@ import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.inventory.ItemData; import com.nukkitx.protocol.bedrock.packet.MobArmorEquipmentPacket; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.type.ItemMapping; import java.util.UUID; public class LlamaEntity extends ChestedHorseEntity { - public LlamaEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public LlamaEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); dirtyMetadata.put(EntityData.CONTAINER_STRENGTH_MODIFIER, 3); // Presumably 3 slots for every 1 strength diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/TraderLlamaEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/TraderLlamaEntity.java index 399ee529b..770d30a05 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/TraderLlamaEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/TraderLlamaEntity.java @@ -28,13 +28,13 @@ package org.geysermc.geyser.entity.type.living.animal.horse; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class TraderLlamaEntity extends LlamaEntity { - public TraderLlamaEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public TraderLlamaEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/CatEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/CatEntity.java index 050c066d8..5538621d9 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/CatEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/CatEntity.java @@ -32,7 +32,7 @@ import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.type.ItemMapping; import java.util.UUID; @@ -41,7 +41,7 @@ public class CatEntity extends TameableEntity { private byte collarColor; - public CatEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public CatEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/ParrotEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/ParrotEntity.java index c291dbbe8..05f0a6ad5 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/ParrotEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/ParrotEntity.java @@ -27,14 +27,14 @@ package org.geysermc.geyser.entity.type.living.animal.tameable; import com.nukkitx.math.vector.Vector3f; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.type.ItemMapping; import java.util.UUID; public class ParrotEntity extends TameableEntity { - public ParrotEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ParrotEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/TameableEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/TameableEntity.java index 1a00a4803..d12839e92 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/TameableEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/TameableEntity.java @@ -34,7 +34,7 @@ import lombok.Getter; import org.geysermc.geyser.entity.type.Entity; import org.geysermc.geyser.entity.EntityDefinition; import org.geysermc.geyser.entity.type.living.animal.AnimalEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.Optional; import java.util.UUID; @@ -46,7 +46,7 @@ public class TameableEntity extends AnimalEntity { @Getter protected long ownerBedrockId; - public TameableEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public TameableEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/WolfEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/WolfEntity.java index 91d5088f2..13bb8e17d 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/WolfEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/WolfEntity.java @@ -32,7 +32,7 @@ import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.type.ItemMapping; import java.util.Set; @@ -49,7 +49,7 @@ public class WolfEntity extends TameableEntity { private byte collarColor; - public WolfEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public WolfEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/merchant/AbstractMerchantEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/merchant/AbstractMerchantEntity.java index 0e40fd9a1..7981c9b23 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/merchant/AbstractMerchantEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/merchant/AbstractMerchantEntity.java @@ -28,13 +28,13 @@ package org.geysermc.geyser.entity.type.living.merchant; import com.nukkitx.math.vector.Vector3f; import org.geysermc.geyser.entity.EntityDefinition; import org.geysermc.geyser.entity.type.living.AgeableEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class AbstractMerchantEntity extends AgeableEntity { - public AbstractMerchantEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public AbstractMerchantEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/merchant/VillagerEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/merchant/VillagerEntity.java index b403f4362..012fb05f2 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/merchant/VillagerEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/merchant/VillagerEntity.java @@ -37,7 +37,7 @@ import it.unimi.dsi.fastutil.ints.Int2IntMap; import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap; import lombok.Getter; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.BlockRegistries; import java.util.Optional; @@ -88,7 +88,7 @@ public class VillagerEntity extends AbstractMerchantEntity { @Getter private boolean canTradeWith; - public VillagerEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public VillagerEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/AbstractSkeletonEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/AbstractSkeletonEntity.java index 3a923ef7f..ae13cfeae 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/AbstractSkeletonEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/AbstractSkeletonEntity.java @@ -29,13 +29,13 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.ByteEnti import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class AbstractSkeletonEntity extends MonsterEntity { - public AbstractSkeletonEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public AbstractSkeletonEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/BasePiglinEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/BasePiglinEntity.java index 19ccaaef2..2f315368f 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/BasePiglinEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/BasePiglinEntity.java @@ -29,7 +29,7 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanE import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.util.DimensionUtils; import java.util.UUID; @@ -37,7 +37,7 @@ import java.util.UUID; public class BasePiglinEntity extends MonsterEntity { private boolean isImmuneToZombification; - public BasePiglinEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public BasePiglinEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/BlazeEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/BlazeEntity.java index 46e4576c9..2303f8091 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/BlazeEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/BlazeEntity.java @@ -29,13 +29,13 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.ByteEnti import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class BlazeEntity extends MonsterEntity { - public BlazeEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public BlazeEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/CreeperEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/CreeperEntity.java index e601999cf..f1e0b6a65 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/CreeperEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/CreeperEntity.java @@ -30,7 +30,7 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.IntEntit import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; @@ -41,7 +41,7 @@ public class CreeperEntity extends MonsterEntity { */ private boolean ignitedByFlintAndSteel = false; - public CreeperEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public CreeperEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ElderGuardianEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ElderGuardianEntity.java index b25bc3168..9c237f117 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ElderGuardianEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ElderGuardianEntity.java @@ -28,13 +28,13 @@ package org.geysermc.geyser.entity.type.living.monster; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class ElderGuardianEntity extends GuardianEntity { - public ElderGuardianEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ElderGuardianEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/EnderDragonEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/EnderDragonEntity.java index 5319e4b2a..f49b51e6c 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/EnderDragonEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/EnderDragonEntity.java @@ -36,7 +36,7 @@ import lombok.Data; import org.geysermc.geyser.entity.EntityDefinition; import org.geysermc.geyser.entity.type.Tickable; import org.geysermc.geyser.entity.type.living.MobEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.util.DimensionUtils; import java.util.Random; @@ -79,7 +79,7 @@ public class EnderDragonEntity extends MobEntity implements Tickable { private float wingPosition; private float lastWingPosition; - public EnderDragonEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public EnderDragonEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/EnderDragonPartEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/EnderDragonPartEntity.java index 2ab9cc461..7cd4bb6cf 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/EnderDragonPartEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/EnderDragonPartEntity.java @@ -30,11 +30,11 @@ import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import org.geysermc.geyser.entity.type.Entity; import org.geysermc.geyser.entity.EntityDefinitions; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; public class EnderDragonPartEntity extends Entity { - public EnderDragonPartEntity(GeyserSessionImpl session, long entityId, long geyserId, float width, float height) { + public EnderDragonPartEntity(GeyserSession session, long entityId, long geyserId, float width, float height) { super(session, entityId, geyserId, null, EntityDefinitions.ENDER_DRAGON_PART, Vector3f.ZERO, Vector3f.ZERO, 0, 0, 0); dirtyMetadata.put(EntityData.BOUNDING_BOX_WIDTH, width); diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/EndermanEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/EndermanEntity.java index 771b00e36..469f48521 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/EndermanEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/EndermanEntity.java @@ -33,13 +33,13 @@ import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import com.nukkitx.protocol.bedrock.packet.LevelSoundEvent2Packet; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class EndermanEntity extends MonsterEntity { - public EndermanEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public EndermanEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/GhastEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/GhastEntity.java index a03f1df95..845a281d9 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/GhastEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/GhastEntity.java @@ -30,13 +30,13 @@ import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import org.geysermc.geyser.entity.EntityDefinition; import org.geysermc.geyser.entity.type.living.FlyingEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class GhastEntity extends FlyingEntity { - public GhastEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public GhastEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/GiantEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/GiantEntity.java index 2c84efd77..6dd27cc39 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/GiantEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/GiantEntity.java @@ -28,13 +28,13 @@ package org.geysermc.geyser.entity.type.living.monster; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class GiantEntity extends MonsterEntity { - public GiantEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public GiantEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); dirtyMetadata.put(EntityData.SCALE, 6f); diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/GuardianEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/GuardianEntity.java index 9c1954134..0190f3c60 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/GuardianEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/GuardianEntity.java @@ -30,13 +30,13 @@ import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import org.geysermc.geyser.entity.type.Entity; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class GuardianEntity extends MonsterEntity { - public GuardianEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public GuardianEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/MonsterEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/MonsterEntity.java index 0372c174a..fad45f982 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/MonsterEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/MonsterEntity.java @@ -28,13 +28,13 @@ package org.geysermc.geyser.entity.type.living.monster; import com.nukkitx.math.vector.Vector3f; import org.geysermc.geyser.entity.EntityDefinition; import org.geysermc.geyser.entity.type.living.CreatureEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class MonsterEntity extends CreatureEntity { - public MonsterEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public MonsterEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/PhantomEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/PhantomEntity.java index 0854c2522..68f3e7d23 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/PhantomEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/PhantomEntity.java @@ -30,12 +30,12 @@ import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import org.geysermc.geyser.entity.EntityDefinition; import org.geysermc.geyser.entity.type.living.FlyingEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class PhantomEntity extends FlyingEntity { - public PhantomEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public PhantomEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/PiglinEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/PiglinEntity.java index 084f1dc36..b98d6eabc 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/PiglinEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/PiglinEntity.java @@ -30,13 +30,13 @@ import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class PiglinEntity extends BasePiglinEntity { - public PiglinEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public PiglinEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } @@ -55,7 +55,7 @@ public class PiglinEntity extends BasePiglinEntity { } @Override - public void updateOffHand(GeyserSessionImpl session) { + public void updateOffHand(GeyserSession session) { // Check if the Piglin is holding Gold and set the ADMIRING flag accordingly so its pose updates setFlag(EntityFlag.ADMIRING, session.getTagCache().shouldPiglinAdmire(session.getItemMappings().getMapping(this.offHand))); super.updateBedrockMetadata(); diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ShulkerEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ShulkerEntity.java index d5d816a46..e60f81d2f 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ShulkerEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ShulkerEntity.java @@ -33,13 +33,13 @@ import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import org.geysermc.geyser.entity.EntityDefinition; import org.geysermc.geyser.entity.type.living.GolemEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class ShulkerEntity extends GolemEntity { - public ShulkerEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ShulkerEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); // Indicate that invisibility should be fixed through the resource pack setFlag(EntityFlag.BRIBED, true); diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/SkeletonEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/SkeletonEntity.java index 9339b6593..b1f6939aa 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/SkeletonEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/SkeletonEntity.java @@ -29,14 +29,14 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanE import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class SkeletonEntity extends AbstractSkeletonEntity { private boolean convertingToStray = false; - public SkeletonEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public SkeletonEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/SpiderEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/SpiderEntity.java index af358a800..4f7b02d73 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/SpiderEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/SpiderEntity.java @@ -29,13 +29,13 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.ByteEnti import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class SpiderEntity extends MonsterEntity { - public SpiderEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public SpiderEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/VexEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/VexEntity.java index f6017d479..938b18022 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/VexEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/VexEntity.java @@ -29,13 +29,13 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.ByteEnti import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class VexEntity extends MonsterEntity { - public VexEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public VexEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/WitherEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/WitherEntity.java index d79fe4e8b..17da0a611 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/WitherEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/WitherEntity.java @@ -30,13 +30,13 @@ import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import org.geysermc.geyser.entity.type.Entity; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class WitherEntity extends MonsterEntity { - public WitherEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public WitherEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ZoglinEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ZoglinEntity.java index 364233d81..f0fe101da 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ZoglinEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ZoglinEntity.java @@ -30,13 +30,13 @@ import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class ZoglinEntity extends MonsterEntity { - public ZoglinEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ZoglinEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ZombieEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ZombieEntity.java index 1cd5c4c91..9e3301b48 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ZombieEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ZombieEntity.java @@ -30,14 +30,14 @@ import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class ZombieEntity extends MonsterEntity { private boolean convertingToDrowned = false; - public ZombieEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ZombieEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ZombieVillagerEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ZombieVillagerEntity.java index 4fa3d88f8..54a5c4506 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ZombieVillagerEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ZombieVillagerEntity.java @@ -33,14 +33,14 @@ import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import org.geysermc.geyser.entity.EntityDefinition; import org.geysermc.geyser.entity.type.living.merchant.VillagerEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class ZombieVillagerEntity extends ZombieEntity { private boolean isTransforming; - public ZombieVillagerEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ZombieVillagerEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ZombifiedPiglinEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ZombifiedPiglinEntity.java index aaf3d8001..2604ce12e 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ZombifiedPiglinEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ZombifiedPiglinEntity.java @@ -28,13 +28,13 @@ package org.geysermc.geyser.entity.type.living.monster; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class ZombifiedPiglinEntity extends ZombieEntity { - public ZombifiedPiglinEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ZombifiedPiglinEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); setFlag(EntityFlag.FIRE_IMMUNE, true); diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/raid/AbstractIllagerEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/raid/AbstractIllagerEntity.java index ff24b7fb2..15ac1a0d9 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/raid/AbstractIllagerEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/raid/AbstractIllagerEntity.java @@ -27,13 +27,13 @@ package org.geysermc.geyser.entity.type.living.monster.raid; import com.nukkitx.math.vector.Vector3f; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class AbstractIllagerEntity extends RaidParticipantEntity { - public AbstractIllagerEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public AbstractIllagerEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/raid/PillagerEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/raid/PillagerEntity.java index d13fc247a..477d9fef7 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/raid/PillagerEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/raid/PillagerEntity.java @@ -28,26 +28,26 @@ package org.geysermc.geyser.entity.type.living.monster.raid; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.type.ItemMapping; import java.util.UUID; public class PillagerEntity extends AbstractIllagerEntity { - public PillagerEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public PillagerEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } @Override - public void updateMainHand(GeyserSessionImpl session) { //TODO + public void updateMainHand(GeyserSession session) { //TODO checkForCrossbow(); super.updateMainHand(session); } @Override - public void updateOffHand(GeyserSessionImpl session) { + public void updateOffHand(GeyserSession session) { checkForCrossbow(); super.updateOffHand(session); diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/raid/RaidParticipantEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/raid/RaidParticipantEntity.java index cecb679aa..bd0f3ac5d 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/raid/RaidParticipantEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/raid/RaidParticipantEntity.java @@ -28,13 +28,13 @@ package org.geysermc.geyser.entity.type.living.monster.raid; import com.nukkitx.math.vector.Vector3f; import org.geysermc.geyser.entity.EntityDefinition; import org.geysermc.geyser.entity.type.living.monster.MonsterEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class RaidParticipantEntity extends MonsterEntity { - public RaidParticipantEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public RaidParticipantEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/raid/SpellcasterIllagerEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/raid/SpellcasterIllagerEntity.java index 0ada45517..7c2a05de1 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/raid/SpellcasterIllagerEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/raid/SpellcasterIllagerEntity.java @@ -31,7 +31,7 @@ import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import org.geysermc.geyser.entity.EntityDefinition; import org.geysermc.geyser.entity.EntityDefinitions; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; @@ -40,7 +40,7 @@ public class SpellcasterIllagerEntity extends AbstractIllagerEntity { private static final int ATTACK_PARTICLE_COLOR = (102 << 16) | (77 << 8) | 89; private static final int WOLOLO_PARTICLE_COLOR = (179 << 16) | (128 << 8) | 51; - public SpellcasterIllagerEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public SpellcasterIllagerEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); // OptionalPack usage setFlag(EntityFlag.BRIBED, this.definition == EntityDefinitions.ILLUSIONER); diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/raid/VindicatorEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/raid/VindicatorEntity.java index d6b239e10..a3b85dc73 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/raid/VindicatorEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/raid/VindicatorEntity.java @@ -29,13 +29,13 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.ByteEnti import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class VindicatorEntity extends AbstractIllagerEntity { - public VindicatorEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public VindicatorEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/player/PlayerEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/player/PlayerEntity.java index 4a3064825..8737ef847 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/player/PlayerEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/player/PlayerEntity.java @@ -52,7 +52,7 @@ import org.geysermc.geyser.entity.type.Entity; import org.geysermc.geyser.entity.EntityDefinitions; import org.geysermc.geyser.entity.type.LivingEntity; import org.geysermc.geyser.entity.type.living.animal.tameable.ParrotEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.text.MessageTranslator; import org.geysermc.geyser.scoreboard.Objective; import org.geysermc.geyser.scoreboard.Score; @@ -81,7 +81,7 @@ public class PlayerEntity extends LivingEntity { */ private ParrotEntity rightParrot; - public PlayerEntity(GeyserSessionImpl session, long entityId, long geyserId, GameProfile gameProfile, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public PlayerEntity(GeyserSession session, long entityId, long geyserId, GameProfile gameProfile, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, gameProfile.getId(), EntityDefinitions.PLAYER, position, motion, yaw, pitch, headYaw); profile = gameProfile; diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/player/SessionPlayerEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/player/SessionPlayerEntity.java index 4ee309290..c297bdb18 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/player/SessionPlayerEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/player/SessionPlayerEntity.java @@ -39,7 +39,7 @@ import com.nukkitx.protocol.bedrock.packet.UpdateAttributesPacket; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import lombok.Getter; import org.geysermc.geyser.entity.attribute.GeyserAttributeType; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.util.AttributeUtils; import java.util.Collections; @@ -48,7 +48,7 @@ import java.util.Map; import java.util.UUID; /** - * The entity class specifically for a {@link GeyserSessionImpl}'s player. + * The entity class specifically for a {@link GeyserSession}'s player. */ public class SessionPlayerEntity extends PlayerEntity { /** @@ -70,9 +70,9 @@ public class SessionPlayerEntity extends PlayerEntity { */ private int fakeTradeXp; - private final GeyserSessionImpl session; + private final GeyserSession session; - public SessionPlayerEntity(GeyserSessionImpl session) { + public SessionPlayerEntity(GeyserSession session) { super(session, 1, 1, new GameProfile(UUID.randomUUID(), "unknown"), Vector3f.ZERO, Vector3f.ZERO, 0, 0, 0); valid = true; diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/player/SkullPlayerEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/player/SkullPlayerEntity.java index 8bf3a8400..0afb3e8b5 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/player/SkullPlayerEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/player/SkullPlayerEntity.java @@ -34,7 +34,7 @@ import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import com.nukkitx.protocol.bedrock.packet.AddPlayerPacket; import lombok.Getter; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; /** * A wrapper to handle skulls more effectively - skulls have to be treated as entities since there are no @@ -48,7 +48,7 @@ public class SkullPlayerEntity extends PlayerEntity { @Getter private final int blockState; - public SkullPlayerEntity(GeyserSessionImpl session, long geyserId, GameProfile gameProfile, Vector3f position, float rotation, int blockState) { + public SkullPlayerEntity(GeyserSession session, long geyserId, GameProfile gameProfile, Vector3f position, float rotation, int blockState) { super(session, 0, geyserId, gameProfile, position, Vector3f.ZERO, rotation, 0, rotation); this.blockState = blockState; setPlayerList(false); diff --git a/core/src/main/java/org/geysermc/geyser/inventory/Container.java b/core/src/main/java/org/geysermc/geyser/inventory/Container.java index 2e1ef0542..464d683fa 100644 --- a/core/src/main/java/org/geysermc/geyser/inventory/Container.java +++ b/core/src/main/java/org/geysermc/geyser/inventory/Container.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.inventory; import com.github.steveice10.mc.protocol.data.game.inventory.ContainerType; import lombok.Getter; import lombok.NonNull; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.inventory.InventoryTranslator; /** @@ -60,7 +60,7 @@ public class Container extends Inventory { } @Override - public void setItem(int slot, @NonNull GeyserItemStack newItem, GeyserSessionImpl session) { + public void setItem(int slot, @NonNull GeyserItemStack newItem, GeyserSession session) { if (slot < this.size) { super.setItem(slot, newItem, session); } else { diff --git a/core/src/main/java/org/geysermc/geyser/inventory/EnchantingContainer.java b/core/src/main/java/org/geysermc/geyser/inventory/EnchantingContainer.java index 6be1f79c3..b16a3a07c 100644 --- a/core/src/main/java/org/geysermc/geyser/inventory/EnchantingContainer.java +++ b/core/src/main/java/org/geysermc/geyser/inventory/EnchantingContainer.java @@ -49,7 +49,7 @@ public class EnchantingContainer extends Container { for (int i = 0; i < geyserEnchantOptions.length; i++) { geyserEnchantOptions[i] = new GeyserEnchantOption(i); // Options cannot be null, so we build initial options - // GeyserSession can be safely null here because it's only needed for net IDs + // GeyserConnection can be safely null here because it's only needed for net IDs enchantOptions[i] = geyserEnchantOptions[i].build(null); } } diff --git a/core/src/main/java/org/geysermc/geyser/inventory/Generic3X3Container.java b/core/src/main/java/org/geysermc/geyser/inventory/Generic3X3Container.java index cc2eda74e..fc226f621 100644 --- a/core/src/main/java/org/geysermc/geyser/inventory/Generic3X3Container.java +++ b/core/src/main/java/org/geysermc/geyser/inventory/Generic3X3Container.java @@ -27,14 +27,14 @@ package org.geysermc.geyser.inventory; import com.github.steveice10.mc.protocol.data.game.inventory.ContainerType; import lombok.Getter; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.inventory.Generic3X3InventoryTranslator; public class Generic3X3Container extends Container { /** * Whether we need to set the container type as {@link com.nukkitx.protocol.bedrock.data.inventory.ContainerType#DROPPER}. * - * Used at {@link Generic3X3InventoryTranslator#openInventory(GeyserSessionImpl, Inventory)} + * Used at {@link Generic3X3InventoryTranslator#openInventory(GeyserSession, Inventory)} */ @Getter private boolean isDropper = false; diff --git a/core/src/main/java/org/geysermc/geyser/inventory/GeyserEnchantOption.java b/core/src/main/java/org/geysermc/geyser/inventory/GeyserEnchantOption.java index 6b789a075..8ecb3fe8d 100644 --- a/core/src/main/java/org/geysermc/geyser/inventory/GeyserEnchantOption.java +++ b/core/src/main/java/org/geysermc/geyser/inventory/GeyserEnchantOption.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.inventory; import com.nukkitx.protocol.bedrock.data.inventory.EnchantData; import com.nukkitx.protocol.bedrock.data.inventory.EnchantOptionData; import lombok.Getter; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.Arrays; import java.util.Collections; @@ -70,7 +70,7 @@ public class GeyserEnchantOption { this.javaIndex = javaIndex; } - public EnchantOptionData build(GeyserSessionImpl session) { + public EnchantOptionData build(GeyserSession session) { this.hasChanged = false; return new EnchantOptionData(xpCost, javaIndex + 16, EMPTY, enchantLevel == -1 ? EMPTY : Collections.singletonList(new EnchantData(bedrockEnchantIndex, enchantLevel)), EMPTY, diff --git a/core/src/main/java/org/geysermc/geyser/inventory/GeyserItemStack.java b/core/src/main/java/org/geysermc/geyser/inventory/GeyserItemStack.java index bdc141045..a75631db0 100644 --- a/core/src/main/java/org/geysermc/geyser/inventory/GeyserItemStack.java +++ b/core/src/main/java/org/geysermc/geyser/inventory/GeyserItemStack.java @@ -29,7 +29,7 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack; import com.github.steveice10.opennbt.tag.builtin.CompoundTag; import com.nukkitx.protocol.bedrock.data.inventory.ItemData; import lombok.Data; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.inventory.item.ItemTranslator; import org.geysermc.geyser.registry.type.ItemMapping; @@ -91,14 +91,14 @@ public class GeyserItemStack { return isEmpty() ? null : new ItemStack(javaId, newAmount, nbt); } - public ItemData getItemData(GeyserSessionImpl session) { + public ItemData getItemData(GeyserSession session) { ItemData itemData = ItemTranslator.translateToBedrock(session, getItemStack()); itemData.setNetId(getNetId()); itemData.setUsingNetId(true); // Seems silly - this should probably be on the protocol level return itemData; } - public ItemMapping getMapping(GeyserSessionImpl session) { + public ItemMapping getMapping(GeyserSession session) { return session.getItemMappings().getMapping(this.javaId); } diff --git a/core/src/main/java/org/geysermc/geyser/inventory/Inventory.java b/core/src/main/java/org/geysermc/geyser/inventory/Inventory.java index bf58abf4c..6eaaf84a2 100644 --- a/core/src/main/java/org/geysermc/geyser/inventory/Inventory.java +++ b/core/src/main/java/org/geysermc/geyser/inventory/Inventory.java @@ -34,7 +34,7 @@ import lombok.Getter; import lombok.NonNull; import lombok.Setter; import org.geysermc.geyser.GeyserImpl; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.Arrays; @@ -102,7 +102,7 @@ public class Inventory { return items[slot]; } - public void setItem(int slot, @NonNull GeyserItemStack newItem, GeyserSessionImpl session) { + public void setItem(int slot, @NonNull GeyserItemStack newItem, GeyserSession session) { if (slot > this.size) { session.getGeyser().getLogger().debug("Tried to set an item out of bounds! " + this); return; @@ -123,7 +123,7 @@ public class Inventory { } } - protected static void updateItemNetId(GeyserItemStack oldItem, GeyserItemStack newItem, GeyserSessionImpl session) { + protected static void updateItemNetId(GeyserItemStack oldItem, GeyserItemStack newItem, GeyserSession session) { if (!newItem.isEmpty()) { if (newItem.getItemData(session).equals(oldItem.getItemData(session), false, false, false)) { newItem.setNetId(oldItem.getNetId()); diff --git a/core/src/main/java/org/geysermc/geyser/inventory/PlayerInventory.java b/core/src/main/java/org/geysermc/geyser/inventory/PlayerInventory.java index 57df2fe68..36114ccba 100644 --- a/core/src/main/java/org/geysermc/geyser/inventory/PlayerInventory.java +++ b/core/src/main/java/org/geysermc/geyser/inventory/PlayerInventory.java @@ -29,7 +29,7 @@ import lombok.Getter; import lombok.NonNull; import lombok.Setter; import org.geysermc.geyser.GeyserImpl; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; public class PlayerInventory extends Inventory { @@ -50,7 +50,7 @@ public class PlayerInventory extends Inventory { heldItemSlot = 0; } - public void setCursor(@NonNull GeyserItemStack newCursor, GeyserSessionImpl session) { + public void setCursor(@NonNull GeyserItemStack newCursor, GeyserSession session) { updateItemNetId(cursor, newCursor, session); cursor = newCursor; } diff --git a/core/src/main/java/org/geysermc/geyser/inventory/StonecutterContainer.java b/core/src/main/java/org/geysermc/geyser/inventory/StonecutterContainer.java index 0785c4eac..3dc35f5df 100644 --- a/core/src/main/java/org/geysermc/geyser/inventory/StonecutterContainer.java +++ b/core/src/main/java/org/geysermc/geyser/inventory/StonecutterContainer.java @@ -29,7 +29,7 @@ import com.github.steveice10.mc.protocol.data.game.inventory.ContainerType; import lombok.Getter; import lombok.NonNull; import lombok.Setter; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; public class StonecutterContainer extends Container { /** @@ -44,7 +44,7 @@ public class StonecutterContainer extends Container { } @Override - public void setItem(int slot, @NonNull GeyserItemStack newItem, GeyserSessionImpl session) { + public void setItem(int slot, @NonNull GeyserItemStack newItem, GeyserSession session) { if (slot == 0 && newItem.getJavaId() != items[slot].getJavaId()) { // The pressed stonecutter button output resets whenever the input item changes this.stonecutterButton = -1; diff --git a/core/src/main/java/org/geysermc/geyser/inventory/click/ClickPlan.java b/core/src/main/java/org/geysermc/geyser/inventory/click/ClickPlan.java index e58c0bc0d..c239cc778 100644 --- a/core/src/main/java/org/geysermc/geyser/inventory/click/ClickPlan.java +++ b/core/src/main/java/org/geysermc/geyser/inventory/click/ClickPlan.java @@ -35,7 +35,7 @@ import it.unimi.dsi.fastutil.ints.IntSet; import lombok.Value; import org.geysermc.geyser.inventory.GeyserItemStack; import org.geysermc.geyser.inventory.Inventory; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.inventory.InventoryTranslator; import org.geysermc.geyser.inventory.SlotType; import org.geysermc.geyser.translator.inventory.CraftingInventoryTranslator; @@ -52,12 +52,12 @@ public class ClickPlan { private GeyserItemStack simulatedCursor; private boolean simulating; - private final GeyserSessionImpl session; + private final GeyserSession session; private final InventoryTranslator translator; private final Inventory inventory; private final int gridSize; - public ClickPlan(GeyserSessionImpl session, InventoryTranslator translator, Inventory inventory) { + public ClickPlan(GeyserSession session, InventoryTranslator translator, Inventory inventory) { this.session = session; this.translator = translator; this.inventory = inventory; diff --git a/core/src/main/java/org/geysermc/geyser/inventory/holder/BlockInventoryHolder.java b/core/src/main/java/org/geysermc/geyser/inventory/holder/BlockInventoryHolder.java index 59e32c97e..8dba5a69d 100644 --- a/core/src/main/java/org/geysermc/geyser/inventory/holder/BlockInventoryHolder.java +++ b/core/src/main/java/org/geysermc/geyser/inventory/holder/BlockInventoryHolder.java @@ -36,7 +36,7 @@ import com.nukkitx.protocol.bedrock.packet.ContainerOpenPacket; import com.nukkitx.protocol.bedrock.packet.UpdateBlockPacket; import org.geysermc.geyser.inventory.Container; import org.geysermc.geyser.inventory.Inventory; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.inventory.InventoryTranslator; import org.geysermc.geyser.registry.BlockRegistries; import org.geysermc.geyser.util.BlockUtils; @@ -71,7 +71,7 @@ public class BlockInventoryHolder extends InventoryHolder { } @Override - public void prepareInventory(InventoryTranslator translator, GeyserSessionImpl session, Inventory inventory) { + public void prepareInventory(InventoryTranslator translator, GeyserSession session, Inventory inventory) { // Check to see if there is an existing block we can use that the player just selected. // First, verify that the player's position has not changed, so we don't try to select a block wildly out of range. // (This could be a virtual inventory that the player is opening) @@ -108,7 +108,7 @@ public class BlockInventoryHolder extends InventoryHolder { * @return if the player's last interaction position and current position match. Used to ensure that we don't select * a block to hold the inventory that's wildly out of range. */ - protected boolean checkInteractionPosition(GeyserSessionImpl session) { + protected boolean checkInteractionPosition(GeyserSession session) { return session.getLastInteractionPlayerPosition().equals(session.getPlayerEntity().getPosition()); } @@ -119,7 +119,7 @@ public class BlockInventoryHolder extends InventoryHolder { return this.validBlocks.contains(javaBlockString[0]); } - protected void setCustomName(GeyserSessionImpl session, Vector3i position, Inventory inventory, int javaBlockState) { + protected void setCustomName(GeyserSession session, Vector3i position, Inventory inventory, int javaBlockState) { NbtMap tag = NbtMap.builder() .putInt("x", position.getX()) .putInt("y", position.getY()) @@ -132,7 +132,7 @@ public class BlockInventoryHolder extends InventoryHolder { } @Override - public void openInventory(InventoryTranslator translator, GeyserSessionImpl session, Inventory inventory) { + public void openInventory(InventoryTranslator translator, GeyserSession session, Inventory inventory) { ContainerOpenPacket containerOpenPacket = new ContainerOpenPacket(); containerOpenPacket.setId((byte) inventory.getId()); containerOpenPacket.setType(containerType); @@ -142,7 +142,7 @@ public class BlockInventoryHolder extends InventoryHolder { } @Override - public void closeInventory(InventoryTranslator translator, GeyserSessionImpl session, Inventory inventory) { + public void closeInventory(InventoryTranslator translator, GeyserSession session, Inventory inventory) { if (((Container) inventory).isUsingRealBlock()) { // No need to reset a block since we didn't change any blocks // But send a container close packet because we aren't destroying the original. diff --git a/core/src/main/java/org/geysermc/geyser/inventory/holder/InventoryHolder.java b/core/src/main/java/org/geysermc/geyser/inventory/holder/InventoryHolder.java index d90487a86..845e645e3 100644 --- a/core/src/main/java/org/geysermc/geyser/inventory/holder/InventoryHolder.java +++ b/core/src/main/java/org/geysermc/geyser/inventory/holder/InventoryHolder.java @@ -26,11 +26,11 @@ package org.geysermc.geyser.inventory.holder; import org.geysermc.geyser.inventory.Inventory; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.inventory.InventoryTranslator; public abstract class InventoryHolder { - public abstract void prepareInventory(InventoryTranslator translator, GeyserSessionImpl session, Inventory inventory); - public abstract void openInventory(InventoryTranslator translator, GeyserSessionImpl session, Inventory inventory); - public abstract void closeInventory(InventoryTranslator translator, GeyserSessionImpl session, Inventory inventory); + public abstract void prepareInventory(InventoryTranslator translator, GeyserSession session, Inventory inventory); + public abstract void openInventory(InventoryTranslator translator, GeyserSession session, Inventory inventory); + public abstract void closeInventory(InventoryTranslator translator, GeyserSession session, Inventory inventory); } diff --git a/core/src/main/java/org/geysermc/geyser/inventory/updater/AnvilInventoryUpdater.java b/core/src/main/java/org/geysermc/geyser/inventory/updater/AnvilInventoryUpdater.java index 2c162ef85..f95633768 100644 --- a/core/src/main/java/org/geysermc/geyser/inventory/updater/AnvilInventoryUpdater.java +++ b/core/src/main/java/org/geysermc/geyser/inventory/updater/AnvilInventoryUpdater.java @@ -40,7 +40,7 @@ import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.inventory.AnvilContainer; import org.geysermc.geyser.inventory.GeyserItemStack; import org.geysermc.geyser.inventory.Inventory; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.text.MessageTranslator; import org.geysermc.geyser.translator.inventory.InventoryTranslator; import org.geysermc.geyser.inventory.item.Enchantment.JavaEnchantment; @@ -57,7 +57,7 @@ public class AnvilInventoryUpdater extends InventoryUpdater { private static final int MAX_LEVEL_COST = 40; @Override - public void updateInventory(InventoryTranslator translator, GeyserSessionImpl session, Inventory inventory) { + public void updateInventory(InventoryTranslator translator, GeyserSession session, Inventory inventory) { super.updateInventory(translator, session, inventory); AnvilContainer anvilContainer = (AnvilContainer) inventory; updateInventoryState(session, anvilContainer); @@ -79,7 +79,7 @@ public class AnvilInventoryUpdater extends InventoryUpdater { } @Override - public boolean updateSlot(InventoryTranslator translator, GeyserSessionImpl session, Inventory inventory, int javaSlot) { + public boolean updateSlot(InventoryTranslator translator, GeyserSession session, Inventory inventory, int javaSlot) { if (super.updateSlot(translator, session, inventory, javaSlot)) return true; AnvilContainer anvilContainer = (AnvilContainer) inventory; @@ -107,7 +107,7 @@ public class AnvilInventoryUpdater extends InventoryUpdater { return true; } - private void updateInventoryState(GeyserSessionImpl session, AnvilContainer anvilContainer) { + private void updateInventoryState(GeyserSession session, AnvilContainer anvilContainer) { GeyserItemStack input = anvilContainer.getInput(); if (!input.equals(anvilContainer.getLastInput())) { anvilContainer.setLastInput(input.copy()); @@ -133,7 +133,7 @@ public class AnvilInventoryUpdater extends InventoryUpdater { * @param anvilContainer the anvil inventory * @return the slot to change the repair cost */ - private int getTargetSlot(GeyserSessionImpl session, AnvilContainer anvilContainer) { + private int getTargetSlot(GeyserSession session, AnvilContainer anvilContainer) { GeyserItemStack input = anvilContainer.getInput(); GeyserItemStack material = anvilContainer.getMaterial(); @@ -148,7 +148,7 @@ public class AnvilInventoryUpdater extends InventoryUpdater { return 0; } - private void updateTargetSlot(InventoryTranslator translator, GeyserSessionImpl session, AnvilContainer anvilContainer, int slot) { + private void updateTargetSlot(InventoryTranslator translator, GeyserSession session, AnvilContainer anvilContainer, int slot) { ItemData itemData = anvilContainer.getItem(slot).getItemData(session); itemData = hijackRepairCost(session, anvilContainer, itemData); @@ -166,7 +166,7 @@ public class AnvilInventoryUpdater extends InventoryUpdater { session.sendUpstreamPacket(slotPacket); } - private ItemData hijackRepairCost(GeyserSessionImpl session, AnvilContainer anvilContainer, ItemData itemData) { + private ItemData hijackRepairCost(GeyserSession session, AnvilContainer anvilContainer, ItemData itemData) { if (itemData.isNull()) { return itemData; } @@ -208,7 +208,7 @@ public class AnvilInventoryUpdater extends InventoryUpdater { * @param bedrock True to count enchantments like Bedrock * @return the number of levels needed */ - public int calcLevelCost(GeyserSessionImpl session, AnvilContainer anvilContainer, boolean bedrock) { + public int calcLevelCost(GeyserSession session, AnvilContainer anvilContainer, boolean bedrock) { GeyserItemStack input = anvilContainer.getInput(); GeyserItemStack material = anvilContainer.getMaterial(); @@ -262,7 +262,7 @@ public class AnvilInventoryUpdater extends InventoryUpdater { * @param material the item's respective repair material * @return the number of levels needed or 0 if it is not possible to repair any further */ - private int calcRepairLevelCost(GeyserSessionImpl session, GeyserItemStack input, GeyserItemStack material) { + private int calcRepairLevelCost(GeyserSession session, GeyserItemStack input, GeyserItemStack material) { int newDamage = getDamage(input); int unitRepair = Math.min(newDamage, input.getMapping(session).getMaxDamage() / 4); if (unitRepair <= 0) { @@ -287,7 +287,7 @@ public class AnvilInventoryUpdater extends InventoryUpdater { * @param material a matching item * @return the number of levels needed or 0 if it is not possible to repair any further */ - private int calcMergeRepairCost(GeyserSessionImpl session, GeyserItemStack input, GeyserItemStack material) { + private int calcMergeRepairCost(GeyserSession session, GeyserItemStack input, GeyserItemStack material) { // If the material item is damaged 112% or more, then the input item will not be repaired if (getDamage(input) > 0 && getDamage(material) < (material.getMapping(session).getMaxDamage() * 112 / 100)) { return 2; @@ -304,7 +304,7 @@ public class AnvilInventoryUpdater extends InventoryUpdater { * @param bedrock True to count enchantments like Bedrock, False to count like Java * @return the number of levels needed or -1 if no enchantments can be applied */ - private int calcMergeEnchantmentCost(GeyserSessionImpl session, GeyserItemStack input, GeyserItemStack material, boolean bedrock) { + private int calcMergeEnchantmentCost(GeyserSession session, GeyserItemStack input, GeyserItemStack material, boolean bedrock) { boolean hasCompatible = false; Object2IntMap combinedEnchantments = getEnchantments(session, input, bedrock); int cost = 0; @@ -367,7 +367,7 @@ public class AnvilInventoryUpdater extends InventoryUpdater { return cost; } - private Object2IntMap getEnchantments(GeyserSessionImpl session, GeyserItemStack itemStack, boolean bedrock) { + private Object2IntMap getEnchantments(GeyserSession session, GeyserItemStack itemStack, boolean bedrock) { if (itemStack.getNbt() == null) { return Object2IntMaps.emptyMap(); } @@ -405,20 +405,20 @@ public class AnvilInventoryUpdater extends InventoryUpdater { return enchantments; } - private boolean isEnchantedBook(GeyserSessionImpl session, GeyserItemStack itemStack) { + private boolean isEnchantedBook(GeyserSession session, GeyserItemStack itemStack) { return itemStack.getJavaId() == session.getItemMappings().getStoredItems().enchantedBook().getJavaId(); } - private boolean isCombining(GeyserSessionImpl session, GeyserItemStack input, GeyserItemStack material) { + private boolean isCombining(GeyserSession session, GeyserItemStack input, GeyserItemStack material) { return isEnchantedBook(session, material) || (input.getJavaId() == material.getJavaId() && hasDurability(session, input)); } - private boolean isRepairing(GeyserSessionImpl session, GeyserItemStack input, GeyserItemStack material) { + private boolean isRepairing(GeyserSession session, GeyserItemStack input, GeyserItemStack material) { Set repairMaterials = input.getMapping(session).getRepairMaterials(); return repairMaterials != null && repairMaterials.contains(material.getMapping(session).getJavaIdentifier()); } - private boolean isRenaming(GeyserSessionImpl session, AnvilContainer anvilContainer, boolean bedrock) { + private boolean isRenaming(GeyserSession session, AnvilContainer anvilContainer, boolean bedrock) { if (anvilContainer.getResult().isEmpty()) { return false; } @@ -447,7 +447,7 @@ public class AnvilInventoryUpdater extends InventoryUpdater { return getTagIntValueOr(itemStack, "RepairCost", 0); } - private boolean hasDurability(GeyserSessionImpl session, GeyserItemStack itemStack) { + private boolean hasDurability(GeyserSession session, GeyserItemStack itemStack) { if (itemStack.getMapping(session).getMaxDamage() > 0) { return getTagIntValueOr(itemStack, "Unbreakable", 0) == 0; } diff --git a/core/src/main/java/org/geysermc/geyser/inventory/updater/ChestInventoryUpdater.java b/core/src/main/java/org/geysermc/geyser/inventory/updater/ChestInventoryUpdater.java index d8951b9d6..65147abb6 100644 --- a/core/src/main/java/org/geysermc/geyser/inventory/updater/ChestInventoryUpdater.java +++ b/core/src/main/java/org/geysermc/geyser/inventory/updater/ChestInventoryUpdater.java @@ -30,7 +30,7 @@ import com.nukkitx.protocol.bedrock.packet.InventoryContentPacket; import com.nukkitx.protocol.bedrock.packet.InventorySlotPacket; import lombok.AllArgsConstructor; import org.geysermc.geyser.inventory.Inventory; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.inventory.InventoryTranslator; import org.geysermc.geyser.util.InventoryUtils; import org.geysermc.geyser.text.GeyserLocale; @@ -46,7 +46,7 @@ public class ChestInventoryUpdater extends InventoryUpdater { private final int paddedSize; @Override - public void updateInventory(InventoryTranslator translator, GeyserSessionImpl session, Inventory inventory) { + public void updateInventory(InventoryTranslator translator, GeyserSession session, Inventory inventory) { super.updateInventory(translator, session, inventory); List bedrockItems = new ArrayList<>(paddedSize); @@ -65,7 +65,7 @@ public class ChestInventoryUpdater extends InventoryUpdater { } @Override - public boolean updateSlot(InventoryTranslator translator, GeyserSessionImpl session, Inventory inventory, int javaSlot) { + public boolean updateSlot(InventoryTranslator translator, GeyserSession session, Inventory inventory, int javaSlot) { if (super.updateSlot(translator, session, inventory, javaSlot)) return true; diff --git a/core/src/main/java/org/geysermc/geyser/inventory/updater/ContainerInventoryUpdater.java b/core/src/main/java/org/geysermc/geyser/inventory/updater/ContainerInventoryUpdater.java index 2790e1de7..dd1e810ca 100644 --- a/core/src/main/java/org/geysermc/geyser/inventory/updater/ContainerInventoryUpdater.java +++ b/core/src/main/java/org/geysermc/geyser/inventory/updater/ContainerInventoryUpdater.java @@ -29,7 +29,7 @@ import com.nukkitx.protocol.bedrock.data.inventory.ItemData; import com.nukkitx.protocol.bedrock.packet.InventoryContentPacket; import com.nukkitx.protocol.bedrock.packet.InventorySlotPacket; import org.geysermc.geyser.inventory.Inventory; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.inventory.InventoryTranslator; import java.util.Arrays; @@ -38,7 +38,7 @@ public class ContainerInventoryUpdater extends InventoryUpdater { public static final ContainerInventoryUpdater INSTANCE = new ContainerInventoryUpdater(); @Override - public void updateInventory(InventoryTranslator translator, GeyserSessionImpl session, Inventory inventory) { + public void updateInventory(InventoryTranslator translator, GeyserSession session, Inventory inventory) { super.updateInventory(translator, session, inventory); ItemData[] bedrockItems = new ItemData[translator.size]; @@ -53,7 +53,7 @@ public class ContainerInventoryUpdater extends InventoryUpdater { } @Override - public boolean updateSlot(InventoryTranslator translator, GeyserSessionImpl session, Inventory inventory, int javaSlot) { + public boolean updateSlot(InventoryTranslator translator, GeyserSession session, Inventory inventory, int javaSlot) { if (super.updateSlot(translator, session, inventory, javaSlot)) return true; diff --git a/core/src/main/java/org/geysermc/geyser/inventory/updater/HorseInventoryUpdater.java b/core/src/main/java/org/geysermc/geyser/inventory/updater/HorseInventoryUpdater.java index 36f98da5a..10a556c81 100644 --- a/core/src/main/java/org/geysermc/geyser/inventory/updater/HorseInventoryUpdater.java +++ b/core/src/main/java/org/geysermc/geyser/inventory/updater/HorseInventoryUpdater.java @@ -29,7 +29,7 @@ import com.nukkitx.protocol.bedrock.data.inventory.ItemData; import com.nukkitx.protocol.bedrock.packet.InventoryContentPacket; import com.nukkitx.protocol.bedrock.packet.InventorySlotPacket; import org.geysermc.geyser.inventory.Inventory; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.inventory.InventoryTranslator; import java.util.Arrays; @@ -38,7 +38,7 @@ public class HorseInventoryUpdater extends InventoryUpdater { public static final HorseInventoryUpdater INSTANCE = new HorseInventoryUpdater(); @Override - public void updateInventory(InventoryTranslator translator, GeyserSessionImpl session, Inventory inventory) { + public void updateInventory(InventoryTranslator translator, GeyserSession session, Inventory inventory) { super.updateInventory(translator, session, inventory); ItemData[] bedrockItems = new ItemData[translator.size]; @@ -53,7 +53,7 @@ public class HorseInventoryUpdater extends InventoryUpdater { } @Override - public boolean updateSlot(InventoryTranslator translator, GeyserSessionImpl session, Inventory inventory, int javaSlot) { + public boolean updateSlot(InventoryTranslator translator, GeyserSession session, Inventory inventory, int javaSlot) { if (super.updateSlot(translator, session, inventory, javaSlot)) return true; diff --git a/core/src/main/java/org/geysermc/geyser/inventory/updater/InventoryUpdater.java b/core/src/main/java/org/geysermc/geyser/inventory/updater/InventoryUpdater.java index 33dee921b..6910aa447 100644 --- a/core/src/main/java/org/geysermc/geyser/inventory/updater/InventoryUpdater.java +++ b/core/src/main/java/org/geysermc/geyser/inventory/updater/InventoryUpdater.java @@ -30,13 +30,13 @@ import com.nukkitx.protocol.bedrock.data.inventory.ItemData; import com.nukkitx.protocol.bedrock.packet.InventoryContentPacket; import com.nukkitx.protocol.bedrock.packet.InventorySlotPacket; import org.geysermc.geyser.inventory.Inventory; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.inventory.InventoryTranslator; import java.util.Arrays; public class InventoryUpdater { - public void updateInventory(InventoryTranslator translator, GeyserSessionImpl session, Inventory inventory) { + public void updateInventory(InventoryTranslator translator, GeyserSession session, Inventory inventory) { ItemData[] bedrockItems = new ItemData[36]; for (int i = 0; i < 36; i++) { final int offset = i < 9 ? 27 : -9; @@ -48,7 +48,7 @@ public class InventoryUpdater { session.sendUpstreamPacket(contentPacket); } - public boolean updateSlot(InventoryTranslator translator, GeyserSessionImpl session, Inventory inventory, int javaSlot) { + public boolean updateSlot(InventoryTranslator translator, GeyserSession session, Inventory inventory, int javaSlot) { if (javaSlot >= translator.size) { InventorySlotPacket slotPacket = new InventorySlotPacket(); slotPacket.setContainerId(ContainerId.INVENTORY); diff --git a/core/src/main/java/org/geysermc/geyser/inventory/updater/UIInventoryUpdater.java b/core/src/main/java/org/geysermc/geyser/inventory/updater/UIInventoryUpdater.java index eeaa0fd7b..79b6bffc0 100644 --- a/core/src/main/java/org/geysermc/geyser/inventory/updater/UIInventoryUpdater.java +++ b/core/src/main/java/org/geysermc/geyser/inventory/updater/UIInventoryUpdater.java @@ -28,14 +28,14 @@ package org.geysermc.geyser.inventory.updater; import com.nukkitx.protocol.bedrock.data.inventory.ContainerId; import com.nukkitx.protocol.bedrock.packet.InventorySlotPacket; import org.geysermc.geyser.inventory.Inventory; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.inventory.InventoryTranslator; public class UIInventoryUpdater extends InventoryUpdater { public static final UIInventoryUpdater INSTANCE = new UIInventoryUpdater(); @Override - public void updateInventory(InventoryTranslator translator, GeyserSessionImpl session, Inventory inventory) { + public void updateInventory(InventoryTranslator translator, GeyserSession session, Inventory inventory) { super.updateInventory(translator, session, inventory); for (int i = 0; i < translator.size; i++) { @@ -51,7 +51,7 @@ public class UIInventoryUpdater extends InventoryUpdater { } @Override - public boolean updateSlot(InventoryTranslator translator, GeyserSessionImpl session, Inventory inventory, int javaSlot) { + public boolean updateSlot(InventoryTranslator translator, GeyserSession session, Inventory inventory, int javaSlot) { if (super.updateSlot(translator, session, inventory, javaSlot)) return true; diff --git a/core/src/main/java/org/geysermc/geyser/level/GeyserWorldManager.java b/core/src/main/java/org/geysermc/geyser/level/GeyserWorldManager.java index 7253809e3..d766c4b4c 100644 --- a/core/src/main/java/org/geysermc/geyser/level/GeyserWorldManager.java +++ b/core/src/main/java/org/geysermc/geyser/level/GeyserWorldManager.java @@ -32,7 +32,7 @@ import com.nukkitx.nbt.NbtMap; import com.nukkitx.nbt.NbtMapBuilder; import it.unimi.dsi.fastutil.objects.Object2ObjectMap; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.session.cache.ChunkCache; import org.geysermc.geyser.translator.inventory.LecternInventoryTranslator; import org.geysermc.geyser.level.block.BlockStateValues; @@ -42,7 +42,7 @@ public class GeyserWorldManager extends WorldManager { private static final Object2ObjectMap gameruleCache = new Object2ObjectOpenHashMap<>(); @Override - public int getBlockAt(GeyserSessionImpl session, int x, int y, int z) { + public int getBlockAt(GeyserSession session, int x, int y, int z) { ChunkCache chunkCache = session.getChunkCache(); if (chunkCache != null) { // Chunk cache can be null if the session is closed asynchronously return chunkCache.getBlockAt(x, y, z); @@ -57,7 +57,7 @@ public class GeyserWorldManager extends WorldManager { } @Override - public NbtMap getLecternDataAt(GeyserSessionImpl session, int x, int y, int z, boolean isChunkLoad) { + public NbtMap getLecternDataAt(GeyserSession session, int x, int y, int z, boolean isChunkLoad) { // Without direct server access, we can't get lectern information on-the-fly. // I should have set this up so it's only called when there is a book in the block state. - Camotoy NbtMapBuilder lecternTag = LecternInventoryTranslator.getBaseLecternTag(x, y, z, 1); @@ -80,13 +80,13 @@ public class GeyserWorldManager extends WorldManager { } @Override - public void setGameRule(GeyserSessionImpl session, String name, Object value) { + public void setGameRule(GeyserSession session, String name, Object value) { session.sendDownstreamPacket(new ServerboundChatPacket("/gamerule " + name + " " + value)); gameruleCache.put(name, String.valueOf(value)); } @Override - public Boolean getGameRuleBool(GeyserSessionImpl session, GameRule gameRule) { + public Boolean getGameRuleBool(GeyserSession session, GameRule gameRule) { String value = gameruleCache.get(gameRule.getJavaID()); if (value != null) { return Boolean.parseBoolean(value); @@ -96,7 +96,7 @@ public class GeyserWorldManager extends WorldManager { } @Override - public int getGameRuleInt(GeyserSessionImpl session, GameRule gameRule) { + public int getGameRuleInt(GeyserSession session, GameRule gameRule) { String value = gameruleCache.get(gameRule.getJavaID()); if (value != null) { return Integer.parseInt(value); @@ -106,17 +106,17 @@ public class GeyserWorldManager extends WorldManager { } @Override - public void setPlayerGameMode(GeyserSessionImpl session, GameMode gameMode) { + public void setPlayerGameMode(GeyserSession session, GameMode gameMode) { session.sendDownstreamPacket(new ServerboundChatPacket("/gamemode " + gameMode.name().toLowerCase())); } @Override - public void setDifficulty(GeyserSessionImpl session, Difficulty difficulty) { + public void setDifficulty(GeyserSession session, Difficulty difficulty) { session.sendDownstreamPacket(new ServerboundChatPacket("/difficulty " + difficulty.name().toLowerCase())); } @Override - public boolean hasPermission(GeyserSessionImpl session, String permission) { + public boolean hasPermission(GeyserSession session, String permission) { return false; } } diff --git a/core/src/main/java/org/geysermc/geyser/level/WorldManager.java b/core/src/main/java/org/geysermc/geyser/level/WorldManager.java index edd95bb52..9aaf323c0 100644 --- a/core/src/main/java/org/geysermc/geyser/level/WorldManager.java +++ b/core/src/main/java/org/geysermc/geyser/level/WorldManager.java @@ -30,7 +30,7 @@ import com.github.steveice10.mc.protocol.data.game.entity.player.GameMode; import com.github.steveice10.mc.protocol.data.game.setting.Difficulty; import com.nukkitx.math.vector.Vector3i; import com.nukkitx.nbt.NbtMap; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; /** * Class that manages or retrieves various information @@ -48,7 +48,7 @@ public abstract class WorldManager { * @param position the position * @return the block state at the specified location */ - public int getBlockAt(GeyserSessionImpl session, Position position) { + public int getBlockAt(GeyserSession session, Position position) { return this.getBlockAt(session, position.getX(), position.getY(), position.getZ()); } @@ -59,7 +59,7 @@ public abstract class WorldManager { * @param vector the position * @return the block state at the specified location */ - public int getBlockAt(GeyserSessionImpl session, Vector3i vector) { + public int getBlockAt(GeyserSession session, Vector3i vector) { return this.getBlockAt(session, vector.getX(), vector.getY(), vector.getZ()); } @@ -72,7 +72,7 @@ public abstract class WorldManager { * @param z the z coordinate to get the block at * @return the block state at the specified location */ - public abstract int getBlockAt(GeyserSessionImpl session, int x, int y, int z); + public abstract int getBlockAt(GeyserSession session, int x, int y, int z); /** * Checks whether or not this world manager requires a separate chunk cache/has access to more block data than the chunk cache. @@ -103,7 +103,7 @@ public abstract class WorldManager { * @return the Bedrock lectern block entity tag. This may not be the exact block entity tag - for example, Spigot's * block handled must be done on the server thread, so we send the tag manually there. */ - public abstract NbtMap getLecternDataAt(GeyserSessionImpl session, int x, int y, int z, boolean isChunkLoad); + public abstract NbtMap getLecternDataAt(GeyserSession session, int x, int y, int z, boolean isChunkLoad); /** * @return whether we should expect lectern data to update, or if we have to fall back on a workaround. @@ -117,7 +117,7 @@ public abstract class WorldManager { * @param name The gamerule to change * @param value The new value for the gamerule */ - public abstract void setGameRule(GeyserSessionImpl session, String name, Object value); + public abstract void setGameRule(GeyserSession session, String name, Object value); /** * Gets a gamerule value as a boolean @@ -126,7 +126,7 @@ public abstract class WorldManager { * @param gameRule The gamerule to fetch the value of * @return The boolean representation of the value */ - public abstract Boolean getGameRuleBool(GeyserSessionImpl session, GameRule gameRule); + public abstract Boolean getGameRuleBool(GeyserSession session, GameRule gameRule); /** * Get a gamerule value as an integer @@ -135,7 +135,7 @@ public abstract class WorldManager { * @param gameRule The gamerule to fetch the value of * @return The integer representation of the value */ - public abstract int getGameRuleInt(GeyserSessionImpl session, GameRule gameRule); + public abstract int getGameRuleInt(GeyserSession session, GameRule gameRule); /** * Change the game mode of the given session @@ -143,7 +143,7 @@ public abstract class WorldManager { * @param session The session of the player to change the game mode of * @param gameMode The game mode to change the player to */ - public abstract void setPlayerGameMode(GeyserSessionImpl session, GameMode gameMode); + public abstract void setPlayerGameMode(GeyserSession session, GameMode gameMode); /** * Change the difficulty of the Java server @@ -151,7 +151,7 @@ public abstract class WorldManager { * @param session The session of the user that requested the change * @param difficulty The difficulty to change to */ - public abstract void setDifficulty(GeyserSessionImpl session, Difficulty difficulty); + public abstract void setDifficulty(GeyserSession session, Difficulty difficulty); /** * Checks if the given session's player has a permission @@ -160,5 +160,5 @@ public abstract class WorldManager { * @param permission The permission node to check * @return True if the player has the requested permission, false if not */ - public abstract boolean hasPermission(GeyserSessionImpl session, String permission); + public abstract boolean hasPermission(GeyserSession session, String permission); } diff --git a/core/src/main/java/org/geysermc/geyser/level/physics/CollisionManager.java b/core/src/main/java/org/geysermc/geyser/level/physics/CollisionManager.java index 60aba03f2..5bd72182f 100644 --- a/core/src/main/java/org/geysermc/geyser/level/physics/CollisionManager.java +++ b/core/src/main/java/org/geysermc/geyser/level/physics/CollisionManager.java @@ -35,7 +35,7 @@ import lombok.Setter; import org.geysermc.geyser.entity.type.Entity; import org.geysermc.geyser.entity.EntityDefinitions; import org.geysermc.geyser.entity.type.player.PlayerEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.session.cache.PistonCache; import org.geysermc.geyser.translator.collision.BlockCollision; import org.geysermc.geyser.translator.collision.ScaffoldingCollision; @@ -49,7 +49,7 @@ import java.util.Locale; public class CollisionManager { - private final GeyserSessionImpl session; + private final GeyserSession session; @Getter private final BoundingBox playerBoundingBox; @@ -85,7 +85,7 @@ public class CollisionManager { */ private static final double INCORRECT_MOVEMENT_THRESHOLD = 0.08; - public CollisionManager(GeyserSessionImpl session) { + public CollisionManager(GeyserSession session) { this.session = session; this.playerBoundingBox = new BoundingBox(0, 0, 0, 0.6, 1.8, 0.6); } @@ -224,7 +224,7 @@ public class CollisionManager { /** * Returns false if the movement is invalid, and in this case it shouldn't be sent to the server and should be * cancelled - * See {@link BlockCollision#correctPosition(GeyserSessionImpl, int, int, int, BoundingBox)} for more info + * See {@link BlockCollision#correctPosition(GeyserSession, int, int, int, BoundingBox)} for more info */ public boolean correctPlayerPosition() { diff --git a/core/src/main/java/org/geysermc/geyser/network/ConnectorServerEventHandler.java b/core/src/main/java/org/geysermc/geyser/network/ConnectorServerEventHandler.java index 5d580fc05..2cd866365 100644 --- a/core/src/main/java/org/geysermc/geyser/network/ConnectorServerEventHandler.java +++ b/core/src/main/java/org/geysermc/geyser/network/ConnectorServerEventHandler.java @@ -36,7 +36,7 @@ import io.netty.util.concurrent.DefaultThreadFactory; import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.ping.GeyserPingInfo; import org.geysermc.geyser.configuration.GeyserConfiguration; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.text.MessageTranslator; import org.geysermc.geyser.ping.IGeyserPingPassthrough; import org.geysermc.geyser.text.GeyserLocale; @@ -168,7 +168,7 @@ public class ConnectorServerEventHandler implements BedrockServerEventHandler { public void onSessionCreation(BedrockServerSession bedrockServerSession) { bedrockServerSession.setLogging(true); bedrockServerSession.setCompressionLevel(geyser.getConfig().getBedrock().getCompressionLevel()); - bedrockServerSession.setPacketHandler(new UpstreamPacketHandler(geyser, new GeyserSessionImpl(geyser, bedrockServerSession, eventLoopGroup.next()))); + bedrockServerSession.setPacketHandler(new UpstreamPacketHandler(geyser, new GeyserSession(geyser, bedrockServerSession, eventLoopGroup.next()))); // Set the packet codec to default just in case we need to send disconnect packets. bedrockServerSession.setPacketCodec(MinecraftProtocol.DEFAULT_BEDROCK_CODEC); } diff --git a/core/src/main/java/org/geysermc/geyser/network/LoggingPacketHandler.java b/core/src/main/java/org/geysermc/geyser/network/LoggingPacketHandler.java index 1eeca3319..0dceed7e9 100644 --- a/core/src/main/java/org/geysermc/geyser/network/LoggingPacketHandler.java +++ b/core/src/main/java/org/geysermc/geyser/network/LoggingPacketHandler.java @@ -29,7 +29,7 @@ import com.nukkitx.protocol.bedrock.BedrockPacket; import com.nukkitx.protocol.bedrock.handler.BedrockPacketHandler; import com.nukkitx.protocol.bedrock.packet.*; import org.geysermc.geyser.GeyserImpl; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; /** * Bare bones implementation of BedrockPacketHandler suitable for extension. @@ -39,9 +39,9 @@ import org.geysermc.geyser.session.GeyserSessionImpl; */ public class LoggingPacketHandler implements BedrockPacketHandler { protected final GeyserImpl geyser; - protected final GeyserSessionImpl session; + protected final GeyserSession session; - LoggingPacketHandler(GeyserImpl geyser, GeyserSessionImpl session) { + LoggingPacketHandler(GeyserImpl geyser, GeyserSession session) { this.geyser = geyser; this.session = session; } diff --git a/core/src/main/java/org/geysermc/geyser/network/UpstreamPacketHandler.java b/core/src/main/java/org/geysermc/geyser/network/UpstreamPacketHandler.java index 76a238ad5..4d22bd7ce 100644 --- a/core/src/main/java/org/geysermc/geyser/network/UpstreamPacketHandler.java +++ b/core/src/main/java/org/geysermc/geyser/network/UpstreamPacketHandler.java @@ -34,7 +34,7 @@ import com.nukkitx.protocol.bedrock.v471.Bedrock_v471; import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.session.auth.AuthType; import org.geysermc.geyser.configuration.GeyserConfiguration; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.pack.ResourcePack; import org.geysermc.geyser.pack.ResourcePackManifest; import org.geysermc.geyser.registry.BlockRegistries; @@ -47,7 +47,7 @@ import java.io.InputStream; public class UpstreamPacketHandler extends LoggingPacketHandler { - public UpstreamPacketHandler(GeyserImpl geyser, GeyserSessionImpl session) { + public UpstreamPacketHandler(GeyserImpl geyser, GeyserSession session) { super(geyser, session); } diff --git a/core/src/main/java/org/geysermc/geyser/network/netty/LocalSession.java b/core/src/main/java/org/geysermc/geyser/network/netty/LocalSession.java index 781644056..7e2b18a51 100644 --- a/core/src/main/java/org/geysermc/geyser/network/netty/LocalSession.java +++ b/core/src/main/java/org/geysermc/geyser/network/netty/LocalSession.java @@ -57,7 +57,7 @@ public final class LocalSession extends TcpSession { @Override public void connect() { if (this.disconnected) { - throw new IllegalStateException("Session has already been disconnected."); + throw new IllegalStateException("Connection has already been disconnected."); } if (DEFAULT_EVENT_LOOP_GROUP == null) { diff --git a/core/src/main/java/org/geysermc/geyser/registry/PacketTranslatorRegistry.java b/core/src/main/java/org/geysermc/geyser/registry/PacketTranslatorRegistry.java index 6f9e766a0..e74d15001 100644 --- a/core/src/main/java/org/geysermc/geyser/registry/PacketTranslatorRegistry.java +++ b/core/src/main/java/org/geysermc/geyser/registry/PacketTranslatorRegistry.java @@ -31,7 +31,7 @@ import com.nukkitx.protocol.bedrock.BedrockPacket; import io.netty.channel.EventLoop; import org.geysermc.common.PlatformType; import org.geysermc.geyser.GeyserImpl; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.loader.RegistryLoaders; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.text.GeyserLocale; @@ -53,7 +53,7 @@ public class PacketTranslatorRegistry extends AbstractMappedRegistry boolean translate(Class clazz, P packet, GeyserSessionImpl session) { + public

boolean translate(Class clazz, P packet, GeyserSession session) { if (session.getUpstream().isClosed() || session.isClosed()) { return false; } @@ -77,7 +77,7 @@ public class PacketTranslatorRegistry extends AbstractMappedRegistry void translate0(GeyserSessionImpl session, PacketTranslator

translator, P packet) { + private

void translate0(GeyserSession session, PacketTranslator

translator, P packet) { if (session.isClosed()) { return; } diff --git a/core/src/main/java/org/geysermc/geyser/registry/type/ParticleMapping.java b/core/src/main/java/org/geysermc/geyser/registry/type/ParticleMapping.java index 7cdb85838..cd5ad17ce 100644 --- a/core/src/main/java/org/geysermc/geyser/registry/type/ParticleMapping.java +++ b/core/src/main/java/org/geysermc/geyser/registry/type/ParticleMapping.java @@ -26,14 +26,14 @@ package org.geysermc.geyser.registry.type; import com.nukkitx.protocol.bedrock.data.LevelEventType; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import javax.annotation.ParametersAreNullableByDefault; @ParametersAreNullableByDefault public record ParticleMapping(LevelEventType levelEventType, String identifier) { - public int getParticleId(GeyserSessionImpl session) { + public int getParticleId(GeyserSession session) { if (this.levelEventType == null) { return -1; } diff --git a/core/src/main/java/org/geysermc/geyser/scoreboard/Scoreboard.java b/core/src/main/java/org/geysermc/geyser/scoreboard/Scoreboard.java index be7ca3c84..2d7f2373f 100644 --- a/core/src/main/java/org/geysermc/geyser/scoreboard/Scoreboard.java +++ b/core/src/main/java/org/geysermc/geyser/scoreboard/Scoreboard.java @@ -35,7 +35,7 @@ import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.GeyserLogger; import org.geysermc.geyser.entity.type.Entity; import org.geysermc.geyser.entity.type.player.PlayerEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.text.GeyserLocale; import javax.annotation.Nullable; @@ -46,7 +46,7 @@ import java.util.concurrent.atomic.AtomicLong; import static org.geysermc.geyser.scoreboard.UpdateType.*; public final class Scoreboard { - private final GeyserSessionImpl session; + private final GeyserSession session; private final GeyserLogger logger; @Getter private final AtomicLong nextId = new AtomicLong(0); @@ -59,7 +59,7 @@ public final class Scoreboard { private int lastAddScoreCount = 0; private int lastRemoveScoreCount = 0; - public Scoreboard(GeyserSessionImpl session) { + public Scoreboard(GeyserSession session) { this.session = session; this.logger = GeyserImpl.getInstance().getLogger(); } diff --git a/core/src/main/java/org/geysermc/geyser/scoreboard/ScoreboardUpdater.java b/core/src/main/java/org/geysermc/geyser/scoreboard/ScoreboardUpdater.java index 4f4cd8601..80a4491ba 100644 --- a/core/src/main/java/org/geysermc/geyser/scoreboard/ScoreboardUpdater.java +++ b/core/src/main/java/org/geysermc/geyser/scoreboard/ScoreboardUpdater.java @@ -29,7 +29,7 @@ import lombok.Getter; import lombok.RequiredArgsConstructor; import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.configuration.GeyserConfiguration; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.session.cache.WorldCache; import org.geysermc.geyser.text.GeyserLocale; @@ -73,10 +73,10 @@ public final class ScoreboardUpdater extends Thread { long currentTime = System.currentTimeMillis(); // reset score-packets per second every second - Collection sessions = geyser.getSessionManager().getSessions().values(); + Collection sessions = geyser.getSessionManager().getSessions().values(); if (currentTime - lastPacketsPerSecondUpdate >= 1000) { lastPacketsPerSecondUpdate = currentTime; - for (GeyserSessionImpl session : sessions) { + for (GeyserSession session : sessions) { ScoreboardSession scoreboardSession = session.getWorldCache().getScoreboardSession(); int oldPps = scoreboardSession.getPacketsPerSecond(); @@ -96,7 +96,7 @@ public final class ScoreboardUpdater extends Thread { if (currentTime - lastUpdate >= FIRST_MILLIS_BETWEEN_UPDATES) { lastUpdate = currentTime; - for (GeyserSessionImpl session : sessions) { + for (GeyserSession session : sessions) { WorldCache worldCache = session.getWorldCache(); ScoreboardSession scoreboardSession = worldCache.getScoreboardSession(); @@ -172,7 +172,7 @@ public final class ScoreboardUpdater extends Thread { @RequiredArgsConstructor @Getter public static final class ScoreboardSession { - private final GeyserSessionImpl session; + private final GeyserSession session; private final AtomicInteger pendingPacketsPerSecond = new AtomicInteger(0); private int packetsPerSecond; private long lastUpdate; diff --git a/core/src/main/java/org/geysermc/geyser/session/GeyserSessionImpl.java b/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java similarity index 99% rename from core/src/main/java/org/geysermc/geyser/session/GeyserSessionImpl.java rename to core/src/main/java/org/geysermc/geyser/session/GeyserSession.java index 7a93a2653..595603f41 100644 --- a/core/src/main/java/org/geysermc/geyser/session/GeyserSessionImpl.java +++ b/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java @@ -76,7 +76,7 @@ import lombok.Setter; import org.geysermc.common.PlatformType; import org.geysermc.geyser.Constants; import org.geysermc.geyser.GeyserImpl; -import org.geysermc.geyser.api.session.GeyserSession; +import org.geysermc.api.geyser.GeyserConnection; import org.geysermc.geyser.command.CommandSender; import org.geysermc.geyser.entity.InteractiveTagManager; import org.geysermc.geyser.session.auth.AuthType; @@ -121,7 +121,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; @Getter -public class GeyserSessionImpl implements GeyserSession, CommandSender { +public class GeyserSession implements GeyserConnection, CommandSender { private final GeyserImpl geyser; private final UpstreamSession upstream; @@ -227,7 +227,7 @@ public class GeyserSessionImpl implements GeyserSession, CommandSender { /** * Stores a list of all lectern locations and their block entity tags. - * See {@link WorldManager#getLecternDataAt(GeyserSessionImpl, int, int, int, boolean)} + * See {@link WorldManager#getLecternDataAt(GeyserSession, int, int, int, boolean)} * for more information. */ private final Set lecternCache; @@ -459,7 +459,7 @@ public class GeyserSessionImpl implements GeyserSession, CommandSender { private MinecraftProtocol protocol; - public GeyserSessionImpl(GeyserImpl geyser, BedrockServerSession bedrockServerSession, EventLoop eventLoop) { + public GeyserSession(GeyserImpl geyser, BedrockServerSession bedrockServerSession, EventLoop eventLoop) { this.geyser = geyser; this.upstream = new UpstreamSession(bedrockServerSession); this.eventLoop = eventLoop; @@ -902,7 +902,7 @@ public class GeyserSessionImpl implements GeyserSession, CommandSender { @Override public void packetReceived(PacketReceivedEvent event) { Packet packet = event.getPacket(); - Registries.JAVA_PACKET_TRANSLATORS.translate(packet.getClass(), packet, GeyserSessionImpl.this); + Registries.JAVA_PACKET_TRANSLATORS.translate(packet.getClass(), packet, GeyserSession.this); } @Override @@ -1463,7 +1463,7 @@ public class GeyserSessionImpl implements GeyserSession, CommandSender { public void refreshEmotes(List emotes) { this.emotes.addAll(emotes); - for (GeyserSessionImpl player : geyser.getSessionManager().getSessions().values()) { + for (GeyserSession player : geyser.getSessionManager().getSessions().values()) { List pieces = new ArrayList<>(); for (UUID piece : emotes) { if (!player.getEmotes().contains(piece)) { diff --git a/core/src/main/java/org/geysermc/geyser/session/SessionManager.java b/core/src/main/java/org/geysermc/geyser/session/SessionManager.java index e70015b81..5aecdf175 100644 --- a/core/src/main/java/org/geysermc/geyser/session/SessionManager.java +++ b/core/src/main/java/org/geysermc/geyser/session/SessionManager.java @@ -38,31 +38,31 @@ public final class SessionManager { * A list of all players who don't currently have a permanent UUID attached yet. */ @Getter(AccessLevel.PACKAGE) - private final Set pendingSessions = ConcurrentHashMap.newKeySet(); + private final Set pendingSessions = ConcurrentHashMap.newKeySet(); /** * A list of all players who are currently in-game. */ @Getter - private final Map sessions = new ConcurrentHashMap<>(); + private final Map sessions = new ConcurrentHashMap<>(); /** * Called once the player has successfully authenticated to the Geyser server. */ - public void addPendingSession(GeyserSessionImpl session) { + public void addPendingSession(GeyserSession session) { pendingSessions.add(session); } /** * Called once a player has successfully logged into their Java server. */ - public void addSession(UUID uuid, GeyserSessionImpl session) { + public void addSession(UUID uuid, GeyserSession session) { pendingSessions.remove(session); sessions.put(uuid, session); } - public void removeSession(GeyserSessionImpl session) { + public void removeSession(GeyserSession session) { if (sessions.remove(session.getPlayerEntity().getUuid()) == null) { - // Session was likely pending + // Connection was likely pending pendingSessions.remove(session); } } @@ -70,16 +70,16 @@ public final class SessionManager { /** * Creates a new, immutable list containing all pending and active sessions. */ - public List getAllSessions() { - return ImmutableList.builder() // builderWithExpectedSize is probably not a good idea yet as older Spigot builds probably won't have it. + public List getAllSessions() { + return ImmutableList.builder() // builderWithExpectedSize is probably not a good idea yet as older Spigot builds probably won't have it. .addAll(pendingSessions) .addAll(sessions.values()) .build(); } public void disconnectAll(String message) { - Collection sessions = getAllSessions(); - for (GeyserSessionImpl session : sessions) { + Collection sessions = getAllSessions(); + for (GeyserSession session : sessions) { session.disconnect(GeyserLocale.getPlayerLocaleString(message, session.getLocale())); } } diff --git a/core/src/main/java/org/geysermc/geyser/session/cache/AdvancementsCache.java b/core/src/main/java/org/geysermc/geyser/session/cache/AdvancementsCache.java index d99f963ad..b6dde975c 100644 --- a/core/src/main/java/org/geysermc/geyser/session/cache/AdvancementsCache.java +++ b/core/src/main/java/org/geysermc/geyser/session/cache/AdvancementsCache.java @@ -29,7 +29,7 @@ import com.github.steveice10.mc.protocol.data.game.advancement.Advancement; import com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory.ServerboundSeenAdvancementsPacket; import lombok.Getter; import lombok.Setter; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.text.MessageTranslator; import org.geysermc.geyser.level.GeyserAdvancement; import org.geysermc.geyser.text.GeyserLocale; @@ -60,9 +60,9 @@ public class AdvancementsCache { @Setter private String currentAdvancementCategoryId = null; - private final GeyserSessionImpl session; + private final GeyserSession session; - public AdvancementsCache(GeyserSessionImpl session) { + public AdvancementsCache(GeyserSession session) { this.session = session; } diff --git a/core/src/main/java/org/geysermc/geyser/session/cache/BookEditCache.java b/core/src/main/java/org/geysermc/geyser/session/cache/BookEditCache.java index 55ed10df4..faaeafdb9 100644 --- a/core/src/main/java/org/geysermc/geyser/session/cache/BookEditCache.java +++ b/core/src/main/java/org/geysermc/geyser/session/cache/BookEditCache.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.session.cache; import com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory.ServerboundEditBookPacket; import lombok.Setter; import org.geysermc.geyser.inventory.GeyserItemStack; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; /** * Manages updating the current writable book. @@ -37,7 +37,7 @@ import org.geysermc.geyser.session.GeyserSessionImpl; * book packets. Because of this, we need to ensure packets are only send every second or so at maximum. */ public class BookEditCache { - private final GeyserSessionImpl session; + private final GeyserSession session; @Setter private ServerboundEditBookPacket packet; /** @@ -45,7 +45,7 @@ public class BookEditCache { */ private long lastBookUpdate; - public BookEditCache(GeyserSessionImpl session) { + public BookEditCache(GeyserSession session) { this.session = session; } diff --git a/core/src/main/java/org/geysermc/geyser/session/cache/BossBar.java b/core/src/main/java/org/geysermc/geyser/session/cache/BossBar.java index 842be51d6..9595a3daf 100644 --- a/core/src/main/java/org/geysermc/geyser/session/cache/BossBar.java +++ b/core/src/main/java/org/geysermc/geyser/session/cache/BossBar.java @@ -32,12 +32,12 @@ import com.nukkitx.protocol.bedrock.packet.BossEventPacket; import com.nukkitx.protocol.bedrock.packet.RemoveEntityPacket; import lombok.AllArgsConstructor; import net.kyori.adventure.text.Component; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.text.MessageTranslator; @AllArgsConstructor public class BossBar { - private final GeyserSessionImpl session; + private final GeyserSession session; private final long entityId; private Component title; diff --git a/core/src/main/java/org/geysermc/geyser/session/cache/ChunkCache.java b/core/src/main/java/org/geysermc/geyser/session/cache/ChunkCache.java index eda21b9ce..522c00d2a 100644 --- a/core/src/main/java/org/geysermc/geyser/session/cache/ChunkCache.java +++ b/core/src/main/java/org/geysermc/geyser/session/cache/ChunkCache.java @@ -30,7 +30,7 @@ import it.unimi.dsi.fastutil.longs.Long2ObjectMap; import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; import lombok.Getter; import lombok.Setter; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.level.block.BlockStateValues; import org.geysermc.geyser.level.chunk.GeyserChunk; import org.geysermc.geyser.util.MathUtils; @@ -51,7 +51,7 @@ public class ChunkCache { @Setter private boolean isExtendedHeight = false; - public ChunkCache(GeyserSessionImpl session) { + public ChunkCache(GeyserSession session) { this.cache = !session.getGeyser().getWorldManager().hasOwnChunkCache(); // To prevent Spigot from initializing chunks = cache ? new Long2ObjectOpenHashMap<>() : null; } diff --git a/core/src/main/java/org/geysermc/geyser/session/cache/EntityCache.java b/core/src/main/java/org/geysermc/geyser/session/cache/EntityCache.java index 48b05fd70..eb1bc6e9a 100644 --- a/core/src/main/java/org/geysermc/geyser/session/cache/EntityCache.java +++ b/core/src/main/java/org/geysermc/geyser/session/cache/EntityCache.java @@ -35,7 +35,7 @@ import lombok.Getter; import org.geysermc.geyser.entity.type.Entity; import org.geysermc.geyser.entity.type.Tickable; import org.geysermc.geyser.entity.type.player.PlayerEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.*; import java.util.concurrent.atomic.AtomicLong; @@ -59,7 +59,7 @@ public class EntityCache { @Getter private final AtomicLong nextEntityId = new AtomicLong(2L); - public EntityCache(GeyserSessionImpl session) { + public EntityCache(GeyserSession session) { cachedPlayerEntityLinks.defaultReturnValue(-1L); } diff --git a/core/src/main/java/org/geysermc/geyser/session/cache/FormCache.java b/core/src/main/java/org/geysermc/geyser/session/cache/FormCache.java index e3e5f3b7c..6f7d180de 100644 --- a/core/src/main/java/org/geysermc/geyser/session/cache/FormCache.java +++ b/core/src/main/java/org/geysermc/geyser/session/cache/FormCache.java @@ -32,7 +32,7 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectMap; import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; import lombok.RequiredArgsConstructor; import org.geysermc.geyser.GeyserImpl; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.cumulus.Form; import org.geysermc.cumulus.SimpleForm; @@ -44,7 +44,7 @@ import java.util.function.Consumer; public class FormCache { private final AtomicInteger formId = new AtomicInteger(0); private final Int2ObjectMap

forms = new Int2ObjectOpenHashMap<>(); - private final GeyserSessionImpl session; + private final GeyserSession session; public int addForm(Form form) { int windowId = formId.getAndIncrement(); diff --git a/core/src/main/java/org/geysermc/geyser/session/cache/PistonCache.java b/core/src/main/java/org/geysermc/geyser/session/cache/PistonCache.java index a0809e590..05e59a5bb 100644 --- a/core/src/main/java/org/geysermc/geyser/session/cache/PistonCache.java +++ b/core/src/main/java/org/geysermc/geyser/session/cache/PistonCache.java @@ -34,7 +34,7 @@ import lombok.AccessLevel; import lombok.Getter; import lombok.Setter; import org.geysermc.geyser.entity.type.player.SessionPlayerEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.level.physics.BoundingBox; import org.geysermc.geyser.translator.level.block.entity.PistonBlockEntity; import org.geysermc.geyser.level.physics.Axis; @@ -44,7 +44,7 @@ import java.util.Map; @Getter public class PistonCache { @Getter(AccessLevel.PRIVATE) - private final GeyserSessionImpl session; + private final GeyserSession session; /** * Maps the position of a piston to its block entity @@ -84,7 +84,7 @@ public class PistonCache { @Setter private boolean playerAttachedToHoney = false; - public PistonCache(GeyserSessionImpl session) { + public PistonCache(GeyserSession session) { this.session = session; } diff --git a/core/src/main/java/org/geysermc/geyser/session/cache/PreferencesCache.java b/core/src/main/java/org/geysermc/geyser/session/cache/PreferencesCache.java index a2a9a6c1c..534045f81 100644 --- a/core/src/main/java/org/geysermc/geyser/session/cache/PreferencesCache.java +++ b/core/src/main/java/org/geysermc/geyser/session/cache/PreferencesCache.java @@ -28,12 +28,12 @@ package org.geysermc.geyser.session.cache; import lombok.Getter; import lombok.Setter; import org.geysermc.geyser.configuration.GeyserConfiguration; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.util.CooldownUtils; @Getter public class PreferencesCache { - private final GeyserSessionImpl session; + private final GeyserSession session; /** * True if the client prefers being shown their coordinates, regardless if they're being shown or not. @@ -59,7 +59,7 @@ public class PreferencesCache { @Setter private CooldownUtils.CooldownType cooldownPreference = CooldownUtils.getDefaultShowCooldown(); - public PreferencesCache(GeyserSessionImpl session) { + public PreferencesCache(GeyserSession session) { this.session = session; prefersCustomSkulls = session.getGeyser().getConfig().isAllowCustomSkulls(); @@ -70,7 +70,7 @@ public class PreferencesCache { * * If {@link #prefersShowCoordinates} is true, coordinates will be shown, unless either of the following conditions apply:
*
- * {@link GeyserSessionImpl#reducedDebugInfo} is enabled + * {@link GeyserSession#reducedDebugInfo} is enabled * {@link GeyserConfiguration#isShowCoordinates()} is disabled */ public void updateShowCoordinates() { diff --git a/core/src/main/java/org/geysermc/geyser/session/cache/WorldBorder.java b/core/src/main/java/org/geysermc/geyser/session/cache/WorldBorder.java index ac99623b5..5c486af49 100644 --- a/core/src/main/java/org/geysermc/geyser/session/cache/WorldBorder.java +++ b/core/src/main/java/org/geysermc/geyser/session/cache/WorldBorder.java @@ -35,7 +35,7 @@ import lombok.Getter; import lombok.Setter; import org.geysermc.geyser.entity.EntityDefinitions; import org.geysermc.geyser.entity.type.player.PlayerEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import javax.annotation.Nonnull; import java.util.Collections; @@ -114,9 +114,9 @@ public class WorldBorder { */ private long lastUpdatedWorldBorderTime = 0; - private final GeyserSessionImpl session; + private final GeyserSession session; - public WorldBorder(GeyserSessionImpl session) { + public WorldBorder(GeyserSession session) { this.session = session; // Initialize all min/max/warning variables update(); @@ -300,7 +300,7 @@ public class WorldBorder { /** * Send the following fog IDs to the client */ - public static void sendFog(GeyserSessionImpl session, String... fogNameSpaces) { + public static void sendFog(GeyserSession session, String... fogNameSpaces) { PlayerFogPacket packet = new PlayerFogPacket(); Collections.addAll(packet.getFogStack(), fogNameSpaces); session.sendUpstreamPacket(packet); @@ -309,7 +309,7 @@ public class WorldBorder { /** * Clear any additional fog sent to the client */ - public static void removeFog(GeyserSessionImpl session) { + public static void removeFog(GeyserSession session) { session.sendUpstreamPacket(new PlayerFogPacket()); } diff --git a/core/src/main/java/org/geysermc/geyser/session/cache/WorldCache.java b/core/src/main/java/org/geysermc/geyser/session/cache/WorldCache.java index 59fe70ab2..a9564b157 100644 --- a/core/src/main/java/org/geysermc/geyser/session/cache/WorldCache.java +++ b/core/src/main/java/org/geysermc/geyser/session/cache/WorldCache.java @@ -28,19 +28,19 @@ package org.geysermc.geyser.session.cache; import com.github.steveice10.mc.protocol.data.game.setting.Difficulty; import lombok.Getter; import lombok.Setter; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.scoreboard.Scoreboard; import org.geysermc.geyser.scoreboard.ScoreboardUpdater.ScoreboardSession; @Getter public class WorldCache { - private final GeyserSessionImpl session; + private final GeyserSession session; private final ScoreboardSession scoreboardSession; private Scoreboard scoreboard; @Setter private Difficulty difficulty = Difficulty.EASY; - public WorldCache(GeyserSessionImpl session) { + public WorldCache(GeyserSession session) { this.session = session; this.scoreboard = new Scoreboard(session); scoreboardSession = new ScoreboardSession(session); diff --git a/core/src/main/java/org/geysermc/geyser/skin/FloodgateSkinUploader.java b/core/src/main/java/org/geysermc/geyser/skin/FloodgateSkinUploader.java index 792adb654..5fc45c703 100644 --- a/core/src/main/java/org/geysermc/geyser/skin/FloodgateSkinUploader.java +++ b/core/src/main/java/org/geysermc/geyser/skin/FloodgateSkinUploader.java @@ -32,7 +32,7 @@ import com.fasterxml.jackson.databind.node.ObjectNode; import lombok.Getter; import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.GeyserLogger; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.Constants; import org.geysermc.geyser.util.PluginMessageUtils; import org.geysermc.floodgate.util.WebsocketEventType; @@ -111,7 +111,7 @@ public final class FloodgateSkinUploader { } String xuid = node.get("xuid").asText(); - GeyserSessionImpl session = geyser.sessionByXuid(xuid); + GeyserSession session = geyser.connectionByXuid(xuid); if (session != null) { if (!node.get("success").asBoolean()) { diff --git a/core/src/main/java/org/geysermc/geyser/skin/SkinManager.java b/core/src/main/java/org/geysermc/geyser/skin/SkinManager.java index 58721bb1c..05f49a664 100644 --- a/core/src/main/java/org/geysermc/geyser/skin/SkinManager.java +++ b/core/src/main/java/org/geysermc/geyser/skin/SkinManager.java @@ -33,7 +33,7 @@ import com.nukkitx.protocol.bedrock.packet.PlayerListPacket; import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.session.auth.AuthType; import org.geysermc.geyser.entity.type.player.PlayerEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.session.auth.BedrockClientData; import org.geysermc.geyser.text.GeyserLocale; @@ -48,7 +48,7 @@ public class SkinManager { /** * Builds a Bedrock player list entry from our existing, cached Bedrock skin information */ - public static PlayerListPacket.Entry buildCachedEntry(GeyserSessionImpl session, PlayerEntity playerEntity) { + public static PlayerListPacket.Entry buildCachedEntry(GeyserSession session, PlayerEntity playerEntity) { GameProfileData data = GameProfileData.from(playerEntity.getProfile()); SkinProvider.Cape cape = SkinProvider.getCachedCape(data.capeUrl()); SkinProvider.SkinGeometry geometry = SkinProvider.SkinGeometry.getLegacy(data.isAlex()); @@ -74,7 +74,7 @@ public class SkinManager { /** * With all the information needed, build a Bedrock player entry with translated skin information. */ - public static PlayerListPacket.Entry buildEntryManually(GeyserSessionImpl session, UUID uuid, String username, long geyserId, + public static PlayerListPacket.Entry buildEntryManually(GeyserSession session, UUID uuid, String username, long geyserId, String skinId, byte[] skinData, String capeId, byte[] capeData, SkinProvider.SkinGeometry geometry) { @@ -86,7 +86,7 @@ public class SkinManager { // This attempts to find the XUID of the player so profile images show up for Xbox accounts String xuid = ""; - GeyserSessionImpl playerSession = GeyserImpl.getInstance().sessionByUuid(uuid); + GeyserSession playerSession = GeyserImpl.getInstance().connectionByUuid(uuid); if (playerSession != null) { xuid = playerSession.getAuthData().xuid(); @@ -112,7 +112,7 @@ public class SkinManager { return entry; } - public static void requestAndHandleSkinAndCape(PlayerEntity entity, GeyserSessionImpl session, + public static void requestAndHandleSkinAndCape(PlayerEntity entity, GeyserSession session, Consumer skinAndCapeConsumer) { GameProfileData data = GameProfileData.from(entity.getProfile()); @@ -280,7 +280,7 @@ public class SkinManager { String skinUrl = isAlex ? SkinProvider.EMPTY_SKIN_ALEX.getTextureUrl() : SkinProvider.EMPTY_SKIN.getTextureUrl(); String capeUrl = SkinProvider.EMPTY_CAPE.getTextureUrl(); if (("steve".equals(skinUrl) || "alex".equals(skinUrl)) && GeyserImpl.getInstance().getConfig().getRemote().getAuthType() != AuthType.ONLINE) { - GeyserSessionImpl session = GeyserImpl.getInstance().sessionByUuid(profile.getId()); + GeyserSession session = GeyserImpl.getInstance().connectionByUuid(profile.getId()); if (session != null) { skinUrl = session.getClientData().getSkinId(); diff --git a/core/src/main/java/org/geysermc/geyser/skin/SkinProvider.java b/core/src/main/java/org/geysermc/geyser/skin/SkinProvider.java index 5b51d203b..a79ed5b7f 100644 --- a/core/src/main/java/org/geysermc/geyser/skin/SkinProvider.java +++ b/core/src/main/java/org/geysermc/geyser/skin/SkinProvider.java @@ -37,7 +37,7 @@ import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import org.geysermc.geyser.GeyserImpl; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.util.FileUtils; import org.geysermc.geyser.util.WebUtils; @@ -143,7 +143,7 @@ public class SkinProvider { String newSkinUrl = skinUrl; if ("steve".equals(skinUrl) || "alex".equals(skinUrl)) { - GeyserSessionImpl session = GeyserImpl.getInstance().sessionByUuid(playerId); + GeyserSession session = GeyserImpl.getInstance().connectionByUuid(playerId); if (session != null) { newSkinUrl = session.getClientData().getSkinId(); diff --git a/core/src/main/java/org/geysermc/geyser/skin/SkullSkinManager.java b/core/src/main/java/org/geysermc/geyser/skin/SkullSkinManager.java index c42b9522d..100f06caf 100644 --- a/core/src/main/java/org/geysermc/geyser/skin/SkullSkinManager.java +++ b/core/src/main/java/org/geysermc/geyser/skin/SkullSkinManager.java @@ -30,7 +30,7 @@ import com.nukkitx.protocol.bedrock.data.skin.SerializedSkin; import com.nukkitx.protocol.bedrock.packet.PlayerSkinPacket; import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.entity.type.player.PlayerEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.text.GeyserLocale; import java.util.Collections; @@ -48,7 +48,7 @@ public class SkullSkinManager extends SkinManager { ); } - public static void requestAndHandleSkin(PlayerEntity entity, GeyserSessionImpl session, + public static void requestAndHandleSkin(PlayerEntity entity, GeyserSession session, Consumer skinConsumer) { GameProfileData data = GameProfileData.from(entity.getProfile()); diff --git a/core/src/main/java/org/geysermc/geyser/translator/collision/BlockCollision.java b/core/src/main/java/org/geysermc/geyser/translator/collision/BlockCollision.java index 53fc0649f..964faab0a 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/collision/BlockCollision.java +++ b/core/src/main/java/org/geysermc/geyser/translator/collision/BlockCollision.java @@ -29,7 +29,7 @@ import com.nukkitx.math.vector.Vector3d; import com.nukkitx.math.vector.Vector3i; import lombok.EqualsAndHashCode; import lombok.Getter; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.level.physics.BoundingBox; import org.geysermc.geyser.level.physics.CollisionManager; import org.geysermc.geyser.level.physics.Axis; @@ -72,7 +72,7 @@ public class BlockCollision { * While the Java server should do this, it could result in false flags by anticheat * This functionality is currently only used in 6 or 7 layer snow */ - public boolean correctPosition(GeyserSessionImpl session, int x, int y, int z, BoundingBox playerCollision) { + public boolean correctPosition(GeyserSession session, int x, int y, int z, BoundingBox playerCollision) { double playerMinY = playerCollision.getMiddleY() - (playerCollision.getSizeY() / 2); for (BoundingBox b : this.boundingBoxes) { double boxMinY = (b.getMiddleY() + y) - (b.getSizeY() / 2); diff --git a/core/src/main/java/org/geysermc/geyser/translator/collision/DoorCollision.java b/core/src/main/java/org/geysermc/geyser/translator/collision/DoorCollision.java index 4379c68b1..3c858dc92 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/collision/DoorCollision.java +++ b/core/src/main/java/org/geysermc/geyser/translator/collision/DoorCollision.java @@ -26,7 +26,7 @@ package org.geysermc.geyser.translator.collision; import lombok.EqualsAndHashCode; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.level.physics.BoundingBox; @EqualsAndHashCode(callSuper = true) @@ -59,7 +59,7 @@ public class DoorCollision extends BlockCollision { } @Override - public boolean correctPosition(GeyserSessionImpl session, int x, int y, int z, BoundingBox playerCollision) { + public boolean correctPosition(GeyserSession session, int x, int y, int z, BoundingBox playerCollision) { boolean result = super.correctPosition(session, x, y, z, playerCollision); // Hack to prevent false positives playerCollision.setSizeX(playerCollision.getSizeX() - 0.0001); diff --git a/core/src/main/java/org/geysermc/geyser/translator/collision/ScaffoldingCollision.java b/core/src/main/java/org/geysermc/geyser/translator/collision/ScaffoldingCollision.java index 72f525151..fddc2e39b 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/collision/ScaffoldingCollision.java +++ b/core/src/main/java/org/geysermc/geyser/translator/collision/ScaffoldingCollision.java @@ -26,7 +26,7 @@ package org.geysermc.geyser.translator.collision; import lombok.EqualsAndHashCode; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.level.physics.BoundingBox; /** @@ -40,7 +40,7 @@ public class ScaffoldingCollision extends BlockCollision { } @Override - public boolean correctPosition(GeyserSessionImpl session, int x, int y, int z, BoundingBox playerCollision) { + public boolean correctPosition(GeyserSession session, int x, int y, int z, BoundingBox playerCollision) { // Hack to not check below the player playerCollision.setSizeY(playerCollision.getSizeY() - 0.001); playerCollision.setMiddleY(playerCollision.getMiddleY() + 0.002); diff --git a/core/src/main/java/org/geysermc/geyser/translator/collision/SnowCollision.java b/core/src/main/java/org/geysermc/geyser/translator/collision/SnowCollision.java index 39250282a..912d6a9b9 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/collision/SnowCollision.java +++ b/core/src/main/java/org/geysermc/geyser/translator/collision/SnowCollision.java @@ -26,7 +26,7 @@ package org.geysermc.geyser.translator.collision; import lombok.EqualsAndHashCode; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.level.physics.BoundingBox; @EqualsAndHashCode(callSuper = true) @@ -61,7 +61,7 @@ public class SnowCollision extends BlockCollision { } @Override - public boolean correctPosition(GeyserSessionImpl session, int x, int y, int z, BoundingBox playerCollision) { + public boolean correctPosition(GeyserSession session, int x, int y, int z, BoundingBox playerCollision) { if (layers == 1) { // 1 layer of snow does not have collision return true; diff --git a/core/src/main/java/org/geysermc/geyser/translator/collision/TrapdoorCollision.java b/core/src/main/java/org/geysermc/geyser/translator/collision/TrapdoorCollision.java index f0d312b35..49b9f6c3f 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/collision/TrapdoorCollision.java +++ b/core/src/main/java/org/geysermc/geyser/translator/collision/TrapdoorCollision.java @@ -26,7 +26,7 @@ package org.geysermc.geyser.translator.collision; import lombok.EqualsAndHashCode; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.level.physics.BoundingBox; import org.geysermc.geyser.level.physics.CollisionManager; @@ -67,7 +67,7 @@ public class TrapdoorCollision extends BlockCollision { } @Override - public boolean correctPosition(GeyserSessionImpl session, int x, int y, int z, BoundingBox playerCollision) { + public boolean correctPosition(GeyserSession session, int x, int y, int z, BoundingBox playerCollision) { boolean result = super.correctPosition(session, x, y, z, playerCollision); // Check for door bug (doors are 0.1875 blocks thick on Java but 0.1825 blocks thick on Bedrock) if (this.checkIntersection(x, y, z, playerCollision)) { diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/AbstractBlockInventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/AbstractBlockInventoryTranslator.java index 525dfaf3e..d34f5195c 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/AbstractBlockInventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/AbstractBlockInventoryTranslator.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.translator.inventory; import com.nukkitx.protocol.bedrock.data.inventory.ContainerType; import org.geysermc.geyser.inventory.Inventory; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.inventory.holder.BlockInventoryHolder; import org.geysermc.geyser.inventory.holder.InventoryHolder; import org.geysermc.geyser.inventory.updater.InventoryUpdater; @@ -65,27 +65,27 @@ public abstract class AbstractBlockInventoryTranslator extends BaseInventoryTran } @Override - public void prepareInventory(GeyserSessionImpl session, Inventory inventory) { + public void prepareInventory(GeyserSession session, Inventory inventory) { holder.prepareInventory(this, session, inventory); } @Override - public void openInventory(GeyserSessionImpl session, Inventory inventory) { + public void openInventory(GeyserSession session, Inventory inventory) { holder.openInventory(this, session, inventory); } @Override - public void closeInventory(GeyserSessionImpl session, Inventory inventory) { + public void closeInventory(GeyserSession session, Inventory inventory) { holder.closeInventory(this, session, inventory); } @Override - public void updateInventory(GeyserSessionImpl session, Inventory inventory) { + public void updateInventory(GeyserSession session, Inventory inventory) { updater.updateInventory(this, session, inventory); } @Override - public void updateSlot(GeyserSessionImpl session, Inventory inventory, int slot) { + public void updateSlot(GeyserSession session, Inventory inventory, int slot) { updater.updateSlot(this, session, inventory, slot); } } diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/AnvilInventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/AnvilInventoryTranslator.java index 486c500de..b7aaad7b1 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/AnvilInventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/AnvilInventoryTranslator.java @@ -31,7 +31,7 @@ import com.nukkitx.protocol.bedrock.data.inventory.StackRequestSlotInfoData; import org.geysermc.geyser.inventory.AnvilContainer; import org.geysermc.geyser.inventory.Inventory; import org.geysermc.geyser.inventory.PlayerInventory; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.inventory.BedrockContainerSlot; import org.geysermc.geyser.inventory.updater.AnvilInventoryUpdater; @@ -77,7 +77,7 @@ public class AnvilInventoryTranslator extends AbstractBlockInventoryTranslator { } @Override - public void updateProperty(GeyserSessionImpl session, Inventory inventory, int key, int value) { + public void updateProperty(GeyserSession session, Inventory inventory, int key, int value) { // The only property sent by Java is key 0 which is the level cost if (key != 0) return; AnvilContainer anvilContainer = (AnvilContainer) inventory; diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/BaseInventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/BaseInventoryTranslator.java index f1db5e77c..becca359b 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/BaseInventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/BaseInventoryTranslator.java @@ -31,7 +31,7 @@ import com.nukkitx.protocol.bedrock.data.inventory.StackRequestSlotInfoData; import org.geysermc.geyser.inventory.Container; import org.geysermc.geyser.inventory.Inventory; import org.geysermc.geyser.inventory.PlayerInventory; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.inventory.BedrockContainerSlot; import org.geysermc.geyser.inventory.SlotType; @@ -41,7 +41,7 @@ public abstract class BaseInventoryTranslator extends InventoryTranslator { } @Override - public void updateProperty(GeyserSessionImpl session, Inventory inventory, int key, int value) { + public void updateProperty(GeyserSession session, Inventory inventory, int key, int value) { // } diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/BeaconInventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/BeaconInventoryTranslator.java index f7e6ebe37..f0820d9e8 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/BeaconInventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/BeaconInventoryTranslator.java @@ -41,7 +41,7 @@ import com.nukkitx.protocol.bedrock.packet.ItemStackResponsePacket; import org.geysermc.geyser.inventory.BeaconContainer; import org.geysermc.geyser.inventory.Inventory; import org.geysermc.geyser.inventory.PlayerInventory; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.inventory.BedrockContainerSlot; import org.geysermc.geyser.inventory.holder.BlockInventoryHolder; import org.geysermc.geyser.inventory.updater.UIInventoryUpdater; @@ -53,13 +53,13 @@ public class BeaconInventoryTranslator extends AbstractBlockInventoryTranslator public BeaconInventoryTranslator() { super(1, new BlockInventoryHolder("minecraft:beacon", com.nukkitx.protocol.bedrock.data.inventory.ContainerType.BEACON) { @Override - protected boolean checkInteractionPosition(GeyserSessionImpl session) { + protected boolean checkInteractionPosition(GeyserSession session) { // Since we can't fall back to a virtual inventory, let's make opening one easier return true; } @Override - public void openInventory(InventoryTranslator translator, GeyserSessionImpl session, Inventory inventory) { + public void openInventory(InventoryTranslator translator, GeyserSession session, Inventory inventory) { if (!((BeaconContainer) inventory).isUsingRealBlock()) { InventoryUtils.closeInventory(session, inventory.getId(), false); return; @@ -70,7 +70,7 @@ public class BeaconInventoryTranslator extends AbstractBlockInventoryTranslator } @Override - public void updateProperty(GeyserSessionImpl session, Inventory inventory, int key, int value) { + public void updateProperty(GeyserSession session, Inventory inventory, int key, int value) { //FIXME?: Beacon graphics look weird after inputting an item. This might be a Bedrock bug, since it resets to nothing // on BDS BeaconContainer beaconContainer = (BeaconContainer) inventory; @@ -109,7 +109,7 @@ public class BeaconInventoryTranslator extends AbstractBlockInventoryTranslator } @Override - public ItemStackResponsePacket.Response translateSpecialRequest(GeyserSessionImpl session, Inventory inventory, ItemStackRequest request) { + public ItemStackResponsePacket.Response translateSpecialRequest(GeyserSession session, Inventory inventory, ItemStackRequest request) { // Input a beacon payment BeaconPaymentStackRequestActionData beaconPayment = (BeaconPaymentStackRequestActionData) request.getActions()[0]; ServerboundSetBeaconPacket packet = new ServerboundSetBeaconPacket(beaconPayment.getPrimaryEffect(), beaconPayment.getSecondaryEffect()); diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/BrewingInventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/BrewingInventoryTranslator.java index 03c0ef224..43bea55ab 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/BrewingInventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/BrewingInventoryTranslator.java @@ -30,7 +30,7 @@ import com.nukkitx.protocol.bedrock.data.inventory.ContainerType; import com.nukkitx.protocol.bedrock.data.inventory.StackRequestSlotInfoData; import com.nukkitx.protocol.bedrock.packet.ContainerSetDataPacket; import org.geysermc.geyser.inventory.Inventory; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.inventory.BedrockContainerSlot; import org.geysermc.geyser.inventory.updater.ContainerInventoryUpdater; @@ -40,7 +40,7 @@ public class BrewingInventoryTranslator extends AbstractBlockInventoryTranslator } @Override - public void openInventory(GeyserSessionImpl session, Inventory inventory) { + public void openInventory(GeyserSession session, Inventory inventory) { super.openInventory(session, inventory); ContainerSetDataPacket dataPacket = new ContainerSetDataPacket(); dataPacket.setWindowId((byte) inventory.getId()); @@ -50,7 +50,7 @@ public class BrewingInventoryTranslator extends AbstractBlockInventoryTranslator } @Override - public void updateProperty(GeyserSessionImpl session, Inventory inventory, int key, int value) { + public void updateProperty(GeyserSession session, Inventory inventory, int key, int value) { ContainerSetDataPacket dataPacket = new ContainerSetDataPacket(); dataPacket.setWindowId((byte) inventory.getId()); switch (key) { diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/CartographyInventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/CartographyInventoryTranslator.java index b4dd3048a..08caa7784 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/CartographyInventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/CartographyInventoryTranslator.java @@ -32,7 +32,7 @@ import org.geysermc.geyser.inventory.CartographyContainer; import org.geysermc.geyser.inventory.GeyserItemStack; import org.geysermc.geyser.inventory.Inventory; import org.geysermc.geyser.inventory.PlayerInventory; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.inventory.BedrockContainerSlot; import org.geysermc.geyser.inventory.updater.UIInventoryUpdater; @@ -42,7 +42,7 @@ public class CartographyInventoryTranslator extends AbstractBlockInventoryTransl } @Override - public boolean shouldRejectItemPlace(GeyserSessionImpl session, Inventory inventory, ContainerSlotType bedrockSourceContainer, + public boolean shouldRejectItemPlace(GeyserSession session, Inventory inventory, ContainerSlotType bedrockSourceContainer, int javaSourceSlot, ContainerSlotType bedrockDestinationContainer, int javaDestinationSlot) { if (javaDestinationSlot == 0) { // Bedrock Edition can use paper or an empty map in slot 0 diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/EnchantingInventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/EnchantingInventoryTranslator.java index dd8b22fad..f18a902ff 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/EnchantingInventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/EnchantingInventoryTranslator.java @@ -37,7 +37,7 @@ import org.geysermc.geyser.inventory.EnchantingContainer; import org.geysermc.geyser.inventory.GeyserEnchantOption; import org.geysermc.geyser.inventory.Inventory; import org.geysermc.geyser.inventory.PlayerInventory; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.inventory.BedrockContainerSlot; import org.geysermc.geyser.inventory.updater.UIInventoryUpdater; import org.geysermc.geyser.inventory.item.Enchantment; @@ -51,7 +51,7 @@ public class EnchantingInventoryTranslator extends AbstractBlockInventoryTransla } @Override - public void updateProperty(GeyserSessionImpl session, Inventory inventory, int key, int value) { + public void updateProperty(GeyserSession session, Inventory inventory, int key, int value) { int slotToUpdate; EnchantingContainer enchantingInventory = (EnchantingContainer) inventory; boolean shouldUpdate = false; @@ -109,7 +109,7 @@ public class EnchantingInventoryTranslator extends AbstractBlockInventoryTransla } @Override - public ItemStackResponsePacket.Response translateSpecialRequest(GeyserSessionImpl session, Inventory inventory, ItemStackRequest request) { + public ItemStackResponsePacket.Response translateSpecialRequest(GeyserSession session, Inventory inventory, ItemStackRequest request) { // Client has requested an item to be enchanted CraftRecipeStackRequestActionData craftRecipeData = (CraftRecipeStackRequestActionData) request.getActions()[0]; EnchantingContainer enchantingInventory = (EnchantingContainer) inventory; diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/Generic3X3InventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/Generic3X3InventoryTranslator.java index 2119a8aed..4265b39e3 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/Generic3X3InventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/Generic3X3InventoryTranslator.java @@ -31,7 +31,7 @@ import com.nukkitx.protocol.bedrock.packet.ContainerOpenPacket; import org.geysermc.geyser.inventory.Generic3X3Container; import org.geysermc.geyser.inventory.Inventory; import org.geysermc.geyser.inventory.PlayerInventory; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.inventory.BedrockContainerSlot; import org.geysermc.geyser.inventory.updater.ContainerInventoryUpdater; @@ -50,7 +50,7 @@ public class Generic3X3InventoryTranslator extends AbstractBlockInventoryTransla } @Override - public void openInventory(GeyserSessionImpl session, Inventory inventory) { + public void openInventory(GeyserSession session, Inventory inventory) { ContainerOpenPacket containerOpenPacket = new ContainerOpenPacket(); containerOpenPacket.setId((byte) inventory.getId()); // Required for opening the real block - otherwise, if the container type is incorrect, it refuses to open diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/InventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/InventoryTranslator.java index 0e5fbbd90..d6bc4b186 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/InventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/InventoryTranslator.java @@ -46,7 +46,7 @@ import org.geysermc.geyser.inventory.CartographyContainer; import org.geysermc.geyser.inventory.GeyserItemStack; import org.geysermc.geyser.inventory.Inventory; import org.geysermc.geyser.inventory.PlayerInventory; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.inventory.BedrockContainerSlot; import org.geysermc.geyser.inventory.SlotType; import org.geysermc.geyser.inventory.click.Click; @@ -109,12 +109,12 @@ public abstract class InventoryTranslator { public final int size; - public abstract void prepareInventory(GeyserSessionImpl session, Inventory inventory); - public abstract void openInventory(GeyserSessionImpl session, Inventory inventory); - public abstract void closeInventory(GeyserSessionImpl session, Inventory inventory); - public abstract void updateProperty(GeyserSessionImpl session, Inventory inventory, int key, int value); - public abstract void updateInventory(GeyserSessionImpl session, Inventory inventory); - public abstract void updateSlot(GeyserSessionImpl session, Inventory inventory, int slot); + public abstract void prepareInventory(GeyserSession session, Inventory inventory); + public abstract void openInventory(GeyserSession session, Inventory inventory); + public abstract void closeInventory(GeyserSession session, Inventory inventory); + public abstract void updateProperty(GeyserSession session, Inventory inventory, int key, int value); + public abstract void updateInventory(GeyserSession session, Inventory inventory); + public abstract void updateSlot(GeyserSession session, Inventory inventory, int slot); public abstract int bedrockSlotToJava(StackRequestSlotInfoData slotInfoData); public abstract int javaSlotToBedrock(int javaSlot); public abstract BedrockContainerSlot javaSlotToBedrockContainer(int javaSlot); @@ -129,7 +129,7 @@ public abstract class InventoryTranslator { * * @return true if this transfer should be rejected */ - public boolean shouldRejectItemPlace(GeyserSessionImpl session, Inventory inventory, ContainerSlotType bedrockSourceContainer, + public boolean shouldRejectItemPlace(GeyserSession session, Inventory inventory, ContainerSlotType bedrockSourceContainer, int javaSourceSlot, ContainerSlotType bedrockDestinationContainer, int javaDestinationSlot) { return false; } @@ -145,11 +145,11 @@ public abstract class InventoryTranslator { /** * If {@link #shouldHandleRequestFirst(StackRequestActionData, Inventory)} returns true, this will be called */ - public ItemStackResponsePacket.Response translateSpecialRequest(GeyserSessionImpl session, Inventory inventory, ItemStackRequest request) { + public ItemStackResponsePacket.Response translateSpecialRequest(GeyserSession session, Inventory inventory, ItemStackRequest request) { return rejectRequest(request); } - public void translateRequests(GeyserSessionImpl session, Inventory inventory, List requests) { + public void translateRequests(GeyserSession session, Inventory inventory, List requests) { boolean refresh = false; ItemStackResponsePacket responsePacket = new ItemStackResponsePacket(); for (ItemStackRequest request : requests) { @@ -188,7 +188,7 @@ public abstract class InventoryTranslator { } } - public ItemStackResponsePacket.Response translateRequest(GeyserSessionImpl session, Inventory inventory, ItemStackRequest request) { + public ItemStackResponsePacket.Response translateRequest(GeyserSession session, Inventory inventory, ItemStackRequest request) { ClickPlan plan = new ClickPlan(session, this, inventory); IntSet affectedSlots = new IntOpenHashSet(); for (StackRequestActionData action : request.getActions()) { @@ -410,7 +410,7 @@ public abstract class InventoryTranslator { return acceptRequest(request, makeContainerEntries(session, inventory, affectedSlots)); } - public ItemStackResponsePacket.Response translateCraftingRequest(GeyserSessionImpl session, Inventory inventory, ItemStackRequest request) { + public ItemStackResponsePacket.Response translateCraftingRequest(GeyserSession session, Inventory inventory, ItemStackRequest request) { int resultSize = 0; int timesCrafted; CraftState craftState = CraftState.START; @@ -511,7 +511,7 @@ public abstract class InventoryTranslator { return acceptRequest(request, makeContainerEntries(session, inventory, plan.getAffectedSlots())); } - public ItemStackResponsePacket.Response translateAutoCraftingRequest(GeyserSessionImpl session, Inventory inventory, ItemStackRequest request) { + public ItemStackResponsePacket.Response translateAutoCraftingRequest(GeyserSession session, Inventory inventory, ItemStackRequest request) { int gridSize; int gridDimensions; if (this instanceof PlayerInventoryTranslator) { @@ -708,7 +708,7 @@ public abstract class InventoryTranslator { /** * Handled in {@link PlayerInventoryTranslator} */ - public ItemStackResponsePacket.Response translateCreativeRequest(GeyserSessionImpl session, Inventory inventory, ItemStackRequest request) { + public ItemStackResponsePacket.Response translateCreativeRequest(GeyserSession session, Inventory inventory, ItemStackRequest request) { return rejectRequest(request); } @@ -770,14 +770,14 @@ public abstract class InventoryTranslator { /** * Print out the contents of an ItemStackRequest, should the net ID check fail. */ - protected void dumpStackRequestDetails(GeyserSessionImpl session, Inventory inventory, StackRequestSlotInfoData source, StackRequestSlotInfoData destination) { + protected void dumpStackRequestDetails(GeyserSession session, Inventory inventory, StackRequestSlotInfoData source, StackRequestSlotInfoData destination) { session.getGeyser().getLogger().error("Source: " + source.toString() + " Result: " + checkNetId(session, inventory, source)); session.getGeyser().getLogger().error("Destination: " + destination.toString() + " Result: " + checkNetId(session, inventory, destination)); session.getGeyser().getLogger().error("Geyser's record of source slot: " + inventory.getItem(bedrockSlotToJava(source))); session.getGeyser().getLogger().error("Geyser's record of destination slot: " + inventory.getItem(bedrockSlotToJava(destination))); } - public boolean checkNetId(GeyserSessionImpl session, Inventory inventory, StackRequestSlotInfoData slotInfoData) { + public boolean checkNetId(GeyserSession session, Inventory inventory, StackRequestSlotInfoData slotInfoData) { int netId = slotInfoData.getStackNetworkId(); // "In my testing, sometimes the client thinks the netId of an item in the crafting grid is 1, even though we never said it was. // I think it only happens when we manually set the grid but that was my quick fix" @@ -835,7 +835,7 @@ public abstract class InventoryTranslator { return -1; } - public List makeContainerEntries(GeyserSessionImpl session, Inventory inventory, Set affectedSlots) { + public List makeContainerEntries(GeyserSession session, Inventory inventory, Set affectedSlots) { Map> containerMap = new HashMap<>(); for (int slot : affectedSlots) { BedrockContainerSlot bedrockSlot = javaSlotToBedrockContainer(slot); @@ -854,7 +854,7 @@ public abstract class InventoryTranslator { return containerEntries; } - public static ItemStackResponsePacket.ItemEntry makeItemEntry(GeyserSessionImpl session, int bedrockSlot, GeyserItemStack itemStack) { + public static ItemStackResponsePacket.ItemEntry makeItemEntry(GeyserSession session, int bedrockSlot, GeyserItemStack itemStack) { ItemStackResponsePacket.ItemEntry itemEntry; if (!itemStack.isEmpty()) { // As of 1.16.210: Bedrock needs confirmation on what the current item durability is. diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/LecternInventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/LecternInventoryTranslator.java index 623b9e708..b59914a13 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/LecternInventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/LecternInventoryTranslator.java @@ -39,7 +39,7 @@ import org.geysermc.geyser.inventory.GeyserItemStack; import org.geysermc.geyser.inventory.Inventory; import org.geysermc.geyser.inventory.LecternContainer; import org.geysermc.geyser.inventory.PlayerInventory; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.inventory.updater.InventoryUpdater; import org.geysermc.geyser.util.BlockEntityUtils; import org.geysermc.geyser.util.InventoryUtils; @@ -55,19 +55,19 @@ public class LecternInventoryTranslator extends BaseInventoryTranslator { } @Override - public void prepareInventory(GeyserSessionImpl session, Inventory inventory) { + public void prepareInventory(GeyserSession session, Inventory inventory) { } @Override - public void openInventory(GeyserSessionImpl session, Inventory inventory) { + public void openInventory(GeyserSession session, Inventory inventory) { } @Override - public void closeInventory(GeyserSessionImpl session, Inventory inventory) { + public void closeInventory(GeyserSession session, Inventory inventory) { } @Override - public void updateProperty(GeyserSessionImpl session, Inventory inventory, int key, int value) { + public void updateProperty(GeyserSession session, Inventory inventory, int key, int value) { if (key == 0) { // Lectern page update LecternContainer lecternContainer = (LecternContainer) inventory; lecternContainer.setCurrentBedrockPage(value / 2); @@ -77,7 +77,7 @@ public class LecternInventoryTranslator extends BaseInventoryTranslator { } @Override - public void updateInventory(GeyserSessionImpl session, Inventory inventory) { + public void updateInventory(GeyserSession session, Inventory inventory) { GeyserItemStack itemStack = inventory.getItem(0); if (!itemStack.isEmpty()) { updateBook(session, inventory, itemStack); @@ -85,7 +85,7 @@ public class LecternInventoryTranslator extends BaseInventoryTranslator { } @Override - public void updateSlot(GeyserSessionImpl session, Inventory inventory, int slot) { + public void updateSlot(GeyserSession session, Inventory inventory, int slot) { this.updater.updateSlot(this, session, inventory, slot); if (slot == 0) { updateBook(session, inventory, inventory.getItem(0)); @@ -95,7 +95,7 @@ public class LecternInventoryTranslator extends BaseInventoryTranslator { /** * Translate the data of the book in the lectern into a block entity tag. */ - private void updateBook(GeyserSessionImpl session, Inventory inventory, GeyserItemStack book) { + private void updateBook(GeyserSession session, Inventory inventory, GeyserItemStack book) { LecternContainer lecternContainer = (LecternContainer) inventory; if (session.isDroppingLecternBook()) { // We have to enter the inventory GUI to eject the book diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/LoomInventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/LoomInventoryTranslator.java index fcdf68cd9..d035543bc 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/LoomInventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/LoomInventoryTranslator.java @@ -43,7 +43,7 @@ import it.unimi.dsi.fastutil.objects.Object2IntMap; import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; import org.geysermc.geyser.inventory.GeyserItemStack; import org.geysermc.geyser.inventory.Inventory; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.inventory.BedrockContainerSlot; import org.geysermc.geyser.inventory.SlotType; import org.geysermc.geyser.inventory.updater.UIInventoryUpdater; @@ -102,7 +102,7 @@ public class LoomInventoryTranslator extends AbstractBlockInventoryTranslator { } @Override - public boolean shouldRejectItemPlace(GeyserSessionImpl session, Inventory inventory, ContainerSlotType bedrockSourceContainer, + public boolean shouldRejectItemPlace(GeyserSession session, Inventory inventory, ContainerSlotType bedrockSourceContainer, int javaSourceSlot, ContainerSlotType bedrockDestinationContainer, int javaDestinationSlot) { if (javaDestinationSlot != 1) { return false; @@ -125,7 +125,7 @@ public class LoomInventoryTranslator extends AbstractBlockInventoryTranslator { } @Override - public ItemStackResponsePacket.Response translateSpecialRequest(GeyserSessionImpl session, Inventory inventory, ItemStackRequest request) { + public ItemStackResponsePacket.Response translateSpecialRequest(GeyserSession session, Inventory inventory, ItemStackRequest request) { StackRequestActionData headerData = request.getActions()[0]; StackRequestActionData data = request.getActions()[1]; if (!(data instanceof CraftResultsDeprecatedStackRequestActionData craftData)) { diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/MerchantInventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/MerchantInventoryTranslator.java index 9aaca1893..cf0c475f0 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/MerchantInventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/MerchantInventoryTranslator.java @@ -39,7 +39,7 @@ import org.geysermc.geyser.entity.EntityDefinitions; import org.geysermc.geyser.inventory.Inventory; import org.geysermc.geyser.inventory.MerchantContainer; import org.geysermc.geyser.inventory.PlayerInventory; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.inventory.BedrockContainerSlot; import org.geysermc.geyser.inventory.SlotType; import org.geysermc.geyser.inventory.updater.InventoryUpdater; @@ -92,7 +92,7 @@ public class MerchantInventoryTranslator extends BaseInventoryTranslator { } @Override - public void prepareInventory(GeyserSessionImpl session, Inventory inventory) { + public void prepareInventory(GeyserSession session, Inventory inventory) { MerchantContainer merchantInventory = (MerchantContainer) inventory; if (merchantInventory.getVillager() == null) { long geyserId = session.getEntityCache().getNextEntityId().incrementAndGet(); @@ -118,13 +118,13 @@ public class MerchantInventoryTranslator extends BaseInventoryTranslator { } @Override - public void openInventory(GeyserSessionImpl session, Inventory inventory) { + public void openInventory(GeyserSession session, Inventory inventory) { //Handled in JavaMerchantOffersTranslator //TODO: send a blank inventory here in case the villager doesn't send a TradeList packet } @Override - public void closeInventory(GeyserSessionImpl session, Inventory inventory) { + public void closeInventory(GeyserSession session, Inventory inventory) { MerchantContainer merchantInventory = (MerchantContainer) inventory; if (merchantInventory.getVillager() != null) { merchantInventory.getVillager().despawnEntity(); @@ -132,19 +132,19 @@ public class MerchantInventoryTranslator extends BaseInventoryTranslator { } @Override - public ItemStackResponsePacket.Response translateAutoCraftingRequest(GeyserSessionImpl session, Inventory inventory, ItemStackRequest request) { + public ItemStackResponsePacket.Response translateAutoCraftingRequest(GeyserSession session, Inventory inventory, ItemStackRequest request) { // We're not crafting here // Called at least by consoles when pressing a trade option button return translateRequest(session, inventory, request); } @Override - public void updateInventory(GeyserSessionImpl session, Inventory inventory) { + public void updateInventory(GeyserSession session, Inventory inventory) { updater.updateInventory(this, session, inventory); } @Override - public void updateSlot(GeyserSessionImpl session, Inventory inventory, int slot) { + public void updateSlot(GeyserSession session, Inventory inventory, int slot) { updater.updateSlot(this, session, inventory, slot); } diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/PlayerInventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/PlayerInventoryTranslator.java index 026bf5be3..19fe3f58a 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/PlayerInventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/PlayerInventoryTranslator.java @@ -39,7 +39,7 @@ import it.unimi.dsi.fastutil.ints.IntSet; import org.geysermc.geyser.inventory.GeyserItemStack; import org.geysermc.geyser.inventory.Inventory; import org.geysermc.geyser.inventory.PlayerInventory; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.inventory.BedrockContainerSlot; import org.geysermc.geyser.inventory.SlotType; import org.geysermc.geyser.translator.inventory.item.ItemTranslator; @@ -58,7 +58,7 @@ public class PlayerInventoryTranslator extends InventoryTranslator { } @Override - public void updateInventory(GeyserSessionImpl session, Inventory inventory) { + public void updateInventory(GeyserSession session, Inventory inventory) { updateCraftingGrid(session, inventory); InventoryContentPacket inventoryContentPacket = new InventoryContentPacket(); @@ -94,10 +94,10 @@ public class PlayerInventoryTranslator extends InventoryTranslator { /** * Update the crafting grid for the player to hide/show the barriers in the creative inventory - * @param session Session of the player + * @param session Connection of the player * @param inventory Inventory of the player */ - public static void updateCraftingGrid(GeyserSessionImpl session, Inventory inventory) { + public static void updateCraftingGrid(GeyserSession session, Inventory inventory) { // Crafting grid for (int i = 1; i < 5; i++) { InventorySlotPacket slotPacket = new InventorySlotPacket(); @@ -115,7 +115,7 @@ public class PlayerInventoryTranslator extends InventoryTranslator { } @Override - public void updateSlot(GeyserSessionImpl session, Inventory inventory, int slot) { + public void updateSlot(GeyserSession session, Inventory inventory, int slot) { if (slot >= 1 && slot <= 44) { InventorySlotPacket slotPacket = new InventorySlotPacket(); if (slot >= 9) { @@ -208,7 +208,7 @@ public class PlayerInventoryTranslator extends InventoryTranslator { } @Override - public ItemStackResponsePacket.Response translateRequest(GeyserSessionImpl session, Inventory inventory, ItemStackRequest request) { + public ItemStackResponsePacket.Response translateRequest(GeyserSession session, Inventory inventory, ItemStackRequest request) { if (session.getGameMode() != GameMode.CREATIVE) { return super.translateRequest(session, inventory, request); } @@ -365,7 +365,7 @@ public class PlayerInventoryTranslator extends InventoryTranslator { } @Override - public ItemStackResponsePacket.Response translateCreativeRequest(GeyserSessionImpl session, Inventory inventory, ItemStackRequest request) { + public ItemStackResponsePacket.Response translateCreativeRequest(GeyserSession session, Inventory inventory, ItemStackRequest request) { ItemStack javaCreativeItem = null; IntSet affectedSlots = new IntOpenHashSet(); CraftState craftState = CraftState.START; @@ -451,7 +451,7 @@ public class PlayerInventoryTranslator extends InventoryTranslator { return acceptRequest(request, makeContainerEntries(session, inventory, affectedSlots)); } - private static void sendCreativeAction(GeyserSessionImpl session, Inventory inventory, int slot) { + private static void sendCreativeAction(GeyserSession session, Inventory inventory, int slot) { GeyserItemStack item = inventory.getItem(slot); ItemStack itemStack = item.isEmpty() ? new ItemStack(-1, 0, null) : item.getItemStack(); @@ -469,18 +469,18 @@ public class PlayerInventoryTranslator extends InventoryTranslator { } @Override - public void prepareInventory(GeyserSessionImpl session, Inventory inventory) { + public void prepareInventory(GeyserSession session, Inventory inventory) { } @Override - public void openInventory(GeyserSessionImpl session, Inventory inventory) { + public void openInventory(GeyserSession session, Inventory inventory) { } @Override - public void closeInventory(GeyserSessionImpl session, Inventory inventory) { + public void closeInventory(GeyserSession session, Inventory inventory) { } @Override - public void updateProperty(GeyserSessionImpl session, Inventory inventory, int key, int value) { + public void updateProperty(GeyserSession session, Inventory inventory, int key, int value) { } } diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/ShulkerInventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/ShulkerInventoryTranslator.java index 67d1a3989..f92474fb3 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/ShulkerInventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/ShulkerInventoryTranslator.java @@ -33,7 +33,7 @@ import com.nukkitx.protocol.bedrock.data.inventory.ContainerSlotType; import com.nukkitx.protocol.bedrock.data.inventory.ContainerType; import com.nukkitx.protocol.bedrock.packet.BlockEntityDataPacket; import org.geysermc.geyser.inventory.Inventory; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.inventory.BedrockContainerSlot; import org.geysermc.geyser.inventory.holder.BlockInventoryHolder; import org.geysermc.geyser.inventory.updater.ContainerInventoryUpdater; @@ -51,7 +51,7 @@ public class ShulkerInventoryTranslator extends AbstractBlockInventoryTranslator } @Override - protected void setCustomName(GeyserSessionImpl session, Vector3i position, Inventory inventory, int javaBlockState) { + protected void setCustomName(GeyserSession session, Vector3i position, Inventory inventory, int javaBlockState) { NbtMapBuilder tag = NbtMap.builder() .putInt("x", position.getX()) .putInt("y", position.getY()) diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/StonecutterInventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/StonecutterInventoryTranslator.java index 816a32634..ed1f38799 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/StonecutterInventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/StonecutterInventoryTranslator.java @@ -40,7 +40,7 @@ import org.geysermc.geyser.inventory.GeyserItemStack; import org.geysermc.geyser.inventory.Inventory; import org.geysermc.geyser.inventory.PlayerInventory; import org.geysermc.geyser.inventory.StonecutterContainer; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.inventory.BedrockContainerSlot; import org.geysermc.geyser.inventory.SlotType; import org.geysermc.geyser.inventory.updater.UIInventoryUpdater; @@ -57,7 +57,7 @@ public class StonecutterInventoryTranslator extends AbstractBlockInventoryTransl } @Override - public ItemStackResponsePacket.Response translateSpecialRequest(GeyserSessionImpl session, Inventory inventory, ItemStackRequest request) { + public ItemStackResponsePacket.Response translateSpecialRequest(GeyserSession session, Inventory inventory, ItemStackRequest request) { // TODO: Also surely to change in the future StackRequestActionData data = request.getActions()[1]; if (!(data instanceof CraftResultsDeprecatedStackRequestActionData craftData)) { diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/chest/ChestInventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/chest/ChestInventoryTranslator.java index 94a7c624c..417aa5bf3 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/chest/ChestInventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/chest/ChestInventoryTranslator.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.translator.inventory.chest; import com.nukkitx.protocol.bedrock.data.inventory.ContainerSlotType; import org.geysermc.geyser.inventory.Inventory; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.inventory.BedrockContainerSlot; import org.geysermc.geyser.translator.inventory.BaseInventoryTranslator; import org.geysermc.geyser.inventory.updater.ChestInventoryUpdater; @@ -42,7 +42,7 @@ public abstract class ChestInventoryTranslator extends BaseInventoryTranslator { } @Override - public boolean shouldRejectItemPlace(GeyserSessionImpl session, Inventory inventory, ContainerSlotType bedrockSourceContainer, + public boolean shouldRejectItemPlace(GeyserSession session, Inventory inventory, ContainerSlotType bedrockSourceContainer, int javaSourceSlot, ContainerSlotType bedrockDestinationContainer, int javaDestinationSlot) { // Reject any item placements that occur in the unusable inventory space if (bedrockSourceContainer == ContainerSlotType.CONTAINER && javaSourceSlot >= this.size) { @@ -52,12 +52,12 @@ public abstract class ChestInventoryTranslator extends BaseInventoryTranslator { } @Override - public void updateInventory(GeyserSessionImpl session, Inventory inventory) { + public void updateInventory(GeyserSession session, Inventory inventory) { updater.updateInventory(this, session, inventory); } @Override - public void updateSlot(GeyserSessionImpl session, Inventory inventory, int slot) { + public void updateSlot(GeyserSession session, Inventory inventory, int slot) { updater.updateSlot(this, session, inventory, slot); } diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/chest/DoubleChestInventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/chest/DoubleChestInventoryTranslator.java index 448fb3df7..a42001d34 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/chest/DoubleChestInventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/chest/DoubleChestInventoryTranslator.java @@ -35,7 +35,7 @@ import com.nukkitx.protocol.bedrock.packet.ContainerOpenPacket; import com.nukkitx.protocol.bedrock.packet.UpdateBlockPacket; import org.geysermc.geyser.inventory.Container; import org.geysermc.geyser.inventory.Inventory; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.level.block.BlockStateValues; import org.geysermc.geyser.level.block.DoubleChestValue; import org.geysermc.geyser.translator.level.block.entity.DoubleChestBlockEntityTranslator; @@ -50,7 +50,7 @@ public class DoubleChestInventoryTranslator extends ChestInventoryTranslator { } @Override - public void prepareInventory(GeyserSessionImpl session, Inventory inventory) { + public void prepareInventory(GeyserSession session, Inventory inventory) { // See BlockInventoryHolder - same concept there except we're also dealing with a specific block state if (session.getLastInteractionPlayerPosition().equals(session.getPlayerEntity().getPosition())) { int javaBlockId = session.getGeyser().getWorldManager().getBlockAt(session, session.getLastInteractionBlockPosition()); @@ -128,7 +128,7 @@ public class DoubleChestInventoryTranslator extends ChestInventoryTranslator { } @Override - public void openInventory(GeyserSessionImpl session, Inventory inventory) { + public void openInventory(GeyserSession session, Inventory inventory) { ContainerOpenPacket containerOpenPacket = new ContainerOpenPacket(); containerOpenPacket.setId((byte) inventory.getId()); containerOpenPacket.setType(ContainerType.CONTAINER); @@ -138,7 +138,7 @@ public class DoubleChestInventoryTranslator extends ChestInventoryTranslator { } @Override - public void closeInventory(GeyserSessionImpl session, Inventory inventory) { + public void closeInventory(GeyserSession session, Inventory inventory) { if (((Container) inventory).isUsingRealBlock()) { // No need to reset a block since we didn't change any blocks // But send a container close packet because we aren't destroying the original. diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/chest/SingleChestInventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/chest/SingleChestInventoryTranslator.java index a7e3b8ec7..86696b21b 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/chest/SingleChestInventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/chest/SingleChestInventoryTranslator.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.translator.inventory.chest; import com.nukkitx.protocol.bedrock.data.inventory.ContainerType; import org.geysermc.geyser.inventory.Inventory; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.inventory.holder.BlockInventoryHolder; import org.geysermc.geyser.inventory.holder.InventoryHolder; @@ -52,17 +52,17 @@ public class SingleChestInventoryTranslator extends ChestInventoryTranslator { } @Override - public void prepareInventory(GeyserSessionImpl session, Inventory inventory) { + public void prepareInventory(GeyserSession session, Inventory inventory) { holder.prepareInventory(this, session, inventory); } @Override - public void openInventory(GeyserSessionImpl session, Inventory inventory) { + public void openInventory(GeyserSession session, Inventory inventory) { holder.openInventory(this, session, inventory); } @Override - public void closeInventory(GeyserSessionImpl session, Inventory inventory) { + public void closeInventory(GeyserSession session, Inventory inventory) { holder.closeInventory(this, session, inventory); } } diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/furnace/AbstractFurnaceInventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/furnace/AbstractFurnaceInventoryTranslator.java index f40586753..de7ea4de7 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/furnace/AbstractFurnaceInventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/furnace/AbstractFurnaceInventoryTranslator.java @@ -29,7 +29,7 @@ import com.nukkitx.protocol.bedrock.data.inventory.ContainerSlotType; import com.nukkitx.protocol.bedrock.data.inventory.ContainerType; import com.nukkitx.protocol.bedrock.packet.ContainerSetDataPacket; import org.geysermc.geyser.inventory.Inventory; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.inventory.BedrockContainerSlot; import org.geysermc.geyser.inventory.SlotType; import org.geysermc.geyser.translator.inventory.AbstractBlockInventoryTranslator; @@ -41,7 +41,7 @@ public abstract class AbstractFurnaceInventoryTranslator extends AbstractBlockIn } @Override - public void updateProperty(GeyserSessionImpl session, Inventory inventory, int key, int value) { + public void updateProperty(GeyserSession session, Inventory inventory, int key, int value) { ContainerSetDataPacket dataPacket = new ContainerSetDataPacket(); dataPacket.setWindowId((byte) inventory.getId()); switch (key) { diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/horse/AbstractHorseInventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/horse/AbstractHorseInventoryTranslator.java index 689cb0a9d..b4c49cb12 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/horse/AbstractHorseInventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/horse/AbstractHorseInventoryTranslator.java @@ -26,7 +26,7 @@ package org.geysermc.geyser.translator.inventory.horse; import org.geysermc.geyser.inventory.Inventory; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.inventory.BaseInventoryTranslator; import org.geysermc.geyser.inventory.updater.HorseInventoryUpdater; import org.geysermc.geyser.inventory.updater.InventoryUpdater; @@ -40,24 +40,24 @@ public abstract class AbstractHorseInventoryTranslator extends BaseInventoryTran } @Override - public void prepareInventory(GeyserSessionImpl session, Inventory inventory) { + public void prepareInventory(GeyserSession session, Inventory inventory) { } @Override - public void openInventory(GeyserSessionImpl session, Inventory inventory) { + public void openInventory(GeyserSession session, Inventory inventory) { } @Override - public void closeInventory(GeyserSessionImpl session, Inventory inventory) { + public void closeInventory(GeyserSession session, Inventory inventory) { } @Override - public void updateInventory(GeyserSessionImpl session, Inventory inventory) { + public void updateInventory(GeyserSession session, Inventory inventory) { updater.updateInventory(this, session, inventory); } @Override - public void updateSlot(GeyserSessionImpl session, Inventory inventory, int slot) { + public void updateSlot(GeyserSession session, Inventory inventory, int slot) { updater.updateSlot(this, session, inventory, slot); } } diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/horse/ChestedHorseInventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/horse/ChestedHorseInventoryTranslator.java index 8866af56e..79f34da57 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/horse/ChestedHorseInventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/horse/ChestedHorseInventoryTranslator.java @@ -31,7 +31,7 @@ import com.nukkitx.protocol.bedrock.data.inventory.ItemData; import com.nukkitx.protocol.bedrock.data.inventory.StackRequestSlotInfoData; import com.nukkitx.protocol.bedrock.packet.InventoryContentPacket; import org.geysermc.geyser.inventory.Inventory; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.inventory.BedrockContainerSlot; import java.util.Arrays; @@ -85,7 +85,7 @@ public abstract class ChestedHorseInventoryTranslator extends AbstractHorseInven } @Override - public void updateInventory(GeyserSessionImpl session, Inventory inventory) { + public void updateInventory(GeyserSession session, Inventory inventory) { ItemData[] bedrockItems = new ItemData[36]; for (int i = 0; i < 36; i++) { final int offset = i < 9 ? 27 : -9; diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/item/ItemTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/item/ItemTranslator.java index 427b70a65..046db67c9 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/item/ItemTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/item/ItemTranslator.java @@ -35,7 +35,7 @@ import com.nukkitx.protocol.bedrock.data.inventory.ItemData; import it.unimi.dsi.fastutil.ints.Int2ObjectMap; import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; import org.geysermc.geyser.GeyserImpl; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.text.MessageTranslator; import org.geysermc.geyser.registry.BlockRegistries; import org.geysermc.geyser.registry.type.ItemMapping; @@ -126,7 +126,7 @@ public abstract class ItemTranslator { } @Nonnull - public static ItemData translateToBedrock(GeyserSessionImpl session, ItemStack stack) { + public static ItemData translateToBedrock(GeyserSession session, ItemStack stack) { if (stack == null) { return ItemData.AIR; } @@ -402,7 +402,7 @@ public abstract class ItemTranslator { * * @return the new tag to use, should the current one be null */ - public static CompoundTag translateDisplayProperties(GeyserSessionImpl session, CompoundTag tag, ItemMapping mapping) { + public static CompoundTag translateDisplayProperties(GeyserSession session, CompoundTag tag, ItemMapping mapping) { return translateDisplayProperties(session, tag, mapping, 'f'); } @@ -410,7 +410,7 @@ public abstract class ItemTranslator { * @param translationColor if this item is not available on Java, the color that the new name should be. * Normally, this should just be white, but for shulker boxes this should be gray. */ - public static CompoundTag translateDisplayProperties(GeyserSessionImpl session, CompoundTag tag, ItemMapping mapping, char translationColor) { + public static CompoundTag translateDisplayProperties(GeyserSession session, CompoundTag tag, ItemMapping mapping, char translationColor) { boolean hasCustomName = false; if (tag != null) { CompoundTag display = tag.get("display"); diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/item/NbtItemStackTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/item/NbtItemStackTranslator.java index c9c4dc5d4..6c2c501fd 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/item/NbtItemStackTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/item/NbtItemStackTranslator.java @@ -26,7 +26,7 @@ package org.geysermc.geyser.translator.inventory.item; import com.github.steveice10.opennbt.tag.builtin.CompoundTag; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.type.ItemMapping; public class NbtItemStackTranslator { @@ -37,7 +37,7 @@ public class NbtItemStackTranslator { * @param itemTag the item's CompoundTag * @param mapping Geyser's item mapping */ - public void translateToBedrock(GeyserSessionImpl session, CompoundTag itemTag, ItemMapping mapping) { + public void translateToBedrock(GeyserSession session, CompoundTag itemTag, ItemMapping mapping) { } diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/AxolotlBucketTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/AxolotlBucketTranslator.java index 418023766..071ead230 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/AxolotlBucketTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/AxolotlBucketTranslator.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.translator.inventory.item.nbt; import com.github.steveice10.opennbt.tag.builtin.ByteTag; import com.github.steveice10.opennbt.tag.builtin.CompoundTag; import com.github.steveice10.opennbt.tag.builtin.StringTag; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.inventory.item.ItemRemapper; import org.geysermc.geyser.translator.inventory.item.NbtItemStackTranslator; import org.geysermc.geyser.registry.type.ItemMapping; @@ -38,7 +38,7 @@ import org.geysermc.geyser.text.MinecraftLocale; public class AxolotlBucketTranslator extends NbtItemStackTranslator { @Override - public void translateToBedrock(GeyserSessionImpl session, CompoundTag itemTag, ItemMapping mapping) { + public void translateToBedrock(GeyserSession session, CompoundTag itemTag, ItemMapping mapping) { // Bedrock Edition displays the properties of the axolotl. Java does not. // To work around this, set the custom name to the Axolotl translation and it's displayed correctly itemTag.put(new ByteTag("AppendCustomName", (byte) 1)); diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/BasicItemTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/BasicItemTranslator.java index 83279671e..10ad58544 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/BasicItemTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/BasicItemTranslator.java @@ -26,7 +26,7 @@ package org.geysermc.geyser.translator.inventory.item.nbt; import com.github.steveice10.opennbt.tag.builtin.*; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.inventory.item.ItemRemapper; import org.geysermc.geyser.translator.text.MessageTranslator; import org.geysermc.geyser.translator.inventory.item.NbtItemStackTranslator; @@ -40,7 +40,7 @@ import java.util.List; public class BasicItemTranslator extends NbtItemStackTranslator { @Override - public void translateToBedrock(GeyserSessionImpl session, CompoundTag itemTag, ItemMapping mapping) { + public void translateToBedrock(GeyserSession session, CompoundTag itemTag, ItemMapping mapping) { Tag damage = itemTag.get("Damage"); if (damage instanceof IntTag) { int originalDurability = ((IntTag) damage).getValue(); diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/BookPagesTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/BookPagesTranslator.java index d24018287..b3371aab7 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/BookPagesTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/BookPagesTranslator.java @@ -29,7 +29,7 @@ import com.github.steveice10.opennbt.tag.builtin.CompoundTag; import com.github.steveice10.opennbt.tag.builtin.ListTag; import com.github.steveice10.opennbt.tag.builtin.StringTag; import com.github.steveice10.opennbt.tag.builtin.Tag; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.inventory.item.ItemRemapper; import org.geysermc.geyser.translator.inventory.item.NbtItemStackTranslator; import org.geysermc.geyser.translator.text.MessageTranslator; @@ -42,7 +42,7 @@ import java.util.List; public class BookPagesTranslator extends NbtItemStackTranslator { @Override - public void translateToBedrock(GeyserSessionImpl session, CompoundTag itemTag, ItemMapping mapping) { + public void translateToBedrock(GeyserSession session, CompoundTag itemTag, ItemMapping mapping) { if (!itemTag.contains("pages")) { return; } diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/CrossbowTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/CrossbowTranslator.java index f74129eab..e1dda45ed 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/CrossbowTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/CrossbowTranslator.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.translator.inventory.item.nbt; import com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack; import com.github.steveice10.opennbt.tag.builtin.*; import com.nukkitx.protocol.bedrock.data.inventory.ItemData; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.inventory.item.ItemRemapper; import org.geysermc.geyser.translator.inventory.item.ItemTranslator; import org.geysermc.geyser.translator.inventory.item.NbtItemStackTranslator; @@ -38,7 +38,7 @@ import org.geysermc.geyser.registry.type.ItemMapping; public class CrossbowTranslator extends NbtItemStackTranslator { @Override - public void translateToBedrock(GeyserSessionImpl session, CompoundTag itemTag, ItemMapping mapping) { + public void translateToBedrock(GeyserSession session, CompoundTag itemTag, ItemMapping mapping) { if (itemTag.get("ChargedProjectiles") != null) { ListTag chargedProjectiles = itemTag.get("ChargedProjectiles"); if (!chargedProjectiles.getValue().isEmpty()) { diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/EnchantedBookTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/EnchantedBookTranslator.java index aac5caa92..8a009bc2d 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/EnchantedBookTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/EnchantedBookTranslator.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.translator.inventory.item.nbt; import com.github.steveice10.opennbt.tag.builtin.CompoundTag; import com.github.steveice10.opennbt.tag.builtin.ListTag; import com.github.steveice10.opennbt.tag.builtin.Tag; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.inventory.item.ItemRemapper; import org.geysermc.geyser.translator.inventory.item.NbtItemStackTranslator; import org.geysermc.geyser.registry.type.ItemMapping; @@ -37,7 +37,7 @@ import org.geysermc.geyser.registry.type.ItemMapping; public class EnchantedBookTranslator extends NbtItemStackTranslator { @Override - public void translateToBedrock(GeyserSessionImpl session, CompoundTag itemTag, ItemMapping mapping) { + public void translateToBedrock(GeyserSession session, CompoundTag itemTag, ItemMapping mapping) { if (!itemTag.contains("StoredEnchantments")) { return; } diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/EnchantmentTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/EnchantmentTranslator.java index f011c7045..ddc5f3780 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/EnchantmentTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/EnchantmentTranslator.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.translator.inventory.item.nbt; import com.github.steveice10.opennbt.tag.builtin.*; import org.geysermc.geyser.GeyserImpl; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.inventory.item.ItemRemapper; import org.geysermc.geyser.translator.inventory.item.NbtItemStackTranslator; import org.geysermc.geyser.inventory.item.Enchantment; @@ -41,7 +41,7 @@ import java.util.Map; public class EnchantmentTranslator extends NbtItemStackTranslator { @Override - public void translateToBedrock(GeyserSessionImpl session, CompoundTag itemTag, ItemMapping mapping) { + public void translateToBedrock(GeyserSession session, CompoundTag itemTag, ItemMapping mapping) { List newTags = new ArrayList<>(); Tag enchantmentTag = itemTag.get("Enchantments"); if (enchantmentTag instanceof ListTag listTag) { diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/FireworkRocketTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/FireworkRocketTranslator.java index 25b498277..8c1154dea 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/FireworkRocketTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/FireworkRocketTranslator.java @@ -29,7 +29,7 @@ import com.github.steveice10.opennbt.tag.builtin.ByteTag; import com.github.steveice10.opennbt.tag.builtin.CompoundTag; import com.github.steveice10.opennbt.tag.builtin.ListTag; import com.github.steveice10.opennbt.tag.builtin.Tag; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.inventory.item.ItemRemapper; import org.geysermc.geyser.registry.type.ItemMapping; import org.geysermc.geyser.util.MathUtils; @@ -38,7 +38,7 @@ import org.geysermc.geyser.util.MathUtils; public class FireworkRocketTranslator extends FireworkBaseTranslator { @Override - public void translateToBedrock(GeyserSessionImpl session, CompoundTag itemTag, ItemMapping mapping) { + public void translateToBedrock(GeyserSession session, CompoundTag itemTag, ItemMapping mapping) { CompoundTag fireworks = itemTag.get("Fireworks"); if (fireworks == null) { return; diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/FireworkStarTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/FireworkStarTranslator.java index c1ff272f2..e66589f6d 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/FireworkStarTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/FireworkStarTranslator.java @@ -29,7 +29,7 @@ import com.github.steveice10.opennbt.tag.builtin.CompoundTag; import com.github.steveice10.opennbt.tag.builtin.IntArrayTag; import com.github.steveice10.opennbt.tag.builtin.IntTag; import com.github.steveice10.opennbt.tag.builtin.Tag; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.inventory.item.ItemRemapper; import org.geysermc.geyser.registry.type.ItemMapping; @@ -37,7 +37,7 @@ import org.geysermc.geyser.registry.type.ItemMapping; public class FireworkStarTranslator extends FireworkBaseTranslator { @Override - public void translateToBedrock(GeyserSessionImpl session, CompoundTag itemTag, ItemMapping mapping) { + public void translateToBedrock(GeyserSession session, CompoundTag itemTag, ItemMapping mapping) { Tag explosion = itemTag.get("Explosion"); if (explosion instanceof CompoundTag) { CompoundTag newExplosion = translateExplosionToBedrock((CompoundTag) explosion, "FireworksItem"); diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/LeatherArmorTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/LeatherArmorTranslator.java index c66968124..ddf76b595 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/LeatherArmorTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/LeatherArmorTranslator.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.translator.inventory.item.nbt; import com.github.steveice10.opennbt.tag.builtin.CompoundTag; import com.github.steveice10.opennbt.tag.builtin.IntTag; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.inventory.item.ItemRemapper; import org.geysermc.geyser.translator.inventory.item.NbtItemStackTranslator; import org.geysermc.geyser.registry.type.ItemMapping; @@ -42,7 +42,7 @@ public class LeatherArmorTranslator extends NbtItemStackTranslator { "minecraft:leather_leggings", "minecraft:leather_boots", "minecraft:leather_horse_armor"); @Override - public void translateToBedrock(GeyserSessionImpl session, CompoundTag itemTag, ItemMapping mapping) { + public void translateToBedrock(GeyserSession session, CompoundTag itemTag, ItemMapping mapping) { CompoundTag displayTag = itemTag.get("display"); if (displayTag == null) { return; diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/LodestoneCompassTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/LodestoneCompassTranslator.java index ca4cd2fcb..924735626 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/LodestoneCompassTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/LodestoneCompassTranslator.java @@ -26,7 +26,7 @@ package org.geysermc.geyser.translator.inventory.item.nbt; import com.github.steveice10.opennbt.tag.builtin.*; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.inventory.item.ItemRemapper; import org.geysermc.geyser.translator.inventory.item.NbtItemStackTranslator; import org.geysermc.geyser.registry.type.ItemMapping; @@ -35,7 +35,7 @@ import org.geysermc.geyser.registry.type.ItemMapping; public class LodestoneCompassTranslator extends NbtItemStackTranslator { @Override - public void translateToBedrock(GeyserSessionImpl session, CompoundTag itemTag, ItemMapping mapping) { + public void translateToBedrock(GeyserSession session, CompoundTag itemTag, ItemMapping mapping) { Tag lodestoneTag = itemTag.get("LodestoneTracked"); if (lodestoneTag instanceof ByteTag) { int trackId = session.getLodestoneCache().store(itemTag); diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/MapItemTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/MapItemTranslator.java index 1d96db42a..23739340e 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/MapItemTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/MapItemTranslator.java @@ -26,7 +26,7 @@ package org.geysermc.geyser.translator.inventory.item.nbt; import com.github.steveice10.opennbt.tag.builtin.*; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.inventory.item.ItemRemapper; import org.geysermc.geyser.translator.inventory.item.NbtItemStackTranslator; import org.geysermc.geyser.registry.type.ItemMapping; @@ -35,7 +35,7 @@ import org.geysermc.geyser.registry.type.ItemMapping; public class MapItemTranslator extends NbtItemStackTranslator { @Override - public void translateToBedrock(GeyserSessionImpl session, CompoundTag itemTag, ItemMapping mapping) { + public void translateToBedrock(GeyserSession session, CompoundTag itemTag, ItemMapping mapping) { // Can be either an IntTag or ShortTag Tag mapId = itemTag.get("map"); if (mapId == null) return; diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/PlayerHeadTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/PlayerHeadTranslator.java index 18ccde054..1e182568a 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/PlayerHeadTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/PlayerHeadTranslator.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.translator.inventory.item.nbt; import com.github.steveice10.opennbt.tag.builtin.CompoundTag; import com.github.steveice10.opennbt.tag.builtin.StringTag; import com.github.steveice10.opennbt.tag.builtin.Tag; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.inventory.item.ItemRemapper; import org.geysermc.geyser.translator.inventory.item.NbtItemStackTranslator; import org.geysermc.geyser.registry.type.ItemMapping; @@ -38,7 +38,7 @@ import org.geysermc.geyser.text.MinecraftLocale; public class PlayerHeadTranslator extends NbtItemStackTranslator { @Override - public void translateToBedrock(GeyserSessionImpl session, CompoundTag itemTag, ItemMapping mapping) { + public void translateToBedrock(GeyserSession session, CompoundTag itemTag, ItemMapping mapping) { if (!itemTag.contains("display") || !((CompoundTag) itemTag.get("display")).contains("Name")) { if (itemTag.contains("SkullOwner")) { StringTag name; diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/ShulkerBoxItemTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/ShulkerBoxItemTranslator.java index 4182278d6..f4160ec08 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/ShulkerBoxItemTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/ShulkerBoxItemTranslator.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.translator.inventory.item.nbt; import com.github.steveice10.mc.protocol.data.game.Identifier; import com.github.steveice10.opennbt.tag.builtin.*; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.inventory.item.ItemRemapper; import org.geysermc.geyser.registry.type.ItemMapping; import org.geysermc.geyser.translator.inventory.item.ItemTranslator; @@ -38,7 +38,7 @@ import org.geysermc.geyser.util.MathUtils; public class ShulkerBoxItemTranslator extends NbtItemStackTranslator { @Override - public void translateToBedrock(GeyserSessionImpl session, CompoundTag itemTag, ItemMapping mapping) { + public void translateToBedrock(GeyserSession session, CompoundTag itemTag, ItemMapping mapping) { if (!itemTag.contains("BlockEntityTag")) return; // Empty shulker box CompoundTag blockEntityTag = itemTag.get("BlockEntityTag"); diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/TropicalFishBucketTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/TropicalFishBucketTranslator.java index 7c396fd28..316ebc1ae 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/TropicalFishBucketTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/item/nbt/TropicalFishBucketTranslator.java @@ -31,7 +31,7 @@ import net.kyori.adventure.text.format.NamedTextColor; import net.kyori.adventure.text.format.Style; import net.kyori.adventure.text.format.TextDecoration; import org.geysermc.geyser.entity.type.living.animal.TropicalFishEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.inventory.item.ItemRemapper; import org.geysermc.geyser.translator.text.MessageTranslator; import org.geysermc.geyser.translator.inventory.item.NbtItemStackTranslator; @@ -47,7 +47,7 @@ public class TropicalFishBucketTranslator extends NbtItemStackTranslator { private static final Style LORE_STYLE = Style.style(NamedTextColor.GRAY, TextDecoration.ITALIC); @Override - public void translateToBedrock(GeyserSessionImpl session, CompoundTag itemTag, ItemMapping mapping) { + public void translateToBedrock(GeyserSession session, CompoundTag itemTag, ItemMapping mapping) { // Prevent name from appearing as "Bucket of" itemTag.put(new ByteTag("AppendCustomName", (byte) 1)); itemTag.put(new StringTag("CustomName", MinecraftLocale.getLocaleString("entity.minecraft.tropical_fish", session.getLocale()))); diff --git a/core/src/main/java/org/geysermc/geyser/translator/level/BiomeTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/level/BiomeTranslator.java index 2358b197d..6cafb6012 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/level/BiomeTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/level/BiomeTranslator.java @@ -35,7 +35,7 @@ import it.unimi.dsi.fastutil.ints.Int2IntMap; import it.unimi.dsi.fastutil.ints.IntArrayList; import it.unimi.dsi.fastutil.ints.IntList; import it.unimi.dsi.fastutil.ints.IntLists; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.level.chunk.BlockStorage; import org.geysermc.geyser.level.chunk.GeyserChunkSection; import org.geysermc.geyser.level.chunk.bitarray.BitArray; @@ -47,7 +47,7 @@ import org.geysermc.geyser.util.MathUtils; // Array index formula by https://wiki.vg/Chunk_Format public class BiomeTranslator { - public static void loadServerBiomes(GeyserSessionImpl session, CompoundTag codec) { + public static void loadServerBiomes(GeyserSession session, CompoundTag codec) { Int2IntMap biomeTranslations = session.getBiomeTranslations(); biomeTranslations.clear(); @@ -87,7 +87,7 @@ public class BiomeTranslator { } } - public static BlockStorage toNewBedrockBiome(GeyserSessionImpl session, DataPalette biomeData) { + public static BlockStorage toNewBedrockBiome(GeyserSession session, DataPalette biomeData) { Int2IntMap biomeTranslations = session.getBiomeTranslations(); // As of 1.17.10: the client expects the same format as a chunk but filled with biomes // As of 1.18 this is the same as Java Edition diff --git a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/BedrockOnlyBlockEntity.java b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/BedrockOnlyBlockEntity.java index af1eea293..3534e5be7 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/BedrockOnlyBlockEntity.java +++ b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/BedrockOnlyBlockEntity.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.translator.level.block.entity; import com.nukkitx.math.vector.Vector3i; import com.nukkitx.nbt.NbtMap; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; /** * Implemented only if a block is a block entity in Bedrock and not Java Edition. @@ -42,11 +42,11 @@ public interface BedrockOnlyBlockEntity extends RequiresBlockState { /** * Update the block on Bedrock Edition. - * @param session GeyserSession. + * @param session GeyserConnection. * @param blockState The Java block state. * @param position The Bedrock block position. */ - void updateBlock(GeyserSessionImpl session, int blockState, Vector3i position); + void updateBlock(GeyserSession session, int blockState, Vector3i position); /** * Get the tag of the Bedrock-only block entity @@ -54,7 +54,7 @@ public interface BedrockOnlyBlockEntity extends RequiresBlockState { * @param blockState Java BlockState of block. * @return Bedrock tag, or null if not a Bedrock-only Block Entity */ - static NbtMap getTag(GeyserSessionImpl session, Vector3i position, int blockState) { + static NbtMap getTag(GeyserSession session, Vector3i position, int blockState) { if (FlowerPotBlockEntityTranslator.isFlowerBlock(blockState)) { return FlowerPotBlockEntityTranslator.getTag(session, blockState, position); } else if (PistonBlockEntityTranslator.isBlock(blockState)) { diff --git a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/DoubleChestBlockEntityTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/DoubleChestBlockEntityTranslator.java index 9fe087cb9..e41f9e492 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/DoubleChestBlockEntityTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/DoubleChestBlockEntityTranslator.java @@ -29,7 +29,7 @@ import com.github.steveice10.mc.protocol.data.game.level.block.BlockEntityType; import com.github.steveice10.opennbt.tag.builtin.CompoundTag; import com.nukkitx.math.vector.Vector3i; import com.nukkitx.nbt.NbtMapBuilder; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.level.block.BlockStateValues; import org.geysermc.geyser.level.block.DoubleChestValue; import org.geysermc.geyser.util.BlockEntityUtils; @@ -45,7 +45,7 @@ public class DoubleChestBlockEntityTranslator extends BlockEntityTranslator impl } @Override - public void updateBlock(GeyserSessionImpl session, int blockState, Vector3i position) { + public void updateBlock(GeyserSession session, int blockState, Vector3i position) { CompoundTag javaTag = getConstantJavaTag("chest", position.getX(), position.getY(), position.getZ()); NbtMapBuilder tagBuilder = getConstantBedrockTag(BlockEntityUtils.getBedrockBlockEntityId(BlockEntityType.CHEST), position.getX(), position.getY(), position.getZ()); translateTag(tagBuilder, javaTag, blockState); diff --git a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/FlowerPotBlockEntityTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/FlowerPotBlockEntityTranslator.java index 01d3952a6..b6c498d9f 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/FlowerPotBlockEntityTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/FlowerPotBlockEntityTranslator.java @@ -29,7 +29,7 @@ import com.nukkitx.math.vector.Vector3i; import com.nukkitx.nbt.NbtMap; import com.nukkitx.nbt.NbtMapBuilder; import com.nukkitx.protocol.bedrock.packet.UpdateBlockPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.level.block.BlockStateValues; import org.geysermc.geyser.util.BlockEntityUtils; @@ -49,7 +49,7 @@ public class FlowerPotBlockEntityTranslator implements BedrockOnlyBlockEntity { * @param position Bedrock position of flower pot. * @return Bedrock tag of flower pot. */ - public static NbtMap getTag(GeyserSessionImpl session, int blockState, Vector3i position) { + public static NbtMap getTag(GeyserSession session, int blockState, Vector3i position) { NbtMapBuilder tagBuilder = NbtMap.builder() .putInt("x", position.getX()) .putInt("y", position.getY()) @@ -75,7 +75,7 @@ public class FlowerPotBlockEntityTranslator implements BedrockOnlyBlockEntity { } @Override - public void updateBlock(GeyserSessionImpl session, int blockState, Vector3i position) { + public void updateBlock(GeyserSession session, int blockState, Vector3i position) { NbtMap tag = getTag(session, blockState, position); BlockEntityUtils.updateBlockEntity(session, tag, position); UpdateBlockPacket updateBlockPacket = new UpdateBlockPacket(); diff --git a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/NoteblockBlockEntityTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/NoteblockBlockEntityTranslator.java index db29afc6f..1d61d0e30 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/NoteblockBlockEntityTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/NoteblockBlockEntityTranslator.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.translator.level.block.entity; import com.github.steveice10.mc.protocol.data.game.entity.metadata.Position; import com.nukkitx.math.vector.Vector3i; import com.nukkitx.protocol.bedrock.packet.BlockEventPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.level.block.BlockStateValues; /** @@ -36,7 +36,7 @@ import org.geysermc.geyser.level.block.BlockStateValues; */ public class NoteblockBlockEntityTranslator { - public static void translate(GeyserSessionImpl session, Position position) { + public static void translate(GeyserSession session, Position position) { int blockState = session.getGeyser().getWorldManager().getBlockAt(session, position); BlockEventPacket blockEventPacket = new BlockEventPacket(); blockEventPacket.setBlockPosition(Vector3i.from(position.getX(), position.getY(), position.getZ())); diff --git a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/PistonBlockEntity.java b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/PistonBlockEntity.java index 44d87a70c..1363f6641 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/PistonBlockEntity.java +++ b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/PistonBlockEntity.java @@ -39,7 +39,7 @@ import lombok.Getter; import org.geysermc.common.PlatformType; import org.geysermc.geyser.level.physics.Axis; import org.geysermc.geyser.level.physics.Direction; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.session.cache.PistonCache; import org.geysermc.geyser.level.physics.BoundingBox; import org.geysermc.geyser.level.physics.CollisionManager; @@ -54,7 +54,7 @@ import java.util.Queue; import java.util.Set; public class PistonBlockEntity { - private final GeyserSessionImpl session; + private final GeyserSession session; @Getter private final Vector3i position; private final Direction orientation; @@ -104,7 +104,7 @@ public class PistonBlockEntity { HONEY_BOUNDING_BOX = new BoundingBox(0.5, honeyHeight + boundingBoxHeight / 2, 0.5, blockBoundingBox.getSizeX(), boundingBoxHeight, blockBoundingBox.getSizeZ()); } - public PistonBlockEntity(GeyserSessionImpl session, Vector3i position, Direction orientation, boolean sticky, boolean extended) { + public PistonBlockEntity(GeyserSession session, Vector3i position, Direction orientation, boolean sticky, boolean extended) { this.session = session; this.position = position; this.orientation = orientation; diff --git a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/SkullBlockEntityTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/SkullBlockEntityTranslator.java index 6bdc8e16f..b6b41db6d 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/SkullBlockEntityTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/SkullBlockEntityTranslator.java @@ -35,7 +35,7 @@ import com.nukkitx.math.vector.Vector3i; import com.nukkitx.nbt.NbtMapBuilder; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import org.geysermc.geyser.entity.type.player.SkullPlayerEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.level.block.BlockStateValues; import org.geysermc.geyser.skin.SkinProvider; import org.geysermc.geyser.skin.SkullSkinManager; @@ -85,7 +85,7 @@ public class SkullBlockEntityTranslator extends BlockEntityTranslator implements return CompletableFuture.completedFuture(null); } - public static void spawnPlayer(GeyserSessionImpl session, CompoundTag tag, int posX, int posY, int posZ, int blockState) { + public static void spawnPlayer(GeyserSession session, CompoundTag tag, int posX, int posY, int posZ, int blockState) { float x = posX + .5f; float y = posY - .01f; float z = posZ + .5f; @@ -123,7 +123,7 @@ public class SkullBlockEntityTranslator extends BlockEntityTranslator implements }); } - private static void spawnPlayer(GeyserSessionImpl session, GameProfile profile, Vector3i blockPosition, + private static void spawnPlayer(GeyserSession session, GameProfile profile, Vector3i blockPosition, Vector3f entityPosition, float rotation, int blockState) { long geyserId = session.getEntityCache().getNextEntityId().incrementAndGet(); diff --git a/core/src/main/java/org/geysermc/geyser/translator/level/event/LevelEventTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/level/event/LevelEventTranslator.java index 34fe04a76..c06998af4 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/level/event/LevelEventTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/level/event/LevelEventTranslator.java @@ -26,7 +26,7 @@ package org.geysermc.geyser.translator.level.event; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundLevelEventPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; /** * Represents an event capable of translating itself into bedrock @@ -35,8 +35,8 @@ public interface LevelEventTranslator { /** * Translates the given {@link ClientboundLevelEventPacket} into bedrock and sends it upstream. * - * @param session GeyserSession + * @param session GeyserConnection * @param packet the effect packet to handle */ - void translate(GeyserSessionImpl session, ClientboundLevelEventPacket packet); + void translate(GeyserSession session, ClientboundLevelEventPacket packet); } diff --git a/core/src/main/java/org/geysermc/geyser/translator/level/event/PlaySoundEventTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/level/event/PlaySoundEventTranslator.java index 6d976989f..df882d0d0 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/level/event/PlaySoundEventTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/level/event/PlaySoundEventTranslator.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.translator.level.event; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundLevelEventPacket; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.packet.PlaySoundPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.Random; import java.util.concurrent.ThreadLocalRandom; @@ -36,7 +36,7 @@ import java.util.concurrent.ThreadLocalRandom; public record PlaySoundEventTranslator(String name, float volume, boolean pitchSub, float pitchMul, float pitchAdd, boolean relative) implements LevelEventTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundLevelEventPacket packet) { + public void translate(GeyserSession session, ClientboundLevelEventPacket packet) { Random rand = ThreadLocalRandom.current(); PlaySoundPacket playSoundPacket = new PlaySoundPacket(); playSoundPacket.setSound(name); diff --git a/core/src/main/java/org/geysermc/geyser/translator/level/event/SoundEventEventTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/level/event/SoundEventEventTranslator.java index b12065744..5c3e890a2 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/level/event/SoundEventEventTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/level/event/SoundEventEventTranslator.java @@ -29,12 +29,12 @@ import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.Clientb import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.SoundEvent; import com.nukkitx.protocol.bedrock.packet.LevelSoundEventPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; public record SoundEventEventTranslator(SoundEvent soundEvent, String identifier, int extraData) implements LevelEventTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundLevelEventPacket packet) { + public void translate(GeyserSession session, ClientboundLevelEventPacket packet) { LevelSoundEventPacket levelSoundEvent = new LevelSoundEventPacket(); levelSoundEvent.setSound(soundEvent); levelSoundEvent.setIdentifier(identifier); diff --git a/core/src/main/java/org/geysermc/geyser/translator/level/event/SoundLevelEventTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/level/event/SoundLevelEventTranslator.java index b5414bc40..48a4bf2fd 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/level/event/SoundLevelEventTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/level/event/SoundLevelEventTranslator.java @@ -29,12 +29,12 @@ import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.Clientb import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.LevelEventType; import com.nukkitx.protocol.bedrock.packet.LevelEventPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; public record SoundLevelEventTranslator(LevelEventType levelEventType, int data) implements LevelEventTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundLevelEventPacket packet) { + public void translate(GeyserSession session, ClientboundLevelEventPacket packet) { LevelEventPacket eventPacket = new LevelEventPacket(); eventPacket.setType(levelEventType); eventPacket.setData(data); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/PacketTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/PacketTranslator.java index 1045e8ef8..37485120d 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/PacketTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/PacketTranslator.java @@ -25,11 +25,11 @@ package org.geysermc.geyser.translator.protocol; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; public abstract class PacketTranslator { - public abstract void translate(GeyserSessionImpl session, T packet); + public abstract void translate(GeyserSession session, T packet); /** * Determines if this packet should be handled in the session's event loop. This should generally be true - diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockAdventureSettingsTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockAdventureSettingsTranslator.java index 5a29d4a24..d4de9e22a 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockAdventureSettingsTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockAdventureSettingsTranslator.java @@ -30,7 +30,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.serverbound.player.Server import com.nukkitx.protocol.bedrock.data.AdventureSetting; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import com.nukkitx.protocol.bedrock.packet.AdventureSettingsPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -38,7 +38,7 @@ import org.geysermc.geyser.translator.protocol.Translator; public class BedrockAdventureSettingsTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, AdventureSettingsPacket packet) { + 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 diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockAnimateTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockAnimateTranslator.java index b03272a87..d52a66be7 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockAnimateTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockAnimateTranslator.java @@ -29,7 +29,7 @@ import com.github.steveice10.mc.protocol.data.game.entity.player.Hand; import com.github.steveice10.mc.protocol.packet.ingame.serverbound.level.ServerboundPaddleBoatPacket; import com.github.steveice10.mc.protocol.packet.ingame.serverbound.player.ServerboundSwingPacket; import com.nukkitx.protocol.bedrock.packet.AnimatePacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -39,7 +39,7 @@ import java.util.concurrent.TimeUnit; public class BedrockAnimateTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, AnimatePacket packet) { + public void translate(GeyserSession session, AnimatePacket packet) { // Stop the player sending animations before they have fully spawned into the server if (!session.isSpawned()) { return; diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockBlockEntityDataTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockBlockEntityDataTranslator.java index 8c5e449c5..828f5a934 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockBlockEntityDataTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockBlockEntityDataTranslator.java @@ -30,7 +30,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory.Ser import com.github.steveice10.mc.protocol.packet.ingame.serverbound.level.ServerboundSignUpdatePacket; import com.nukkitx.nbt.NbtMap; import com.nukkitx.protocol.bedrock.packet.BlockEntityDataPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.util.SignUtils; @@ -39,7 +39,7 @@ import org.geysermc.geyser.util.SignUtils; public class BedrockBlockEntityDataTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, BlockEntityDataPacket packet) { + 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 diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockBlockPickRequestTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockBlockPickRequestTranslator.java index 87a433567..a0bd43455 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockBlockPickRequestTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockBlockPickRequestTranslator.java @@ -29,7 +29,7 @@ import com.nukkitx.math.vector.Vector3i; import com.nukkitx.protocol.bedrock.packet.BlockPickRequestPacket; import org.geysermc.geyser.entity.EntityDefinitions; import org.geysermc.geyser.entity.type.ItemFrameEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.level.block.BlockStateValues; @@ -40,7 +40,7 @@ import org.geysermc.geyser.util.InventoryUtils; public class BedrockBlockPickRequestTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, BlockPickRequestPacket packet) { + public void translate(GeyserSession session, BlockPickRequestPacket packet) { Vector3i vector = packet.getBlockPosition(); int blockToPick = session.getGeyser().getWorldManager().getBlockAt(session, vector.getX(), vector.getY(), vector.getZ()); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockBookEditTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockBookEditTranslator.java index 3d113d8d3..bead427db 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockBookEditTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockBookEditTranslator.java @@ -33,7 +33,7 @@ import com.github.steveice10.opennbt.tag.builtin.StringTag; import com.github.steveice10.opennbt.tag.builtin.Tag; import com.nukkitx.protocol.bedrock.packet.BookEditPacket; import org.geysermc.geyser.inventory.GeyserItemStack; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -49,7 +49,7 @@ public class BedrockBookEditTranslator extends PacketTranslator private static final int MAXIMUM_TITLE_LENGTH = 128 * 4; @Override - public void translate(GeyserSessionImpl session, BookEditPacket packet) { + 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.getGeyser().getLogger().warning("Page length greater than server allowed!"); return; diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockCommandBlockUpdateTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockCommandBlockUpdateTranslator.java index 4f6750444..f0cf4ff8c 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockCommandBlockUpdateTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockCommandBlockUpdateTranslator.java @@ -30,7 +30,7 @@ import com.github.steveice10.mc.protocol.data.game.level.block.CommandBlockMode; import com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory.ServerboundSetCommandMinecartPacket; import com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory.ServerboundSetCommandBlockPacket; import com.nukkitx.protocol.bedrock.packet.CommandBlockUpdatePacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -38,7 +38,7 @@ import org.geysermc.geyser.translator.protocol.Translator; public class BedrockCommandBlockUpdateTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, CommandBlockUpdatePacket packet) { + public void translate(GeyserSession session, CommandBlockUpdatePacket packet) { String command = packet.getCommand(); boolean outputTracked = packet.isOutputTracked(); if (packet.isBlock()) { diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockCommandRequestTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockCommandRequestTranslator.java index bc25acc16..a67b81434 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockCommandRequestTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockCommandRequestTranslator.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.translator.protocol.bedrock; import org.geysermc.common.PlatformType; import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.command.CommandManager; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -40,7 +40,7 @@ import org.geysermc.geyser.translator.text.MessageTranslator; public class BedrockCommandRequestTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, CommandRequestPacket packet) { + public void translate(GeyserSession session, CommandRequestPacket packet) { String command = packet.getCommand().replace("/", ""); CommandManager commandManager = GeyserImpl.getInstance().getCommandManager(); if (session.getGeyser().getPlatformType() == PlatformType.STANDALONE && command.trim().startsWith("geyser ") && commandManager.getCommands().containsKey(command.split(" ")[1])) { diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockContainerCloseTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockContainerCloseTranslator.java index 00cf6607c..4c1f55018 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockContainerCloseTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockContainerCloseTranslator.java @@ -29,7 +29,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory.Ser import com.nukkitx.protocol.bedrock.packet.ContainerClosePacket; import org.geysermc.geyser.inventory.Inventory; import org.geysermc.geyser.inventory.MerchantContainer; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.util.InventoryUtils; @@ -38,7 +38,7 @@ import org.geysermc.geyser.util.InventoryUtils; public class BedrockContainerCloseTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ContainerClosePacket packet) { + public void translate(GeyserSession session, ContainerClosePacket packet) { byte windowId = packet.getId(); //Client wants close confirmation diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockEmoteListTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockEmoteListTranslator.java index 1f5ad7c15..dac5fe638 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockEmoteListTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockEmoteListTranslator.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.translator.protocol.bedrock; import com.nukkitx.protocol.bedrock.packet.EmoteListPacket; import org.geysermc.geyser.configuration.EmoteOffhandWorkaroundOption; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -35,7 +35,7 @@ import org.geysermc.geyser.translator.protocol.Translator; public class BedrockEmoteListTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, EmoteListPacket packet) { + public void translate(GeyserSession session, EmoteListPacket packet) { if (session.getGeyser().getConfig().getEmoteOffhandWorkaround() == EmoteOffhandWorkaroundOption.NO_EMOTES) { return; } diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockEntityPickRequestTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockEntityPickRequestTranslator.java index 9ea36061e..732142573 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockEntityPickRequestTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockEntityPickRequestTranslator.java @@ -29,7 +29,7 @@ import com.github.steveice10.mc.protocol.data.game.entity.player.GameMode; import com.nukkitx.protocol.bedrock.packet.EntityPickRequestPacket; import org.geysermc.geyser.entity.type.BoatEntity; import org.geysermc.geyser.entity.type.Entity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.registry.type.ItemMapping; @@ -44,7 +44,7 @@ import java.util.Locale; public class BedrockEntityPickRequestTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, EntityPickRequestPacket packet) { + 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; diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockFilterTextTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockFilterTextTranslator.java index 520aa8d93..b7961c8fb 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockFilterTextTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockFilterTextTranslator.java @@ -29,7 +29,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory.Ser import com.nukkitx.protocol.bedrock.packet.FilterTextPacket; import org.geysermc.geyser.inventory.AnvilContainer; import org.geysermc.geyser.inventory.CartographyContainer; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.translator.text.MessageTranslator; @@ -43,7 +43,7 @@ import org.geysermc.geyser.util.ItemUtils; public class BedrockFilterTextTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, FilterTextPacket packet) { + 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; diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockInventoryTransactionTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockInventoryTransactionTranslator.java index 2ad827b9d..d779ab339 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockInventoryTransactionTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockInventoryTransactionTranslator.java @@ -45,7 +45,7 @@ import org.geysermc.geyser.entity.type.Entity; import org.geysermc.geyser.entity.EntityDefinitions; import org.geysermc.geyser.entity.type.ItemFrameEntity; import org.geysermc.geyser.inventory.GeyserItemStack; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.translator.sound.EntitySoundInteractionTranslator; @@ -70,7 +70,7 @@ public class BedrockInventoryTransactionTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ItemFrameDropItemPacket packet) { + public void translate(GeyserSession session, ItemFrameDropItemPacket packet) { Entity entity = ItemFrameEntity.getItemFrameEntity(session, packet.getBlockPosition()); if (entity != null) { ServerboundInteractPacket interactPacket = new ServerboundInteractPacket((int) entity.getEntityId(), diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockItemStackRequestTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockItemStackRequestTranslator.java index afa9992f9..efa0dabcc 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockItemStackRequestTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockItemStackRequestTranslator.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.translator.protocol.bedrock; import com.nukkitx.protocol.bedrock.packet.ItemStackRequestPacket; import org.geysermc.geyser.inventory.Inventory; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.translator.inventory.InventoryTranslator; @@ -39,7 +39,7 @@ import org.geysermc.geyser.translator.inventory.InventoryTranslator; public class BedrockItemStackRequestTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ItemStackRequestPacket packet) { + public void translate(GeyserSession session, ItemStackRequestPacket packet) { Inventory inventory = session.getOpenInventory(); if (inventory == null) return; diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockLecternUpdateTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockLecternUpdateTranslator.java index b6c7a8626..d7e97825c 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockLecternUpdateTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockLecternUpdateTranslator.java @@ -33,7 +33,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory.Ser import com.github.steveice10.mc.protocol.packet.ingame.serverbound.player.ServerboundUseItemOnPacket; import com.nukkitx.protocol.bedrock.packet.LecternUpdatePacket; import org.geysermc.geyser.inventory.LecternContainer; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.util.InventoryUtils; @@ -45,7 +45,7 @@ import org.geysermc.geyser.util.InventoryUtils; public class BedrockLecternUpdateTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, LecternUpdatePacket packet) { + 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! :) diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockMapInfoRequestTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockMapInfoRequestTranslator.java index 4297f6d2c..788f65134 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockMapInfoRequestTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockMapInfoRequestTranslator.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.translator.protocol.bedrock; import com.nukkitx.protocol.bedrock.packet.ClientboundMapItemDataPacket; import com.nukkitx.protocol.bedrock.packet.MapInfoRequestPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -37,7 +37,7 @@ import java.util.concurrent.TimeUnit; public class BedrockMapInfoRequestTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, MapInfoRequestPacket packet) { + public void translate(GeyserSession session, MapInfoRequestPacket packet) { long mapId = packet.getUniqueMapId(); ClientboundMapItemDataPacket mapPacket = session.getStoredMaps().remove(mapId); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockMobEquipmentTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockMobEquipmentTranslator.java index fa42a3c39..7a077c8b3 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockMobEquipmentTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockMobEquipmentTranslator.java @@ -30,7 +30,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.serverbound.player.Server import com.github.steveice10.mc.protocol.packet.ingame.serverbound.player.ServerboundUseItemPacket; import com.nukkitx.protocol.bedrock.data.inventory.ContainerId; import com.nukkitx.protocol.bedrock.packet.MobEquipmentPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.util.CooldownUtils; @@ -42,7 +42,7 @@ import java.util.concurrent.TimeUnit; public class BedrockMobEquipmentTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, MobEquipmentPacket packet) { + 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 diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockMoveEntityAbsoluteTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockMoveEntityAbsoluteTranslator.java index ff6795d26..6d971daeb 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockMoveEntityAbsoluteTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockMoveEntityAbsoluteTranslator.java @@ -31,7 +31,7 @@ import com.nukkitx.protocol.bedrock.packet.MoveEntityAbsolutePacket; import org.geysermc.geyser.entity.type.BoatEntity; import org.geysermc.geyser.entity.type.Entity; import org.geysermc.geyser.entity.EntityDefinitions; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -42,7 +42,7 @@ import org.geysermc.geyser.translator.protocol.Translator; public class BedrockMoveEntityAbsoluteTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, MoveEntityAbsolutePacket packet) { + public void translate(GeyserSession session, MoveEntityAbsolutePacket packet) { session.setLastVehicleMoveTimestamp(System.currentTimeMillis()); Entity ridingEntity = session.getRidingVehicleEntity(); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockNetworkStackLatencyTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockNetworkStackLatencyTranslator.java index 238ed86aa..9ecce9a57 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockNetworkStackLatencyTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockNetworkStackLatencyTranslator.java @@ -30,7 +30,7 @@ import com.nukkitx.protocol.bedrock.data.AttributeData; import com.nukkitx.protocol.bedrock.packet.NetworkStackLatencyPacket; import com.nukkitx.protocol.bedrock.packet.UpdateAttributesPacket; import org.geysermc.geyser.entity.attribute.GeyserAttributeType; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.floodgate.util.DeviceOs; @@ -45,7 +45,7 @@ import java.util.concurrent.TimeUnit; public class BedrockNetworkStackLatencyTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, NetworkStackLatencyPacket packet) { + 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!!! diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockPacketViolationWarningTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockPacketViolationWarningTranslator.java index d0bb391d4..f3967ddf5 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockPacketViolationWarningTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockPacketViolationWarningTranslator.java @@ -26,7 +26,7 @@ package org.geysermc.geyser.translator.protocol.bedrock; import com.nukkitx.protocol.bedrock.packet.PacketViolationWarningPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -34,7 +34,7 @@ import org.geysermc.geyser.translator.protocol.Translator; public class BedrockPacketViolationWarningTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, PacketViolationWarningPacket packet) { + public void translate(GeyserSession session, PacketViolationWarningPacket packet) { // Not translated since this is something that the developers need to know session.getGeyser().getLogger().error("Packet violation warning sent from client! " + packet.toString()); } diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockPlayerInputTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockPlayerInputTranslator.java index ef394aa8c..75199ae74 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockPlayerInputTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockPlayerInputTranslator.java @@ -34,7 +34,7 @@ import org.geysermc.geyser.entity.type.Entity; import org.geysermc.geyser.entity.EntityDefinitions; import org.geysermc.geyser.entity.type.living.animal.horse.AbstractHorseEntity; import org.geysermc.geyser.entity.type.living.animal.horse.LlamaEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -45,7 +45,7 @@ import org.geysermc.geyser.translator.protocol.Translator; public class BedrockPlayerInputTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, PlayerInputPacket packet) { + public void translate(GeyserSession session, PlayerInputPacket packet) { ServerboundPlayerInputPacket playerInputPacket = new ServerboundPlayerInputPacket( packet.getInputMotion().getX(), packet.getInputMotion().getY(), packet.isJumping(), packet.isSneaking() ); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockPositionTrackingDBClientRequestTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockPositionTrackingDBClientRequestTranslator.java index 19c9f702f..59082ccdc 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockPositionTrackingDBClientRequestTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockPositionTrackingDBClientRequestTranslator.java @@ -30,7 +30,7 @@ import com.nukkitx.nbt.NbtMapBuilder; import com.nukkitx.nbt.NbtType; import com.nukkitx.protocol.bedrock.packet.PositionTrackingDBClientRequestPacket; import com.nukkitx.protocol.bedrock.packet.PositionTrackingDBServerBroadcastPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.session.cache.LodestoneCache; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -40,7 +40,7 @@ import org.geysermc.geyser.util.DimensionUtils; public class BedrockPositionTrackingDBClientRequestTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, PositionTrackingDBClientRequestPacket packet) { + public void translate(GeyserSession session, PositionTrackingDBClientRequestPacket packet) { PositionTrackingDBServerBroadcastPacket broadcastPacket = new PositionTrackingDBServerBroadcastPacket(); broadcastPacket.setTrackingId(packet.getTrackingId()); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockRespawnTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockRespawnTranslator.java index e3f259394..59712da7f 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockRespawnTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockRespawnTranslator.java @@ -31,7 +31,7 @@ import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.packet.MovePlayerPacket; import com.nukkitx.protocol.bedrock.packet.RespawnPacket; import org.geysermc.geyser.entity.type.player.PlayerEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -39,7 +39,7 @@ import org.geysermc.geyser.translator.protocol.Translator; public class BedrockRespawnTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, RespawnPacket packet) { + 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' diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockServerSettingsRequestTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockServerSettingsRequestTranslator.java index 281cbb085..1840c9b0d 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockServerSettingsRequestTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockServerSettingsRequestTranslator.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.translator.protocol.bedrock; import com.nukkitx.protocol.bedrock.packet.ServerSettingsRequestPacket; import com.nukkitx.protocol.bedrock.packet.ServerSettingsResponsePacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.util.SettingsUtils; @@ -38,7 +38,7 @@ import java.util.concurrent.TimeUnit; @Translator(packet = ServerSettingsRequestPacket.class) public class BedrockServerSettingsRequestTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ServerSettingsRequestPacket packet) { + public void translate(GeyserSession session, ServerSettingsRequestPacket packet) { CustomForm window = SettingsUtils.buildForm(session); int windowId = session.getFormCache().addForm(window); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockSetLocalPlayerAsInitializedTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockSetLocalPlayerAsInitializedTranslator.java index e81b8f30f..bc6d1f4e4 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockSetLocalPlayerAsInitializedTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockSetLocalPlayerAsInitializedTranslator.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.translator.protocol.bedrock; import com.nukkitx.protocol.bedrock.packet.SetLocalPlayerAsInitializedPacket; import org.geysermc.geyser.session.auth.AuthType; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.util.LoginEncryptionUtils; @@ -35,7 +35,7 @@ import org.geysermc.geyser.util.LoginEncryptionUtils; @Translator(packet = SetLocalPlayerAsInitializedPacket.class) public class BedrockSetLocalPlayerAsInitializedTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, SetLocalPlayerAsInitializedPacket packet) { + public void translate(GeyserSession session, SetLocalPlayerAsInitializedPacket packet) { if (session.getPlayerEntity().getGeyserId() == packet.getRuntimeEntityId()) { if (!session.getUpstream().isInitialized()) { session.getUpstream().setInitialized(true); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockShowCreditsTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockShowCreditsTranslator.java index 719cf190c..19797b8a2 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockShowCreditsTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockShowCreditsTranslator.java @@ -25,7 +25,7 @@ package org.geysermc.geyser.translator.protocol.bedrock; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -37,7 +37,7 @@ import com.nukkitx.protocol.bedrock.packet.ShowCreditsPacket; public class BedrockShowCreditsTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ShowCreditsPacket packet) { + public void translate(GeyserSession session, ShowCreditsPacket packet) { if (packet.getStatus() == ShowCreditsPacket.Status.END_CREDITS) { ServerboundClientCommandPacket javaRespawnPacket = new ServerboundClientCommandPacket(ClientCommand.RESPAWN); session.sendDownstreamPacket(javaRespawnPacket); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockTextTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockTextTranslator.java index a1fbe6622..3cf121cf9 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockTextTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockTextTranslator.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.translator.protocol.bedrock; import com.github.steveice10.mc.protocol.packet.ingame.serverbound.ServerboundChatPacket; import com.nukkitx.protocol.bedrock.packet.TextPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.translator.text.MessageTranslator; @@ -36,7 +36,7 @@ import org.geysermc.geyser.translator.text.MessageTranslator; public class BedrockTextTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, TextPacket packet) { + public void translate(GeyserSession session, TextPacket packet) { String message = packet.getMessage(); if (message.isBlank()) { diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/BedrockEntityEventTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/BedrockEntityEventTranslator.java index 88f44a719..775ec15b5 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/BedrockEntityEventTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/BedrockEntityEventTranslator.java @@ -32,7 +32,7 @@ import org.geysermc.geyser.entity.type.player.SessionPlayerEntity; import org.geysermc.geyser.inventory.GeyserItemStack; import org.geysermc.geyser.inventory.Inventory; import org.geysermc.geyser.inventory.MerchantContainer; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -42,7 +42,7 @@ import java.util.concurrent.TimeUnit; public class BedrockEntityEventTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, EntityEventPacket packet) { + public void translate(GeyserSession session, EntityEventPacket packet) { switch (packet.getType()) { case EATING_ITEM -> { // Resend the packet so we get the eating sounds diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/BedrockActionTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/BedrockActionTranslator.java index 58c4b7822..711285948 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/BedrockActionTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/BedrockActionTranslator.java @@ -40,7 +40,7 @@ import org.geysermc.geyser.entity.type.Entity; import org.geysermc.geyser.entity.type.ItemFrameEntity; import org.geysermc.geyser.entity.type.player.SessionPlayerEntity; import org.geysermc.geyser.inventory.PlayerInventory; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.level.block.BlockStateValues; @@ -54,7 +54,7 @@ import java.util.ArrayList; public class BedrockActionTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, PlayerActionPacket packet) { + public void translate(GeyserSession session, PlayerActionPacket packet) { SessionPlayerEntity entity = session.getPlayerEntity(); // Send book update before any player action diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/BedrockEmoteTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/BedrockEmoteTranslator.java index 62f0dddcf..a4fe12d4e 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/BedrockEmoteTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/BedrockEmoteTranslator.java @@ -31,7 +31,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.serverbound.player.Server import com.nukkitx.protocol.bedrock.packet.EmotePacket; import org.geysermc.geyser.configuration.EmoteOffhandWorkaroundOption; import org.geysermc.geyser.entity.type.Entity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.util.BlockUtils; @@ -40,7 +40,7 @@ import org.geysermc.geyser.util.BlockUtils; public class BedrockEmoteTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, EmotePacket packet) { + public void translate(GeyserSession session, EmotePacket packet) { if (session.getGeyser().getConfig().getEmoteOffhandWorkaround() != EmoteOffhandWorkaroundOption.DISABLED) { // Activate the workaround - we should trigger the offhand now ServerboundPlayerActionPacket swapHandsPacket = new ServerboundPlayerActionPacket(PlayerAction.SWAP_HANDS, BlockUtils.POSITION_ZERO, @@ -53,7 +53,7 @@ public class BedrockEmoteTranslator extends PacketTranslator { } long javaId = session.getPlayerEntity().getEntityId(); - for (GeyserSessionImpl otherSession : session.getGeyser().getSessionManager().getSessions().values()) { + for (GeyserSession otherSession : session.getGeyser().getSessionManager().getSessions().values()) { if (otherSession != session) { if (otherSession.isClosed()) continue; if (otherSession.getEventLoop().inEventLoop()) { @@ -65,7 +65,7 @@ public class BedrockEmoteTranslator extends PacketTranslator { } } - private void playEmote(GeyserSessionImpl otherSession, long javaId, String emoteId) { + private void playEmote(GeyserSession otherSession, long javaId, String emoteId) { Entity otherEntity = otherSession.getEntityCache().getEntityByJavaId(javaId); // Must be ran on same thread if (otherEntity == null) return; EmotePacket otherEmotePacket = new EmotePacket(); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/BedrockInteractTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/BedrockInteractTranslator.java index a32d9808f..26a25725e 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/BedrockInteractTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/BedrockInteractTranslator.java @@ -37,7 +37,7 @@ import com.nukkitx.protocol.bedrock.packet.ContainerOpenPacket; import com.nukkitx.protocol.bedrock.packet.InteractPacket; import org.geysermc.geyser.entity.type.Entity; import org.geysermc.geyser.entity.type.living.animal.horse.AbstractHorseEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.entity.InteractiveTagManager; @@ -46,7 +46,7 @@ import org.geysermc.geyser.entity.InteractiveTagManager; public class BedrockInteractTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, InteractPacket packet) { + public void translate(GeyserSession session, InteractPacket packet) { Entity entity; if (packet.getRuntimeEntityId() == session.getPlayerEntity().getGeyserId()) { //Player is not in entity cache diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/BedrockMovePlayerTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/BedrockMovePlayerTranslator.java index ecf0b2225..76d7edc17 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/BedrockMovePlayerTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/BedrockMovePlayerTranslator.java @@ -36,7 +36,7 @@ import com.nukkitx.protocol.bedrock.packet.MovePlayerPacket; import org.geysermc.geyser.text.ChatColor; import org.geysermc.geyser.entity.EntityDefinitions; import org.geysermc.geyser.entity.type.player.SessionPlayerEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -47,7 +47,7 @@ public class BedrockMovePlayerTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, RiderJumpPacket packet) { + public void translate(GeyserSession session, RiderJumpPacket packet) { Entity vehicle = session.getRidingVehicleEntity(); if (vehicle instanceof AbstractHorseEntity) { ServerboundPlayerCommandPacket playerCommandPacket = new ServerboundPlayerCommandPacket((int) vehicle.getEntityId(), PlayerState.START_HORSE_JUMP, packet.getJumpStrength()); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/BedrockSetPlayerGameTypeTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/BedrockSetPlayerGameTypeTranslator.java index f57d7957a..b149f8836 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/BedrockSetPlayerGameTypeTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/BedrockSetPlayerGameTypeTranslator.java @@ -26,7 +26,7 @@ package org.geysermc.geyser.translator.protocol.bedrock.entity.player; import com.nukkitx.protocol.bedrock.packet.SetPlayerGameTypePacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -38,7 +38,7 @@ import org.geysermc.geyser.translator.protocol.Translator; public class BedrockSetPlayerGameTypeTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, SetPlayerGameTypePacket packet) { + public void translate(GeyserSession session, SetPlayerGameTypePacket packet) { // no SetPlayerGameTypePacket playerGameTypePacket = new SetPlayerGameTypePacket(); playerGameTypePacket.setGamemode(session.getGameMode().ordinal()); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/world/BedrockLevelSoundEventTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/world/BedrockLevelSoundEventTranslator.java index 9969e55f4..2ac8587bf 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/world/BedrockLevelSoundEventTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/world/BedrockLevelSoundEventTranslator.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.translator.protocol.bedrock.world; import com.nukkitx.protocol.bedrock.data.SoundEvent; import com.nukkitx.protocol.bedrock.packet.LevelSoundEventPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.util.CooldownUtils; @@ -36,7 +36,7 @@ import org.geysermc.geyser.util.CooldownUtils; public class BedrockLevelSoundEventTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, LevelSoundEventPacket packet) { + public void translate(GeyserSession session, LevelSoundEventPacket packet) { // lol what even :thinking: session.sendUpstreamPacket(packet); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaAwardStatsTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaAwardStatsTranslator.java index eb3b52040..8f4e93635 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaAwardStatsTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaAwardStatsTranslator.java @@ -26,7 +26,7 @@ package org.geysermc.geyser.translator.protocol.java; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundAwardStatsPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.util.StatisticsUtils; @@ -35,7 +35,7 @@ import org.geysermc.geyser.util.StatisticsUtils; public class JavaAwardStatsTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundAwardStatsPacket packet) { + public void translate(GeyserSession session, ClientboundAwardStatsPacket packet) { session.updateStatistics(packet.getStatistics()); if (session.isWaitingForStatistics()) { diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaBossEventTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaBossEventTranslator.java index c15ea56dd..2c49baa56 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaBossEventTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaBossEventTranslator.java @@ -25,7 +25,7 @@ package org.geysermc.geyser.translator.protocol.java; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.session.cache.BossBar; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -36,7 +36,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundBo public class JavaBossEventTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundBossEventPacket packet) { + public void translate(GeyserSession session, ClientboundBossEventPacket packet) { BossBar bossBar = session.getEntityCache().getBossBar(packet.getUuid()); switch (packet.getAction()) { case ADD: diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaChangeDifficultyTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaChangeDifficultyTranslator.java index 9aa747187..e0c3a9b95 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaChangeDifficultyTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaChangeDifficultyTranslator.java @@ -26,7 +26,7 @@ package org.geysermc.geyser.translator.protocol.java; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundChangeDifficultyPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import com.nukkitx.protocol.bedrock.packet.SetDifficultyPacket; @@ -35,7 +35,7 @@ import com.nukkitx.protocol.bedrock.packet.SetDifficultyPacket; public class JavaChangeDifficultyTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundChangeDifficultyPacket packet) { + public void translate(GeyserSession session, ClientboundChangeDifficultyPacket packet) { SetDifficultyPacket setDifficultyPacket = new SetDifficultyPacket(); setDifficultyPacket.setDifficulty(packet.getDifficulty().ordinal()); session.sendUpstreamPacket(setDifficultyPacket); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaChatTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaChatTranslator.java index 93daa4c45..1c771ff52 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaChatTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaChatTranslator.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.translator.protocol.java; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundChatPacket; import com.nukkitx.protocol.bedrock.packet.TextPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.translator.text.MessageTranslator; @@ -36,7 +36,7 @@ import org.geysermc.geyser.translator.text.MessageTranslator; public class JavaChatTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundChatPacket packet) { + public void translate(GeyserSession session, ClientboundChatPacket packet) { TextPacket textPacket = new TextPacket(); textPacket.setPlatformChatId(""); textPacket.setSourceName(""); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaCommandsTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaCommandsTranslator.java index feef811e4..d0ab68d8f 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaCommandsTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaCommandsTranslator.java @@ -43,7 +43,7 @@ import lombok.Getter; import lombok.ToString; import net.kyori.adventure.text.format.NamedTextColor; import org.geysermc.geyser.GeyserImpl; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.inventory.item.Enchantment; @@ -98,7 +98,7 @@ public class JavaCommandsTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundCustomQueryPacket packet) { + public void translate(GeyserSession session, ClientboundCustomQueryPacket 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( diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaDisconnectTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaDisconnectTranslator.java index 4822d8b4a..e073e6f27 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaDisconnectTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaDisconnectTranslator.java @@ -26,7 +26,7 @@ package org.geysermc.geyser.translator.protocol.java; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundDisconnectPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.translator.text.MessageTranslator; @@ -35,7 +35,7 @@ import org.geysermc.geyser.translator.text.MessageTranslator; public class JavaDisconnectTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundDisconnectPacket packet) { + public void translate(GeyserSession session, ClientboundDisconnectPacket packet) { session.disconnect(MessageTranslator.convertMessage(packet.getReason(), session.getLocale())); } diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaGameProfileTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaGameProfileTranslator.java index 833dfe732..307c27c29 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaGameProfileTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaGameProfileTranslator.java @@ -29,7 +29,7 @@ import com.github.steveice10.mc.auth.data.GameProfile; import com.github.steveice10.mc.protocol.packet.login.clientbound.ClientboundGameProfilePacket; import org.geysermc.geyser.session.auth.AuthType; import org.geysermc.geyser.entity.type.player.PlayerEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.skin.SkinManager; @@ -38,7 +38,7 @@ import org.geysermc.geyser.skin.SkinManager; public class JavaGameProfileTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundGameProfilePacket packet) { + public void translate(GeyserSession session, ClientboundGameProfilePacket packet) { PlayerEntity playerEntity = session.getPlayerEntity(); AuthType remoteAuthType = session.getRemoteAuthType(); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaKeepAliveTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaKeepAliveTranslator.java index 208768ff8..680debe49 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaKeepAliveTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaKeepAliveTranslator.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.translator.protocol.java; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundKeepAlivePacket; import com.nukkitx.protocol.bedrock.packet.NetworkStackLatencyPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -38,7 +38,7 @@ import org.geysermc.geyser.translator.protocol.Translator; public class JavaKeepAliveTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundKeepAlivePacket packet) { + public void translate(GeyserSession session, ClientboundKeepAlivePacket packet) { if (!session.getGeyser().getConfig().isForwardPlayerPing()) { return; } diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaLoginDisconnectTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaLoginDisconnectTranslator.java index 531d4a791..ce5fabe30 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaLoginDisconnectTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaLoginDisconnectTranslator.java @@ -26,7 +26,7 @@ package org.geysermc.geyser.translator.protocol.java; import com.github.steveice10.mc.protocol.packet.login.clientbound.ClientboundLoginDisconnectPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.translator.text.MessageTranslator; @@ -35,7 +35,7 @@ import org.geysermc.geyser.translator.text.MessageTranslator; public class JavaLoginDisconnectTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundLoginDisconnectPacket packet) { + public void translate(GeyserSession session, ClientboundLoginDisconnectPacket packet) { // The client doesn't manually get disconnected so we have to do it ourselves session.disconnect(MessageTranslator.convertMessage(packet.getReason(), session.getLocale())); } diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaLoginTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaLoginTranslator.java index 90c21c8d0..855f5b144 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaLoginTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaLoginTranslator.java @@ -36,7 +36,7 @@ import com.nukkitx.protocol.bedrock.data.PlayerPermission; import com.nukkitx.protocol.bedrock.packet.*; import org.geysermc.geyser.session.auth.AuthType; import org.geysermc.geyser.entity.type.player.PlayerEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.translator.level.BiomeTranslator; @@ -52,7 +52,7 @@ public class JavaLoginTranslator extends PacketTranslator SKIN_PART_VALUES = Arrays.asList(SkinPart.values()); @Override - public void translate(GeyserSessionImpl session, ClientboundLoginPacket packet) { + public void translate(GeyserSession session, ClientboundLoginPacket packet) { PlayerEntity entity = session.getPlayerEntity(); entity.setEntityId(packet.getEntityId()); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaPingTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaPingTranslator.java index 9a1ef7f08..a3b2e34b7 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaPingTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaPingTranslator.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.translator.protocol.java; import com.github.steveice10.mc.protocol.packet.ingame.serverbound.ServerboundPongPacket; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundPingPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -36,7 +36,7 @@ import org.geysermc.geyser.translator.protocol.Translator; public class JavaPingTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundPingPacket packet) { + public void translate(GeyserSession session, ClientboundPingPacket packet) { session.sendDownstreamPacket(new ServerboundPongPacket(packet.getId())); } } diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaRecipeTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaRecipeTranslator.java index 908ac6e4c..0a329f607 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaRecipeTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaRecipeTranslator.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.translator.protocol.java; import com.github.steveice10.mc.protocol.data.game.UnlockRecipesAction; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundRecipePacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -40,7 +40,7 @@ import java.util.Arrays; public class JavaRecipeTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundRecipePacket packet) { + public void translate(GeyserSession session, ClientboundRecipePacket packet) { if (packet.getAction() == UnlockRecipesAction.REMOVE) { session.getUnlockedRecipes().removeAll(Arrays.asList(packet.getRecipes())); } else { diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaRespawnTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaRespawnTranslator.java index a72a054ef..8f97b1a8d 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaRespawnTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaRespawnTranslator.java @@ -32,7 +32,7 @@ import com.nukkitx.protocol.bedrock.packet.LevelEventPacket; import com.nukkitx.protocol.bedrock.packet.SetPlayerGameTypePacket; import org.geysermc.geyser.entity.attribute.GeyserAttributeType; import org.geysermc.geyser.entity.type.player.SessionPlayerEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.translator.inventory.InventoryTranslator; @@ -43,7 +43,7 @@ import org.geysermc.geyser.util.DimensionUtils; public class JavaRespawnTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundRespawnPacket packet) { + public void translate(GeyserSession session, ClientboundRespawnPacket packet) { SessionPlayerEntity entity = session.getPlayerEntity(); entity.setHealth(entity.getMaxHealth()); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaSelectAdvancementsTabTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaSelectAdvancementsTabTranslator.java index 5acb35059..3f82dffb1 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaSelectAdvancementsTabTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaSelectAdvancementsTabTranslator.java @@ -26,7 +26,7 @@ package org.geysermc.geyser.translator.protocol.java; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundSelectAdvancementsTabPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.session.cache.AdvancementsCache; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -38,7 +38,7 @@ import org.geysermc.geyser.translator.protocol.Translator; public class JavaSelectAdvancementsTabTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundSelectAdvancementsTabPacket packet) { + public void translate(GeyserSession session, ClientboundSelectAdvancementsTabPacket packet) { AdvancementsCache advancementsCache = session.getAdvancementsCache(); advancementsCache.setCurrentAdvancementCategoryId(packet.getTabId()); advancementsCache.buildAndShowListForm(); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaUpdateAdvancementsTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaUpdateAdvancementsTranslator.java index be17064f3..c1f6f77d2 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaUpdateAdvancementsTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaUpdateAdvancementsTranslator.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.translator.protocol.java; import com.github.steveice10.mc.protocol.data.game.advancement.Advancement; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundUpdateAdvancementsPacket; import com.nukkitx.protocol.bedrock.packet.SetTitlePacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.translator.text.MessageTranslator; @@ -42,7 +42,7 @@ import java.util.Map; public class JavaUpdateAdvancementsTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundUpdateAdvancementsPacket packet) { + public void translate(GeyserSession session, ClientboundUpdateAdvancementsPacket packet) { AdvancementsCache advancementsCache = session.getAdvancementsCache(); if (packet.isReset()) { advancementsCache.getStoredAdvancements().clear(); @@ -72,7 +72,7 @@ public class JavaUpdateAdvancementsTranslator extends PacketTranslator> 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; @@ -185,7 +185,7 @@ public class JavaUpdateRecipesTranslator extends PacketTranslator, IntSet> squashedOptions = new HashMap<>(); for (int i = 0; i < ingredients.length; i++) { if (ingredients[i].getOptions().length == 0) { diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaUpdateTagsTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaUpdateTagsTranslator.java index 59aee47cc..5c9d84457 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaUpdateTagsTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaUpdateTagsTranslator.java @@ -26,7 +26,7 @@ package org.geysermc.geyser.translator.protocol.java; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundUpdateTagsPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -34,7 +34,7 @@ import org.geysermc.geyser.translator.protocol.Translator; public class JavaUpdateTagsTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundUpdateTagsPacket packet) { + public void translate(GeyserSession session, ClientboundUpdateTagsPacket packet) { session.getTagCache().loadPacket(packet); } } diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaAnimateTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaAnimateTranslator.java index 98f7172b4..d7fc79f1e 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaAnimateTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaAnimateTranslator.java @@ -31,7 +31,7 @@ import com.nukkitx.protocol.bedrock.packet.AnimateEntityPacket; import com.nukkitx.protocol.bedrock.packet.AnimatePacket; import com.nukkitx.protocol.bedrock.packet.SpawnParticleEffectPacket; import org.geysermc.geyser.entity.type.Entity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.util.DimensionUtils; @@ -40,7 +40,7 @@ import org.geysermc.geyser.util.DimensionUtils; public class JavaAnimateTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundAnimatePacket packet) { + public void translate(GeyserSession session, ClientboundAnimatePacket packet) { Entity entity; if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) { entity = session.getPlayerEntity(); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaEntityEventTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaEntityEventTranslator.java index fccfaef41..1c3239d69 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaEntityEventTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaEntityEventTranslator.java @@ -36,7 +36,7 @@ import org.geysermc.geyser.entity.type.Entity; import org.geysermc.geyser.entity.EntityDefinitions; import org.geysermc.geyser.entity.type.FishingHookEntity; import org.geysermc.geyser.entity.type.LivingEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -46,7 +46,7 @@ import java.util.concurrent.ThreadLocalRandom; public class JavaEntityEventTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundEntityEventPacket packet) { + public void translate(GeyserSession session, ClientboundEntityEventPacket packet) { Entity entity; if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) { entity = session.getPlayerEntity(); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaMoveEntityPosRotTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaMoveEntityPosRotTranslator.java index ae27b54c2..4f15b0717 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaMoveEntityPosRotTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaMoveEntityPosRotTranslator.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.translator.protocol.java.entity; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.entity.ClientboundMoveEntityPosRotPacket; import org.geysermc.geyser.entity.type.Entity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -35,7 +35,7 @@ import org.geysermc.geyser.translator.protocol.Translator; public class JavaMoveEntityPosRotTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundMoveEntityPosRotPacket packet) { + public void translate(GeyserSession session, ClientboundMoveEntityPosRotPacket packet) { Entity entity = session.getEntityCache().getEntityByJavaId(packet.getEntityId()); if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) { entity = session.getPlayerEntity(); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaMoveEntityPosTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaMoveEntityPosTranslator.java index 1a93b0ea1..aeb080465 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaMoveEntityPosTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaMoveEntityPosTranslator.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.translator.protocol.java.entity; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.entity.ClientboundMoveEntityPosPacket; import org.geysermc.geyser.entity.type.Entity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -35,7 +35,7 @@ import org.geysermc.geyser.translator.protocol.Translator; public class JavaMoveEntityPosTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundMoveEntityPosPacket packet) { + public void translate(GeyserSession session, ClientboundMoveEntityPosPacket packet) { Entity entity; if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) { entity = session.getPlayerEntity(); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaMoveEntityRotTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaMoveEntityRotTranslator.java index fa3efc5e1..b2b59480b 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaMoveEntityRotTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaMoveEntityRotTranslator.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.translator.protocol.java.entity; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.entity.ClientboundMoveEntityRotPacket; import org.geysermc.geyser.entity.type.Entity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -35,7 +35,7 @@ import org.geysermc.geyser.translator.protocol.Translator; public class JavaMoveEntityRotTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundMoveEntityRotPacket packet) { + public void translate(GeyserSession session, ClientboundMoveEntityRotPacket packet) { Entity entity = session.getEntityCache().getEntityByJavaId(packet.getEntityId()); if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) { entity = session.getPlayerEntity(); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaMoveVehicleTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaMoveVehicleTranslator.java index 29f3620a9..90e121250 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaMoveVehicleTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaMoveVehicleTranslator.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.translator.protocol.java.entity; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.entity.ClientboundMoveVehiclePacket; import com.nukkitx.math.vector.Vector3f; import org.geysermc.geyser.entity.type.Entity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -36,7 +36,7 @@ import org.geysermc.geyser.translator.protocol.Translator; public class JavaMoveVehicleTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundMoveVehiclePacket packet) { + public void translate(GeyserSession session, ClientboundMoveVehiclePacket packet) { Entity entity = session.getRidingVehicleEntity(); if (entity == null) return; diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaRemoveEntitiesTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaRemoveEntitiesTranslator.java index 1783316ae..043756db0 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaRemoveEntitiesTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaRemoveEntitiesTranslator.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.translator.protocol.java.entity; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.entity.ClientboundRemoveEntitiesPacket; import org.geysermc.geyser.entity.type.Entity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -35,7 +35,7 @@ import org.geysermc.geyser.translator.protocol.Translator; public class JavaRemoveEntitiesTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundRemoveEntitiesPacket packet) { + public void translate(GeyserSession session, ClientboundRemoveEntitiesPacket packet) { for (int entityId : packet.getEntityIds()) { Entity entity = session.getEntityCache().getEntityByJavaId(entityId); if (entity != null) { diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaRemoveMobEffectTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaRemoveMobEffectTranslator.java index 8fe9db808..bc78bb33e 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaRemoveMobEffectTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaRemoveMobEffectTranslator.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.translator.protocol.java.entity; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.entity.ClientboundRemoveMobEffectPacket; import com.nukkitx.protocol.bedrock.packet.MobEffectPacket; import org.geysermc.geyser.entity.type.Entity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.util.EntityUtils; @@ -37,7 +37,7 @@ import org.geysermc.geyser.util.EntityUtils; public class JavaRemoveMobEffectTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundRemoveMobEffectPacket packet) { + public void translate(GeyserSession session, ClientboundRemoveMobEffectPacket packet) { Entity entity; if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) { entity = session.getPlayerEntity(); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaRotateHeadTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaRotateHeadTranslator.java index 3f598dd3b..edcad7af6 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaRotateHeadTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaRotateHeadTranslator.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.translator.protocol.java.entity; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.entity.ClientboundRotateHeadPacket; import org.geysermc.geyser.entity.type.Entity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -35,7 +35,7 @@ import org.geysermc.geyser.translator.protocol.Translator; public class JavaRotateHeadTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundRotateHeadPacket packet) { + public void translate(GeyserSession session, ClientboundRotateHeadPacket packet) { Entity entity; if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) { entity = session.getPlayerEntity(); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaSetEntityDataTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaSetEntityDataTranslator.java index c63905cd6..987e5fcb2 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaSetEntityDataTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaSetEntityDataTranslator.java @@ -29,7 +29,7 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadat import com.github.steveice10.mc.protocol.packet.ingame.clientbound.entity.ClientboundSetEntityDataPacket; import org.geysermc.geyser.entity.type.Entity; import org.geysermc.geyser.entity.EntityDefinition; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.entity.InteractiveTagManager; @@ -39,7 +39,7 @@ public class JavaSetEntityDataTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundSetEntityLinkPacket packet) { + public void translate(GeyserSession session, ClientboundSetEntityLinkPacket packet) { Entity holderId; if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) { holderId = session.getPlayerEntity(); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaSetEntityMotionTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaSetEntityMotionTranslator.java index da8920c29..5febe4813 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaSetEntityMotionTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaSetEntityMotionTranslator.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.translator.protocol.java.entity; import org.geysermc.geyser.entity.type.Entity; import org.geysermc.geyser.entity.type.ItemEntity; import org.geysermc.geyser.entity.type.living.animal.horse.AbstractHorseEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -40,7 +40,7 @@ import com.nukkitx.protocol.bedrock.packet.SetEntityMotionPacket; public class JavaSetEntityMotionTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundSetEntityMotionPacket packet) { + public void translate(GeyserSession session, ClientboundSetEntityMotionPacket packet) { Entity entity; if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) { entity = session.getPlayerEntity(); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaSetEquipmentTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaSetEquipmentTranslator.java index 7222d46dd..0058ed61e 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaSetEquipmentTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaSetEquipmentTranslator.java @@ -30,7 +30,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.clientbound.entity.Client import com.nukkitx.protocol.bedrock.data.inventory.ItemData; import org.geysermc.geyser.entity.type.Entity; import org.geysermc.geyser.entity.type.LivingEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.translator.inventory.item.ItemTranslator; @@ -39,7 +39,7 @@ import org.geysermc.geyser.translator.inventory.item.ItemTranslator; public class JavaSetEquipmentTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundSetEquipmentPacket packet) { + public void translate(GeyserSession session, ClientboundSetEquipmentPacket packet) { Entity entity; if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) { entity = session.getPlayerEntity(); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaSetPassengersTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaSetPassengersTranslator.java index 4f9729c5f..f4a6f94ed 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaSetPassengersTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaSetPassengersTranslator.java @@ -32,7 +32,7 @@ import com.nukkitx.protocol.bedrock.packet.SetEntityLinkPacket; import it.unimi.dsi.fastutil.longs.LongOpenHashSet; import org.geysermc.geyser.entity.type.Entity; import org.geysermc.geyser.entity.EntityDefinitions; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.util.EntityUtils; @@ -43,7 +43,7 @@ import java.util.Arrays; public class JavaSetPassengersTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundSetPassengersPacket packet) { + public void translate(GeyserSession session, ClientboundSetPassengersPacket packet) { Entity entity; if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) { entity = session.getPlayerEntity(); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaTakeItemEntityTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaTakeItemEntityTranslator.java index daf89633f..75d7bc976 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaTakeItemEntityTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaTakeItemEntityTranslator.java @@ -31,7 +31,7 @@ import com.nukkitx.protocol.bedrock.packet.LevelEventPacket; import com.nukkitx.protocol.bedrock.packet.TakeItemEntityPacket; import org.geysermc.geyser.entity.type.Entity; import org.geysermc.geyser.entity.type.ExpOrbEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -44,7 +44,7 @@ import org.geysermc.geyser.translator.protocol.Translator; public class JavaTakeItemEntityTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundTakeItemEntityPacket packet) { + public void translate(GeyserSession session, ClientboundTakeItemEntityPacket packet) { // Collected entity is the other entity Entity collectedEntity = session.getEntityCache().getEntityByJavaId(packet.getCollectedEntityId()); if (collectedEntity == null) return; diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaTeleportEntityTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaTeleportEntityTranslator.java index d6ebd6efb..cbd994d79 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaTeleportEntityTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaTeleportEntityTranslator.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.translator.protocol.java.entity; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.entity.ClientboundTeleportEntityPacket; import com.nukkitx.math.vector.Vector3f; import org.geysermc.geyser.entity.type.Entity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -36,7 +36,7 @@ import org.geysermc.geyser.translator.protocol.Translator; public class JavaTeleportEntityTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundTeleportEntityPacket packet) { + public void translate(GeyserSession session, ClientboundTeleportEntityPacket packet) { Entity entity = session.getEntityCache().getEntityByJavaId(packet.getEntityId()); if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) { entity = session.getPlayerEntity(); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaUpdateAttributesTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaUpdateAttributesTranslator.java index 7d64a880e..c3a4e4ac4 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaUpdateAttributesTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaUpdateAttributesTranslator.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.translator.protocol.java.entity; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.entity.ClientboundUpdateAttributesPacket; import org.geysermc.geyser.entity.type.Entity; import org.geysermc.geyser.entity.type.LivingEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -36,7 +36,7 @@ import org.geysermc.geyser.translator.protocol.Translator; public class JavaUpdateAttributesTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundUpdateAttributesPacket packet) { + public void translate(GeyserSession session, ClientboundUpdateAttributesPacket packet) { Entity entity; if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) { entity = session.getPlayerEntity(); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaUpdateMobEffectTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaUpdateMobEffectTranslator.java index ee53f281b..2d4161739 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaUpdateMobEffectTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaUpdateMobEffectTranslator.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.translator.protocol.java.entity; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.entity.ClientboundUpdateMobEffectPacket; import com.nukkitx.protocol.bedrock.packet.MobEffectPacket; import org.geysermc.geyser.entity.type.Entity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.util.EntityUtils; @@ -37,7 +37,7 @@ import org.geysermc.geyser.util.EntityUtils; public class JavaUpdateMobEffectTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundUpdateMobEffectPacket packet) { + public void translate(GeyserSession session, ClientboundUpdateMobEffectPacket packet) { Entity entity; if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) { entity = session.getPlayerEntity(); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/player/JavaBlockBreakAckTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/player/JavaBlockBreakAckTranslator.java index 08449c108..6fbdb4fc6 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/player/JavaBlockBreakAckTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/player/JavaBlockBreakAckTranslator.java @@ -30,7 +30,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.clientbound.entity.player import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.LevelEventType; import com.nukkitx.protocol.bedrock.packet.LevelEventPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.level.block.BlockStateValues; @@ -40,7 +40,7 @@ import org.geysermc.geyser.util.ChunkUtils; public class JavaBlockBreakAckTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundBlockBreakAckPacket packet) { + public void translate(GeyserSession session, ClientboundBlockBreakAckPacket packet) { ChunkUtils.updateBlock(session, packet.getNewState(), packet.getPosition()); if (packet.getAction() == PlayerAction.START_DIGGING && !packet.isSuccessful()) { LevelEventPacket stopBreak = new LevelEventPacket(); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/player/JavaPlayerAbilitiesTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/player/JavaPlayerAbilitiesTranslator.java index b409db27a..98b69a0b8 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/player/JavaPlayerAbilitiesTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/player/JavaPlayerAbilitiesTranslator.java @@ -26,7 +26,7 @@ package org.geysermc.geyser.translator.protocol.java.entity.player; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.entity.player.ClientboundPlayerAbilitiesPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -34,7 +34,7 @@ import org.geysermc.geyser.translator.protocol.Translator; public class JavaPlayerAbilitiesTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundPlayerAbilitiesPacket packet) { + public void translate(GeyserSession session, ClientboundPlayerAbilitiesPacket packet) { session.setCanFly(packet.isCanFly()); session.setFlying(packet.isFlying()); session.sendAdventureSettings(); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/player/JavaPlayerInfoTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/player/JavaPlayerInfoTranslator.java index ce5f0b798..d8ffdccb6 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/player/JavaPlayerInfoTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/player/JavaPlayerInfoTranslator.java @@ -32,7 +32,7 @@ import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.packet.PlayerListPacket; import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.entity.type.player.PlayerEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.skin.SkinManager; @@ -40,7 +40,7 @@ import org.geysermc.geyser.skin.SkinManager; @Translator(packet = ClientboundPlayerInfoPacket.class) public class JavaPlayerInfoTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundPlayerInfoPacket packet) { + public void translate(GeyserSession session, ClientboundPlayerInfoPacket packet) { if (packet.getAction() != PlayerListEntryAction.ADD_PLAYER && packet.getAction() != PlayerListEntryAction.REMOVE_PLAYER) return; diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/player/JavaPlayerPositionTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/player/JavaPlayerPositionTranslator.java index a8a630656..3e94321f9 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/player/JavaPlayerPositionTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/player/JavaPlayerPositionTranslator.java @@ -37,7 +37,7 @@ import com.nukkitx.protocol.bedrock.packet.SetEntityLinkPacket; import org.geysermc.geyser.entity.type.Entity; import org.geysermc.geyser.entity.EntityDefinitions; import org.geysermc.geyser.entity.type.player.PlayerEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.session.cache.TeleportCache; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -49,7 +49,7 @@ import org.geysermc.geyser.text.GeyserLocale; public class JavaPlayerPositionTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundPlayerPositionPacket packet) { + public void translate(GeyserSession session, ClientboundPlayerPositionPacket packet) { if (!session.isLoggedIn()) return; diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/player/JavaSetCarriedItemTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/player/JavaSetCarriedItemTranslator.java index 3f7de9126..dc10bad34 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/player/JavaSetCarriedItemTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/player/JavaSetCarriedItemTranslator.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.translator.protocol.java.entity.player; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.entity.player.ClientboundSetCarriedItemPacket; import com.nukkitx.protocol.bedrock.packet.PlayerHotbarPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -35,7 +35,7 @@ import org.geysermc.geyser.translator.protocol.Translator; public class JavaSetCarriedItemTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundSetCarriedItemPacket packet) { + public void translate(GeyserSession session, ClientboundSetCarriedItemPacket packet) { PlayerHotbarPacket hotbarPacket = new PlayerHotbarPacket(); hotbarPacket.setContainerId(0); hotbarPacket.setSelectedHotbarSlot(packet.getSlot()); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/player/JavaSetExperienceTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/player/JavaSetExperienceTranslator.java index 794755833..3ac9bf9e3 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/player/JavaSetExperienceTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/player/JavaSetExperienceTranslator.java @@ -30,7 +30,7 @@ import com.nukkitx.protocol.bedrock.data.AttributeData; import com.nukkitx.protocol.bedrock.packet.UpdateAttributesPacket; import org.geysermc.geyser.entity.attribute.GeyserAttributeType; import org.geysermc.geyser.entity.type.player.SessionPlayerEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -40,7 +40,7 @@ import java.util.Arrays; public class JavaSetExperienceTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundSetExperiencePacket packet) { + public void translate(GeyserSession session, ClientboundSetExperiencePacket packet) { SessionPlayerEntity entity = session.getPlayerEntity(); AttributeData experience = GeyserAttributeType.EXPERIENCE.getAttribute(packet.getExperience()); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/player/JavaSetHealthTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/player/JavaSetHealthTranslator.java index 40a6d38e5..8e96ed42e 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/player/JavaSetHealthTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/player/JavaSetHealthTranslator.java @@ -31,7 +31,7 @@ import com.nukkitx.protocol.bedrock.packet.SetHealthPacket; import com.nukkitx.protocol.bedrock.packet.UpdateAttributesPacket; import org.geysermc.geyser.entity.attribute.GeyserAttributeType; import org.geysermc.geyser.entity.type.player.SessionPlayerEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -41,7 +41,7 @@ import java.util.List; public class JavaSetHealthTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundSetHealthPacket packet) { + public void translate(GeyserSession session, ClientboundSetHealthPacket packet) { SessionPlayerEntity entity = session.getPlayerEntity(); int health = (int) Math.ceil(packet.getHealth()); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/spawn/JavaAddEntityTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/spawn/JavaAddEntityTranslator.java index d1ccd7b1b..b80b59ff4 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/spawn/JavaAddEntityTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/spawn/JavaAddEntityTranslator.java @@ -38,7 +38,7 @@ import org.geysermc.geyser.entity.type.FallingBlockEntity; import org.geysermc.geyser.entity.type.FishingHookEntity; import org.geysermc.geyser.entity.type.ItemFrameEntity; import org.geysermc.geyser.entity.type.player.PlayerEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.registry.Registries; @@ -48,7 +48,7 @@ import org.geysermc.geyser.text.GeyserLocale; public class JavaAddEntityTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundAddEntityPacket packet) { + public void translate(GeyserSession session, ClientboundAddEntityPacket packet) { Vector3f position = Vector3f.from(packet.getX(), packet.getY(), packet.getZ()); Vector3f motion = Vector3f.from(packet.getMotionX(), packet.getMotionY(), packet.getMotionZ()); float yaw = packet.getYaw(); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/spawn/JavaAddExperienceOrbTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/spawn/JavaAddExperienceOrbTranslator.java index 1774ec934..33e230c14 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/spawn/JavaAddExperienceOrbTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/spawn/JavaAddExperienceOrbTranslator.java @@ -29,7 +29,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.clientbound.entity.spawn. import com.nukkitx.math.vector.Vector3f; import org.geysermc.geyser.entity.type.Entity; import org.geysermc.geyser.entity.type.ExpOrbEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -37,7 +37,7 @@ import org.geysermc.geyser.translator.protocol.Translator; public class JavaAddExperienceOrbTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundAddExperienceOrbPacket packet) { + public void translate(GeyserSession session, ClientboundAddExperienceOrbPacket packet) { Vector3f position = Vector3f.from(packet.getX(), packet.getY(), packet.getZ()); Entity entity = new ExpOrbEntity( diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/spawn/JavaAddMobTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/spawn/JavaAddMobTranslator.java index a466969aa..e6b82f365 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/spawn/JavaAddMobTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/spawn/JavaAddMobTranslator.java @@ -30,7 +30,7 @@ import com.nukkitx.math.vector.Vector3f; import org.geysermc.geyser.entity.type.Entity; import org.geysermc.geyser.entity.EntityDefinition; import org.geysermc.geyser.entity.factory.BaseEntityFactory; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.registry.Registries; @@ -40,7 +40,7 @@ import org.geysermc.geyser.text.GeyserLocale; public class JavaAddMobTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundAddMobPacket packet) { + public void translate(GeyserSession session, ClientboundAddMobPacket packet) { Vector3f position = Vector3f.from(packet.getX(), packet.getY(), packet.getZ()); Vector3f motion = Vector3f.from(packet.getMotionX(), packet.getMotionY(), packet.getMotionZ()); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/spawn/JavaAddPaintingTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/spawn/JavaAddPaintingTranslator.java index 17e4a800e..433d78477 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/spawn/JavaAddPaintingTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/spawn/JavaAddPaintingTranslator.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.translator.protocol.java.entity.spawn; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.entity.spawn.ClientboundAddPaintingPacket; import com.nukkitx.math.vector.Vector3f; import org.geysermc.geyser.entity.type.PaintingEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.level.PaintingType; @@ -37,7 +37,7 @@ import org.geysermc.geyser.level.PaintingType; public class JavaAddPaintingTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundAddPaintingPacket packet) { + public void translate(GeyserSession session, ClientboundAddPaintingPacket packet) { Vector3f position = Vector3f.from(packet.getPosition().getX(), packet.getPosition().getY(), packet.getPosition().getZ()); PaintingEntity entity = new PaintingEntity(session, packet.getEntityId(), diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/spawn/JavaAddPlayerTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/spawn/JavaAddPlayerTranslator.java index 8dbdf81e9..74dcaf022 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/spawn/JavaAddPlayerTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/spawn/JavaAddPlayerTranslator.java @@ -29,7 +29,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.clientbound.entity.spawn. import com.nukkitx.math.vector.Vector3f; import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.entity.type.player.PlayerEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.text.GeyserLocale; @@ -39,7 +39,7 @@ import org.geysermc.geyser.skin.SkinManager; public class JavaAddPlayerTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundAddPlayerPacket packet) { + public void translate(GeyserSession session, ClientboundAddPlayerPacket packet) { Vector3f position = Vector3f.from(packet.getX(), packet.getY(), packet.getZ()); float yaw = packet.getYaw(); float pitch = packet.getPitch(); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/inventory/JavaContainerCloseTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/inventory/JavaContainerCloseTranslator.java index e12f2ee8d..9a4ff8f26 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/inventory/JavaContainerCloseTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/inventory/JavaContainerCloseTranslator.java @@ -26,7 +26,7 @@ package org.geysermc.geyser.translator.protocol.java.inventory; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.inventory.ClientboundContainerClosePacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.util.InventoryUtils; @@ -35,7 +35,7 @@ import org.geysermc.geyser.util.InventoryUtils; public class JavaContainerCloseTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundContainerClosePacket packet) { + public void translate(GeyserSession session, ClientboundContainerClosePacket packet) { // Sometimes the server can request a window close of ID 0... when the window isn't even open // Don't confirm in this instance InventoryUtils.closeInventory(session, packet.getContainerId(), (session.getOpenInventory() != null && session.getOpenInventory().getId() == packet.getContainerId())); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/inventory/JavaContainerSetContentTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/inventory/JavaContainerSetContentTranslator.java index 3d3255768..0d572ca92 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/inventory/JavaContainerSetContentTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/inventory/JavaContainerSetContentTranslator.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.translator.protocol.java.inventory; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.inventory.ClientboundContainerSetContentPacket; import org.geysermc.geyser.inventory.GeyserItemStack; import org.geysermc.geyser.inventory.Inventory; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.translator.inventory.InventoryTranslator; @@ -38,7 +38,7 @@ import org.geysermc.geyser.util.InventoryUtils; public class JavaContainerSetContentTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundContainerSetContentPacket packet) { + public void translate(GeyserSession session, ClientboundContainerSetContentPacket packet) { Inventory inventory = InventoryUtils.getInventory(session, packet.getContainerId()); if (inventory == null) return; diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/inventory/JavaContainerSetDataTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/inventory/JavaContainerSetDataTranslator.java index 92cfe9619..2ffab0d38 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/inventory/JavaContainerSetDataTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/inventory/JavaContainerSetDataTranslator.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.translator.protocol.java.inventory; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.inventory.ClientboundContainerSetDataPacket; import org.geysermc.geyser.inventory.Inventory; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.translator.inventory.InventoryTranslator; @@ -37,7 +37,7 @@ import org.geysermc.geyser.util.InventoryUtils; public class JavaContainerSetDataTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundContainerSetDataPacket packet) { + public void translate(GeyserSession session, ClientboundContainerSetDataPacket packet) { Inventory inventory = InventoryUtils.getInventory(session, packet.getContainerId()); if (inventory == null) return; diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/inventory/JavaContainerSetSlotTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/inventory/JavaContainerSetSlotTranslator.java index 43d55c47a..54cc91ca6 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/inventory/JavaContainerSetSlotTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/inventory/JavaContainerSetSlotTranslator.java @@ -39,7 +39,7 @@ import com.nukkitx.protocol.bedrock.packet.CraftingDataPacket; import com.nukkitx.protocol.bedrock.packet.InventorySlotPacket; import org.geysermc.geyser.inventory.GeyserItemStack; import org.geysermc.geyser.inventory.Inventory; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.translator.inventory.InventoryTranslator; @@ -58,7 +58,7 @@ import java.util.concurrent.TimeUnit; public class JavaContainerSetSlotTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundContainerSetSlotPacket packet) { + public void translate(GeyserSession session, ClientboundContainerSetSlotPacket packet) { if (packet.getContainerId() == 255) { //cursor GeyserItemStack newItem = GeyserItemStack.from(packet.getItem()); session.getPlayerInventory().setCursor(newItem, session); @@ -92,7 +92,7 @@ public class JavaContainerSetSlotTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundMerchantOffersPacket packet) { + public void translate(GeyserSession session, ClientboundMerchantOffersPacket packet) { Inventory openInventory = session.getOpenInventory(); if (!(openInventory instanceof MerchantContainer merchantInventory && openInventory.getId() == packet.getContainerId())) { return; @@ -132,7 +132,7 @@ public class JavaMerchantOffersTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundOpenScreenPacket packet) { + public void translate(GeyserSession session, ClientboundOpenScreenPacket packet) { if (packet.getContainerId() == 0) { return; } diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaBlockDestructionTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaBlockDestructionTranslator.java index f14d05be6..65db15d83 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaBlockDestructionTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaBlockDestructionTranslator.java @@ -30,7 +30,7 @@ import com.github.steveice10.opennbt.tag.builtin.CompoundTag; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.LevelEventType; import com.nukkitx.protocol.bedrock.packet.LevelEventPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.registry.BlockRegistries; @@ -41,7 +41,7 @@ import org.geysermc.geyser.util.BlockUtils; public class JavaBlockDestructionTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundBlockDestructionPacket packet) { + public void translate(GeyserSession session, ClientboundBlockDestructionPacket packet) { int state = session.getGeyser().getWorldManager().getBlockAt(session, packet.getPosition().getX(), packet.getPosition().getY(), packet.getPosition().getZ()); int breakTime = (int) (65535 / Math.ceil(BlockUtils.getBreakTime(session, BlockRegistries.JAVA_BLOCKS.get(state), ItemMapping.AIR, new CompoundTag(""), false) * 20)); LevelEventPacket levelEventPacket = new LevelEventPacket(); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaBlockEntityDataTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaBlockEntityDataTranslator.java index 1d999542f..1c11b298e 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaBlockEntityDataTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaBlockEntityDataTranslator.java @@ -32,7 +32,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.Clientb import com.nukkitx.math.vector.Vector3i; import com.nukkitx.protocol.bedrock.data.inventory.ContainerType; import com.nukkitx.protocol.bedrock.packet.ContainerOpenPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.level.block.BlockStateValues; @@ -45,7 +45,7 @@ import org.geysermc.geyser.util.BlockEntityUtils; public class JavaBlockEntityDataTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundBlockEntityDataPacket packet) { + public void translate(GeyserSession session, ClientboundBlockEntityDataPacket packet) { BlockEntityTranslator translator = BlockEntityUtils.getBlockEntityTranslator(packet.getType()); // The Java block state is used in BlockEntityTranslator.translateTag() to make up for some inconsistencies // between Java block states and Bedrock block entity data diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaBlockEventTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaBlockEventTranslator.java index a46524010..3504168a5 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaBlockEventTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaBlockEventTranslator.java @@ -35,7 +35,7 @@ import com.nukkitx.protocol.bedrock.packet.BlockEntityDataPacket; import com.nukkitx.protocol.bedrock.packet.BlockEventPacket; import it.unimi.dsi.fastutil.objects.Object2IntMaps; import org.geysermc.common.PlatformType; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.session.cache.PistonCache; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -48,7 +48,7 @@ import org.geysermc.geyser.level.physics.Direction; public class JavaBlockEventTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundBlockEventPacket packet) { + public void translate(GeyserSession session, ClientboundBlockEventPacket packet) { BlockEventPacket blockEventPacket = new BlockEventPacket(); blockEventPacket.setBlockPosition(Vector3i.from(packet.getPosition().getX(), packet.getPosition().getY(), packet.getPosition().getZ())); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaBlockUpdateTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaBlockUpdateTranslator.java index 7bebcd11f..298bd4b90 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaBlockUpdateTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaBlockUpdateTranslator.java @@ -31,7 +31,7 @@ import com.nukkitx.math.vector.Vector3i; import com.nukkitx.protocol.bedrock.data.SoundEvent; import com.nukkitx.protocol.bedrock.packet.LevelSoundEventPacket; import org.geysermc.common.PlatformType; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.translator.sound.BlockSoundInteractionTranslator; @@ -42,7 +42,7 @@ import org.geysermc.geyser.util.ChunkUtils; public class JavaBlockUpdateTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundBlockUpdatePacket packet) { + public void translate(GeyserSession session, ClientboundBlockUpdatePacket packet) { Position pos = packet.getEntry().getPosition(); boolean updatePlacement = session.getGeyser().getPlatformType() != PlatformType.SPIGOT && // Spigot simply listens for the block place event session.getGeyser().getWorldManager().getBlockAt(session, pos) != packet.getEntry().getBlock(); @@ -53,7 +53,7 @@ public class JavaBlockUpdateTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundCustomSoundPacket packet) { + public void translate(GeyserSession session, ClientboundCustomSoundPacket packet) { String packetSound; if (packet.getSound() instanceof BuiltinSound) { packetSound = ((BuiltinSound) packet.getSound()).getName(); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaExplodeTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaExplodeTranslator.java index f07c19fa3..d97035b5c 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaExplodeTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaExplodeTranslator.java @@ -34,7 +34,7 @@ import com.nukkitx.protocol.bedrock.data.SoundEvent; import com.nukkitx.protocol.bedrock.packet.LevelEventPacket; import com.nukkitx.protocol.bedrock.packet.LevelSoundEventPacket; import com.nukkitx.protocol.bedrock.packet.SetEntityMotionPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.level.block.BlockStateValues; @@ -44,7 +44,7 @@ import org.geysermc.geyser.util.ChunkUtils; public class JavaExplodeTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundExplodePacket packet) { + public void translate(GeyserSession session, ClientboundExplodePacket packet) { for (Position position : packet.getExploded()) { Vector3i pos = Vector3i.from(packet.getX() + position.getX(), packet.getY() + position.getY(), packet.getZ() + position.getZ()); ChunkUtils.updateBlock(session, BlockStateValues.JAVA_AIR_ID, pos); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaForgetLevelChunkTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaForgetLevelChunkTranslator.java index 967edbcf4..8204ceea5 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaForgetLevelChunkTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaForgetLevelChunkTranslator.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.translator.protocol.java.level; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundForgetLevelChunkPacket; import com.nukkitx.math.vector.Vector3i; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -37,7 +37,7 @@ import java.util.Iterator; public class JavaForgetLevelChunkTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundForgetLevelChunkPacket packet) { + public void translate(GeyserSession session, ClientboundForgetLevelChunkPacket packet) { session.getChunkCache().removeChunk(packet.getX(), packet.getZ()); //Checks if a skull is in an unloaded chunk then removes it diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaGameEventTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaGameEventTranslator.java index cd1b5f37d..642f707a8 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaGameEventTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaGameEventTranslator.java @@ -39,7 +39,7 @@ import com.nukkitx.protocol.bedrock.data.LevelEventType; import com.nukkitx.protocol.bedrock.data.entity.EntityEventType; import com.nukkitx.protocol.bedrock.packet.*; import org.geysermc.geyser.entity.type.player.PlayerEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.translator.inventory.PlayerInventoryTranslator; @@ -49,7 +49,7 @@ import org.geysermc.geyser.text.MinecraftLocale; public class JavaGameEventTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundGameEventPacket packet) { + public void translate(GeyserSession session, ClientboundGameEventPacket packet) { PlayerEntity entity = session.getPlayerEntity(); switch (packet.getNotification()) { diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaLevelChunkWithLightTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaLevelChunkWithLightTranslator.java index 006620cad..4a749c6d3 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaLevelChunkWithLightTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaLevelChunkWithLightTranslator.java @@ -50,7 +50,7 @@ import it.unimi.dsi.fastutil.ints.IntArrayList; import it.unimi.dsi.fastutil.ints.IntList; import it.unimi.dsi.fastutil.ints.IntLists; import org.geysermc.geyser.entity.type.ItemFrameEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.translator.level.BiomeTranslator; @@ -77,7 +77,7 @@ import static org.geysermc.geyser.util.ChunkUtils.*; public class JavaLevelChunkWithLightTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundLevelChunkWithLightPacket packet) { + public void translate(GeyserSession session, ClientboundLevelChunkWithLightPacket packet) { if (session.isSpawned()) { ChunkUtils.updateChunkPosition(session, session.getPlayerEntity().getPosition().toInt()); } diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaLevelEventTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaLevelEventTranslator.java index 366a4c94c..d861d0338 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaLevelEventTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaLevelEventTranslator.java @@ -42,7 +42,7 @@ import com.nukkitx.protocol.bedrock.packet.LevelSoundEventPacket; import com.nukkitx.protocol.bedrock.packet.TextPacket; import com.nukkitx.protocol.bedrock.v465.Bedrock_v465; import org.geysermc.geyser.GeyserImpl; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.translator.level.event.LevelEventTranslator; @@ -56,7 +56,7 @@ import java.util.Locale; public class JavaLevelEventTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundLevelEventPacket packet) { + public void translate(GeyserSession session, ClientboundLevelEventPacket packet) { // Separate case since each RecordEventData in Java is an individual track in Bedrock if (packet.getEvent() == com.github.steveice10.mc.protocol.data.game.level.event.SoundEvent.RECORD) { RecordEventData recordEventData = (RecordEventData) packet.getData(); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaLevelParticlesTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaLevelParticlesTranslator.java index 4f4251750..7cbdc2a4b 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaLevelParticlesTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaLevelParticlesTranslator.java @@ -34,7 +34,7 @@ import com.nukkitx.protocol.bedrock.data.LevelEventType; import com.nukkitx.protocol.bedrock.data.inventory.ItemData; import com.nukkitx.protocol.bedrock.packet.LevelEventPacket; import com.nukkitx.protocol.bedrock.packet.SpawnParticleEffectPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.translator.inventory.item.ItemTranslator; @@ -50,7 +50,7 @@ import java.util.function.Function; public class JavaLevelParticlesTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundLevelParticlesPacket packet) { + public void translate(GeyserSession session, ClientboundLevelParticlesPacket packet) { Function particleCreateFunction = createParticle(session, packet.getParticle()); if (particleCreateFunction != null) { if (packet.getAmount() == 0) { @@ -80,7 +80,7 @@ public class JavaLevelParticlesTranslator extends PacketTranslator createParticle(GeyserSessionImpl session, Particle particle) { + private Function createParticle(GeyserSession session, Particle particle) { switch (particle.getType()) { case BLOCK -> { int blockState = session.getBlockMappings().getBedrockBlockId(((BlockParticleData) particle.getData()).getBlockState()); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaMapItemDataTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaMapItemDataTranslator.java index ed9aceac2..c5b296f4f 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaMapItemDataTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaMapItemDataTranslator.java @@ -30,7 +30,7 @@ import com.github.steveice10.mc.protocol.data.game.level.map.MapIcon; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundMapItemDataPacket; import com.nukkitx.protocol.bedrock.data.MapDecoration; import com.nukkitx.protocol.bedrock.data.MapTrackedObject; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.level.BedrockMapIcon; @@ -41,7 +41,7 @@ import org.geysermc.geyser.level.MapColor; public class JavaMapItemDataTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundMapItemDataPacket packet) { + public void translate(GeyserSession session, ClientboundMapItemDataPacket packet) { com.nukkitx.protocol.bedrock.packet.ClientboundMapItemDataPacket mapItemDataPacket = new com.nukkitx.protocol.bedrock.packet.ClientboundMapItemDataPacket(); boolean shouldStore = false; diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaSectionBlocksUpdateTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaSectionBlocksUpdateTranslator.java index d1cc3704e..c301ee462 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaSectionBlocksUpdateTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaSectionBlocksUpdateTranslator.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.translator.protocol.java.level; import com.github.steveice10.mc.protocol.data.game.level.block.BlockChangeEntry; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundSectionBlocksUpdatePacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.util.ChunkUtils; @@ -36,7 +36,7 @@ import org.geysermc.geyser.util.ChunkUtils; public class JavaSectionBlocksUpdateTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundSectionBlocksUpdatePacket packet) { + public void translate(GeyserSession session, ClientboundSectionBlocksUpdatePacket packet) { for (BlockChangeEntry entry : packet.getEntries()) { ChunkUtils.updateBlock(session, entry.getBlock(), entry.getPosition()); } diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaSetChunkCacheCenterTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaSetChunkCacheCenterTranslator.java index 8f1147cb3..901a4d82e 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaSetChunkCacheCenterTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaSetChunkCacheCenterTranslator.java @@ -26,7 +26,7 @@ package org.geysermc.geyser.translator.protocol.java.level; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundSetChunkCacheCenterPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.util.ChunkUtils; @@ -36,7 +36,7 @@ import com.nukkitx.math.vector.Vector3i; public class JavaSetChunkCacheCenterTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundSetChunkCacheCenterPacket packet) { + public void translate(GeyserSession session, ClientboundSetChunkCacheCenterPacket packet) { if (!session.isSpawned() && session.getLastChunkPosition() == null) { ChunkUtils.updateChunkPosition(session, Vector3i.from(packet.getChunkX() << 4, 64, packet.getChunkZ() << 4)); } diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaSetChunkCacheRadiusTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaSetChunkCacheRadiusTranslator.java index 919f860df..50ed540ea 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaSetChunkCacheRadiusTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaSetChunkCacheRadiusTranslator.java @@ -26,7 +26,7 @@ package org.geysermc.geyser.translator.protocol.java.level; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundSetChunkCacheRadiusPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -34,7 +34,7 @@ import org.geysermc.geyser.translator.protocol.Translator; public class JavaSetChunkCacheRadiusTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundSetChunkCacheRadiusPacket packet) { + public void translate(GeyserSession session, ClientboundSetChunkCacheRadiusPacket packet) { session.setRenderDistance(packet.getViewDistance()); } } diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaSetDefaultSpawnPositionTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaSetDefaultSpawnPositionTranslator.java index e38cf00fd..8067341e1 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaSetDefaultSpawnPositionTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaSetDefaultSpawnPositionTranslator.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.translator.protocol.java.level; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundSetDefaultSpawnPositionPacket; import com.nukkitx.math.vector.Vector3i; import com.nukkitx.protocol.bedrock.packet.SetSpawnPositionPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.util.DimensionUtils; @@ -37,7 +37,7 @@ import org.geysermc.geyser.util.DimensionUtils; public class JavaSetDefaultSpawnPositionTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundSetDefaultSpawnPositionPacket packet) { + public void translate(GeyserSession session, ClientboundSetDefaultSpawnPositionPacket packet) { SetSpawnPositionPacket spawnPositionPacket = new SetSpawnPositionPacket(); spawnPositionPacket.setBlockPosition(Vector3i.from(packet.getPosition().getX(), packet.getPosition().getY(), packet.getPosition().getZ())); spawnPositionPacket.setSpawnForced(true); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaSetTimeTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaSetTimeTranslator.java index 6170b2b32..9ff6965ca 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaSetTimeTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaSetTimeTranslator.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.translator.protocol.java.level; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundSetTimePacket; import com.nukkitx.protocol.bedrock.packet.SetTimePacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -35,7 +35,7 @@ import org.geysermc.geyser.translator.protocol.Translator; public class JavaSetTimeTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundSetTimePacket packet) { + public void translate(GeyserSession session, ClientboundSetTimePacket packet) { // Bedrock sends a GameRulesChangedPacket if there is no daylight cycle // Java just sends a negative long if there is no daylight cycle long time = packet.getTime(); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaSoundTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaSoundTranslator.java index ad0af4f10..e9f9337aa 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaSoundTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaSoundTranslator.java @@ -31,7 +31,7 @@ import com.nukkitx.protocol.bedrock.data.LevelEventType; import com.nukkitx.protocol.bedrock.data.SoundEvent; import com.nukkitx.protocol.bedrock.packet.LevelEventPacket; import com.nukkitx.protocol.bedrock.packet.LevelSoundEventPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.level.block.BlockStateValues; @@ -44,7 +44,7 @@ import org.geysermc.geyser.registry.type.SoundMapping; public class JavaSoundTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundSoundPacket packet) { + public void translate(GeyserSession session, ClientboundSoundPacket packet) { String packetSound = packet.getSound().getName(); SoundMapping soundMapping = Registries.SOUNDS.get(packetSound); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaStopSoundTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaStopSoundTranslator.java index e791407f2..75a99f0af 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaStopSoundTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaStopSoundTranslator.java @@ -29,7 +29,7 @@ import com.github.steveice10.mc.protocol.data.game.level.sound.BuiltinSound; import com.github.steveice10.mc.protocol.data.game.level.sound.CustomSound; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundStopSoundPacket; import com.nukkitx.protocol.bedrock.packet.StopSoundPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.registry.Registries; @@ -39,7 +39,7 @@ import org.geysermc.geyser.registry.type.SoundMapping; public class JavaStopSoundTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundStopSoundPacket packet) { + public void translate(GeyserSession session, ClientboundStopSoundPacket packet) { // Runs if all sounds are stopped if (packet.getSound() == null) { StopSoundPacket stopPacket = new StopSoundPacket(); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/border/JavaInitializeBorderTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/border/JavaInitializeBorderTranslator.java index f0574f99f..1f7ea7657 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/border/JavaInitializeBorderTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/border/JavaInitializeBorderTranslator.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.translator.protocol.java.level.border; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.border.ClientboundInitializeBorderPacket; import com.nukkitx.math.vector.Vector2d; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.session.cache.WorldBorder; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -36,7 +36,7 @@ import org.geysermc.geyser.translator.protocol.Translator; public class JavaInitializeBorderTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundInitializeBorderPacket packet) { + public void translate(GeyserSession session, ClientboundInitializeBorderPacket packet) { WorldBorder worldBorder = session.getWorldBorder(); worldBorder.setCenter(Vector2d.from(packet.getNewCenterX(), packet.getNewCenterZ())); worldBorder.setOldDiameter(packet.getOldSize()); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/border/JavaSetBorderCenterTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/border/JavaSetBorderCenterTranslator.java index 6a60f6f38..6895cf944 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/border/JavaSetBorderCenterTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/border/JavaSetBorderCenterTranslator.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.translator.protocol.java.level.border; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.border.ClientboundSetBorderCenterPacket; import com.nukkitx.math.vector.Vector2d; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.session.cache.WorldBorder; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -36,7 +36,7 @@ import org.geysermc.geyser.translator.protocol.Translator; public class JavaSetBorderCenterTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundSetBorderCenterPacket packet) { + public void translate(GeyserSession session, ClientboundSetBorderCenterPacket packet) { WorldBorder worldBorder = session.getWorldBorder(); worldBorder.setCenter(Vector2d.from(packet.getNewCenterX(), packet.getNewCenterZ())); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/border/JavaSetBorderLerpSizeTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/border/JavaSetBorderLerpSizeTranslator.java index 2fe5eb392..3eae4b1f5 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/border/JavaSetBorderLerpSizeTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/border/JavaSetBorderLerpSizeTranslator.java @@ -26,7 +26,7 @@ package org.geysermc.geyser.translator.protocol.java.level.border; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.border.ClientboundSetBorderLerpSizePacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.session.cache.WorldBorder; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -35,7 +35,7 @@ import org.geysermc.geyser.translator.protocol.Translator; public class JavaSetBorderLerpSizeTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundSetBorderLerpSizePacket packet) { + public void translate(GeyserSession session, ClientboundSetBorderLerpSizePacket packet) { WorldBorder worldBorder = session.getWorldBorder(); worldBorder.setOldDiameter(packet.getOldSize()); worldBorder.setNewDiameter(packet.getNewSize()); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/border/JavaSetBorderSizeTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/border/JavaSetBorderSizeTranslator.java index 2adee0f41..076924735 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/border/JavaSetBorderSizeTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/border/JavaSetBorderSizeTranslator.java @@ -26,7 +26,7 @@ package org.geysermc.geyser.translator.protocol.java.level.border; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.border.ClientboundSetBorderSizePacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.session.cache.WorldBorder; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -35,7 +35,7 @@ import org.geysermc.geyser.translator.protocol.Translator; public class JavaSetBorderSizeTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundSetBorderSizePacket packet) { + public void translate(GeyserSession session, ClientboundSetBorderSizePacket packet) { WorldBorder worldBorder = session.getWorldBorder(); worldBorder.setOldDiameter(packet.getSize()); worldBorder.setNewDiameter(packet.getSize()); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/border/JavaSetBorderWarningDelayTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/border/JavaSetBorderWarningDelayTranslator.java index 7e7e91f13..b3104fb9a 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/border/JavaSetBorderWarningDelayTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/border/JavaSetBorderWarningDelayTranslator.java @@ -26,7 +26,7 @@ package org.geysermc.geyser.translator.protocol.java.level.border; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.border.ClientboundSetBorderWarningDelayPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.session.cache.WorldBorder; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -35,7 +35,7 @@ import org.geysermc.geyser.translator.protocol.Translator; public class JavaSetBorderWarningDelayTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundSetBorderWarningDelayPacket packet) { + public void translate(GeyserSession session, ClientboundSetBorderWarningDelayPacket packet) { WorldBorder worldBorder = session.getWorldBorder(); worldBorder.setWarningDelay(packet.getWarningDelay()); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/border/JavaSetBorderWarningDistanceTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/border/JavaSetBorderWarningDistanceTranslator.java index 8288f804e..b4483b9a6 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/border/JavaSetBorderWarningDistanceTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/border/JavaSetBorderWarningDistanceTranslator.java @@ -26,7 +26,7 @@ package org.geysermc.geyser.translator.protocol.java.level.border; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.border.ClientboundSetBorderWarningDistancePacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.session.cache.WorldBorder; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -35,7 +35,7 @@ import org.geysermc.geyser.translator.protocol.Translator; public class JavaSetBorderWarningDistanceTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundSetBorderWarningDistancePacket packet) { + public void translate(GeyserSession session, ClientboundSetBorderWarningDistancePacket packet) { WorldBorder worldBorder = session.getWorldBorder(); worldBorder.setWarningBlocks(packet.getWarningBlocks()); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/scoreboard/JavaSetDisplayObjectiveTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/scoreboard/JavaSetDisplayObjectiveTranslator.java index ffe7386fb..fe141486e 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/scoreboard/JavaSetDisplayObjectiveTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/scoreboard/JavaSetDisplayObjectiveTranslator.java @@ -26,7 +26,7 @@ package org.geysermc.geyser.translator.protocol.java.scoreboard; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.scoreboard.ClientboundSetDisplayObjectivePacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.session.cache.WorldCache; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -37,7 +37,7 @@ import org.geysermc.geyser.scoreboard.ScoreboardUpdater; public class JavaSetDisplayObjectiveTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundSetDisplayObjectivePacket packet) { + public void translate(GeyserSession session, ClientboundSetDisplayObjectivePacket packet) { WorldCache worldCache = session.getWorldCache(); Scoreboard scoreboard = worldCache.getScoreboard(); int pps = worldCache.increaseAndGetScoreboardPacketsPerSecond(); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/scoreboard/JavaSetObjectiveTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/scoreboard/JavaSetObjectiveTranslator.java index 20932f9cd..79c0036ad 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/scoreboard/JavaSetObjectiveTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/scoreboard/JavaSetObjectiveTranslator.java @@ -31,7 +31,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.clientbound.scoreboard.Cl import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.GeyserLogger; import org.geysermc.geyser.entity.type.player.PlayerEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.session.cache.WorldCache; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -46,7 +46,7 @@ public class JavaSetObjectiveTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundClearTitlesPacket packet) { + public void translate(GeyserSession session, ClientboundClearTitlesPacket packet) { SetTitlePacket titlePacket = new SetTitlePacket(); // TODO handle packet.isResetTimes() titlePacket.setType(SetTitlePacket.Type.CLEAR); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/title/JavaSetActionBarTextTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/title/JavaSetActionBarTextTranslator.java index e4fa7fe46..914ddafb9 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/title/JavaSetActionBarTextTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/title/JavaSetActionBarTextTranslator.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.translator.protocol.java.title; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.title.ClientboundSetActionBarTextPacket; import com.nukkitx.protocol.bedrock.packet.SetTitlePacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.translator.text.MessageTranslator; @@ -36,7 +36,7 @@ import org.geysermc.geyser.translator.text.MessageTranslator; public class JavaSetActionBarTextTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundSetActionBarTextPacket packet) { + public void translate(GeyserSession session, ClientboundSetActionBarTextPacket packet) { String text; if (packet.getText() == null) { //TODO 1.17 can this happen? text = " "; diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/title/JavaSetSubtitleTextTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/title/JavaSetSubtitleTextTranslator.java index 70e3716a2..521f5eba6 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/title/JavaSetSubtitleTextTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/title/JavaSetSubtitleTextTranslator.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.translator.protocol.java.title; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.title.ClientboundSetSubtitleTextPacket; import com.nukkitx.protocol.bedrock.packet.SetTitlePacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.translator.text.MessageTranslator; @@ -36,7 +36,7 @@ import org.geysermc.geyser.translator.text.MessageTranslator; public class JavaSetSubtitleTextTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundSetSubtitleTextPacket packet) { + public void translate(GeyserSession session, ClientboundSetSubtitleTextPacket packet) { String text; if (packet.getText() == null) { //TODO 1.17 can this happen? text = " "; diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/title/JavaSetTitleTextTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/title/JavaSetTitleTextTranslator.java index 8a2594ffb..04eb76bb5 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/title/JavaSetTitleTextTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/title/JavaSetTitleTextTranslator.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.translator.protocol.java.title; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.title.ClientboundSetTitleTextPacket; import com.nukkitx.protocol.bedrock.packet.SetTitlePacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.translator.text.MessageTranslator; @@ -36,7 +36,7 @@ import org.geysermc.geyser.translator.text.MessageTranslator; public class JavaSetTitleTextTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundSetTitleTextPacket packet) { + public void translate(GeyserSession session, ClientboundSetTitleTextPacket packet) { String text; if (packet.getText() == null) { // This can happen, see https://github.com/KyoriPowered/adventure/issues/447 text = " "; diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/title/JavaSetTitlesAnimationTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/title/JavaSetTitlesAnimationTranslator.java index 6d96bc8ea..b8bbc780a 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/title/JavaSetTitlesAnimationTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/title/JavaSetTitlesAnimationTranslator.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.translator.protocol.java.title; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.title.ClientboundSetTitlesAnimationPacket; import com.nukkitx.protocol.bedrock.packet.SetTitlePacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -35,7 +35,7 @@ import org.geysermc.geyser.translator.protocol.Translator; public class JavaSetTitlesAnimationTranslator extends PacketTranslator { @Override - public void translate(GeyserSessionImpl session, ClientboundSetTitlesAnimationPacket packet) { + public void translate(GeyserSession session, ClientboundSetTitlesAnimationPacket packet) { SetTitlePacket titlePacket = new SetTitlePacket(); titlePacket.setType(SetTitlePacket.Type.TIMES); titlePacket.setText(""); diff --git a/core/src/main/java/org/geysermc/geyser/translator/sound/BlockSoundInteractionTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/sound/BlockSoundInteractionTranslator.java index d42aa9a50..5e6e8d9e8 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/sound/BlockSoundInteractionTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/sound/BlockSoundInteractionTranslator.java @@ -32,7 +32,7 @@ import com.github.steveice10.opennbt.tag.builtin.StringTag; import com.github.steveice10.opennbt.tag.builtin.Tag; import com.nukkitx.math.vector.Vector3f; import org.geysermc.geyser.inventory.GeyserItemStack; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.Registries; import org.geysermc.geyser.util.BlockUtils; @@ -51,7 +51,7 @@ public interface BlockSoundInteractionTranslator extends SoundInteractionTransla * @param position the position of the block * @param identifier the identifier of the block */ - static void handleBlockInteraction(GeyserSessionImpl session, Vector3f position, String identifier) { + static void handleBlockInteraction(GeyserSession session, Vector3f position, String identifier) { // If we need to get the hand identifier, only get it once and save it to a variable String handIdentifier = null; @@ -98,7 +98,7 @@ public interface BlockSoundInteractionTranslator extends SoundInteractionTransla /** * Determines if the adventure gamemode would prevent this item from actually succeeding */ - static boolean canInteract(GeyserSessionImpl session, GeyserItemStack itemInHand, String blockIdentifier) { + static boolean canInteract(GeyserSession session, GeyserItemStack itemInHand, String blockIdentifier) { if (session.getGameMode() != GameMode.ADVENTURE) { // There are no restrictions on the item return true; diff --git a/core/src/main/java/org/geysermc/geyser/translator/sound/EntitySoundInteractionTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/sound/EntitySoundInteractionTranslator.java index 27b026a46..4a88696f8 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/sound/EntitySoundInteractionTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/sound/EntitySoundInteractionTranslator.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.translator.sound; import com.nukkitx.math.vector.Vector3f; import org.geysermc.geyser.entity.type.Entity; import org.geysermc.geyser.inventory.GeyserItemStack; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.Registries; import java.util.Map; @@ -46,7 +46,7 @@ public interface EntitySoundInteractionTranslator extends SoundInteractionTransl * @param position the position of the block * @param entity the entity interacted with */ - static void handleEntityInteraction(GeyserSessionImpl session, Vector3f position, Entity entity) { + static void handleEntityInteraction(GeyserSession session, Vector3f position, Entity entity) { // If we need to get the hand identifier, only get it once and save it to a variable String handIdentifier = null; diff --git a/core/src/main/java/org/geysermc/geyser/translator/sound/SoundInteractionTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/sound/SoundInteractionTranslator.java index be0ccb0c8..7cccbb21d 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/sound/SoundInteractionTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/sound/SoundInteractionTranslator.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.translator.sound; import com.nukkitx.math.vector.Vector3f; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; /** * Handler for playing sounds when right-clicking @@ -48,5 +48,5 @@ public interface SoundInteractionTranslator { * @param position the position of the block * @param value the value */ - void translate(GeyserSessionImpl session, Vector3f position, T value); + void translate(GeyserSession session, Vector3f position, T value); } diff --git a/core/src/main/java/org/geysermc/geyser/translator/sound/block/BucketSoundInteractionTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/sound/block/BucketSoundInteractionTranslator.java index 072e0bf56..1af30e658 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/sound/block/BucketSoundInteractionTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/sound/block/BucketSoundInteractionTranslator.java @@ -29,7 +29,7 @@ import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.SoundEvent; import com.nukkitx.protocol.bedrock.packet.LevelSoundEventPacket; import org.geysermc.geyser.inventory.GeyserItemStack; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.sound.BlockSoundInteractionTranslator; import org.geysermc.geyser.translator.sound.SoundTranslator; @@ -37,7 +37,7 @@ import org.geysermc.geyser.translator.sound.SoundTranslator; public class BucketSoundInteractionTranslator implements BlockSoundInteractionTranslator { @Override - public void translate(GeyserSessionImpl session, Vector3f position, String identifier) { + public void translate(GeyserSession session, Vector3f position, String identifier) { if (session.getBucketScheduledFuture() == null) { return; // No bucket was really interacted with } diff --git a/core/src/main/java/org/geysermc/geyser/translator/sound/block/ComparatorSoundInteractionTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/sound/block/ComparatorSoundInteractionTranslator.java index 9fb95fbb5..8c10076d3 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/sound/block/ComparatorSoundInteractionTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/sound/block/ComparatorSoundInteractionTranslator.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.translator.sound.block; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.LevelEventType; import com.nukkitx.protocol.bedrock.packet.LevelEventPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.sound.BlockSoundInteractionTranslator; import org.geysermc.geyser.translator.sound.SoundTranslator; @@ -36,7 +36,7 @@ import org.geysermc.geyser.translator.sound.SoundTranslator; public class ComparatorSoundInteractionTranslator implements BlockSoundInteractionTranslator { @Override - public void translate(GeyserSessionImpl session, Vector3f position, String identifier) { + public void translate(GeyserSession session, Vector3f position, String identifier) { boolean powered = identifier.contains("mode=compare"); LevelEventPacket levelEventPacket = new LevelEventPacket(); levelEventPacket.setPosition(position); diff --git a/core/src/main/java/org/geysermc/geyser/translator/sound/block/DoorSoundInteractionTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/sound/block/DoorSoundInteractionTranslator.java index 38f53d855..1115760eb 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/sound/block/DoorSoundInteractionTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/sound/block/DoorSoundInteractionTranslator.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.translator.sound.block; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.LevelEventType; import com.nukkitx.protocol.bedrock.packet.LevelEventPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.sound.BlockSoundInteractionTranslator; import org.geysermc.geyser.translator.sound.SoundTranslator; @@ -36,7 +36,7 @@ import org.geysermc.geyser.translator.sound.SoundTranslator; public class DoorSoundInteractionTranslator implements BlockSoundInteractionTranslator { @Override - public void translate(GeyserSessionImpl session, Vector3f position, String identifier) { + public void translate(GeyserSession session, Vector3f position, String identifier) { if (identifier.contains("iron")) return; LevelEventPacket levelEventPacket = new LevelEventPacket(); levelEventPacket.setType(LevelEventType.SOUND_DOOR_OPEN); diff --git a/core/src/main/java/org/geysermc/geyser/translator/sound/block/FlintAndSteelInteractionTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/sound/block/FlintAndSteelInteractionTranslator.java index 920ece899..09e86f461 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/sound/block/FlintAndSteelInteractionTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/sound/block/FlintAndSteelInteractionTranslator.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.translator.sound.block; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.SoundEvent; import com.nukkitx.protocol.bedrock.packet.LevelSoundEventPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.sound.BlockSoundInteractionTranslator; import org.geysermc.geyser.translator.sound.SoundTranslator; @@ -36,7 +36,7 @@ import org.geysermc.geyser.translator.sound.SoundTranslator; public class FlintAndSteelInteractionTranslator implements BlockSoundInteractionTranslator { @Override - public void translate(GeyserSessionImpl session, Vector3f position, String identifier) { + public void translate(GeyserSession session, Vector3f position, String identifier) { LevelSoundEventPacket levelSoundEventPacket = new LevelSoundEventPacket(); levelSoundEventPacket.setPosition(position); levelSoundEventPacket.setBabySound(false); diff --git a/core/src/main/java/org/geysermc/geyser/translator/sound/block/GrassPathInteractionTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/sound/block/GrassPathInteractionTranslator.java index fc258978f..6c91b24a0 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/sound/block/GrassPathInteractionTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/sound/block/GrassPathInteractionTranslator.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.translator.sound.block; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.SoundEvent; import com.nukkitx.protocol.bedrock.packet.LevelSoundEventPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.sound.BlockSoundInteractionTranslator; import org.geysermc.geyser.translator.sound.SoundTranslator; import org.geysermc.geyser.registry.BlockRegistries; @@ -37,7 +37,7 @@ import org.geysermc.geyser.registry.BlockRegistries; public class GrassPathInteractionTranslator implements BlockSoundInteractionTranslator { @Override - public void translate(GeyserSessionImpl session, Vector3f position, String identifier) { + public void translate(GeyserSession session, Vector3f position, String identifier) { LevelSoundEventPacket levelSoundEventPacket = new LevelSoundEventPacket(); levelSoundEventPacket.setPosition(position); levelSoundEventPacket.setBabySound(false); diff --git a/core/src/main/java/org/geysermc/geyser/translator/sound/block/HoeInteractionTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/sound/block/HoeInteractionTranslator.java index a37650849..799364498 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/sound/block/HoeInteractionTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/sound/block/HoeInteractionTranslator.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.translator.sound.block; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.SoundEvent; import com.nukkitx.protocol.bedrock.packet.LevelSoundEventPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.sound.BlockSoundInteractionTranslator; import org.geysermc.geyser.translator.sound.SoundTranslator; import org.geysermc.geyser.registry.BlockRegistries; @@ -37,7 +37,7 @@ import org.geysermc.geyser.registry.BlockRegistries; public class HoeInteractionTranslator implements BlockSoundInteractionTranslator { @Override - public void translate(GeyserSessionImpl session, Vector3f position, String identifier) { + public void translate(GeyserSession session, Vector3f position, String identifier) { LevelSoundEventPacket levelSoundEventPacket = new LevelSoundEventPacket(); levelSoundEventPacket.setPosition(position); levelSoundEventPacket.setBabySound(false); diff --git a/core/src/main/java/org/geysermc/geyser/translator/sound/block/LeverSoundInteractionTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/sound/block/LeverSoundInteractionTranslator.java index a1b6247a1..a57d337b1 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/sound/block/LeverSoundInteractionTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/sound/block/LeverSoundInteractionTranslator.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.translator.sound.block; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.LevelEventType; import com.nukkitx.protocol.bedrock.packet.LevelEventPacket; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.sound.BlockSoundInteractionTranslator; import org.geysermc.geyser.translator.sound.SoundTranslator; @@ -36,7 +36,7 @@ import org.geysermc.geyser.translator.sound.SoundTranslator; public class LeverSoundInteractionTranslator implements BlockSoundInteractionTranslator { @Override - public void translate(GeyserSessionImpl session, Vector3f position, String identifier) { + public void translate(GeyserSession session, Vector3f position, String identifier) { boolean powered = identifier.contains("powered=true"); LevelEventPacket levelEventPacket = new LevelEventPacket(); levelEventPacket.setPosition(position); diff --git a/core/src/main/java/org/geysermc/geyser/translator/sound/entity/FeedBabySoundInteractionTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/sound/entity/FeedBabySoundInteractionTranslator.java index bc8822c8c..ea160538e 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/sound/entity/FeedBabySoundInteractionTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/sound/entity/FeedBabySoundInteractionTranslator.java @@ -32,7 +32,7 @@ import org.geysermc.geyser.entity.type.Entity; import org.geysermc.geyser.entity.type.living.animal.AnimalEntity; import org.geysermc.geyser.entity.type.living.animal.OcelotEntity; import org.geysermc.geyser.entity.type.living.animal.tameable.CatEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.sound.EntitySoundInteractionTranslator; import org.geysermc.geyser.translator.sound.SoundTranslator; @@ -40,7 +40,7 @@ import org.geysermc.geyser.translator.sound.SoundTranslator; public class FeedBabySoundInteractionTranslator implements EntitySoundInteractionTranslator { @Override - public void translate(GeyserSessionImpl session, Vector3f position, Entity entity) { + public void translate(GeyserSession session, Vector3f position, Entity entity) { if (entity instanceof AnimalEntity animalEntity && !(entity instanceof CatEntity || entity instanceof OcelotEntity)) { String handIdentifier = session.getPlayerInventory().getItemInHand().getMapping(session).getJavaIdentifier(); boolean isBaby = animalEntity.isBaby(); diff --git a/core/src/main/java/org/geysermc/geyser/translator/sound/entity/MilkEntitySoundInteractionTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/sound/entity/MilkEntitySoundInteractionTranslator.java index 47fad3559..e8698ff23 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/sound/entity/MilkEntitySoundInteractionTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/sound/entity/MilkEntitySoundInteractionTranslator.java @@ -31,7 +31,7 @@ import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import com.nukkitx.protocol.bedrock.packet.LevelSoundEventPacket; import org.geysermc.geyser.entity.type.Entity; import org.geysermc.geyser.entity.type.living.animal.GoatEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.sound.EntitySoundInteractionTranslator; import org.geysermc.geyser.translator.sound.SoundTranslator; @@ -39,7 +39,7 @@ import org.geysermc.geyser.translator.sound.SoundTranslator; public class MilkEntitySoundInteractionTranslator implements EntitySoundInteractionTranslator { @Override - public void translate(GeyserSessionImpl session, Vector3f position, Entity value) { + public void translate(GeyserSession session, Vector3f position, Entity value) { if (!session.getPlayerInventory().getItemInHand().getMapping(session).getJavaIdentifier().equals("minecraft:bucket")) { return; } diff --git a/core/src/main/java/org/geysermc/geyser/translator/text/MessageTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/text/MessageTranslator.java index eab6c4ba6..d22b47768 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/text/MessageTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/text/MessageTranslator.java @@ -33,7 +33,7 @@ import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer; import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer; import org.geysermc.geyser.GeyserImpl; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.text.MinecraftTranslationRegistry; import org.geysermc.geyser.text.GsonComponentSerializerWrapper; import org.geysermc.geyser.text.GeyserLocale; @@ -223,10 +223,10 @@ public class MessageTranslator { * Checks if the given message is over 256 characters (Java edition server chat limit) and sends a message to the user if it is * * @param message Message to check - * @param session {@link GeyserSessionImpl} for the user + * @param session {@link GeyserSession} for the user * @return True if the message is too long, false if not */ - public static boolean isTooLong(String message, GeyserSessionImpl session) { + public static boolean isTooLong(String message, GeyserSession session) { if (message.length() > 256) { session.sendMessage(GeyserLocale.getPlayerLocaleString("geyser.chat.too_long", session.getLocale(), message.length())); return true; diff --git a/core/src/main/java/org/geysermc/geyser/util/BlockEntityUtils.java b/core/src/main/java/org/geysermc/geyser/util/BlockEntityUtils.java index 0f6cc07a3..6d4258d7e 100644 --- a/core/src/main/java/org/geysermc/geyser/util/BlockEntityUtils.java +++ b/core/src/main/java/org/geysermc/geyser/util/BlockEntityUtils.java @@ -31,7 +31,7 @@ import com.nukkitx.math.vector.Vector3i; import com.nukkitx.nbt.NbtMap; import com.nukkitx.protocol.bedrock.packet.BlockEntityDataPacket; import it.unimi.dsi.fastutil.objects.ObjectArrayList; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.level.block.entity.BedrockOnlyBlockEntity; import org.geysermc.geyser.translator.level.block.entity.BlockEntityTranslator; import org.geysermc.geyser.translator.level.block.entity.FlowerPotBlockEntityTranslator; @@ -89,11 +89,11 @@ public class BlockEntityUtils { return Registries.BLOCK_ENTITIES.get(type); } - public static void updateBlockEntity(GeyserSessionImpl session, @Nonnull NbtMap blockEntity, Position position) { + public static void updateBlockEntity(GeyserSession session, @Nonnull NbtMap blockEntity, Position position) { updateBlockEntity(session, blockEntity, Vector3i.from(position.getX(), position.getY(), position.getZ())); } - public static void updateBlockEntity(GeyserSessionImpl session, @Nonnull NbtMap blockEntity, Vector3i position) { + public static void updateBlockEntity(GeyserSession session, @Nonnull NbtMap blockEntity, Vector3i position) { BlockEntityDataPacket blockEntityPacket = new BlockEntityDataPacket(); blockEntityPacket.setBlockPosition(position); blockEntityPacket.setData(blockEntity); diff --git a/core/src/main/java/org/geysermc/geyser/util/BlockUtils.java b/core/src/main/java/org/geysermc/geyser/util/BlockUtils.java index 125d13662..c43cc3311 100644 --- a/core/src/main/java/org/geysermc/geyser/util/BlockUtils.java +++ b/core/src/main/java/org/geysermc/geyser/util/BlockUtils.java @@ -30,7 +30,7 @@ import com.github.steveice10.opennbt.tag.builtin.CompoundTag; import com.nukkitx.math.vector.Vector3i; import org.geysermc.geyser.inventory.GeyserItemStack; import org.geysermc.geyser.inventory.PlayerInventory; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.collision.BlockCollision; import org.geysermc.geyser.level.block.BlockStateValues; import org.geysermc.geyser.registry.Registries; @@ -43,7 +43,7 @@ public class BlockUtils { */ public static final Position POSITION_ZERO = new Position(0, 0, 0); - private static boolean correctTool(GeyserSessionImpl session, BlockMapping blockMapping, String itemToolType) { + private static boolean correctTool(GeyserSession session, BlockMapping blockMapping, String itemToolType) { switch (itemToolType) { case "axe": return session.getTagCache().isAxeEffective(blockMapping); @@ -78,7 +78,7 @@ public class BlockUtils { }; } - private static boolean canToolTierBreakBlock(GeyserSessionImpl session, BlockMapping blockMapping, String toolTier) { + private static boolean canToolTierBreakBlock(GeyserSession session, BlockMapping blockMapping, String toolTier) { if (toolTier.equals("netherite") || toolTier.equals("diamond")) { // As of 1.17, these tiers can mine everything that is mineable return true; @@ -139,7 +139,7 @@ public class BlockUtils { return 1.0 / speed; } - public static double getBreakTime(GeyserSessionImpl session, BlockMapping blockMapping, ItemMapping item, CompoundTag nbtData, boolean isSessionPlayer) { + public static double getBreakTime(GeyserSession session, BlockMapping blockMapping, ItemMapping item, CompoundTag nbtData, boolean isSessionPlayer) { boolean isShearsEffective = session.getTagCache().isShearsEffective(blockMapping); //TODO called twice boolean canHarvestWithHand = blockMapping.isCanBreakWithHand(); String toolType = ""; @@ -178,7 +178,7 @@ public class BlockUtils { outOfWaterButNotOnGround, insideWaterNotOnGround); } - public static double getSessionBreakTime(GeyserSessionImpl session, BlockMapping blockMapping) { + public static double getSessionBreakTime(GeyserSession session, BlockMapping blockMapping) { PlayerInventory inventory = session.getPlayerInventory(); GeyserItemStack item = inventory.getItemInHand(); ItemMapping mapping; @@ -234,11 +234,11 @@ public class BlockUtils { return Registries.COLLISIONS.get(blockId); } - public static BlockCollision getCollisionAt(GeyserSessionImpl session, Vector3i blockPos) { + public static BlockCollision getCollisionAt(GeyserSession session, Vector3i blockPos) { return getCollision(session.getGeyser().getWorldManager().getBlockAt(session, blockPos)); } - public static BlockCollision getCollisionAt(GeyserSessionImpl session, int x, int y, int z) { + public static BlockCollision getCollisionAt(GeyserSession session, int x, int y, int z) { return getCollision(session.getGeyser().getWorldManager().getBlockAt(session, x, y, z)); } } diff --git a/core/src/main/java/org/geysermc/geyser/util/ChunkUtils.java b/core/src/main/java/org/geysermc/geyser/util/ChunkUtils.java index 2b7713235..cb80e209b 100644 --- a/core/src/main/java/org/geysermc/geyser/util/ChunkUtils.java +++ b/core/src/main/java/org/geysermc/geyser/util/ChunkUtils.java @@ -40,7 +40,7 @@ import it.unimi.dsi.fastutil.ints.IntLists; import lombok.experimental.UtilityClass; import org.geysermc.geyser.entity.type.ItemFrameEntity; import org.geysermc.geyser.entity.type.player.SkullPlayerEntity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.level.block.BlockStateValues; import org.geysermc.geyser.text.GeyserLocale; import org.geysermc.geyser.translator.level.block.entity.BedrockOnlyBlockEntity; @@ -115,7 +115,7 @@ public class ChunkUtils { return (yzx >> 8) | (yzx & 0x0F0) | ((yzx & 0x00F) << 8); } - public static void updateChunkPosition(GeyserSessionImpl session, Vector3i position) { + public static void updateChunkPosition(GeyserSession session, Vector3i position) { Vector2i chunkPos = session.getLastChunkPosition(); Vector2i newChunkPos = Vector2i.from(position.getX() >> 4, position.getZ() >> 4); @@ -136,7 +136,7 @@ public class ChunkUtils { * @param blockState the Java block state of the block * @param position the position of the block */ - public static void updateBlock(GeyserSessionImpl session, int blockState, Position position) { + public static void updateBlock(GeyserSession session, int blockState, Position position) { Vector3i pos = Vector3i.from(position.getX(), position.getY(), position.getZ()); updateBlock(session, blockState, pos); } @@ -148,7 +148,7 @@ public class ChunkUtils { * @param blockState the Java block state of the block * @param position the position of the block */ - public static void updateBlock(GeyserSessionImpl session, int blockState, Vector3i position) { + public static void updateBlock(GeyserSession session, int blockState, Vector3i position) { // Checks for item frames so they aren't tripped up and removed ItemFrameEntity itemFrameEntity = ItemFrameEntity.getItemFrameEntity(session, position); if (itemFrameEntity != null) { @@ -205,7 +205,7 @@ public class ChunkUtils { session.getChunkCache().updateBlock(position.getX(), position.getY(), position.getZ(), blockState); } - public static void sendEmptyChunks(GeyserSessionImpl session, Vector3i position, int radius, boolean forceUpdate) { + public static void sendEmptyChunks(GeyserSession session, Vector3i position, int radius, boolean forceUpdate) { int chunkX = position.getX() >> 4; int chunkZ = position.getZ() >> 4; for (int x = -radius; x <= radius; x++) { @@ -234,7 +234,7 @@ public class ChunkUtils { * Process the minimum and maximum heights for this dimension, and processes the world coordinate scale. * This must be done after the player has switched dimensions so we know what their dimension is */ - public static void loadDimensionTag(GeyserSessionImpl session, CompoundTag dimensionTag) { + public static void loadDimensionTag(GeyserSession session, CompoundTag dimensionTag) { int minY = ((IntTag) dimensionTag.get("min_y")).getValue(); int maxY = ((IntTag) dimensionTag.get("height")).getValue(); // Logical height can be ignored probably - seems to be for artificial limits like the Nether. diff --git a/core/src/main/java/org/geysermc/geyser/util/CooldownUtils.java b/core/src/main/java/org/geysermc/geyser/util/CooldownUtils.java index 06c2a8f3e..c149996b8 100644 --- a/core/src/main/java/org/geysermc/geyser/util/CooldownUtils.java +++ b/core/src/main/java/org/geysermc/geyser/util/CooldownUtils.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.util; import com.nukkitx.protocol.bedrock.packet.SetTitlePacket; import lombok.Getter; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.session.cache.PreferencesCache; import java.util.concurrent.TimeUnit; @@ -51,7 +51,7 @@ public class CooldownUtils { * Starts sending the fake cooldown to the Bedrock client. If the cooldown is not disabled, the sent type is the cooldownPreference in {@link PreferencesCache} * @param session GeyserSession */ - public static void sendCooldown(GeyserSessionImpl session) { + public static void sendCooldown(GeyserSession session) { if (DEFAULT_SHOW_COOLDOWN == CooldownType.DISABLED) return; CooldownType sessionPreference = session.getPreferencesCache().getCooldownPreference(); if (sessionPreference == CooldownType.DISABLED) return; @@ -75,7 +75,7 @@ public class CooldownUtils { * @param sessionPreference The type of cooldown the client prefers * @param lastHitTime The time of the last hit. Used to gauge how long the cooldown is taking. */ - private static void computeCooldown(GeyserSessionImpl session, CooldownType sessionPreference, long lastHitTime) { + private static void computeCooldown(GeyserSession session, CooldownType sessionPreference, long lastHitTime) { if (session.isClosed()) return; // Don't run scheduled tasks if the client left if (lastHitTime != session.getLastHitTime()) return; // Means another cooldown has started so there's no need to continue this one SetTitlePacket titlePacket = new SetTitlePacket(); @@ -108,7 +108,7 @@ public class CooldownUtils { } } - private static boolean hasCooldown(GeyserSessionImpl session) { + private static boolean hasCooldown(GeyserSession session) { long time = System.currentTimeMillis() - session.getLastHitTime(); double cooldown = restrain(((double) time) * session.getAttackSpeed() / 1000d, 1.5); return cooldown < 1.1; @@ -121,7 +121,7 @@ public class CooldownUtils { return Math.min(x, max); } - private static String getTitle(GeyserSessionImpl session) { + private static String getTitle(GeyserSession session) { long time = System.currentTimeMillis() - session.getLastHitTime(); double cooldown = restrain(((double) time) * session.getAttackSpeed() / 1000d, 1); diff --git a/core/src/main/java/org/geysermc/geyser/util/DimensionUtils.java b/core/src/main/java/org/geysermc/geyser/util/DimensionUtils.java index 352a8e996..c729c0b1e 100644 --- a/core/src/main/java/org/geysermc/geyser/util/DimensionUtils.java +++ b/core/src/main/java/org/geysermc/geyser/util/DimensionUtils.java @@ -34,7 +34,7 @@ import com.nukkitx.protocol.bedrock.packet.MobEffectPacket; import com.nukkitx.protocol.bedrock.packet.StopSoundPacket; import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.entity.type.Entity; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.util.Set; @@ -56,7 +56,7 @@ public class DimensionUtils { */ public static final String THE_END = "minecraft:the_end"; - public static void switchDimension(GeyserSessionImpl session, String javaDimension) { + public static void switchDimension(GeyserSession session, String javaDimension) { int bedrockDimension = javaToBedrock(javaDimension); Entity player = session.getPlayerEntity(); diff --git a/core/src/main/java/org/geysermc/geyser/util/InventoryUtils.java b/core/src/main/java/org/geysermc/geyser/util/InventoryUtils.java index 907aef169..1b671b2fe 100644 --- a/core/src/main/java/org/geysermc/geyser/util/InventoryUtils.java +++ b/core/src/main/java/org/geysermc/geyser/util/InventoryUtils.java @@ -41,7 +41,7 @@ import org.geysermc.geyser.inventory.Container; import org.geysermc.geyser.inventory.GeyserItemStack; import org.geysermc.geyser.inventory.Inventory; import org.geysermc.geyser.inventory.PlayerInventory; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.text.ChatColor; import org.geysermc.geyser.text.GeyserLocale; import org.geysermc.geyser.translator.inventory.InventoryTranslator; @@ -64,7 +64,7 @@ public class InventoryUtils { public static final ItemStack REFRESH_ITEM = new ItemStack(1, 127, new CompoundTag("")); - public static void openInventory(GeyserSessionImpl session, Inventory inventory) { + public static void openInventory(GeyserSession session, Inventory inventory) { session.setOpenInventory(inventory); if (session.isClosingInventory()) { //Wait for close confirmation from client before opening the new inventory. @@ -75,7 +75,7 @@ public class InventoryUtils { displayInventory(session, inventory); } - public static void displayInventory(GeyserSessionImpl session, Inventory inventory) { + public static void displayInventory(GeyserSession session, Inventory inventory) { InventoryTranslator translator = session.getInventoryTranslator(); if (translator != null) { translator.prepareInventory(session, inventory); @@ -100,7 +100,7 @@ public class InventoryUtils { } } - public static void closeInventory(GeyserSessionImpl session, int windowId, boolean confirm) { + public static void closeInventory(GeyserSession session, int windowId, boolean confirm) { session.getPlayerInventory().setCursor(GeyserItemStack.EMPTY, session); updateCursor(session); @@ -116,7 +116,7 @@ public class InventoryUtils { session.setOpenInventory(null); } - public static Inventory getInventory(GeyserSessionImpl session, int windowId) { + public static Inventory getInventory(GeyserSession session, int windowId) { if (windowId == 0) { return session.getPlayerInventory(); } else { @@ -128,7 +128,7 @@ public class InventoryUtils { } } - public static void updateCursor(GeyserSessionImpl session) { + public static void updateCursor(GeyserSession session) { InventorySlotPacket cursorPacket = new InventorySlotPacket(); cursorPacket.setContainerId(ContainerId.UI); cursorPacket.setSlot(0); @@ -177,12 +177,12 @@ public class InventoryUtils { } /** - * See {@link #findOrCreateItem(GeyserSessionImpl, String)}. This is for finding a specified {@link ItemStack}. + * See {@link #findOrCreateItem(GeyserSession, String)}. This is for finding a specified {@link ItemStack}. * * @param session the Bedrock client's session * @param itemStack the item to try to find a match for. NBT will also be accounted for. */ - public static void findOrCreateItem(GeyserSessionImpl session, ItemStack itemStack) { + public static void findOrCreateItem(GeyserSession session, ItemStack itemStack) { PlayerInventory inventory = session.getPlayerInventory(); if (itemStack == null || itemStack.getId() == 0) { @@ -241,7 +241,7 @@ public class InventoryUtils { * @param session the Bedrock client's session * @param itemName the Java identifier of the item to search/select */ - public static void findOrCreateItem(GeyserSessionImpl session, String itemName) { + public static void findOrCreateItem(GeyserSession session, String itemName) { // Get the inventory to choose a slot to pick PlayerInventory inventory = session.getPlayerInventory(); @@ -320,7 +320,7 @@ public class InventoryUtils { * @param session GeyserSession * @param slot inventory slot to be selected */ - private static void setHotbarItem(GeyserSessionImpl session, int slot) { + private static void setHotbarItem(GeyserSession session, int slot) { PlayerHotbarPacket hotbarPacket = new PlayerHotbarPacket(); hotbarPacket.setContainerId(0); // Java inventory slot to hotbar slot ID diff --git a/core/src/main/java/org/geysermc/geyser/util/ItemUtils.java b/core/src/main/java/org/geysermc/geyser/util/ItemUtils.java index 3307e3e88..0eed01613 100644 --- a/core/src/main/java/org/geysermc/geyser/util/ItemUtils.java +++ b/core/src/main/java/org/geysermc/geyser/util/ItemUtils.java @@ -26,7 +26,7 @@ package org.geysermc.geyser.util; import com.github.steveice10.opennbt.tag.builtin.*; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; public class ItemUtils { @@ -49,7 +49,7 @@ public class ItemUtils { /** * @return the correct Bedrock durability for this item. */ - public static int getCorrectBedrockDurability(GeyserSessionImpl session, int javaId, int original) { + public static int getCorrectBedrockDurability(GeyserSession session, int javaId, int original) { if (javaId == session.getItemMappings().getStoredItems().fishingRod().getJavaId()) { // Java durability: 64 // Bedrock durability : 384 diff --git a/core/src/main/java/org/geysermc/geyser/util/LoginEncryptionUtils.java b/core/src/main/java/org/geysermc/geyser/util/LoginEncryptionUtils.java index 128b0bcb5..213953bdd 100644 --- a/core/src/main/java/org/geysermc/geyser/util/LoginEncryptionUtils.java +++ b/core/src/main/java/org/geysermc/geyser/util/LoginEncryptionUtils.java @@ -39,7 +39,7 @@ import com.nukkitx.protocol.bedrock.packet.ServerToClientHandshakePacket; import com.nukkitx.protocol.bedrock.util.EncryptionUtils; import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.configuration.GeyserConfiguration; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.session.auth.AuthData; import org.geysermc.geyser.session.auth.BedrockClientData; import org.geysermc.cumulus.CustomForm; @@ -115,7 +115,7 @@ public class LoginEncryptionUtils { return mojangSigned; } - public static void encryptPlayerConnection(GeyserSessionImpl session, LoginPacket loginPacket) { + public static void encryptPlayerConnection(GeyserSession session, LoginPacket loginPacket) { JsonNode certData; try { certData = JSON_MAPPER.readTree(loginPacket.getChainData().toByteArray()); @@ -131,7 +131,7 @@ public class LoginEncryptionUtils { encryptConnectionWithCert(session, loginPacket.getSkinData().toString(), certChainData); } - private static void encryptConnectionWithCert(GeyserSessionImpl session, String clientData, JsonNode certChainData) { + private static void encryptConnectionWithCert(GeyserSession session, String clientData, JsonNode certChainData) { try { GeyserImpl geyser = session.getGeyser(); @@ -190,7 +190,7 @@ public class LoginEncryptionUtils { } } - private static void startEncryptionHandshake(GeyserSessionImpl session, PublicKey key) throws Exception { + private static void startEncryptionHandshake(GeyserSession session, PublicKey key) throws Exception { KeyPairGenerator generator = KeyPairGenerator.getInstance("EC"); generator.initialize(new ECGenParameterSpec("secp384r1")); KeyPair serverKeyPair = generator.generateKeyPair(); @@ -212,7 +212,7 @@ public class LoginEncryptionUtils { } } - public static void buildAndShowLoginWindow(GeyserSessionImpl session) { + public static void buildAndShowLoginWindow(GeyserSession session) { // Set DoDaylightCycle to false so the time doesn't accelerate while we're here session.setDaylightCycle(false); @@ -256,7 +256,7 @@ public class LoginEncryptionUtils { })); } - public static void buildAndShowLoginDetailsWindow(GeyserSessionImpl session) { + public static void buildAndShowLoginDetailsWindow(GeyserSession session) { session.sendForm( CustomForm.builder() .translator(GeyserLocale::getPlayerLocaleString, session.getLocale()) @@ -278,7 +278,7 @@ public class LoginEncryptionUtils { /** * Prompts the user between either OAuth code login or manual password authentication */ - public static void buildAndShowMicrosoftAuthenticationWindow(GeyserSessionImpl session) { + public static void buildAndShowMicrosoftAuthenticationWindow(GeyserSession session) { session.sendForm( SimpleForm.builder() .translator(GeyserLocale::getPlayerLocaleString, session.getLocale()) @@ -306,7 +306,7 @@ public class LoginEncryptionUtils { /** * Shows the code that a user must input into their browser */ - public static void buildAndShowMicrosoftCodeWindow(GeyserSessionImpl session, MsaAuthenticationService.MsCodeResponse msCode) { + public static void buildAndShowMicrosoftCodeWindow(GeyserSession session, MsaAuthenticationService.MsCodeResponse msCode) { session.sendForm( ModalForm.builder() .title("%xbox.signin") diff --git a/core/src/main/java/org/geysermc/geyser/util/NewsHandler.java b/core/src/main/java/org/geysermc/geyser/util/NewsHandler.java index babbc8a62..df163f5b1 100644 --- a/core/src/main/java/org/geysermc/geyser/util/NewsHandler.java +++ b/core/src/main/java/org/geysermc/geyser/util/NewsHandler.java @@ -32,7 +32,7 @@ import com.google.gson.JsonSyntaxException; import org.geysermc.geyser.Constants; import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.GeyserLogger; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.floodgate.news.NewsItem; import org.geysermc.floodgate.news.NewsItemAction; import org.geysermc.floodgate.news.data.AnnouncementData; @@ -88,13 +88,13 @@ public class NewsHandler { } catch (JsonSyntaxException ignored) {} } - public void handleNews(GeyserSessionImpl session, NewsItemAction action) { + public void handleNews(GeyserSession session, NewsItemAction action) { for (NewsItem news : getActiveNews(action)) { handleNewsItem(session, news, action); } } - private void handleNewsItem(GeyserSessionImpl session, NewsItem news, NewsItemAction action) { + private void handleNewsItem(GeyserSession session, NewsItem news, NewsItemAction action) { switch (action) { case ON_SERVER_STARTED: if (!firstCheck) { @@ -110,7 +110,7 @@ public class NewsHandler { // } break; case BROADCAST_TO_OPERATORS: - for (GeyserSessionImpl player : GeyserImpl.getInstance().getSessionManager().getSessions().values()) { + for (GeyserSession player : GeyserImpl.getInstance().getSessionManager().getSessions().values()) { if (player.getOpPermissionLevel() >= 2) { session.sendMessage(ChatColor.GREEN + news.getMessage()); } diff --git a/core/src/main/java/org/geysermc/geyser/util/PluginMessageUtils.java b/core/src/main/java/org/geysermc/geyser/util/PluginMessageUtils.java index ac39f6823..ed706eeca 100644 --- a/core/src/main/java/org/geysermc/geyser/util/PluginMessageUtils.java +++ b/core/src/main/java/org/geysermc/geyser/util/PluginMessageUtils.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.util; import com.github.steveice10.mc.protocol.packet.ingame.serverbound.ServerboundCustomPayloadPacket; import com.google.common.base.Charsets; import org.geysermc.geyser.GeyserImpl; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import java.nio.ByteBuffer; @@ -73,7 +73,7 @@ public class PluginMessageUtils { return SKIN_CHANNEL; } - public static void sendMessage(GeyserSessionImpl session, String channel, byte[] data) { + public static void sendMessage(GeyserSession session, String channel, byte[] data) { session.sendDownstreamPacket(new ServerboundCustomPayloadPacket(channel, data)); } diff --git a/core/src/main/java/org/geysermc/geyser/util/SettingsUtils.java b/core/src/main/java/org/geysermc/geyser/util/SettingsUtils.java index 8adbc6e4e..28fb53ab1 100644 --- a/core/src/main/java/org/geysermc/geyser/util/SettingsUtils.java +++ b/core/src/main/java/org/geysermc/geyser/util/SettingsUtils.java @@ -29,7 +29,7 @@ import com.github.steveice10.mc.protocol.data.game.entity.player.GameMode; import com.github.steveice10.mc.protocol.data.game.setting.Difficulty; import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.level.GameRule; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.level.WorldManager; import org.geysermc.cumulus.CustomForm; import org.geysermc.cumulus.component.DropdownComponent; @@ -43,7 +43,7 @@ public class SettingsUtils { * * @param session The session to build the form for */ - public static CustomForm buildForm(GeyserSessionImpl session) { + public static CustomForm buildForm(GeyserSession session) { // Cache the language for cleaner access String language = session.getLocale(); diff --git a/core/src/main/java/org/geysermc/geyser/util/StatisticsUtils.java b/core/src/main/java/org/geysermc/geyser/util/StatisticsUtils.java index 805fec807..aa5893462 100644 --- a/core/src/main/java/org/geysermc/geyser/util/StatisticsUtils.java +++ b/core/src/main/java/org/geysermc/geyser/util/StatisticsUtils.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.util; import com.github.steveice10.mc.protocol.data.MagicValues; import com.github.steveice10.mc.protocol.data.game.entity.type.EntityType; import com.github.steveice10.mc.protocol.data.game.statistic.*; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.BlockRegistries; import org.geysermc.geyser.registry.type.ItemMappings; import org.geysermc.cumulus.SimpleForm; @@ -49,7 +49,7 @@ public class StatisticsUtils { * * @param session The session to build the form for */ - public static void buildAndSendStatisticsMenu(GeyserSessionImpl session) { + public static void buildAndSendStatisticsMenu(GeyserSession session) { // Cache the language for cleaner access String language = session.getLocale(); diff --git a/core/src/main/java/org/geysermc/geyser/util/collection/LecternHasBookMap.java b/core/src/main/java/org/geysermc/geyser/util/collection/LecternHasBookMap.java index 6226ecbbd..aaa780ed5 100644 --- a/core/src/main/java/org/geysermc/geyser/util/collection/LecternHasBookMap.java +++ b/core/src/main/java/org/geysermc/geyser/util/collection/LecternHasBookMap.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.util.collection; import com.nukkitx.math.vector.Vector3i; import com.nukkitx.nbt.NbtMap; -import org.geysermc.geyser.session.GeyserSessionImpl; +import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.inventory.LecternInventoryTranslator; import org.geysermc.geyser.level.WorldManager; import org.geysermc.geyser.util.BlockEntityUtils; @@ -41,7 +41,7 @@ public class LecternHasBookMap extends FixedInt2BooleanMap { * Update a potential lectern within the world. This is a map method so it can use the internal fields to * optimize lectern determining. */ - public void handleBlockChange(GeyserSessionImpl session, int blockState, Vector3i position) { + public void handleBlockChange(GeyserSession session, int blockState, Vector3i position) { WorldManager worldManager = session.getGeyser().getWorldManager(); int offset = blockState - this.start;