Fix tests

This commit is contained in:
Nassim Jahnke
2024-12-16 11:54:00 +01:00
parent 520ab93fbf
commit 6a0c3c3efc
4 changed files with 36 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
--- a/net/minecraft/gametest/framework/GameTestInfo.java
+++ b/net/minecraft/gametest/framework/GameTestInfo.java
@@ -241,7 +_,7 @@
AABB structureBounds = this.getStructureBounds();
List<Entity> entitiesOfClass = this.getLevel()
.getEntitiesOfClass(Entity.class, structureBounds.inflate(1.0), entity -> !(entity instanceof Player));
- entitiesOfClass.forEach(entity -> entity.remove(Entity.RemovalReason.DISCARDED));
+ entitiesOfClass.forEach(entity -> entity.remove(Entity.RemovalReason.DISCARDED, org.bukkit.event.entity.EntityRemoveEvent.Cause.DISCARD)); // Paper
}
}

View File

@@ -0,0 +1,11 @@
--- a/net/minecraft/gametest/framework/StructureUtils.java
+++ b/net/minecraft/gametest/framework/StructureUtils.java
@@ -187,7 +_,7 @@
level.clearBlockEvents(boundingBox1);
AABB aabb = AABB.of(boundingBox1);
List<Entity> entitiesOfClass = level.getEntitiesOfClass(Entity.class, aabb, entity -> !(entity instanceof Player));
- entitiesOfClass.forEach(Entity::discard);
+ entitiesOfClass.forEach(entity -> entity.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DISCARD)); // Paper
}
public static BlockPos getTransformedFarCorner(BlockPos pos, Vec3i offset, Rotation rotation) {

View File

@@ -0,0 +1,11 @@
--- a/net/minecraft/gametest/framework/TestCommand.java
+++ b/net/minecraft/gametest/framework/TestCommand.java
@@ -278,7 +_,7 @@
}
private static int resetGameTestInfo(GameTestInfo gameTestInfo) {
- gameTestInfo.getLevel().getEntities(null, gameTestInfo.getStructureBounds()).stream().forEach(entity -> entity.remove(Entity.RemovalReason.DISCARDED));
+ gameTestInfo.getLevel().getEntities(null, gameTestInfo.getStructureBounds()).stream().forEach(entity -> entity.remove(Entity.RemovalReason.DISCARDED, org.bukkit.event.entity.EntityRemoveEvent.Cause.DISCARD)); // Paper
gameTestInfo.getStructureBlockEntity().placeStructure(gameTestInfo.getLevel());
StructureUtils.removeBarriers(gameTestInfo.getStructureBounds(), gameTestInfo.getLevel());
say(gameTestInfo.getLevel(), "Reset succeded for: " + gameTestInfo.getTestName(), ChatFormatting.GREEN);