Updated Upstream (Airplane)

Upstream has released updates that appear to apply and compile correctly

Airplane Changes:
5e5ead869e Properly count all liquids
This commit is contained in:
William Blake Galbreath
2021-09-16 14:22:46 -05:00
parent 029c607198
commit 158adc5869
4 changed files with 49 additions and 10 deletions

View File

@@ -1949,7 +1949,7 @@ index 7437f01ca8f416e2c9150250e324af4725a4efb6..bdcd0e38a3ba904811112f41d8bfbfc0
int LARGE_MAX_STACK_SIZE = 64;
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 94857a736d2a16e8ade286c6f2ddf8bd798008eb..29ddf0b12911fb46f260234e704f15f17d80d018 100644
index 94857a736d2a16e8ade286c6f2ddf8bd798008eb..598575b540752e050a94ca703a2b135adbb2018c 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -338,6 +338,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
@@ -2043,7 +2043,7 @@ index 94857a736d2a16e8ade286c6f2ddf8bd798008eb..29ddf0b12911fb46f260234e704f15f1
double d1 = 0.0D;
boolean flag = this.isPushedByFluid();
boolean flag1 = false;
@@ -3826,14 +3852,61 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
@@ -3826,14 +3852,62 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
int k1 = 0;
BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos();
@@ -2091,7 +2091,7 @@ index 94857a736d2a16e8ade286c6f2ddf8bd798008eb..29ddf0b12911fb46f260234e704f15f1
+ for (int currY = minYIterate; currY <= maxYIterate; ++currY) {
+ net.minecraft.world.level.chunk.LevelChunkSection section = sections[(currY >> 4) - minSection];
+
+ if (section == null || section.isEmpty() || !section.isRandomlyTickingFluids()) { // if no ticking fluids, nothing in this section
+ if (section == null || section.isEmpty() || section.fluidStateCount == 0) { // if no fluids, nothing in this section
+ // empty
+ // skip to next section
+ currY = (currY & ~(15)) + 15; // increment by 15: iterator loop increments by the extra one
@@ -2107,11 +2107,12 @@ index 94857a736d2a16e8ade286c6f2ddf8bd798008eb..29ddf0b12911fb46f260234e704f15f1
if (fluid.is(tag)) {
- double d2 = (double) ((float) i2 + fluid.getHeight(this.level, blockposition_mutableblockposition));
+ blockposition_mutableblockposition.set((currChunkX << 4) + currX, currY, (currChunkZ << 4) + currZ);
+ double d2 = (double) ((float) currY + fluid.getHeight(this.level, blockposition_mutableblockposition));
if (d2 >= axisalignedbb.minY) {
flag1 = true;
@@ -3850,9 +3923,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
@@ -3850,9 +3924,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
}
}
}
@@ -3260,6 +3261,44 @@ index 86686c24b0b7de4b4bfadbc77419a8872a8e86ee..e265980f07d95a7912bf8873819033e5
}
@Override
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
index 72e3264dc74822f746fb84fec0be400047d2d9f5..831e2dbe530daf63ac9e681a92af2740fa18ac8c 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
@@ -18,6 +18,9 @@ public class LevelChunkSection {
short nonEmptyBlockCount; // Paper - package-private
private short tickingBlockCount;
private short tickingFluidCount;
+ // Airplane start
+ public short fluidStateCount;
+ // Airplane end
public final PalettedContainer<BlockState> states; // Paper - package-private // Paper - public
public final com.destroystokyo.paper.util.maplist.IBlockDataList tickingList = new com.destroystokyo.paper.util.maplist.IBlockDataList(); // Paper
@@ -88,6 +91,7 @@ public class LevelChunkSection {
if (!fluidState.isEmpty()) {
--this.tickingFluidCount;
+ --this.fluidStateCount; // Airplane
}
if (!state.isAir()) {
@@ -102,6 +106,7 @@ public class LevelChunkSection {
if (!fluidState2.isEmpty()) {
++this.tickingFluidCount;
+ ++this.fluidStateCount; // Airplane
}
return blockState;
@@ -155,6 +160,7 @@ public class LevelChunkSection {
if (fluidState.isRandomlyTicking()) {
this.tickingFluidCount = (short)(this.tickingFluidCount + 1); // Paper
}
+ this.fluidStateCount++; // Airplane
}
});
diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
index c9e942669458668a184aaec3bc0a5509dd6ab5f0..178e56ffc87ea2beb4d84d1f278f4acf90102379 100644
--- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java

View File

@@ -86,7 +86,7 @@ index 7a7ce8f3ad0bbcbf926718bd46e9dccee08a0778..88227a0882b4a667206891b2a26ad576
if ((entity instanceof AbstractFish && origItem != null && origItem.asItem() == Items.WATER_BUCKET) && (event.isCancelled() || ServerGamePacketListenerImpl.this.player.getInventory().getSelected() == null || ServerGamePacketListenerImpl.this.player.getInventory().getSelected().getItem() != origItem)) {
ServerGamePacketListenerImpl.this.send(new ClientboundAddMobPacket((AbstractFish) entity));
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 1afbc542b28b6e0b04b4a886ec6b735f09accd15..c268120fb85287f001c62faccbc9e464d2963096 100644
index 033ef002588881985a22e9990adb09fa56b28106..530d3e8c0377593e973fad65b98f9f484e1ca3bd 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -230,7 +230,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
@@ -135,7 +135,7 @@ index 1afbc542b28b6e0b04b4a886ec6b735f09accd15..c268120fb85287f001c62faccbc9e464
if (this.passengers.size() == 1 && this.passengers.get(0) == entity) {
this.passengers = ImmutableList.of();
} else {
@@ -4311,4 +4325,41 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
@@ -4312,4 +4326,41 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
return ((ServerChunkCache) level.getChunkSource()).isPositionTicking(this);
}
// Paper end

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Add canSaveToDisk to Entity
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 4a236e87856b0ceb8802e851ec861bbecd6b2c10..06097dbb8df50d92c7480e4ce3478e7f5c6560b9 100644
index 7c042280e3b462f2c3e2658e0ff944ffe83c55fa..33f26475b314f8480130ffa9ef091cb6ec37249e 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -4362,5 +4362,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
@@ -4363,5 +4363,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
public boolean processClick(InteractionHand hand) {
return false;
}

View File

@@ -6,10 +6,10 @@ Subject: [PATCH] API for any mob to burn daylight
Co-authored by: Encode42 <me@encode42.dev>
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index a7e67f87d0dabe40e01fb0a8ac5fc9dc995b505f..ecf5b42547162ac098c90335947f8de5bf303072 100644
index 487fd05a2d5946b7f0325b81dce1f8acf28f0db4..4f23021c353c926f92d0403b9c9c383b7300db1c 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -4375,5 +4375,18 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
@@ -4376,5 +4376,18 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
public boolean canSaveToDisk() {
return true;
}