diff --git a/api/base/pom.xml b/api/base/pom.xml new file mode 100644 index 000000000..a3a67b7ec --- /dev/null +++ b/api/base/pom.xml @@ -0,0 +1,27 @@ + + + + geyser-parent + org.geysermc + 1.4.3-SNAPSHOT + + 4.0.0 + + base-api + + + 16 + 16 + + + + + org.checkerframework + checker-qual + 3.19.0 + provided + + + \ No newline at end of file diff --git a/api/base/src/main/java/org/geysermc/api/Api.java b/api/base/src/main/java/org/geysermc/api/Api.java new file mode 100644 index 000000000..f3ee9c742 --- /dev/null +++ b/api/base/src/main/java/org/geysermc/api/Api.java @@ -0,0 +1,79 @@ +/* + * 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; + +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.geysermc.api.session.Session; + +import java.util.List; +import java.util.UUID; + +/** + * The base API class. + * + * @param the session type + */ +public interface Api { + + /** + * Gets the session from the given + * UUID, if applicable. + * + * @param uuid the UUID of the session + * @return the session from the given UUID, if applicable + */ + @Nullable + S sessionByUuid(@NonNull UUID uuid); + + /** + * Gets the session from the given + * XUID, if applicable. + * + * @param xuid the XUID of the session + * @return the session from the given UUID, if applicable + */ + @Nullable + S sessionByXuid(@NonNull String xuid); + + /** + * Gets the session from the given + * name, if applicable. + * + * @param name the uuid of the session + * @return the session from the given name, if applicable + */ + @Nullable + S sessionByName(@NonNull String name); + + /** + * Gets all the online sessions. + * + * @return all the online sessions + */ + @NonNull + List onlineSessions(); +} diff --git a/api/base/src/main/java/org/geysermc/api/Geyser.java b/api/base/src/main/java/org/geysermc/api/Geyser.java new file mode 100644 index 000000000..99d3f1402 --- /dev/null +++ b/api/base/src/main/java/org/geysermc/api/Geyser.java @@ -0,0 +1,94 @@ +/* + * 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; + +import org.checkerframework.checker.nullness.qual.NonNull; + +/** + * General API class for Geyser. + */ +@NonNull +public class Geyser { + private static Api api; + + /** + * Returns the base api. + * + * @return the base api + */ + public static Api api() { + if (api == null) { + throw new RuntimeException("Api has not been registered yet!"); + } + + 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 + * an api has already been specified. + * + * @param api the api + */ + public static void set(@NonNull Api api) { + if (Geyser.api != null) { + throw new RuntimeException("Cannot redefine already registered api!"); + } + + Geyser.api = api; + } + + /** + * Gets if the api has been registered and + * is ready for usage. + * + * @return if the api has been registered + */ + public static boolean registered() { + return api != null; + } +} diff --git a/api/src/main/java/org/geysermc/geyser/api/Geyser.java b/api/base/src/main/java/org/geysermc/api/session/Session.java similarity index 64% rename from api/src/main/java/org/geysermc/geyser/api/Geyser.java rename to api/base/src/main/java/org/geysermc/api/session/Session.java index a8a8b68a7..7862f1e70 100644 --- a/api/src/main/java/org/geysermc/geyser/api/Geyser.java +++ b/api/base/src/main/java/org/geysermc/api/session/Session.java @@ -23,37 +23,36 @@ * @link https://github.com/GeyserMC/Geyser */ -package org.geysermc.geyser.api; +package org.geysermc.api.session; -import org.geysermc.geyser.api.logger.GeyserLogger; +import org.checkerframework.checker.nullness.qual.NonNull; + +import java.util.UUID; /** - * General API class for Geyser. + * Represents a player session. */ -public abstract class Geyser { - private static Geyser instance; +@NonNull +public interface Session { /** - * Gets the logger used by Geyser. + * Gets the name of the session. * - * @return the logger used by Geyser + * @return the name of the session */ - public abstract GeyserLogger getLogger(); + String name(); /** - * Returns the current {@link Geyser} instance. + * Gets the {@link UUID} of the session. * - * @return the current Geyser instance + * @return the UUID of the session */ - public static Geyser getInstance() { - return instance; - } + UUID uuid(); - protected static void setInstance(Geyser instance) { - if (Geyser.instance != null) { - throw new RuntimeException("Cannot redefine singleton Geyser!"); - } - - Geyser.instance = instance; - } + /** + * Gets the XUID of the session. + * + * @return the XUID of the session + */ + String xuid(); } diff --git a/api/geyser/pom.xml b/api/geyser/pom.xml new file mode 100644 index 000000000..dc28b0648 --- /dev/null +++ b/api/geyser/pom.xml @@ -0,0 +1,27 @@ + + + + geyser-parent + org.geysermc + 1.4.3-SNAPSHOT + + 4.0.0 + + geyser-api + + + 16 + 16 + + + + + org.geysermc + base-api + 1.4.3-SNAPSHOT + compile + + + \ No newline at end of file diff --git a/api/geyser/src/main/java/org/geysermc/geyser/api/GeyserApi.java b/api/geyser/src/main/java/org/geysermc/geyser/api/GeyserApi.java new file mode 100644 index 000000000..a6b4cbf78 --- /dev/null +++ b/api/geyser/src/main/java/org/geysermc/geyser/api/GeyserApi.java @@ -0,0 +1,63 @@ +/* + * 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.geyser.api; + +import org.geysermc.api.Api; +import org.geysermc.api.Geyser; +import org.geysermc.geyser.api.session.GeyserSession; + +/** + * Represents the API used in Geyser. + */ +public interface GeyserApi extends Api { + + /** + * Shuts down the current Geyser instance. + */ + void shutdown(); + + /** + * Reloads the current Geyser instance. + */ + void reload(); + + /** + * Gets if this Geyser instance is running in an IDE. This only needs to be used in cases where files + * expected to be in a jarfile are not present. + * + * @return true if the version number is not 'DEV'. + */ + boolean productionEnvironment(); + + /** + * Gets the {@link GeyserApi}. + * + * @return the Geyser API + */ + static GeyserApi api() { + return Geyser.api(GeyserApi.class); + } +} diff --git a/api/geyser/src/main/java/org/geysermc/geyser/api/session/GeyserSession.java b/api/geyser/src/main/java/org/geysermc/geyser/api/session/GeyserSession.java new file mode 100644 index 000000000..16f6f5366 --- /dev/null +++ b/api/geyser/src/main/java/org/geysermc/geyser/api/session/GeyserSession.java @@ -0,0 +1,34 @@ +/* + * 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.geyser.api.session; + +import org.geysermc.api.session.Session; + +/** + * Represents a player session used in Geyser. + */ +public interface GeyserSession extends Session { +} diff --git a/api/pom.xml b/api/pom.xml index ecaa217b6..fcf12088b 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -9,11 +9,16 @@ 4.0.0 - api + api-parent + pom 16 16 + + base + geyser + \ No newline at end of file diff --git a/bootstrap/bungeecord/src/main/java/org/geysermc/geyser/platform/bungeecord/GeyserBungeeLogger.java b/bootstrap/bungeecord/src/main/java/org/geysermc/geyser/platform/bungeecord/GeyserBungeeLogger.java index a53cb7f1d..fbc09956c 100644 --- a/bootstrap/bungeecord/src/main/java/org/geysermc/geyser/platform/bungeecord/GeyserBungeeLogger.java +++ b/bootstrap/bungeecord/src/main/java/org/geysermc/geyser/platform/bungeecord/GeyserBungeeLogger.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.platform.bungeecord; import lombok.Getter; import lombok.Setter; -import org.geysermc.geyser.api.logger.GeyserLogger; +import org.geysermc.geyser.GeyserLogger; import java.util.logging.Level; import java.util.logging.Logger; diff --git a/bootstrap/bungeecord/src/main/java/org/geysermc/geyser/platform/bungeecord/command/BungeeCommandSender.java b/bootstrap/bungeecord/src/main/java/org/geysermc/geyser/platform/bungeecord/command/BungeeCommandSender.java index c7cd90489..7dc04f95b 100644 --- a/bootstrap/bungeecord/src/main/java/org/geysermc/geyser/platform/bungeecord/command/BungeeCommandSender.java +++ b/bootstrap/bungeecord/src/main/java/org/geysermc/geyser/platform/bungeecord/command/BungeeCommandSender.java @@ -41,7 +41,7 @@ public class BungeeCommandSender implements CommandSender { } @Override - public String getName() { + public String name() { return handle.getName(); } 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 f0a05687c..5b137c61c 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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); - GeyserSession session = this.commandExecutor.getGeyserSession(commandSender); + GeyserSessionImpl 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/GeyserSpigotLogger.java b/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/GeyserSpigotLogger.java index 9a1f45bcd..98c85977f 100644 --- a/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/GeyserSpigotLogger.java +++ b/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/GeyserSpigotLogger.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.platform.spigot; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.Setter; -import org.geysermc.geyser.api.logger.GeyserLogger; +import org.geysermc.geyser.GeyserLogger; import java.util.logging.Level; import java.util.logging.Logger; 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 af92091e5..b6386dfee 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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); - GeyserSession session = getGeyserSession(commandSender); + GeyserSessionImpl 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/command/SpigotCommandSender.java b/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/command/SpigotCommandSender.java index 2aa301022..7fbaac4f8 100644 --- a/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/command/SpigotCommandSender.java +++ b/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/command/SpigotCommandSender.java @@ -54,7 +54,7 @@ public class SpigotCommandSender implements CommandSender { } @Override - public String getName() { + public String name() { return handle.getName(); } 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 4d504bcf5..a77afec09 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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; } - GeyserSession session = entry.getValue(); + GeyserSessionImpl 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 2b740eead..68c6fc413 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import org.geysermc.geyser.translator.inventory.item.ItemTranslator; import org.geysermc.geyser.util.InventoryUtils; @@ -79,9 +79,9 @@ public class GeyserSpigot1_11CraftingListener implements Listener { @EventHandler public void onPlayerJoin(PlayerJoinEvent event) { - GeyserSession session = null; - for (GeyserSession otherSession : geyser.getSessionManager().getSessions().values()) { - if (otherSession.getName().equals(event.getPlayer().getName())) { + GeyserSessionImpl session = null; + for (GeyserSessionImpl 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(GeyserSession session) { + public void sendServerRecipes(GeyserSessionImpl 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(GeyserSession session, org.bukkit.inventory.ItemStack itemStack) { + private Pair translateToBedrock(GeyserSessionImpl 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 b89e87878..8f0d6e2db 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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) { - GeyserSession session = geyser.getPlayerByUuid(event.getPlayer().getUniqueId()); + GeyserSessionImpl session = geyser.sessionByUuid(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 ea1fadd0e..12f197f24 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, int x, int y, int z) { + public int getBlockAt(GeyserSessionImpl 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 f12968b1f..b1072b847 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, int x, int y, int z) { + public int getBlockAt(GeyserSessionImpl 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 1aacb73e7..f3071ecdd 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import org.geysermc.geyser.level.block.BlockStateValues; /** - * Should only be used when we know {@link GeyserSpigotWorldManager#getBlockAt(GeyserSession, int, int, int)} + * Should only be used when we know {@link GeyserSpigotWorldManager#getBlockAt(GeyserSessionImpl, 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(GeyserSession session, int x, int y, int z) { + public int getBlockAt(GeyserSessionImpl 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 caeb257f7..242d7ea23 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import org.geysermc.geyser.platform.spigot.GeyserSpigotPlugin; import java.util.List; @@ -66,7 +66,7 @@ public class GeyserSpigotLegacyNativeWorldManager extends GeyserSpigotNativeWorl } @Override - public int getBlockAt(GeyserSession session, int x, int y, int z) { + public int getBlockAt(GeyserSessionImpl 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 b1032671a..0c3e21c01 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, int x, int y, int z) { + public int getBlockAt(GeyserSessionImpl 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 8972b0ac6..35eb292a6 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, int x, int y, int z) { + public int getBlockAt(GeyserSessionImpl 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(GeyserSession session, int x, int y, int z, boolean isChunkLoad) { + public NbtMap getLecternDataAt(GeyserSessionImpl 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(GeyserSession session, GameRule gameRule) { + public Boolean getGameRuleBool(GeyserSessionImpl 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(GeyserSession session, GameRule gameRule) { + public int getGameRuleInt(GeyserSessionImpl 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(GeyserSession session, String permission) { + public boolean hasPermission(GeyserSessionImpl session, String permission) { return Bukkit.getPlayer(session.getPlayerEntity().getUsername()).hasPermission(permission); } diff --git a/bootstrap/sponge/src/main/java/org/geysermc/geyser/platform/sponge/GeyserSpongeLogger.java b/bootstrap/sponge/src/main/java/org/geysermc/geyser/platform/sponge/GeyserSpongeLogger.java index 333ab9038..7e0f2a410 100644 --- a/bootstrap/sponge/src/main/java/org/geysermc/geyser/platform/sponge/GeyserSpongeLogger.java +++ b/bootstrap/sponge/src/main/java/org/geysermc/geyser/platform/sponge/GeyserSpongeLogger.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.platform.sponge; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.Setter; -import org.geysermc.geyser.api.logger.GeyserLogger; +import org.geysermc.geyser.GeyserLogger; import org.slf4j.Logger; @AllArgsConstructor 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 5b8496680..6fbd3e219 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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); - GeyserSession session = getGeyserSession(commandSender); + GeyserSessionImpl session = getGeyserSession(commandSender); String[] args = arguments.split(" "); if (args.length > 0) { diff --git a/bootstrap/sponge/src/main/java/org/geysermc/geyser/platform/sponge/command/SpongeCommandSender.java b/bootstrap/sponge/src/main/java/org/geysermc/geyser/platform/sponge/command/SpongeCommandSender.java index 20d1ec08b..07c0f410a 100644 --- a/bootstrap/sponge/src/main/java/org/geysermc/geyser/platform/sponge/command/SpongeCommandSender.java +++ b/bootstrap/sponge/src/main/java/org/geysermc/geyser/platform/sponge/command/SpongeCommandSender.java @@ -38,7 +38,7 @@ public class SpongeCommandSender implements CommandSender { private CommandSource handle; @Override - public String getName() { + public String name() { return handle.getName(); } diff --git a/bootstrap/standalone/src/main/java/org/geysermc/geyser/platform/standalone/GeyserStandaloneLogger.java b/bootstrap/standalone/src/main/java/org/geysermc/geyser/platform/standalone/GeyserStandaloneLogger.java index 6aec896d1..b585ebe7b 100644 --- a/bootstrap/standalone/src/main/java/org/geysermc/geyser/platform/standalone/GeyserStandaloneLogger.java +++ b/bootstrap/standalone/src/main/java/org/geysermc/geyser/platform/standalone/GeyserStandaloneLogger.java @@ -30,7 +30,7 @@ import net.minecrell.terminalconsole.SimpleTerminalConsole; import org.apache.logging.log4j.Level; import org.apache.logging.log4j.core.config.Configurator; import org.geysermc.geyser.GeyserImpl; -import org.geysermc.geyser.api.logger.GeyserLogger; +import org.geysermc.geyser.GeyserLogger; import org.geysermc.geyser.command.CommandSender; import org.geysermc.geyser.text.ChatColor; @@ -97,7 +97,7 @@ public class GeyserStandaloneLogger extends SimpleTerminalConsole implements Gey } @Override - public String getName() { + public String name() { return "CONSOLE"; } 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 56d211986..e0d957d4f 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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 (GeyserSession player : GeyserImpl.getInstance().getSessionManager().getSessions().values()) { + for (GeyserSessionImpl 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/GeyserVelocityLogger.java b/bootstrap/velocity/src/main/java/org/geysermc/geyser/platform/velocity/GeyserVelocityLogger.java index 57d988dc6..de9ea78d5 100644 --- a/bootstrap/velocity/src/main/java/org/geysermc/geyser/platform/velocity/GeyserVelocityLogger.java +++ b/bootstrap/velocity/src/main/java/org/geysermc/geyser/platform/velocity/GeyserVelocityLogger.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.platform.velocity; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.Setter; -import org.geysermc.geyser.api.logger.GeyserLogger; +import org.geysermc.geyser.GeyserLogger; import org.slf4j.Logger; @AllArgsConstructor 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 1034d6062..ecc9641c9 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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()); - GeyserSession session = getGeyserSession(sender); + GeyserSessionImpl session = getGeyserSession(sender); if (invocation.arguments().length > 0) { GeyserCommand command = getCommand(invocation.arguments()[0]); diff --git a/bootstrap/velocity/src/main/java/org/geysermc/geyser/platform/velocity/command/VelocityCommandSender.java b/bootstrap/velocity/src/main/java/org/geysermc/geyser/platform/velocity/command/VelocityCommandSender.java index 48edb71b1..3ef08d4e9 100644 --- a/bootstrap/velocity/src/main/java/org/geysermc/geyser/platform/velocity/command/VelocityCommandSender.java +++ b/bootstrap/velocity/src/main/java/org/geysermc/geyser/platform/velocity/command/VelocityCommandSender.java @@ -45,7 +45,7 @@ public class VelocityCommandSender implements CommandSender { } @Override - public String getName() { + public String name() { if (handle instanceof Player) { return ((Player) handle).getUsername(); } else if (handle instanceof ConsoleCommandSource) { diff --git a/core/pom.xml b/core/pom.xml index fd54b99d7..fc4d84e3c 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -26,7 +26,7 @@ org.geysermc - api + geyser-api 1.4.3-SNAPSHOT compile diff --git a/core/src/main/java/org/geysermc/connector/GeyserConnector.java b/core/src/main/java/org/geysermc/connector/GeyserConnector.java index af05a4aca..d2d493ecf 100644 --- a/core/src/main/java/org/geysermc/connector/GeyserConnector.java +++ b/core/src/main/java/org/geysermc/connector/GeyserConnector.java @@ -29,7 +29,7 @@ import com.nukkitx.protocol.bedrock.BedrockServer; import org.geysermc.common.PlatformType; import org.geysermc.connector.network.session.GeyserSession; import org.geysermc.geyser.GeyserImpl; -import org.geysermc.geyser.api.Geyser; +import org.geysermc.api.Geyser; import java.util.UUID; @@ -73,14 +73,14 @@ public class GeyserConnector { } public GeyserSession getPlayerByXuid(String xuid) { - return new GeyserSession(GeyserImpl.getInstance().getPlayerByXuid(xuid)); + return new GeyserSession(GeyserImpl.getInstance().sessionByXuid(xuid)); } public GeyserSession getPlayerByUuid(UUID uuid) { - return new GeyserSession(GeyserImpl.getInstance().getPlayerByUuid(uuid)); + return new GeyserSession(GeyserImpl.getInstance().sessionByUuid(uuid)); } public boolean isProductionEnvironment() { - return GeyserImpl.getInstance().isProductionEnvironment(); + return GeyserImpl.getInstance().productionEnvironment(); } } 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 07b7a3298..27c0ce5e0 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,6 +28,7 @@ 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 @@ -37,9 +38,9 @@ import org.geysermc.connector.network.session.auth.AuthData; */ @Deprecated public class GeyserSession { - private final org.geysermc.geyser.session.GeyserSession handle; + private final GeyserSessionImpl handle; - public GeyserSession(org.geysermc.geyser.session.GeyserSession handle) { + public GeyserSession(GeyserSessionImpl handle) { this.handle = handle; } @@ -128,7 +129,7 @@ public class GeyserSession { } public String getName() { - return this.handle.getName(); + return this.handle.name(); } public boolean isConsole() { diff --git a/core/src/main/java/org/geysermc/connector/network/session/auth/AuthData.java b/core/src/main/java/org/geysermc/connector/network/session/auth/AuthData.java index 19e6131bc..3c9a5ee72 100644 --- a/core/src/main/java/org/geysermc/connector/network/session/auth/AuthData.java +++ b/core/src/main/java/org/geysermc/connector/network/session/auth/AuthData.java @@ -41,14 +41,14 @@ public class AuthData { } public String getName() { - return this.handle.getName(); + return this.handle.name(); } public UUID getUUID() { - return this.handle.getUuid(); + return this.handle.uuid(); } public String getXboxUUID() { - return this.handle.getXuid(); + return this.handle.xuid(); } } diff --git a/core/src/main/java/org/geysermc/geyser/FloodgateKeyLoader.java b/core/src/main/java/org/geysermc/geyser/FloodgateKeyLoader.java index 4bed3aaca..73b1cd0fa 100644 --- a/core/src/main/java/org/geysermc/geyser/FloodgateKeyLoader.java +++ b/core/src/main/java/org/geysermc/geyser/FloodgateKeyLoader.java @@ -25,7 +25,7 @@ package org.geysermc.geyser; -import org.geysermc.geyser.api.logger.GeyserLogger; +import org.geysermc.geyser.GeyserLogger; import org.geysermc.geyser.session.auth.AuthType; import org.geysermc.geyser.configuration.GeyserJacksonConfiguration; import org.geysermc.geyser.text.GeyserLocale; diff --git a/core/src/main/java/org/geysermc/geyser/GeyserBootstrap.java b/core/src/main/java/org/geysermc/geyser/GeyserBootstrap.java index 1411c0175..b313af9bb 100644 --- a/core/src/main/java/org/geysermc/geyser/GeyserBootstrap.java +++ b/core/src/main/java/org/geysermc/geyser/GeyserBootstrap.java @@ -27,7 +27,7 @@ package org.geysermc.geyser; import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.configuration.GeyserConfiguration; -import org.geysermc.geyser.api.logger.GeyserLogger; +import org.geysermc.geyser.GeyserLogger; import org.geysermc.geyser.command.CommandManager; import org.geysermc.geyser.dump.BootstrapDumpInfo; import org.geysermc.geyser.level.GeyserWorldManager; diff --git a/core/src/main/java/org/geysermc/geyser/GeyserImpl.java b/core/src/main/java/org/geysermc/geyser/GeyserImpl.java index 546602162..a51dd7b40 100644 --- a/core/src/main/java/org/geysermc/geyser/GeyserImpl.java +++ b/core/src/main/java/org/geysermc/geyser/GeyserImpl.java @@ -39,9 +39,12 @@ import io.netty.util.concurrent.DefaultThreadFactory; import io.netty.util.internal.SystemPropertyUtil; 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.geyser.api.Geyser; -import org.geysermc.geyser.api.logger.GeyserLogger; +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; @@ -52,7 +55,7 @@ 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.GeyserSession; +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; @@ -67,7 +70,6 @@ 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.jetbrains.annotations.Contract; import javax.naming.directory.Attribute; import javax.naming.directory.InitialDirContext; @@ -77,6 +79,7 @@ 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; @@ -86,7 +89,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; @Getter -public class GeyserImpl extends Geyser { +public class GeyserImpl implements GeyserApi { public static final ObjectMapper JSON_MAPPER = new ObjectMapper() .enable(JsonParser.Feature.IGNORE_UNDEFINED) .enable(JsonParser.Feature.ALLOW_COMMENTS) @@ -128,13 +131,17 @@ public class GeyserImpl extends Geyser { private final Metrics metrics; + private static GeyserImpl instance; + private GeyserImpl(PlatformType platformType, GeyserBootstrap bootstrap) { long startupTime = System.currentTimeMillis(); - Geyser.setInstance(this); - this.bootstrap = bootstrap; + instance = this; + + Geyser.set(this); + GeyserLogger logger = bootstrap.getGeyserLogger(); GeyserConfiguration config = bootstrap.getGeyserConfig(); @@ -217,7 +224,7 @@ public class GeyserImpl extends Geyser { String branch = "unknown"; int buildNumber = -1; - if (this.isProductionEnvironment()) { + if (this.productionEnvironment()) { try { Properties gitProperties = new Properties(); gitProperties.load(FileUtils.getResource("git.properties")); @@ -290,7 +297,7 @@ public class GeyserImpl extends Geyser { metrics.addCustomChart(new Metrics.SimplePie("version", () -> GeyserImpl.VERSION)); metrics.addCustomChart(new Metrics.AdvancedPie("playerPlatform", () -> { Map valueMap = new HashMap<>(); - for (GeyserSession session : sessionManager.getAllSessions()) { + for (GeyserSessionImpl session : sessionManager.getAllSessions()) { if (session == null) continue; if (session.getClientData() == null) continue; String os = session.getClientData().getDeviceOs().toString(); @@ -304,7 +311,7 @@ public class GeyserImpl extends Geyser { })); metrics.addCustomChart(new Metrics.AdvancedPie("playerVersion", () -> { Map valueMap = new HashMap<>(); - for (GeyserSession session : sessionManager.getAllSessions()) { + for (GeyserSessionImpl session : sessionManager.getAllSessions()) { if (session == null) continue; if (session.getClientData() == null) continue; String version = session.getClientData().getGameVersion(); @@ -395,6 +402,40 @@ public class GeyserImpl extends Geyser { newsHandler.handleNews(null, NewsItemAction.ON_SERVER_STARTED); } + @Override + public @Nullable GeyserSessionImpl sessionByName(@NonNull String name) { + for (GeyserSessionImpl session : sessionManager.getAllSessions()) { + if (session.name().equals(name) || session.getProtocol().getProfile().getName().equals(name)) { + return session; + } + } + + return null; + } + + @Override + @SuppressWarnings("unchecked") + public @NonNull List onlineSessions() { + return (List) (List) this.sessionManager.getAllSessions(); + } + + @Override + public @Nullable GeyserSessionImpl sessionByUuid(@NonNull UUID uuid) { + return this.sessionManager.getSessions().get(uuid); + } + + @Override + public @Nullable GeyserSessionImpl sessionByXuid(@NonNull String xuid) { + for (GeyserSessionImpl session : sessionManager.getAllSessions()) { + if (session.xuid().equals(xuid)) { + return session; + } + } + + return null; + } + + @Override public void shutdown() { bootstrap.getGeyserLogger().info(GeyserLocale.getLocaleStringLog("geyser.core.shutdown")); shuttingDown = true; @@ -419,47 +460,28 @@ public class GeyserImpl extends Geyser { bootstrap.getGeyserLogger().info(GeyserLocale.getLocaleStringLog("geyser.core.shutdown.done")); } - /** - * Gets a player by their current UUID - * - * @param uuid the uuid - * @return the player or null if there is no player online with this UUID - */ - @Contract("null -> null") - public GeyserSession getPlayerByUuid(UUID uuid) { - if (uuid == null) { - return null; - } - - return sessionManager.getSessions().get(uuid); + @Override + public void reload() { + shutdown(); + bootstrap.onEnable(); } /** - * Gets a player by their Xbox user identifier + * Returns false if this Geyser instance is running in an IDE. This only needs to be used in cases where files + * expected to be in a jarfile are not present. * - * @param xuid the Xbox user identifier - * @return the player or null if there is no player online with this xuid + * @return true if the version number is not 'DEV'. */ - @SuppressWarnings("unused") // API usage - public GeyserSession getPlayerByXuid(String xuid) { - for (GeyserSession session : sessionManager.getAllSessions()) { - if (session.getAuthData().getXuid().equals(xuid)) { - return session; - } - } - - return null; + @Override + public boolean productionEnvironment() { + //noinspection ConstantConditions - changes in production + return !"DEV".equals(GeyserImpl.VERSION); } public static GeyserImpl start(PlatformType platformType, GeyserBootstrap bootstrap) { return new GeyserImpl(platformType, bootstrap); } - public void reload() { - shutdown(); - bootstrap.onEnable(); - } - public GeyserLogger getLogger() { return bootstrap.getGeyserLogger(); } @@ -480,18 +502,7 @@ public class GeyserImpl extends Geyser { return timeSyncer; } - /** - * Returns false if this Geyser instance is running in an IDE. This only needs to be used in cases where files - * expected to be in a jarfile are not present. - * - * @return true if the version number is not 'DEV'. - */ - public boolean isProductionEnvironment() { - //noinspection ConstantConditions - changes in production - return !"DEV".equals(GeyserImpl.VERSION); - } - public static GeyserImpl getInstance() { - return (GeyserImpl) Geyser.getInstance(); + return instance; } } diff --git a/api/src/main/java/org/geysermc/geyser/api/logger/GeyserLogger.java b/core/src/main/java/org/geysermc/geyser/GeyserLogger.java similarity index 98% rename from api/src/main/java/org/geysermc/geyser/api/logger/GeyserLogger.java rename to core/src/main/java/org/geysermc/geyser/GeyserLogger.java index 564a8f30c..266132f63 100644 --- a/api/src/main/java/org/geysermc/geyser/api/logger/GeyserLogger.java +++ b/core/src/main/java/org/geysermc/geyser/GeyserLogger.java @@ -23,7 +23,7 @@ * @link https://github.com/GeyserMC/Geyser */ -package org.geysermc.geyser.api.logger; +package org.geysermc.geyser; public interface GeyserLogger { 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 8e970d6a0..c30a1df56 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import javax.annotation.Nullable; import java.util.ArrayList; @@ -48,13 +48,13 @@ public class CommandExecutor { } @Nullable - public GeyserSession getGeyserSession(CommandSender sender) { + public GeyserSessionImpl getGeyserSession(CommandSender sender) { if (sender.isConsole()) { return null; } - for (GeyserSession session : geyser.getSessionManager().getSessions().values()) { - if (sender.getName().equals(session.getPlayerEntity().getUsername())) { + for (GeyserSessionImpl 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 19b521ed6..791ddd548 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import org.geysermc.geyser.text.GeyserLocale; import java.util.*; @@ -93,8 +93,8 @@ public abstract class CommandManager { return; } - if (sender instanceof GeyserSession) { - cmd.execute((GeyserSession) sender, sender, args); + if (sender instanceof GeyserSessionImpl) { + cmd.execute((GeyserSessionImpl) sender, sender, args); } else { if (!cmd.isBedrockOnly()) { cmd.execute(null, sender, args); diff --git a/core/src/main/java/org/geysermc/geyser/command/CommandSender.java b/core/src/main/java/org/geysermc/geyser/command/CommandSender.java index 47881868f..962883e3d 100644 --- a/core/src/main/java/org/geysermc/geyser/command/CommandSender.java +++ b/core/src/main/java/org/geysermc/geyser/command/CommandSender.java @@ -33,7 +33,7 @@ import org.geysermc.geyser.text.GeyserLocale; */ public interface CommandSender { - String getName(); + String name(); default void sendMessage(String[] messages) { for (String message : messages) { 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 6971ad44d..593c17fe8 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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 GeyserSession session, CommandSender sender, String[] args); + public abstract void execute(@Nullable GeyserSessionImpl 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 41bb8e6cd..e9da5a2a0 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, CommandSender sender, String[] args) { + public void execute(GeyserSessionImpl 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 64ad6e216..24ff41a60 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, CommandSender sender, String[] args) { + public void execute(GeyserSessionImpl 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())); @@ -137,7 +137,7 @@ public class DumpCommand extends GeyserCommand { sender.sendMessage(GeyserLocale.getPlayerLocaleString("geyser.commands.dump.message", sender.getLocale()) + " " + ChatColor.DARK_AQUA + uploadedDumpUrl); if (!sender.isConsole()) { - geyser.getLogger().info(GeyserLocale.getLocaleStringLog("geyser.commands.dump.created", sender.getName(), uploadedDumpUrl)); + geyser.getLogger().info(GeyserLocale.getLocaleStringLog("geyser.commands.dump.created", sender.name(), uploadedDumpUrl)); } } 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 4d4a21319..8ca115007 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, CommandSender sender, String[] args) { + public void execute(GeyserSessionImpl 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 1da6b79c2..a5a5df000 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import org.geysermc.geyser.text.GeyserLocale; import java.util.stream.Collectors; @@ -44,10 +44,10 @@ public class ListCommand extends GeyserCommand { } @Override - public void execute(GeyserSession session, CommandSender sender, String[] args) { + public void execute(GeyserSessionImpl session, CommandSender sender, String[] args) { String message = GeyserLocale.getPlayerLocaleString("geyser.commands.list.message", sender.getLocale(), geyser.getSessionManager().size(), - geyser.getSessionManager().getAllSessions().stream().map(GeyserSession::getName).collect(Collectors.joining(" "))); + geyser.getSessionManager().getAllSessions().stream().map(GeyserSessionImpl::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 934cd8c87..24a8c8f22 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import org.geysermc.geyser.util.BlockUtils; public class OffhandCommand extends GeyserCommand { @@ -41,7 +41,7 @@ public class OffhandCommand extends GeyserCommand { } @Override - public void execute(GeyserSession session, CommandSender sender, String[] args) { + public void execute(GeyserSessionImpl 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 1a72e1734..9ea44577b 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import org.geysermc.geyser.text.GeyserLocale; public class ReloadCommand extends GeyserCommand { @@ -42,7 +42,7 @@ public class ReloadCommand extends GeyserCommand { } @Override - public void execute(GeyserSession session, CommandSender sender, String[] args) { + public void execute(GeyserSessionImpl 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 349f7288b..fd9460255 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import org.geysermc.geyser.util.SettingsUtils; public class SettingsCommand extends GeyserCommand { @@ -37,7 +37,7 @@ public class SettingsCommand extends GeyserCommand { } @Override - public void execute(GeyserSession session, CommandSender sender, String[] args) { + public void execute(GeyserSessionImpl 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 c570770b7..39cbfce7e 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; public class StatisticsCommand extends GeyserCommand { @@ -39,7 +39,7 @@ public class StatisticsCommand extends GeyserCommand { } @Override - public void execute(GeyserSession session, CommandSender sender, String[] args) { + public void execute(GeyserSessionImpl 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 6b74f9c8b..6ef26f121 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import org.geysermc.geyser.text.GeyserLocale; import java.util.Collections; @@ -46,7 +46,7 @@ public class StopCommand extends GeyserCommand { } @Override - public void execute(GeyserSession session, CommandSender sender, String[] args) { + public void execute(GeyserSessionImpl 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 ff80abba3..164ddea92 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, CommandSender sender, String[] args) { + public void execute(GeyserSessionImpl session, CommandSender sender, String[] args) { String bedrockVersions; List supportedCodecs = MinecraftProtocol.SUPPORTED_BEDROCK_CODECS; if (supportedCodecs.size() > 1) { @@ -67,7 +67,7 @@ public class VersionCommand extends GeyserCommand { GeyserImpl.NAME, GeyserImpl.VERSION, MinecraftProtocol.getJavaVersion(), bedrockVersions)); // Disable update checking in dev mode and for players in Geyser Standalone - if (GeyserImpl.getInstance().isProductionEnvironment() && !(!sender.isConsole() && geyser.getPlatformType() == PlatformType.STANDALONE)) { + if (GeyserImpl.getInstance().productionEnvironment() && !(!sender.isConsole() && geyser.getPlatformType() == PlatformType.STANDALONE)) { sender.sendMessage(GeyserLocale.getPlayerLocaleString("geyser.commands.version.checking", sender.getLocale())); try { Properties gitProp = new Properties(); diff --git a/core/src/main/java/org/geysermc/geyser/configuration/GeyserConfiguration.java b/core/src/main/java/org/geysermc/geyser/configuration/GeyserConfiguration.java index eb6b68f78..57cb5fb09 100644 --- a/core/src/main/java/org/geysermc/geyser/configuration/GeyserConfiguration.java +++ b/core/src/main/java/org/geysermc/geyser/configuration/GeyserConfiguration.java @@ -26,7 +26,7 @@ package org.geysermc.geyser.configuration; import com.fasterxml.jackson.annotation.JsonIgnore; -import org.geysermc.geyser.api.logger.GeyserLogger; +import org.geysermc.geyser.GeyserLogger; import org.geysermc.geyser.session.auth.AuthType; import org.geysermc.geyser.network.CIDRMatcher; import org.geysermc.geyser.text.GeyserLocale; 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 5a77b84fb..b4c1f7f6b 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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 (GeyserSession session : GeyserImpl.getInstance().getSessionManager().getAllSessions()) { + for (GeyserSessionImpl 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 b51f83f2c..132194711 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, Entity interactEntity) { + public static void updateTag(GeyserSessionImpl 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 dff1617f9..13a3140f2 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; @FunctionalInterface public interface BaseEntityFactory extends EntityFactory { - T create(GeyserSession session, long javaId, long bedrockId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw); + T create(GeyserSessionImpl 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 40a93c08b..1c8800172 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; @FunctionalInterface public interface ExperienceOrbEntityFactory extends EntityFactory { - ExpOrbEntity create(GeyserSession session, int amount, long entityId, long geyserId, Vector3f position); + ExpOrbEntity create(GeyserSessionImpl 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 2990b0ac5..2d5ff63b3 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import org.geysermc.geyser.level.PaintingType; import java.util.UUID; public interface PaintingEntityFactory extends EntityFactory { - PaintingEntity create(GeyserSession session, long entityId, long geyserId, UUID uuid, Vector3f position, PaintingType paintingName, int direction); + PaintingEntity create(GeyserSessionImpl 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 b80db2570..c8fc72eb2 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class AbstractArrowEntity extends Entity { - public AbstractArrowEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public AbstractArrowEntity(GeyserSessionImpl 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 6063c81f9..a9c6bf11a 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import org.geysermc.geyser.registry.Registries; import java.util.UUID; public class AreaEffectCloudEntity extends Entity { - public AreaEffectCloudEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public AreaEffectCloudEntity(GeyserSessionImpl 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 ac1b3fcbd..85113ba2c 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public BoatEntity(GeyserSessionImpl 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(GeyserSession session, Entity rower) { + private void updateLeftPaddle(GeyserSessionImpl 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(GeyserSession session, Entity rower) { + private void updateRightPaddle(GeyserSessionImpl 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(GeyserSession session, Entity rower, AnimatePacket.Action action, float rowTime) { + private void sendAnimationPacket(GeyserSessionImpl 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 1764c721e..0b755f114 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class CommandBlockMinecartEntity extends DefaultBlockMinecartEntity { - public CommandBlockMinecartEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public CommandBlockMinecartEntity(GeyserSessionImpl 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 ec00c30be..5e6a15198 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; @@ -43,7 +43,7 @@ public class DefaultBlockMinecartEntity extends MinecartEntity { public int customBlockOffset = 0; public boolean showCustomBlock = false; - public DefaultBlockMinecartEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public DefaultBlockMinecartEntity(GeyserSessionImpl 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 aa907b7c6..421043ff6 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.Optional; import java.util.UUID; public class EnderCrystalEntity extends Entity { - public EnderCrystalEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public EnderCrystalEntity(GeyserSessionImpl 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 3b01c428f..7935566e8 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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 GeyserSession session; + protected final GeyserSessionImpl 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(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public Entity(GeyserSessionImpl 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 25135d0b5..1bd059e95 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; public class ExpOrbEntity extends Entity { private final int amount; - public ExpOrbEntity(GeyserSession session, int amount, long entityId, long geyserId, Vector3f position) { + public ExpOrbEntity(GeyserSessionImpl 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 346861f96..f6106f3b0 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class FallingBlockEntity extends Entity { private final int javaId; - public FallingBlockEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, Vector3f position, Vector3f motion, float yaw, float pitch, int javaId) { + public FallingBlockEntity(GeyserSessionImpl 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 075178b55..b6b383dcb 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public FireworkEntity(GeyserSessionImpl 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 b5774bd78..bac3b9bb8 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, long entityId, long geyserId, UUID uuid, Vector3f position, Vector3f motion, float yaw, float pitch, PlayerEntity owner) { + public FishingHookEntity(GeyserSessionImpl 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(GeyserSession session) { + private void sendSplashSound(GeyserSessionImpl 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 ab34cb751..b9134e7e5 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public FurnaceMinecartEntity(GeyserSessionImpl 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 dd98f9aba..f3732a83d 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ItemEntity(GeyserSessionImpl 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 b8688abc4..53094bdf3 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, Direction direction) { + public ItemFrameEntity(GeyserSessionImpl 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() @@ -214,7 +214,7 @@ public class ItemFrameEntity extends Entity { * @param session GeyserSession. * @return Java entity ID or -1 if not found. */ - public static ItemFrameEntity getItemFrameEntity(GeyserSession session, Vector3i position) { + public static ItemFrameEntity getItemFrameEntity(GeyserSessionImpl 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 49548ec2a..8d45d84ae 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; @@ -39,7 +39,7 @@ public class ItemedFireballEntity extends ThrowableEntity { */ protected int futureTicks = 3; - public ItemedFireballEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ItemedFireballEntity(GeyserSessionImpl 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 63e964a55..3443814bf 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class LeashKnotEntity extends Entity { - public LeashKnotEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public LeashKnotEntity(GeyserSessionImpl 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 1f5af0492..8830117e6 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; import java.util.concurrent.ThreadLocalRandom; public class LightningEntity extends Entity { - public LightningEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public LightningEntity(GeyserSessionImpl 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 678741424..63d481182 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public LivingEntity(GeyserSessionImpl 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(GeyserSession session) { + public void updateArmor(GeyserSessionImpl session) { if (!valid) return; ItemData helmet = this.helmet; @@ -194,7 +194,7 @@ public class LivingEntity extends Entity { session.sendUpstreamPacket(armorEquipmentPacket); } - public void updateMainHand(GeyserSession session) { + public void updateMainHand(GeyserSessionImpl session) { if (!valid) return; MobEquipmentPacket handPacket = new MobEquipmentPacket(); @@ -207,7 +207,7 @@ public class LivingEntity extends Entity { session.sendUpstreamPacket(handPacket); } - public void updateOffHand(GeyserSession session) { + public void updateOffHand(GeyserSessionImpl 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(GeyserSession session, List attributes) { + public void updateBedrockAttributes(GeyserSessionImpl 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 ffb5e4018..d71895466 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class MinecartEntity extends Entity { - public MinecartEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public MinecartEntity(GeyserSessionImpl 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 e97bb7090..32c0da71b 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, long entityId, long geyserId, UUID uuid, Vector3f position, PaintingType paintingName, int direction) { + public PaintingEntity(GeyserSessionImpl 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 2cd4cf3f6..2ca179be0 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import org.geysermc.geyser.level.block.BlockStateValues; import java.util.UUID; public class SpawnerMinecartEntity extends DefaultBlockMinecartEntity { - public SpawnerMinecartEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public SpawnerMinecartEntity(GeyserSessionImpl 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 e7edd32d5..31b06d4c4 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class TNTEntity extends Entity implements Tickable { private int currentTick; - public TNTEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public TNTEntity(GeyserSessionImpl 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 67aa09794..5b0ff57fb 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ThrowableEntity(GeyserSessionImpl 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 7abffd0bf..ae2de746c 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; @@ -42,7 +42,7 @@ public class ThrowableItemEntity extends ThrowableEntity { private int age; private boolean invisible; - public ThrowableItemEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ThrowableItemEntity(GeyserSessionImpl 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 c4cd5d54a..19d2b09b4 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ThrownPotionEntity(GeyserSessionImpl 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 a60c0ab33..cb3e2471d 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public TippedArrowEntity(GeyserSessionImpl 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 65591fb50..5e1151db6 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class TridentEntity extends AbstractArrowEntity { - public TridentEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public TridentEntity(GeyserSessionImpl 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 fbed041fe..fb40862cc 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class WitherSkullEntity extends ItemedFireballEntity { private boolean isCharged; - public WitherSkullEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public WitherSkullEntity(GeyserSessionImpl 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 8fedce1e7..1a97bfb12 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class AbstractFishEntity extends WaterEntity { - public AbstractFishEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public AbstractFishEntity(GeyserSessionImpl 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 b250f3e8e..6fb687f47 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class AgeableEntity extends CreatureEntity { - public AgeableEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public AgeableEntity(GeyserSessionImpl 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 693a0cd46..0c15fa95c 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class AmbientEntity extends MobEntity { - public AmbientEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public AmbientEntity(GeyserSessionImpl 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 fb459bf54..7f5ccd306 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.Optional; import java.util.UUID; @@ -78,7 +78,7 @@ public class ArmorStandEntity extends LivingEntity { */ private boolean positionUpdateRequired = false; - public ArmorStandEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ArmorStandEntity(GeyserSessionImpl 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 0a72a431e..07853429a 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class BatEntity extends AmbientEntity { - public BatEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public BatEntity(GeyserSessionImpl 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 b5e7557da..cef93a7a6 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class CreatureEntity extends MobEntity { - public CreatureEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public CreatureEntity(GeyserSessionImpl 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 91f839bc3..3a6581d2f 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class FlyingEntity extends MobEntity { - public FlyingEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public FlyingEntity(GeyserSessionImpl 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 b5950b7bc..dc49ec765 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class GlowSquidEntity extends SquidEntity { - public GlowSquidEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public GlowSquidEntity(GeyserSessionImpl 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 eb94e1406..a6cec0788 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class GolemEntity extends CreatureEntity { - public GolemEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public GolemEntity(GeyserSessionImpl 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 f86392ed3..9a28d7032 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class IronGolemEntity extends GolemEntity { - public IronGolemEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public IronGolemEntity(GeyserSessionImpl 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 03cf9f3dc..1610ee6e5 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class MagmaCubeEntity extends SlimeEntity { - public MagmaCubeEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public MagmaCubeEntity(GeyserSessionImpl 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 e82b813d7..0a06f67c6 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; @@ -43,7 +43,7 @@ public class MobEntity extends LivingEntity { @Getter private long leashHolderBedrockId; - public MobEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public MobEntity(GeyserSessionImpl 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 100ed764d..5d9a4604c 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class SlimeEntity extends MobEntity { - public SlimeEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public SlimeEntity(GeyserSessionImpl 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 1d8375529..c8bf1d67a 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class SnowGolemEntity extends GolemEntity { - public SnowGolemEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public SnowGolemEntity(GeyserSessionImpl 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 b0e2fcb9e..ada353196 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public SquidEntity(GeyserSessionImpl 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 acacd1f52..c1940d043 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class WaterEntity extends CreatureEntity { - public WaterEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public WaterEntity(GeyserSessionImpl 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 c7c15b288..01e3b7a80 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import org.geysermc.geyser.registry.type.ItemMapping; import java.util.UUID; public class AnimalEntity extends AgeableEntity { - public AnimalEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public AnimalEntity(GeyserSessionImpl 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 4dfa5fa8d..d8026d378 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import org.geysermc.geyser.registry.type.ItemMapping; import java.util.UUID; public class AxolotlEntity extends AnimalEntity { - public AxolotlEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public AxolotlEntity(GeyserSessionImpl 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 7f9ec4255..de761167d 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import org.geysermc.geyser.registry.type.ItemMapping; import java.util.UUID; public class BeeEntity extends AnimalEntity { - public BeeEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public BeeEntity(GeyserSessionImpl 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 506714dbc..051c53eae 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import org.geysermc.geyser.registry.type.ItemMapping; import java.util.UUID; public class ChickenEntity extends AnimalEntity { - public ChickenEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ChickenEntity(GeyserSessionImpl 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 127a70a0f..cf7e83108 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import org.geysermc.geyser.registry.type.ItemMapping; import java.util.UUID; public class FoxEntity extends AnimalEntity { - public FoxEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public FoxEntity(GeyserSessionImpl 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 708a95134..a0701503f 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; @@ -41,7 +41,7 @@ public class GoatEntity extends AnimalEntity { @Getter private boolean isScreamer; - public GoatEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public GoatEntity(GeyserSessionImpl 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 ed0feed97..9456361ee 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public HoglinEntity(GeyserSessionImpl 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 15473c8ac..ffd7c138b 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class MooshroomEntity extends AnimalEntity { - public MooshroomEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public MooshroomEntity(GeyserSessionImpl 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 5244e3538..a769324c5 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import org.geysermc.geyser.registry.type.ItemMapping; import java.util.UUID; public class OcelotEntity extends AnimalEntity { - public OcelotEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public OcelotEntity(GeyserSessionImpl 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 7548ccef1..74a4b85c0 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public PandaEntity(GeyserSessionImpl 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 0be4c78f1..000ace4b3 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import org.geysermc.geyser.registry.type.ItemMapping; import java.util.UUID; public class PigEntity extends AnimalEntity { - public PigEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public PigEntity(GeyserSessionImpl 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 727804dbc..bf4991119 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import org.geysermc.geyser.registry.type.ItemMapping; import java.util.UUID; public class PolarBearEntity extends AnimalEntity { - public PolarBearEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public PolarBearEntity(GeyserSessionImpl 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 66853babf..39fecff46 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class PufferFishEntity extends AbstractFishEntity { - public PufferFishEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public PufferFishEntity(GeyserSessionImpl 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 a1d80ac72..0db826ecb 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import org.geysermc.geyser.registry.type.ItemMapping; import java.util.UUID; public class RabbitEntity extends AnimalEntity { - public RabbitEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public RabbitEntity(GeyserSessionImpl 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 757c5b574..a494df017 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class SheepEntity extends AnimalEntity { - public SheepEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public SheepEntity(GeyserSessionImpl 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 d684fba06..db4a44ede 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public StriderEntity(GeyserSessionImpl 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 b883c91a9..08a204804 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public TropicalFishEntity(GeyserSessionImpl 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 e892d7d5e..8a70f9605 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import org.geysermc.geyser.registry.type.ItemMapping; import java.util.UUID; public class TurtleEntity extends AnimalEntity { - public TurtleEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public TurtleEntity(GeyserSessionImpl 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 7d0a3cf9a..6a7391461 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public AbstractHorseEntity(GeyserSessionImpl 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 ccf30dbc8..5389d0236 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class ChestedHorseEntity extends AbstractHorseEntity { - public ChestedHorseEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ChestedHorseEntity(GeyserSessionImpl 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 31b5b7890..77f25bc8a 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class HorseEntity extends AbstractHorseEntity { - public HorseEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public HorseEntity(GeyserSessionImpl 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 c18778c81..7883a564d 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import org.geysermc.geyser.registry.type.ItemMapping; import java.util.UUID; public class LlamaEntity extends ChestedHorseEntity { - public LlamaEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public LlamaEntity(GeyserSessionImpl 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 770d30a05..399ee529b 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class TraderLlamaEntity extends LlamaEntity { - public TraderLlamaEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public TraderLlamaEntity(GeyserSessionImpl 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 5538621d9..050c066d8 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public CatEntity(GeyserSessionImpl 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 05f0a6ad5..c291dbbe8 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import org.geysermc.geyser.registry.type.ItemMapping; import java.util.UUID; public class ParrotEntity extends TameableEntity { - public ParrotEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ParrotEntity(GeyserSessionImpl 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 d12839e92..1a00a4803 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.Optional; import java.util.UUID; @@ -46,7 +46,7 @@ public class TameableEntity extends AnimalEntity { @Getter protected long ownerBedrockId; - public TameableEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public TameableEntity(GeyserSessionImpl 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 13bb8e17d..91d5088f2 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public WolfEntity(GeyserSessionImpl 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 7981c9b23..0e40fd9a1 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class AbstractMerchantEntity extends AgeableEntity { - public AbstractMerchantEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public AbstractMerchantEntity(GeyserSessionImpl 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 012fb05f2..b403f4362 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public VillagerEntity(GeyserSessionImpl 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 ae13cfeae..3a923ef7f 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class AbstractSkeletonEntity extends MonsterEntity { - public AbstractSkeletonEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public AbstractSkeletonEntity(GeyserSessionImpl 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 2f315368f..19ccaaef2 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public BasePiglinEntity(GeyserSessionImpl 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 2303f8091..46e4576c9 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class BlazeEntity extends MonsterEntity { - public BlazeEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public BlazeEntity(GeyserSessionImpl 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 f1e0b6a65..e601999cf 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; @@ -41,7 +41,7 @@ public class CreeperEntity extends MonsterEntity { */ private boolean ignitedByFlintAndSteel = false; - public CreeperEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public CreeperEntity(GeyserSessionImpl 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 9c237f117..b25bc3168 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class ElderGuardianEntity extends GuardianEntity { - public ElderGuardianEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ElderGuardianEntity(GeyserSessionImpl 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 f49b51e6c..5319e4b2a 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public EnderDragonEntity(GeyserSessionImpl 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 7cd4bb6cf..2ab9cc461 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; public class EnderDragonPartEntity extends Entity { - public EnderDragonPartEntity(GeyserSession session, long entityId, long geyserId, float width, float height) { + public EnderDragonPartEntity(GeyserSessionImpl 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 469f48521..771b00e36 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class EndermanEntity extends MonsterEntity { - public EndermanEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public EndermanEntity(GeyserSessionImpl 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 845a281d9..a03f1df95 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class GhastEntity extends FlyingEntity { - public GhastEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public GhastEntity(GeyserSessionImpl 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 6dd27cc39..2c84efd77 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class GiantEntity extends MonsterEntity { - public GiantEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public GiantEntity(GeyserSessionImpl 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 0190f3c60..9c1954134 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class GuardianEntity extends MonsterEntity { - public GuardianEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public GuardianEntity(GeyserSessionImpl 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 fad45f982..0372c174a 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class MonsterEntity extends CreatureEntity { - public MonsterEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public MonsterEntity(GeyserSessionImpl 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 68f3e7d23..0854c2522 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class PhantomEntity extends FlyingEntity { - public PhantomEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public PhantomEntity(GeyserSessionImpl 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 b98d6eabc..084f1dc36 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class PiglinEntity extends BasePiglinEntity { - public PiglinEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public PiglinEntity(GeyserSessionImpl 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(GeyserSession session) { + public void updateOffHand(GeyserSessionImpl 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 e60f81d2f..d5d816a46 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class ShulkerEntity extends GolemEntity { - public ShulkerEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ShulkerEntity(GeyserSessionImpl 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 b1f6939aa..9339b6593 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class SkeletonEntity extends AbstractSkeletonEntity { private boolean convertingToStray = false; - public SkeletonEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public SkeletonEntity(GeyserSessionImpl 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 4f7b02d73..af358a800 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class SpiderEntity extends MonsterEntity { - public SpiderEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public SpiderEntity(GeyserSessionImpl 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 938b18022..f6017d479 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class VexEntity extends MonsterEntity { - public VexEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public VexEntity(GeyserSessionImpl 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 17da0a611..d79fe4e8b 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class WitherEntity extends MonsterEntity { - public WitherEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public WitherEntity(GeyserSessionImpl 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 f0fe101da..364233d81 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class ZoglinEntity extends MonsterEntity { - public ZoglinEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ZoglinEntity(GeyserSessionImpl 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 9e3301b48..1cd5c4c91 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class ZombieEntity extends MonsterEntity { private boolean convertingToDrowned = false; - public ZombieEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ZombieEntity(GeyserSessionImpl 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 54a5c4506..4fa3d88f8 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class ZombieVillagerEntity extends ZombieEntity { private boolean isTransforming; - public ZombieVillagerEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ZombieVillagerEntity(GeyserSessionImpl 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 2604ce12e..aaf3d8001 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class ZombifiedPiglinEntity extends ZombieEntity { - public ZombifiedPiglinEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ZombifiedPiglinEntity(GeyserSessionImpl 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 15ac1a0d9..ff24b7fb2 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class AbstractIllagerEntity extends RaidParticipantEntity { - public AbstractIllagerEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public AbstractIllagerEntity(GeyserSessionImpl 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 477d9fef7..d13fc247a 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import org.geysermc.geyser.registry.type.ItemMapping; import java.util.UUID; public class PillagerEntity extends AbstractIllagerEntity { - public PillagerEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public PillagerEntity(GeyserSessionImpl 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(GeyserSession session) { //TODO + public void updateMainHand(GeyserSessionImpl session) { //TODO checkForCrossbow(); super.updateMainHand(session); } @Override - public void updateOffHand(GeyserSession session) { + public void updateOffHand(GeyserSessionImpl 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 bd0f3ac5d..cecb679aa 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class RaidParticipantEntity extends MonsterEntity { - public RaidParticipantEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public RaidParticipantEntity(GeyserSessionImpl 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 7c2a05de1..0ada45517 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public SpellcasterIllagerEntity(GeyserSessionImpl 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 a3b85dc73..d6b239e10 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.UUID; public class VindicatorEntity extends AbstractIllagerEntity { - public VindicatorEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public VindicatorEntity(GeyserSessionImpl 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 8737ef847..4a3064825 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, long entityId, long geyserId, GameProfile gameProfile, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public PlayerEntity(GeyserSessionImpl 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 c297bdb18..4ee309290 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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 GeyserSession}'s player. + * The entity class specifically for a {@link GeyserSessionImpl}'s player. */ public class SessionPlayerEntity extends PlayerEntity { /** @@ -70,9 +70,9 @@ public class SessionPlayerEntity extends PlayerEntity { */ private int fakeTradeXp; - private final GeyserSession session; + private final GeyserSessionImpl session; - public SessionPlayerEntity(GeyserSession session) { + public SessionPlayerEntity(GeyserSessionImpl 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 0afb3e8b5..8bf3a8400 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; /** * 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(GeyserSession session, long geyserId, GameProfile gameProfile, Vector3f position, float rotation, int blockState) { + public SkullPlayerEntity(GeyserSessionImpl 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 464d683fa..2e1ef0542 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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, GeyserSession session) { + public void setItem(int slot, @NonNull GeyserItemStack newItem, GeyserSessionImpl session) { if (slot < this.size) { super.setItem(slot, newItem, session); } else { 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 fc226f621..cc2eda74e 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession, Inventory)} + * Used at {@link Generic3X3InventoryTranslator#openInventory(GeyserSessionImpl, 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 8ecb3fe8d..6b789a075 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.Arrays; import java.util.Collections; @@ -70,7 +70,7 @@ public class GeyserEnchantOption { this.javaIndex = javaIndex; } - public EnchantOptionData build(GeyserSession session) { + public EnchantOptionData build(GeyserSessionImpl 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 a75631db0..bdc141045 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session) { + public ItemData getItemData(GeyserSessionImpl 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(GeyserSession session) { + public ItemMapping getMapping(GeyserSessionImpl 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 6eaaf84a2..bf58abf4c 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.Arrays; @@ -102,7 +102,7 @@ public class Inventory { return items[slot]; } - public void setItem(int slot, @NonNull GeyserItemStack newItem, GeyserSession session) { + public void setItem(int slot, @NonNull GeyserItemStack newItem, GeyserSessionImpl 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, GeyserSession session) { + protected static void updateItemNetId(GeyserItemStack oldItem, GeyserItemStack newItem, GeyserSessionImpl 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 36114ccba..57df2fe68 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; public class PlayerInventory extends Inventory { @@ -50,7 +50,7 @@ public class PlayerInventory extends Inventory { heldItemSlot = 0; } - public void setCursor(@NonNull GeyserItemStack newCursor, GeyserSession session) { + public void setCursor(@NonNull GeyserItemStack newCursor, GeyserSessionImpl 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 3dc35f5df..0785c4eac 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; public class StonecutterContainer extends Container { /** @@ -44,7 +44,7 @@ public class StonecutterContainer extends Container { } @Override - public void setItem(int slot, @NonNull GeyserItemStack newItem, GeyserSession session) { + public void setItem(int slot, @NonNull GeyserItemStack newItem, GeyserSessionImpl 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 c239cc778..e58c0bc0d 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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 GeyserSession session; + private final GeyserSessionImpl session; private final InventoryTranslator translator; private final Inventory inventory; private final int gridSize; - public ClickPlan(GeyserSession session, InventoryTranslator translator, Inventory inventory) { + public ClickPlan(GeyserSessionImpl 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 8dba5a69d..59e32c97e 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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, GeyserSession session, Inventory inventory) { + public void prepareInventory(InventoryTranslator translator, GeyserSessionImpl 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(GeyserSession session) { + protected boolean checkInteractionPosition(GeyserSessionImpl 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(GeyserSession session, Vector3i position, Inventory inventory, int javaBlockState) { + protected void setCustomName(GeyserSessionImpl 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, GeyserSession session, Inventory inventory) { + public void openInventory(InventoryTranslator translator, GeyserSessionImpl 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, GeyserSession session, Inventory inventory) { + public void closeInventory(InventoryTranslator translator, GeyserSessionImpl 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 845e645e3..d90487a86 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import org.geysermc.geyser.translator.inventory.InventoryTranslator; public abstract class InventoryHolder { - 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); + 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); } 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 f95633768..2c162ef85 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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, GeyserSession session, Inventory inventory) { + public void updateInventory(InventoryTranslator translator, GeyserSessionImpl 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, GeyserSession session, Inventory inventory, int javaSlot) { + public boolean updateSlot(InventoryTranslator translator, GeyserSessionImpl 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(GeyserSession session, AnvilContainer anvilContainer) { + private void updateInventoryState(GeyserSessionImpl 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(GeyserSession session, AnvilContainer anvilContainer) { + private int getTargetSlot(GeyserSessionImpl 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, GeyserSession session, AnvilContainer anvilContainer, int slot) { + private void updateTargetSlot(InventoryTranslator translator, GeyserSessionImpl 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(GeyserSession session, AnvilContainer anvilContainer, ItemData itemData) { + private ItemData hijackRepairCost(GeyserSessionImpl 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(GeyserSession session, AnvilContainer anvilContainer, boolean bedrock) { + public int calcLevelCost(GeyserSessionImpl 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(GeyserSession session, GeyserItemStack input, GeyserItemStack material) { + private int calcRepairLevelCost(GeyserSessionImpl 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(GeyserSession session, GeyserItemStack input, GeyserItemStack material) { + private int calcMergeRepairCost(GeyserSessionImpl 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(GeyserSession session, GeyserItemStack input, GeyserItemStack material, boolean bedrock) { + private int calcMergeEnchantmentCost(GeyserSessionImpl 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(GeyserSession session, GeyserItemStack itemStack, boolean bedrock) { + private Object2IntMap getEnchantments(GeyserSessionImpl 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(GeyserSession session, GeyserItemStack itemStack) { + private boolean isEnchantedBook(GeyserSessionImpl session, GeyserItemStack itemStack) { return itemStack.getJavaId() == session.getItemMappings().getStoredItems().enchantedBook().getJavaId(); } - private boolean isCombining(GeyserSession session, GeyserItemStack input, GeyserItemStack material) { + private boolean isCombining(GeyserSessionImpl session, GeyserItemStack input, GeyserItemStack material) { return isEnchantedBook(session, material) || (input.getJavaId() == material.getJavaId() && hasDurability(session, input)); } - private boolean isRepairing(GeyserSession session, GeyserItemStack input, GeyserItemStack material) { + private boolean isRepairing(GeyserSessionImpl session, GeyserItemStack input, GeyserItemStack material) { Set repairMaterials = input.getMapping(session).getRepairMaterials(); return repairMaterials != null && repairMaterials.contains(material.getMapping(session).getJavaIdentifier()); } - private boolean isRenaming(GeyserSession session, AnvilContainer anvilContainer, boolean bedrock) { + private boolean isRenaming(GeyserSessionImpl 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(GeyserSession session, GeyserItemStack itemStack) { + private boolean hasDurability(GeyserSessionImpl 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 65147abb6..d8951b9d6 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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, GeyserSession session, Inventory inventory) { + public void updateInventory(InventoryTranslator translator, GeyserSessionImpl 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, GeyserSession session, Inventory inventory, int javaSlot) { + public boolean updateSlot(InventoryTranslator translator, GeyserSessionImpl 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 dd1e810ca..2790e1de7 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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, GeyserSession session, Inventory inventory) { + public void updateInventory(InventoryTranslator translator, GeyserSessionImpl 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, GeyserSession session, Inventory inventory, int javaSlot) { + public boolean updateSlot(InventoryTranslator translator, GeyserSessionImpl 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 10a556c81..36f98da5a 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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, GeyserSession session, Inventory inventory) { + public void updateInventory(InventoryTranslator translator, GeyserSessionImpl 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, GeyserSession session, Inventory inventory, int javaSlot) { + public boolean updateSlot(InventoryTranslator translator, GeyserSessionImpl 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 6910aa447..33dee921b 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import org.geysermc.geyser.translator.inventory.InventoryTranslator; import java.util.Arrays; public class InventoryUpdater { - public void updateInventory(InventoryTranslator translator, GeyserSession session, Inventory inventory) { + public void updateInventory(InventoryTranslator translator, GeyserSessionImpl 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, GeyserSession session, Inventory inventory, int javaSlot) { + public boolean updateSlot(InventoryTranslator translator, GeyserSessionImpl 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 79b6bffc0..eeaa0fd7b 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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, GeyserSession session, Inventory inventory) { + public void updateInventory(InventoryTranslator translator, GeyserSessionImpl 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, GeyserSession session, Inventory inventory, int javaSlot) { + public boolean updateSlot(InventoryTranslator translator, GeyserSessionImpl 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 d766c4b4c..7253809e3 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, int x, int y, int z) { + public int getBlockAt(GeyserSessionImpl 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(GeyserSession session, int x, int y, int z, boolean isChunkLoad) { + public NbtMap getLecternDataAt(GeyserSessionImpl 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(GeyserSession session, String name, Object value) { + public void setGameRule(GeyserSessionImpl session, String name, Object value) { session.sendDownstreamPacket(new ServerboundChatPacket("/gamerule " + name + " " + value)); gameruleCache.put(name, String.valueOf(value)); } @Override - public Boolean getGameRuleBool(GeyserSession session, GameRule gameRule) { + public Boolean getGameRuleBool(GeyserSessionImpl 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(GeyserSession session, GameRule gameRule) { + public int getGameRuleInt(GeyserSessionImpl 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(GeyserSession session, GameMode gameMode) { + public void setPlayerGameMode(GeyserSessionImpl session, GameMode gameMode) { session.sendDownstreamPacket(new ServerboundChatPacket("/gamemode " + gameMode.name().toLowerCase())); } @Override - public void setDifficulty(GeyserSession session, Difficulty difficulty) { + public void setDifficulty(GeyserSessionImpl session, Difficulty difficulty) { session.sendDownstreamPacket(new ServerboundChatPacket("/difficulty " + difficulty.name().toLowerCase())); } @Override - public boolean hasPermission(GeyserSession session, String permission) { + public boolean hasPermission(GeyserSessionImpl 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 9aaf323c0..edd95bb52 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; /** * 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(GeyserSession session, Position position) { + public int getBlockAt(GeyserSessionImpl 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(GeyserSession session, Vector3i vector) { + public int getBlockAt(GeyserSessionImpl 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(GeyserSession session, int x, int y, int z); + public abstract int getBlockAt(GeyserSessionImpl 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(GeyserSession session, int x, int y, int z, boolean isChunkLoad); + public abstract NbtMap getLecternDataAt(GeyserSessionImpl 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(GeyserSession session, String name, Object value); + public abstract void setGameRule(GeyserSessionImpl 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(GeyserSession session, GameRule gameRule); + public abstract Boolean getGameRuleBool(GeyserSessionImpl 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(GeyserSession session, GameRule gameRule); + public abstract int getGameRuleInt(GeyserSessionImpl 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(GeyserSession session, GameMode gameMode); + public abstract void setPlayerGameMode(GeyserSessionImpl 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(GeyserSession session, Difficulty difficulty); + public abstract void setDifficulty(GeyserSessionImpl 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(GeyserSession session, String permission); + public abstract boolean hasPermission(GeyserSessionImpl 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 5bd72182f..60aba03f2 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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 GeyserSession session; + private final GeyserSessionImpl session; @Getter private final BoundingBox playerBoundingBox; @@ -85,7 +85,7 @@ public class CollisionManager { */ private static final double INCORRECT_MOVEMENT_THRESHOLD = 0.08; - public CollisionManager(GeyserSession session) { + public CollisionManager(GeyserSessionImpl 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(GeyserSession, int, int, int, BoundingBox)} for more info + * See {@link BlockCollision#correctPosition(GeyserSessionImpl, 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 2cd866365..5d580fc05 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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 GeyserSession(geyser, bedrockServerSession, eventLoopGroup.next()))); + bedrockServerSession.setPacketHandler(new UpstreamPacketHandler(geyser, new GeyserSessionImpl(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 0dceed7e9..1eeca3319 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; /** * Bare bones implementation of BedrockPacketHandler suitable for extension. @@ -39,9 +39,9 @@ import org.geysermc.geyser.session.GeyserSession; */ public class LoggingPacketHandler implements BedrockPacketHandler { protected final GeyserImpl geyser; - protected final GeyserSession session; + protected final GeyserSessionImpl session; - LoggingPacketHandler(GeyserImpl geyser, GeyserSession session) { + LoggingPacketHandler(GeyserImpl geyser, GeyserSessionImpl 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 a0800fb42..76a238ad5 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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, GeyserSession session) { + public UpstreamPacketHandler(GeyserImpl geyser, GeyserSessionImpl session) { super(geyser, session); } @@ -116,12 +116,12 @@ public class UpstreamPacketHandler extends LoggingPacketHandler { switch (packet.getStatus()) { case COMPLETED: if (geyser.getConfig().getRemote().getAuthType() != AuthType.ONLINE) { - session.authenticate(session.getAuthData().getName()); - } else if (!couldLoginUserByName(session.getAuthData().getName())) { + session.authenticate(session.getAuthData().name()); + } else if (!couldLoginUserByName(session.getAuthData().name())) { // We must spawn the white world session.connect(); } - geyser.getLogger().info(GeyserLocale.getLocaleStringLog("geyser.network.connect", session.getAuthData().getName())); + geyser.getLogger().info(GeyserLocale.getLocaleStringLog("geyser.network.connect", session.getAuthData().name())); break; case SEND_PACKS: @@ -188,7 +188,7 @@ public class UpstreamPacketHandler extends LoggingPacketHandler { GeyserConfiguration.IUserAuthenticationInfo info = geyser.getConfig().getUserAuths().get(bedrockUsername); if (info != null) { - geyser.getLogger().info(GeyserLocale.getLocaleStringLog("geyser.auth.stored_credentials", session.getAuthData().getName())); + geyser.getLogger().info(GeyserLocale.getLocaleStringLog("geyser.auth.stored_credentials", session.getAuthData().name())); session.setMicrosoftAccount(info.isMicrosoftAccount()); session.authenticate(info.getEmail(), info.getPassword()); return true; 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 e74d15001..6f9e766a0 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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, GeyserSession session) { + public

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

translator, P packet) { + private

void translate0(GeyserSessionImpl 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 cd5ad17ce..7cdb85838 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import javax.annotation.ParametersAreNullableByDefault; @ParametersAreNullableByDefault public record ParticleMapping(LevelEventType levelEventType, String identifier) { - public int getParticleId(GeyserSession session) { + public int getParticleId(GeyserSessionImpl 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 3dc416c6c..be7ca3c84 100644 --- a/core/src/main/java/org/geysermc/geyser/scoreboard/Scoreboard.java +++ b/core/src/main/java/org/geysermc/geyser/scoreboard/Scoreboard.java @@ -32,10 +32,10 @@ import com.nukkitx.protocol.bedrock.packet.SetDisplayObjectivePacket; import com.nukkitx.protocol.bedrock.packet.SetScorePacket; import lombok.Getter; import org.geysermc.geyser.GeyserImpl; -import org.geysermc.geyser.api.logger.GeyserLogger; +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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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 GeyserSession session; + private final GeyserSessionImpl 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(GeyserSession session) { + public Scoreboard(GeyserSessionImpl 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 2f817a918..4f4cd8601 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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 (GeyserSession session : sessions) { + for (GeyserSessionImpl 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 (GeyserSession session : sessions) { + for (GeyserSessionImpl session : sessions) { WorldCache worldCache = session.getWorldCache(); ScoreboardSession scoreboardSession = worldCache.getScoreboardSession(); @@ -118,7 +118,7 @@ public final class ScoreboardUpdater extends Thread { FIRST_SCORE_PACKETS_PER_SECOND_THRESHOLD; geyser.getLogger().info( - GeyserLocale.getLocaleStringLog("geyser.scoreboard.updater.threshold_reached.log", session.getName(), threshold, pps) + + GeyserLocale.getLocaleStringLog("geyser.scoreboard.updater.threshold_reached.log", session.name(), threshold, pps) + GeyserLocale.getLocaleStringLog("geyser.scoreboard.updater.threshold_reached", (millisBetweenUpdates / 1000.0)) ); @@ -172,7 +172,7 @@ public final class ScoreboardUpdater extends Thread { @RequiredArgsConstructor @Getter public static final class ScoreboardSession { - private final GeyserSession session; + private final GeyserSessionImpl 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/GeyserSession.java b/core/src/main/java/org/geysermc/geyser/session/GeyserSessionImpl.java similarity index 97% rename from core/src/main/java/org/geysermc/geyser/session/GeyserSession.java rename to core/src/main/java/org/geysermc/geyser/session/GeyserSessionImpl.java index cf5f5c6af..7a93a2653 100644 --- a/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java +++ b/core/src/main/java/org/geysermc/geyser/session/GeyserSessionImpl.java @@ -76,6 +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.geyser.command.CommandSender; import org.geysermc.geyser.entity.InteractiveTagManager; import org.geysermc.geyser.session.auth.AuthType; @@ -120,7 +121,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; @Getter -public class GeyserSession implements CommandSender { +public class GeyserSessionImpl implements GeyserSession, CommandSender { private final GeyserImpl geyser; private final UpstreamSession upstream; @@ -226,7 +227,7 @@ public class GeyserSession implements CommandSender { /** * Stores a list of all lectern locations and their block entity tags. - * See {@link WorldManager#getLecternDataAt(GeyserSession, int, int, int, boolean)} + * See {@link WorldManager#getLecternDataAt(GeyserSessionImpl, int, int, int, boolean)} * for more information. */ private final Set lecternCache; @@ -458,7 +459,7 @@ public class GeyserSession implements CommandSender { private MinecraftProtocol protocol; - public GeyserSession(GeyserImpl geyser, BedrockServerSession bedrockServerSession, EventLoop eventLoop) { + public GeyserSessionImpl(GeyserImpl geyser, BedrockServerSession bedrockServerSession, EventLoop eventLoop) { this.geyser = geyser; this.upstream = new UpstreamSession(bedrockServerSession); this.eventLoop = eventLoop; @@ -579,7 +580,7 @@ public class GeyserSession implements CommandSender { } else { geyser.getLogger().info(GeyserLocale.getLocaleStringLog("geyser.auth.login.floodgate")); } - authenticate(authData.getName()); + authenticate(authData.name()); } } @@ -658,7 +659,7 @@ public class GeyserSession implements CommandSender { */ public void authenticateWithMicrosoftCode() { if (loggedIn) { - geyser.getLogger().severe(GeyserLocale.getLocaleStringLog("geyser.auth.already_loggedin", getAuthData().getName())); + geyser.getLogger().severe(GeyserLocale.getLocaleStringLog("geyser.auth.already_loggedin", getAuthData().name())); return; } @@ -771,8 +772,8 @@ public class GeyserSession implements CommandSender { encryptedData = cipher.encryptFromString(BedrockData.of( clientData.getGameVersion(), - authData.getName(), - authData.getXuid(), + authData.name(), + authData.xuid(), clientData.getDeviceOs().ordinal(), clientData.getLanguageCode(), clientData.getUiProfile().ordinal(), @@ -822,18 +823,18 @@ public class GeyserSession implements CommandSender { if (downstream instanceof LocalSession) { // Connected directly to the server geyser.getLogger().info(GeyserLocale.getLocaleStringLog("geyser.network.remote.connect_internal", - authData.getName(), protocol.getProfile().getName())); + authData.name(), protocol.getProfile().getName())); } else { // Connected to an IP address geyser.getLogger().info(GeyserLocale.getLocaleStringLog("geyser.network.remote.connect", - authData.getName(), protocol.getProfile().getName(), remoteAddress)); + authData.name(), protocol.getProfile().getName(), remoteAddress)); } UUID uuid = protocol.getProfile().getId(); if (uuid == null) { // Set what our UUID *probably* is going to be if (remoteAuthType == AuthType.FLOODGATE) { - uuid = new UUID(0, Long.parseLong(authData.getXuid())); + uuid = new UUID(0, Long.parseLong(authData.xuid())); } else { uuid = UUID.nameUUIDFromBytes(("OfflinePlayer:" + protocol.getProfile().getName()).getBytes(StandardCharsets.UTF_8)); } @@ -887,9 +888,9 @@ public class GeyserSession implements CommandSender { } if (downstream instanceof LocalSession) { - geyser.getLogger().info(GeyserLocale.getLocaleStringLog("geyser.network.remote.disconnect_internal", authData.getName(), disconnectMessage)); + geyser.getLogger().info(GeyserLocale.getLocaleStringLog("geyser.network.remote.disconnect_internal", authData.name(), disconnectMessage)); } else { - geyser.getLogger().info(GeyserLocale.getLocaleStringLog("geyser.network.remote.disconnect", authData.getName(), remoteAddress, disconnectMessage)); + geyser.getLogger().info(GeyserLocale.getLocaleStringLog("geyser.network.remote.disconnect", authData.name(), remoteAddress, disconnectMessage)); } if (cause != null) { cause.printStackTrace(); @@ -901,7 +902,7 @@ public class GeyserSession implements CommandSender { @Override public void packetReceived(PacketReceivedEvent event) { Packet packet = event.getPacket(); - Registries.JAVA_PACKET_TRANSLATORS.translate(packet.getClass(), packet, GeyserSession.this); + Registries.JAVA_PACKET_TRANSLATORS.translate(packet.getClass(), packet, GeyserSessionImpl.this); } @Override @@ -951,7 +952,7 @@ public class GeyserSession implements CommandSender { try { runnable.run(); } catch (Throwable e) { - geyser.getLogger().error("Error thrown in " + getName() + "'s event loop!", e); + geyser.getLogger().error("Error thrown in " + this.name() + "'s event loop!", e); } }); } @@ -964,7 +965,7 @@ public class GeyserSession implements CommandSender { try { runnable.run(); } catch (Throwable e) { - geyser.getLogger().error("Error thrown in " + getName() + "'s event loop!", e); + geyser.getLogger().error("Error thrown in " + this.name() + "'s event loop!", e); } }, duration, timeUnit); } @@ -1104,8 +1105,18 @@ public class GeyserSession implements CommandSender { } @Override - public String getName() { - return authData.getName(); + public String name() { + return authData.name(); + } + + @Override + public UUID uuid() { + return authData.uuid(); + } + + @Override + public String xuid() { + return authData.xuid(); } @Override @@ -1452,7 +1463,7 @@ public class GeyserSession implements CommandSender { public void refreshEmotes(List emotes) { this.emotes.addAll(emotes); - for (GeyserSession player : geyser.getSessionManager().getSessions().values()) { + for (GeyserSessionImpl 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 c5f30d3b2..e70015b81 100644 --- a/core/src/main/java/org/geysermc/geyser/session/SessionManager.java +++ b/core/src/main/java/org/geysermc/geyser/session/SessionManager.java @@ -28,7 +28,6 @@ package org.geysermc.geyser.session; import com.google.common.collect.ImmutableList; import lombok.AccessLevel; import lombok.Getter; -import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.text.GeyserLocale; import java.util.*; @@ -39,29 +38,29 @@ 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(GeyserSession session) { + public void addPendingSession(GeyserSessionImpl session) { pendingSessions.add(session); } /** * Called once a player has successfully logged into their Java server. */ - public void addSession(UUID uuid, GeyserSession session) { + public void addSession(UUID uuid, GeyserSessionImpl session) { pendingSessions.remove(session); sessions.put(uuid, session); } - public void removeSession(GeyserSession session) { + public void removeSession(GeyserSessionImpl session) { if (sessions.remove(session.getPlayerEntity().getUuid()) == null) { // Session was likely pending pendingSessions.remove(session); @@ -71,16 +70,16 @@ public final class SessionManager { /** * Creates a new, immutable list containing all pending and active sessions. */ - public Collection 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 (GeyserSession session : sessions) { + Collection sessions = getAllSessions(); + for (GeyserSessionImpl session : sessions) { session.disconnect(GeyserLocale.getPlayerLocaleString(message, session.getLocale())); } } diff --git a/core/src/main/java/org/geysermc/geyser/session/auth/AuthData.java b/core/src/main/java/org/geysermc/geyser/session/auth/AuthData.java index eb142eec6..d48cf3889 100644 --- a/core/src/main/java/org/geysermc/geyser/session/auth/AuthData.java +++ b/core/src/main/java/org/geysermc/geyser/session/auth/AuthData.java @@ -26,20 +26,12 @@ package org.geysermc.geyser.session.auth; import com.fasterxml.jackson.databind.JsonNode; -import lombok.Getter; -import lombok.RequiredArgsConstructor; import org.geysermc.geyser.GeyserImpl; import java.util.UUID; -@RequiredArgsConstructor -public class AuthData { - @Getter private final String name; - @Getter private final UUID uuid; - @Getter private final String xuid; - - private final JsonNode certChainData; - private final String clientData; +public record AuthData(String name, UUID uuid, String xuid, + JsonNode certChainData, String clientData) { public void upload(GeyserImpl geyser) { // we can't upload the skin in LoginEncryptionUtil since the global server would return 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 b6dde975c..d99f963ad 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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 GeyserSession session; + private final GeyserSessionImpl session; - public AdvancementsCache(GeyserSession session) { + public AdvancementsCache(GeyserSessionImpl 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 faaeafdb9..55ed10df4 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; /** * Manages updating the current writable book. @@ -37,7 +37,7 @@ import org.geysermc.geyser.session.GeyserSession; * book packets. Because of this, we need to ensure packets are only send every second or so at maximum. */ public class BookEditCache { - private final GeyserSession session; + private final GeyserSessionImpl session; @Setter private ServerboundEditBookPacket packet; /** @@ -45,7 +45,7 @@ public class BookEditCache { */ private long lastBookUpdate; - public BookEditCache(GeyserSession session) { + public BookEditCache(GeyserSessionImpl 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 9595a3daf..842be51d6 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import org.geysermc.geyser.translator.text.MessageTranslator; @AllArgsConstructor public class BossBar { - private final GeyserSession session; + private final GeyserSessionImpl 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 522c00d2a..eda21b9ce 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session) { + public ChunkCache(GeyserSessionImpl 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 eb1bc6e9a..48b05fd70 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session) { + public EntityCache(GeyserSessionImpl 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 6f7d180de..e3e5f3b7c 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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 GeyserSession session; + private final GeyserSessionImpl 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 05e59a5bb..a0809e590 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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 GeyserSession session; + private final GeyserSessionImpl 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(GeyserSession session) { + public PistonCache(GeyserSessionImpl 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 534045f81..a2a9a6c1c 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import org.geysermc.geyser.util.CooldownUtils; @Getter public class PreferencesCache { - private final GeyserSession session; + private final GeyserSessionImpl 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(GeyserSession session) { + public PreferencesCache(GeyserSessionImpl 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 GeyserSession#reducedDebugInfo} is enabled + * {@link GeyserSessionImpl#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 5c486af49..ac99623b5 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import javax.annotation.Nonnull; import java.util.Collections; @@ -114,9 +114,9 @@ public class WorldBorder { */ private long lastUpdatedWorldBorderTime = 0; - private final GeyserSession session; + private final GeyserSessionImpl session; - public WorldBorder(GeyserSession session) { + public WorldBorder(GeyserSessionImpl 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(GeyserSession session, String... fogNameSpaces) { + public static void sendFog(GeyserSessionImpl 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(GeyserSession session) { + public static void removeFog(GeyserSessionImpl 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 a9564b157..59fe70ab2 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import org.geysermc.geyser.scoreboard.Scoreboard; import org.geysermc.geyser.scoreboard.ScoreboardUpdater.ScoreboardSession; @Getter public class WorldCache { - private final GeyserSession session; + private final GeyserSessionImpl session; private final ScoreboardSession scoreboardSession; private Scoreboard scoreboard; @Setter private Difficulty difficulty = Difficulty.EASY; - public WorldCache(GeyserSession session) { + public WorldCache(GeyserSessionImpl 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 d07e06597..792adb654 100644 --- a/core/src/main/java/org/geysermc/geyser/skin/FloodgateSkinUploader.java +++ b/core/src/main/java/org/geysermc/geyser/skin/FloodgateSkinUploader.java @@ -31,8 +31,8 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ObjectNode; import lombok.Getter; import org.geysermc.geyser.GeyserImpl; -import org.geysermc.geyser.api.logger.GeyserLogger; -import org.geysermc.geyser.session.GeyserSession; +import org.geysermc.geyser.GeyserLogger; +import org.geysermc.geyser.session.GeyserSessionImpl; import org.geysermc.geyser.Constants; import org.geysermc.geyser.util.PluginMessageUtils; import org.geysermc.floodgate.util.WebsocketEventType; @@ -111,11 +111,11 @@ public final class FloodgateSkinUploader { } String xuid = node.get("xuid").asText(); - GeyserSession session = geyser.getPlayerByXuid(xuid); + GeyserSessionImpl session = geyser.sessionByXuid(xuid); if (session != null) { if (!node.get("success").asBoolean()) { - logger.info("Failed to upload skin for " + session.getName()); + logger.info("Failed to upload skin for " + session.name()); return; } 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 454456800..58721bb1c 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, PlayerEntity playerEntity) { + public static PlayerListPacket.Entry buildCachedEntry(GeyserSessionImpl 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,10 +74,10 @@ public class SkinManager { /** * With all the information needed, build a Bedrock player entry with translated skin information. */ - public static PlayerListPacket.Entry buildEntryManually(GeyserSession session, UUID uuid, String username, long geyserId, - String skinId, byte[] skinData, - String capeId, byte[] capeData, - SkinProvider.SkinGeometry geometry) { + public static PlayerListPacket.Entry buildEntryManually(GeyserSessionImpl session, UUID uuid, String username, long geyserId, + String skinId, byte[] skinData, + String capeId, byte[] capeData, + SkinProvider.SkinGeometry geometry) { SerializedSkin serializedSkin = SerializedSkin.of( skinId, "", geometry.getGeometryName(), ImageData.of(skinData), Collections.emptyList(), ImageData.of(capeData), geometry.getGeometryData(), "", true, false, @@ -86,10 +86,10 @@ public class SkinManager { // This attempts to find the XUID of the player so profile images show up for Xbox accounts String xuid = ""; - GeyserSession playerSession = GeyserImpl.getInstance().getPlayerByUuid(uuid); + GeyserSessionImpl playerSession = GeyserImpl.getInstance().sessionByUuid(uuid); if (playerSession != null) { - xuid = playerSession.getAuthData().getXuid(); + xuid = playerSession.getAuthData().xuid(); } PlayerListPacket.Entry entry; @@ -97,7 +97,7 @@ public class SkinManager { // If we are building a PlayerListEntry for our own session we use our AuthData UUID instead of the Java UUID // as Bedrock expects to get back its own provided UUID if (session.getPlayerEntity().getUuid().equals(uuid)) { - entry = new PlayerListPacket.Entry(session.getAuthData().getUuid()); + entry = new PlayerListPacket.Entry(session.getAuthData().uuid()); } else { entry = new PlayerListPacket.Entry(uuid); } @@ -112,7 +112,7 @@ public class SkinManager { return entry; } - public static void requestAndHandleSkinAndCape(PlayerEntity entity, GeyserSession session, + public static void requestAndHandleSkinAndCape(PlayerEntity entity, GeyserSessionImpl 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) { - GeyserSession session = GeyserImpl.getInstance().getPlayerByUuid(profile.getId()); + GeyserSessionImpl session = GeyserImpl.getInstance().sessionByUuid(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 483d0d3e9..5b51d203b 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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)) { - GeyserSession session = GeyserImpl.getInstance().getPlayerByUuid(playerId); + GeyserSessionImpl session = GeyserImpl.getInstance().sessionByUuid(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 100f06caf..c42b9522d 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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, GeyserSession session, + public static void requestAndHandleSkin(PlayerEntity entity, GeyserSessionImpl 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 964faab0a..53fc0649f 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, int x, int y, int z, BoundingBox playerCollision) { + public boolean correctPosition(GeyserSessionImpl 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 3c858dc92..4379c68b1 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import org.geysermc.geyser.level.physics.BoundingBox; @EqualsAndHashCode(callSuper = true) @@ -59,7 +59,7 @@ public class DoorCollision extends BlockCollision { } @Override - public boolean correctPosition(GeyserSession session, int x, int y, int z, BoundingBox playerCollision) { + public boolean correctPosition(GeyserSessionImpl 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 fddc2e39b..72f525151 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import org.geysermc.geyser.level.physics.BoundingBox; /** @@ -40,7 +40,7 @@ public class ScaffoldingCollision extends BlockCollision { } @Override - public boolean correctPosition(GeyserSession session, int x, int y, int z, BoundingBox playerCollision) { + public boolean correctPosition(GeyserSessionImpl 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 912d6a9b9..39250282a 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import org.geysermc.geyser.level.physics.BoundingBox; @EqualsAndHashCode(callSuper = true) @@ -61,7 +61,7 @@ public class SnowCollision extends BlockCollision { } @Override - public boolean correctPosition(GeyserSession session, int x, int y, int z, BoundingBox playerCollision) { + public boolean correctPosition(GeyserSessionImpl 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 49b9f6c3f..f0d312b35 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, int x, int y, int z, BoundingBox playerCollision) { + public boolean correctPosition(GeyserSessionImpl 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 d34f5195c..525dfaf3e 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, Inventory inventory) { + public void prepareInventory(GeyserSessionImpl session, Inventory inventory) { holder.prepareInventory(this, session, inventory); } @Override - public void openInventory(GeyserSession session, Inventory inventory) { + public void openInventory(GeyserSessionImpl session, Inventory inventory) { holder.openInventory(this, session, inventory); } @Override - public void closeInventory(GeyserSession session, Inventory inventory) { + public void closeInventory(GeyserSessionImpl session, Inventory inventory) { holder.closeInventory(this, session, inventory); } @Override - public void updateInventory(GeyserSession session, Inventory inventory) { + public void updateInventory(GeyserSessionImpl session, Inventory inventory) { updater.updateInventory(this, session, inventory); } @Override - public void updateSlot(GeyserSession session, Inventory inventory, int slot) { + public void updateSlot(GeyserSessionImpl 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 b7aaad7b1..486c500de 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, Inventory inventory, int key, int value) { + public void updateProperty(GeyserSessionImpl 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 becca359b..f1db5e77c 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, Inventory inventory, int key, int value) { + public void updateProperty(GeyserSessionImpl 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 f0820d9e8..f7e6ebe37 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session) { + protected boolean checkInteractionPosition(GeyserSessionImpl 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, GeyserSession session, Inventory inventory) { + public void openInventory(InventoryTranslator translator, GeyserSessionImpl 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(GeyserSession session, Inventory inventory, int key, int value) { + public void updateProperty(GeyserSessionImpl 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(GeyserSession session, Inventory inventory, ItemStackRequest request) { + public ItemStackResponsePacket.Response translateSpecialRequest(GeyserSessionImpl 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 43bea55ab..03c0ef224 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, Inventory inventory) { + public void openInventory(GeyserSessionImpl 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(GeyserSession session, Inventory inventory, int key, int value) { + public void updateProperty(GeyserSessionImpl 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 08caa7784..b4dd3048a 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, Inventory inventory, ContainerSlotType bedrockSourceContainer, + public boolean shouldRejectItemPlace(GeyserSessionImpl 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 f18a902ff..dd8b22fad 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, Inventory inventory, int key, int value) { + public void updateProperty(GeyserSessionImpl 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(GeyserSession session, Inventory inventory, ItemStackRequest request) { + public ItemStackResponsePacket.Response translateSpecialRequest(GeyserSessionImpl 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 4265b39e3..2119a8aed 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, Inventory inventory) { + public void openInventory(GeyserSessionImpl 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 5ddd12702..0e5fbbd90 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(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 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 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(GeyserSession session, Inventory inventory, ContainerSlotType bedrockSourceContainer, + public boolean shouldRejectItemPlace(GeyserSessionImpl 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(GeyserSession session, Inventory inventory, ItemStackRequest request) { + public ItemStackResponsePacket.Response translateSpecialRequest(GeyserSessionImpl session, Inventory inventory, ItemStackRequest request) { return rejectRequest(request); } - public void translateRequests(GeyserSession session, Inventory inventory, List requests) { + public void translateRequests(GeyserSessionImpl 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(GeyserSession session, Inventory inventory, ItemStackRequest request) { + public ItemStackResponsePacket.Response translateRequest(GeyserSessionImpl session, Inventory inventory, ItemStackRequest request) { ClickPlan plan = new ClickPlan(session, this, inventory); IntSet affectedSlots = new IntOpenHashSet(); for (StackRequestActionData action : request.getActions()) { @@ -203,7 +203,7 @@ public abstract class InventoryTranslator { return rejectRequest(request, false); } if (session.getGeyser().getConfig().isDebugMode()) { - session.getGeyser().getLogger().error("DEBUG: About to reject TAKE/PLACE request made by " + session.getName()); + session.getGeyser().getLogger().error("DEBUG: About to reject TAKE/PLACE request made by " + session.name()); dumpStackRequestDetails(session, inventory, transferAction.getSource(), transferAction.getDestination()); } return rejectRequest(request); @@ -289,7 +289,7 @@ public abstract class InventoryTranslator { SwapStackRequestActionData swapAction = (SwapStackRequestActionData) action; if (!(checkNetId(session, inventory, swapAction.getSource()) && checkNetId(session, inventory, swapAction.getDestination()))) { if (session.getGeyser().getConfig().isDebugMode()) { - session.getGeyser().getLogger().error("DEBUG: About to reject SWAP request made by " + session.getName()); + session.getGeyser().getLogger().error("DEBUG: About to reject SWAP request made by " + session.name()); dumpStackRequestDetails(session, inventory, swapAction.getSource(), swapAction.getDestination()); } return rejectRequest(request); @@ -410,7 +410,7 @@ public abstract class InventoryTranslator { return acceptRequest(request, makeContainerEntries(session, inventory, affectedSlots)); } - public ItemStackResponsePacket.Response translateCraftingRequest(GeyserSession session, Inventory inventory, ItemStackRequest request) { + public ItemStackResponsePacket.Response translateCraftingRequest(GeyserSessionImpl 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(GeyserSession session, Inventory inventory, ItemStackRequest request) { + public ItemStackResponsePacket.Response translateAutoCraftingRequest(GeyserSessionImpl 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(GeyserSession session, Inventory inventory, ItemStackRequest request) { + public ItemStackResponsePacket.Response translateCreativeRequest(GeyserSessionImpl 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(GeyserSession session, Inventory inventory, StackRequestSlotInfoData source, StackRequestSlotInfoData destination) { + protected void dumpStackRequestDetails(GeyserSessionImpl 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(GeyserSession session, Inventory inventory, StackRequestSlotInfoData slotInfoData) { + public boolean checkNetId(GeyserSessionImpl 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(GeyserSession session, Inventory inventory, Set affectedSlots) { + public List makeContainerEntries(GeyserSessionImpl 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(GeyserSession session, int bedrockSlot, GeyserItemStack itemStack) { + public static ItemStackResponsePacket.ItemEntry makeItemEntry(GeyserSessionImpl 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 b59914a13..623b9e708 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, Inventory inventory) { + public void prepareInventory(GeyserSessionImpl session, Inventory inventory) { } @Override - public void openInventory(GeyserSession session, Inventory inventory) { + public void openInventory(GeyserSessionImpl session, Inventory inventory) { } @Override - public void closeInventory(GeyserSession session, Inventory inventory) { + public void closeInventory(GeyserSessionImpl session, Inventory inventory) { } @Override - public void updateProperty(GeyserSession session, Inventory inventory, int key, int value) { + public void updateProperty(GeyserSessionImpl 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(GeyserSession session, Inventory inventory) { + public void updateInventory(GeyserSessionImpl 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(GeyserSession session, Inventory inventory, int slot) { + public void updateSlot(GeyserSessionImpl 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(GeyserSession session, Inventory inventory, GeyserItemStack book) { + private void updateBook(GeyserSessionImpl 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 d035543bc..fcdf68cd9 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, Inventory inventory, ContainerSlotType bedrockSourceContainer, + public boolean shouldRejectItemPlace(GeyserSessionImpl 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(GeyserSession session, Inventory inventory, ItemStackRequest request) { + public ItemStackResponsePacket.Response translateSpecialRequest(GeyserSessionImpl 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 cf0c475f0..9aaca1893 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, Inventory inventory) { + public void prepareInventory(GeyserSessionImpl 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(GeyserSession session, Inventory inventory) { + public void openInventory(GeyserSessionImpl 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(GeyserSession session, Inventory inventory) { + public void closeInventory(GeyserSessionImpl 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(GeyserSession session, Inventory inventory, ItemStackRequest request) { + public ItemStackResponsePacket.Response translateAutoCraftingRequest(GeyserSessionImpl 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(GeyserSession session, Inventory inventory) { + public void updateInventory(GeyserSessionImpl session, Inventory inventory) { updater.updateInventory(this, session, inventory); } @Override - public void updateSlot(GeyserSession session, Inventory inventory, int slot) { + public void updateSlot(GeyserSessionImpl 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 3a451891c..026bf5be3 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, Inventory inventory) { + public void updateInventory(GeyserSessionImpl session, Inventory inventory) { updateCraftingGrid(session, inventory); InventoryContentPacket inventoryContentPacket = new InventoryContentPacket(); @@ -97,7 +97,7 @@ public class PlayerInventoryTranslator extends InventoryTranslator { * @param session Session of the player * @param inventory Inventory of the player */ - public static void updateCraftingGrid(GeyserSession session, Inventory inventory) { + public static void updateCraftingGrid(GeyserSessionImpl 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(GeyserSession session, Inventory inventory, int slot) { + public void updateSlot(GeyserSessionImpl 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(GeyserSession session, Inventory inventory, ItemStackRequest request) { + public ItemStackResponsePacket.Response translateRequest(GeyserSessionImpl session, Inventory inventory, ItemStackRequest request) { if (session.getGameMode() != GameMode.CREATIVE) { return super.translateRequest(session, inventory, request); } @@ -353,7 +353,7 @@ public class PlayerInventoryTranslator extends InventoryTranslator { } } default -> { - session.getGeyser().getLogger().error("Unknown crafting state induced by " + session.getName()); + session.getGeyser().getLogger().error("Unknown crafting state induced by " + session.name()); return rejectRequest(request); } } @@ -365,7 +365,7 @@ public class PlayerInventoryTranslator extends InventoryTranslator { } @Override - public ItemStackResponsePacket.Response translateCreativeRequest(GeyserSession session, Inventory inventory, ItemStackRequest request) { + public ItemStackResponsePacket.Response translateCreativeRequest(GeyserSessionImpl 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(GeyserSession session, Inventory inventory, int slot) { + private static void sendCreativeAction(GeyserSessionImpl 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(GeyserSession session, Inventory inventory) { + public void prepareInventory(GeyserSessionImpl session, Inventory inventory) { } @Override - public void openInventory(GeyserSession session, Inventory inventory) { + public void openInventory(GeyserSessionImpl session, Inventory inventory) { } @Override - public void closeInventory(GeyserSession session, Inventory inventory) { + public void closeInventory(GeyserSessionImpl session, Inventory inventory) { } @Override - public void updateProperty(GeyserSession session, Inventory inventory, int key, int value) { + public void updateProperty(GeyserSessionImpl 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 f92474fb3..67d1a3989 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, Vector3i position, Inventory inventory, int javaBlockState) { + protected void setCustomName(GeyserSessionImpl 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 ed1f38799..816a32634 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, Inventory inventory, ItemStackRequest request) { + public ItemStackResponsePacket.Response translateSpecialRequest(GeyserSessionImpl 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 417aa5bf3..94a7c624c 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, Inventory inventory, ContainerSlotType bedrockSourceContainer, + public boolean shouldRejectItemPlace(GeyserSessionImpl 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(GeyserSession session, Inventory inventory) { + public void updateInventory(GeyserSessionImpl session, Inventory inventory) { updater.updateInventory(this, session, inventory); } @Override - public void updateSlot(GeyserSession session, Inventory inventory, int slot) { + public void updateSlot(GeyserSessionImpl 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 a42001d34..448fb3df7 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, Inventory inventory) { + public void prepareInventory(GeyserSessionImpl 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(GeyserSession session, Inventory inventory) { + public void openInventory(GeyserSessionImpl 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(GeyserSession session, Inventory inventory) { + public void closeInventory(GeyserSessionImpl 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 86696b21b..a7e3b8ec7 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, Inventory inventory) { + public void prepareInventory(GeyserSessionImpl session, Inventory inventory) { holder.prepareInventory(this, session, inventory); } @Override - public void openInventory(GeyserSession session, Inventory inventory) { + public void openInventory(GeyserSessionImpl session, Inventory inventory) { holder.openInventory(this, session, inventory); } @Override - public void closeInventory(GeyserSession session, Inventory inventory) { + public void closeInventory(GeyserSessionImpl 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 de7ea4de7..f40586753 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, Inventory inventory, int key, int value) { + public void updateProperty(GeyserSessionImpl 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 b4c49cb12..689cb0a9d 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, Inventory inventory) { + public void prepareInventory(GeyserSessionImpl session, Inventory inventory) { } @Override - public void openInventory(GeyserSession session, Inventory inventory) { + public void openInventory(GeyserSessionImpl session, Inventory inventory) { } @Override - public void closeInventory(GeyserSession session, Inventory inventory) { + public void closeInventory(GeyserSessionImpl session, Inventory inventory) { } @Override - public void updateInventory(GeyserSession session, Inventory inventory) { + public void updateInventory(GeyserSessionImpl session, Inventory inventory) { updater.updateInventory(this, session, inventory); } @Override - public void updateSlot(GeyserSession session, Inventory inventory, int slot) { + public void updateSlot(GeyserSessionImpl 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 79f34da57..8866af56e 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import org.geysermc.geyser.inventory.BedrockContainerSlot; import java.util.Arrays; @@ -85,7 +85,7 @@ public abstract class ChestedHorseInventoryTranslator extends AbstractHorseInven } @Override - public void updateInventory(GeyserSession session, Inventory inventory) { + public void updateInventory(GeyserSessionImpl 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 046db67c9..427b70a65 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ItemStack stack) { + public static ItemData translateToBedrock(GeyserSessionImpl 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(GeyserSession session, CompoundTag tag, ItemMapping mapping) { + public static CompoundTag translateDisplayProperties(GeyserSessionImpl 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(GeyserSession session, CompoundTag tag, ItemMapping mapping, char translationColor) { + public static CompoundTag translateDisplayProperties(GeyserSessionImpl 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 6c2c501fd..c9c4dc5d4 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, CompoundTag itemTag, ItemMapping mapping) { + public void translateToBedrock(GeyserSessionImpl 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 071ead230..418023766 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, CompoundTag itemTag, ItemMapping mapping) { + public void translateToBedrock(GeyserSessionImpl 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 10ad58544..83279671e 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, CompoundTag itemTag, ItemMapping mapping) { + public void translateToBedrock(GeyserSessionImpl 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 b3371aab7..d24018287 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, CompoundTag itemTag, ItemMapping mapping) { + public void translateToBedrock(GeyserSessionImpl 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 e1dda45ed..f74129eab 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, CompoundTag itemTag, ItemMapping mapping) { + public void translateToBedrock(GeyserSessionImpl 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 8a009bc2d..aac5caa92 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, CompoundTag itemTag, ItemMapping mapping) { + public void translateToBedrock(GeyserSessionImpl 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 ddc5f3780..f011c7045 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, CompoundTag itemTag, ItemMapping mapping) { + public void translateToBedrock(GeyserSessionImpl 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 8c1154dea..25b498277 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, CompoundTag itemTag, ItemMapping mapping) { + public void translateToBedrock(GeyserSessionImpl 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 e66589f6d..c1ff272f2 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, CompoundTag itemTag, ItemMapping mapping) { + public void translateToBedrock(GeyserSessionImpl 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 ddf76b595..c66968124 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, CompoundTag itemTag, ItemMapping mapping) { + public void translateToBedrock(GeyserSessionImpl 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 924735626..ca4cd2fcb 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, CompoundTag itemTag, ItemMapping mapping) { + public void translateToBedrock(GeyserSessionImpl 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 23739340e..1d96db42a 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, CompoundTag itemTag, ItemMapping mapping) { + public void translateToBedrock(GeyserSessionImpl 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 1e182568a..18ccde054 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, CompoundTag itemTag, ItemMapping mapping) { + public void translateToBedrock(GeyserSessionImpl 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 f4160ec08..4182278d6 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, CompoundTag itemTag, ItemMapping mapping) { + public void translateToBedrock(GeyserSessionImpl 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 316ebc1ae..7c396fd28 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, CompoundTag itemTag, ItemMapping mapping) { + public void translateToBedrock(GeyserSessionImpl 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 6cafb6012..2358b197d 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, CompoundTag codec) { + public static void loadServerBiomes(GeyserSessionImpl session, CompoundTag codec) { Int2IntMap biomeTranslations = session.getBiomeTranslations(); biomeTranslations.clear(); @@ -87,7 +87,7 @@ public class BiomeTranslator { } } - public static BlockStorage toNewBedrockBiome(GeyserSession session, DataPalette biomeData) { + public static BlockStorage toNewBedrockBiome(GeyserSessionImpl 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 bc96a6e0d..af1eea293 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; /** * Implemented only if a block is a block entity in Bedrock and not Java Edition. @@ -46,7 +46,7 @@ public interface BedrockOnlyBlockEntity extends RequiresBlockState { * @param blockState The Java block state. * @param position The Bedrock block position. */ - void updateBlock(GeyserSession session, int blockState, Vector3i position); + void updateBlock(GeyserSessionImpl 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(GeyserSession session, Vector3i position, int blockState) { + static NbtMap getTag(GeyserSessionImpl 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 e41f9e492..9fe087cb9 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, int blockState, Vector3i position) { + public void updateBlock(GeyserSessionImpl 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 b6c498d9f..01d3952a6 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, int blockState, Vector3i position) { + public static NbtMap getTag(GeyserSessionImpl 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(GeyserSession session, int blockState, Vector3i position) { + public void updateBlock(GeyserSessionImpl 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 1d61d0e30..db29afc6f 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, Position position) { + public static void translate(GeyserSessionImpl 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 1363f6641..44d87a70c 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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 GeyserSession session; + private final GeyserSessionImpl 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(GeyserSession session, Vector3i position, Direction orientation, boolean sticky, boolean extended) { + public PistonBlockEntity(GeyserSessionImpl 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 b6b41db6d..6bdc8e16f 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, CompoundTag tag, int posX, int posY, int posZ, int blockState) { + public static void spawnPlayer(GeyserSessionImpl 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(GeyserSession session, GameProfile profile, Vector3i blockPosition, + private static void spawnPlayer(GeyserSessionImpl 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 63bf0a7d9..34fe04a76 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; /** * Represents an event capable of translating itself into bedrock @@ -38,5 +38,5 @@ public interface LevelEventTranslator { * @param session GeyserSession * @param packet the effect packet to handle */ - void translate(GeyserSession session, ClientboundLevelEventPacket packet); + void translate(GeyserSessionImpl 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 df882d0d0..6d976989f 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundLevelEventPacket packet) { + public void translate(GeyserSessionImpl 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 5c3e890a2..b12065744 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; public record SoundEventEventTranslator(SoundEvent soundEvent, String identifier, int extraData) implements LevelEventTranslator { @Override - public void translate(GeyserSession session, ClientboundLevelEventPacket packet) { + public void translate(GeyserSessionImpl 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 48a4bf2fd..b5414bc40 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; public record SoundLevelEventTranslator(LevelEventType levelEventType, int data) implements LevelEventTranslator { @Override - public void translate(GeyserSession session, ClientboundLevelEventPacket packet) { + public void translate(GeyserSessionImpl 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 37485120d..1045e8ef8 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; public abstract class PacketTranslator { - public abstract void translate(GeyserSession session, T packet); + public abstract void translate(GeyserSessionImpl 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 d4de9e22a..5a29d4a24 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, AdventureSettingsPacket packet) { + public void translate(GeyserSessionImpl 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 d52a66be7..b03272a87 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, AnimatePacket packet) { + public void translate(GeyserSessionImpl 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 828f5a934..8c5e449c5 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, BlockEntityDataPacket packet) { + public void translate(GeyserSessionImpl 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 a0bd43455..87a433567 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, BlockPickRequestPacket packet) { + public void translate(GeyserSessionImpl 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 bead427db..3d113d8d3 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, BookEditPacket packet) { + public void translate(GeyserSessionImpl 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 f0cf4ff8c..4f6750444 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, CommandBlockUpdatePacket packet) { + public void translate(GeyserSessionImpl 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 a67b81434..bc25acc16 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, CommandRequestPacket packet) { + public void translate(GeyserSessionImpl 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 4c1f55018..00cf6607c 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ContainerClosePacket packet) { + public void translate(GeyserSessionImpl 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 dac5fe638..1f5ad7c15 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, EmoteListPacket packet) { + public void translate(GeyserSessionImpl 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 732142573..9ea36061e 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, EntityPickRequestPacket packet) { + public void translate(GeyserSessionImpl 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 b7961c8fb..520aa8d93 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, FilterTextPacket packet) { + public void translate(GeyserSessionImpl 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 d779ab339..2ad827b9d 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ItemFrameDropItemPacket packet) { + public void translate(GeyserSessionImpl 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 efa0dabcc..afa9992f9 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ItemStackRequestPacket packet) { + public void translate(GeyserSessionImpl 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 d7e97825c..b6c7a8626 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, LecternUpdatePacket packet) { + public void translate(GeyserSessionImpl 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 788f65134..4297f6d2c 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, MapInfoRequestPacket packet) { + public void translate(GeyserSessionImpl 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 7a077c8b3..fa42a3c39 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, MobEquipmentPacket packet) { + public void translate(GeyserSessionImpl 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 6d971daeb..ff6795d26 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, MoveEntityAbsolutePacket packet) { + public void translate(GeyserSessionImpl 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 9ecce9a57..238ed86aa 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, NetworkStackLatencyPacket packet) { + public void translate(GeyserSessionImpl 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 f3967ddf5..d0bb391d4 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, PacketViolationWarningPacket packet) { + public void translate(GeyserSessionImpl 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 75199ae74..ef394aa8c 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, PlayerInputPacket packet) { + public void translate(GeyserSessionImpl 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 59082ccdc..19c9f702f 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, PositionTrackingDBClientRequestPacket packet) { + public void translate(GeyserSessionImpl 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 59712da7f..e3f259394 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, RespawnPacket packet) { + public void translate(GeyserSessionImpl 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 1840c9b0d..281cbb085 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ServerSettingsRequestPacket packet) { + public void translate(GeyserSessionImpl 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 bc6d1f4e4..e81b8f30f 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, SetLocalPlayerAsInitializedPacket packet) { + public void translate(GeyserSessionImpl 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 19797b8a2..719cf190c 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ShowCreditsPacket packet) { + public void translate(GeyserSessionImpl 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 3cf121cf9..a1fbe6622 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, TextPacket packet) { + public void translate(GeyserSessionImpl 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 775ec15b5..88f44a719 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, EntityEventPacket packet) { + public void translate(GeyserSessionImpl 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 711285948..58c4b7822 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, PlayerActionPacket packet) { + public void translate(GeyserSessionImpl 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 a4fe12d4e..62f0dddcf 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, EmotePacket packet) { + public void translate(GeyserSessionImpl 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 (GeyserSession otherSession : session.getGeyser().getSessionManager().getSessions().values()) { + for (GeyserSessionImpl 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(GeyserSession otherSession, long javaId, String emoteId) { + private void playEmote(GeyserSessionImpl 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 26a25725e..a32d9808f 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, InteractPacket packet) { + public void translate(GeyserSessionImpl 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 98dd7832c..ecf0b2225 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -47,7 +47,7 @@ public class BedrockMovePlayerTranslator extends PacketTranslator 300) { - session.getGeyser().getLogger().debug(ChatColor.RED + session.getName() + " moved too quickly." + + session.getGeyser().getLogger().debug(ChatColor.RED + session.name() + " moved too quickly." + " current position: " + currentPosition + ", new position: " + newPosition); return false; diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/BedrockRiderJumpTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/BedrockRiderJumpTranslator.java index 79911b5e7..f6c580b2e 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/BedrockRiderJumpTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/BedrockRiderJumpTranslator.java @@ -30,14 +30,14 @@ import com.github.steveice10.mc.protocol.packet.ingame.serverbound.player.Server import com.nukkitx.protocol.bedrock.packet.RiderJumpPacket; import org.geysermc.geyser.entity.type.Entity; import org.geysermc.geyser.entity.type.living.animal.horse.AbstractHorseEntity; -import org.geysermc.geyser.session.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @Translator(packet = RiderJumpPacket.class) public class BedrockRiderJumpTranslator extends PacketTranslator { @Override - public void translate(GeyserSession session, RiderJumpPacket packet) { + public void translate(GeyserSessionImpl 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 b149f8836..f57d7957a 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, SetPlayerGameTypePacket packet) { + public void translate(GeyserSessionImpl 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 2ac8587bf..9969e55f4 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, LevelSoundEventPacket packet) { + public void translate(GeyserSessionImpl 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 8f4e93635..eb3b52040 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundAwardStatsPacket packet) { + public void translate(GeyserSessionImpl 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 2c49baa56..c15ea56dd 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundBossEventPacket packet) { + public void translate(GeyserSessionImpl 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 e0c3a9b95..9aa747187 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundChangeDifficultyPacket packet) { + public void translate(GeyserSessionImpl 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 ca8be2374..93daa4c45 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.translator.text.MessageTranslator; @@ -36,11 +36,11 @@ import org.geysermc.geyser.translator.text.MessageTranslator; public class JavaChatTranslator extends PacketTranslator { @Override - public void translate(GeyserSession session, ClientboundChatPacket packet) { + public void translate(GeyserSessionImpl session, ClientboundChatPacket packet) { TextPacket textPacket = new TextPacket(); textPacket.setPlatformChatId(""); textPacket.setSourceName(""); - textPacket.setXuid(session.getAuthData().getXuid()); + textPacket.setXuid(session.getAuthData().xuid()); textPacket.setType(switch (packet.getType()) { case CHAT -> TextPacket.Type.CHAT; case SYSTEM -> TextPacket.Type.SYSTEM; 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 d0ab68d8f..feef811e4 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundCustomQueryPacket packet) { + public void translate(GeyserSessionImpl 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 e073e6f27..4822d8b4a 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundDisconnectPacket packet) { + public void translate(GeyserSessionImpl 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 307c27c29..833dfe732 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundGameProfilePacket packet) { + public void translate(GeyserSessionImpl 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 680debe49..208768ff8 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundKeepAlivePacket packet) { + public void translate(GeyserSessionImpl 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 ce5fabe30..531d4a791 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundLoginDisconnectPacket packet) { + public void translate(GeyserSessionImpl 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 855f5b144..90c21c8d0 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundLoginPacket packet) { + public void translate(GeyserSessionImpl 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 a3b2e34b7..9a1ef7f08 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundPingPacket packet) { + public void translate(GeyserSessionImpl 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 0a329f607..908ac6e4c 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundRecipePacket packet) { + public void translate(GeyserSessionImpl 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 8f97b1a8d..a72a054ef 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundRespawnPacket packet) { + public void translate(GeyserSessionImpl 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 3f82dffb1..5acb35059 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundSelectAdvancementsTabPacket packet) { + public void translate(GeyserSessionImpl 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 c1f6f77d2..be17064f3 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundUpdateAdvancementsPacket packet) { + public void translate(GeyserSessionImpl 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 5c9d84457..59aee47cc 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundUpdateTagsPacket packet) { + public void translate(GeyserSessionImpl 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 d7fc79f1e..98f7172b4 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundAnimatePacket packet) { + public void translate(GeyserSessionImpl 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 1c3239d69..fccfaef41 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundEntityEventPacket packet) { + public void translate(GeyserSessionImpl 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 4f15b0717..ae27b54c2 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundMoveEntityPosRotPacket packet) { + public void translate(GeyserSessionImpl 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 aeb080465..1a93b0ea1 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundMoveEntityPosPacket packet) { + public void translate(GeyserSessionImpl 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 b2b59480b..fa3efc5e1 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundMoveEntityRotPacket packet) { + public void translate(GeyserSessionImpl 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 90e121250..29f3620a9 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundMoveVehiclePacket packet) { + public void translate(GeyserSessionImpl 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 043756db0..1783316ae 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundRemoveEntitiesPacket packet) { + public void translate(GeyserSessionImpl 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 bc78bb33e..8fe9db808 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundRemoveMobEffectPacket packet) { + public void translate(GeyserSessionImpl 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 edcad7af6..3f598dd3b 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundRotateHeadPacket packet) { + public void translate(GeyserSessionImpl 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 987e5fcb2..c63905cd6 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundSetEntityLinkPacket packet) { + public void translate(GeyserSessionImpl 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 5febe4813..da8920c29 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundSetEntityMotionPacket packet) { + public void translate(GeyserSessionImpl 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 0058ed61e..7222d46dd 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundSetEquipmentPacket packet) { + public void translate(GeyserSessionImpl 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 f4a6f94ed..4f9729c5f 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundSetPassengersPacket packet) { + public void translate(GeyserSessionImpl 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 75d7bc976..daf89633f 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundTakeItemEntityPacket packet) { + public void translate(GeyserSessionImpl 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 cbd994d79..d6ebd6efb 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundTeleportEntityPacket packet) { + public void translate(GeyserSessionImpl 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 c3a4e4ac4..7d64a880e 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundUpdateAttributesPacket packet) { + public void translate(GeyserSessionImpl 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 2d4161739..ee53f281b 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundUpdateMobEffectPacket packet) { + public void translate(GeyserSessionImpl 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 6fbdb4fc6..08449c108 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundBlockBreakAckPacket packet) { + public void translate(GeyserSessionImpl 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 98b69a0b8..b409db27a 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundPlayerAbilitiesPacket packet) { + public void translate(GeyserSessionImpl 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 252287edc..ce5f0b798 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundPlayerInfoPacket packet) { + public void translate(GeyserSessionImpl session, ClientboundPlayerInfoPacket packet) { if (packet.getAction() != PlayerListEntryAction.ADD_PLAYER && packet.getAction() != PlayerListEntryAction.REMOVE_PLAYER) return; @@ -102,7 +102,7 @@ public class JavaPlayerInfoTranslator extends PacketTranslator { @Override - public void translate(GeyserSession session, ClientboundPlayerPositionPacket packet) { + public void translate(GeyserSessionImpl 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 dc10bad34..3f7de9126 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundSetCarriedItemPacket packet) { + public void translate(GeyserSessionImpl 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 3ac9bf9e3..794755833 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundSetExperiencePacket packet) { + public void translate(GeyserSessionImpl 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 8e96ed42e..40a6d38e5 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundSetHealthPacket packet) { + public void translate(GeyserSessionImpl 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 b80b59ff4..d1ccd7b1b 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundAddEntityPacket packet) { + public void translate(GeyserSessionImpl 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 33e230c14..1774ec934 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundAddExperienceOrbPacket packet) { + public void translate(GeyserSessionImpl 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 e6b82f365..a466969aa 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundAddMobPacket packet) { + public void translate(GeyserSessionImpl 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 433d78477..17e4a800e 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundAddPaintingPacket packet) { + public void translate(GeyserSessionImpl 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 74dcaf022..8dbdf81e9 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundAddPlayerPacket packet) { + public void translate(GeyserSessionImpl 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 9a4ff8f26..e12f2ee8d 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundContainerClosePacket packet) { + public void translate(GeyserSessionImpl 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 0d572ca92..3d3255768 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundContainerSetContentPacket packet) { + public void translate(GeyserSessionImpl 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 2ffab0d38..92cfe9619 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundContainerSetDataPacket packet) { + public void translate(GeyserSessionImpl 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 54cc91ca6..43d55c47a 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundContainerSetSlotPacket packet) { + public void translate(GeyserSessionImpl 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(GeyserSession session, ClientboundMerchantOffersPacket packet) { + public void translate(GeyserSessionImpl 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(GeyserSession session, ClientboundOpenScreenPacket packet) { + public void translate(GeyserSessionImpl 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 65db15d83..f14d05be6 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundBlockDestructionPacket packet) { + public void translate(GeyserSessionImpl 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 1c11b298e..1d999542f 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundBlockEntityDataPacket packet) { + public void translate(GeyserSessionImpl 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 3504168a5..a46524010 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundBlockEventPacket packet) { + public void translate(GeyserSessionImpl 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 298bd4b90..7bebcd11f 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundBlockUpdatePacket packet) { + public void translate(GeyserSessionImpl 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(GeyserSession session, ClientboundCustomSoundPacket packet) { + public void translate(GeyserSessionImpl 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 d97035b5c..f07c19fa3 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundExplodePacket packet) { + public void translate(GeyserSessionImpl 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 8204ceea5..967edbcf4 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundForgetLevelChunkPacket packet) { + public void translate(GeyserSessionImpl 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 642f707a8..cd1b5f37d 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundGameEventPacket packet) { + public void translate(GeyserSessionImpl 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 4a749c6d3..006620cad 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundLevelChunkWithLightPacket packet) { + public void translate(GeyserSessionImpl 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 d861d0338..366a4c94c 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundLevelEventPacket packet) { + public void translate(GeyserSessionImpl 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 7cbdc2a4b..4f4251750 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundLevelParticlesPacket packet) { + public void translate(GeyserSessionImpl 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(GeyserSession session, Particle particle) { + private Function createParticle(GeyserSessionImpl 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 c5b296f4f..ed9aceac2 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundMapItemDataPacket packet) { + public void translate(GeyserSessionImpl 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 c301ee462..d1cc3704e 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundSectionBlocksUpdatePacket packet) { + public void translate(GeyserSessionImpl 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 901a4d82e..8f1147cb3 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundSetChunkCacheCenterPacket packet) { + public void translate(GeyserSessionImpl 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 50ed540ea..919f860df 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundSetChunkCacheRadiusPacket packet) { + public void translate(GeyserSessionImpl 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 8067341e1..e38cf00fd 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundSetDefaultSpawnPositionPacket packet) { + public void translate(GeyserSessionImpl 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 9ff6965ca..6170b2b32 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundSetTimePacket packet) { + public void translate(GeyserSessionImpl 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 e9f9337aa..ad0af4f10 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundSoundPacket packet) { + public void translate(GeyserSessionImpl 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 75a99f0af..e791407f2 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundStopSoundPacket packet) { + public void translate(GeyserSessionImpl 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 1f7ea7657..f0574f99f 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundInitializeBorderPacket packet) { + public void translate(GeyserSessionImpl 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 6895cf944..6a60f6f38 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundSetBorderCenterPacket packet) { + public void translate(GeyserSessionImpl 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 3eae4b1f5..2fe5eb392 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundSetBorderLerpSizePacket packet) { + public void translate(GeyserSessionImpl 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 076924735..2adee0f41 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundSetBorderSizePacket packet) { + public void translate(GeyserSessionImpl 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 b3104fb9a..7e7e91f13 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundSetBorderWarningDelayPacket packet) { + public void translate(GeyserSessionImpl 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 b4483b9a6..8288f804e 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundSetBorderWarningDistancePacket packet) { + public void translate(GeyserSessionImpl 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 fe141486e..ffe7386fb 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundSetDisplayObjectivePacket packet) { + public void translate(GeyserSessionImpl 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 927fb5488..20932f9cd 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 @@ -29,9 +29,9 @@ import com.github.steveice10.mc.protocol.data.game.scoreboard.ObjectiveAction; import com.github.steveice10.mc.protocol.data.game.scoreboard.ScoreboardPosition; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.scoreboard.ClientboundSetObjectivePacket; import org.geysermc.geyser.GeyserImpl; -import org.geysermc.geyser.api.logger.GeyserLogger; +import org.geysermc.geyser.GeyserLogger; import org.geysermc.geyser.entity.type.player.PlayerEntity; -import org.geysermc.geyser.session.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundClearTitlesPacket packet) { + public void translate(GeyserSessionImpl 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 914ddafb9..e4fa7fe46 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundSetActionBarTextPacket packet) { + public void translate(GeyserSessionImpl 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 521f5eba6..70e3716a2 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundSetSubtitleTextPacket packet) { + public void translate(GeyserSessionImpl 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 04eb76bb5..8a2594ffb 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundSetTitleTextPacket packet) { + public void translate(GeyserSessionImpl 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 b8bbc780a..6d96bc8ea 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, ClientboundSetTitlesAnimationPacket packet) { + public void translate(GeyserSessionImpl 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 5e6e8d9e8..d42aa9a50 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, Vector3f position, String identifier) { + static void handleBlockInteraction(GeyserSessionImpl 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(GeyserSession session, GeyserItemStack itemInHand, String blockIdentifier) { + static boolean canInteract(GeyserSessionImpl 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 4a88696f8..27b026a46 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, Vector3f position, Entity entity) { + static void handleEntityInteraction(GeyserSessionImpl 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 7cccbb21d..be0ccb0c8 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; /** * 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(GeyserSession session, Vector3f position, T value); + void translate(GeyserSessionImpl 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 1af30e658..072e0bf56 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, Vector3f position, String identifier) { + public void translate(GeyserSessionImpl 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 8c10076d3..9fb95fbb5 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, Vector3f position, String identifier) { + public void translate(GeyserSessionImpl 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 1115760eb..38f53d855 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, Vector3f position, String identifier) { + public void translate(GeyserSessionImpl 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 09e86f461..920ece899 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, Vector3f position, String identifier) { + public void translate(GeyserSessionImpl 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 6c91b24a0..fc258978f 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, Vector3f position, String identifier) { + public void translate(GeyserSessionImpl 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 799364498..a37650849 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, Vector3f position, String identifier) { + public void translate(GeyserSessionImpl 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 a57d337b1..a1b6247a1 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, Vector3f position, String identifier) { + public void translate(GeyserSessionImpl 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 ea160538e..bc8822c8c 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, Vector3f position, Entity entity) { + public void translate(GeyserSessionImpl 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 e8698ff23..47fad3559 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, Vector3f position, Entity value) { + public void translate(GeyserSessionImpl 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 d22b47768..eab6c4ba6 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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 GeyserSession} for the user + * @param session {@link GeyserSessionImpl} for the user * @return True if the message is too long, false if not */ - public static boolean isTooLong(String message, GeyserSession session) { + public static boolean isTooLong(String message, GeyserSessionImpl 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 6d4258d7e..0f6cc07a3 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, @Nonnull NbtMap blockEntity, Position position) { + public static void updateBlockEntity(GeyserSessionImpl session, @Nonnull NbtMap blockEntity, Position position) { updateBlockEntity(session, blockEntity, Vector3i.from(position.getX(), position.getY(), position.getZ())); } - public static void updateBlockEntity(GeyserSession session, @Nonnull NbtMap blockEntity, Vector3i position) { + public static void updateBlockEntity(GeyserSessionImpl 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 c43cc3311..125d13662 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, BlockMapping blockMapping, String itemToolType) { + private static boolean correctTool(GeyserSessionImpl 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(GeyserSession session, BlockMapping blockMapping, String toolTier) { + private static boolean canToolTierBreakBlock(GeyserSessionImpl 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(GeyserSession session, BlockMapping blockMapping, ItemMapping item, CompoundTag nbtData, boolean isSessionPlayer) { + public static double getBreakTime(GeyserSessionImpl 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(GeyserSession session, BlockMapping blockMapping) { + public static double getSessionBreakTime(GeyserSessionImpl 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(GeyserSession session, Vector3i blockPos) { + public static BlockCollision getCollisionAt(GeyserSessionImpl session, Vector3i blockPos) { return getCollision(session.getGeyser().getWorldManager().getBlockAt(session, blockPos)); } - public static BlockCollision getCollisionAt(GeyserSession session, int x, int y, int z) { + public static BlockCollision getCollisionAt(GeyserSessionImpl 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 cb80e209b..2b7713235 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, Vector3i position) { + public static void updateChunkPosition(GeyserSessionImpl 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(GeyserSession session, int blockState, Position position) { + public static void updateBlock(GeyserSessionImpl 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(GeyserSession session, int blockState, Vector3i position) { + public static void updateBlock(GeyserSessionImpl 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(GeyserSession session, Vector3i position, int radius, boolean forceUpdate) { + public static void sendEmptyChunks(GeyserSessionImpl 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(GeyserSession session, CompoundTag dimensionTag) { + public static void loadDimensionTag(GeyserSessionImpl 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 c149996b8..06c2a8f3e 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session) { + public static void sendCooldown(GeyserSessionImpl 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(GeyserSession session, CooldownType sessionPreference, long lastHitTime) { + private static void computeCooldown(GeyserSessionImpl 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(GeyserSession session) { + private static boolean hasCooldown(GeyserSessionImpl 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(GeyserSession session) { + private static String getTitle(GeyserSessionImpl 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 c729c0b1e..352a8e996 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.util.Set; @@ -56,7 +56,7 @@ public class DimensionUtils { */ public static final String THE_END = "minecraft:the_end"; - public static void switchDimension(GeyserSession session, String javaDimension) { + public static void switchDimension(GeyserSessionImpl 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 1b671b2fe..907aef169 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, Inventory inventory) { + public static void openInventory(GeyserSessionImpl 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(GeyserSession session, Inventory inventory) { + public static void displayInventory(GeyserSessionImpl 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(GeyserSession session, int windowId, boolean confirm) { + public static void closeInventory(GeyserSessionImpl 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(GeyserSession session, int windowId) { + public static Inventory getInventory(GeyserSessionImpl session, int windowId) { if (windowId == 0) { return session.getPlayerInventory(); } else { @@ -128,7 +128,7 @@ public class InventoryUtils { } } - public static void updateCursor(GeyserSession session) { + public static void updateCursor(GeyserSessionImpl session) { InventorySlotPacket cursorPacket = new InventorySlotPacket(); cursorPacket.setContainerId(ContainerId.UI); cursorPacket.setSlot(0); @@ -177,12 +177,12 @@ public class InventoryUtils { } /** - * See {@link #findOrCreateItem(GeyserSession, String)}. This is for finding a specified {@link ItemStack}. + * See {@link #findOrCreateItem(GeyserSessionImpl, 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(GeyserSession session, ItemStack itemStack) { + public static void findOrCreateItem(GeyserSessionImpl 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(GeyserSession session, String itemName) { + public static void findOrCreateItem(GeyserSessionImpl 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(GeyserSession session, int slot) { + private static void setHotbarItem(GeyserSessionImpl 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 0eed01613..3307e3e88 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; public class ItemUtils { @@ -49,7 +49,7 @@ public class ItemUtils { /** * @return the correct Bedrock durability for this item. */ - public static int getCorrectBedrockDurability(GeyserSession session, int javaId, int original) { + public static int getCorrectBedrockDurability(GeyserSessionImpl 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 213953bdd..128b0bcb5 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, LoginPacket loginPacket) { + public static void encryptPlayerConnection(GeyserSessionImpl 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(GeyserSession session, String clientData, JsonNode certChainData) { + private static void encryptConnectionWithCert(GeyserSessionImpl session, String clientData, JsonNode certChainData) { try { GeyserImpl geyser = session.getGeyser(); @@ -190,7 +190,7 @@ public class LoginEncryptionUtils { } } - private static void startEncryptionHandshake(GeyserSession session, PublicKey key) throws Exception { + private static void startEncryptionHandshake(GeyserSessionImpl 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(GeyserSession session) { + public static void buildAndShowLoginWindow(GeyserSessionImpl 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(GeyserSession session) { + public static void buildAndShowLoginDetailsWindow(GeyserSessionImpl 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(GeyserSession session) { + public static void buildAndShowMicrosoftAuthenticationWindow(GeyserSessionImpl 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(GeyserSession session, MsaAuthenticationService.MsCodeResponse msCode) { + public static void buildAndShowMicrosoftCodeWindow(GeyserSessionImpl 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 ff0080f74..babbc8a62 100644 --- a/core/src/main/java/org/geysermc/geyser/util/NewsHandler.java +++ b/core/src/main/java/org/geysermc/geyser/util/NewsHandler.java @@ -31,8 +31,8 @@ import com.google.gson.JsonElement; import com.google.gson.JsonSyntaxException; import org.geysermc.geyser.Constants; import org.geysermc.geyser.GeyserImpl; -import org.geysermc.geyser.api.logger.GeyserLogger; -import org.geysermc.geyser.session.GeyserSession; +import org.geysermc.geyser.GeyserLogger; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, NewsItemAction action) { + public void handleNews(GeyserSessionImpl session, NewsItemAction action) { for (NewsItem news : getActiveNews(action)) { handleNewsItem(session, news, action); } } - private void handleNewsItem(GeyserSession session, NewsItem news, NewsItemAction action) { + private void handleNewsItem(GeyserSessionImpl 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 (GeyserSession player : GeyserImpl.getInstance().getSessionManager().getSessions().values()) { + for (GeyserSessionImpl 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 ed706eeca..ac39f6823 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; import java.nio.ByteBuffer; @@ -73,7 +73,7 @@ public class PluginMessageUtils { return SKIN_CHANNEL; } - public static void sendMessage(GeyserSession session, String channel, byte[] data) { + public static void sendMessage(GeyserSessionImpl 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 28fb53ab1..8adbc6e4e 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session) { + public static CustomForm buildForm(GeyserSessionImpl 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 aa5893462..805fec807 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session) { + public static void buildAndSendStatisticsMenu(GeyserSessionImpl 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 aaa780ed5..6226ecbbd 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.GeyserSession; +import org.geysermc.geyser.session.GeyserSessionImpl; 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(GeyserSession session, int blockState, Vector3i position) { + public void handleBlockChange(GeyserSessionImpl session, int blockState, Vector3i position) { WorldManager worldManager = session.getGeyser().getWorldManager(); int offset = blockState - this.start; diff --git a/pom.xml b/pom.xml index 67e068212..334fa8031 100644 --- a/pom.xml +++ b/pom.xml @@ -32,10 +32,10 @@ ap + api bootstrap common core - api