diff --git a/api/build.gradle.kts b/api/build.gradle.kts index a3abe45..a448180 100644 --- a/api/build.gradle.kts +++ b/api/build.gradle.kts @@ -11,7 +11,7 @@ java { } group = "net.thenextlvl.holograms" -version = "2.1.2" +version = "2.1.3" repositories { mavenCentral() @@ -21,7 +21,7 @@ repositories { dependencies { compileOnly("org.projectlombok:lombok:1.18.32") - compileOnly("io.papermc.paper:paper-api:1.20.6-R0.1-SNAPSHOT") + compileOnly("io.papermc.paper:paper-api:1.21-R0.1-SNAPSHOT") compileOnly("net.thenextlvl.core:annotations:2.0.1") diff --git a/plugin/build.gradle.kts b/plugin/build.gradle.kts index ec9d29e..735d349 100644 --- a/plugin/build.gradle.kts +++ b/plugin/build.gradle.kts @@ -24,7 +24,7 @@ repositories { } dependencies { - paperweight.paperDevBundle("1.20.6-R0.1-SNAPSHOT") + paperweight.paperDevBundle("1.21-R0.1-SNAPSHOT") compileOnly("org.projectlombok:lombok:1.18.32") compileOnly("net.thenextlvl.core:annotations:2.0.1") @@ -39,7 +39,7 @@ dependencies { paper { name = "HologramAPI" main = "net.thenextlvl.hologram.HologramAPI" - apiVersion = "1.20" + apiVersion = "1.21" prefix = "Holograms" load = BukkitPluginDescription.PluginLoadOrder.STARTUP website = "https://thenextlvl.net" diff --git a/plugin/src/main/java/net/thenextlvl/hologram/implementation/CraftHologramLoader.java b/plugin/src/main/java/net/thenextlvl/hologram/implementation/CraftHologramLoader.java index ead9f97..c9b9e29 100644 --- a/plugin/src/main/java/net/thenextlvl/hologram/implementation/CraftHologramLoader.java +++ b/plugin/src/main/java/net/thenextlvl/hologram/implementation/CraftHologramLoader.java @@ -2,10 +2,13 @@ import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; +import net.minecraft.network.protocol.Packet; +import net.minecraft.network.protocol.game.ClientboundAddEntityPacket; import net.minecraft.network.protocol.game.ClientboundRemoveEntitiesPacket; import net.minecraft.network.protocol.game.ClientboundSetEntityDataPacket; import net.minecraft.network.protocol.game.ClientboundTeleportEntityPacket; import net.minecraft.network.syncher.SynchedEntityData; +import net.minecraft.world.phys.Vec3; import net.thenextlvl.hologram.api.HologramLoader; import net.thenextlvl.hologram.api.hologram.Hologram; import org.bukkit.Location; @@ -64,11 +67,27 @@ private static class ClientHologramLoader extends WeakHashMap createAddEntityPacket(CraftDisplay display) { + return new ClientboundAddEntityPacket( + display.getEntityId(), + display.getUniqueId(), + display.getX(), + display.getY(), + display.getZ(), + display.getPitch(), + display.getYaw(), + display.getHandle().getType(), + 0, + new Vec3(0, 0, 0), + display.getYaw() + ); + } + private void unload(Hologram hologram, CraftPlayer player) { player.getHandle().connection.send(new ClientboundRemoveEntitiesPacket(hologram.getEntityId())); removeHologram(player, hologram);