mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
Updated Upstream (Paper & Airplane)
Upstream has released updates that appear to apply and compile correctly Paper Changes:7a59345eb7Hide feature seeds in Timings79e52a51bdDon't log if debug logging isn't enabled. (#6603)89c648bcd7Fix log message formatting when classes not owned by plugins use sysout (#6604)3069eaee04Fix tick rates map being stored with upper case values instead of lower case (#6587) Airplane Changes:1888adc228Reduce fluid lookups for entities
This commit is contained in:
@@ -4,7 +4,7 @@ version = 1.17.1-R0.1-SNAPSHOT
|
||||
mcVersion = 1.17.1
|
||||
packageVersion = 1_17_R1
|
||||
|
||||
paperCommit = 810d200bb4c6d73687526ce7ec6b739bc1e674cc
|
||||
paperCommit = 3069eaee04730c12dcc5000c44fe3ef640ce7d38
|
||||
|
||||
org.gradle.caching = true
|
||||
org.gradle.parallel = true
|
||||
|
||||
@@ -92,7 +92,7 @@ index b3687f632bbf06c933a6ef04dc2236ccf3c030b8..c1e70d5f127804deabcf626b72539086
|
||||
|
||||
tasks.shadowJar {
|
||||
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
index 7d44abcb4fff9717a1af55879deb7eb9c2d9e7e9..da6a5b1b2f5203a0fab8e4fccd727951df7c9c9a 100644
|
||||
index e29b0a90019b12bd6586ad0f7b5314f307e527ba..6e8001c7ff6497c9e5c274a5fe85cc204f3ba4c5 100644
|
||||
--- a/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
+++ b/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
@@ -228,7 +228,8 @@ public class TimingsExport extends Thread {
|
||||
@@ -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..732eb171f6a8fe1b02044a00fcf85217c41116ac 100644
|
||||
index 94857a736d2a16e8ade286c6f2ddf8bd798008eb..29ddf0b12911fb46f260234e704f15f17d80d018 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
|
||||
@@ -2022,6 +2022,108 @@ index 94857a736d2a16e8ade286c6f2ddf8bd798008eb..732eb171f6a8fe1b02044a00fcf85217
|
||||
// Paper end
|
||||
}
|
||||
}
|
||||
@@ -3813,12 +3837,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||
return false;
|
||||
} else {
|
||||
AABB axisalignedbb = this.getBoundingBox().deflate(0.001D);
|
||||
- int i = Mth.floor(axisalignedbb.minX);
|
||||
- int j = Mth.ceil(axisalignedbb.maxX);
|
||||
- int k = Mth.floor(axisalignedbb.minY);
|
||||
- int l = Mth.ceil(axisalignedbb.maxY);
|
||||
- int i1 = Mth.floor(axisalignedbb.minZ);
|
||||
- int j1 = Mth.ceil(axisalignedbb.maxZ);
|
||||
+ // Airplane start - rename
|
||||
+ int minBlockX = Mth.floor(axisalignedbb.minX);
|
||||
+ int maxBlockX = Mth.ceil(axisalignedbb.maxX);
|
||||
+ int minBlockY = Mth.floor(axisalignedbb.minY);
|
||||
+ int maxBlockY = Mth.ceil(axisalignedbb.maxY);
|
||||
+ int minBlockZ = Mth.floor(axisalignedbb.minZ);
|
||||
+ int maxBlockZ = Mth.ceil(axisalignedbb.maxZ);
|
||||
+ // Airplane end
|
||||
double d1 = 0.0D;
|
||||
boolean flag = this.isPushedByFluid();
|
||||
boolean flag1 = false;
|
||||
@@ -3826,14 +3852,61 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||
int k1 = 0;
|
||||
BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos();
|
||||
|
||||
- for (int l1 = i; l1 < j; ++l1) {
|
||||
- for (int i2 = k; i2 < l; ++i2) {
|
||||
- for (int j2 = i1; j2 < j1; ++j2) {
|
||||
- blockposition_mutableblockposition.set(l1, i2, j2);
|
||||
- FluidState fluid = this.level.getFluidState(blockposition_mutableblockposition);
|
||||
+ // Airplane start - based off CollisionUtil.getCollisionsForBlocksOrWorldBorder
|
||||
+ final int minSection = io.papermc.paper.util.WorldUtil.getMinSection(this.level);
|
||||
+ final int maxSection = io.papermc.paper.util.WorldUtil.getMaxSection(this.level);
|
||||
+ final int minBlock = minSection << 4;
|
||||
+ final int maxBlock = (maxSection << 4) | 15;
|
||||
+
|
||||
+ // special cases:
|
||||
+ if (minBlockY > maxBlock || maxBlockY < minBlock) {
|
||||
+ // no point in checking
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ int minYIterate = Math.max(minBlock, minBlockY);
|
||||
+ int maxYIterate = Math.min(maxBlock, maxBlockY);
|
||||
+
|
||||
+ int minChunkX = minBlockX >> 4;
|
||||
+ int maxChunkX = maxBlockX >> 4;
|
||||
+
|
||||
+ int minChunkZ = minBlockZ >> 4;
|
||||
+ int maxChunkZ = maxBlockZ >> 4;
|
||||
+
|
||||
+ for (int currChunkZ = minChunkZ; currChunkZ <= maxChunkZ; ++currChunkZ) {
|
||||
+ int minZ = currChunkZ == minChunkZ ? minBlockZ & 15 : 0; // coordinate in chunk
|
||||
+ int maxZ = currChunkZ == maxChunkZ ? maxBlockZ & 15 : 15; // coordinate in chunk
|
||||
+
|
||||
+ for (int currChunkX = minChunkX; currChunkX <= maxChunkX; ++currChunkX) {
|
||||
+ int minX = currChunkX == minChunkX ? minBlockX & 15 : 0; // coordinate in chunk
|
||||
+ int maxX = currChunkX == maxChunkX ? maxBlockX & 15 : 15; // coordinate in chunk
|
||||
+
|
||||
+ net.minecraft.world.level.chunk.ChunkAccess chunk = this.level.getChunkIfLoadedImmediately(currChunkX, currChunkZ);
|
||||
+ if (chunk == null) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ net.minecraft.world.level.chunk.LevelChunkSection[] sections = chunk.getSections();
|
||||
+
|
||||
+ 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
|
||||
+ // empty
|
||||
+ // skip to next section
|
||||
+ currY = (currY & ~(15)) + 15; // increment by 15: iterator loop increments by the extra one
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ net.minecraft.world.level.chunk.PalettedContainer<BlockState> blocks = section.states;
|
||||
+
|
||||
+ for (int currZ = minZ; currZ <= maxZ; ++currZ) {
|
||||
+ for (int currX = minX; currX <= maxX; ++currX) {
|
||||
+ int localBlockIndex = (currX) | (currZ << 4) | ((currY & 15) << 8);
|
||||
+ FluidState fluid = blocks.get(localBlockIndex).getFluidState();
|
||||
|
||||
if (fluid.is(tag)) {
|
||||
- double d2 = (double) ((float) i2 + fluid.getHeight(this.level, blockposition_mutableblockposition));
|
||||
+ 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
|
||||
}
|
||||
}
|
||||
}
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
||||
+ // Airplane end
|
||||
|
||||
if (vec3d.length() > 0.0D) {
|
||||
if (k1 > 0) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||
index 1c446dba5de89698397041ee38a2e1a00bec8a56..03371c99c34ba4b2ffde3f6da36f171b582e3c3f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||
|
||||
@@ -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 3b7d72f035d7fd74971af043294047ff1ed4c95c..33edd0863374b4a7f2b0812879b23533515da447 100644
|
||||
index 1afbc542b28b6e0b04b4a886ec6b735f09accd15..c268120fb85287f001c62faccbc9e464d2963096 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 3b7d72f035d7fd74971af043294047ff1ed4c95c..33edd0863374b4a7f2b0812879b23533
|
||||
if (this.passengers.size() == 1 && this.passengers.get(0) == entity) {
|
||||
this.passengers = ImmutableList.of();
|
||||
} else {
|
||||
@@ -4259,4 +4273,41 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||
@@ -4311,4 +4325,41 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||
return ((ServerChunkCache) level.getChunkSource()).isPositionTicking(this);
|
||||
}
|
||||
// Paper end
|
||||
|
||||
@@ -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 c07ab3ec326bd43f857324679a4dae482b40b392..46d6b2fbbcb90a7e7738a1f403d02b9cc384c479 100644
|
||||
index 4a236e87856b0ceb8802e851ec861bbecd6b2c10..06097dbb8df50d92c7480e4ce3478e7f5c6560b9 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -4310,5 +4310,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||
@@ -4362,5 +4362,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||
public boolean processClick(InteractionHand hand) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Stop squids floating on top of water
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 46d6b2fbbcb90a7e7738a1f403d02b9cc384c479..003aefff36185613a195edad1bd0121b8526a90b 100644
|
||||
index 06097dbb8df50d92c7480e4ce3478e7f5c6560b9..d2ff6445b4afb2b8a5aee1ba5b58b69a438ec8b2 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -3875,11 +3875,17 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||
@@ -24,11 +24,11 @@ index 46d6b2fbbcb90a7e7738a1f403d02b9cc384c479..003aefff36185613a195edad1bd0121b
|
||||
} else {
|
||||
- AABB axisalignedbb = this.getBoundingBox().deflate(0.001D);
|
||||
+ AABB axisalignedbb = getAxisForFluidCheck(); // Purpur
|
||||
int i = Mth.floor(axisalignedbb.minX);
|
||||
int j = Mth.ceil(axisalignedbb.maxX);
|
||||
int k = Mth.floor(axisalignedbb.minY);
|
||||
// Airplane start - rename
|
||||
int minBlockX = Mth.floor(axisalignedbb.minX);
|
||||
int maxBlockX = Mth.ceil(axisalignedbb.maxX);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Squid.java b/src/main/java/net/minecraft/world/entity/animal/Squid.java
|
||||
index f96def2ebdf114823c322c2d4318d039e20eab97..2affff346a7fe81480e86cb61996039df0569853 100644
|
||||
index f96def2ebdf114823c322c2d4318d039e20eab97..8b3dfce6c890a44f9bc485bec016c922375fadfb 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Squid.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Squid.java
|
||||
@@ -79,6 +79,12 @@ public class Squid extends WaterAnimal {
|
||||
@@ -39,7 +39,7 @@ index f96def2ebdf114823c322c2d4318d039e20eab97..2affff346a7fe81480e86cb61996039d
|
||||
+ @Override
|
||||
+ public net.minecraft.world.phys.AABB getAxisForFluidCheck() {
|
||||
+ // Stops squids from floating just over the water
|
||||
+ return this.getBoundingBox().deflate(0.001D).offsetY(level.purpurConfig.squidOffsetWaterCheck);
|
||||
+ return super.getAxisForFluidCheck().offsetY(level.purpurConfig.squidOffsetWaterCheck);
|
||||
+ }
|
||||
// Purpur end
|
||||
|
||||
|
||||
@@ -21,12 +21,12 @@ index 87d01bebbb179eec53323e9e23db011a791660ed..02b79aa6f4c472a9450549b1730f026d
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Squid.java b/src/main/java/net/minecraft/world/entity/animal/Squid.java
|
||||
index 2affff346a7fe81480e86cb61996039df0569853..12be4a2f25a7def8341acda47d10a256c044aec2 100644
|
||||
index 8b3dfce6c890a44f9bc485bec016c922375fadfb..3c3a5d7ac95916e066c4ec78c0d3849cd0a9f3e0 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Squid.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Squid.java
|
||||
@@ -85,6 +85,15 @@ public class Squid extends WaterAnimal {
|
||||
// Stops squids from floating just over the water
|
||||
return this.getBoundingBox().deflate(0.001D).offsetY(level.purpurConfig.squidOffsetWaterCheck);
|
||||
return super.getAxisForFluidCheck().offsetY(level.purpurConfig.squidOffsetWaterCheck);
|
||||
}
|
||||
+
|
||||
+ public boolean canFly() {
|
||||
|
||||
@@ -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 20689afe1556d2b463143ebb5cdbcbd683f5e76b..6ad500cdcafd35c5c2839859afa0d24695f64430 100644
|
||||
index a7e67f87d0dabe40e01fb0a8ac5fc9dc995b505f..ecf5b42547162ac098c90335947f8de5bf303072 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -4323,5 +4323,18 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||
@@ -4375,5 +4375,18 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||
public boolean canSaveToDisk() {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user