-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add 1.21.3 module * Add support for 1.21.3 --------- Co-authored-by: OliverSchlueter <OliverSchlueter@users.noreply.github.com>
- Loading branch information
1 parent
ff83a75
commit f36a881
Showing
32 changed files
with
966 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
minecraftVersion=1.21 | ||
minecraftVersion=1.21.3 | ||
fancyLoggerVersion=0.0.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
plugins { | ||
id("java-library") | ||
id("io.papermc.paperweight.userdev") version "1.7.3" | ||
} | ||
|
||
val minecraftVersion = "1.21.3" | ||
|
||
paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArtifactConfiguration.MOJANG_PRODUCTION | ||
|
||
dependencies { | ||
paperweight.paperDevBundle("$minecraftVersion-R0.1-SNAPSHOT") | ||
compileOnly(project(":api")) | ||
|
||
testImplementation(project(":api")) | ||
testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.2") | ||
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.10.2") | ||
} | ||
|
||
tasks { | ||
test { | ||
useJUnitPlatform() | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
...n/java/de/oliver/fancysitula/versions/v1_21_3/packets/ClientboundAddEntityPacketImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
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_21_3.utils.VanillaPlayerAdapter; | ||
import net.minecraft.core.registries.BuiltInRegistries; | ||
import net.minecraft.network.protocol.game.ClientboundAddEntityPacket; | ||
import net.minecraft.server.level.ServerPlayer; | ||
import net.minecraft.world.phys.Vec3; | ||
import org.bukkit.craftbukkit.util.CraftNamespacedKey; | ||
import org.bukkit.entity.EntityType; | ||
|
||
import java.util.UUID; | ||
|
||
public class ClientboundAddEntityPacketImpl extends FS_ClientboundAddEntityPacket { | ||
|
||
public ClientboundAddEntityPacketImpl(int entityId, UUID entityUUID, EntityType entityType, double x, double y, double z, float yaw, float pitch, float headYaw, int velocityX, int velocityY, int velocityZ, int data) { | ||
super(entityId, entityUUID, entityType, x, y, z, yaw, pitch, headYaw, velocityX, velocityY, velocityZ, data); | ||
} | ||
|
||
@Override | ||
public Object createPacket() { | ||
net.minecraft.world.entity.EntityType<?> vanillaType = BuiltInRegistries.ENTITY_TYPE.getValue(CraftNamespacedKey.toMinecraft(entityType.getKey())); | ||
|
||
return new ClientboundAddEntityPacket( | ||
entityId, | ||
entityUUID, | ||
x, | ||
y, | ||
z, | ||
AngelConverter.degreesToVanillaByte(pitch), | ||
AngelConverter.degreesToVanillaByte(yaw), | ||
vanillaType, | ||
data, | ||
new Vec3(velocityX, velocityY, velocityZ), | ||
AngelConverter.degreesToVanillaByte(headYaw) | ||
); | ||
} | ||
|
||
@Override | ||
public void sendPacketTo(FS_RealPlayer player) { | ||
ClientboundAddEntityPacket packet = (ClientboundAddEntityPacket) createPacket(); | ||
|
||
ServerPlayer vanillaPlayer = VanillaPlayerAdapter.asVanilla(player.getBukkitPlayer()); | ||
vanillaPlayer.connection.send(packet); | ||
} | ||
} |
Oops, something went wrong.