SPIGOT-5103: World.save does not save gamerules

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2019-06-25 21:02:13 +10:00
parent a2f5bbf93c
commit 5add39bbe3
2 changed files with 58 additions and 41 deletions

View File

@@ -249,7 +249,24 @@
if (iprogressupdate != null) {
iprogressupdate.a(new ChatMessage("menu.savingLevel", new Object[0]));
}
@@ -715,8 +801,16 @@
@@ -648,6 +734,16 @@
chunkproviderserver.save(flag);
}
+
+ // CraftBukkit start - moved from MinecraftServer.saveChunks
+ // PAIL - rename
+ WorldServer worldserver1 = this;
+ WorldData worlddata = worldserver1.getWorldData();
+
+ worldserver1.getWorldBorder().a(worlddata);
+ worlddata.c(this.server.getBossBattleCustomData().c());
+ worldserver1.getDataManager().saveWorldData(worlddata, this.server.getPlayerList().r());
+ // CraftBukkit end
}
protected void k_() throws ExceptionWorldConflict {
@@ -715,8 +811,16 @@
while (objectiterator.hasNext()) {
Entity entity = (Entity) objectiterator.next();
@@ -267,7 +284,7 @@
EnumCreatureType enumcreaturetype = entity.getEntityType().d();
if (enumcreaturetype != EnumCreatureType.MISC && this.getChunkProvider().b(entity)) {
@@ -730,11 +824,24 @@
@@ -730,11 +834,24 @@
@Override
public boolean addEntity(Entity entity) {
@@ -294,7 +311,7 @@
}
public void addEntityTeleport(Entity entity) {
@@ -784,13 +891,18 @@
@@ -784,13 +901,18 @@
this.registerEntity(entityplayer);
}
@@ -315,7 +332,7 @@
IChunkAccess ichunkaccess = this.getChunkAt(MathHelper.floor(entity.locX / 16.0D), MathHelper.floor(entity.locZ / 16.0D), ChunkStatus.FULL, entity.attachedToPlayer);
if (!(ichunkaccess instanceof Chunk)) {
@@ -818,7 +930,7 @@
@@ -818,7 +940,7 @@
if (entity1 == null) {
return false;
} else {
@@ -324,7 +341,7 @@
return true;
}
}
@@ -873,6 +985,7 @@
@@ -873,6 +995,7 @@
this.I.remove(((EntityInsentient) entity).getNavigation());
}
@@ -332,7 +349,7 @@
}
private void registerEntity(Entity entity) {
@@ -896,6 +1009,7 @@
@@ -896,6 +1019,7 @@
if (entity instanceof EntityInsentient) {
this.I.add(((EntityInsentient) entity).getNavigation());
}
@@ -340,7 +357,7 @@
}
}
@@ -926,6 +1040,18 @@
@@ -926,6 +1050,18 @@
}
public void strikeLightning(EntityLightning entitylightning) {
@@ -359,7 +376,7 @@
this.globalEntityList.add(entitylightning);
this.server.getPlayerList().sendPacketNearby((EntityHuman) null, entitylightning.locX, entitylightning.locY, entitylightning.locZ, 512.0D, this.worldProvider.getDimensionManager(), new PacketPlayOutSpawnEntityWeather(entitylightning));
}
@@ -934,6 +1060,12 @@
@@ -934,6 +1070,12 @@
public void a(int i, BlockPosition blockposition, int j) {
Iterator iterator = this.server.getPlayerList().getPlayers().iterator();
@@ -372,7 +389,7 @@
while (iterator.hasNext()) {
EntityPlayer entityplayer = (EntityPlayer) iterator.next();
@@ -942,6 +1074,12 @@
@@ -942,6 +1084,12 @@
double d1 = (double) blockposition.getY() - entityplayer.locY;
double d2 = (double) blockposition.getZ() - entityplayer.locZ;
@@ -385,7 +402,7 @@
if (d0 * d0 + d1 * d1 + d2 * d2 < 1024.0D) {
entityplayer.playerConnection.sendPacket(new PacketPlayOutBlockBreakAnimation(i, blockposition, j));
}
@@ -1002,6 +1140,14 @@
@@ -1002,6 +1150,14 @@
@Override
public Explosion createExplosion(@Nullable Entity entity, DamageSource damagesource, double d0, double d1, double d2, float f, boolean flag, Explosion.Effect explosion_effect) {
@@ -400,7 +417,7 @@
Explosion explosion = new Explosion(this, entity, d0, d1, d2, f, flag, explosion_effect);
if (damagesource != null) {
@@ -1010,6 +1156,8 @@
@@ -1010,6 +1166,8 @@
explosion.a();
explosion.a(false);
@@ -409,7 +426,7 @@
if (explosion_effect == Explosion.Effect.NONE) {
explosion.clearBlocks();
}
@@ -1074,13 +1222,20 @@
@@ -1074,13 +1232,20 @@
}
public <T extends ParticleParam> int a(T t0, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6) {
@@ -432,7 +449,7 @@
++j;
}
}
@@ -1163,7 +1318,13 @@
@@ -1163,7 +1328,13 @@
@Override
public WorldMap a(String s) {
return (WorldMap) this.getMinecraftServer().getWorldServer(DimensionManager.OVERWORLD).getWorldPersistentData().b(() -> {