3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-12-24 15:20:25 +01:00

API: change player class to Connection

Dieser Commit ist enthalten in:
Camotoy 2021-11-22 14:52:26 -05:00
Ursprung 5b415cea68
Commit 966c2155ad
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 7EEFB66FE798081F
394 geänderte Dateien mit 1103 neuen und 1114 gelöschten Zeilen

Datei anzeigen

@ -32,14 +32,14 @@ import org.checkerframework.checker.nullness.qual.NonNull;
*/
@NonNull
public class Geyser {
private static Api api;
private static GeyserApi api;
/**
* Returns the base api.
*
* @return the base api
*/
public static Api api() {
public static GeyserApi api() {
if (api == null) {
throw new RuntimeException("Api has not been registered yet!");
}
@ -47,26 +47,6 @@ public class Geyser {
return api;
}
/**
* Returns the api of the given type.
*
* @param apiClass the api class
* @param <T> the type
* @return the api of the given type
*/
@SuppressWarnings("unchecked")
public static <T extends Api> T api(@NonNull Class<T> apiClass) {
if (apiClass.isInstance(api)) {
return (T) api;
}
if (api == null) {
throw new RuntimeException("Api has not been registered yet!");
} else {
throw new RuntimeException("Api was not an instance of " + apiClass + "! Was " + api.getClass().getCanonicalName());
}
}
/**
* Registers the given api type. The api cannot be
* registered if {@link #registered()} is true as
@ -74,7 +54,7 @@ public class Geyser {
*
* @param api the api
*/
public static void set(@NonNull Api api) {
public static void set(@NonNull GeyserApi api) {
if (Geyser.api != null) {
throw new RuntimeException("Cannot redefine already registered api!");
}

Datei anzeigen

@ -27,7 +27,8 @@ package org.geysermc.api;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.geysermc.api.session.Session;
import org.geysermc.api.geyser.GeyserExtensionApi;
import org.geysermc.api.session.Connection;
import java.util.List;
import java.util.UUID;
@ -35,17 +36,16 @@ import java.util.UUID;
/**
* The base API class.
*/
public interface Api {
public interface GeyserApi {
/**
* Gets the session from the given
* UUID, if applicable.
* Gets the session from the given UUID, if applicable. The player must be logged in to the Java server
* for this to return a non-null value.
*
* @param uuid the UUID of the session
* @return the session from the given UUID, if applicable
*/
@Nullable
Session sessionByUuid(@NonNull UUID uuid);
Connection connectionByUuid(@NonNull UUID uuid);
/**
* Gets the session from the given
@ -55,7 +55,7 @@ public interface Api {
* @return the session from the given UUID, if applicable
*/
@Nullable
Session sessionByXuid(@NonNull String xuid);
Connection connectionByXuid(@NonNull String xuid);
/**
* Gets the session from the given
@ -65,7 +65,7 @@ public interface Api {
* @return the session from the given name, if applicable
*/
@Nullable
Session sessionByName(@NonNull String name);
Connection connectionByName(@NonNull String name);
/**
* Gets all the online sessions.
@ -73,5 +73,28 @@ public interface Api {
* @return all the online sessions
*/
@NonNull
List<? extends Session> onlineSessions();
List<? extends Connection> onlineConnections();
/**
* Returns this as the Geyser extension API, if the platform supports it.
*
* @return the extension API, if this platform supports it.
*/
default GeyserExtensionApi asExtensionApi() {
return null;
}
/**
* @return the major API version. Bumped whenever a significant breaking change or feature addition is added.
*/
default int majorApiVersion() {
return 0;
}
/**
* @return the minor API version. May be bumped for new API additions.
*/
default int minorApiVersion() {
return 0;
}
}

Datei anzeigen

@ -23,12 +23,12 @@
* @link https://github.com/GeyserMC/Geyser
*/
package org.geysermc.geyser.api.session;
package org.geysermc.api.geyser;
import org.geysermc.api.session.Session;
import org.geysermc.api.session.Connection;
/**
* Represents a player session used in Geyser.
*/
public interface GeyserSession extends Session {
public interface GeyserConnection extends Connection {
}

Datei anzeigen

@ -23,23 +23,14 @@
* @link https://github.com/GeyserMC/Geyser
*/
package org.geysermc.geyser.api;
package org.geysermc.api.geyser;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.geysermc.api.Api;
import org.geysermc.api.Geyser;
import org.geysermc.api.session.Session;
import org.geysermc.geyser.api.session.GeyserSession;
import java.util.List;
import java.util.UUID;
import org.geysermc.api.GeyserApi;
/**
* Represents the API used in Geyser.
*/
public interface GeyserApi extends Api {
public interface GeyserExtensionApi extends GeyserApi {
/**
* Shuts down the current Geyser instance.
*/
@ -58,36 +49,8 @@ public interface GeyserApi extends Api {
*/
boolean productionEnvironment();
/**
* {@inheritDoc}
*/
@Override
@Nullable GeyserSession sessionByUuid(@NonNull UUID uuid);
/**
* {@inheritDoc}
*/
@Override
@Nullable GeyserSession sessionByXuid(@NonNull String xuid);
/**
* {@inheritDoc}
*/
@Override
@Nullable GeyserSession sessionByName(@NonNull String name);
/**
* {@inheritDoc}
*/
@NonNull
List<? extends GeyserSession> onlineSessions();
/**
* Gets the {@link GeyserApi}.
*
* @return the Geyser API
*/
static GeyserApi api() {
return Geyser.api(GeyserApi.class);
default GeyserExtensionApi asExtensionApi() {
return this;
}
}

Datei anzeigen

@ -0,0 +1,29 @@
/*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @author GeyserMC
* @link https://github.com/GeyserMC/Geyser
*/
/**
*
*/
package org.geysermc.api.geyser;

Datei anzeigen

@ -30,29 +30,30 @@ import org.checkerframework.checker.nullness.qual.NonNull;
import java.util.UUID;
/**
* Represents a player session.
* Represents a player connection.
*/
@NonNull
public interface Session {
public interface Connection {
/**
* Gets the name of the session.
* Gets the name of the connection.
*
* @return the name of the session
* @return the name of the connection
*/
String name();
/**
* Gets the {@link UUID} of the session.
* Gets the {@link UUID} of the connection.
*
* @return the UUID of the session
* @return the UUID of the connection
*/
UUID uuid();
/**
* Gets the XUID of the session.
* Gets the XUID of the connection.
*
* @return the XUID of the session
* @return the XUID of the connection
*/
String xuid();
}

Datei anzeigen

@ -32,7 +32,7 @@ import net.md_5.bungee.api.plugin.TabExecutor;
import org.geysermc.geyser.GeyserImpl;
import org.geysermc.geyser.command.CommandExecutor;
import org.geysermc.geyser.command.GeyserCommand;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.text.GeyserLocale;
import java.util.Arrays;
@ -50,7 +50,7 @@ public class GeyserBungeeCommandExecutor extends Command implements TabExecutor
@Override
public void execute(CommandSender sender, String[] args) {
BungeeCommandSender commandSender = new BungeeCommandSender(sender);
GeyserSessionImpl session = this.commandExecutor.getGeyserSession(commandSender);
GeyserSession session = this.commandExecutor.getGeyserSession(commandSender);
if (args.length > 0) {
GeyserCommand command = this.commandExecutor.getCommand(args[0]);

Datei anzeigen

@ -32,7 +32,7 @@ import org.bukkit.command.TabExecutor;
import org.geysermc.geyser.GeyserImpl;
import org.geysermc.geyser.command.CommandExecutor;
import org.geysermc.geyser.command.GeyserCommand;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.text.GeyserLocale;
import java.util.Arrays;
@ -48,7 +48,7 @@ public class GeyserSpigotCommandExecutor extends CommandExecutor implements TabE
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
SpigotCommandSender commandSender = new SpigotCommandSender(sender);
GeyserSessionImpl session = getGeyserSession(commandSender);
GeyserSession session = getGeyserSession(commandSender);
if (args.length > 0) {
GeyserCommand geyserCommand = getCommand(args[0]);

Datei anzeigen

@ -41,7 +41,7 @@ import org.bukkit.event.block.BlockPistonEvent;
import org.bukkit.event.block.BlockPistonExtendEvent;
import org.bukkit.event.block.BlockPistonRetractEvent;
import org.geysermc.geyser.GeyserImpl;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.session.cache.PistonCache;
import org.geysermc.geyser.level.block.BlockStateValues;
import org.geysermc.geyser.translator.level.block.entity.PistonBlockEntity;
@ -88,12 +88,12 @@ public class GeyserPistonListener implements Listener {
Object2IntMap<Vector3i> attachedBlocks = new Object2IntOpenHashMap<>();
boolean blocksFilled = false;
for (Map.Entry<UUID, GeyserSessionImpl> entry : geyser.getSessionManager().getSessions().entrySet()) {
for (Map.Entry<UUID, GeyserSession> entry : geyser.getSessionManager().getSessions().entrySet()) {
Player player = Bukkit.getPlayer(entry.getKey());
if (player == null || !player.getWorld().equals(world)) {
continue;
}
GeyserSessionImpl session = entry.getValue();
GeyserSession session = entry.getValue();
int dX = Math.abs(location.getBlockX() - player.getLocation().getBlockX()) >> 4;
int dZ = Math.abs(location.getBlockZ() - player.getLocation().getBlockZ()) >> 4;

Datei anzeigen

@ -48,7 +48,7 @@ import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.inventory.ShapelessRecipe;
import org.geysermc.geyser.GeyserImpl;
import org.geysermc.geyser.network.MinecraftProtocol;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.translator.inventory.item.ItemTranslator;
import org.geysermc.geyser.util.InventoryUtils;
@ -79,8 +79,8 @@ public class GeyserSpigot1_11CraftingListener implements Listener {
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
GeyserSessionImpl session = null;
for (GeyserSessionImpl otherSession : geyser.getSessionManager().getSessions().values()) {
GeyserSession session = null;
for (GeyserSession otherSession : geyser.getSessionManager().getSessions().values()) {
if (otherSession.name().equals(event.getPlayer().getName())) {
session = otherSession;
break;
@ -93,7 +93,7 @@ public class GeyserSpigot1_11CraftingListener implements Listener {
sendServerRecipes(session);
}
public void sendServerRecipes(GeyserSessionImpl session) {
public void sendServerRecipes(GeyserSession session) {
int netId = InventoryUtils.LAST_RECIPE_NET_ID;
CraftingDataPacket craftingDataPacket = new CraftingDataPacket();
@ -161,7 +161,7 @@ public class GeyserSpigot1_11CraftingListener implements Listener {
}
@SuppressWarnings("deprecation")
private Pair<ItemStack, ItemData> translateToBedrock(GeyserSessionImpl session, org.bukkit.inventory.ItemStack itemStack) {
private Pair<ItemStack, ItemData> translateToBedrock(GeyserSession session, org.bukkit.inventory.ItemStack itemStack) {
if (itemStack != null && itemStack.getData() != null) {
if (itemStack.getType().getId() == 0) {
return new Pair<>(null, ItemData.AIR);

Datei anzeigen

@ -33,7 +33,7 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockPlaceEvent;
import org.geysermc.geyser.GeyserImpl;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.level.block.BlockStateValues;
import org.geysermc.geyser.registry.BlockRegistries;
import org.geysermc.geyser.platform.spigot.world.manager.GeyserSpigotWorldManager;
@ -45,7 +45,7 @@ public class GeyserSpigotBlockPlaceListener implements Listener {
@EventHandler
public void place(final BlockPlaceEvent event) {
GeyserSessionImpl session = geyser.sessionByUuid(event.getPlayer().getUniqueId());
GeyserSession session = geyser.connectionByUuid(event.getPlayer().getUniqueId());
if (session == null) {
return;
}

Datei anzeigen

@ -30,7 +30,7 @@ import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.storage.BlockSto
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.level.block.BlockStateValues;
import org.geysermc.geyser.adapters.spigot.SpigotAdapters;
import org.geysermc.geyser.adapters.spigot.SpigotWorldAdapter;
@ -48,7 +48,7 @@ public class GeyserSpigot1_12NativeWorldManager extends GeyserSpigot1_12WorldMan
}
@Override
public int getBlockAt(GeyserSessionImpl session, int x, int y, int z) {
public int getBlockAt(GeyserSession session, int x, int y, int z) {
Player player = Bukkit.getPlayer(session.getPlayerEntity().getUsername());
if (player == null) {
return BlockStateValues.JAVA_AIR_ID;

Datei anzeigen

@ -36,7 +36,7 @@ import org.bukkit.Bukkit;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.level.block.BlockStateValues;
import java.util.List;
@ -66,7 +66,7 @@ public class GeyserSpigot1_12WorldManager extends GeyserSpigotWorldManager {
}
@Override
public int getBlockAt(GeyserSessionImpl session, int x, int y, int z) {
public int getBlockAt(GeyserSession session, int x, int y, int z) {
Player player = Bukkit.getPlayer(session.getPlayerEntity().getUsername());
if (player == null) {
return BlockStateValues.JAVA_AIR_ID;

Datei anzeigen

@ -26,11 +26,11 @@
package org.geysermc.geyser.platform.spigot.world.manager;
import org.bukkit.plugin.Plugin;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.level.block.BlockStateValues;
/**
* Should only be used when we know {@link GeyserSpigotWorldManager#getBlockAt(GeyserSessionImpl, int, int, int)}
* Should only be used when we know {@link GeyserSpigotWorldManager#getBlockAt(GeyserSession, int, int, int)}
* cannot be accurate. Typically, this is when ViaVersion is not installed but a client still manages to connect.
* If this occurs to you somehow, please let us know!!
*/
@ -40,7 +40,7 @@ public class GeyserSpigotFallbackWorldManager extends GeyserSpigotWorldManager {
}
@Override
public int getBlockAt(GeyserSessionImpl session, int x, int y, int z) {
public int getBlockAt(GeyserSession session, int x, int y, int z) {
return BlockStateValues.JAVA_AIR_ID;
}

Datei anzeigen

@ -33,7 +33,7 @@ import it.unimi.dsi.fastutil.ints.Int2IntMap;
import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap;
import it.unimi.dsi.fastutil.ints.IntList;
import org.geysermc.geyser.network.MinecraftProtocol;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.platform.spigot.GeyserSpigotPlugin;
import java.util.List;
@ -66,7 +66,7 @@ public class GeyserSpigotLegacyNativeWorldManager extends GeyserSpigotNativeWorl
}
@Override
public int getBlockAt(GeyserSessionImpl session, int x, int y, int z) {
public int getBlockAt(GeyserSession session, int x, int y, int z) {
int nativeBlockId = super.getBlockAt(session, x, y, z);
return oldToNewBlockId.getOrDefault(nativeBlockId, nativeBlockId);
}

Datei anzeigen

@ -28,7 +28,7 @@ package org.geysermc.geyser.platform.spigot.world.manager;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.level.block.BlockStateValues;
import org.geysermc.geyser.adapters.spigot.SpigotAdapters;
import org.geysermc.geyser.adapters.spigot.SpigotWorldAdapter;
@ -42,7 +42,7 @@ public class GeyserSpigotNativeWorldManager extends GeyserSpigotWorldManager {
}
@Override
public int getBlockAt(GeyserSessionImpl session, int x, int y, int z) {
public int getBlockAt(GeyserSession session, int x, int y, int z) {
Player player = Bukkit.getPlayer(session.getPlayerEntity().getUsername());
if (player == null) {
return BlockStateValues.JAVA_AIR_ID;

Datei anzeigen

@ -39,7 +39,7 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.BookMeta;
import org.bukkit.plugin.Plugin;
import org.geysermc.geyser.network.MinecraftProtocol;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.translator.inventory.LecternInventoryTranslator;
import org.geysermc.geyser.level.GeyserWorldManager;
import org.geysermc.geyser.level.block.BlockStateValues;
@ -66,7 +66,7 @@ public class GeyserSpigotWorldManager extends GeyserWorldManager {
}
@Override
public int getBlockAt(GeyserSessionImpl session, int x, int y, int z) {
public int getBlockAt(GeyserSession session, int x, int y, int z) {
Player bukkitPlayer;
if ((bukkitPlayer = Bukkit.getPlayer(session.getPlayerEntity().getUsername())) == null) {
return BlockStateValues.JAVA_AIR_ID;
@ -90,7 +90,7 @@ public class GeyserSpigotWorldManager extends GeyserWorldManager {
}
@Override
public NbtMap getLecternDataAt(GeyserSessionImpl session, int x, int y, int z, boolean isChunkLoad) {
public NbtMap getLecternDataAt(GeyserSession session, int x, int y, int z, boolean isChunkLoad) {
// Run as a task to prevent async issues
Runnable lecternInfoGet = () -> {
Player bukkitPlayer;
@ -158,7 +158,7 @@ public class GeyserSpigotWorldManager extends GeyserWorldManager {
return true;
}
public Boolean getGameRuleBool(GeyserSessionImpl session, GameRule gameRule) {
public Boolean getGameRuleBool(GeyserSession session, GameRule gameRule) {
String value = Bukkit.getPlayer(session.getPlayerEntity().getUsername()).getWorld().getGameRuleValue(gameRule.getJavaID());
if (!value.isEmpty()) {
return Boolean.parseBoolean(value);
@ -167,7 +167,7 @@ public class GeyserSpigotWorldManager extends GeyserWorldManager {
}
@Override
public int getGameRuleInt(GeyserSessionImpl session, GameRule gameRule) {
public int getGameRuleInt(GeyserSession session, GameRule gameRule) {
String value = Bukkit.getPlayer(session.getPlayerEntity().getUsername()).getWorld().getGameRuleValue(gameRule.getJavaID());
if (!value.isEmpty()) {
return Integer.parseInt(value);
@ -176,7 +176,7 @@ public class GeyserSpigotWorldManager extends GeyserWorldManager {
}
@Override
public boolean hasPermission(GeyserSessionImpl session, String permission) {
public boolean hasPermission(GeyserSession session, String permission) {
return Bukkit.getPlayer(session.getPlayerEntity().getUsername()).hasPermission(permission);
}

Datei anzeigen

@ -30,7 +30,7 @@ import org.geysermc.geyser.command.CommandExecutor;
import org.geysermc.geyser.command.CommandSender;
import org.geysermc.geyser.command.GeyserCommand;
import org.geysermc.geyser.text.ChatColor;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.text.GeyserLocale;
import org.spongepowered.api.command.CommandCallable;
import org.spongepowered.api.command.CommandResult;
@ -54,7 +54,7 @@ public class GeyserSpongeCommandExecutor extends CommandExecutor implements Comm
@Override
public CommandResult process(CommandSource source, String arguments) {
CommandSender commandSender = new SpongeCommandSender(source);
GeyserSessionImpl session = getGeyserSession(commandSender);
GeyserSession session = getGeyserSession(commandSender);
String[] args = arguments.split(" ");
if (args.length > 0) {

Datei anzeigen

@ -27,7 +27,7 @@ package org.geysermc.geyser.platform.standalone.gui;
import org.geysermc.geyser.GeyserImpl;
import org.geysermc.geyser.command.GeyserCommand;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.text.GeyserLocale;
import org.geysermc.geyser.platform.standalone.GeyserStandaloneLogger;
import org.geysermc.geyser.platform.standalone.command.GeyserCommandManager;
@ -306,7 +306,7 @@ public class GeyserStandaloneGUI {
// Update player table
playerTableModel.getDataVector().removeAllElements();
for (GeyserSessionImpl player : GeyserImpl.getInstance().getSessionManager().getSessions().values()) {
for (GeyserSession player : GeyserImpl.getInstance().getSessionManager().getSessions().values()) {
Vector<String> row = new Vector<>();
row.add(player.getSocketAddress().getHostName());
row.add(player.getPlayerEntity().getUsername());

Datei anzeigen

@ -31,7 +31,7 @@ import org.geysermc.geyser.command.CommandExecutor;
import org.geysermc.geyser.command.CommandSender;
import org.geysermc.geyser.command.GeyserCommand;
import org.geysermc.geyser.text.ChatColor;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.text.GeyserLocale;
import java.util.Arrays;
@ -47,7 +47,7 @@ public class GeyserVelocityCommandExecutor extends CommandExecutor implements Si
@Override
public void execute(Invocation invocation) {
CommandSender sender = new VelocityCommandSender(invocation.source());
GeyserSessionImpl session = getGeyserSession(sender);
GeyserSession session = getGeyserSession(sender);
if (invocation.arguments().length > 0) {
GeyserCommand command = getCommand(invocation.arguments()[0]);

Datei anzeigen

@ -73,11 +73,11 @@ public class GeyserConnector {
}
public GeyserSession getPlayerByXuid(String xuid) {
return new GeyserSession(GeyserImpl.getInstance().sessionByXuid(xuid));
return new GeyserSession(GeyserImpl.getInstance().connectionByXuid(xuid));
}
public GeyserSession getPlayerByUuid(UUID uuid) {
return new GeyserSession(GeyserImpl.getInstance().sessionByUuid(uuid));
return new GeyserSession(GeyserImpl.getInstance().connectionByUuid(uuid));
}
public boolean isProductionEnvironment() {

Datei anzeigen

@ -28,7 +28,6 @@ package org.geysermc.connector.network.session;
import com.github.steveice10.packetlib.packet.Packet;
import com.nukkitx.protocol.bedrock.BedrockPacket;
import org.geysermc.connector.network.session.auth.AuthData;
import org.geysermc.geyser.session.GeyserSessionImpl;
/**
* Deprecated, legacy code. Serves as a wrapper around
@ -38,9 +37,9 @@ import org.geysermc.geyser.session.GeyserSessionImpl;
*/
@Deprecated
public class GeyserSession {
private final GeyserSessionImpl handle;
private final org.geysermc.geyser.session.GeyserSession handle;
public GeyserSession(GeyserSessionImpl handle) {
public GeyserSession(org.geysermc.geyser.session.GeyserSession handle) {
this.handle = handle;
}

Datei anzeigen

@ -41,35 +41,33 @@ import lombok.Getter;
import lombok.Setter;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.geysermc.common.PlatformType;
import org.geysermc.api.Geyser;
import org.geysermc.geyser.api.GeyserApi;
import org.geysermc.geyser.api.session.GeyserSession;
import org.geysermc.geyser.command.CommandManager;
import org.geysermc.geyser.session.auth.AuthType;
import org.geysermc.geyser.configuration.GeyserConfiguration;
import org.geysermc.geyser.entity.EntityDefinitions;
import org.geysermc.geyser.pack.ResourcePack;
import org.geysermc.geyser.session.SessionManager;
import org.geysermc.geyser.text.GeyserLocale;
import org.geysermc.geyser.text.MinecraftLocale;
import org.geysermc.geyser.util.Metrics;
import org.geysermc.geyser.network.ConnectorServerEventHandler;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.translator.text.MessageTranslator;
import org.geysermc.geyser.translator.inventory.item.ItemTranslator;
import org.geysermc.geyser.level.WorldManager;
import org.geysermc.geyser.registry.BlockRegistries;
import org.geysermc.geyser.registry.Registries;
import org.geysermc.geyser.scoreboard.ScoreboardUpdater;
import org.geysermc.geyser.skin.FloodgateSkinUploader;
import org.geysermc.geyser.util.*;
import org.geysermc.api.geyser.GeyserExtensionApi;
import org.geysermc.common.PlatformType;
import org.geysermc.floodgate.crypto.AesCipher;
import org.geysermc.floodgate.crypto.AesKeyProducer;
import org.geysermc.floodgate.crypto.Base64Topping;
import org.geysermc.floodgate.crypto.FloodgateCipher;
import org.geysermc.floodgate.news.NewsItemAction;
import org.geysermc.floodgate.time.TimeSyncer;
import org.geysermc.geyser.command.CommandManager;
import org.geysermc.geyser.configuration.GeyserConfiguration;
import org.geysermc.geyser.entity.EntityDefinitions;
import org.geysermc.geyser.level.WorldManager;
import org.geysermc.geyser.network.ConnectorServerEventHandler;
import org.geysermc.geyser.pack.ResourcePack;
import org.geysermc.geyser.registry.BlockRegistries;
import org.geysermc.geyser.registry.Registries;
import org.geysermc.geyser.scoreboard.ScoreboardUpdater;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.session.SessionManager;
import org.geysermc.geyser.session.auth.AuthType;
import org.geysermc.geyser.skin.FloodgateSkinUploader;
import org.geysermc.geyser.text.GeyserLocale;
import org.geysermc.geyser.text.MinecraftLocale;
import org.geysermc.geyser.translator.inventory.item.ItemTranslator;
import org.geysermc.geyser.translator.text.MessageTranslator;
import org.geysermc.geyser.util.*;
import javax.naming.directory.Attribute;
import javax.naming.directory.InitialDirContext;
@ -78,18 +76,14 @@ import java.net.InetSocketAddress;
import java.net.UnknownHostException;
import java.security.Key;
import java.text.DecimalFormat;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.UUID;
import java.util.*;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@Getter
public class GeyserImpl implements GeyserApi {
public class GeyserImpl implements GeyserExtensionApi {
public static final ObjectMapper JSON_MAPPER = new ObjectMapper()
.enable(JsonParser.Feature.IGNORE_UNDEFINED)
.enable(JsonParser.Feature.ALLOW_COMMENTS)
@ -297,7 +291,7 @@ public class GeyserImpl implements GeyserApi {
metrics.addCustomChart(new Metrics.SimplePie("version", () -> GeyserImpl.VERSION));
metrics.addCustomChart(new Metrics.AdvancedPie("playerPlatform", () -> {
Map<String, Integer> valueMap = new HashMap<>();
for (GeyserSessionImpl session : sessionManager.getAllSessions()) {
for (GeyserSession session : sessionManager.getAllSessions()) {
if (session == null) continue;
if (session.getClientData() == null) continue;
String os = session.getClientData().getDeviceOs().toString();
@ -311,7 +305,7 @@ public class GeyserImpl implements GeyserApi {
}));
metrics.addCustomChart(new Metrics.AdvancedPie("playerVersion", () -> {
Map<String, Integer> valueMap = new HashMap<>();
for (GeyserSessionImpl session : sessionManager.getAllSessions()) {
for (GeyserSession session : sessionManager.getAllSessions()) {
if (session == null) continue;
if (session.getClientData() == null) continue;
String version = session.getClientData().getGameVersion();
@ -403,8 +397,8 @@ public class GeyserImpl implements GeyserApi {
}
@Override
public @Nullable GeyserSessionImpl sessionByName(@NonNull String name) {
for (GeyserSessionImpl session : sessionManager.getAllSessions()) {
public @Nullable GeyserSession connectionByName(@NonNull String name) {
for (GeyserSession session : sessionManager.getAllSessions()) {
if (session.name().equals(name) || session.getProtocol().getProfile().getName().equals(name)) {
return session;
}
@ -414,18 +408,18 @@ public class GeyserImpl implements GeyserApi {
}
@Override
public @NonNull List<GeyserSessionImpl> onlineSessions() {
public @NonNull List<GeyserSession> onlineConnections() {
return this.sessionManager.getAllSessions();
}
@Override
public @Nullable GeyserSessionImpl sessionByUuid(@NonNull UUID uuid) {
public @Nullable GeyserSession connectionByUuid(@NonNull UUID uuid) {
return this.sessionManager.getSessions().get(uuid);
}
@Override
public @Nullable GeyserSessionImpl sessionByXuid(@NonNull String xuid) {
for (GeyserSessionImpl session : sessionManager.getAllSessions()) {
public @Nullable GeyserSession connectionByXuid(@NonNull String xuid) {
for (GeyserSession session : sessionManager.getAllSessions()) {
if (session.xuid().equals(xuid)) {
return session;
}

Datei anzeigen

@ -27,7 +27,7 @@ package org.geysermc.geyser.command;
import lombok.AllArgsConstructor;
import org.geysermc.geyser.GeyserImpl;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import javax.annotation.Nullable;
import java.util.ArrayList;
@ -48,12 +48,12 @@ public class CommandExecutor {
}
@Nullable
public GeyserSessionImpl getGeyserSession(CommandSender sender) {
public GeyserSession getGeyserSession(CommandSender sender) {
if (sender.isConsole()) {
return null;
}
for (GeyserSessionImpl session : geyser.getSessionManager().getSessions().values()) {
for (GeyserSession session : geyser.getSessionManager().getSessions().values()) {
if (sender.name().equals(session.getPlayerEntity().getUsername())) {
return session;
}

Datei anzeigen

@ -30,7 +30,7 @@ import lombok.Getter;
import org.geysermc.common.PlatformType;
import org.geysermc.geyser.GeyserImpl;
import org.geysermc.geyser.command.defaults.*;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.text.GeyserLocale;
import java.util.*;
@ -93,8 +93,8 @@ public abstract class CommandManager {
return;
}
if (sender instanceof GeyserSessionImpl) {
cmd.execute((GeyserSessionImpl) sender, sender, args);
if (sender instanceof GeyserSession) {
cmd.execute((GeyserSession) sender, sender, args);
} else {
if (!cmd.isBedrockOnly()) {
cmd.execute(null, sender, args);

Datei anzeigen

@ -28,7 +28,7 @@ package org.geysermc.geyser.command;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import javax.annotation.Nullable;
import java.util.ArrayList;
@ -49,7 +49,7 @@ public abstract class GeyserCommand {
@Setter
private List<String> aliases = new ArrayList<>();
public abstract void execute(@Nullable GeyserSessionImpl session, CommandSender sender, String[] args);
public abstract void execute(@Nullable GeyserSession session, CommandSender sender, String[] args);
/**
* If false, hides the command from being shown on the Geyser Standalone GUI.

Datei anzeigen

@ -27,7 +27,7 @@ package org.geysermc.geyser.command.defaults;
import org.geysermc.geyser.command.CommandSender;
import org.geysermc.geyser.command.GeyserCommand;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
public class AdvancementsCommand extends GeyserCommand {
public AdvancementsCommand(String name, String description, String permission) {
@ -35,7 +35,7 @@ public class AdvancementsCommand extends GeyserCommand {
}
@Override
public void execute(GeyserSessionImpl session, CommandSender sender, String[] args) {
public void execute(GeyserSession session, CommandSender sender, String[] args) {
if (session != null) {
session.getAdvancementsCache().buildAndShowMenuForm();
}

Datei anzeigen

@ -36,7 +36,7 @@ import org.geysermc.geyser.command.GeyserCommand;
import org.geysermc.geyser.text.ChatColor;
import org.geysermc.geyser.text.AsteriskSerializer;
import org.geysermc.geyser.dump.DumpInfo;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.text.GeyserLocale;
import org.geysermc.geyser.util.WebUtils;
@ -58,7 +58,7 @@ public class DumpCommand extends GeyserCommand {
}
@Override
public void execute(GeyserSessionImpl session, CommandSender sender, String[] args) {
public void execute(GeyserSession session, CommandSender sender, String[] args) {
// Only allow the console to create dumps on Geyser Standalone
if (!sender.isConsole() && geyser.getPlatformType() == PlatformType.STANDALONE) {
sender.sendMessage(GeyserLocale.getPlayerLocaleString("geyser.bootstrap.command.permission_fail", sender.getLocale()));

Datei anzeigen

@ -29,7 +29,7 @@ import org.geysermc.geyser.GeyserImpl;
import org.geysermc.geyser.command.CommandSender;
import org.geysermc.geyser.command.GeyserCommand;
import org.geysermc.geyser.text.ChatColor;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.text.GeyserLocale;
import java.util.Collections;
@ -53,7 +53,7 @@ public class HelpCommand extends GeyserCommand {
* @param args Not used.
*/
@Override
public void execute(GeyserSessionImpl session, CommandSender sender, String[] args) {
public void execute(GeyserSession session, CommandSender sender, String[] args) {
int page = 1;
int maxPage = 1;
String header = GeyserLocale.getPlayerLocaleString("geyser.commands.help.header", sender.getLocale(), page, maxPage);

Datei anzeigen

@ -28,7 +28,7 @@ package org.geysermc.geyser.command.defaults;
import org.geysermc.geyser.GeyserImpl;
import org.geysermc.geyser.command.CommandSender;
import org.geysermc.geyser.command.GeyserCommand;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.text.GeyserLocale;
import java.util.stream.Collectors;
@ -44,10 +44,10 @@ public class ListCommand extends GeyserCommand {
}
@Override
public void execute(GeyserSessionImpl session, CommandSender sender, String[] args) {
public void execute(GeyserSession session, CommandSender sender, String[] args) {
String message = GeyserLocale.getPlayerLocaleString("geyser.commands.list.message", sender.getLocale(),
geyser.getSessionManager().size(),
geyser.getSessionManager().getAllSessions().stream().map(GeyserSessionImpl::name).collect(Collectors.joining(" ")));
geyser.getSessionManager().getAllSessions().stream().map(GeyserSession::name).collect(Collectors.joining(" ")));
sender.sendMessage(message);
}

Datei anzeigen

@ -31,7 +31,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.serverbound.player.Server
import org.geysermc.geyser.GeyserImpl;
import org.geysermc.geyser.command.CommandSender;
import org.geysermc.geyser.command.GeyserCommand;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.util.BlockUtils;
public class OffhandCommand extends GeyserCommand {
@ -41,7 +41,7 @@ public class OffhandCommand extends GeyserCommand {
}
@Override
public void execute(GeyserSessionImpl session, CommandSender sender, String[] args) {
public void execute(GeyserSession session, CommandSender sender, String[] args) {
if (session == null) {
return;
}

Datei anzeigen

@ -29,7 +29,7 @@ import org.geysermc.common.PlatformType;
import org.geysermc.geyser.GeyserImpl;
import org.geysermc.geyser.command.CommandSender;
import org.geysermc.geyser.command.GeyserCommand;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.text.GeyserLocale;
public class ReloadCommand extends GeyserCommand {
@ -42,7 +42,7 @@ public class ReloadCommand extends GeyserCommand {
}
@Override
public void execute(GeyserSessionImpl session, CommandSender sender, String[] args) {
public void execute(GeyserSession session, CommandSender sender, String[] args) {
if (!sender.isConsole() && geyser.getPlatformType() == PlatformType.STANDALONE) {
return;
}

Datei anzeigen

@ -28,7 +28,7 @@ package org.geysermc.geyser.command.defaults;
import org.geysermc.geyser.GeyserImpl;
import org.geysermc.geyser.command.CommandSender;
import org.geysermc.geyser.command.GeyserCommand;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.util.SettingsUtils;
public class SettingsCommand extends GeyserCommand {
@ -37,7 +37,7 @@ public class SettingsCommand extends GeyserCommand {
}
@Override
public void execute(GeyserSessionImpl session, CommandSender sender, String[] args) {
public void execute(GeyserSession session, CommandSender sender, String[] args) {
if (session != null) {
session.sendForm(SettingsUtils.buildForm(session));
}

Datei anzeigen

@ -30,7 +30,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.serverbound.ServerboundCl
import org.geysermc.geyser.GeyserImpl;
import org.geysermc.geyser.command.CommandSender;
import org.geysermc.geyser.command.GeyserCommand;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
public class StatisticsCommand extends GeyserCommand {
@ -39,7 +39,7 @@ public class StatisticsCommand extends GeyserCommand {
}
@Override
public void execute(GeyserSessionImpl session, CommandSender sender, String[] args) {
public void execute(GeyserSession session, CommandSender sender, String[] args) {
if (session == null) return;
session.setWaitingForStatistics(true);

Datei anzeigen

@ -29,7 +29,7 @@ import org.geysermc.common.PlatformType;
import org.geysermc.geyser.GeyserImpl;
import org.geysermc.geyser.command.CommandSender;
import org.geysermc.geyser.command.GeyserCommand;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.text.GeyserLocale;
import java.util.Collections;
@ -46,7 +46,7 @@ public class StopCommand extends GeyserCommand {
}
@Override
public void execute(GeyserSessionImpl session, CommandSender sender, String[] args) {
public void execute(GeyserSession session, CommandSender sender, String[] args) {
if (!sender.isConsole() && geyser.getPlatformType() == PlatformType.STANDALONE) {
sender.sendMessage(GeyserLocale.getPlayerLocaleString("geyser.bootstrap.command.permission_fail", sender.getLocale()));
return;

Datei anzeigen

@ -32,7 +32,7 @@ import org.geysermc.geyser.command.CommandSender;
import org.geysermc.geyser.command.GeyserCommand;
import org.geysermc.geyser.text.ChatColor;
import org.geysermc.geyser.network.MinecraftProtocol;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.util.FileUtils;
import org.geysermc.geyser.text.GeyserLocale;
import org.geysermc.geyser.util.WebUtils;
@ -54,7 +54,7 @@ public class VersionCommand extends GeyserCommand {
}
@Override
public void execute(GeyserSessionImpl session, CommandSender sender, String[] args) {
public void execute(GeyserSession session, CommandSender sender, String[] args) {
String bedrockVersions;
List<BedrockPacketCodec> supportedCodecs = MinecraftProtocol.SUPPORTED_BEDROCK_CODECS;
if (supportedCodecs.size() > 1) {

Datei anzeigen

@ -39,7 +39,7 @@ import org.geysermc.geyser.GeyserImpl;
import org.geysermc.geyser.text.AsteriskSerializer;
import org.geysermc.geyser.configuration.GeyserConfiguration;
import org.geysermc.geyser.network.MinecraftProtocol;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.util.FileUtils;
import org.geysermc.geyser.util.WebUtils;
import org.geysermc.floodgate.util.DeviceOs;
@ -113,7 +113,7 @@ public class DumpInfo {
}
this.userPlatforms = new Object2IntOpenHashMap<>();
for (GeyserSessionImpl session : GeyserImpl.getInstance().getSessionManager().getAllSessions()) {
for (GeyserSession session : GeyserImpl.getInstance().getSessionManager().getAllSessions()) {
DeviceOs device = session.getClientData().getDeviceOs();
userPlatforms.put(device, userPlatforms.getOrDefault(device, 0) + 1);
}

Datei anzeigen

@ -36,7 +36,7 @@ import org.geysermc.geyser.entity.type.living.animal.horse.HorseEntity;
import org.geysermc.geyser.entity.type.living.animal.tameable.CatEntity;
import org.geysermc.geyser.entity.type.living.animal.tameable.WolfEntity;
import org.geysermc.geyser.entity.type.living.merchant.VillagerEntity;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.registry.type.ItemMapping;
import java.util.EnumSet;
@ -62,7 +62,7 @@ public class InteractiveTagManager {
* @param session the Bedrock client session
* @param interactEntity the entity that the client is currently facing.
*/
public static void updateTag(GeyserSessionImpl session, Entity interactEntity) {
public static void updateTag(GeyserSession session, Entity interactEntity) {
ItemMapping mapping = session.getPlayerInventory().getItemInHand().getMapping(session);
String javaIdentifierStripped = mapping.getJavaIdentifier().replace("minecraft:", "");
EntityType entityType = interactEntity.getDefinition().entityType();

Datei anzeigen

@ -28,12 +28,12 @@ package org.geysermc.geyser.entity.factory;
import com.nukkitx.math.vector.Vector3f;
import org.geysermc.geyser.entity.type.Entity;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import java.util.UUID;
@FunctionalInterface
public interface BaseEntityFactory<T extends Entity> extends EntityFactory<T> {
T create(GeyserSessionImpl session, long javaId, long bedrockId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw);
T create(GeyserSession session, long javaId, long bedrockId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw);
}

Datei anzeigen

@ -27,10 +27,10 @@ package org.geysermc.geyser.entity.factory;
import com.nukkitx.math.vector.Vector3f;
import org.geysermc.geyser.entity.type.ExpOrbEntity;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
@FunctionalInterface
public interface ExperienceOrbEntityFactory extends EntityFactory<ExpOrbEntity> {
ExpOrbEntity create(GeyserSessionImpl session, int amount, long entityId, long geyserId, Vector3f position);
ExpOrbEntity create(GeyserSession session, int amount, long entityId, long geyserId, Vector3f position);
}

Datei anzeigen

@ -27,12 +27,12 @@ package org.geysermc.geyser.entity.factory;
import com.nukkitx.math.vector.Vector3f;
import org.geysermc.geyser.entity.type.PaintingEntity;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.level.PaintingType;
import java.util.UUID;
public interface PaintingEntityFactory extends EntityFactory<PaintingEntity> {
PaintingEntity create(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, Vector3f position, PaintingType paintingName, int direction);
PaintingEntity create(GeyserSession session, long entityId, long geyserId, UUID uuid, Vector3f position, PaintingType paintingName, int direction);
}

Datei anzeigen

@ -30,13 +30,13 @@ import com.github.steveice10.mc.protocol.data.game.entity.type.EntityType;
import com.nukkitx.math.vector.Vector3f;
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import java.util.UUID;
public class AbstractArrowEntity extends Entity {
public AbstractArrowEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public AbstractArrowEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
// Set the correct texture if using the resource pack

Datei anzeigen

@ -32,14 +32,14 @@ import com.nukkitx.math.vector.Vector3f;
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.registry.Registries;
import java.util.UUID;
public class AreaEffectCloudEntity extends Entity {
public AreaEffectCloudEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public AreaEffectCloudEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}

Datei anzeigen

@ -34,7 +34,7 @@ import com.nukkitx.protocol.bedrock.packet.MoveEntityAbsolutePacket;
import lombok.Getter;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.entity.EntityDefinitions;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
@ -65,7 +65,7 @@ public class BoatEntity extends Entity {
// Looks too fast and too choppy with 0.1f, which is how I believe the Microsoftian client handles it
private final float ROWING_SPEED = 0.05f;
public BoatEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public BoatEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
// Initial rotation is incorrect
super(session, entityId, geyserId, uuid, definition, position.add(0d, definition.offset(), 0d), motion, yaw + 90, 0, yaw + 90);
@ -154,7 +154,7 @@ public class BoatEntity extends Entity {
}
}
private void updateLeftPaddle(GeyserSessionImpl session, Entity rower) {
private void updateLeftPaddle(GeyserSession session, Entity rower) {
if (isPaddlingLeft) {
paddleTimeLeft += ROWING_SPEED;
sendAnimationPacket(session, rower, AnimatePacket.Action.ROW_LEFT, paddleTimeLeft);
@ -167,7 +167,7 @@ public class BoatEntity extends Entity {
}
}
private void updateRightPaddle(GeyserSessionImpl session, Entity rower) {
private void updateRightPaddle(GeyserSession session, Entity rower) {
if (isPaddlingRight) {
paddleTimeRight += ROWING_SPEED;
sendAnimationPacket(session, rower, AnimatePacket.Action.ROW_RIGHT, paddleTimeRight);
@ -180,7 +180,7 @@ public class BoatEntity extends Entity {
}
}
private void sendAnimationPacket(GeyserSessionImpl session, Entity rower, AnimatePacket.Action action, float rowTime) {
private void sendAnimationPacket(GeyserSession session, Entity rower, AnimatePacket.Action action, float rowTime) {
AnimatePacket packet = new AnimatePacket();
packet.setRuntimeEntityId(rower.getGeyserId());
packet.setAction(action);

Datei anzeigen

@ -28,13 +28,13 @@ package org.geysermc.geyser.entity.type;
import com.nukkitx.math.vector.Vector3f;
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import java.util.UUID;
public class CommandBlockMinecartEntity extends DefaultBlockMinecartEntity {
public CommandBlockMinecartEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public CommandBlockMinecartEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}

Datei anzeigen

@ -30,7 +30,7 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.IntEntit
import com.nukkitx.math.vector.Vector3f;
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import java.util.UUID;
@ -43,7 +43,7 @@ public class DefaultBlockMinecartEntity extends MinecartEntity {
public int customBlockOffset = 0;
public boolean showCustomBlock = false;
public DefaultBlockMinecartEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public DefaultBlockMinecartEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
dirtyMetadata.put(EntityData.CUSTOM_DISPLAY, (byte) 1);

Datei anzeigen

@ -32,14 +32,14 @@ import com.nukkitx.math.vector.Vector3i;
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import java.util.Optional;
import java.util.UUID;
public class EnderCrystalEntity extends Entity {
public EnderCrystalEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public EnderCrystalEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}

Datei anzeigen

@ -45,7 +45,7 @@ import lombok.Setter;
import net.kyori.adventure.text.Component;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.entity.GeyserDirtyMetadata;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.translator.text.MessageTranslator;
import org.geysermc.geyser.util.MathUtils;
@ -55,7 +55,7 @@ import java.util.UUID;
@Getter
@Setter
public class Entity {
protected final GeyserSessionImpl session;
protected final GeyserSession session;
protected long entityId;
protected final long geyserId;
@ -108,7 +108,7 @@ public class Entity {
@Setter(AccessLevel.PROTECTED) // For players
private boolean flagsDirty = false;
public Entity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public Entity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
this.session = session;
this.entityId = entityId;

Datei anzeigen

@ -28,13 +28,13 @@ package org.geysermc.geyser.entity.type;
import com.nukkitx.math.vector.Vector3f;
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
import org.geysermc.geyser.entity.EntityDefinitions;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
public class ExpOrbEntity extends Entity {
private final int amount;
public ExpOrbEntity(GeyserSessionImpl session, int amount, long entityId, long geyserId, Vector3f position) {
public ExpOrbEntity(GeyserSession session, int amount, long entityId, long geyserId, Vector3f position) {
super(session, entityId, geyserId, null, EntityDefinitions.EXPERIENCE_ORB, position, Vector3f.ZERO, 0, 0, 0);
this.amount = amount;

Datei anzeigen

@ -30,14 +30,14 @@ import com.nukkitx.math.vector.Vector3f;
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
import org.geysermc.geyser.entity.EntityDefinitions;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import java.util.UUID;
public class FallingBlockEntity extends Entity {
private final int javaId;
public FallingBlockEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, Vector3f position, Vector3f motion, float yaw, float pitch, int javaId) {
public FallingBlockEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, Vector3f position, Vector3f motion, float yaw, float pitch, int javaId) {
super(session, entityId, geyserId, uuid, EntityDefinitions.FALLING_BLOCK, position, motion, yaw, pitch, 0f);
this.javaId = javaId;
}

Datei anzeigen

@ -38,7 +38,7 @@ import com.nukkitx.protocol.bedrock.data.entity.EntityData;
import com.nukkitx.protocol.bedrock.packet.SetEntityMotionPacket;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.entity.type.player.PlayerEntity;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.level.FireworkColor;
import org.geysermc.geyser.util.MathUtils;
import org.geysermc.floodgate.util.DeviceOs;
@ -50,7 +50,7 @@ import java.util.UUID;
public class FireworkEntity extends Entity {
public FireworkEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public FireworkEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}

Datei anzeigen

@ -33,7 +33,7 @@ import com.nukkitx.protocol.bedrock.packet.PlaySoundPacket;
import lombok.Getter;
import org.geysermc.geyser.entity.EntityDefinitions;
import org.geysermc.geyser.entity.type.player.PlayerEntity;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.level.physics.BoundingBox;
import org.geysermc.geyser.translator.collision.BlockCollision;
import org.geysermc.geyser.level.block.BlockStateValues;
@ -56,7 +56,7 @@ public class FishingHookEntity extends ThrowableEntity {
private final BoundingBox boundingBox;
public FishingHookEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, Vector3f position, Vector3f motion, float yaw, float pitch, PlayerEntity owner) {
public FishingHookEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, Vector3f position, Vector3f motion, float yaw, float pitch, PlayerEntity owner) {
super(session, entityId, geyserId, uuid, EntityDefinitions.FISHING_BOBBER, position, motion, yaw, pitch, 0f);
this.boundingBox = new BoundingBox(0.125, 0.125, 0.125, 0.25, 0.25, 0.25);
@ -140,7 +140,7 @@ public class FishingHookEntity extends ThrowableEntity {
}
}
private void sendSplashSound(GeyserSessionImpl session) {
private void sendSplashSound(GeyserSession session) {
if (!getFlag(EntityFlag.SILENT)) {
float volume = (float) (0.2f * Math.sqrt(0.2 * (motion.getX() * motion.getX() + motion.getZ() * motion.getZ()) + motion.getY() * motion.getY()));
if (volume > 1) {

Datei anzeigen

@ -29,7 +29,7 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanE
import com.nukkitx.math.vector.Vector3f;
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.level.block.BlockStateValues;
import java.util.UUID;
@ -37,7 +37,7 @@ import java.util.UUID;
public class FurnaceMinecartEntity extends DefaultBlockMinecartEntity {
private boolean hasFuel = false;
public FurnaceMinecartEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public FurnaceMinecartEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}

Datei anzeigen

@ -35,7 +35,7 @@ import com.nukkitx.protocol.bedrock.data.inventory.ItemData;
import com.nukkitx.protocol.bedrock.packet.AddItemEntityPacket;
import com.nukkitx.protocol.bedrock.packet.EntityEventPacket;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.translator.inventory.item.ItemTranslator;
import org.geysermc.geyser.level.block.BlockStateValues;
@ -46,7 +46,7 @@ public class ItemEntity extends ThrowableEntity {
private int waterLevel = -1;
public ItemEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public ItemEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}

Datei anzeigen

@ -40,7 +40,7 @@ import com.nukkitx.protocol.bedrock.packet.UpdateBlockPacket;
import com.nukkitx.protocol.bedrock.v465.Bedrock_v465;
import lombok.Getter;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.translator.inventory.item.ItemTranslator;
import org.geysermc.geyser.registry.type.ItemMapping;
@ -77,7 +77,7 @@ public class ItemFrameEntity extends Entity {
*/
private boolean changed = true;
public ItemFrameEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, Direction direction) {
public ItemFrameEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, Direction direction) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, 0f);
NbtMapBuilder blockBuilder = NbtMap.builder()
@ -211,10 +211,10 @@ public class ItemFrameEntity extends Entity {
/**
* Finds the Java entity ID of an item frame from its Bedrock position.
* @param position position of item frame in Bedrock.
* @param session GeyserSession.
* @param session GeyserConnection.
* @return Java entity ID or -1 if not found.
*/
public static ItemFrameEntity getItemFrameEntity(GeyserSessionImpl session, Vector3i position) {
public static ItemFrameEntity getItemFrameEntity(GeyserSession session, Vector3i position) {
return session.getItemFrameCache().get(position);
}
}

Datei anzeigen

@ -27,7 +27,7 @@ package org.geysermc.geyser.entity.type;
import com.nukkitx.math.vector.Vector3f;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import java.util.UUID;
@ -39,7 +39,7 @@ public class ItemedFireballEntity extends ThrowableEntity {
*/
protected int futureTicks = 3;
public ItemedFireballEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public ItemedFireballEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, Vector3f.ZERO, yaw, pitch, headYaw);
float magnitude = motion.length();

Datei anzeigen

@ -27,13 +27,13 @@ package org.geysermc.geyser.entity.type;
import com.nukkitx.math.vector.Vector3f;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import java.util.UUID;
public class LeashKnotEntity extends Entity {
public LeashKnotEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public LeashKnotEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
// Position is incorrect by default
super(session, entityId, geyserId, uuid, definition, position.add(0.5f, 0.25f, 0.5f), motion, yaw, pitch, headYaw);
}

Datei anzeigen

@ -28,14 +28,14 @@ package org.geysermc.geyser.entity.type;
import com.nukkitx.math.vector.Vector3f;
import com.nukkitx.protocol.bedrock.packet.PlaySoundPacket;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import java.util.UUID;
import java.util.concurrent.ThreadLocalRandom;
public class LightningEntity extends Entity {
public LightningEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public LightningEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}

Datei anzeigen

@ -47,7 +47,7 @@ import lombok.Getter;
import lombok.Setter;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.entity.attribute.GeyserAttributeType;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.registry.type.ItemMapping;
import org.geysermc.geyser.util.AttributeUtils;
import org.geysermc.geyser.util.ChunkUtils;
@ -79,7 +79,7 @@ public class LivingEntity extends Entity {
*/
private boolean isMaxFrozenState = false;
public LivingEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public LivingEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}
@ -168,7 +168,7 @@ public class LivingEntity extends Entity {
return new AttributeData(GeyserAttributeType.HEALTH.getBedrockIdentifier(), 0f, this.maxHealth, (float) Math.ceil(this.health), this.maxHealth);
}
public void updateArmor(GeyserSessionImpl session) {
public void updateArmor(GeyserSession session) {
if (!valid) return;
ItemData helmet = this.helmet;
@ -194,7 +194,7 @@ public class LivingEntity extends Entity {
session.sendUpstreamPacket(armorEquipmentPacket);
}
public void updateMainHand(GeyserSessionImpl session) {
public void updateMainHand(GeyserSession session) {
if (!valid) return;
MobEquipmentPacket handPacket = new MobEquipmentPacket();
@ -207,7 +207,7 @@ public class LivingEntity extends Entity {
session.sendUpstreamPacket(handPacket);
}
public void updateOffHand(GeyserSessionImpl session) {
public void updateOffHand(GeyserSession session) {
if (!valid) return;
MobEquipmentPacket offHandPacket = new MobEquipmentPacket();
@ -226,7 +226,7 @@ public class LivingEntity extends Entity {
*
* @param attributes the Java list of attributes sent from the server
*/
public void updateBedrockAttributes(GeyserSessionImpl session, List<Attribute> attributes) {
public void updateBedrockAttributes(GeyserSession session, List<Attribute> attributes) {
if (!valid) return;
List<AttributeData> newAttributes = new ArrayList<>();

Datei anzeigen

@ -30,13 +30,13 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.IntEntit
import com.nukkitx.math.vector.Vector3f;
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import java.util.UUID;
public class MinecartEntity extends Entity {
public MinecartEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public MinecartEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position.add(0d, definition.offset(), 0d), motion, yaw, pitch, headYaw);
}

Datei anzeigen

@ -28,7 +28,7 @@ package org.geysermc.geyser.entity.type;
import com.nukkitx.math.vector.Vector3f;
import com.nukkitx.protocol.bedrock.packet.AddPaintingPacket;
import org.geysermc.geyser.entity.EntityDefinitions;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.level.PaintingType;
import java.util.UUID;
@ -38,7 +38,7 @@ public class PaintingEntity extends Entity {
private final PaintingType paintingName;
private final int direction;
public PaintingEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, Vector3f position, PaintingType paintingName, int direction) {
public PaintingEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, Vector3f position, PaintingType paintingName, int direction) {
super(session, entityId, geyserId, uuid, EntityDefinitions.PAINTING, position, Vector3f.ZERO, 0f, 0f, 0f);
this.paintingName = paintingName;
this.direction = direction;

Datei anzeigen

@ -28,14 +28,14 @@ package org.geysermc.geyser.entity.type;
import com.nukkitx.math.vector.Vector3f;
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.level.block.BlockStateValues;
import java.util.UUID;
public class SpawnerMinecartEntity extends DefaultBlockMinecartEntity {
public SpawnerMinecartEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public SpawnerMinecartEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}

Datei anzeigen

@ -31,14 +31,14 @@ import com.nukkitx.protocol.bedrock.data.entity.EntityData;
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
import com.nukkitx.protocol.bedrock.packet.SetEntityDataPacket;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import java.util.UUID;
public class TNTEntity extends Entity implements Tickable {
private int currentTick;
public TNTEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public TNTEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}

Datei anzeigen

@ -32,7 +32,7 @@ import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
import com.nukkitx.protocol.bedrock.packet.LevelEventPacket;
import com.nukkitx.protocol.bedrock.packet.MoveEntityDeltaPacket;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.level.block.BlockStateValues;
import java.util.UUID;
@ -44,7 +44,7 @@ public class ThrowableEntity extends Entity implements Tickable {
protected Vector3f lastJavaPosition;
public ThrowableEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public ThrowableEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
this.lastJavaPosition = position;
}

Datei anzeigen

@ -28,7 +28,7 @@ package org.geysermc.geyser.entity.type;
import com.nukkitx.math.vector.Vector3f;
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import java.util.UUID;
@ -42,7 +42,7 @@ public class ThrowableItemEntity extends ThrowableEntity {
private int age;
private boolean invisible;
public ThrowableItemEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public ThrowableItemEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
setFlag(EntityFlag.INVISIBLE, true);
invisible = false;

Datei anzeigen

@ -34,7 +34,7 @@ import com.nukkitx.protocol.bedrock.data.entity.EntityData;
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
import org.geysermc.geyser.GeyserImpl;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.inventory.item.Potion;
import org.geysermc.geyser.registry.type.ItemMapping;
@ -44,7 +44,7 @@ import java.util.UUID;
public class ThrownPotionEntity extends ThrowableItemEntity {
private static final EnumSet<Potion> NON_ENCHANTED_POTIONS = EnumSet.of(Potion.WATER, Potion.MUNDANE, Potion.THICK, Potion.AWKWARD);
public ThrownPotionEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public ThrownPotionEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}

Datei anzeigen

@ -29,7 +29,7 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.IntEntit
import com.nukkitx.math.vector.Vector3f;
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.inventory.item.TippedArrowPotion;
import java.util.UUID;
@ -39,7 +39,7 @@ import java.util.UUID;
*/
public class TippedArrowEntity extends AbstractArrowEntity {
public TippedArrowEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public TippedArrowEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}

Datei anzeigen

@ -27,13 +27,13 @@ package org.geysermc.geyser.entity.type;
import com.nukkitx.math.vector.Vector3f;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import java.util.UUID;
public class TridentEntity extends AbstractArrowEntity {
public TridentEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public TridentEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}
}

Datei anzeigen

@ -29,14 +29,14 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanE
import com.nukkitx.math.vector.Vector3f;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.entity.EntityDefinitions;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import java.util.UUID;
public class WitherSkullEntity extends ItemedFireballEntity {
private boolean isCharged;
public WitherSkullEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public WitherSkullEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
this.futureTicks = 1;

Datei anzeigen

@ -28,13 +28,13 @@ package org.geysermc.geyser.entity.type.living;
import com.nukkitx.math.vector.Vector3f;
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import java.util.UUID;
public class AbstractFishEntity extends WaterEntity {
public AbstractFishEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public AbstractFishEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
setFlag(EntityFlag.CAN_SWIM, true);

Datei anzeigen

@ -30,13 +30,13 @@ import com.nukkitx.math.vector.Vector3f;
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import java.util.UUID;
public class AgeableEntity extends CreatureEntity {
public AgeableEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public AgeableEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}

Datei anzeigen

@ -27,13 +27,13 @@ package org.geysermc.geyser.entity.type.living;
import com.nukkitx.math.vector.Vector3f;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import java.util.UUID;
public class AmbientEntity extends MobEntity {
public AmbientEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public AmbientEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}
}

Datei anzeigen

@ -38,7 +38,7 @@ import net.kyori.adventure.text.Component;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.entity.EntityDefinitions;
import org.geysermc.geyser.entity.type.LivingEntity;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import java.util.Optional;
import java.util.UUID;
@ -78,7 +78,7 @@ public class ArmorStandEntity extends LivingEntity {
*/
private boolean positionUpdateRequired = false;
public ArmorStandEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public ArmorStandEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}

Datei anzeigen

@ -29,13 +29,13 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.ByteEnti
import com.nukkitx.math.vector.Vector3f;
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import java.util.UUID;
public class BatEntity extends AmbientEntity {
public BatEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public BatEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}

Datei anzeigen

@ -27,13 +27,13 @@ package org.geysermc.geyser.entity.type.living;
import com.nukkitx.math.vector.Vector3f;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import java.util.UUID;
public class CreatureEntity extends MobEntity {
public CreatureEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public CreatureEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}
}

Datei anzeigen

@ -27,13 +27,13 @@ package org.geysermc.geyser.entity.type.living;
import com.nukkitx.math.vector.Vector3f;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import java.util.UUID;
public class FlyingEntity extends MobEntity {
public FlyingEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public FlyingEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}
}

Datei anzeigen

@ -27,12 +27,12 @@ package org.geysermc.geyser.entity.type.living;
import com.nukkitx.math.vector.Vector3f;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import java.util.UUID;
public class GlowSquidEntity extends SquidEntity {
public GlowSquidEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public GlowSquidEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}
}

Datei anzeigen

@ -27,13 +27,13 @@ package org.geysermc.geyser.entity.type.living;
import com.nukkitx.math.vector.Vector3f;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import java.util.UUID;
public class GolemEntity extends CreatureEntity {
public GolemEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public GolemEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}
}

Datei anzeigen

@ -29,13 +29,13 @@ import com.nukkitx.math.vector.Vector3f;
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import java.util.UUID;
public class IronGolemEntity extends GolemEntity {
public IronGolemEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public IronGolemEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
// Indicate that we should show cracks through a resource pack
setFlag(EntityFlag.BRIBED, true);

Datei anzeigen

@ -28,13 +28,13 @@ package org.geysermc.geyser.entity.type.living;
import com.nukkitx.math.vector.Vector3f;
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import java.util.UUID;
public class MagmaCubeEntity extends SlimeEntity {
public MagmaCubeEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public MagmaCubeEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}

Datei anzeigen

@ -32,7 +32,7 @@ import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
import lombok.Getter;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.entity.type.LivingEntity;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import java.util.UUID;
@ -43,7 +43,7 @@ public class MobEntity extends LivingEntity {
@Getter
private long leashHolderBedrockId;
public MobEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public MobEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}

Datei anzeigen

@ -29,13 +29,13 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.IntEntit
import com.nukkitx.math.vector.Vector3f;
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import java.util.UUID;
public class SlimeEntity extends MobEntity {
public SlimeEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public SlimeEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}

Datei anzeigen

@ -29,13 +29,13 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.ByteEnti
import com.nukkitx.math.vector.Vector3f;
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import java.util.UUID;
public class SnowGolemEntity extends GolemEntity {
public SnowGolemEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public SnowGolemEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}

Datei anzeigen

@ -30,7 +30,7 @@ import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
import com.nukkitx.protocol.bedrock.packet.MoveEntityDeltaPacket;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.entity.type.Tickable;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.level.block.BlockStateValues;
import java.util.UUID;
@ -41,7 +41,7 @@ public class SquidEntity extends WaterEntity implements Tickable {
private boolean inWater;
public SquidEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public SquidEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}

Datei anzeigen

@ -27,13 +27,13 @@ package org.geysermc.geyser.entity.type.living;
import com.nukkitx.math.vector.Vector3f;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import java.util.UUID;
public class WaterEntity extends CreatureEntity {
public WaterEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public WaterEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}
}

Datei anzeigen

@ -28,14 +28,14 @@ package org.geysermc.geyser.entity.type.living.animal;
import com.nukkitx.math.vector.Vector3f;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.entity.type.living.AgeableEntity;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.registry.type.ItemMapping;
import java.util.UUID;
public class AnimalEntity extends AgeableEntity {
public AnimalEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public AnimalEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}

Datei anzeigen

@ -31,13 +31,13 @@ import com.nukkitx.math.vector.Vector3f;
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.registry.type.ItemMapping;
import java.util.UUID;
public class AxolotlEntity extends AnimalEntity {
public AxolotlEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public AxolotlEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}

Datei anzeigen

@ -33,14 +33,14 @@ import com.nukkitx.protocol.bedrock.data.entity.EntityEventType;
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
import com.nukkitx.protocol.bedrock.packet.EntityEventPacket;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.registry.type.ItemMapping;
import java.util.UUID;
public class BeeEntity extends AnimalEntity {
public BeeEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public BeeEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}

Datei anzeigen

@ -27,14 +27,14 @@ package org.geysermc.geyser.entity.type.living.animal;
import com.nukkitx.math.vector.Vector3f;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.registry.type.ItemMapping;
import java.util.UUID;
public class ChickenEntity extends AnimalEntity {
public ChickenEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public ChickenEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}

Datei anzeigen

@ -31,14 +31,14 @@ import com.nukkitx.math.vector.Vector3f;
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.registry.type.ItemMapping;
import java.util.UUID;
public class FoxEntity extends AnimalEntity {
public FoxEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public FoxEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}

Datei anzeigen

@ -30,7 +30,7 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanE
import com.nukkitx.math.vector.Vector3f;
import lombok.Getter;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import java.util.UUID;
@ -41,7 +41,7 @@ public class GoatEntity extends AnimalEntity {
@Getter
private boolean isScreamer;
public GoatEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public GoatEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}

Datei anzeigen

@ -29,7 +29,7 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanE
import com.nukkitx.math.vector.Vector3f;
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.registry.type.ItemMapping;
import org.geysermc.geyser.util.DimensionUtils;
@ -38,7 +38,7 @@ import java.util.UUID;
public class HoglinEntity extends AnimalEntity {
private boolean isImmuneToZombification;
public HoglinEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public HoglinEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}

Datei anzeigen

@ -27,13 +27,13 @@ package org.geysermc.geyser.entity.type.living.animal;
import com.nukkitx.math.vector.Vector3f;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import java.util.UUID;
public class MooshroomEntity extends AnimalEntity {
public MooshroomEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public MooshroomEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}
}

Datei anzeigen

@ -27,14 +27,14 @@ package org.geysermc.geyser.entity.type.living.animal;
import com.nukkitx.math.vector.Vector3f;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.registry.type.ItemMapping;
import java.util.UUID;
public class OcelotEntity extends AnimalEntity {
public OcelotEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public OcelotEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}

Datei anzeigen

@ -33,7 +33,7 @@ import com.nukkitx.protocol.bedrock.data.entity.EntityEventType;
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
import com.nukkitx.protocol.bedrock.packet.EntityEventPacket;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.registry.type.ItemMapping;
import java.util.UUID;
@ -42,7 +42,7 @@ public class PandaEntity extends AnimalEntity {
private int mainGene;
private int hiddenGene;
public PandaEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public PandaEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}

Datei anzeigen

@ -27,14 +27,14 @@ package org.geysermc.geyser.entity.type.living.animal;
import com.nukkitx.math.vector.Vector3f;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.registry.type.ItemMapping;
import java.util.UUID;
public class PigEntity extends AnimalEntity {
public PigEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public PigEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}

Datei anzeigen

@ -27,14 +27,14 @@ package org.geysermc.geyser.entity.type.living.animal;
import com.nukkitx.math.vector.Vector3f;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.registry.type.ItemMapping;
import java.util.UUID;
public class PolarBearEntity extends AnimalEntity {
public PolarBearEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public PolarBearEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}

Datei anzeigen

@ -30,13 +30,13 @@ import com.nukkitx.math.vector.Vector3f;
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.entity.type.living.AbstractFishEntity;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import java.util.UUID;
public class PufferFishEntity extends AbstractFishEntity {
public PufferFishEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public PufferFishEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}

Datei anzeigen

@ -31,14 +31,14 @@ import com.nukkitx.math.vector.Vector3f;
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.registry.type.ItemMapping;
import java.util.UUID;
public class RabbitEntity extends AnimalEntity {
public RabbitEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public RabbitEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}

Datei anzeigen

@ -30,13 +30,13 @@ import com.nukkitx.math.vector.Vector3f;
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
import org.geysermc.geyser.entity.EntityDefinition;
import org.geysermc.geyser.session.GeyserSessionImpl;
import org.geysermc.geyser.session.GeyserSession;
import java.util.UUID;
public class SheepEntity extends AnimalEntity {
public SheepEntity(GeyserSessionImpl session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
public SheepEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
}

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden Mehr anzeigen