diff --git a/api/src/main/java/de/oliver/fancysitula/api/utils/ServerVersion.java b/api/src/main/java/de/oliver/fancysitula/api/utils/ServerVersion.java index 7b3643b..eb6f225 100644 --- a/api/src/main/java/de/oliver/fancysitula/api/utils/ServerVersion.java +++ b/api/src/main/java/de/oliver/fancysitula/api/utils/ServerVersion.java @@ -7,6 +7,7 @@ public enum ServerVersion { + v1_21_3("1.21.3", 768), v1_21_1("1.21.1", 767), v1_21("1.21", 767), v1_20_6("1.20.6", 766), diff --git a/build.gradle.kts b/build.gradle.kts index f22c0cd..2b25f8c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,7 +7,7 @@ plugins { allprojects { group = "de.oliver" - version = "0.0.10.1" + version = "0.0.10.2" description = "Simple, lightweight and fast library for minecraft internals" repositories { diff --git a/factories/build.gradle.kts b/factories/build.gradle.kts index e303422..dae80e5 100644 --- a/factories/build.gradle.kts +++ b/factories/build.gradle.kts @@ -6,6 +6,7 @@ dependencies { compileOnly("io.papermc.paper:paper-api:${findProperty("minecraftVersion")}-R0.1-SNAPSHOT") compileOnly(project(":api")) compileOnly(project(":implementations:1_20_6")) + compileOnly(project(":implementations:1_21_3")) } tasks { diff --git a/factories/src/main/java/de/oliver/fancysitula/factories/PacketFactory.java b/factories/src/main/java/de/oliver/fancysitula/factories/PacketFactory.java index 067fa3f..4af50c7 100644 --- a/factories/src/main/java/de/oliver/fancysitula/factories/PacketFactory.java +++ b/factories/src/main/java/de/oliver/fancysitula/factories/PacketFactory.java @@ -26,6 +26,9 @@ public FS_ClientboundPlayerInfoUpdatePacket createPlayerInfoUpdatePacket( ServerVersion serverVersion, EnumSet actions, List entries) { switch (serverVersion) { + case v1_21_3 -> { + return new de.oliver.fancysitula.versions.v1_21_3.packets.ClientboundPlayerInfoUpdatePacketImpl(actions, entries); + } case v1_20_5, v1_20_6, v1_21, v1_21_1 -> { return new de.oliver.fancysitula.versions.v1_20_6.packets.ClientboundPlayerInfoUpdatePacketImpl(actions, entries); } @@ -68,6 +71,9 @@ public FS_ClientboundAddEntityPacket createAddEntityPacket( int velocityZ, int data) { switch (serverVersion) { + case v1_21_3 -> { + return new de.oliver.fancysitula.versions.v1_21_3.packets.ClientboundAddEntityPacketImpl(entityId, entityUUID, entityType, x, y, z, yaw, pitch, headYaw, velocityX, velocityY, velocityZ, data); + } case v1_20_5, v1_20_6, v1_21, v1_21_1 -> { return new de.oliver.fancysitula.versions.v1_20_6.packets.ClientboundAddEntityPacketImpl(entityId, entityUUID, entityType, x, y, z, yaw, pitch, headYaw, velocityX, velocityY, velocityZ, data); } @@ -106,6 +112,9 @@ public FS_ClientboundAddEntityPacket createAddEntityPacket( */ public FS_ClientboundPlayerInfoRemovePacket createPlayerInfoRemovePacket(ServerVersion serverVersion, List uuids) { switch (serverVersion) { + case v1_21_3 -> { + return new de.oliver.fancysitula.versions.v1_21_3.packets.ClientboundPlayerInfoRemovePacketImpl(uuids); + } case v1_20_5, v1_20_6, v1_21, v1_21_1 -> { return new de.oliver.fancysitula.versions.v1_20_6.packets.ClientboundPlayerInfoRemovePacketImpl(uuids); } @@ -147,6 +156,9 @@ public FS_ClientboundPlayerInfoRemovePacket createPlayerInfoRemovePacket(UUID uu */ public FS_ClientboundRemoveEntitiesPacket createRemoveEntitiesPacket(ServerVersion serverVersion, List entityIds) { switch (serverVersion) { + case v1_21_3 -> { + return new de.oliver.fancysitula.versions.v1_21_3.packets.ClientboundRemoveEntitiesPacketImpl(entityIds); + } case v1_20_5, v1_20_6, v1_21, v1_21_1 -> { return new de.oliver.fancysitula.versions.v1_20_6.packets.ClientboundRemoveEntitiesPacketImpl(entityIds); } @@ -185,6 +197,9 @@ public FS_ClientboundTeleportEntityPacket createTeleportEntityPacket( boolean onGround ) { switch (serverVersion) { + case v1_21_3 -> { + return new de.oliver.fancysitula.versions.v1_21_3.packets.ClientboundTeleportEntityPacketImpl(entityId, x, y, z, yaw, pitch, onGround); + } case v1_20_5, v1_20_6, v1_21, v1_21_1 -> { return new de.oliver.fancysitula.versions.v1_20_6.packets.ClientboundTeleportEntityPacketImpl(entityId, x, y, z, yaw, pitch, onGround); } @@ -223,6 +238,9 @@ public FS_ClientboundTeleportEntityPacket createTeleportEntityPacket( */ public FS_ClientboundRotateHeadPacket createRotateHeadPacket(ServerVersion serverVersion, int entityId, float headYaw) { switch (serverVersion) { + case v1_21_3 -> { + return new de.oliver.fancysitula.versions.v1_21_3.packets.ClientboundRotateHeadPacketImpl(entityId, headYaw); + } case v1_20_5, v1_20_6, v1_21, v1_21_1 -> { return new de.oliver.fancysitula.versions.v1_20_6.packets.ClientboundRotateHeadPacketImpl(entityId, headYaw); } @@ -249,6 +267,9 @@ public FS_ClientboundRotateHeadPacket createRotateHeadPacket(int entityId, float public FS_ClientboundSetEntityDataPacket createSetEntityDataPacket( ServerVersion serverVersion, int entityId, List entityData) { switch (serverVersion) { + case v1_21_3 -> { + return new de.oliver.fancysitula.versions.v1_21_3.packets.ClientboundSetEntityDataPacketImpl(entityId, entityData); + } case v1_20_5, v1_20_6, v1_21, v1_21_1 -> { return new de.oliver.fancysitula.versions.v1_20_6.packets.ClientboundSetEntityDataPacketImpl(entityId, entityData); } @@ -274,6 +295,9 @@ public FS_ClientboundSetEntityDataPacket createSetEntityDataPacket(int entityId, */ public FS_ClientboundSetEquipmentPacket createSetEquipmentPacket(ServerVersion serverVersion, int entityId, Map equipment) { switch (serverVersion) { + case v1_21_3 -> { + return new de.oliver.fancysitula.versions.v1_21_3.packets.ClientboundSetEquipmentPacketImpl(entityId, equipment); + } case v1_20_5, v1_20_6, v1_21, v1_21_1 -> { return new de.oliver.fancysitula.versions.v1_20_6.packets.ClientboundSetEquipmentPacketImpl(entityId, equipment); } @@ -300,6 +324,9 @@ public FS_ClientboundSetEquipmentPacket createSetEquipmentPacket(int entityId, M public FS_ClientboundSetPassengersPacket createSetPassengersPacket( ServerVersion serverVersion, int entityId, List passengers) { switch (serverVersion) { + case v1_21_3 -> { + return new de.oliver.fancysitula.versions.v1_21_3.packets.ClientboundSetPassengersPacketImpl(entityId, passengers); + } case v1_20_5, v1_20_6, v1_21, v1_21_1 -> { return new de.oliver.fancysitula.versions.v1_20_6.packets.ClientboundSetPassengersPacketImpl(entityId, passengers); } @@ -329,6 +356,9 @@ public FS_ClientboundSetPassengersPacket createSetPassengersPacket(int entityId, */ public FS_ClientboundCreateOrUpdateTeamPacket createCreateOrUpdateTeamPacket(ServerVersion serverVersion, String teamName, FS_ClientboundCreateOrUpdateTeamPacket.CreateTeam createTeam) { switch (serverVersion) { + case v1_21_3 -> { + return new de.oliver.fancysitula.versions.v1_21_3.packets.ClientboundCreateOrUpdateTeamPacketImpl(teamName, createTeam); + } case v1_20_5, v1_20_6, v1_21, v1_21_1 -> { return new de.oliver.fancysitula.versions.v1_20_6.packets.ClientboundCreateOrUpdateTeamPacketImpl(teamName, createTeam); } @@ -358,6 +388,9 @@ public FS_ClientboundCreateOrUpdateTeamPacket createCreateOrUpdateTeamPacket(Str */ public FS_ClientboundCreateOrUpdateTeamPacket createCreateOrUpdateTeamPacket(ServerVersion serverVersion, String teamName, FS_ClientboundCreateOrUpdateTeamPacket.RemoveTeam removeTeam) { switch (serverVersion) { + case v1_21_3 -> { + return new de.oliver.fancysitula.versions.v1_21_3.packets.ClientboundCreateOrUpdateTeamPacketImpl(teamName, removeTeam); + } case v1_20_5, v1_20_6, v1_21, v1_21_1 -> { return new de.oliver.fancysitula.versions.v1_20_6.packets.ClientboundCreateOrUpdateTeamPacketImpl(teamName, removeTeam); } @@ -387,6 +420,9 @@ public FS_ClientboundCreateOrUpdateTeamPacket createCreateOrUpdateTeamPacket(Str */ public FS_ClientboundCreateOrUpdateTeamPacket createCreateOrUpdateTeamPacket(ServerVersion serverVersion, String teamName, FS_ClientboundCreateOrUpdateTeamPacket.UpdateTeam updateTeam) { switch (serverVersion) { + case v1_21_3 -> { + return new de.oliver.fancysitula.versions.v1_21_3.packets.ClientboundCreateOrUpdateTeamPacketImpl(teamName, updateTeam); + } case v1_20_5, v1_20_6, v1_21, v1_21_1 -> { return new de.oliver.fancysitula.versions.v1_20_6.packets.ClientboundCreateOrUpdateTeamPacketImpl(teamName, updateTeam); } @@ -416,6 +452,9 @@ public FS_ClientboundCreateOrUpdateTeamPacket createCreateOrUpdateTeamPacket(Str */ public FS_ClientboundCreateOrUpdateTeamPacket createCreateOrUpdateTeamPacket(ServerVersion serverVersion, String teamName, FS_ClientboundCreateOrUpdateTeamPacket.AddEntity addEntity) { switch (serverVersion) { + case v1_21_3 -> { + return new de.oliver.fancysitula.versions.v1_21_3.packets.ClientboundCreateOrUpdateTeamPacketImpl(teamName, addEntity); + } case v1_20_5, v1_20_6, v1_21, v1_21_1 -> { return new de.oliver.fancysitula.versions.v1_20_6.packets.ClientboundCreateOrUpdateTeamPacketImpl(teamName, addEntity); } @@ -445,6 +484,9 @@ public FS_ClientboundCreateOrUpdateTeamPacket createCreateOrUpdateTeamPacket(Str */ public FS_ClientboundCreateOrUpdateTeamPacket createCreateOrUpdateTeamPacket(ServerVersion serverVersion, String teamName, FS_ClientboundCreateOrUpdateTeamPacket.RemoveEntity removeEntity) { switch (serverVersion) { + case v1_21_3 -> { + return new de.oliver.fancysitula.versions.v1_21_3.packets.ClientboundCreateOrUpdateTeamPacketImpl(teamName, removeEntity); + } case v1_20_5, v1_20_6, v1_21, v1_21_1 -> { return new de.oliver.fancysitula.versions.v1_20_6.packets.ClientboundCreateOrUpdateTeamPacketImpl(teamName, removeEntity); } diff --git a/gradle.properties b/gradle.properties index ee84cbe..9491850 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,2 @@ -minecraftVersion=1.21 +minecraftVersion=1.21.3 fancyLoggerVersion=0.0.4 \ No newline at end of file diff --git a/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundTeleportEntityPacketImpl.java b/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundTeleportEntityPacketImpl.java deleted file mode 100644 index 9221e15..0000000 --- a/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundTeleportEntityPacketImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -package de.oliver.fancysitula.versions.v1_20_6.packets; - -import de.oliver.fancysitula.api.entities.FS_RealPlayer; -import de.oliver.fancysitula.api.packets.FS_ClientboundTeleportEntityPacket; -import de.oliver.fancysitula.api.utils.AngelConverter; -import de.oliver.fancysitula.api.utils.reflections.ReflectionUtils; -import de.oliver.fancysitula.versions.v1_20_6.utils.VanillaPlayerAdapter; -import net.minecraft.network.protocol.game.ClientboundTeleportEntityPacket; -import net.minecraft.server.level.ServerPlayer; - -public class ClientboundTeleportEntityPacketImpl extends FS_ClientboundTeleportEntityPacket { - - public ClientboundTeleportEntityPacketImpl(int entityId, double x, double y, double z, float yaw, float pitch, boolean onGround) { - super(entityId, x, y, z, yaw, pitch, onGround); - } - - @Override - public Object createPacket() { - ClientboundTeleportEntityPacket packet = null; - - try { - packet = ReflectionUtils.createUnsafeInstance(ClientboundTeleportEntityPacket.class); - ReflectionUtils.setFinalField(packet, "id", entityId); - ReflectionUtils.setFinalField(packet, "x", x); - ReflectionUtils.setFinalField(packet, "y", y); - ReflectionUtils.setFinalField(packet, "z", z); - ReflectionUtils.setFinalField(packet, "yRot", AngelConverter.degreesToVanillaByte(yaw)); - ReflectionUtils.setFinalField(packet, "xRot", AngelConverter.degreesToVanillaByte(pitch)); - ReflectionUtils.setFinalField(packet, "onGround", onGround); - } catch (Exception e) { - e.printStackTrace(); - } - return packet; - } - - @Override - public void sendPacketTo(FS_RealPlayer player) { - ClientboundTeleportEntityPacket packet = (ClientboundTeleportEntityPacket) createPacket(); - - ServerPlayer vanillaPlayer = VanillaPlayerAdapter.asVanilla(player.getBukkitPlayer()); - vanillaPlayer.connection.send(packet); - } -} diff --git a/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundAddEntityPacketImpl.java b/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundAddEntityPacketImpl.java similarity index 94% rename from implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundAddEntityPacketImpl.java rename to implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundAddEntityPacketImpl.java index 99f0f14..44572a0 100644 --- a/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundAddEntityPacketImpl.java +++ b/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundAddEntityPacketImpl.java @@ -1,9 +1,9 @@ -package de.oliver.fancysitula.versions.v1_20_6.packets; +package de.oliver.fancysitula.versions.v1_21_3.packets; import de.oliver.fancysitula.api.entities.FS_RealPlayer; import de.oliver.fancysitula.api.packets.FS_ClientboundAddEntityPacket; import de.oliver.fancysitula.api.utils.AngelConverter; -import de.oliver.fancysitula.versions.v1_20_6.utils.VanillaPlayerAdapter; +import de.oliver.fancysitula.versions.v1_21_3.utils.VanillaPlayerAdapter; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.network.protocol.game.ClientboundAddEntityPacket; import net.minecraft.server.level.ServerPlayer; diff --git a/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundCreateOrUpdateTeamPacketImpl.java b/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundCreateOrUpdateTeamPacketImpl.java similarity index 97% rename from implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundCreateOrUpdateTeamPacketImpl.java rename to implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundCreateOrUpdateTeamPacketImpl.java index 04aa823..39201c6 100644 --- a/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundCreateOrUpdateTeamPacketImpl.java +++ b/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundCreateOrUpdateTeamPacketImpl.java @@ -1,8 +1,8 @@ -package de.oliver.fancysitula.versions.v1_20_6.packets; +package de.oliver.fancysitula.versions.v1_21_3.packets; import de.oliver.fancysitula.api.entities.FS_RealPlayer; import de.oliver.fancysitula.api.packets.FS_ClientboundCreateOrUpdateTeamPacket; -import de.oliver.fancysitula.versions.v1_20_6.utils.VanillaPlayerAdapter; +import de.oliver.fancysitula.versions.v1_21_3.utils.VanillaPlayerAdapter; import io.papermc.paper.adventure.PaperAdventure; import net.minecraft.ChatFormatting; import net.minecraft.network.protocol.game.ClientboundSetPlayerTeamPacket; diff --git a/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundPlayerInfoRemovePacketImpl.java b/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundPlayerInfoRemovePacketImpl.java similarity index 88% rename from implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundPlayerInfoRemovePacketImpl.java rename to implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundPlayerInfoRemovePacketImpl.java index 8a4626f..b8fe806 100644 --- a/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundPlayerInfoRemovePacketImpl.java +++ b/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundPlayerInfoRemovePacketImpl.java @@ -1,8 +1,8 @@ -package de.oliver.fancysitula.versions.v1_20_6.packets; +package de.oliver.fancysitula.versions.v1_21_3.packets; import de.oliver.fancysitula.api.entities.FS_RealPlayer; import de.oliver.fancysitula.api.packets.FS_ClientboundPlayerInfoRemovePacket; -import de.oliver.fancysitula.versions.v1_20_6.utils.VanillaPlayerAdapter; +import de.oliver.fancysitula.versions.v1_21_3.utils.VanillaPlayerAdapter; import net.minecraft.network.protocol.game.ClientboundPlayerInfoRemovePacket; import net.minecraft.server.level.ServerPlayer; diff --git a/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundPlayerInfoUpdatePacketImpl.java b/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundPlayerInfoUpdatePacketImpl.java similarity index 91% rename from implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundPlayerInfoUpdatePacketImpl.java rename to implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundPlayerInfoUpdatePacketImpl.java index 97383bb..fe4d6c1 100644 --- a/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundPlayerInfoUpdatePacketImpl.java +++ b/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundPlayerInfoUpdatePacketImpl.java @@ -1,9 +1,9 @@ -package de.oliver.fancysitula.versions.v1_20_6.packets; +package de.oliver.fancysitula.versions.v1_21_3.packets; import de.oliver.fancysitula.api.entities.FS_RealPlayer; import de.oliver.fancysitula.api.packets.FS_ClientboundPlayerInfoUpdatePacket; -import de.oliver.fancysitula.versions.v1_20_6.utils.GameProfileImpl; -import de.oliver.fancysitula.versions.v1_20_6.utils.VanillaPlayerAdapter; +import de.oliver.fancysitula.versions.v1_21_3.utils.GameProfileImpl; +import de.oliver.fancysitula.versions.v1_21_3.utils.VanillaPlayerAdapter; import io.papermc.paper.adventure.PaperAdventure; import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket; import net.minecraft.server.level.ServerPlayer; diff --git a/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundRemoveEntitiesPacketImpl.java b/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundRemoveEntitiesPacketImpl.java similarity index 90% rename from implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundRemoveEntitiesPacketImpl.java rename to implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundRemoveEntitiesPacketImpl.java index 7b3c35a..90671fd 100644 --- a/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundRemoveEntitiesPacketImpl.java +++ b/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundRemoveEntitiesPacketImpl.java @@ -1,8 +1,8 @@ -package de.oliver.fancysitula.versions.v1_20_6.packets; +package de.oliver.fancysitula.versions.v1_21_3.packets; import de.oliver.fancysitula.api.entities.FS_RealPlayer; import de.oliver.fancysitula.api.packets.FS_ClientboundRemoveEntitiesPacket; -import de.oliver.fancysitula.versions.v1_20_6.utils.VanillaPlayerAdapter; +import de.oliver.fancysitula.versions.v1_21_3.utils.VanillaPlayerAdapter; import net.minecraft.network.protocol.game.ClientboundRemoveEntitiesPacket; import net.minecraft.server.level.ServerPlayer; diff --git a/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundRotateHeadPacketImpl.java b/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundRotateHeadPacketImpl.java similarity index 92% rename from implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundRotateHeadPacketImpl.java rename to implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundRotateHeadPacketImpl.java index 8d1a8c0..0ccd04e 100644 --- a/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundRotateHeadPacketImpl.java +++ b/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundRotateHeadPacketImpl.java @@ -1,10 +1,10 @@ -package de.oliver.fancysitula.versions.v1_20_6.packets; +package de.oliver.fancysitula.versions.v1_21_3.packets; import de.oliver.fancysitula.api.entities.FS_RealPlayer; import de.oliver.fancysitula.api.packets.FS_ClientboundRotateHeadPacket; import de.oliver.fancysitula.api.utils.AngelConverter; import de.oliver.fancysitula.api.utils.reflections.ReflectionUtils; -import de.oliver.fancysitula.versions.v1_20_6.utils.VanillaPlayerAdapter; +import de.oliver.fancysitula.versions.v1_21_3.utils.VanillaPlayerAdapter; import net.minecraft.network.protocol.game.ClientboundRotateHeadPacket; import net.minecraft.server.level.ServerPlayer; diff --git a/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundSetEntityDataPacketImpl.java b/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundSetEntityDataPacketImpl.java similarity index 95% rename from implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundSetEntityDataPacketImpl.java rename to implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundSetEntityDataPacketImpl.java index 573d7e8..09667e6 100644 --- a/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundSetEntityDataPacketImpl.java +++ b/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundSetEntityDataPacketImpl.java @@ -1,9 +1,9 @@ -package de.oliver.fancysitula.versions.v1_20_6.packets; +package de.oliver.fancysitula.versions.v1_21_3.packets; import de.oliver.fancysitula.api.entities.FS_RealPlayer; import de.oliver.fancysitula.api.packets.FS_ClientboundSetEntityDataPacket; import de.oliver.fancysitula.api.utils.reflections.ReflectionUtils; -import de.oliver.fancysitula.versions.v1_20_6.utils.VanillaPlayerAdapter; +import de.oliver.fancysitula.versions.v1_21_3.utils.VanillaPlayerAdapter; import io.papermc.paper.adventure.PaperAdventure; import net.kyori.adventure.text.Component; import net.minecraft.network.protocol.game.ClientboundSetEntityDataPacket; diff --git a/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundSetEquipmentPacketImpl.java b/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundSetEquipmentPacketImpl.java similarity index 93% rename from implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundSetEquipmentPacketImpl.java rename to implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundSetEquipmentPacketImpl.java index e25b481..cee9a61 100644 --- a/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundSetEquipmentPacketImpl.java +++ b/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundSetEquipmentPacketImpl.java @@ -1,10 +1,10 @@ -package de.oliver.fancysitula.versions.v1_20_6.packets; +package de.oliver.fancysitula.versions.v1_21_3.packets; import com.mojang.datafixers.util.Pair; import de.oliver.fancysitula.api.entities.FS_RealPlayer; import de.oliver.fancysitula.api.packets.FS_ClientboundSetEquipmentPacket; import de.oliver.fancysitula.api.utils.FS_EquipmentSlot; -import de.oliver.fancysitula.versions.v1_20_6.utils.VanillaPlayerAdapter; +import de.oliver.fancysitula.versions.v1_21_3.utils.VanillaPlayerAdapter; import net.minecraft.network.protocol.game.ClientboundSetEquipmentPacket; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.EquipmentSlot; diff --git a/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundSetPassengersPacketImpl.java b/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundSetPassengersPacketImpl.java similarity index 92% rename from implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundSetPassengersPacketImpl.java rename to implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundSetPassengersPacketImpl.java index 1b20181..20b8420 100644 --- a/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundSetPassengersPacketImpl.java +++ b/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundSetPassengersPacketImpl.java @@ -1,9 +1,9 @@ -package de.oliver.fancysitula.versions.v1_20_6.packets; +package de.oliver.fancysitula.versions.v1_21_3.packets; import de.oliver.fancysitula.api.entities.FS_RealPlayer; import de.oliver.fancysitula.api.packets.FS_ClientboundSetPassengersPacket; import de.oliver.fancysitula.api.utils.reflections.ReflectionUtils; -import de.oliver.fancysitula.versions.v1_20_6.utils.VanillaPlayerAdapter; +import de.oliver.fancysitula.versions.v1_21_3.utils.VanillaPlayerAdapter; import net.minecraft.network.protocol.game.ClientboundSetPassengersPacket; import net.minecraft.server.level.ServerPlayer; diff --git a/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundTeleportEntityPacketImpl.java b/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundTeleportEntityPacketImpl.java new file mode 100644 index 0000000..390fe39 --- /dev/null +++ b/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundTeleportEntityPacketImpl.java @@ -0,0 +1,43 @@ +package de.oliver.fancysitula.versions.v1_21_3.packets; + +import de.oliver.fancysitula.api.entities.FS_RealPlayer; +import de.oliver.fancysitula.api.packets.FS_ClientboundTeleportEntityPacket; +import de.oliver.fancysitula.versions.v1_21_3.utils.VanillaPlayerAdapter; +import net.minecraft.network.protocol.game.ClientboundTeleportEntityPacket; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.entity.PositionMoveRotation; +import net.minecraft.world.phys.Vec3; + +import java.util.Set; + +public class ClientboundTeleportEntityPacketImpl extends FS_ClientboundTeleportEntityPacket { + + public ClientboundTeleportEntityPacketImpl(int entityId, double x, double y, double z, float yaw, float pitch, boolean onGround) { + super(entityId, x, y, z, yaw, pitch, onGround); + } + + @Override + public Object createPacket() { + ClientboundTeleportEntityPacket packet = new ClientboundTeleportEntityPacket( + entityId, + new PositionMoveRotation( + new Vec3(x, y, z), + Vec3.ZERO, + yaw, + pitch + ), + Set.of(), + onGround + ); + + return packet; + } + + @Override + public void sendPacketTo(FS_RealPlayer player) { + ClientboundTeleportEntityPacket packet = (ClientboundTeleportEntityPacket) createPacket(); + + ServerPlayer vanillaPlayer = VanillaPlayerAdapter.asVanilla(player.getBukkitPlayer()); + vanillaPlayer.connection.send(packet); + } +} diff --git a/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_20_6/utils/GameProfileImpl.java b/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_21_3/utils/GameProfileImpl.java similarity index 95% rename from implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_20_6/utils/GameProfileImpl.java rename to implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_21_3/utils/GameProfileImpl.java index 2fc3602..0cc5fb3 100644 --- a/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_20_6/utils/GameProfileImpl.java +++ b/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_21_3/utils/GameProfileImpl.java @@ -1,4 +1,4 @@ -package de.oliver.fancysitula.versions.v1_20_6.utils; +package de.oliver.fancysitula.versions.v1_21_3.utils; import com.mojang.authlib.GameProfile; import de.oliver.fancysitula.api.utils.FS_GameProfile; diff --git a/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_20_6/utils/VanillaPlayerAdapter.java b/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_21_3/utils/VanillaPlayerAdapter.java similarity index 83% rename from implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_20_6/utils/VanillaPlayerAdapter.java rename to implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_21_3/utils/VanillaPlayerAdapter.java index 40bae3d..9d6f000 100644 --- a/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_20_6/utils/VanillaPlayerAdapter.java +++ b/implementations/1_21_3/src/main/java/de/oliver/fancysitula/versions/v1_21_3/utils/VanillaPlayerAdapter.java @@ -1,4 +1,4 @@ -package de.oliver.fancysitula.versions.v1_20_6.utils; +package de.oliver.fancysitula.versions.v1_21_3.utils; import net.minecraft.server.level.ServerPlayer; import org.bukkit.craftbukkit.entity.CraftPlayer; diff --git a/implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundAddEntityPacketImplTest.java b/implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundAddEntityPacketImplTest.java similarity index 93% rename from implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundAddEntityPacketImplTest.java rename to implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundAddEntityPacketImplTest.java index 90779a7..1cb95bb 100644 --- a/implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundAddEntityPacketImplTest.java +++ b/implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundAddEntityPacketImplTest.java @@ -1,6 +1,7 @@ -package de.oliver.fancysitula.versions.v1_20_6.packets; +package de.oliver.fancysitula.versions.v1_21_3.packets; import de.oliver.fancysitula.api.utils.AngelConverter; +import de.oliver.fancysitula.versions.v1_21_3.packets.ClientboundAddEntityPacketImpl; import net.minecraft.network.protocol.game.ClientboundAddEntityPacket; import org.bukkit.entity.EntityType; diff --git a/implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundPlayerInfoRemovePacketImplTest.java b/implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundPlayerInfoRemovePacketImplTest.java similarity index 81% rename from implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundPlayerInfoRemovePacketImplTest.java rename to implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundPlayerInfoRemovePacketImplTest.java index c741c05..cc94a4d 100644 --- a/implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundPlayerInfoRemovePacketImplTest.java +++ b/implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundPlayerInfoRemovePacketImplTest.java @@ -1,5 +1,6 @@ -package de.oliver.fancysitula.versions.v1_20_6.packets; +package de.oliver.fancysitula.versions.v1_21_3.packets; +import de.oliver.fancysitula.versions.v1_21_3.packets.ClientboundPlayerInfoRemovePacketImpl; import net.minecraft.network.protocol.game.ClientboundPlayerInfoRemovePacket; import org.junit.jupiter.api.Test; diff --git a/implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundPlayerInfoUpdatePacketImplTest.java b/implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundPlayerInfoUpdatePacketImplTest.java similarity index 94% rename from implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundPlayerInfoUpdatePacketImplTest.java rename to implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundPlayerInfoUpdatePacketImplTest.java index d5e830c..a6ad9e3 100644 --- a/implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundPlayerInfoUpdatePacketImplTest.java +++ b/implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundPlayerInfoUpdatePacketImplTest.java @@ -1,8 +1,9 @@ -package de.oliver.fancysitula.versions.v1_20_6.packets; +package de.oliver.fancysitula.versions.v1_21_3.packets; import de.oliver.fancysitula.api.packets.FS_ClientboundPlayerInfoUpdatePacket; import de.oliver.fancysitula.api.utils.FS_GameProfile; import de.oliver.fancysitula.api.utils.FS_GameType; +import de.oliver.fancysitula.versions.v1_21_3.packets.ClientboundPlayerInfoUpdatePacketImpl; import net.kyori.adventure.text.Component; import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket; import org.junit.jupiter.api.Test; diff --git a/implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundRemoveEntitiesPacketImplTest.java b/implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundRemoveEntitiesPacketImplTest.java similarity index 81% rename from implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundRemoveEntitiesPacketImplTest.java rename to implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundRemoveEntitiesPacketImplTest.java index 1fadcfd..bb71e5c 100644 --- a/implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundRemoveEntitiesPacketImplTest.java +++ b/implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundRemoveEntitiesPacketImplTest.java @@ -1,5 +1,6 @@ -package de.oliver.fancysitula.versions.v1_20_6.packets; +package de.oliver.fancysitula.versions.v1_21_3.packets; +import de.oliver.fancysitula.versions.v1_21_3.packets.ClientboundRemoveEntitiesPacketImpl; import net.minecraft.network.protocol.game.ClientboundRemoveEntitiesPacket; import org.junit.jupiter.api.Test; diff --git a/implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundRotateHeadPacketImplTest.java b/implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundRotateHeadPacketImplTest.java similarity index 84% rename from implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundRotateHeadPacketImplTest.java rename to implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundRotateHeadPacketImplTest.java index 632cc6d..cf0106d 100644 --- a/implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundRotateHeadPacketImplTest.java +++ b/implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundRotateHeadPacketImplTest.java @@ -1,7 +1,8 @@ -package de.oliver.fancysitula.versions.v1_20_6.packets; +package de.oliver.fancysitula.versions.v1_21_3.packets; import de.oliver.fancysitula.api.utils.AngelConverter; import de.oliver.fancysitula.api.utils.reflections.ReflectionUtils; +import de.oliver.fancysitula.versions.v1_21_3.packets.ClientboundRotateHeadPacketImpl; import net.minecraft.network.protocol.game.ClientboundRotateHeadPacket; import org.junit.jupiter.api.Test; diff --git a/implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundSetEntityDataPacketImplTest.java b/implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundSetEntityDataPacketImplTest.java similarity index 87% rename from implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundSetEntityDataPacketImplTest.java rename to implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundSetEntityDataPacketImplTest.java index 96c8a24..97bdaaa 100644 --- a/implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundSetEntityDataPacketImplTest.java +++ b/implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundSetEntityDataPacketImplTest.java @@ -1,7 +1,8 @@ -package de.oliver.fancysitula.versions.v1_20_6.packets; +package de.oliver.fancysitula.versions.v1_21_3.packets; import de.oliver.fancysitula.api.packets.FS_ClientboundSetEntityDataPacket; import de.oliver.fancysitula.api.utils.entityData.FS_TextDisplayData; +import de.oliver.fancysitula.versions.v1_21_3.packets.ClientboundSetEntityDataPacketImpl; import net.minecraft.network.protocol.game.ClientboundSetEntityDataPacket; import java.util.List; diff --git a/implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundSetEquipmentPacketImplTest.java b/implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundSetEquipmentPacketImplTest.java similarity index 87% rename from implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundSetEquipmentPacketImplTest.java rename to implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundSetEquipmentPacketImplTest.java index 4206614..943c9cc 100644 --- a/implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundSetEquipmentPacketImplTest.java +++ b/implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundSetEquipmentPacketImplTest.java @@ -1,6 +1,7 @@ -package de.oliver.fancysitula.versions.v1_20_6.packets; +package de.oliver.fancysitula.versions.v1_21_3.packets; import de.oliver.fancysitula.api.utils.FS_EquipmentSlot; +import de.oliver.fancysitula.versions.v1_21_3.packets.ClientboundSetEquipmentPacketImpl; import net.minecraft.network.protocol.game.ClientboundSetEquipmentPacket; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; diff --git a/implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundSetPassengersPacketImplTest.java b/implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundSetPassengersPacketImplTest.java similarity index 86% rename from implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundSetPassengersPacketImplTest.java rename to implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundSetPassengersPacketImplTest.java index 91c2aa9..34bc26e 100644 --- a/implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundSetPassengersPacketImplTest.java +++ b/implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundSetPassengersPacketImplTest.java @@ -1,5 +1,6 @@ -package de.oliver.fancysitula.versions.v1_20_6.packets; +package de.oliver.fancysitula.versions.v1_21_3.packets; +import de.oliver.fancysitula.versions.v1_21_3.packets.ClientboundSetPassengersPacketImpl; import net.minecraft.network.protocol.game.ClientboundSetPassengersPacket; import org.junit.jupiter.api.Test; diff --git a/implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundTeleportEntityPacketImplTest.java b/implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundTeleportEntityPacketImplTest.java similarity index 88% rename from implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundTeleportEntityPacketImplTest.java rename to implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundTeleportEntityPacketImplTest.java index 84991ce..758e55c 100644 --- a/implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_20_6/packets/ClientboundTeleportEntityPacketImplTest.java +++ b/implementations/1_21_3/src/test/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundTeleportEntityPacketImplTest.java @@ -1,6 +1,7 @@ -package de.oliver.fancysitula.versions.v1_20_6.packets; +package de.oliver.fancysitula.versions.v1_21_3.packets; import de.oliver.fancysitula.api.utils.AngelConverter; +import de.oliver.fancysitula.versions.v1_21_3.packets.ClientboundTeleportEntityPacketImpl; import net.minecraft.network.protocol.game.ClientboundTeleportEntityPacket; import org.junit.jupiter.api.Test; diff --git a/test_plugin/build.gradle.kts b/test_plugin/build.gradle.kts index bcb8cbb..978a51a 100644 --- a/test_plugin/build.gradle.kts +++ b/test_plugin/build.gradle.kts @@ -22,6 +22,7 @@ dependencies { implementation(project(":api")) implementation(project(":factories")) implementation(project(":implementations:1_20_6")) + implementation(project(":implementations:1_21_3")) implementation("de.oliver.FancyAnalytics:logger:${findProperty("fancyLoggerVersion")}") }