mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 17:07:43 +01:00
Update to 1.18.2
This commit is contained in:
@@ -3,24 +3,9 @@ From: Kevin Raneri <kevin.raneri@gmail.com>
|
||||
Date: Wed, 3 Feb 2021 23:02:38 -0600
|
||||
Subject: [PATCH] Pufferfish Server Changes
|
||||
|
||||
Pufferfish
|
||||
Copyright (C) 2022 Pufferfish Studios LLC
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 4662952bd0a389fe77e00ede9ab4a57f33522794..a37ca23682272d5ddaf1a2246917e6c46b69da86 100644
|
||||
index 4beb35d1e5b013395f5df101e843f41c2ce174ad..27c18ced1ce6d38c9cd05eb4269f25a9d6520030 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -18,8 +18,12 @@ repositories {
|
||||
@@ -629,7 +614,7 @@ index 0000000000000000000000000000000000000000..020368da69b9a492155f6de6297f7473
|
||||
+}
|
||||
diff --git a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..17bc75a0f0e665a3b7abaaf2bf197abe3cd2af20
|
||||
index 0000000000000000000000000000000000000000..56330536c52fa327ef89d7a08e72557c6633c8bb
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
|
||||
@@ -0,0 +1,291 @@
|
||||
@@ -714,7 +699,7 @@ index 0000000000000000000000000000000000000000..17bc75a0f0e665a3b7abaaf2bf197abe
|
||||
+ try {
|
||||
+ method.invoke(null);
|
||||
+ } catch (Throwable t) {
|
||||
+ MinecraftServer.LOGGER.log(Level.WARN, "Failed to load configuration option from " + method.getName(), t);
|
||||
+ MinecraftServer.LOGGER.warn("Failed to load configuration option from " + method.getName(), t);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
@@ -880,7 +865,7 @@ index 0000000000000000000000000000000000000000..17bc75a0f0e665a3b7abaaf2bf197abe
|
||||
+ getStringList("dab.blacklisted-entities", "activation-range.blacklisted-entities", Collections.emptyList(), "A list of entities to ignore for activation")
|
||||
+ .forEach(name -> EntityType.byString(name).ifPresentOrElse(entityType -> {
|
||||
+ entityType.dabEnabled = false;
|
||||
+ }, () -> MinecraftServer.LOGGER.log(Level.WARN, "Unknown entity \"" + name + "\"")));
|
||||
+ }, () -> MinecraftServer.LOGGER.warn("Unknown entity \"" + name + "\"")));
|
||||
+
|
||||
+ setComment("dab", "Optimizes entity brains when", "they're far away from the player");
|
||||
+ }
|
||||
@@ -1189,7 +1174,7 @@ index 0000000000000000000000000000000000000000..401b42e29bccb5251684062f10b2e0f8
|
||||
+}
|
||||
diff --git a/src/main/java/gg/pufferfish/pufferfish/flare/FlareCommand.java b/src/main/java/gg/pufferfish/pufferfish/flare/FlareCommand.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..6401e508729407254abd8caea988f84d1eb7cb0f
|
||||
index 0000000000000000000000000000000000000000..3785d1512eb650f91d58903672c059e7449598fc
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/gg/pufferfish/pufferfish/flare/FlareCommand.java
|
||||
@@ -0,0 +1,136 @@
|
||||
@@ -1295,7 +1280,7 @@ index 0000000000000000000000000000000000000000..6401e508729407254abd8caea988f84d
|
||||
+ } catch (UserReportableException e) {
|
||||
+ sender.sendMessage(Component.text("Flare failed to start: " + e.getUserError(), NamedTextColor.RED));
|
||||
+ if (e.getCause() != null) {
|
||||
+ MinecraftServer.LOGGER.log(Level.WARN, "Flare failed to start", e);
|
||||
+ MinecraftServer.LOGGER.warn("Flare failed to start", e);
|
||||
+ }
|
||||
+ }
|
||||
+ });
|
||||
@@ -1331,7 +1316,7 @@ index 0000000000000000000000000000000000000000..6401e508729407254abd8caea988f84d
|
||||
+}
|
||||
diff --git a/src/main/java/gg/pufferfish/pufferfish/flare/FlareSetup.java b/src/main/java/gg/pufferfish/pufferfish/flare/FlareSetup.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..0435f1dbec1cc9fc1751567128d9fff3f246c7b4
|
||||
index 0000000000000000000000000000000000000000..cd22e4dcc8b7b57b10a95ef084637249a98e524f
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/gg/pufferfish/pufferfish/flare/FlareSetup.java
|
||||
@@ -0,0 +1,33 @@
|
||||
@@ -1355,11 +1340,11 @@ index 0000000000000000000000000000000000000000..0435f1dbec1cc9fc1751567128d9fff3
|
||||
+ initialized = true;
|
||||
+ try {
|
||||
+ for (String warning : FlareInitializer.initialize()) {
|
||||
+ MinecraftServer.LOGGER.log(Level.WARN, "Flare warning: " + warning);
|
||||
+ MinecraftServer.LOGGER.warn("Flare warning: " + warning);
|
||||
+ }
|
||||
+ supported = true;
|
||||
+ } catch (InitializationException e) {
|
||||
+ MinecraftServer.LOGGER.log(Level.WARN, "Failed to enable Flare:", e);
|
||||
+ MinecraftServer.LOGGER.warn("Failed to enable Flare:", e);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
@@ -2135,30 +2120,6 @@ index 0000000000000000000000000000000000000000..facd55463d44cb7e3d2ca6892982f549
|
||||
+ return backingMap.size();
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java
|
||||
index 34e571b702684673b89103176838dc246ff9b24d..3bef6ecc820b57f3953b48ecbd451d457ecc46e1 100644
|
||||
--- a/src/main/java/net/minecraft/Util.java
|
||||
+++ b/src/main/java/net/minecraft/Util.java
|
||||
@@ -392,6 +392,10 @@ public class Util {
|
||||
|
||||
private static final CompletableFuture<?>[] EMPTY_FUTURE = new CompletableFuture[0]; // Paper
|
||||
public static <V> CompletableFuture<List<V>> sequence(List<? extends CompletableFuture<? extends V>> futures) {
|
||||
+ // Pufferfish start - faster sequencing without all of.. _that_
|
||||
+ return CompletableFuture.allOf(futures.toArray(new CompletableFuture[futures.size()]))
|
||||
+ .thenApply(unused -> futures.stream().map(CompletableFuture::join).collect(Collectors.toList()));
|
||||
+ /*
|
||||
// Paper start - optimize
|
||||
return CompletableFuture.allOf(futures.toArray(EMPTY_FUTURE))
|
||||
.thenApply(v -> {
|
||||
@@ -402,6 +406,8 @@ public class Util {
|
||||
return list;
|
||||
});
|
||||
// Paper end
|
||||
+ */
|
||||
+ // Pufferfish end
|
||||
}
|
||||
|
||||
public static <V> CompletableFuture<List<V>> sequenceFailFast(List<? extends CompletableFuture<? extends V>> futures) {
|
||||
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
|
||||
index 7bddc7517356cc74104dcc5c7c55522a53f2596f..d6a57cdad2c92521a800cb18d060d9d6d627a8c0 100644
|
||||
--- a/src/main/java/net/minecraft/server/MCUtil.java
|
||||
@@ -2173,7 +2134,7 @@ index 7bddc7517356cc74104dcc5c7c55522a53f2596f..d6a57cdad2c92521a800cb18d060d9d6
|
||||
|
||||
public static long getCoordinateKey(final ChunkPos pair) {
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index c847a2b935130a293d9ac4c196c9cff27470649b..505e37b45c2712bb42cd834b527e8ddb0eae1236 100644
|
||||
index 0a0bc8c45cb70073cb94dee25b5e54fb98bf9c8e..b53fa61dc542937641c36d90c6613e072a05ec5f 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -310,6 +310,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -2185,7 +2146,7 @@ index c847a2b935130a293d9ac4c196c9cff27470649b..505e37b45c2712bb42cd834b527e8ddb
|
||||
|
||||
public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
|
||||
AtomicReference<S> atomicreference = new AtomicReference();
|
||||
@@ -1719,7 +1721,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1685,7 +1687,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
||||
@DontObfuscate
|
||||
public String getServerModName() {
|
||||
@@ -2194,7 +2155,7 @@ index c847a2b935130a293d9ac4c196c9cff27470649b..505e37b45c2712bb42cd834b527e8ddb
|
||||
}
|
||||
|
||||
public SystemReport fillSystemReport(SystemReport details) {
|
||||
@@ -2254,6 +2256,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -2238,6 +2240,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
|
||||
public ProfilerFiller getProfiler() {
|
||||
@@ -2203,10 +2164,10 @@ index c847a2b935130a293d9ac4c196c9cff27470649b..505e37b45c2712bb42cd834b527e8ddb
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 38a0fb9a7c4ade9cacfd30dffabfea7e6b773981..aae2dadabedb075fd1bc712f0226882b85f4551d 100644
|
||||
index e28e09aae1d95d9bed50a137e999e6d457e62478..27e90ca03275a42271bbe97ee1a63a355b098ede 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -232,6 +232,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -235,6 +235,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
io.papermc.paper.util.ObfHelper.INSTANCE.getClass(); // load mappings for stacktrace deobf and etc.
|
||||
io.papermc.paper.brigadier.PaperBrigadierProviderImpl.INSTANCE.getClass(); // init PaperBrigadierProvider
|
||||
// Paper end
|
||||
@@ -2215,7 +2176,7 @@ index 38a0fb9a7c4ade9cacfd30dffabfea7e6b773981..aae2dadabedb075fd1bc712f0226882b
|
||||
|
||||
this.setPvpAllowed(dedicatedserverproperties.pvp);
|
||||
this.setFlightAllowed(dedicatedserverproperties.allowFlight);
|
||||
@@ -345,6 +347,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -348,6 +350,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
DedicatedServer.LOGGER.info("JMX monitoring enabled");
|
||||
}
|
||||
|
||||
@@ -2224,10 +2185,10 @@ index 38a0fb9a7c4ade9cacfd30dffabfea7e6b773981..aae2dadabedb075fd1bc712f0226882b
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index afef3ea6d1ae5f145261eaae3da720fdf9e923a8..ca07ba8eb33f1b4f10aba9f4b4c7c1078f80f61b 100644
|
||||
index d93eb2d0f38598a8939048de16dc7f14f2d39302..5a1a0ccf163488d5c4ec377821afaa95abebddcb 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -452,7 +452,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -457,7 +457,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
this.dataRegionManager = new io.papermc.paper.chunk.SingleThreadChunkRegionManager(this.level, 2, (1.0 / 3.0), 1, 6, "Data", DataRegionData::new, DataRegionSectionData::new);
|
||||
this.regionManagers.add(this.dataRegionManager);
|
||||
// Paper end
|
||||
@@ -2236,7 +2197,7 @@ index afef3ea6d1ae5f145261eaae3da720fdf9e923a8..ca07ba8eb33f1b4f10aba9f4b4c7c107
|
||||
// Paper start - use distance map to optimise entity tracker
|
||||
this.playerEntityTrackerTrackMaps = new com.destroystokyo.paper.util.misc.PlayerAreaMap[TRACKING_RANGE_TYPES.length];
|
||||
this.entityTrackerTrackRanges = new int[TRACKING_RANGE_TYPES.length];
|
||||
@@ -2318,8 +2318,28 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -2370,8 +2370,28 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
return ChunkMap.this.level.getServer().getScaledTrackingDistance(initialDistance);
|
||||
}
|
||||
|
||||
@@ -2265,7 +2226,7 @@ index afef3ea6d1ae5f145261eaae3da720fdf9e923a8..ca07ba8eb33f1b4f10aba9f4b4c7c107
|
||||
Iterator iterator = this.entity.getIndirectPassengers().iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@@ -2331,6 +2351,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -2383,6 +2403,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
i = j;
|
||||
}
|
||||
}
|
||||
@@ -2276,11 +2237,11 @@ index afef3ea6d1ae5f145261eaae3da720fdf9e923a8..ca07ba8eb33f1b4f10aba9f4b4c7c107
|
||||
return this.scaledRange(i);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
index e20fc528b85a8278bffab32845daac2208836748..7780c6cd92a716e62625df95841680b0e99a86e6 100644
|
||||
index 5793154c0deca7fc570bbe858c6bea0d640db941..f33ae29fd86fbfb2a94748fbf9515e3b4ae01753 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
@@ -78,6 +78,9 @@ public class ServerChunkCache extends ChunkSource {
|
||||
final Long2ObjectOpenHashMap<LevelChunk> loadedChunkMap = new Long2ObjectOpenHashMap<>(8192, 0.5f);
|
||||
@@ -74,6 +74,9 @@ public class ServerChunkCache extends ChunkSource {
|
||||
final it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<LevelChunk> loadedChunkMap = new it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<>(8192, 0.5f);
|
||||
|
||||
private final LevelChunk[] lastLoadedChunks = new LevelChunk[4 * 4];
|
||||
+
|
||||
@@ -2289,7 +2250,7 @@ index e20fc528b85a8278bffab32845daac2208836748..7780c6cd92a716e62625df95841680b0
|
||||
|
||||
private static int getChunkCacheKey(int x, int z) {
|
||||
return x & 3 | ((z & 3) << 2);
|
||||
@@ -970,6 +973,7 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -969,6 +972,7 @@ public class ServerChunkCache extends ChunkSource {
|
||||
ProfilerFiller gameprofilerfiller = this.level.getProfiler();
|
||||
|
||||
gameprofilerfiller.push("pollingChunks");
|
||||
@@ -2297,7 +2258,7 @@ index e20fc528b85a8278bffab32845daac2208836748..7780c6cd92a716e62625df95841680b0
|
||||
int k = this.level.getGameRules().getInt(GameRules.RULE_RANDOMTICKING);
|
||||
boolean flag1 = level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) != 0L && worlddata.getGameTime() % level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) == 0L; // CraftBukkit
|
||||
|
||||
@@ -979,18 +983,25 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -978,18 +982,25 @@ public class ServerChunkCache extends ChunkSource {
|
||||
// Paper start - per player mob spawning
|
||||
NaturalSpawner.SpawnState spawnercreature_d; // moved down
|
||||
if ((this.spawnFriendlies || this.spawnEnemies) && this.chunkMap.playerMobDistanceMap != null) { // don't count mobs when animals and monsters are disabled
|
||||
@@ -2329,9 +2290,9 @@ index e20fc528b85a8278bffab32845daac2208836748..7780c6cd92a716e62625df95841680b0
|
||||
gameprofilerfiller.popPush("filteringLoadedChunks");
|
||||
// Paper - moved down
|
||||
this.level.timings.chunkTicks.startTiming(); // Paper
|
||||
@@ -1028,8 +1039,8 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -1027,8 +1038,8 @@ public class ServerChunkCache extends ChunkSource {
|
||||
|
||||
if ((true || this.level.isPositionEntityTicking(chunkcoordintpair)) && this.chunkMap.anyPlayerCloseEnoughForSpawning(holder, chunkcoordintpair, false)) { // Paper - optimise anyPlayerCloseEnoughForSpawning // Paper - replace player chunk loader system
|
||||
if ((true || this.level.isNaturalSpawningAllowed(chunkcoordintpair)) && this.chunkMap.anyPlayerCloseEnoughForSpawning(holder, chunkcoordintpair, false)) { // Paper - optimise anyPlayerCloseEnoughForSpawning // Paper - replace player chunk loader system
|
||||
chunk1.incrementInhabitedTime(j);
|
||||
- if (flag2 && (this.spawnEnemies || this.spawnFriendlies) && this.level.getWorldBorder().isWithinBounds(chunkcoordintpair) && this.chunkMap.anyPlayerCloseEnoughForSpawning(holder, chunkcoordintpair, true)) { // Spigot // Paper - optimise anyPlayerCloseEnoughForSpawning & optimise chunk tick iteration
|
||||
- NaturalSpawner.spawnForChunk(this.level, chunk1, spawnercreature_d, this.spawnFriendlies, this.spawnEnemies, flag1);
|
||||
@@ -2339,8 +2300,8 @@ index e20fc528b85a8278bffab32845daac2208836748..7780c6cd92a716e62625df95841680b0
|
||||
+ NaturalSpawner.spawnForChunk(this.level, chunk1, lastSpawnState, this.spawnFriendlies, this.spawnEnemies, flag1); // Pufferfish
|
||||
}
|
||||
|
||||
if ((true || this.level.shouldTickBlocksAt(chunkcoordintpair.toLong()))) { // Paper - replace player chunk loader system
|
||||
@@ -1091,6 +1102,30 @@ public class ServerChunkCache extends ChunkSource {
|
||||
if (true || this.level.shouldTickBlocksAt(chunkcoordintpair.toLong())) { // Paper - replace player chunk loader system
|
||||
@@ -1090,6 +1101,30 @@ public class ServerChunkCache extends ChunkSource {
|
||||
}
|
||||
// Paper end - controlled flush for entity tracker packets
|
||||
}
|
||||
@@ -2372,7 +2333,7 @@ index e20fc528b85a8278bffab32845daac2208836748..7780c6cd92a716e62625df95841680b0
|
||||
|
||||
private void getFullChunk(long pos, Consumer<LevelChunk> chunkConsumer) {
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
index b0a79e335ac9dc24fc6f18010bf40716ecc724bf..c37afd850654905343dd2eb33881dab7d57d9137 100644
|
||||
index 1092ba200a945d8d70e48f956535f56e2743302d..937a93d134dc986fe23e5676d58f7619524b9bf3 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
@@ -174,6 +174,7 @@ public class ServerEntity {
|
||||
@@ -2392,10 +2353,10 @@ index b0a79e335ac9dc24fc6f18010bf40716ecc724bf..c37afd850654905343dd2eb33881dab7
|
||||
this.wasOnGround = this.entity.isOnGround();
|
||||
this.teleportDelay = 0;
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 835a17cd4ec487271ba28232280dd0fbf2687c4b..58604c77d9273c866e53f8ee62c7056acc76e004 100644
|
||||
index 8e87aca16879d7dd1dc0bd17d3215fca40b547cd..a154761eecb4911f8b646cccbb9b713e0fcc693e 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -667,7 +667,20 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -670,7 +670,20 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
}
|
||||
|
||||
gameprofilerfiller.push("tick");
|
||||
@@ -2417,7 +2378,7 @@ index 835a17cd4ec487271ba28232280dd0fbf2687c4b..58604c77d9273c866e53f8ee62c7056a
|
||||
gameprofilerfiller.pop();
|
||||
}
|
||||
}
|
||||
@@ -732,9 +745,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -735,9 +748,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
}
|
||||
// Paper start - optimise random block ticking
|
||||
private final BlockPos.MutableBlockPos chunkTickMutablePosition = new BlockPos.MutableBlockPos();
|
||||
@@ -2430,7 +2391,7 @@ index 835a17cd4ec487271ba28232280dd0fbf2687c4b..58604c77d9273c866e53f8ee62c7056a
|
||||
public void tickChunk(LevelChunk chunk, int randomTickSpeed) {
|
||||
ChunkPos chunkcoordintpair = chunk.getPos();
|
||||
boolean flag = this.isRaining();
|
||||
@@ -745,7 +760,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -748,7 +763,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
gameprofilerfiller.push("thunder");
|
||||
final BlockPos.MutableBlockPos blockposition = this.chunkTickMutablePosition; // Paper - use mutable to reduce allocation rate, final to force compile fail on change
|
||||
|
||||
@@ -2439,20 +2400,20 @@ index 835a17cd4ec487271ba28232280dd0fbf2687c4b..58604c77d9273c866e53f8ee62c7056a
|
||||
blockposition.set(this.findLightningTargetAround(this.getBlockRandomPos(j, 0, k, 15))); // Paper
|
||||
if (this.isRainingAt(blockposition)) {
|
||||
DifficultyInstance difficultydamagescaler = this.getCurrentDifficultyAt(blockposition);
|
||||
@@ -769,7 +784,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -772,7 +787,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
}
|
||||
|
||||
gameprofilerfiller.popPush("iceandsnow");
|
||||
- if (!this.paperConfig.disableIceAndSnow && this.randomTickRandom.nextInt(16) == 0) { // Paper - Disable ice and snow // Paper - optimise random ticking
|
||||
+ if (!this.paperConfig.disableIceAndSnow && (this.currentIceAndSnowTick++ & 15) == 0) { // Paper - Disable ice and snow // Paper - optimise random ticking // Pufferfish - optimize further random ticking
|
||||
- if (!this.paperConfig.disableIceAndSnow && this.random.nextInt(16) == 0) { // Paper - Disable ice and snow
|
||||
+ if (!this.paperConfig.disableIceAndSnow && (this.currentIceAndSnowTick++ & 15) == 0) { // Paper - Disable ice and snow // Pufferfish - optimize further random ticking
|
||||
// Paper start - optimise chunk ticking
|
||||
this.getRandomBlockPosition(j, 0, k, 15, blockposition);
|
||||
int normalY = chunk.getHeight(Heightmap.Types.MOTION_BLOCKING, blockposition.getX() & 15, blockposition.getZ() & 15) + 1;
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index d945a22e2bb992f3cbba3c9ed0f660b6a385a1b0..b9f2f6713bd9e3431ddbf2a41f16cbda5739ef57 100644
|
||||
index dea4d455d05945505f9ef33793a61783b521bf11..bc67e1a997d59408b00c333184d9f8dcc6cb262a 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1113,6 +1113,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
@@ -1107,6 +1107,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
|
||||
@Override
|
||||
public void handleEditBook(ServerboundEditBookPacket packet) {
|
||||
@@ -2573,10 +2534,10 @@ index 7437f01ca8f416e2c9150250e324af4725a4efb6..7ac51dbfce18a2bc52faa7a915abeccc
|
||||
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 9ca080e2745686fc2e39485965ec54c5de0bae6e..fd6e42d3df429aaf753102258b8e65a61ff4d296 100644
|
||||
index 84fce7dccf9232209f939a32acfc3131e62eb27c..59ec3d56e88cf6cee218422481457b944ff25998 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -227,7 +227,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
||||
@@ -230,7 +230,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
||||
public double yo;
|
||||
public double zo;
|
||||
private Vec3 position;
|
||||
@@ -2585,7 +2546,7 @@ index 9ca080e2745686fc2e39485965ec54c5de0bae6e..fd6e42d3df429aaf753102258b8e65a6
|
||||
private ChunkPos chunkPosition;
|
||||
private Vec3 deltaMovement;
|
||||
public float yRot; // Paper - private->public
|
||||
@@ -349,6 +349,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
||||
@@ -352,6 +352,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
||||
return this.originWorld;
|
||||
}
|
||||
// Paper end
|
||||
@@ -2597,7 +2558,7 @@ index 9ca080e2745686fc2e39485965ec54c5de0bae6e..fd6e42d3df429aaf753102258b8e65a6
|
||||
public float getBukkitYaw() {
|
||||
return this.yRot;
|
||||
}
|
||||
@@ -372,17 +377,36 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
||||
@@ -375,17 +380,36 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
||||
this.isLegacyTrackingEntity = isLegacyTrackingEntity;
|
||||
}
|
||||
|
||||
@@ -2635,7 +2596,7 @@ index 9ca080e2745686fc2e39485965ec54c5de0bae6e..fd6e42d3df429aaf753102258b8e65a6
|
||||
for (Entity passenger : passengers) {
|
||||
org.spigotmc.TrackingRange.TrackingRangeType passengerType = passenger.trackingRangeType;
|
||||
int passengerRange = chunkMap.getEntityTrackerRange(passengerType.ordinal());
|
||||
@@ -391,6 +415,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
||||
@@ -394,6 +418,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
||||
range = passengerRange;
|
||||
}
|
||||
}
|
||||
@@ -2645,10 +2606,10 @@ index 9ca080e2745686fc2e39485965ec54c5de0bae6e..fd6e42d3df429aaf753102258b8e65a6
|
||||
|
||||
return chunkMap.playerEntityTrackerTrackMaps[type.ordinal()].getObjectsInRange(MCUtil.getCoordinateKey(this));
|
||||
}
|
||||
@@ -3871,16 +3898,18 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
||||
@@ -3906,16 +3933,18 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
||||
}
|
||||
|
||||
public boolean updateFluidHeightAndDoFluidPushing(Tag<Fluid> tag, double speed) {
|
||||
public boolean updateFluidHeightAndDoFluidPushing(TagKey<Fluid> tag, double speed) {
|
||||
- if (this.touchingUnloadedChunk()) {
|
||||
+ if (false && this.touchingUnloadedChunk()) { // Pufferfish - cost of a lookup here is the same cost as below, so skip
|
||||
return false;
|
||||
@@ -2671,7 +2632,7 @@ index 9ca080e2745686fc2e39485965ec54c5de0bae6e..fd6e42d3df429aaf753102258b8e65a6
|
||||
double d1 = 0.0D;
|
||||
boolean flag = this.isPushedByFluid();
|
||||
boolean flag1 = false;
|
||||
@@ -3888,14 +3917,61 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
||||
@@ -3923,14 +3952,61 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
||||
int k1 = 0;
|
||||
BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos();
|
||||
|
||||
@@ -2739,7 +2700,7 @@ index 9ca080e2745686fc2e39485965ec54c5de0bae6e..fd6e42d3df429aaf753102258b8e65a6
|
||||
|
||||
if (d2 >= axisalignedbb.minY) {
|
||||
flag1 = true;
|
||||
@@ -3917,9 +3993,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
||||
@@ -3952,9 +4028,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
||||
// CraftBukkit end
|
||||
}
|
||||
}
|
||||
@@ -2753,10 +2714,10 @@ index 9ca080e2745686fc2e39485965ec54c5de0bae6e..fd6e42d3df429aaf753102258b8e65a6
|
||||
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 419a7e9614af2328ed401fc954196056243a984c..9bc568a2b0df13f55ee8670839b9e6a6b4f38c2d 100644
|
||||
index 79abd84696ef099f6b12ddeaa6e398f18c53316a..29169f9819ebbe0b90d87ed1e5833a3a57e39f06 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||
@@ -293,6 +293,7 @@ public class EntityType<T extends Entity> implements EntityTypeTest<Entity, T> {
|
||||
@@ -296,6 +296,7 @@ public class EntityType<T extends Entity> implements EntityTypeTest<Entity, T> {
|
||||
return Registry.ENTITY_TYPE.getOptional(ResourceLocation.tryParse(id));
|
||||
}
|
||||
|
||||
@@ -2765,10 +2726,10 @@ index 419a7e9614af2328ed401fc954196056243a984c..9bc568a2b0df13f55ee8670839b9e6a6
|
||||
public final String id;
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 9822d163a9e4d6ac8240c18a7082e911788d0948..6f98681ac54f575be047867a8c0b58e1dbd2a37d 100644
|
||||
index fdd76d1a1636f30f519c434b41061d826c4a8261..6a31e29bce673e698922da3c3ba8fd4d8b0adedb 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -139,7 +139,6 @@ import org.bukkit.event.entity.EntityTeleportEvent;
|
||||
@@ -141,7 +141,6 @@ import org.bukkit.event.entity.EntityTeleportEvent;
|
||||
import org.bukkit.event.player.PlayerItemConsumeEvent;
|
||||
// CraftBukkit end
|
||||
|
||||
@@ -2776,7 +2737,7 @@ index 9822d163a9e4d6ac8240c18a7082e911788d0948..6f98681ac54f575be047867a8c0b58e1
|
||||
|
||||
public abstract class LivingEntity extends Entity {
|
||||
|
||||
@@ -393,8 +392,7 @@ public abstract class LivingEntity extends Entity {
|
||||
@@ -396,8 +395,7 @@ public abstract class LivingEntity extends Entity {
|
||||
|
||||
if (this.isAlive()) {
|
||||
boolean flag = this instanceof net.minecraft.world.entity.player.Player;
|
||||
@@ -2786,7 +2747,7 @@ index 9822d163a9e4d6ac8240c18a7082e911788d0948..6f98681ac54f575be047867a8c0b58e1
|
||||
this.hurt(DamageSource.IN_WALL, 1.0F);
|
||||
} else if (flag && !this.level.getWorldBorder().isWithinBounds(this.getBoundingBox())) {
|
||||
double d0 = this.level.getWorldBorder().getDistanceToBorder(this) + this.level.getWorldBorder().getDamageSafeZone();
|
||||
@@ -1287,6 +1285,15 @@ public abstract class LivingEntity extends Entity {
|
||||
@@ -1290,6 +1288,15 @@ public abstract class LivingEntity extends Entity {
|
||||
return this.getHealth() <= 0.0F;
|
||||
}
|
||||
|
||||
@@ -2802,7 +2763,7 @@ index 9822d163a9e4d6ac8240c18a7082e911788d0948..6f98681ac54f575be047867a8c0b58e1
|
||||
@Override
|
||||
public boolean hurt(DamageSource source, float amount) {
|
||||
if (this.isInvulnerableTo(source)) {
|
||||
@@ -1848,6 +1855,20 @@ public abstract class LivingEntity extends Entity {
|
||||
@@ -1851,6 +1858,20 @@ public abstract class LivingEntity extends Entity {
|
||||
return this.lastClimbablePos;
|
||||
}
|
||||
|
||||
@@ -2823,7 +2784,7 @@ index 9822d163a9e4d6ac8240c18a7082e911788d0948..6f98681ac54f575be047867a8c0b58e1
|
||||
public boolean onClimbable() {
|
||||
if (this.isSpectator()) {
|
||||
return false;
|
||||
@@ -3545,7 +3566,10 @@ public abstract class LivingEntity extends Entity {
|
||||
@@ -3540,7 +3561,10 @@ public abstract class LivingEntity extends Entity {
|
||||
Vec3 vec3d1 = new Vec3(entity.getX(), entity.getEyeY(), entity.getZ());
|
||||
|
||||
// Paper - diff on change - used in CraftLivingEntity#hasLineOfSight(Location) and CraftWorld#lineOfSightExists
|
||||
@@ -2836,7 +2797,7 @@ index 9822d163a9e4d6ac8240c18a7082e911788d0948..6f98681ac54f575be047867a8c0b58e1
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
index 850a4f8a9bd1dc30b13205e158fcbfaa872d6157..73af374f4aa9e3e8f188434c21a5f1433cffc637 100644
|
||||
index b1ae9b0d8b229e2a6797a173cb11ecc0f43e2592..d7a0fb4727e263932846a67c584da2c8d6d4e275 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -206,14 +206,16 @@ public abstract class Mob extends LivingEntity {
|
||||
@@ -2880,7 +2841,7 @@ index 850a4f8a9bd1dc30b13205e158fcbfaa872d6157..73af374f4aa9e3e8f188434c21a5f143
|
||||
this.level.getProfiler().pop();
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
||||
index 9cbfda029782385d1a7987f5be46d450bd8a758e..52ddf38d5a1894a248e142c6b9ebaff5cc921e5b 100644
|
||||
index c770ee21b7b699522941f6a1584d532001c04082..9bce290eb0c2cfef4896a3f2076c80bf3d76bd56 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
||||
@@ -22,9 +22,11 @@ public class AttributeMap {
|
||||
@@ -2939,7 +2900,7 @@ index 42d466f7f162943886078eba3db18f2dfc2d7bee..6c0dda1ce018ec6bb2ebb97147045fff
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
|
||||
index 7fdc1cbd04a5bba9648272985f51c849b07b8223..02f44b5682b99417f3cd6d6b25dc46cdc2a09093 100644
|
||||
index c77fad612ba99663af2ec4418e3c2d68752dc2c8..8229001df0a901d9016fb16e4ddc81b5a0f51452 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
|
||||
@@ -51,9 +51,12 @@ public class GoalSelector {
|
||||
@@ -2958,7 +2919,7 @@ index 7fdc1cbd04a5bba9648272985f51c849b07b8223..02f44b5682b99417f3cd6d6b25dc46cd
|
||||
public boolean hasTasks() {
|
||||
for (WrappedGoal task : this.availableGoals) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java
|
||||
index 7fc40bb5fb6265b283c7c611f63aae76302c0eaf..387d31e342cef73ae769d712ba62e6aabb364e98 100644
|
||||
index 26bf383caea68834c654b25653ced9017f1b1b22..615eb55e24d365d994fbfe9d45d2be387fd5d561 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java
|
||||
@@ -119,6 +119,7 @@ public abstract class MoveToBlockGoal extends Goal {
|
||||
@@ -2995,10 +2956,10 @@ index a7575b5ef56af6f53448d391abb4956e130148ca..e752c83df50fb9b670ecea2abc95426c
|
||||
return false;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ambient/Bat.java b/src/main/java/net/minecraft/world/entity/ambient/Bat.java
|
||||
index 29dfbcecfbb2560e6ecde997abd5224a16c08c94..a76b754305036bf9c6387e27b86ec1559b290774 100644
|
||||
index ed617223942b410fb6f799be7db2001909db67ed..f11eb6df9f095109378caaf0fd16575bfb2e4976 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ambient/Bat.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ambient/Bat.java
|
||||
@@ -254,13 +254,22 @@ public class Bat extends AmbientCreature {
|
||||
@@ -253,13 +253,22 @@ public class Bat extends AmbientCreature {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3023,10 +2984,10 @@ index 29dfbcecfbb2560e6ecde997abd5224a16c08c94..a76b754305036bf9c6387e27b86ec155
|
||||
@Override
|
||||
protected float getStandingEyeHeight(Pose pose, EntityDimensions dimensions) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java
|
||||
index a3ad957a9131168656b8e30c82d762c77e96ae6e..c296862063d2dcaf5e2d03d316c49ae03ab7d625 100644
|
||||
index d54fc22639bb67a977c27585aac46e9d3dcafa6d..fb800bf3fc198c1aee9a8bdc8d33e5e76f6a8746 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java
|
||||
@@ -282,9 +282,11 @@ public class Axolotl extends Animal implements LerpingModel, Bucketable {
|
||||
@@ -284,9 +284,11 @@ public class Axolotl extends Animal implements LerpingModel, Bucketable {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -3039,10 +3000,10 @@ index a3ad957a9131168656b8e30c82d762c77e96ae6e..c296862063d2dcaf5e2d03d316c49ae0
|
||||
this.level.getProfiler().pop();
|
||||
this.level.getProfiler().push("axolotlActivityUpdate");
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java
|
||||
index cc5687f43f8ac99995667fdc53c5c0586f70f367..d5cd18c478bedaeed83de31d442d1a5b0f0f54cf 100644
|
||||
index 78f1082b0a3bad923c1e142d15bc7dad2ae5ff15..042e852cd440e62003b5e72d92728e2dc602f279 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java
|
||||
@@ -146,9 +146,11 @@ public class Goat extends Animal {
|
||||
@@ -141,9 +141,11 @@ public class Goat extends Animal {
|
||||
return (Brain<Goat>) super.getBrain(); // CraftBukkit - decompile error
|
||||
}
|
||||
|
||||
@@ -3055,7 +3016,7 @@ index cc5687f43f8ac99995667fdc53c5c0586f70f367..d5cd18c478bedaeed83de31d442d1a5b
|
||||
this.level.getProfiler().pop();
|
||||
this.level.getProfiler().push("goatActivityUpdate");
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
index 5170a3d87fa95eace2ec5e56ad4ebc4b25f9297c..7889c9832c6a1ac2afebe4e1030495b3ea52fc2b 100644
|
||||
index f7d29950644a5cf12da0d31246d9f5fcbcc201bb..e5b8bcfe0d69cc0deecdf54662d553f16550fd2a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
@@ -242,10 +242,16 @@ public class ItemEntity extends Entity {
|
||||
@@ -3076,10 +3037,10 @@ index 5170a3d87fa95eace2ec5e56ad4ebc4b25f9297c..7889c9832c6a1ac2afebe4e1030495b3
|
||||
// Paper End
|
||||
this.tryToMerge(entityitem);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
||||
index d47002d45dabd66f38d25d398d8943f4b911cdc5..5e207a3ea30ead2749c1121e2df8da53c8ebfdd7 100644
|
||||
index 4920f5465298b4da33b53f80b8af6220cb0e8ccc..987b7d1924a9caa710fc350012533e56a378646b 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
||||
@@ -318,11 +318,17 @@ public class EnderMan extends Monster implements NeutralMob {
|
||||
@@ -317,11 +317,17 @@ public class EnderMan extends Monster implements NeutralMob {
|
||||
private boolean teleport(double x, double y, double z) {
|
||||
BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos(x, y, z);
|
||||
|
||||
@@ -3097,7 +3058,7 @@ index d47002d45dabd66f38d25d398d8943f4b911cdc5..5e207a3ea30ead2749c1121e2df8da53
|
||||
- BlockState iblockdata = this.level.getBlockState(blockposition_mutableblockposition);
|
||||
+ BlockState iblockdata = chunk.getBlockState(blockposition_mutableblockposition); // Pufferfish
|
||||
boolean flag = iblockdata.getMaterial().blocksMotion();
|
||||
boolean flag1 = iblockdata.getFluidState().is((Tag) FluidTags.WATER);
|
||||
boolean flag1 = iblockdata.getFluidState().is(FluidTags.WATER);
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java b/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java
|
||||
index 373ec915412899e4893aa182abd6fb63f3dff0aa..fc43b1d5dcb53456bb24ae46ea08b97b14403c86 100644
|
||||
@@ -3132,10 +3093,10 @@ index f65d32245556e2acab927a29626749edea980f0a..16116a4f907ff691646a3e98dd8e25e0
|
||||
this.level.getProfiler().pop();
|
||||
PiglinAi.updateActivity(this);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java
|
||||
index ea612b3c3ed7305b504d65eb6d38ed99547fd488..7d6bc3c253a77adfc7c35383caadb37154dc5c0f 100644
|
||||
index 268524e256a034520438d5c825e5e419d72d29ce..63903bd02c6f31d3190a20d106997d4f7b777df8 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/npc/Villager.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java
|
||||
@@ -138,6 +138,8 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
||||
@@ -140,6 +140,8 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
||||
return villageplacetype == PoiType.MEETING;
|
||||
});
|
||||
|
||||
@@ -3144,7 +3105,7 @@ index ea612b3c3ed7305b504d65eb6d38ed99547fd488..7d6bc3c253a77adfc7c35383caadb371
|
||||
public Villager(EntityType<? extends Villager> entityType, Level world) {
|
||||
this(entityType, world, VillagerType.PLAINS);
|
||||
}
|
||||
@@ -241,11 +243,17 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
||||
@@ -243,11 +245,17 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
||||
}
|
||||
// Spigot End
|
||||
|
||||
@@ -3164,10 +3125,10 @@ index ea612b3c3ed7305b504d65eb6d38ed99547fd488..7d6bc3c253a77adfc7c35383caadb371
|
||||
if (this.assignProfessionWhenSpawned) {
|
||||
this.assignProfessionWhenSpawned = false;
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Inventory.java b/src/main/java/net/minecraft/world/entity/player/Inventory.java
|
||||
index c7e16e96633e17b951f0681599c5b3efc3ce1e6c..15dc5e9f426f78af0f3f92435a641a89ef2f134c 100644
|
||||
index b770e7840b00b46a127ae05cc872a21f7a2dffad..772200b9efe232cb407e460f2353a156c1a92c89 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/Inventory.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/Inventory.java
|
||||
@@ -688,6 +688,8 @@ public class Inventory implements Container, Nameable {
|
||||
@@ -682,6 +682,8 @@ public class Inventory implements Container, Nameable {
|
||||
}
|
||||
|
||||
public boolean contains(ItemStack stack) {
|
||||
@@ -3176,7 +3137,7 @@ index c7e16e96633e17b951f0681599c5b3efc3ce1e6c..15dc5e9f426f78af0f3f92435a641a89
|
||||
Iterator iterator = this.compartments.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@@ -702,6 +704,18 @@ public class Inventory implements Container, Nameable {
|
||||
@@ -696,6 +698,18 @@ public class Inventory implements Container, Nameable {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3353,7 +3314,7 @@ index d1eefa6ef3e9abfe7af4d8310aa64465fa2d5463..0f4aa330e5b179bb706a31917c671f16
|
||||
default BlockHitResult clip(ClipContext raytrace1, BlockPos blockposition) {
|
||||
// Paper start - Prevent raytrace from loading chunks
|
||||
diff --git a/src/main/java/net/minecraft/world/level/GameRules.java b/src/main/java/net/minecraft/world/level/GameRules.java
|
||||
index e7ca5d6fb8922e7e8065864f736b06056be080a0..6c9e574851b518242dbbee9bce954b44dbaeecb6 100644
|
||||
index 798afc145c54306fcf0838d8daef2bdf17763da9..e67d5012bc7af629d05bceb1b1e22162272e17aa 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/GameRules.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/GameRules.java
|
||||
@@ -90,6 +90,7 @@ public class GameRules {
|
||||
@@ -3413,10 +3374,10 @@ index e7ca5d6fb8922e7e8065864f736b06056be080a0..6c9e574851b518242dbbee9bce954b44
|
||||
final String id;
|
||||
private final GameRules.Category category;
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 11e146241a01ab9ec206b9d3f39aebf5c201a16e..9f2a16d32a93a0bcbdfb2f3734cd9ee5c8d57c52 100644
|
||||
index 160c0f37aa3aaf7598f852acf9bd444f79444c97..d1521394eaf38ab4e3ee55452149458911a3030b 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -305,6 +305,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -259,6 +259,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
}
|
||||
// Paper end - optimise checkDespawn
|
||||
|
||||
@@ -3429,24 +3390,24 @@ index 11e146241a01ab9ec206b9d3f39aebf5c201a16e..9f2a16d32a93a0bcbdfb2f3734cd9ee5
|
||||
+ @Override public final int getHeight() { return this.height; }
|
||||
+ // Pufferfish end
|
||||
+
|
||||
protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, final DimensionType dimensionmanager, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor
|
||||
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
|
||||
this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName(), this.spigotConfig); // Paper
|
||||
@@ -322,6 +331,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
this.profiler = supplier;
|
||||
public abstract ResourceKey<LevelStem> getTypeKey();
|
||||
|
||||
protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor
|
||||
@@ -279,6 +288,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
this.levelData = worlddatamutable;
|
||||
this.dimensionType = dimensionmanager;
|
||||
this.dimensionTypeRegistration = holder;
|
||||
this.dimensionType = (DimensionType) holder.value();
|
||||
+ // Pufferfish start
|
||||
+ this.minBuildHeight = dimensionmanager.minY();
|
||||
+ this.minBuildHeight = this.dimensionType.minY();
|
||||
+ this.minSection = SectionPos.blockToSectionCoord(this.minBuildHeight);
|
||||
+ this.height = dimensionmanager.height();
|
||||
+ this.height = this.dimensionType.height();
|
||||
+ this.maxBuildHeight = this.minBuildHeight + this.height;
|
||||
+ this.maxSection = SectionPos.blockToSectionCoord(this.maxBuildHeight - 1) + 1;
|
||||
+ // Pufferfish end
|
||||
this.dimension = resourcekey;
|
||||
this.isClientSide = flag;
|
||||
if (dimensionmanager.coordinateScale() != 1.0D) {
|
||||
@@ -437,6 +453,91 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
if (this.dimensionType.coordinateScale() != 1.0D) {
|
||||
@@ -394,6 +410,91 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -3538,7 +3499,7 @@ index 11e146241a01ab9ec206b9d3f39aebf5c201a16e..9f2a16d32a93a0bcbdfb2f3734cd9ee5
|
||||
public boolean isInWorldBounds(BlockPos pos) {
|
||||
return pos.isInsideBuildHeightAndWorldBoundsHorizontal(this); // Paper - use better/optimized check
|
||||
}
|
||||
@@ -978,13 +1079,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -935,13 +1036,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
try {
|
||||
tickConsumer.accept(entity);
|
||||
MinecraftServer.getServer().executeMidTickTasks(); // Paper - execute chunk tasks mid tick
|
||||
@@ -3554,7 +3515,7 @@ index 11e146241a01ab9ec206b9d3f39aebf5c201a16e..9f2a16d32a93a0bcbdfb2f3734cd9ee5
|
||||
// Paper end
|
||||
}
|
||||
}
|
||||
@@ -1446,6 +1547,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -1405,6 +1506,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
}
|
||||
|
||||
public ProfilerFiller getProfiler() {
|
||||
@@ -3563,11 +3524,11 @@ index 11e146241a01ab9ec206b9d3f39aebf5c201a16e..9f2a16d32a93a0bcbdfb2f3734cd9ee5
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||
index 515e58e3db223fbdc01ca87607aca234c7010d51..f71f8b5c95849a6fb0367d7b027300cb2559b9e8 100644
|
||||
index 13eded53a64d0f36f8c9bce2077de4f1c1ed2d56..303ad9eab2e0a9b73597ca4ee9d70bea1979c5dd 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||
@@ -408,12 +408,12 @@ public final class NaturalSpawner {
|
||||
return spawnGroup == MobCategory.MONSTER && world.getBlockState(pos.below()).is(Blocks.NETHER_BRICKS) && structureAccessor.getStructureAt(pos, StructureFeature.NETHER_BRIDGE).isValid();
|
||||
@@ -414,12 +414,12 @@ public final class NaturalSpawner {
|
||||
}
|
||||
}
|
||||
|
||||
- private static BlockPos getRandomPosWithin(Level world, LevelChunk chunk) {
|
||||
@@ -3584,10 +3545,10 @@ index 515e58e3db223fbdc01ca87607aca234c7010d51..f71f8b5c95849a6fb0367d7b027300cb
|
||||
return new BlockPos(i, l, j);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/biome/Biome.java b/src/main/java/net/minecraft/world/level/biome/Biome.java
|
||||
index fa4544541b9c5f163b633596e73a5197cd081eb8..0e993320f56fa08fa346833620ad0b3bc2fc772b 100644
|
||||
index 0422d787593cc65aadcae9f7517ec67a52f1f72b..74b446bde17ff023fb19c422d15993fb1f4b3d69 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/biome/Biome.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/biome/Biome.java
|
||||
@@ -80,14 +80,20 @@ public final class Biome {
|
||||
@@ -52,14 +52,20 @@ public final class Biome {
|
||||
private final MobSpawnSettings mobSettings;
|
||||
private final Biome.BiomeCategory biomeCategory;
|
||||
private final BiomeSpecialEffects specialEffects;
|
||||
@@ -3609,7 +3570,7 @@ index fa4544541b9c5f163b633596e73a5197cd081eb8..0e993320f56fa08fa346833620ad0b3b
|
||||
});
|
||||
});
|
||||
|
||||
@@ -129,17 +135,15 @@ public final class Biome {
|
||||
@@ -101,17 +107,15 @@ public final class Biome {
|
||||
@Deprecated
|
||||
public float getTemperature(BlockPos blockPos) {
|
||||
long l = blockPos.asLong();
|
||||
@@ -3711,7 +3672,7 @@ index e56f7d76b501dab7d549efd2fafd514a9625c24e..066f43deb5df6f79428eb0f325c2abfb
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||
index a19642740f42ee8c683ed7a86f6edd2bc887b6dd..14d5c4c62e5b9cac1c16af8e259f6a8ff3d8bbbf 100644
|
||||
index d241b25acc223982109495542fd17e0fbdf53437..9cc130087dfda6639def3b5bfd347c59602da3f3 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||
@@ -44,7 +44,10 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||
@@ -3845,7 +3806,7 @@ index ed3518fe7c841d9e1a9c97626acaa3d765a6d76f..da00f75ccc9f8c2e2174d4450479202a
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
index b47c4c9e9b82030cd82d72fe90d7c8bf558d6b28..087be9acfa77d3fd0216e5983aa62149e668cfc7 100644
|
||||
index d4ce71d98c5071cd3567c772a0853ca86550bad5..5d91f00e81864a981ca457fc4fa88f01dbc67a47 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
@@ -94,6 +94,18 @@ public class LevelChunk extends ChunkAccess {
|
||||
@@ -3876,20 +3837,20 @@ index b47c4c9e9b82030cd82d72fe90d7c8bf558d6b28..087be9acfa77d3fd0216e5983aa62149
|
||||
|
||||
public org.bukkit.Chunk bukkitChunk;
|
||||
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 e962db693510dc261d6456706a459929369f2510..16874e3c7c8e2577f3661cb3a459c63ea061b2d8 100644
|
||||
index b11ad90c0956ac1b8ee069fa3f4553a2b4ce88e9..a32a90056acf37150b90f2941ce5b87b6ca8d162 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
|
||||
@@ -25,6 +25,9 @@ public class LevelChunkSection {
|
||||
@@ -26,6 +26,9 @@ public class LevelChunkSection {
|
||||
private short tickingFluidCount;
|
||||
public final PalettedContainer<BlockState> states;
|
||||
private final PalettedContainer<Biome> biomes;
|
||||
private final PalettedContainer<Holder<Biome>> biomes;
|
||||
+ // Pufferfish start
|
||||
+ public short fluidStateCount;
|
||||
+ // Pufferfish end
|
||||
public final com.destroystokyo.paper.util.maplist.IBlockDataList tickingList = new com.destroystokyo.paper.util.maplist.IBlockDataList(); // Paper
|
||||
|
||||
public LevelChunkSection(int chunkPos, PalettedContainer<BlockState> blockStateContainer, PalettedContainer<Biome> biomeContainer) {
|
||||
@@ -195,6 +198,7 @@ public class LevelChunkSection {
|
||||
public LevelChunkSection(int chunkPos, PalettedContainer<BlockState> blockStateContainer, PalettedContainer<Holder<Biome>> biomeContainer) {
|
||||
@@ -196,6 +199,7 @@ public class LevelChunkSection {
|
||||
|
||||
if (!fluid.isEmpty()) {
|
||||
--this.tickingFluidCount;
|
||||
@@ -3897,7 +3858,7 @@ index e962db693510dc261d6456706a459929369f2510..16874e3c7c8e2577f3661cb3a459c63e
|
||||
}
|
||||
|
||||
if (!state.isAir()) {
|
||||
@@ -209,6 +213,7 @@ public class LevelChunkSection {
|
||||
@@ -210,6 +214,7 @@ public class LevelChunkSection {
|
||||
|
||||
if (!fluid1.isEmpty()) {
|
||||
++this.tickingFluidCount;
|
||||
@@ -3905,9 +3866,9 @@ index e962db693510dc261d6456706a459929369f2510..16874e3c7c8e2577f3661cb3a459c63e
|
||||
}
|
||||
|
||||
this.updateKnownBlockInfo(x | (z << 4) | (y << 8), iblockdata1, state); // Paper
|
||||
@@ -260,6 +265,7 @@ public class LevelChunkSection {
|
||||
@@ -258,6 +263,7 @@ public class LevelChunkSection {
|
||||
if (fluid.isRandomlyTicking()) {
|
||||
this.tickingFluidCount = (short) (this.tickingFluidCount + 1); // Paper
|
||||
this.tickingFluidCount = (short) (this.tickingFluidCount + 1);
|
||||
}
|
||||
+ this.fluidStateCount++; // Pufferfish
|
||||
}
|
||||
@@ -3953,10 +3914,10 @@ index 3b13f6ea36a3bfecabe09221eb5c48dddab119db..563b6c47df0c5ae9efcb91fd53a065b1
|
||||
@Override
|
||||
public T get(int id) {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
|
||||
index 6f5f9d8a38bf023969c883b3e3a230c3cdc62104..a02a5313db545a8694feec0e2504465426c39a6a 100644
|
||||
index ff40fe323964f173561a6838fb443e79abf9df38..c2c3ed6ba79f9f41497e042571f699a0fc6e9335 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
|
||||
@@ -44,6 +44,8 @@ public abstract class FlowingFluid extends Fluid {
|
||||
@@ -43,6 +43,8 @@ public abstract class FlowingFluid extends Fluid {
|
||||
public static final BooleanProperty FALLING = BlockStateProperties.FALLING;
|
||||
public static final IntegerProperty LEVEL = BlockStateProperties.LEVEL_FLOWING;
|
||||
private static final int CACHE_SIZE = 200;
|
||||
@@ -3965,7 +3926,7 @@ index 6f5f9d8a38bf023969c883b3e3a230c3cdc62104..a02a5313db545a8694feec0e25044654
|
||||
private static final ThreadLocal<Object2ByteLinkedOpenHashMap<Block.BlockStatePairKey>> OCCLUSION_CACHE = ThreadLocal.withInitial(() -> {
|
||||
Object2ByteLinkedOpenHashMap<Block.BlockStatePairKey> object2bytelinkedopenhashmap = new Object2ByteLinkedOpenHashMap<Block.BlockStatePairKey>(200) {
|
||||
protected void rehash(int i) {}
|
||||
@@ -52,6 +54,14 @@ public abstract class FlowingFluid extends Fluid {
|
||||
@@ -51,6 +53,14 @@ public abstract class FlowingFluid extends Fluid {
|
||||
object2bytelinkedopenhashmap.defaultReturnValue((byte) 127);
|
||||
return object2bytelinkedopenhashmap;
|
||||
});
|
||||
@@ -3980,7 +3941,7 @@ index 6f5f9d8a38bf023969c883b3e3a230c3cdc62104..a02a5313db545a8694feec0e25044654
|
||||
private final Map<FluidState, VoxelShape> shapes = Maps.newIdentityHashMap();
|
||||
|
||||
public FlowingFluid() {}
|
||||
@@ -240,6 +250,8 @@ public abstract class FlowingFluid extends Fluid {
|
||||
@@ -239,6 +249,8 @@ public abstract class FlowingFluid extends Fluid {
|
||||
}
|
||||
|
||||
private boolean canPassThroughWall(Direction face, BlockGetter world, BlockPos pos, BlockState state, BlockPos fromPos, BlockState fromState) {
|
||||
@@ -3989,7 +3950,7 @@ index 6f5f9d8a38bf023969c883b3e3a230c3cdc62104..a02a5313db545a8694feec0e25044654
|
||||
Object2ByteLinkedOpenHashMap object2bytelinkedopenhashmap;
|
||||
|
||||
if (!state.getBlock().hasDynamicShape() && !fromState.getBlock().hasDynamicShape()) {
|
||||
@@ -247,9 +259,16 @@ public abstract class FlowingFluid extends Fluid {
|
||||
@@ -246,9 +258,16 @@ public abstract class FlowingFluid extends Fluid {
|
||||
} else {
|
||||
object2bytelinkedopenhashmap = null;
|
||||
}
|
||||
@@ -4006,7 +3967,7 @@ index 6f5f9d8a38bf023969c883b3e3a230c3cdc62104..a02a5313db545a8694feec0e25044654
|
||||
if (object2bytelinkedopenhashmap != null) {
|
||||
block_a = new Block.BlockStatePairKey(state, fromState, face);
|
||||
byte b0 = object2bytelinkedopenhashmap.getAndMoveToFirst(block_a);
|
||||
@@ -260,11 +279,22 @@ public abstract class FlowingFluid extends Fluid {
|
||||
@@ -259,11 +278,22 @@ public abstract class FlowingFluid extends Fluid {
|
||||
} else {
|
||||
block_a = null;
|
||||
}
|
||||
@@ -4029,7 +3990,7 @@ index 6f5f9d8a38bf023969c883b3e3a230c3cdc62104..a02a5313db545a8694feec0e25044654
|
||||
if (object2bytelinkedopenhashmap != null) {
|
||||
if (object2bytelinkedopenhashmap.size() == 200) {
|
||||
object2bytelinkedopenhashmap.removeLastByte();
|
||||
@@ -272,6 +302,11 @@ public abstract class FlowingFluid extends Fluid {
|
||||
@@ -271,6 +301,11 @@ public abstract class FlowingFluid extends Fluid {
|
||||
|
||||
object2bytelinkedopenhashmap.putAndMoveToFirst(block_a, (byte) (flag ? 1 : 0));
|
||||
}
|
||||
@@ -4059,10 +4020,10 @@ index 05b64f2730bfe836bd1d72dcfccd9f536908a099..d33af84300db18ea2b71dba2c9ed4339
|
||||
|
||||
public boolean hasParam(LootContextParam<?> parameter) {
|
||||
diff --git a/src/main/java/net/minecraft/world/phys/shapes/EntityCollisionContext.java b/src/main/java/net/minecraft/world/phys/shapes/EntityCollisionContext.java
|
||||
index e387de8adc480eac27b58b6f3f0d331ffc4382f1..6dba9d6bb7b81fe176cc0fabbb60b554282a9180 100644
|
||||
index b1992ed5136cc7dcf04219868b94b3c37ae36b4b..7d494a050d1dac79c7bae5a7464fccabfdc6066d 100644
|
||||
--- a/src/main/java/net/minecraft/world/phys/shapes/EntityCollisionContext.java
|
||||
+++ b/src/main/java/net/minecraft/world/phys/shapes/EntityCollisionContext.java
|
||||
@@ -21,47 +21,68 @@ public class EntityCollisionContext implements CollisionContext {
|
||||
@@ -19,47 +19,68 @@ public class EntityCollisionContext implements CollisionContext {
|
||||
return defaultValue;
|
||||
}
|
||||
};
|
||||
@@ -4071,12 +4032,12 @@ index e387de8adc480eac27b58b6f3f0d331ffc4382f1..6dba9d6bb7b81fe176cc0fabbb60b554
|
||||
private final boolean descending;
|
||||
private final double entityBottom;
|
||||
private final ItemStack heldItem;
|
||||
private final Predicate<Fluid> canStandOnFluid;
|
||||
+ */
|
||||
private final Predicate<FluidState> canStandOnFluid;
|
||||
+ */
|
||||
@Nullable
|
||||
private final Entity entity;
|
||||
|
||||
protected EntityCollisionContext(boolean descending, double minY, ItemStack heldItem, Predicate<Fluid> walkOnFluidPredicate, @Nullable Entity entity) {
|
||||
protected EntityCollisionContext(boolean descending, double minY, ItemStack heldItem, Predicate<FluidState> walkOnFluidPredicate, @Nullable Entity entity) {
|
||||
+ /*
|
||||
this.descending = descending;
|
||||
this.entityBottom = minY;
|
||||
@@ -4090,7 +4051,7 @@ index e387de8adc480eac27b58b6f3f0d331ffc4382f1..6dba9d6bb7b81fe176cc0fabbb60b554
|
||||
@Deprecated
|
||||
protected EntityCollisionContext(Entity entity) {
|
||||
+ /*
|
||||
this(entity.isDescending(), entity.getY(), entity instanceof LivingEntity ? ((LivingEntity)entity).getMainHandItem() : ItemStack.EMPTY, entity instanceof LivingEntity ? ((LivingEntity)entity)::canStandOnFluid : (fluid) -> {
|
||||
this(entity.isDescending(), entity.getY(), entity instanceof LivingEntity ? ((LivingEntity)entity).getMainHandItem() : ItemStack.EMPTY, entity instanceof LivingEntity ? ((LivingEntity)entity)::canStandOnFluid : (fluidState) -> {
|
||||
return false;
|
||||
}, entity);
|
||||
+ */
|
||||
@@ -4111,12 +4072,12 @@ index e387de8adc480eac27b58b6f3f0d331ffc4382f1..6dba9d6bb7b81fe176cc0fabbb60b554
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canStandOnFluid(FluidState state, FlowingFluid fluid) {
|
||||
- return this.canStandOnFluid.test(fluid) && !state.getType().isSame(fluid);
|
||||
public boolean canStandOnFluid(FluidState state, FluidState fluidState) {
|
||||
- return this.canStandOnFluid.test(fluidState) && !state.getType().isSame(fluidState.getType());
|
||||
+ // Pufferfish start
|
||||
+ Entity entity = this.entity;
|
||||
+ if (entity instanceof LivingEntity livingEntity) {
|
||||
+ return livingEntity.canStandOnFluid(fluid) && !state.getType().isSame(fluid);
|
||||
+ return livingEntity.canStandOnFluid(fluidState) && !state.getType().isSame(fluidState.getType());
|
||||
+ }
|
||||
+ return false;
|
||||
+ // Pufferfish end
|
||||
@@ -4136,10 +4097,10 @@ index e387de8adc480eac27b58b6f3f0d331ffc4382f1..6dba9d6bb7b81fe176cc0fabbb60b554
|
||||
|
||||
@Nullable
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 51f67a2944034552d57b939ef29e0249e74383b9..206754441b98e9386bb366d5ec57cffc0142fc94 100644
|
||||
index 5a6290e5d7b82dbc069d159ea53292e4dbc94d03..118b9aed39dfaa3780905bb38738ba8b131fc0e4 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -251,7 +251,7 @@ import javax.annotation.Nullable; // Paper
|
||||
@@ -248,7 +248,7 @@ import javax.annotation.Nullable; // Paper
|
||||
import javax.annotation.Nonnull; // Paper
|
||||
|
||||
public final class CraftServer implements Server {
|
||||
@@ -4148,7 +4109,7 @@ index 51f67a2944034552d57b939ef29e0249e74383b9..206754441b98e9386bb366d5ec57cffc
|
||||
private final String serverVersion;
|
||||
private final String bukkitVersion = Versioning.getBukkitVersion();
|
||||
private final Logger logger = Logger.getLogger("Minecraft");
|
||||
@@ -1045,6 +1045,11 @@ public final class CraftServer implements Server {
|
||||
@@ -1042,6 +1042,11 @@ public final class CraftServer implements Server {
|
||||
plugin.getDescription().getName(),
|
||||
"This plugin is not properly shutting down its async tasks when it is being shut down. This task may throw errors during the final shutdown logs and might not complete before process dies."
|
||||
));
|
||||
@@ -4210,7 +4171,7 @@ index 909b2c98e7a9117d2f737245e4661792ffafb744..0d9e2b3728f9ab500bd5e44702718535
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index 4be7b18b4e794734439d1e8bec4304d88328c91e..98d396658bd7547e6b6f850529cab216e83c6c62 100644
|
||||
index d8f4d351a66c6d1e60e1a470ce64f538c7718232..d5d9f5d16a0972c2dac84f713dee940d21c56865 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -421,7 +421,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
|
||||
Reference in New Issue
Block a user