diff --git a/build-data/dev-imports.txt b/build-data/dev-imports.txt index b431e66..b818b96 100644 --- a/build-data/dev-imports.txt +++ b/build-data/dev-imports.txt @@ -8,5 +8,3 @@ # To import classes from the vanilla Minecraft jar use `minecraft` as the artifactId: # minecraft net.minecraft.world.level.entity.LevelEntityGetterAdapter # minecraft net/minecraft/world/level/entity/LevelEntityGetter.java - -minecraft net.minecraft.network.protocol.status.ServerStatus.java \ No newline at end of file diff --git a/patches/server/0006-Fix-MC-98160-and-MC-105103.patch b/patches/server/0006-Fix-MC-98160-and-MC-105103.patch new file mode 100644 index 0000000..c5fae54 --- /dev/null +++ b/patches/server/0006-Fix-MC-98160-and-MC-105103.patch @@ -0,0 +1,19 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com> +Date: Fri, 31 Mar 2023 00:39:40 +0300 +Subject: [PATCH] Fix MC-98160 and MC-105103 + + +diff --git a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java +index 33de7cca8063618466fe47417e700a5b15c8dc70..49660b0b9ee24de96006441a46bf6efa95873db3 100644 +--- a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java ++++ b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java +@@ -906,7 +906,7 @@ public class Boat extends Entity implements VariantHolder { + if (!this.isPassenger()) { + if (onGround) { + if (this.fallDistance > 3.0F) { +- if (this.status != Boat.Status.ON_LAND) { ++ if (this.status != Boat.Status.ON_LAND && this.status != Status.IN_AIR) { // DivineMC - Fix MC-98160 and MC-105103 + this.resetFallDistance(); + return; + } diff --git a/patches/server/0007-Fix-MC-93826.patch b/patches/server/0007-Fix-MC-93826.patch new file mode 100644 index 0000000..611b834 --- /dev/null +++ b/patches/server/0007-Fix-MC-93826.patch @@ -0,0 +1,23 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com> +Date: Fri, 31 Mar 2023 00:39:40 +0300 +Subject: [PATCH] Fix MC-93826 + + +diff --git a/src/main/java/net/minecraft/world/entity/animal/Animal.java b/src/main/java/net/minecraft/world/entity/animal/Animal.java +index 2ac88f06ebb79e515cd9934ac1e3e2c8003d9e3c..22aa2dbbd5da1b0e4c76756fe960876ec46019bf 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/Animal.java ++++ b/src/main/java/net/minecraft/world/entity/animal/Animal.java +@@ -70,7 +70,11 @@ public abstract class Animal extends AgeableMob { + double d1 = this.random.nextGaussian() * 0.02D; + double d2 = this.random.nextGaussian() * 0.02D; + +- this.level.addParticle(ParticleTypes.HEART, this.getRandomX(1.0D), this.getRandomY() + 0.5D, this.getRandomZ(1.0D), d0, d1, d2); ++ // DivineMC start - Fix MC-93826 ++ if (this.level instanceof ServerLevel serverLevel) { ++ serverLevel.sendParticles(ParticleTypes.HEART, this.getRandomX(1.0D), this.getRandomY() + 0.5D, this.getRandomZ(1.0D), 1, d0, d1, d2, 0); ++ } ++ // DivineMC end + } + } + diff --git a/patches/server/0008-Fix-entity-serialization.patch b/patches/server/0008-Fix-entity-serialization.patch new file mode 100644 index 0000000..cdb9daa --- /dev/null +++ b/patches/server/0008-Fix-entity-serialization.patch @@ -0,0 +1,45 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com> +Date: Fri, 31 Mar 2023 00:39:40 +0300 +Subject: [PATCH] Fix entity serialization + + +diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java +index 3c10c719f6172161a2dcc6592a0a1492e9b3d7c1..d839a6d7be3fb2a9b14fbad1e3e48d0b88a1c6eb 100644 +--- a/src/main/java/net/minecraft/world/entity/Entity.java ++++ b/src/main/java/net/minecraft/world/entity/Entity.java +@@ -2182,15 +2182,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { + } + } + +- // Paper start - Entity serialization api +- public boolean serializeEntity(CompoundTag compound) { +- List pass = new java.util.ArrayList<>(this.getPassengers()); +- this.passengers = ImmutableList.of(); +- boolean result = save(compound); +- this.passengers = ImmutableList.copyOf(pass); +- return result; +- } +- // Paper end + public boolean save(CompoundTag nbt) { + return this.isPassenger() ? false : this.saveAsPassenger(nbt); + } +diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +index bd21dd728b6d47d354aeb879b083394e186d6a5c..a006dea11313f2cbd33d652fcddd171f1dd7355b 100644 +--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java ++++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +@@ -490,8 +490,13 @@ public final class CraftMagicNumbers implements UnsafeValues { + Preconditions.checkNotNull(entity, "null cannot be serialized"); + Preconditions.checkArgument(entity instanceof org.bukkit.craftbukkit.entity.CraftEntity, "only CraftEntities can be serialized"); + ++ net.minecraft.world.entity.Entity nmsEntity = ((org.bukkit.craftbukkit.entity.CraftEntity) entity).getHandle(); + CompoundTag compound = new CompoundTag(); +- ((org.bukkit.craftbukkit.entity.CraftEntity) entity).getHandle().serializeEntity(compound); ++ compound.putString("id", net.minecraft.world.entity.EntityType.getKey(nmsEntity.getType()).toString()); ++ List pass = new java.util.ArrayList<>(nmsEntity.getPassengers()); ++ nmsEntity.passengers = com.google.common.collect.ImmutableList.of(); ++ nmsEntity.saveWithoutId(compound); ++ nmsEntity.passengers = com.google.common.collect.ImmutableList.copyOf(pass); + return serializeNbtToBytes(compound); + } +