Various bug fixes

This commit is contained in:
William Blake Galbreath
2020-08-15 13:03:26 -05:00
parent f801a266fb
commit da61b4917d
3 changed files with 52 additions and 3 deletions

View File

@@ -18,12 +18,15 @@ index 6677740edb..3296904445 100644
IBlockData iblockdata4 = ichunkaccess.getType(blockposition_mutableblockposition);
diff --git a/src/main/java/net/minecraft/server/WorldGenSurfaceNetherAbstract.java b/src/main/java/net/minecraft/server/WorldGenSurfaceNetherAbstract.java
index 1ff8b4eb10..58e0006ac3 100644
index 1ff8b4eb10..2fbc8a2e0d 100644
--- a/src/main/java/net/minecraft/server/WorldGenSurfaceNetherAbstract.java
+++ b/src/main/java/net/minecraft/server/WorldGenSurfaceNetherAbstract.java
@@ -37,7 +37,7 @@ public abstract class WorldGenSurfaceNetherAbstract extends WorldGenSurface<Worl
@@ -35,9 +35,9 @@ public abstract class WorldGenSurfaceNetherAbstract extends WorldGenSurface<Worl
return ((NoiseGeneratorOctaves) entry.getValue()).a((double) i, (double) l, (double) j);
})).get()).getKey();
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition();
IBlockData iblockdata4 = ichunkaccess.getType(blockposition_mutableblockposition.d(k1, 128, l1));
- IBlockData iblockdata4 = ichunkaccess.getType(blockposition_mutableblockposition.d(k1, 128, l1));
+ IBlockData iblockdata4 = ichunkaccess.getType(blockposition_mutableblockposition.d(k1, k, l1)); // Purpur - use configured height
- for (int k2 = 127; k2 >= 0; --k2) {
+ for (int k2 = k; k2 >= 0; --k2) { // Purpur - use configured height

View File

@@ -0,0 +1,18 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Mariell Hoversholm <proximyst@proximyst.com>
Date: Fri, 14 Aug 2020 23:41:19 +0200
Subject: [PATCH] Don't mark null chunk sections for block updates
diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java
index 9f1dd6e1aa..577f0a234b 100644
--- a/src/main/java/net/minecraft/server/PlayerChunk.java
+++ b/src/main/java/net/minecraft/server/PlayerChunk.java
@@ -419,6 +419,7 @@ public class PlayerChunk {
this.a(world, blockposition, iblockdata);
} else {
ChunkSection chunksection = chunk.getSections()[sectionposition.getY()];
+ if (chunksection == null) chunksection = new ChunkSection(sectionposition.getY(), chunk, world, true); // Paper - make a new chunk section if none was found
PacketPlayOutMultiBlockChange packetplayoutmultiblockchange = new PacketPlayOutMultiBlockChange(sectionposition, shortset, chunksection, this.x);
this.a(packetplayoutmultiblockchange, false);

View File

@@ -0,0 +1,28 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Mariell Hoversholm <proximyst@proximyst.com>
Date: Fri, 14 Aug 2020 23:59:26 +0200
Subject: [PATCH] Remove armour stand double add to world
diff --git a/src/main/java/net/minecraft/server/ItemArmorStand.java b/src/main/java/net/minecraft/server/ItemArmorStand.java
index 73b92c8a71..9611f940a3 100644
--- a/src/main/java/net/minecraft/server/ItemArmorStand.java
+++ b/src/main/java/net/minecraft/server/ItemArmorStand.java
@@ -33,7 +33,7 @@ public class ItemArmorStand extends Item {
return EnumInteractionResult.FAIL;
}
- worldserver.addAllEntities(entityarmorstand);
+ // worldserver.addAllEntities(entityarmorstand); // Paper - moved down
float f = (float) MathHelper.d((MathHelper.g(itemactioncontext.h() - 180.0F) + 22.5F) / 45.0F) * 45.0F;
entityarmorstand.setPositionRotation(entityarmorstand.locX(), entityarmorstand.locY(), entityarmorstand.locZ(), f, 0.0F);
@@ -43,7 +43,7 @@ public class ItemArmorStand extends Item {
return EnumInteractionResult.FAIL;
}
// CraftBukkit end
- world.addEntity(entityarmorstand);
+ worldserver.addAllEntities(entityarmorstand); // Paper - moved down
world.playSound((EntityHuman) null, entityarmorstand.locX(), entityarmorstand.locY(), entityarmorstand.locZ(), SoundEffects.ENTITY_ARMOR_STAND_PLACE, SoundCategory.BLOCKS, 0.75F, 0.8F);
}