1.21.5
Co-authored-by: Bjarne Koll <git@lynxplay.dev> Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com> Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> Co-authored-by: MiniDigger | Martin <admin@minidigger.dev> Co-authored-by: Nassim Jahnke <nassim@njahnke.dev> Co-authored-by: Noah van der Aa <ndvdaa@gmail.com> Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> Co-authored-by: Shane Freeder <theboyetronic@gmail.com> Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com> Co-authored-by: Tamion <70228790+notTamion@users.noreply.github.com> Co-authored-by: Warrior <50800980+Warriorrrr@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/gametest/framework/GameTestInfo.java
|
||||
+++ b/net/minecraft/gametest/framework/GameTestInfo.java
|
||||
@@ -241,7 +_,7 @@
|
||||
@@ -247,7 +_,7 @@
|
||||
AABB structureBounds = this.getStructureBounds();
|
||||
List<Entity> entitiesOfClass = this.getLevel()
|
||||
.getEntitiesOfClass(Entity.class, structureBounds.inflate(1.0), entity -> !(entity instanceof Player));
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/gametest/framework/GameTestMainUtil.java
|
||||
+++ b/net/minecraft/gametest/framework/GameTestMainUtil.java
|
||||
@@ -77,7 +_,7 @@
|
||||
copyPacks(string, string1);
|
||||
}
|
||||
|
||||
- LevelStorageSource.LevelStorageAccess levelStorageAccess = LevelStorageSource.createDefault(Paths.get(string)).createAccess("gametestworld");
|
||||
+ LevelStorageSource.LevelStorageAccess levelStorageAccess = LevelStorageSource.createDefault(Paths.get(string)).createAccess("gametestworld", net.minecraft.world.level.dimension.LevelStem.OVERWORLD); // Paper
|
||||
PackRepository packRepository = ServerPacksSource.createPackRepository(levelStorageAccess);
|
||||
MinecraftServer.spin(
|
||||
thread -> GameTestServer.create(thread, levelStorageAccess, packRepository, optionalFromOption(optionSet, tests), optionSet.has(verify))
|
||||
@@ -1,7 +1,7 @@
|
||||
--- a/net/minecraft/gametest/framework/GameTestServer.java
|
||||
+++ b/net/minecraft/gametest/framework/GameTestServer.java
|
||||
@@ -139,6 +_,8 @@
|
||||
BlockPos spawnPos
|
||||
@@ -133,6 +_,8 @@
|
||||
boolean verify
|
||||
) {
|
||||
super(
|
||||
+ null, // Paper
|
||||
@@ -9,7 +9,7 @@
|
||||
serverThread,
|
||||
storageSource,
|
||||
packRepository,
|
||||
@@ -154,8 +_,15 @@
|
||||
@@ -148,8 +_,15 @@
|
||||
|
||||
@Override
|
||||
public boolean initServer() {
|
||||
@@ -25,9 +25,9 @@
|
||||
+ this.loadLevel("blah");
|
||||
+ // Paper end
|
||||
ServerLevel serverLevel = this.overworld();
|
||||
this.testBatches = Lists.newArrayList(GameTestBatchFactory.fromTestFunction(this.testFunctions, serverLevel));
|
||||
serverLevel.setDefaultSpawnPos(this.spawnPos, 0.0F);
|
||||
@@ -303,6 +_,13 @@
|
||||
this.testBatches = this.evaluateTestsToRun(serverLevel);
|
||||
LOGGER.info("Started game test server");
|
||||
@@ -338,6 +_,13 @@
|
||||
public boolean shouldInformAdmins() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/gametest/framework/StructureUtils.java
|
||||
+++ b/net/minecraft/gametest/framework/StructureUtils.java
|
||||
@@ -187,7 +_,7 @@
|
||||
@@ -86,7 +_,7 @@
|
||||
level.clearBlockEvents(boundingBox1);
|
||||
AABB aabb = AABB.of(boundingBox1);
|
||||
List<Entity> entitiesOfClass = level.getEntitiesOfClass(Entity.class, aabb, entity -> !(entity instanceof Player));
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
--- 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);
|
||||
@@ -0,0 +1,30 @@
|
||||
--- a/net/minecraft/gametest/framework/TestEnvironmentDefinition.java
|
||||
+++ b/net/minecraft/gametest/framework/TestEnvironmentDefinition.java
|
||||
@@ -132,11 +_,11 @@
|
||||
MinecraftServer server = level.getServer();
|
||||
|
||||
for (TestEnvironmentDefinition.SetGameRules.Entry<Boolean, GameRules.BooleanValue> entry : this.boolRules) {
|
||||
- gameRules.getRule(entry.key()).set(entry.value(), server);
|
||||
+ gameRules.getRule(entry.key()).set(entry.value(), level); // Paper - per-world
|
||||
}
|
||||
|
||||
for (TestEnvironmentDefinition.SetGameRules.Entry<Integer, GameRules.IntegerValue> entry : this.intRules) {
|
||||
- gameRules.getRule(entry.key()).set(entry.value(), server);
|
||||
+ gameRules.getRule(entry.key()).set(entry.value(), level); // Paper - per-world
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,11 +_,11 @@
|
||||
MinecraftServer server = level.getServer();
|
||||
|
||||
for (TestEnvironmentDefinition.SetGameRules.Entry<Boolean, GameRules.BooleanValue> entry : this.boolRules) {
|
||||
- gameRules.getRule(entry.key()).setFrom(GameRules.getType(entry.key()).createRule(), server);
|
||||
+ gameRules.getRule(entry.key()).setFrom(GameRules.getType(entry.key()).createRule(), level); // Paper - per-world
|
||||
}
|
||||
|
||||
for (TestEnvironmentDefinition.SetGameRules.Entry<Integer, GameRules.IntegerValue> entry : this.intRules) {
|
||||
- gameRules.getRule(entry.key()).setFrom(GameRules.getType(entry.key()).createRule(), server);
|
||||
+ gameRules.getRule(entry.key()).setFrom(GameRules.getType(entry.key()).createRule(), level); // Paper - per-world
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user