mirror of
https://github.com/Dreeam-qwq/Gale.git
synced 2025-12-21 15:59:28 +00:00
Update to 1.20
This commit is contained in:
@@ -9,14 +9,26 @@
|
||||
# of these issues. Due to the complex nature of mappings generation and the debugging difficulty involved it may take
|
||||
# a significant amount of time for us to track down every possible issue, so this file will likely be around and in
|
||||
# use - at least in some capacity - for a long time.
|
||||
#
|
||||
# If you are adding mappings patches which are correcting for issues in paperweight's reobf mappings generation,
|
||||
# unrelated to any changes in your patches, we ask that you PR the mapping to Paper so more users can benefit rather
|
||||
# than keep the fix for your own fork. If the mappings patch is there to correct reobf for changes made in your patches,
|
||||
# then obviously it doesn't make any sense to PR them upstream.
|
||||
|
||||
tiny 2 0 mojang+yarn spigot
|
||||
|
||||
# Workaround by MoritzR200 (see issue#87)
|
||||
c net/minecraft/server/dedicated/DedicatedServerProperties net/minecraft/server/dedicated/DedicatedServerProperties
|
||||
m (Ljava/lang/String;)Ljava/lang/String; lambda$new$3 d
|
||||
# CraftBukkit changes type
|
||||
c net/minecraft/server/level/ServerLevel net/minecraft/server/level/WorldServer
|
||||
f Lnet/minecraft/world/level/storage/PrimaryLevelData; serverLevelData K
|
||||
|
||||
c net/minecraft/world/level/chunk/LevelChunk net/minecraft/world/level/chunk/Chunk
|
||||
f Lnet/minecraft/server/level/ServerLevel; level r
|
||||
|
||||
# See mappings-patch.tiny
|
||||
c net/minecraft/server/level/ChunkMap net/minecraft/server/level/PlayerChunkMap
|
||||
f Lnet/minecraft/server/level/ChunkMap$ChunkDistanceManager; distanceManager F
|
||||
|
||||
# Paper changes type
|
||||
c net/minecraft/core/MappedRegistry net/minecraft/core/RegistryMaterials
|
||||
f Lit/unimi/dsi/fastutil/objects/Reference2IntOpenHashMap; toId e
|
||||
|
||||
# upstream makes a bunch of methods public that cause accidental overrides now
|
||||
c net/minecraft/world/entity/Display net/minecraft/world/entity/Display
|
||||
m ()I getInterpolationDelay getInterpolationDelay_
|
||||
m (I)V setInterpolationDelay setInterpolationDelay_
|
||||
m (I)V setInterpolationDuration setInterpolationDuration_
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import io.papermc.paperweight.tasks.CollectATsFromPatches
|
||||
|
||||
plugins {
|
||||
java
|
||||
`maven-publish`
|
||||
@@ -66,3 +68,8 @@ paperweight {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Uncomment while updating for a new Minecraft version
|
||||
//tasks.withType<CollectATsFromPatches> {
|
||||
// extraPatchDir.set(layout.projectDirectory.dir("patches/unapplied/server"))
|
||||
//}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
group=org.galemc.gale
|
||||
version=1.19.4-R0.1-SNAPSHOT
|
||||
version=1.20-R0.1-SNAPSHOT
|
||||
|
||||
mcVersion=1.19.4
|
||||
paperRef=bc4a6647c99ae98c52c1c81597834be8fec6aa0d
|
||||
mcVersion=1.20
|
||||
paperRef=4b5f84712ba3afab4ab9184de91d85d070584e60
|
||||
|
||||
org.gradle.caching=true
|
||||
org.gradle.parallel=true
|
||||
|
||||
@@ -7,10 +7,10 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
Gale - https://galemc.org
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 279a666e8ea2c07f41ee3f28b768e95dca5f0a10..cd3207095c92ab6a195f8a24dbe4afaa65bf0996 100644
|
||||
index 7d6239855a84502de4eb3328b0dcf12ac671dce4..3ba111a857dda4773f4a66dea99d516b37c64b07 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -85,6 +85,15 @@ val generateApiVersioningFile by tasks.registering {
|
||||
@@ -87,6 +87,15 @@ val generateApiVersioningFile by tasks.registering {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ index 279a666e8ea2c07f41ee3f28b768e95dca5f0a10..cd3207095c92ab6a195f8a24dbe4afaa
|
||||
tasks.jar {
|
||||
from(generateApiVersioningFile.map { it.outputs.files.singleFile }) {
|
||||
into("META-INF/maven/${project.group}/${project.name}")
|
||||
@@ -134,6 +143,8 @@ tasks.withType<Javadoc> {
|
||||
@@ -136,6 +145,8 @@ tasks.withType<Javadoc> {
|
||||
into("build/docs/javadoc")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,10 +13,10 @@ As part of: Pufferfish (https://github.com/pufferfish-gg/Pufferfish)
|
||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index cd3207095c92ab6a195f8a24dbe4afaa65bf0996..0719e49dde343c80d18daf82d7fed926150d7d6d 100644
|
||||
index 3ba111a857dda4773f4a66dea99d516b37c64b07..003429ead5a773c1283a732ff54a4fdc7b85618b 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -91,6 +91,7 @@ tasks.withType<JavaCompile> {
|
||||
@@ -93,6 +93,7 @@ tasks.withType<JavaCompile> {
|
||||
compilerArgs.add("-Xlint:-module")
|
||||
compilerArgs.add("-Xlint:-removal")
|
||||
compilerArgs.add("-Xlint:-dep-ann")
|
||||
@@ -24,7 +24,7 @@ index cd3207095c92ab6a195f8a24dbe4afaa65bf0996..0719e49dde343c80d18daf82d7fed926
|
||||
}
|
||||
// Gale end - hide irrelevant compilation warnings
|
||||
|
||||
@@ -145,6 +146,7 @@ tasks.withType<Javadoc> {
|
||||
@@ -147,6 +148,7 @@ tasks.withType<Javadoc> {
|
||||
}
|
||||
|
||||
options.addStringOption("Xdoclint:none", "-quiet") // Gale - hide irrelevant compilation warnings
|
||||
@@ -34,7 +34,7 @@ index cd3207095c92ab6a195f8a24dbe4afaa65bf0996..0719e49dde343c80d18daf82d7fed926
|
||||
// Paper start
|
||||
diff --git a/src/main/java/gg/pufferfish/pufferfish/simd/SIMDChecker.java b/src/main/java/gg/pufferfish/pufferfish/simd/SIMDChecker.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..48312d416805697257e4cd3451b8d14bab7ea252
|
||||
index 0000000000000000000000000000000000000000..3f008b41727ff1bfdf14e6d186e8d74af5b35245
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/gg/pufferfish/pufferfish/simd/SIMDChecker.java
|
||||
@@ -0,0 +1,45 @@
|
||||
@@ -58,7 +58,7 @@ index 0000000000000000000000000000000000000000..48312d416805697257e4cd3451b8d14b
|
||||
+ public static boolean canEnable(Logger logger, boolean logVectorSizesToConsole) {
|
||||
+ try {
|
||||
+ int javaVersion = SIMDDetection.getJavaVersion();
|
||||
+ if (!(javaVersion >= 17 && javaVersion <= 19)) {
|
||||
+ if (!(javaVersion >= 17 && javaVersion <= 22)) {
|
||||
+ return false;
|
||||
+ } else {
|
||||
+ SIMDDetection.testRun = true;
|
||||
|
||||
@@ -37,7 +37,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 88c4885569d2b8b22fce55601d50608ac8e9388c..930086e164c1c8cef8ff27009736e6962357bc2b 100644
|
||||
index 997afb6739c72529ea8226228a9905d72f77c89a..37ab594c0323a1e85c53646f07d2f4ffef62f7c9 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -3,6 +3,8 @@ package org.bukkit.entity;
|
||||
@@ -49,7 +49,7 @@ index 88c4885569d2b8b22fce55601d50608ac8e9388c..930086e164c1c8cef8ff27009736e696
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.GameMode;
|
||||
@@ -1645,6 +1647,16 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1672,6 +1674,16 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@ApiStatus.Experimental
|
||||
public boolean canSee(@NotNull Entity entity);
|
||||
|
||||
|
||||
@@ -22,6 +22,31 @@ The above copyright notice and this permission notice shall be included in all c
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index b5042ccfad1f99cce88b3a8878da15909333c3a0..8b66e73c03ef016b99e0480b951140c1c6be6ec4 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -2532,6 +2532,20 @@ public final class Bukkit {
|
||||
}
|
||||
// Paper end
|
||||
|
||||
+ // Gale start - YAPFA - last tick time - API
|
||||
+ public static long getLastTickTotalTime() {
|
||||
+ return server.getLastTickTotalTime();
|
||||
+ }
|
||||
+
|
||||
+ public static long getLastTickProperTime() {
|
||||
+ return server.getLastTickProperTime();
|
||||
+ }
|
||||
+
|
||||
+ public static long getLastTickOversleepTime() {
|
||||
+ return server.getLastTickOversleepTime();
|
||||
+ }
|
||||
+ // Gale end - YAPFA - last tick time - API
|
||||
+
|
||||
@NotNull
|
||||
public static Server.Spigot spigot() {
|
||||
return server.spigot();
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index 237b837a790bb3a3e33ae5731f550b1e8b55437b..007e23a9383ab8eda12c6dffb385256215356040 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
|
||||
@@ -7,7 +7,7 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
Gale - https://galemc.org
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index d5d49bb2b47c889e12d17dc87b8c439a60b3fe67..b7dab09e5cab1098211851ecd9555c9be68071e4 100644
|
||||
index 7a17e05b630517a6861c34a4561198db62acf82a..7617fe6903713893af8f6ef6564c97549709ff26 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -7,8 +7,14 @@ plugins {
|
||||
@@ -20,7 +20,7 @@ index d5d49bb2b47c889e12d17dc87b8c439a60b3fe67..b7dab09e5cab1098211851ecd9555c9b
|
||||
+ // Depend on own API
|
||||
+ implementation(project(":gale-api"))
|
||||
+ // Depend on Paper MojangAPI
|
||||
+ implementation("io.papermc.paper:paper-mojangapi:1.19.3-R0.1-SNAPSHOT") {
|
||||
+ implementation("io.papermc.paper:paper-mojangapi:1.20-R0.1-SNAPSHOT") {
|
||||
+ exclude("io.papermc.paper", "paper-api")
|
||||
+ }
|
||||
+ // Gale end - project setup
|
||||
|
||||
@@ -93,10 +93,10 @@ index 50a9f33aa31e9273c7c52d4bb2b02f0f884f7ba5..19779298b2b2ecbe30f9308dad1d8037
|
||||
});
|
||||
return Collections.unmodifiableCollection(list);
|
||||
diff --git a/src/main/java/net/minecraft/util/ExtraCodecs.java b/src/main/java/net/minecraft/util/ExtraCodecs.java
|
||||
index cf64c2bed790da41a2e524e75d60a069765f035a..57fae84be749bd4a61a0c700a5cefce7122643e6 100644
|
||||
index 066d423dc908080157586555ba01053a2477d570..9402ba85ebb8260d7bd29ddf8cf871b77aa2e783 100644
|
||||
--- a/src/main/java/net/minecraft/util/ExtraCodecs.java
|
||||
+++ b/src/main/java/net/minecraft/util/ExtraCodecs.java
|
||||
@@ -228,7 +228,7 @@ public class ExtraCodecs {
|
||||
@@ -247,7 +247,7 @@ public class ExtraCodecs {
|
||||
return ImmutableList.of(leftFunction.apply(pair), rightFunction.apply(pair));
|
||||
});
|
||||
Codec<I> codec3 = RecordCodecBuilder.<Pair>create((instance) -> {
|
||||
@@ -105,7 +105,7 @@ index cf64c2bed790da41a2e524e75d60a069765f035a..57fae84be749bd4a61a0c700a5cefce7
|
||||
}).comapFlatMap((pair) -> {
|
||||
return combineFunction.apply((P)pair.getFirst(), (P)pair.getSecond());
|
||||
}, (pair) -> {
|
||||
@@ -259,7 +259,7 @@ public class ExtraCodecs {
|
||||
@@ -278,7 +278,7 @@ public class ExtraCodecs {
|
||||
Optional<Pair<A, T>> optional = dataResult.resultOrPartial(mutableObject::setValue);
|
||||
return optional.isPresent() ? dataResult : DataResult.error(() -> {
|
||||
return "(" + (String)mutableObject.getValue() + " -> using default)";
|
||||
@@ -114,7 +114,7 @@ index cf64c2bed790da41a2e524e75d60a069765f035a..57fae84be749bd4a61a0c700a5cefce7
|
||||
}
|
||||
|
||||
public <T> DataResult<T> coApply(DynamicOps<T> dynamicOps, A objectx, DataResult<T> dataResult) {
|
||||
@@ -542,7 +542,7 @@ public class ExtraCodecs {
|
||||
@@ -565,7 +565,7 @@ public class ExtraCodecs {
|
||||
|
||||
static record LazyInitializedCodec<A>(Supplier<Codec<A>> delegate) implements Codec<A> {
|
||||
LazyInitializedCodec {
|
||||
@@ -124,7 +124,7 @@ index cf64c2bed790da41a2e524e75d60a069765f035a..57fae84be749bd4a61a0c700a5cefce7
|
||||
|
||||
public <T> DataResult<Pair<A, T>> decode(DynamicOps<T> dynamicOps, T object) {
|
||||
diff --git a/src/main/java/net/minecraft/util/datafix/fixes/ChunkProtoTickListFix.java b/src/main/java/net/minecraft/util/datafix/fixes/ChunkProtoTickListFix.java
|
||||
index db8eed0070a6e9949d73e94e07fea589ace09fd4..d6de68b4b0edabf37ba551b91bbe6682895b2a82 100644
|
||||
index 2e650637afede22d314bbe4dd4e91806ce88dcc3..8081a24eb5a533a55cdca3c882ccc61255b8a76c 100644
|
||||
--- a/src/main/java/net/minecraft/util/datafix/fixes/ChunkProtoTickListFix.java
|
||||
+++ b/src/main/java/net/minecraft/util/datafix/fixes/ChunkProtoTickListFix.java
|
||||
@@ -17,6 +17,7 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectArrayMap;
|
||||
@@ -196,7 +196,7 @@ index db8eed0070a6e9949d73e94e07fea589ace09fd4..d6de68b4b0edabf37ba551b91bbe6682
|
||||
|
||||
public static final class PoorMansPalettedContainer {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Zoglin.java b/src/main/java/net/minecraft/world/entity/monster/Zoglin.java
|
||||
index 5956a7759964f5e4939f062e93714fba64f53141..51ad507a3b625201ecca50bd92f8f089f3b4d60a 100644
|
||||
index c1abeb62f63d2f8fb891efec8f76c6736b8f7f75..b056e29671f0a8437387c990fc96a9f3c1d614a2 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Zoglin.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Zoglin.java
|
||||
@@ -182,7 +182,7 @@ public class Zoglin extends Monster implements Enemy, HoglinBase {
|
||||
@@ -209,7 +209,7 @@ index 5956a7759964f5e4939f062e93714fba64f53141..51ad507a3b625201ecca50bd92f8f089
|
||||
|
||||
protected void updateActivity() {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java
|
||||
index ac75c54e897565e340b66823caeed92ba1d1641a..e44eec821eaa1cd77569814000d4aa36253fb13d 100644
|
||||
index d02ee11066fc4f07ccb110b09b86d895ff90d4f2..5d1a30e09870a5a535c71a2e44b8e6933de0c1e8 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java
|
||||
@@ -70,7 +70,7 @@ public class PiglinBrute extends AbstractPiglin {
|
||||
@@ -221,8 +221,25 @@ index ac75c54e897565e340b66823caeed92ba1d1641a..e44eec821eaa1cd77569814000d4aa36
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/item/BrushItem.java b/src/main/java/net/minecraft/world/item/BrushItem.java
|
||||
index 0279e3fc7aed675ccf66aa68a11ff94a6dc6abe6..d025232b43af3cb8dc28dff2e3e05c72e490901d 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/BrushItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/BrushItem.java
|
||||
@@ -82,8 +82,10 @@ public class BrushItem extends Item {
|
||||
BlockEntity var18 = world.getBlockEntity(blockPos);
|
||||
if (var18 instanceof BrushableBlockEntity) {
|
||||
BrushableBlockEntity brushableBlockEntity = (BrushableBlockEntity)var18;
|
||||
- boolean bl2 = brushableBlockEntity.brush(world.getGameTime(), player, blockHitResult.getDirection());
|
||||
- if (bl2) {
|
||||
+ // Gale start - dev import deobfuscation fixes
|
||||
+ boolean bl22 = brushableBlockEntity.brush(world.getGameTime(), player, blockHitResult.getDirection());
|
||||
+ if (bl22) {
|
||||
+ // Gale end - dev import deobfuscation fixes
|
||||
EquipmentSlot equipmentSlot = stack.equals(player.getItemBySlot(EquipmentSlot.OFFHAND)) ? EquipmentSlot.OFFHAND : EquipmentSlot.MAINHAND;
|
||||
stack.hurtAndBreak(1, user, (userx) -> {
|
||||
userx.broadcastBreakEvent(equipmentSlot);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/levelgen/SurfaceRules.java b/src/main/java/net/minecraft/world/level/levelgen/SurfaceRules.java
|
||||
index daee1072171769d89783a7d7ef9e5692cb9fbc20..45b0706a48c4bf44923a2590f34913b7373de8f4 100644
|
||||
index 915c1cbcc0ecf634cc76f02bba53dc82d22be698..0c05aa0d0938b19453f45adf5931c88713e3b227 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/levelgen/SurfaceRules.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/levelgen/SurfaceRules.java
|
||||
@@ -154,7 +154,7 @@ public class SurfaceRules {
|
||||
|
||||
@@ -7,13 +7,13 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
Gale - https://galemc.org
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 337003cf37ee544903c0800f7118dbd5c5a40a63..0b3f1508c2d461a11cf26e9e298e15e3650daccf 100644
|
||||
index 0bf73437d6aabadc2b784ff62f2854bcfc4c2a11..b0066dc98abf596fc60ff2d4b0761f5845d5ffa5 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -56,6 +56,16 @@ dependencies {
|
||||
}
|
||||
|
||||
val craftbukkitPackageVersion = "1_19_R3" // Paper
|
||||
val craftbukkitPackageVersion = "1_20_R1" // Paper
|
||||
+
|
||||
+// Gale start - hide irrelevant compilation warnings
|
||||
+tasks.withType<JavaCompile> {
|
||||
|
||||
@@ -7,10 +7,10 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
Gale - https://galemc.org
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 1f7d0aa2d36b59c23a04e94dc117da987bc1a0b2..6394d18f32d190e4eee34c40c1aa9ffe65662e6b 100644
|
||||
index ab3633eb6552bde9ac6fc16d3a5feb6d1f0992bc..86a8726e033f405cb0c8b4289f21dca16431718e 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -182,6 +182,10 @@ fun TaskContainer.registerRunTask(
|
||||
@@ -183,6 +183,10 @@ fun TaskContainer.registerRunTask(
|
||||
val memoryGb = providers.gradleProperty("paper.runMemoryGb").getOrElse("2")
|
||||
minHeapSize = "${memoryGb}G"
|
||||
maxHeapSize = "${memoryGb}G"
|
||||
|
||||
@@ -11,7 +11,7 @@ License for non-image files: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
Gale - https://galemc.org
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 4793c65a161e951ab9329479fdf86abdb6e641f1..1f35bf1c87cd503a3b164b4824c78d4d9ef393a9 100644
|
||||
index 7400f732562df7aaf10f7059e8085df95de792f3..860a744f61db62bb95374c6e7a4ebfd2cd51f35a 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -78,7 +78,7 @@ tasks.jar {
|
||||
@@ -194,10 +194,10 @@ index c5d5648f4ca603ef2b1df723b58f9caf4dd3c722..e45e6b44b2a8f2cdae6e0048a812b921
|
||||
.completer(new ConsoleCommandCompleter(this.server))
|
||||
.option(LineReader.Option.COMPLETE_IN_WORD, true);
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 9f15d9dbdfa74a0640b1a2b4ff695609d4758a4c..ec7bf5c30a19215af6fe19b16de24e523de0a2ac 100644
|
||||
index fb82bb52f219e7683fe1d3c0fb3acbe2251de8d4..bc54a4d802b81877b45fc69631f09a9668b5ea78 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -925,7 +925,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -923,7 +923,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
shutdownThread = Thread.currentThread();
|
||||
org.spigotmc.WatchdogThread.doStop(); // Paper
|
||||
if (!isSameThread()) {
|
||||
@@ -212,7 +212,7 @@ index 9f15d9dbdfa74a0640b1a2b4ff695609d4758a4c..ec7bf5c30a19215af6fe19b16de24e52
|
||||
while (this.getRunningThread().isAlive()) {
|
||||
this.getRunningThread().stop();
|
||||
try {
|
||||
@@ -1682,7 +1688,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1681,7 +1687,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
||||
@DontObfuscate
|
||||
public String getServerModName() {
|
||||
@@ -222,7 +222,7 @@ index 9f15d9dbdfa74a0640b1a2b4ff695609d4758a4c..ec7bf5c30a19215af6fe19b16de24e52
|
||||
|
||||
public SystemReport fillSystemReport(SystemReport details) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 9f2536d9a73bdb15b5b3004d4da79ca32cee205b..ac72aa6f4bb39aaace7c2abd7ec7ced4b955991d 100644
|
||||
index f87433133fa6a68dac33895f91770f453e0678d2..0ca28d30b0237cb2ec1097ed4c429397f8e3d414 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -262,7 +262,7 @@ import javax.annotation.Nullable; // Paper
|
||||
@@ -248,7 +248,7 @@ index cdefb2025eedea7e204d70d568adaf1c1ec4c03c..3997a7fec43e05b455644b4d58c68995
|
||||
// (async tasks must live with race-conditions if they attempt to cancel between these few lines of code)
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index 1179e9fbff93ec8ff82aa3aae477f6bf4ce9b885..9a6ac55178ab36a52e2a13a581e5760331f9bf2f 100644
|
||||
index b059bb46b649cbf82debdb8d58fe4ba77d040276..a5bb5c8a9a45a71356ddbe8702c414a0a60aa16b 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -472,7 +472,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -460,7 +460,7 @@ index 0000000000000000000000000000000000000000..7fee1c2779ab390586b2d3f75f568908
|
||||
+}
|
||||
diff --git a/src/main/java/org/galemc/gale/version/GaleVersionFetcher.java b/src/main/java/org/galemc/gale/version/GaleVersionFetcher.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..1ed9ecedba4b1daaf35c1a5b5c7aa524399b4c0e
|
||||
index 0000000000000000000000000000000000000000..4946618a2be455738a3b0222d91ed6611c472c74
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/galemc/gale/version/GaleVersionFetcher.java
|
||||
@@ -0,0 +1,11 @@
|
||||
@@ -471,7 +471,7 @@ index 0000000000000000000000000000000000000000..1ed9ecedba4b1daaf35c1a5b5c7aa524
|
||||
+public class GaleVersionFetcher extends AbstractPaperVersionFetcher {
|
||||
+
|
||||
+ public GaleVersionFetcher() {
|
||||
+ super("ver/1.19.4", "https://github.com/GaleMC/Gale", "Gale", "GaleMC", "GaleMC", "Gale");
|
||||
+ super("ver/1.20", "https://github.com/GaleMC/Gale", "Gale", "GaleMC", "GaleMC", "Gale");
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
|
||||
@@ -13,7 +13,7 @@ As part of: Paper (https://github.com/PaperMC/Paper)
|
||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
|
||||
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
index c07eb451a576811a39021f6f97103c77488fd001..6724cd70b2b255979b371411c7b5b8c6231b49fd 100644
|
||||
index a2f71a6d1a9e98133dff6cd0f625da9435a8af14..1b9d997c31ab281ce9f4719f53b0ad78a430789d 100644
|
||||
--- a/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
+++ b/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
@@ -242,7 +242,10 @@ public class TimingsExport extends Thread {
|
||||
@@ -225,7 +225,7 @@ index f6b9d216c24d8858802f85209fe1a869e5a9be31..1376290026401424619f95dead7fca63
|
||||
+ // Gale end - Gale configuration
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index ec7bf5c30a19215af6fe19b16de24e523de0a2ac..d2b0f385ae241f8212e78bfe96f8c2047c96a237 100644
|
||||
index bc54a4d802b81877b45fc69631f09a9668b5ea78..2fbd75595dc222c2fb784e9e356a3dce530c6776 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -3,9 +3,6 @@ package net.minecraft.server;
|
||||
@@ -254,15 +254,17 @@ index ec7bf5c30a19215af6fe19b16de24e523de0a2ac..d2b0f385ae241f8212e78bfe96f8c204
|
||||
import net.minecraft.util.datafix.DataFixers;
|
||||
import net.minecraft.util.profiling.EmptyProfileResults;
|
||||
import net.minecraft.util.profiling.ProfileResults;
|
||||
@@ -164,6 +159,7 @@ import net.minecraft.world.level.storage.loot.LootTables;
|
||||
import net.minecraft.world.level.storage.loot.PredicateManager;
|
||||
import net.minecraft.world.phys.Vec2;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
@@ -161,6 +156,9 @@ import net.minecraft.world.level.storage.PrimaryLevelData;
|
||||
import net.minecraft.world.level.storage.ServerLevelData;
|
||||
import net.minecraft.world.level.storage.WorldData;
|
||||
import net.minecraft.world.level.storage.loot.LootDataManager;
|
||||
+import net.minecraft.world.phys.Vec2;
|
||||
+import net.minecraft.world.phys.Vec3;
|
||||
+import org.galemc.gale.configuration.GaleConfigurations;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
// CraftBukkit start
|
||||
@@ -308,6 +304,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -308,6 +306,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
public final double[] recentTps = new double[ 3 ];
|
||||
// Spigot end
|
||||
public final io.papermc.paper.configuration.PaperConfigurations paperConfigurations;
|
||||
@@ -270,7 +272,7 @@ index ec7bf5c30a19215af6fe19b16de24e523de0a2ac..d2b0f385ae241f8212e78bfe96f8c204
|
||||
public static long currentTickLong = 0L; // Paper
|
||||
|
||||
public volatile Thread shutdownThread; // Paper
|
||||
@@ -410,6 +407,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -410,6 +409,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
// Paper end
|
||||
Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this));
|
||||
this.paperConfigurations = services.paperConfigurations(); // Paper
|
||||
@@ -279,26 +281,26 @@ index ec7bf5c30a19215af6fe19b16de24e523de0a2ac..d2b0f385ae241f8212e78bfe96f8c204
|
||||
// CraftBukkit end
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Services.java b/src/main/java/net/minecraft/server/Services.java
|
||||
index ef6ff78af2ae747e939895b82ee9d11c75012dcd..b445d4562304fec912131ee32c4e0f894f44a928 100644
|
||||
index a9b2c8cd4dcd3f884e4306bebee9334d3848fce5..3430a1ac3252ff9a457ee36ffc112503a25e4272 100644
|
||||
--- a/src/main/java/net/minecraft/server/Services.java
|
||||
+++ b/src/main/java/net/minecraft/server/Services.java
|
||||
@@ -6,12 +6,13 @@ import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService;
|
||||
import java.io.File;
|
||||
@@ -9,12 +9,13 @@ import java.io.File;
|
||||
import javax.annotation.Nullable;
|
||||
import net.minecraft.server.players.GameProfileCache;
|
||||
import net.minecraft.util.SignatureValidator;
|
||||
+import org.galemc.gale.configuration.GaleConfigurations;
|
||||
|
||||
// Paper start
|
||||
-public record Services(MinecraftSessionService sessionService, SignatureValidator serviceSignatureValidator, GameProfileRepository profileRepository, GameProfileCache profileCache, @javax.annotation.Nullable io.papermc.paper.configuration.PaperConfigurations paperConfigurations) {
|
||||
+public record Services(MinecraftSessionService sessionService, SignatureValidator serviceSignatureValidator, GameProfileRepository profileRepository, GameProfileCache profileCache, @javax.annotation.Nullable io.papermc.paper.configuration.PaperConfigurations paperConfigurations, @javax.annotation.Nullable GaleConfigurations galeConfigurations) { // Gale - Gale configuration
|
||||
-public record Services(MinecraftSessionService sessionService, ServicesKeySet servicesKeySet, GameProfileRepository profileRepository, GameProfileCache profileCache, @javax.annotation.Nullable io.papermc.paper.configuration.PaperConfigurations paperConfigurations) {
|
||||
+public record Services(MinecraftSessionService sessionService, ServicesKeySet servicesKeySet, GameProfileRepository profileRepository, GameProfileCache profileCache, @javax.annotation.Nullable io.papermc.paper.configuration.PaperConfigurations paperConfigurations, @javax.annotation.Nullable GaleConfigurations galeConfigurations) { // Gale - Gale configuration
|
||||
|
||||
public Services(MinecraftSessionService sessionService, SignatureValidator signatureValidator, GameProfileRepository profileRepository, GameProfileCache profileCache) {
|
||||
- this(sessionService, signatureValidator, profileRepository, profileCache, null);
|
||||
+ this(sessionService, signatureValidator, profileRepository, profileCache, null, null); // Gale - Gale configuration
|
||||
public Services(MinecraftSessionService sessionService, ServicesKeySet servicesKeySet, GameProfileRepository profileRepository, GameProfileCache profileCache) {
|
||||
- this(sessionService, servicesKeySet, profileRepository, profileCache, null);
|
||||
+ this(sessionService, servicesKeySet, profileRepository, profileCache, null, null); // Gale - Gale configuration
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -19,6 +20,11 @@ public record Services(MinecraftSessionService sessionService, SignatureValidato
|
||||
@@ -22,6 +23,11 @@ public record Services(MinecraftSessionService sessionService, ServicesKeySet se
|
||||
return java.util.Objects.requireNonNull(this.paperConfigurations);
|
||||
}
|
||||
// Paper end
|
||||
@@ -310,20 +312,20 @@ index ef6ff78af2ae747e939895b82ee9d11c75012dcd..b445d4562304fec912131ee32c4e0f89
|
||||
public static final String USERID_CACHE_FILE = "usercache.json"; // Paper - private -> public
|
||||
|
||||
public static Services create(YggdrasilAuthenticationService authenticationService, File rootDirectory, File userCacheFile, joptsimple.OptionSet optionSet) throws Exception { // Paper
|
||||
@@ -30,7 +36,10 @@ public record Services(MinecraftSessionService sessionService, SignatureValidato
|
||||
@@ -32,7 +38,10 @@ public record Services(MinecraftSessionService sessionService, ServicesKeySet se
|
||||
final java.nio.file.Path legacyConfigPath = ((File) optionSet.valueOf("paper-settings")).toPath();
|
||||
final java.nio.file.Path configDirPath = ((File) optionSet.valueOf("paper-settings-directory")).toPath();
|
||||
io.papermc.paper.configuration.PaperConfigurations paperConfigurations = io.papermc.paper.configuration.PaperConfigurations.setup(legacyConfigPath, configDirPath, rootDirectory.toPath(), (File) optionSet.valueOf("spigot-settings"));
|
||||
- return new Services(minecraftSessionService, signatureValidator, gameProfileRepository, gameProfileCache, paperConfigurations);
|
||||
- return new Services(minecraftSessionService, authenticationService.getServicesKeySet(), gameProfileRepository, gameProfileCache, paperConfigurations);
|
||||
+ // Gale start - Gale configuration
|
||||
+ GaleConfigurations galeConfigurations = GaleConfigurations.setup(configDirPath);
|
||||
+ return new Services(minecraftSessionService, signatureValidator, gameProfileRepository, gameProfileCache, paperConfigurations, galeConfigurations);
|
||||
+ return new Services(minecraftSessionService, authenticationService.getServicesKeySet(), gameProfileRepository, gameProfileCache, paperConfigurations, galeConfigurations);
|
||||
+ // Gale end - Gale configuration
|
||||
// Paper end
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index a7e133f3495e9132a5fdae2c24f225e7b026295a..b98fb8afdadbda47db5924299d90082edf3ca1b4 100644
|
||||
index 9f422cbeaa52b3e6a0a27af4f8ad4ddb7808483f..9d54ef5f12a24131b1504566e09cd9714b93e913 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -1,20 +1,15 @@
|
||||
@@ -360,10 +362,10 @@ index a7e133f3495e9132a5fdae2c24f225e7b026295a..b98fb8afdadbda47db5924299d90082e
|
||||
if (this.convertOldUsers()) {
|
||||
this.getProfileCache().save(false); // Paper
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 45804711255f04110e9509df8d60900314aa10b7..ffbc971acd9a01e693d9fc2c9ab8fab859e1df10 100644
|
||||
index 18aac3da3c88f33b1a71a5920a8daa27e9723913..513916690d2579760f59edecb1a273f475d54adf 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -130,12 +130,10 @@ import net.minecraft.world.level.chunk.storage.EntityStorage;
|
||||
@@ -132,12 +132,10 @@ import net.minecraft.world.level.chunk.storage.EntityStorage;
|
||||
import net.minecraft.world.level.dimension.BuiltinDimensionTypes;
|
||||
import net.minecraft.world.level.dimension.LevelStem;
|
||||
import net.minecraft.world.level.dimension.end.EndDragonFight;
|
||||
@@ -376,7 +378,7 @@ index 45804711255f04110e9509df8d60900314aa10b7..ffbc971acd9a01e693d9fc2c9ab8fab8
|
||||
import net.minecraft.world.level.gameevent.DynamicGameEventListener;
|
||||
import net.minecraft.world.level.gameevent.GameEvent;
|
||||
import net.minecraft.world.level.gameevent.GameEventDispatcher;
|
||||
@@ -527,7 +525,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -647,7 +645,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
// Holder holder = worlddimension.type(); // CraftBukkit - decompile error
|
||||
|
||||
// Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error
|
||||
@@ -386,7 +388,7 @@ index 45804711255f04110e9509df8d60900314aa10b7..ffbc971acd9a01e693d9fc2c9ab8fab8
|
||||
this.convertable = convertable_conversionsession;
|
||||
this.uuid = WorldUUID.getUUID(convertable_conversionsession.levelDirectory.path().toFile());
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 973ecd50f9cb6b86c353586e84d15dcb118ccb60..63122fb74a51547e23232a5409295369ee3aa353 100644
|
||||
index 147d802d9207e358fdb2d1c7806fc2f634dcfd98..71189e98dcb71e625defe5a0bd6355597c9382e6 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -1,10 +1,7 @@
|
||||
@@ -436,7 +438,7 @@ index 973ecd50f9cb6b86c353586e84d15dcb118ccb60..63122fb74a51547e23232a5409295369
|
||||
// CraftBukkit end
|
||||
|
||||
public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -175,6 +167,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -174,6 +166,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
return this.paperConfig;
|
||||
}
|
||||
// Paper end
|
||||
@@ -449,7 +451,7 @@ index 973ecd50f9cb6b86c353586e84d15dcb118ccb60..63122fb74a51547e23232a5409295369
|
||||
|
||||
public final com.destroystokyo.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray
|
||||
public final co.aikar.timings.WorldTimingsHandler timings; // Paper
|
||||
@@ -274,9 +272,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -273,9 +271,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
|
||||
public abstract ResourceKey<LevelStem> getTypeKey();
|
||||
|
||||
@@ -462,7 +464,7 @@ index 973ecd50f9cb6b86c353586e84d15dcb118ccb60..63122fb74a51547e23232a5409295369
|
||||
this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env);
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index ac72aa6f4bb39aaace7c2abd7ec7ced4b955991d..1cd4198fa1cbb4e27f016463c489dbddce9c659e 100644
|
||||
index 7f3cb409e90dc0b558f583d0c83c91f5f76d6ea8..2301c9adfd70e130ee89c63481d9976cec0793e4 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -979,6 +979,7 @@ public final class CraftServer implements Server {
|
||||
@@ -473,7 +475,7 @@ index ac72aa6f4bb39aaace7c2abd7ec7ced4b955991d..1cd4198fa1cbb4e27f016463c489dbdd
|
||||
for (ServerLevel world : this.console.getAllLevels()) {
|
||||
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
|
||||
world.setSpawnSettings(world.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && config.spawnMonsters, config.spawnAnimals); // Paper - per level difficulty (from MinecraftServer#setDifficulty(ServerLevel, Difficulty, boolean))
|
||||
@@ -2763,6 +2764,14 @@ public final class CraftServer implements Server {
|
||||
@@ -2759,6 +2760,14 @@ public final class CraftServer implements Server {
|
||||
return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,10 +7,10 @@ License: AGPL-3.0 (https://www.gnu.org/licenses/agpl-3.0.html)
|
||||
Gale - https://galemc.org
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index d2b0f385ae241f8212e78bfe96f8c2047c96a237..205390c78e81d46b2f121dc431d876ed9d499e77 100644
|
||||
index 2fbd75595dc222c2fb784e9e356a3dce530c6776..824b9b5374e0f4ccf2205ee55540ee9fcdec3c2c 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1385,7 +1385,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1386,7 +1386,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
public void onServerExit() {}
|
||||
|
||||
public void tickServer(BooleanSupplier shouldKeepTicking) {
|
||||
@@ -19,7 +19,7 @@ index d2b0f385ae241f8212e78bfe96f8c2047c96a237..205390c78e81d46b2f121dc431d876ed
|
||||
long i = Util.getNanos();
|
||||
|
||||
// Paper start - move oversleep into full server tick
|
||||
@@ -1451,7 +1451,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1452,7 +1452,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.frameTimer.logFrameDuration(k - i);
|
||||
this.profiler.pop();
|
||||
org.spigotmc.WatchdogThread.tick(); // Spigot
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -40,23 +40,23 @@ 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/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index b4b916f2929d83aaa160a69a198836ed53430e23..517a4cde947b51195ca7e99afc330d8b40fae235 100644
|
||||
index 5cf43c4d0ce6e3af5ea6c190db0c47c35b0a350c..59db3933d1abb161b7ea6b9164653e96255cb545 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -3591,7 +3591,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -3640,7 +3640,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
Vec3 vec3d1 = new Vec3(entity.getX(), entity.getEyeY(), entity.getZ());
|
||||
|
||||
// Paper - diff on change - used in CraftLivingEntity#hasLineOfSight(Location) and CraftWorld#lineOfSightExists
|
||||
- return vec3d1.distanceToSqr(vec3d) > 128D * 128D ? false : this.level.clip(new ClipContext(vec3d, vec3d1, ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE, this)).getType() == HitResult.Type.MISS; // Paper - use distanceToSqr
|
||||
+ return vec3d1.distanceToSqr(vec3d) > 128D * 128D ? false : this.level.rayTraceDirect(vec3d, vec3d1, net.minecraft.world.phys.shapes.CollisionContext.of(this)) == net.minecraft.world.phys.BlockHitResult.Type.MISS; // Paper - use distanceToSqr // Gale - Airplane - strip raytracing for EntityLiving#hasLineOfSight
|
||||
- return vec3d1.distanceToSqr(vec3d) > 128D * 128D ? false : this.level().clip(new ClipContext(vec3d, vec3d1, ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE, this)).getType() == HitResult.Type.MISS;
|
||||
+ return vec3d1.distanceToSqr(vec3d) > 128D * 128D ? false : this.level().rayTraceDirect(vec3d, vec3d1, net.minecraft.world.phys.shapes.CollisionContext.of(this)) == net.minecraft.world.phys.BlockHitResult.Type.MISS; // Paper - use distanceToSqr // Gale - Airplane - strip raytracing for EntityLiving#hasLineOfSight
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/BlockGetter.java b/src/main/java/net/minecraft/world/level/BlockGetter.java
|
||||
index 2ee9e8e3c1a28c1823de8e1fe421cc1f3e72f384..9d41fc2ed4fa623d5fac62fbb3340d13c78a746d 100644
|
||||
index 0e8746759752b692668886370181aa5db1fd0bb0..e5e50817c83b6a7d3daf90960ed402180998ca49 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/BlockGetter.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/BlockGetter.java
|
||||
@@ -73,6 +73,16 @@ public interface BlockGetter extends LevelHeightAccessor {
|
||||
@@ -68,6 +68,16 @@ public interface BlockGetter extends LevelHeightAccessor {
|
||||
});
|
||||
}
|
||||
|
||||
@@ -74,10 +74,10 @@ index 2ee9e8e3c1a28c1823de8e1fe421cc1f3e72f384..9d41fc2ed4fa623d5fac62fbb3340d13
|
||||
default BlockHitResult clip(ClipContext raytrace1, BlockPos blockposition) {
|
||||
// Paper start - Prevent raytrace from loading chunks
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 262626a0a01ed05f3f49cebec8b31266b2c441e7..c512c37439fa2b40bbd1d40301686bd13fa0469e 100644
|
||||
index 65258190f550a0a2653fc975430d8d88ff5ec259..0502f5bf4ee886ddc16f430a4c6679279cc12ff1 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -409,6 +409,91 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -408,6 +408,91 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,10 +31,10 @@ 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/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||
index 8b2a3a8482018b7db7de81bc295862f783e17ce5..64f6555372ba5c97891fd6742f51fa6680c690a2 100644
|
||||
index 1b7cf6d06bdf36f146656727511a461f2520762e..d598a99072bd8eb4a4ed151b9202237dd0c2af8c 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||
@@ -44,6 +44,44 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
@@ -44,6 +44,45 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
super(type, world);
|
||||
}
|
||||
|
||||
@@ -53,17 +53,18 @@ index 8b2a3a8482018b7db7de81bc295862f783e17ce5..64f6555372ba5c97891fd6742f51fa66
|
||||
+ int previousX = Mth.floor(this.getX()) >> 4, previousZ = Mth.floor(this.getZ()) >> 4;
|
||||
+ int newX = Mth.floor(x) >> 4, newZ = Mth.floor(z) >> 4;
|
||||
+ if (previousX != newX || previousZ != newZ) {
|
||||
+ boolean isLoaded = ((net.minecraft.server.level.ServerChunkCache) this.level.getChunkSource()).getChunkAtIfLoadedMainThread(newX, newZ) != null;
|
||||
+ boolean isLoaded = ((net.minecraft.server.level.ServerChunkCache) this.level().getChunkSource()).getChunkAtIfLoadedMainThread(newX, newZ) != null;
|
||||
+ if (!isLoaded) {
|
||||
+ int maxChunkLoadsPerTick = this.level.galeConfig().smallOptimizations.maxProjectileChunkLoads.perTick;
|
||||
+ var maxProjectileChunkLoadsConfig = this.level().galeConfig().smallOptimizations.maxProjectileChunkLoads;
|
||||
+ int maxChunkLoadsPerTick = maxProjectileChunkLoadsConfig.perTick;
|
||||
+ if (maxChunkLoadsPerTick >= 0 && chunksLoadedThisTick > maxChunkLoadsPerTick) {
|
||||
+ return;
|
||||
+ }
|
||||
+ int maxChunkLoadsPerProjectile = this.level.galeConfig().smallOptimizations.maxProjectileChunkLoads.perProjectile.max;
|
||||
+ int maxChunkLoadsPerProjectile = maxProjectileChunkLoadsConfig.perProjectile.max;
|
||||
+ if (maxChunkLoadsPerProjectile >= 0 && this.chunksLoadedByProjectile >= maxChunkLoadsPerProjectile) {
|
||||
+ if (this.level.galeConfig().smallOptimizations.maxProjectileChunkLoads.perProjectile.removeFromWorldAfterReachLimit) {
|
||||
+ if (maxProjectileChunkLoadsConfig.perProjectile.removeFromWorldAfterReachLimit) {
|
||||
+ this.discard();
|
||||
+ } else if (this.level.galeConfig().smallOptimizations.maxProjectileChunkLoads.perProjectile.resetMovementAfterReachLimit) {
|
||||
+ } else if (maxProjectileChunkLoadsConfig.perProjectile.resetMovementAfterReachLimit) {
|
||||
+ this.setDeltaMovement(0, this.getDeltaMovement().y, 0);
|
||||
+ }
|
||||
+ return;
|
||||
|
||||
@@ -19,10 +19,10 @@ require it to be initialized earlier. By moving it to the superclass, we
|
||||
initialize it earlier, ensuring that it is available sooner.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 42b0aa27af33aa5879f9d9a5fcfa19c296fbc635..c0424d758bf2921ae89cfdf89ff71980684e5d0c 100644
|
||||
index 287f6a38a6f042983c5e652ff9800fb215a91221..47acb63bfca2f722a595cf6614c28e75d1d94235 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -770,7 +770,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -911,7 +911,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
}
|
||||
// Paper start - optimise random block ticking
|
||||
private final BlockPos.MutableBlockPos chunkTickMutablePosition = new BlockPos.MutableBlockPos();
|
||||
@@ -31,10 +31,10 @@ index 42b0aa27af33aa5879f9d9a5fcfa19c296fbc635..c0424d758bf2921ae89cfdf89ff71980
|
||||
|
||||
public void tickChunk(LevelChunk chunk, int randomTickSpeed) {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index c512c37439fa2b40bbd1d40301686bd13fa0469e..67de286dd6a569da9f8b36a4c7bd673830c17a2b 100644
|
||||
index 0502f5bf4ee886ddc16f430a4c6679279cc12ff1..5185af09005fd9f671daca0844b42e85b29a0376 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -181,6 +181,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -180,6 +180,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
public final Map<Explosion.CacheKey, Float> explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions
|
||||
public java.util.ArrayDeque<net.minecraft.world.level.block.RedstoneTorchBlock.Toggle> redstoneUpdateInfos; // Paper - Move from Map in BlockRedstoneTorch to here
|
||||
|
||||
|
||||
@@ -52,10 +52,10 @@ 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/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
index d95c3b14c06421c03c99f84efb3a5319200f8a57..8ed18a158a13dceca7cd342125c09e52ac0d013c 100644
|
||||
index 78201998d6cbee9aa6f0bad80b726b46675393dc..041f188b742ad819e2460e8ca5ab7f44412dbf9b 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
@@ -689,6 +689,7 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -539,6 +539,7 @@ public class ServerChunkCache extends ChunkSource {
|
||||
// Paper end - optimize isOutisdeRange
|
||||
LevelData worlddata = this.level.getLevelData();
|
||||
|
||||
@@ -64,10 +64,10 @@ index d95c3b14c06421c03c99f84efb3a5319200f8a57..8ed18a158a13dceca7cd342125c09e52
|
||||
boolean flag1 = level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) != 0L && worlddata.getGameTime() % level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) == 0L; // CraftBukkit
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index f9e58d0b2d4b41bbfadf2ab9591914e7090c61dd..cb0df7b5db3fa885f43b35e6ef8c6cdc221b4003 100644
|
||||
index 47acb63bfca2f722a595cf6614c28e75d1d94235..b7318670e039e05a058e437e025519d40557bb88 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -772,6 +772,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -913,6 +913,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
private final BlockPos.MutableBlockPos chunkTickMutablePosition = new BlockPos.MutableBlockPos();
|
||||
// Paper end
|
||||
|
||||
@@ -76,7 +76,7 @@ index f9e58d0b2d4b41bbfadf2ab9591914e7090c61dd..cb0df7b5db3fa885f43b35e6ef8c6cdc
|
||||
public void tickChunk(LevelChunk chunk, int randomTickSpeed) {
|
||||
ChunkPos chunkcoordintpair = chunk.getPos();
|
||||
boolean flag = this.isRaining();
|
||||
@@ -779,7 +781,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -920,7 +922,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
int k = chunkcoordintpair.getMinBlockZ();
|
||||
final BlockPos.MutableBlockPos blockposition = this.chunkTickMutablePosition; // Paper - use mutable to reduce allocation rate, final to force compile fail on change
|
||||
|
||||
@@ -85,9 +85,9 @@ index f9e58d0b2d4b41bbfadf2ab9591914e7090c61dd..cb0df7b5db3fa885f43b35e6ef8c6cdc
|
||||
blockposition.set(this.findLightningTargetAround(this.getBlockRandomPos(j, 0, k, 15))); // Paper
|
||||
if (this.isRainingAt(blockposition)) {
|
||||
DifficultyInstance difficultydamagescaler = this.getCurrentDifficultyAt(blockposition);
|
||||
@@ -808,7 +810,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
|
||||
@@ -950,7 +952,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
int l;
|
||||
int i1;
|
||||
|
||||
- if (!this.paperConfig().environment.disableIceAndSnow && this.random.nextInt(16) == 0) { // Paper - Disable ice and snow
|
||||
+ if (!this.paperConfig().environment.disableIceAndSnow && (this.currentIceAndSnowTick++ & 15) == 0) { // Paper - Disable ice and snow // Paper - optimise random ticking // Gale - Airplane - optimize random calls in chunk ticking - optimize further random ticking
|
||||
@@ -95,10 +95,10 @@ index f9e58d0b2d4b41bbfadf2ab9591914e7090c61dd..cb0df7b5db3fa885f43b35e6ef8c6cdc
|
||||
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/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
index 6ba3d1721a781522df24b255beee6dc61b9144ae..18c3f13c523ea62a098f489636b4320c73da4b8b 100644
|
||||
index 624c96b0907dfb8b6c351710bed58df78690a483..901938201c1abee1c88e217d2c1ba1a2d147420e 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
@@ -87,6 +87,18 @@ public class LevelChunk extends ChunkAccess {
|
||||
@@ -84,6 +84,18 @@ public class LevelChunk extends ChunkAccess {
|
||||
private final LevelChunkTicks<Block> blockTicks;
|
||||
private final LevelChunkTicks<Fluid> fluidTicks;
|
||||
|
||||
@@ -117,7 +117,7 @@ index 6ba3d1721a781522df24b255beee6dc61b9144ae..18c3f13c523ea62a098f489636b4320c
|
||||
public LevelChunk(Level world, ChunkPos pos) {
|
||||
this(world, pos, UpgradeData.EMPTY, new LevelChunkTicks<>(), new LevelChunkTicks<>(), 0L, (LevelChunkSection[]) null, (LevelChunk.PostLoadProcessor) null, (BlendingData) null);
|
||||
}
|
||||
@@ -115,6 +127,7 @@ public class LevelChunk extends ChunkAccess {
|
||||
@@ -111,6 +123,7 @@ public class LevelChunk extends ChunkAccess {
|
||||
this.postLoad = entityLoader;
|
||||
this.blockTicks = blockTickScheduler;
|
||||
this.fluidTicks = fluidTickScheduler;
|
||||
|
||||
@@ -31,26 +31,26 @@ 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/src/main/java/net/minecraft/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
||||
index 418d6301f067803e2471e59ac2d52a68cbff249b..079bd9d0d3c73da61297723aea8e79edf531004b 100644
|
||||
index 4616addb05fcc20b1ec6ca1dea01cbefed697acd..82e8ddfd136d04106c796d784028c45e5c21dedd 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
||||
@@ -322,11 +322,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);
|
||||
|
||||
- while (blockposition_mutableblockposition.getY() > this.level.getMinBuildHeight() && !this.level.getBlockState(blockposition_mutableblockposition).getMaterial().blocksMotion()) {
|
||||
- while (blockposition_mutableblockposition.getY() > this.level().getMinBuildHeight() && !this.level().getBlockState(blockposition_mutableblockposition).blocksMotion()) {
|
||||
+ // Gale start - Airplane - single chunk lookup
|
||||
+ net.minecraft.world.level.chunk.LevelChunk chunk = this.level.getChunkIfLoaded(blockposition_mutableblockposition);
|
||||
+ net.minecraft.world.level.chunk.LevelChunk chunk = this.level().getChunkIfLoaded(blockposition_mutableblockposition);
|
||||
+ if (chunk == null) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ while (blockposition_mutableblockposition.getY() > this.level.getMinBuildHeight() && !chunk.getBlockState(blockposition_mutableblockposition).getMaterial().blocksMotion()) {
|
||||
+ while (blockposition_mutableblockposition.getY() > this.level().getMinBuildHeight() && !chunk.getBlockState(blockposition_mutableblockposition).blocksMotion()) {
|
||||
+ // Gale end - Airplane - single chunk lookup
|
||||
blockposition_mutableblockposition.move(Direction.DOWN);
|
||||
}
|
||||
|
||||
- BlockState iblockdata = this.level.getBlockState(blockposition_mutableblockposition);
|
||||
- BlockState iblockdata = this.level().getBlockState(blockposition_mutableblockposition);
|
||||
+ BlockState iblockdata = chunk.getBlockState(blockposition_mutableblockposition); // Gale - Airplane - single chunk lookup
|
||||
boolean flag = iblockdata.getMaterial().blocksMotion();
|
||||
boolean flag = iblockdata.blocksMotion();
|
||||
boolean flag1 = iblockdata.getFluidState().is(FluidTags.WATER);
|
||||
|
||||
|
||||
@@ -31,10 +31,10 @@ 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/src/main/java/net/minecraft/world/entity/player/Inventory.java b/src/main/java/net/minecraft/world/entity/player/Inventory.java
|
||||
index 27c028ab6b1edb6e413af3bbaa27bf30f2d85540..5e0e5a59fced422b931009f98550fd0f8729d9f4 100644
|
||||
index 395cecc385e4126a7534ac9aeb15cf323efab03e..cbcbb826733cf75bb018752af75a6a338947c472 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/Inventory.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/Inventory.java
|
||||
@@ -682,6 +682,8 @@ public class Inventory implements Container, Nameable {
|
||||
@@ -681,6 +681,8 @@ public class Inventory implements Container, Nameable {
|
||||
}
|
||||
|
||||
public boolean contains(ItemStack stack) {
|
||||
@@ -43,7 +43,7 @@ index 27c028ab6b1edb6e413af3bbaa27bf30f2d85540..5e0e5a59fced422b931009f98550fd0f
|
||||
Iterator iterator = this.compartments.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@@ -696,7 +698,18 @@ public class Inventory implements Container, Nameable {
|
||||
@@ -695,7 +697,18 @@ public class Inventory implements Container, Nameable {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -53,7 +53,7 @@ index 27c028ab6b1edb6e413af3bbaa27bf30f2d85540..5e0e5a59fced422b931009f98550fd0f
|
||||
+ for (int j = 0; j < list.size(); j++) {
|
||||
+ ItemStack itemstack1 = list.get(j);
|
||||
|
||||
+ if (!itemstack1.isEmpty() && itemstack1.sameItem(stack)) {
|
||||
+ if (!itemstack1.isEmpty() && ItemStack.isSameItem(itemstack1, stack)) {
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
@@ -186,10 +186,10 @@ index 0000000000000000000000000000000000000000..bf6a36c933b686f0e34591dff3d43b37
|
||||
+ }
|
||||
+}
|
||||
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 bf4de7b8fd630c596e096a411a8c84c64c13ebf7..363aed175ecc5cccd8f798503841948b72a98d5b 100644
|
||||
index 5502ad143fd2575f1346334b5b4fe7846628f54e..974cd5ff0836d89127be190b1335d945df1cb73c 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
|
||||
@@ -43,6 +43,8 @@ public abstract class FlowingFluid extends Fluid {
|
||||
@@ -44,6 +44,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;
|
||||
@@ -198,7 +198,7 @@ index bf4de7b8fd630c596e096a411a8c84c64c13ebf7..363aed175ecc5cccd8f798503841948b
|
||||
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) {}
|
||||
@@ -51,6 +53,14 @@ public abstract class FlowingFluid extends Fluid {
|
||||
@@ -52,6 +54,14 @@ public abstract class FlowingFluid extends Fluid {
|
||||
object2bytelinkedopenhashmap.defaultReturnValue((byte) 127);
|
||||
return object2bytelinkedopenhashmap;
|
||||
});
|
||||
@@ -213,7 +213,7 @@ index bf4de7b8fd630c596e096a411a8c84c64c13ebf7..363aed175ecc5cccd8f798503841948b
|
||||
private final Map<FluidState, VoxelShape> shapes = Maps.newIdentityHashMap();
|
||||
|
||||
public FlowingFluid() {}
|
||||
@@ -239,6 +249,8 @@ public abstract class FlowingFluid extends Fluid {
|
||||
@@ -240,6 +250,8 @@ public abstract class FlowingFluid extends Fluid {
|
||||
}
|
||||
|
||||
private boolean canPassThroughWall(Direction face, BlockGetter world, BlockPos pos, BlockState state, BlockPos fromPos, BlockState fromState) {
|
||||
@@ -222,7 +222,7 @@ index bf4de7b8fd630c596e096a411a8c84c64c13ebf7..363aed175ecc5cccd8f798503841948b
|
||||
Object2ByteLinkedOpenHashMap object2bytelinkedopenhashmap;
|
||||
|
||||
if (!state.getBlock().hasDynamicShape() && !fromState.getBlock().hasDynamicShape()) {
|
||||
@@ -246,9 +258,16 @@ public abstract class FlowingFluid extends Fluid {
|
||||
@@ -247,9 +259,16 @@ public abstract class FlowingFluid extends Fluid {
|
||||
} else {
|
||||
object2bytelinkedopenhashmap = null;
|
||||
}
|
||||
@@ -239,7 +239,7 @@ index bf4de7b8fd630c596e096a411a8c84c64c13ebf7..363aed175ecc5cccd8f798503841948b
|
||||
if (object2bytelinkedopenhashmap != null) {
|
||||
block_a = new Block.BlockStatePairKey(state, fromState, face);
|
||||
byte b0 = object2bytelinkedopenhashmap.getAndMoveToFirst(block_a);
|
||||
@@ -259,11 +278,22 @@ public abstract class FlowingFluid extends Fluid {
|
||||
@@ -260,11 +279,22 @@ public abstract class FlowingFluid extends Fluid {
|
||||
} else {
|
||||
block_a = null;
|
||||
}
|
||||
@@ -262,7 +262,7 @@ index bf4de7b8fd630c596e096a411a8c84c64c13ebf7..363aed175ecc5cccd8f798503841948b
|
||||
if (object2bytelinkedopenhashmap != null) {
|
||||
if (object2bytelinkedopenhashmap.size() == 200) {
|
||||
object2bytelinkedopenhashmap.removeLastByte();
|
||||
@@ -271,6 +301,11 @@ public abstract class FlowingFluid extends Fluid {
|
||||
@@ -272,6 +302,11 @@ public abstract class FlowingFluid extends Fluid {
|
||||
|
||||
object2bytelinkedopenhashmap.putAndMoveToFirst(block_a, (byte) (flag ? 1 : 0));
|
||||
}
|
||||
|
||||
@@ -31,10 +31,10 @@ 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/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 8d90c02c8f0b82e9c31889b35dcfbe2932406b1d..6411a059a67e1a09580ec8b11afbffe1ef4b8958 100644
|
||||
index 66b562e3f16050ebee50b8b440b48c4e3c7049d3..f86cb887d2cc3ae38c8d38675c3ac5ff2992242d 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -141,7 +141,6 @@ import org.bukkit.event.entity.EntityTeleportEvent;
|
||||
@@ -143,7 +143,6 @@ import org.bukkit.event.entity.EntityTeleportEvent;
|
||||
import org.bukkit.event.player.PlayerItemConsumeEvent;
|
||||
// CraftBukkit end
|
||||
|
||||
@@ -42,7 +42,7 @@ index 8d90c02c8f0b82e9c31889b35dcfbe2932406b1d..6411a059a67e1a09580ec8b11afbffe1
|
||||
|
||||
public abstract class LivingEntity extends Entity implements Attackable {
|
||||
|
||||
@@ -1927,6 +1926,20 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -1970,6 +1969,20 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
return this.lastClimbablePos;
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ index 8d90c02c8f0b82e9c31889b35dcfbe2932406b1d..6411a059a67e1a09580ec8b11afbffe1
|
||||
if (this.isSpectator()) {
|
||||
return false;
|
||||
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
index 52780192d6417f8085566e4cdf3a895a83638520..a04c202e83abc08a98549440e987d4d5f47379b7 100644
|
||||
index d4da9ec6e00bb92b70598ee9a0d0ca5816562378..713f62b7bfe290b1eb0eda6e3acc1d3583029aa6 100644
|
||||
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
||||
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
@@ -292,7 +292,7 @@ public class ActivationRange
|
||||
|
||||
@@ -265,7 +265,7 @@ index 04b1531572e8fff1e46fe1c94e7fc863841e0f66..0d22bce549c46d686ab3402a1cad8730
|
||||
int LARGE_MAX_STACK_SIZE = 64;
|
||||
int DEFAULT_DISTANCE_LIMIT = 8;
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
|
||||
index 08f027cdcaeeca7b545483cb8c5eb8d13e4933b9..ef02bd4948c8c6bcf1d3da1a7e1c94d6628cd505 100644
|
||||
index 272095d7a09ab41227d741172735f66fd2798ce1..77eee9c231ea075feb1ea0492d0be56554f78ec8 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
|
||||
@@ -27,7 +27,10 @@ import org.bukkit.inventory.InventoryHolder;
|
||||
@@ -390,7 +390,7 @@ index a71414397bd45ee7bcacfeef0041d80dfa25f114..7743f185672e977520218c3ce6b8ddc9
|
||||
|
||||
@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 aac5572c1d40a10cd1d17f89c9eb836718837577..1ad1716d27e58db05c1e22f7f2781319debde925 100644
|
||||
index 93c13cb36024370f6ec71137cebca254af2b3b61..9849e784f4fc92368779134f8e10fa2f290a086b 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
|
||||
@@ -47,7 +47,10 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||
@@ -498,10 +498,10 @@ index aac5572c1d40a10cd1d17f89c9eb836718837577..1ad1716d27e58db05c1e22f7f2781319
|
||||
|
||||
public static void entityInside(Level world, BlockPos pos, BlockState state, Entity entity, HopperBlockEntity blockEntity) {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
|
||||
index 79b01e32f89defb6b78f4764600d33d4945af592..a05f7c8815d564bf1b95b6ce35ca2ac71ec84c9f 100644
|
||||
index 081691f9710ff1115e4308f79ed49fbc38941193..6347459c1e7347914642c23fe919526db879d103 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
|
||||
@@ -97,12 +97,7 @@ public abstract class RandomizableContainerBlockEntity extends BaseContainerBloc
|
||||
@@ -96,12 +96,7 @@ public abstract class RandomizableContainerBlockEntity extends BaseContainerBloc
|
||||
public boolean isEmpty() {
|
||||
this.unpackLootTable((Player)null);
|
||||
// Paper start
|
||||
|
||||
@@ -31,22 +31,22 @@ 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/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
index b7fd8e70413c38923d0719aff803449e392383ac..48adbfbb8a55f6719c92a1fe83c64d87f1b236d5 100644
|
||||
index 6670e657e08e130f7e0368f418379fd1ece00cdf..1717844256fe6479e3d7125db3937354578d17d0 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
@@ -185,6 +185,7 @@ public class ServerEntity {
|
||||
@@ -181,6 +181,7 @@ public class ServerEntity {
|
||||
boolean flag6 = k < -32768L || k > 32767L || l < -32768L || l > 32767L || i1 < -32768L || i1 > 32767L;
|
||||
|
||||
if (!flag6 && this.teleportDelay <= 400 && !this.wasRiding && this.wasOnGround == this.entity.isOnGround() && !(io.papermc.paper.configuration.GlobalConfiguration.get().collisions.sendFullPosForHardCollidingEntities && this.entity.hardCollides())) { // Paper - send full pos for hard colliding entities to prevent collision problems due to desync
|
||||
if (!flag6 && this.teleportDelay <= 400 && !this.wasRiding && this.wasOnGround == this.entity.onGround()&& !(io.papermc.paper.configuration.GlobalConfiguration.get().collisions.sendFullPosForHardCollidingEntities && this.entity.hardCollides())) { // Paper - send full pos for hard colliding entities to prevent collision problems due to desync
|
||||
+ if (flag2 || flag3 || this.entity instanceof AbstractArrow) { // Gale - Airplane - better checking for useless move packets
|
||||
if ((!flag2 || !flag3) && !(this.entity instanceof AbstractArrow)) {
|
||||
if (flag2) {
|
||||
packet1 = new ClientboundMoveEntityPacket.Pos(this.entity.getId(), (short) ((int) k), (short) ((int) l), (short) ((int) i1), this.entity.isOnGround());
|
||||
@@ -198,6 +199,7 @@ public class ServerEntity {
|
||||
packet1 = new ClientboundMoveEntityPacket.Pos(this.entity.getId(), (short) ((int) k), (short) ((int) l), (short) ((int) i1), this.entity.onGround());
|
||||
@@ -194,6 +195,7 @@ public class ServerEntity {
|
||||
flag4 = true;
|
||||
flag5 = true;
|
||||
}
|
||||
+ } // Gale - Airplane - better checking for useless move packets
|
||||
} else {
|
||||
this.wasOnGround = this.entity.isOnGround();
|
||||
this.wasOnGround = this.entity.onGround();
|
||||
this.teleportDelay = 0;
|
||||
|
||||
@@ -31,21 +31,21 @@ 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/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
index d47b3ac633e7936d30abfda6fc46c2c7412d76fe..036d7d29d7c85390b9658ddd70f17447648c265a 100644
|
||||
index 3d41dbe0285f8fec8adae1e93010cf464df9b08c..cf2b2c279718d86cc2c57795ef2e61c835977564 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
@@ -264,10 +264,16 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||
@@ -269,10 +269,16 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||
if (entityitem.isMergable()) {
|
||||
// Paper Start - Fix items merging through walls
|
||||
if (this.level.paperConfig().fixes.fixItemsMergingThroughWalls) {
|
||||
if (this.level().paperConfig().fixes.fixItemsMergingThroughWalls) {
|
||||
+ // Gale start - Airplane - use fast item merge raytracing - skip the allocations
|
||||
+ /*
|
||||
net.minecraft.world.level.ClipContext rayTrace = new net.minecraft.world.level.ClipContext(this.position(), entityitem.position(),
|
||||
net.minecraft.world.level.ClipContext.Block.COLLIDER, net.minecraft.world.level.ClipContext.Fluid.NONE, this);
|
||||
net.minecraft.world.phys.BlockHitResult rayTraceResult = level.clip(rayTrace);
|
||||
net.minecraft.world.phys.BlockHitResult rayTraceResult = this.level().clip(rayTrace);
|
||||
if (rayTraceResult.getType() == net.minecraft.world.phys.HitResult.Type.BLOCK) continue;
|
||||
+ */
|
||||
+ if (level.rayTraceDirect(this.position(), entityitem.position(), net.minecraft.world.phys.shapes.CollisionContext.of(this)) ==
|
||||
+ if (level().rayTraceDirect(this.position(), entityitem.position(), net.minecraft.world.phys.shapes.CollisionContext.of(this)) ==
|
||||
+ net.minecraft.world.phys.HitResult.Type.BLOCK) continue;
|
||||
+ // Gale end - Airplane - use fast item merge raytracing - skip the allocations
|
||||
}
|
||||
|
||||
@@ -31,10 +31,10 @@ 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/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 67de286dd6a569da9f8b36a4c7bd673830c17a2b..901bd7f723b2c57ee5bbff0735fd6b47947f4383 100644
|
||||
index 5185af09005fd9f671daca0844b42e85b29a0376..dd5d28339d28f344c2e68b43782545e6378117ca 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -272,6 +272,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -271,6 +271,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
|
||||
public abstract ResourceKey<LevelStem> getTypeKey();
|
||||
|
||||
@@ -50,7 +50,7 @@ index 67de286dd6a569da9f8b36a4c7bd673830c17a2b..901bd7f723b2c57ee5bbff0735fd6b47
|
||||
protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.function.Function<org.spigotmc.SpigotWorldConfig, GaleWorldConfiguration> galeWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor // Gale - Gale configuration // Gale - Purpur - remove vanilla profiler
|
||||
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
|
||||
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper
|
||||
@@ -294,6 +303,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -293,6 +302,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
});
|
||||
final DimensionType dimensionmanager = (DimensionType) holder.value();
|
||||
|
||||
|
||||
@@ -31,10 +31,10 @@ 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/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index d7a8b1ee9c3efda2c8463d6e06e54eb59b1b4dc4..014ca25e17915d2a3a8e2a8d37265a4d7bc09d24 100644
|
||||
index 31963a0931bcd3465e46b9c875e89ac56aead62d..caa765c6264e14cc66973267f94074c7056fe122 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -1630,8 +1630,30 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1549,8 +1549,30 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
return ChunkMap.this.level.getServer().getScaledTrackingDistance(initialDistance);
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ index d7a8b1ee9c3efda2c8463d6e06e54eb59b1b4dc4..014ca25e17915d2a3a8e2a8d37265a4d
|
||||
Iterator iterator = this.entity.getIndirectPassengers().iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@@ -1643,6 +1665,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1562,6 +1584,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
i = j;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,10 +31,10 @@ 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/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 158fecd37dedec27a930e427550a92c4db01fc8c..cd6396ccbfab14a456952462af580c75c4b73744 100644
|
||||
index cc6bcffcc124f75bdaf4e72601d1557a173b7825..ba832679bd88779eeea9ba17ff4b1bb164496d56 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -491,17 +491,37 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -495,17 +495,37 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
this.isLegacyTrackingEntity = isLegacyTrackingEntity;
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ index 158fecd37dedec27a930e427550a92c4db01fc8c..cd6396ccbfab14a456952462af580c75
|
||||
for (Entity passenger : passengers) {
|
||||
org.spigotmc.TrackingRange.TrackingRangeType passengerType = passenger.trackingRangeType;
|
||||
int passengerRange = chunkMap.getEntityTrackerRange(passengerType.ordinal());
|
||||
@@ -510,6 +530,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -514,6 +534,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
range = passengerRange;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,14 +31,14 @@ 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/src/main/java/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java
|
||||
index 26bf383caea68834c654b25653ced9017f1b1b22..6c67eef93e764ab7d339859d87d2e438b3b137fa 100644
|
||||
index 34f319ad09276c6f68dde449c79351de0d7d86f5..faa95db38528b24f2274e92f71e3001a640a428b 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 {
|
||||
for(int m = 0; m <= l; m = m > 0 ? -m : 1 - m) {
|
||||
for(int n = m < l && m > -l ? l : 0; n <= l; n = n > 0 ? -n : 1 - n) {
|
||||
mutableBlockPos.setWithOffset(blockPos, m, k - 1, n);
|
||||
+ if (!this.mob.level.hasChunkAt(mutableBlockPos)) continue; // Gale - Airplane - block goal does not load chunks - if this block isn't loaded, continue
|
||||
if (this.mob.isWithinRestriction(mutableBlockPos) && this.isValidTarget(this.mob.level, mutableBlockPos)) {
|
||||
+ if (!this.mob.level().hasChunkAt(mutableBlockPos)) continue; // Gale - Airplane - block goal does not load chunks - if this block isn't loaded, continue
|
||||
if (this.mob.isWithinRestriction(mutableBlockPos) && this.isValidTarget(this.mob.level(), mutableBlockPos)) {
|
||||
this.blockPos = mutableBlockPos;
|
||||
setTargetPosition(mutableBlockPos.immutable()); // Paper
|
||||
@@ -1,56 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
||||
Date: Wed, 23 Nov 2022 23:01:31 +0100
|
||||
Subject: [PATCH] Skip cloning loot parameters
|
||||
|
||||
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
Gale - https://galemc.org
|
||||
|
||||
This patch is based on the following patch:
|
||||
"Skip cloning loot parameters"
|
||||
By: Paul Sauve <paul@technove.co>
|
||||
As part of: Airplane (https://github.com/TECHNOVE/Airplane)
|
||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
|
||||
* Airplane description *
|
||||
|
||||
Small improvement in CPU, much larger improvement in allocations. As a
|
||||
new loot context is created every time a player moves (along with a lot
|
||||
of other times) the constant cloning churns out a lot of useless
|
||||
objects.
|
||||
|
||||
* Airplane copyright *
|
||||
|
||||
Airplane
|
||||
Copyright (C) 2020 Technove 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/src/main/java/net/minecraft/world/level/storage/loot/LootContext.java b/src/main/java/net/minecraft/world/level/storage/loot/LootContext.java
|
||||
index 35f9b11a3a61976c952a2c1c64bb2a932538f54f..eb399244af70c8fe735657d429d883c48215af0a 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/storage/loot/LootContext.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/storage/loot/LootContext.java
|
||||
@@ -41,8 +41,10 @@ public class LootContext {
|
||||
this.level = world;
|
||||
this.lootTables = tableGetter;
|
||||
this.conditions = conditionGetter;
|
||||
- this.params = ImmutableMap.copyOf(parameters);
|
||||
- this.dynamicDrops = ImmutableMap.copyOf(drops);
|
||||
+ // Gale start - Airplane - skip cloning loot parameters - use unmodifiable maps instead of immutable ones to skip the copy
|
||||
+ this.params = java.util.Collections.unmodifiableMap(parameters);
|
||||
+ this.dynamicDrops = java.util.Collections.unmodifiableMap(drops);
|
||||
+ // Gale end - Airplane - skip cloning loot parameters - use unmodifiable maps instead of immutable ones to skip the copy
|
||||
}
|
||||
|
||||
public boolean hasParam(LootContextParam<?> parameter) {
|
||||
@@ -31,10 +31,10 @@ 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/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index cd6396ccbfab14a456952462af580c75c4b73744..f27df41a95926da2c38d2a5224d7597d17b620b0 100644
|
||||
index ba832679bd88779eeea9ba17ff4b1bb164496d56..6bc97a0ffbe9581d72f033fe315e1e2a03099e5b 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -417,6 +417,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -421,6 +421,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
return this.originWorld;
|
||||
}
|
||||
// Paper end
|
||||
@@ -31,10 +31,10 @@ 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/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index cb0df7b5db3fa885f43b35e6ef8c6cdc221b4003..ef0b765c04bfdb684d8a3aef7aa4184fafb38864 100644
|
||||
index b7318670e039e05a058e437e025519d40557bb88..efbc8483a51c5272ca81747c82dc65e7f0f5c232 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -709,7 +709,20 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -850,7 +850,20 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
entity.stopRiding();
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ index cb0df7b5db3fa885f43b35e6ef8c6cdc221b4003..ef0b765c04bfdb684d8a3aef7aa4184f
|
||||
+ } catch (Throwable throwable) {
|
||||
+ if (throwable instanceof ThreadDeath) throw throwable; // Paper
|
||||
+ // Paper start - Prevent tile entity and entity crashes
|
||||
+ final String msg = String.format("Entity threw exception at %s:%s,%s,%s", entity.level.getWorld().getName(), entity.getX(), entity.getY(), entity.getZ());
|
||||
+ final String msg = String.format("Entity threw exception at %s:%s,%s,%s", entity.level().getWorld().getName(), entity.getX(), entity.getY(), entity.getZ());
|
||||
+ MinecraftServer.LOGGER.error(msg, throwable);
|
||||
+ getCraftServer().getPluginManager().callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerInternalException(msg, throwable)));
|
||||
+ entity.discard();
|
||||
@@ -57,10 +57,10 @@ index cb0df7b5db3fa885f43b35e6ef8c6cdc221b4003..ef0b765c04bfdb684d8a3aef7aa4184f
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 901bd7f723b2c57ee5bbff0735fd6b47947f4383..d4527b0f11893925c93b1846305fb3b17ba8e89a 100644
|
||||
index dd5d28339d28f344c2e68b43782545e6378117ca..b9431be4e6fb366bbdb7e66c9570f26a37379488 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -1018,13 +1018,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -1013,13 +1013,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
try {
|
||||
tickConsumer.accept(entity);
|
||||
MinecraftServer.getServer().executeMidTickTasks(); // Paper - execute chunk tasks mid tick
|
||||
@@ -68,7 +68,7 @@ index 901bd7f723b2c57ee5bbff0735fd6b47947f4383..d4527b0f11893925c93b1846305fb3b1
|
||||
+ } catch (Throwable throwable) { // Gale - Airplane - remove lambda from ticking guard - diff on change ServerLevel#tick
|
||||
if (throwable instanceof ThreadDeath) throw throwable; // Paper
|
||||
// Paper start - Prevent tile entity and entity crashes
|
||||
final String msg = String.format("Entity threw exception at %s:%s,%s,%s", entity.level.getWorld().getName(), entity.getX(), entity.getY(), entity.getZ());
|
||||
final String msg = String.format("Entity threw exception at %s:%s,%s,%s", entity.level().getWorld().getName(), entity.getX(), entity.getY(), entity.getZ());
|
||||
MinecraftServer.LOGGER.error(msg, throwable);
|
||||
getCraftServer().getPluginManager().callEvent(new ServerExceptionEvent(new ServerInternalException(msg, throwable)));
|
||||
- entity.discard();
|
||||
@@ -31,10 +31,10 @@ 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/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index f27df41a95926da2c38d2a5224d7597d17b620b0..a105db86db91d932d7d27fc6a96a5ef3c60671e5 100644
|
||||
index 6bc97a0ffbe9581d72f033fe315e1e2a03099e5b..eefbbd4621454b95ef0601be526e71c3d759446a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -4171,16 +4171,18 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -4300,16 +4300,18 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
}
|
||||
|
||||
public boolean updateFluidHeightAndDoFluidPushing(TagKey<Fluid> tag, double speed) {
|
||||
@@ -60,7 +60,7 @@ index f27df41a95926da2c38d2a5224d7597d17b620b0..a105db86db91d932d7d27fc6a96a5ef3
|
||||
double d1 = 0.0D;
|
||||
boolean flag = this.isPushedByFluid();
|
||||
boolean flag1 = false;
|
||||
@@ -4188,14 +4190,61 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -4317,14 +4319,61 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
int k1 = 0;
|
||||
BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos();
|
||||
|
||||
@@ -68,10 +68,10 @@ index f27df41a95926da2c38d2a5224d7597d17b620b0..a105db86db91d932d7d27fc6a96a5ef3
|
||||
- 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);
|
||||
- FluidState fluid = this.level().getFluidState(blockposition_mutableblockposition);
|
||||
+ // Gale start - Airplane - reduce entity fluid lookups if no fluids - 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 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;
|
||||
+
|
||||
@@ -98,7 +98,7 @@ index f27df41a95926da2c38d2a5224d7597d17b620b0..a105db86db91d932d7d27fc6a96a5ef3
|
||||
+ int minX = currChunkX == minChunkX ? minBlockX & 15 : 0; // coordinate in chunk
|
||||
+ int maxX = currChunkX == maxChunkX ? maxBlockX & 15 : 16; // coordinate in chunk
|
||||
+
|
||||
+ net.minecraft.world.level.chunk.ChunkAccess chunk = this.level.getChunkIfLoadedImmediately(currChunkX, currChunkZ);
|
||||
+ net.minecraft.world.level.chunk.ChunkAccess chunk = this.level().getChunkIfLoadedImmediately(currChunkX, currChunkZ);
|
||||
+ if (chunk == null) {
|
||||
+ return false; // if we're touching an unloaded chunk then it's false
|
||||
+ }
|
||||
@@ -122,13 +122,13 @@ index f27df41a95926da2c38d2a5224d7597d17b620b0..a105db86db91d932d7d27fc6a96a5ef3
|
||||
+ FluidState fluid = blocks.get(currX & 15, currY & 15, currZ & 15).getFluidState();
|
||||
|
||||
if (fluid.is(tag)) {
|
||||
- double d2 = (double) ((float) i2 + fluid.getHeight(this.level, blockposition_mutableblockposition));
|
||||
- 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));
|
||||
+ double d2 = (double) ((float) currY + fluid.getHeight(this.level(), blockposition_mutableblockposition));
|
||||
|
||||
if (d2 >= axisalignedbb.minY) {
|
||||
flag1 = true;
|
||||
@@ -4217,9 +4266,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -4346,9 +4395,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
// CraftBukkit end
|
||||
}
|
||||
}
|
||||
@@ -142,18 +142,18 @@ index f27df41a95926da2c38d2a5224d7597d17b620b0..a105db86db91d932d7d27fc6a96a5ef3
|
||||
if (vec3d.length() > 0.0D) {
|
||||
if (k1 > 0) {
|
||||
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 854865f28bcae0fb0c17717c914687f78e951e21..0b4afcbe5a8c25418c28ce95961dd9e337c6973a 100644
|
||||
index d4477b0dda6a1ef7bd8323c0d11b636bd071d18e..e04749d26cc09aa3e1319a1f792085ad96f51b8c 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
|
||||
@@ -27,6 +27,7 @@ public class LevelChunkSection {
|
||||
@@ -25,6 +25,7 @@ public class LevelChunkSection {
|
||||
public final PalettedContainer<BlockState> states;
|
||||
// CraftBukkit start - read/write
|
||||
private PalettedContainer<Holder<Biome>> biomes;
|
||||
+ public short fluidStateCount; // Gale - Airplane - reduce entity fluid lookups if no fluids
|
||||
public final com.destroystokyo.paper.util.maplist.IBlockDataList tickingList = new com.destroystokyo.paper.util.maplist.IBlockDataList(); // Paper
|
||||
|
||||
public LevelChunkSection(int i, PalettedContainer<BlockState> datapaletteblock, PalettedContainer<Holder<Biome>> palettedcontainerro) {
|
||||
@@ -198,6 +199,7 @@ public class LevelChunkSection {
|
||||
public LevelChunkSection(PalettedContainer<BlockState> datapaletteblock, PalettedContainer<Holder<Biome>> palettedcontainerro) {
|
||||
@@ -190,6 +191,7 @@ public class LevelChunkSection {
|
||||
|
||||
if (!fluid.isEmpty()) {
|
||||
--this.tickingFluidCount;
|
||||
@@ -161,7 +161,7 @@ index 854865f28bcae0fb0c17717c914687f78e951e21..0b4afcbe5a8c25418c28ce95961dd9e3
|
||||
}
|
||||
|
||||
if (!state.isAir()) {
|
||||
@@ -212,6 +214,7 @@ public class LevelChunkSection {
|
||||
@@ -204,6 +206,7 @@ public class LevelChunkSection {
|
||||
|
||||
if (!fluid1.isEmpty()) {
|
||||
++this.tickingFluidCount;
|
||||
@@ -169,7 +169,7 @@ index 854865f28bcae0fb0c17717c914687f78e951e21..0b4afcbe5a8c25418c28ce95961dd9e3
|
||||
}
|
||||
|
||||
this.updateKnownBlockInfo(x | (z << 4) | (y << 8), iblockdata1, state); // Paper
|
||||
@@ -261,6 +264,7 @@ public class LevelChunkSection {
|
||||
@@ -249,6 +252,7 @@ public class LevelChunkSection {
|
||||
if (fluid.isRandomlyTicking()) {
|
||||
this.tickingFluidCount = (short) (this.tickingFluidCount + 1);
|
||||
}
|
||||
@@ -13,7 +13,7 @@ As part of: Pufferfish (https://github.com/pufferfish-gg/Pufferfish)
|
||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 7d3b8f3c7616b5db72a6fccb51e5543a0e096125..394b5044090c1c7b00b30036e4b8be4a6ac58ed1 100644
|
||||
index 774e79681c910dc036238b4a913fa6ecaf09a94f..3097e021e89bf04e9cf18dae1f9be8a089d29743 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -63,6 +63,7 @@ tasks.withType<JavaCompile> {
|
||||
@@ -24,7 +24,7 @@ index 7d3b8f3c7616b5db72a6fccb51e5543a0e096125..394b5044090c1c7b00b30036e4b8be4a
|
||||
}
|
||||
// Gale end - hide irrelevant compilation warnings
|
||||
|
||||
@@ -186,6 +187,7 @@ fun TaskContainer.registerRunTask(
|
||||
@@ -187,6 +188,7 @@ fun TaskContainer.registerRunTask(
|
||||
jvmArgs("--enable-preview")
|
||||
jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
|
||||
// Gale end - enable virtual threads for development runs
|
||||
@@ -33,7 +33,7 @@ index 7d3b8f3c7616b5db72a6fccb51e5543a0e096125..394b5044090c1c7b00b30036e4b8be4a
|
||||
doFirst {
|
||||
workingDir.mkdirs()
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 985f1a50438b325e33fba5d07e26519171504aab..54458601bbda3a4142c09f717e3b87a079ce096f 100644
|
||||
index 5be4267d88604210b7bfcc03b2c2056e0a9f0fb0..e981740075e287ede989e805314a1356b566a2c4 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -14,6 +14,8 @@ import java.util.Locale;
|
||||
@@ -22,7 +22,7 @@ you to easily disable books, should you want to preemptively remove this
|
||||
functionality before additional exploits are found.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 4b74da1c0138ed5946c7f446be79c647c172faa5..10bdc027ad7070e2ee0e5b1b24783c3e880996dd 100644
|
||||
index 3d33236932c14d651d393656b06ae8152cc89eee..bb68e65813f2f471add275023f53430c05170813 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -184,6 +184,8 @@ import net.minecraft.world.phys.Vec3;
|
||||
@@ -34,7 +34,7 @@ index 4b74da1c0138ed5946c7f446be79c647c172faa5..10bdc027ad7070e2ee0e5b1b24783c3e
|
||||
import org.slf4j.Logger;
|
||||
|
||||
// CraftBukkit start
|
||||
@@ -1214,6 +1216,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -1217,6 +1219,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
|
||||
@Override
|
||||
public void handleEditBook(ServerboundEditBookPacket packet) {
|
||||
@@ -22,7 +22,7 @@ data is already available in the blockPosition struct, so we use that
|
||||
instead of re-doing the casting.
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/util/MCUtil.java b/src/main/java/io/papermc/paper/util/MCUtil.java
|
||||
index 6efb8b10f17c70b05128039376d254e6beda3841..fe8d2fa5fdb116762b644b08020fee23e517e57c 100644
|
||||
index 2d11a67bdc82088abf0b3ca134f352f155c8eb1f..a31d7c1907f40792eefe35038bc6ec7cb67b2f6a 100644
|
||||
--- a/src/main/java/io/papermc/paper/util/MCUtil.java
|
||||
+++ b/src/main/java/io/papermc/paper/util/MCUtil.java
|
||||
@@ -210,7 +210,7 @@ public final class MCUtil {
|
||||
@@ -35,10 +35,10 @@ index 6efb8b10f17c70b05128039376d254e6beda3841..fe8d2fa5fdb116762b644b08020fee23
|
||||
|
||||
public static long getCoordinateKey(final ChunkPos pair) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index a105db86db91d932d7d27fc6a96a5ef3c60671e5..254feb89dc2bdb7c994fb65b1a345f879ec8ff72 100644
|
||||
index eefbbd4621454b95ef0601be526e71c3d759446a..eb395d6498f3f43c20d371efd8e1f410400f1f2a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -292,7 +292,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -294,7 +294,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
public double yo;
|
||||
public double zo;
|
||||
private Vec3 position;
|
||||
@@ -28,22 +28,22 @@ but is so much cheaper than the suffocation check that it's worth
|
||||
keeping it.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 6411a059a67e1a09580ec8b11afbffe1ef4b8958..848022c049e27d80ceb11f0cee6cbda15edf2ff3 100644
|
||||
index 806bf3e93ec368d117851281fd5d51fa22e3a4bf..1040e76c829521b214e5a96fb41ee60e223641d3 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -395,7 +395,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -413,7 +413,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
boolean flag = this instanceof net.minecraft.world.entity.player.Player;
|
||||
|
||||
if (!this.level.isClientSide) {
|
||||
if (!this.level().isClientSide) {
|
||||
- if (this.isInWall()) {
|
||||
+ // Gale start - Pufferfish - reduce in wall checks
|
||||
+ long checkStuckInWallInterval = this.level.galeConfig().smallOptimizations.reducedIntervals.checkStuckInWall;
|
||||
+ long checkStuckInWallInterval = this.level().galeConfig().smallOptimizations.reducedIntervals.checkStuckInWall;
|
||||
+ if ((checkStuckInWallInterval <= 1 || (tickCount % checkStuckInWallInterval == 0 && couldPossiblyBeHurt(1.0F))) && this.isInWall()) {
|
||||
+ // Gale end - Pufferfish - reduce in wall checks
|
||||
this.hurt(this.damageSources().inWall(), 1.0F);
|
||||
} else if (flag && !this.level.getWorldBorder().isWithinBounds(this.getBoundingBox())) {
|
||||
double d0 = this.level.getWorldBorder().getDistanceToBorder(this) + this.level.getWorldBorder().getDamageSafeZone();
|
||||
@@ -1318,6 +1321,15 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
} else if (flag && !this.level().getWorldBorder().isWithinBounds(this.getBoundingBox())) {
|
||||
double d0 = this.level().getWorldBorder().getDistanceToBorder(this) + this.level().getWorldBorder().getDamageSafeZone();
|
||||
@@ -1367,6 +1370,15 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
return this.getHealth() <= 0.0F;
|
||||
}
|
||||
|
||||
@@ -13,10 +13,10 @@ As part of: Pufferfish (https://github.com/pufferfish-gg/Pufferfish)
|
||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 10bdc027ad7070e2ee0e5b1b24783c3e880996dd..434a671878fedb3dea7423a929def187a9ef4f9c 100644
|
||||
index bb68e65813f2f471add275023f53430c05170813..9b028f8a5d0bcda9ea1bc28b65587627e31e78b1 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -2368,6 +2368,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -2366,6 +2366,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
}
|
||||
|
||||
private boolean updateChatOrder(Instant timestamp) {
|
||||
@@ -20,7 +20,7 @@ launcher can very easily fill a chunk.
|
||||
Prevent saving Fireworks so that chunk unloads will wipe a chunks fireworks in this case.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java b/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
|
||||
index fca27f98989bf106060ba08196255fe32f850df5..2260bc728ce6cdbc78408aec37ac3ffe26db3d76 100644
|
||||
index 288910fb168ddc5d3a61971778b8038a56772fa8..a9354adc79b71a206ef7d76f0c59b26478160fb6 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
|
||||
@@ -357,4 +357,12 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier {
|
||||
@@ -31,7 +31,7 @@ index fca27f98989bf106060ba08196255fe32f850df5..2260bc728ce6cdbc78408aec37ac3ffe
|
||||
+ // Gale start - EMC - make saving fireworks configurable
|
||||
+ @Override
|
||||
+ public boolean shouldBeSaved() {
|
||||
+ return this.level.galeConfig().smallOptimizations.saveFireworks;
|
||||
+ return this.level().galeConfig().smallOptimizations.saveFireworks;
|
||||
+ }
|
||||
+ // Gale end - EMC - make saving fireworks configurable
|
||||
+
|
||||
@@ -13,7 +13,7 @@ As part of: EmpireCraft (https://github.com/starlis/empirecraft)
|
||||
Licensed under: MIT (https://opensource.org/licenses/MIT)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
|
||||
index a05f7c8815d564bf1b95b6ce35ca2ac71ec84c9f..6e75f5696a6bc56a26578dba518920ac9b069427 100644
|
||||
index 6347459c1e7347914642c23fe919526db879d103..d652873922fa89a40f7520f5aff53847637c9771 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
|
||||
@@ -70,6 +70,7 @@ public abstract class RandomizableContainerBlockEntity extends BaseContainerBloc
|
||||
@@ -22,5 +22,5 @@ index a05f7c8815d564bf1b95b6ce35ca2ac71ec84c9f..6e75f5696a6bc56a26578dba518920ac
|
||||
public void unpackLootTable(@Nullable Player player) {
|
||||
+ if (player == null) return; // Gale - EMC - don't trigger lootable refresh for non-player interaction
|
||||
if (this.lootableData.shouldReplenish(player) && this.level.getServer() != null) { // Paper
|
||||
LootTable lootTable = this.level.getServer().getLootTables().get(this.lootTable);
|
||||
LootTable lootTable = this.level.getServer().getLootData().getLootTable(this.lootTable);
|
||||
if (player instanceof ServerPlayer) {
|
||||
@@ -17,7 +17,7 @@ Licensed under: MIT (https://opensource.org/licenses/MIT)
|
||||
Only do an item "suck in" action once per second
|
||||
|
||||
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 036d7d29d7c85390b9658ddd70f17447648c265a..b77d112f74046cd35f17bada00a22402cb716482 100644
|
||||
index cf2b2c279718d86cc2c57795ef2e61c835977564..fb0cd2ad93d2dbd678662f2cdad0851fd698cf3d 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
@@ -15,11 +15,13 @@ import net.minecraft.world.entity.EntityType;
|
||||
@@ -47,14 +47,14 @@ index 036d7d29d7c85390b9658ddd70f17447648c265a..b77d112f74046cd35f17bada00a22402
|
||||
|
||||
+ // Gale start - EMC - reduce hopper item checks
|
||||
+ private void markNearbyHopperCartsAsImmune() {
|
||||
+ var config = level.galeConfig().smallOptimizations.reducedIntervals.checkNearbyItem.hopper.minecart;
|
||||
+ var config = level().galeConfig().smallOptimizations.reducedIntervals.checkNearbyItem.hopper.minecart;
|
||||
+ // No need to mark hopper minecarts as immune if they can pull every tick anyway
|
||||
+ if (config.interval <= 1) {
|
||||
+ return;
|
||||
+ }
|
||||
+ if (config.temporaryImmunity.duration > 0 && this.isAlive() && this.onGround && !this.isRemoved() && (config.temporaryImmunity.nearbyItemMaxAge == -1 || this.age <= config.temporaryImmunity.nearbyItemMaxAge) && this.age % Math.max(1, config.temporaryImmunity.checkForMinecartNearItemInterval) == 0 && config.temporaryImmunity.maxItemHorizontalDistance >= 0 && config.temporaryImmunity.maxItemVerticalDistance >= 0) {
|
||||
+ AABB aabb = this.getBoundingBox().inflate(config.temporaryImmunity.maxItemHorizontalDistance, config.temporaryImmunity.maxItemVerticalDistance, config.temporaryImmunity.maxItemHorizontalDistance);
|
||||
+ for (Entity entity : this.level.getEntities(this, aabb)) {
|
||||
+ for (Entity entity : this.level().getEntities(this, aabb)) {
|
||||
+ if (entity instanceof MinecartHopper) {
|
||||
+ ((MinecartHopper) entity).pickupImmunity = MinecraftServer.currentTick + config.temporaryImmunity.duration;
|
||||
+ }
|
||||
@@ -73,7 +73,7 @@ index 036d7d29d7c85390b9658ddd70f17447648c265a..b77d112f74046cd35f17bada00a22402
|
||||
+ return; // Gale - EMC - reduce hopper item checks
|
||||
+ }
|
||||
+ // Gale start - EMC - reduce hopper item checks
|
||||
+ if (level.galeConfig().smallOptimizations.reducedIntervals.checkNearbyItem.hopper.minecart.temporaryImmunity.checkForMinecartNearItemWhileInactive) {
|
||||
+ if (level().galeConfig().smallOptimizations.reducedIntervals.checkNearbyItem.hopper.minecart.temporaryImmunity.checkForMinecartNearItemWhileInactive) {
|
||||
+ this.markNearbyHopperCartsAsImmune();
|
||||
}
|
||||
+ // Gale end - EMC - reduce hopper item checks
|
||||
@@ -81,7 +81,7 @@ index 036d7d29d7c85390b9658ddd70f17447648c265a..b77d112f74046cd35f17bada00a22402
|
||||
// Spigot end
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/MinecartHopper.java b/src/main/java/net/minecraft/world/entity/vehicle/MinecartHopper.java
|
||||
index 1b8f22805af87dc08e0dea9fd93a5f93c0b05107..36c2da765ef520d0cbe239892b8234b81b1b8012 100644
|
||||
index fc35cfc9d045f3e5b6a50af1d0ba83b6e322091f..41e23b4e0df3f3561925dad87624f4e445831a52 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/vehicle/MinecartHopper.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/vehicle/MinecartHopper.java
|
||||
@@ -17,6 +17,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
||||
@@ -119,7 +119,7 @@ index a05acf709735b40ca86f978508c63a86065fd405..3752b4ba7fb0d680d4b4a61bf44d54d5
|
||||
|
||||
double getLevelY();
|
||||
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 1ad1716d27e58db05c1e22f7f2781319debde925..44732d98902797e3ed924bf77198657ce3a1ec30 100644
|
||||
index 1eb9326a0defaf412d94eac2e3b3e1fd855ba24c..f28e264c5975e94d284bdbd9646f3154a0e223ab 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
|
||||
@@ -11,6 +11,7 @@ import net.minecraft.core.Direction;
|
||||
@@ -156,7 +156,7 @@ index 1ad1716d27e58db05c1e22f7f2781319debde925..44732d98902797e3ed924bf77198657c
|
||||
|
||||
@io.papermc.paper.annotation.DoNotUse // Paper - method unused as logic is inlined above
|
||||
@@ -805,6 +808,31 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||
return first.is(second.getItem()) && first.getDamageValue() == second.getDamageValue() && first.getCount() < first.getMaxStackSize() && ItemStack.tagMatches(first, second); // Paper - used to return true for full itemstacks?!
|
||||
return first.getCount() < first.getMaxStackSize() && first.is(second.getItem()) && first.getDamageValue() == second.getDamageValue() && ((first.isEmpty() && second.isEmpty()) || java.util.Objects.equals(first.getTag(), second.getTag())); // Paper - used to return true for full itemstacks?!
|
||||
}
|
||||
|
||||
+ // Gale start - EMC - reduce hopper item checks
|
||||
@@ -18,7 +18,7 @@ Helps 1.8 Farms let hoppers pick it up before Villager
|
||||
due to our hopper changes
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java b/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java
|
||||
index d81f7eecb8204a974da14a75d1a7a23a6c071112..3bff137413f12df37f1b77d68991e653c6267861 100644
|
||||
index 92bd58010e8c89e361e28aec59447349edbbc028..2239c7260638bb25df5b45dbc129bcfe1530bc59 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java
|
||||
@@ -21,6 +21,7 @@ import net.minecraft.world.entity.ai.memory.NearestVisibleLivingEntities;
|
||||
@@ -36,7 +36,7 @@ index d81f7eecb8204a974da14a75d1a7a23a6c071112..3bff137413f12df37f1b77d68991e653
|
||||
- entityitem.setDefaultPickUpDelay();
|
||||
+ // Gale start - EMC - reduce villager item re-pickup
|
||||
+ if (entity instanceof Villager) {
|
||||
+ int repickupDelay = entity.level.galeConfig().smallOptimizations.reducedIntervals.villagerItemRepickup;
|
||||
+ int repickupDelay = entity.level().galeConfig().smallOptimizations.reducedIntervals.villagerItemRepickup;
|
||||
+ if (repickupDelay <= -1) {
|
||||
+ entityitem.setDefaultPickUpDelay();
|
||||
+ } else {
|
||||
@@ -46,7 +46,7 @@ index d81f7eecb8204a974da14a75d1a7a23a6c071112..3bff137413f12df37f1b77d68991e653
|
||||
+ // Gale end - EMC - reduce villager item re-pickup
|
||||
// CraftBukkit start
|
||||
org.bukkit.event.entity.EntityDropItemEvent event = new org.bukkit.event.entity.EntityDropItemEvent(entity.getBukkitEntity(), (org.bukkit.entity.Item) entityitem.getBukkitEntity());
|
||||
entityitem.level.getCraftServer().getPluginManager().callEvent(event);
|
||||
entityitem.level().getCraftServer().getPluginManager().callEvent(event);
|
||||
diff --git a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
||||
index 0f2f14b0612f764a2780bc244c89db548997b2c1..be563b466b9b9312254596ea3b8e116b28cf250c 100644
|
||||
--- a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
||||
@@ -38,7 +38,7 @@ index be563b466b9b9312254596ea3b8e116b28cf250c..7355c828ab66c23d878e4981be9e44c7
|
||||
+
|
||||
}
|
||||
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
index a04c202e83abc08a98549440e987d4d5f47379b7..754c8ab99b908b017b9ef4ceaa3ae67c7266ac44 100644
|
||||
index 713f62b7bfe290b1eb0eda6e3acc1d3583029aa6..4dc59a82f12a727f6db4a68bc1f5bd65c8cb08cc 100644
|
||||
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
||||
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
@@ -38,6 +38,7 @@ import co.aikar.timings.MinecraftTimings;
|
||||
@@ -83,7 +83,7 @@ index a04c202e83abc08a98549440e987d4d5f47379b7..754c8ab99b908b017b9ef4ceaa3ae67c
|
||||
+ private static final java.util.Random wakeUpDurationRandom = new java.util.Random();
|
||||
+
|
||||
+ private static int getWakeUpDurationWithVariance(Entity entity, int wakeUpDuration) {
|
||||
+ GaleWorldConfiguration config = entity.level.galeConfig();
|
||||
+ GaleWorldConfiguration config = entity.level().galeConfig();
|
||||
+ double deviation = config.gameplayMechanics.entityWakeUpDurationRatioStandardDeviation;
|
||||
+ if (deviation <= 0) {
|
||||
+ return wakeUpDuration;
|
||||
@@ -13,7 +13,7 @@ As part of: EmpireCraft (https://github.com/starlis/empirecraft)
|
||||
Licensed under: MIT (https://opensource.org/licenses/MIT)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index ab208c49a5ed5db359ab8a4a12ddf91ecec2ce5d..9de7eda75e41065ab509c05c3ed844d943ccfe00 100644
|
||||
index f77f4cbdca0b22e0c24acbf08425e2e83ddef449..e7ec98be67ab50c06d90a1bccd023fcd2a2fee93 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -270,6 +270,7 @@ public class ServerPlayer extends Player {
|
||||
@@ -25,10 +25,10 @@ index ab208c49a5ed5db359ab8a4a12ddf91ecec2ce5d..9de7eda75e41065ab509c05c3ed844d9
|
||||
// CraftBukkit end
|
||||
public boolean isRealPlayer; // Paper
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 434a671878fedb3dea7423a929def187a9ef4f9c..6e1567de96b77a8eea9f2a3bcb1756e391949ca8 100644
|
||||
index 9b028f8a5d0bcda9ea1bc28b65587627e31e78b1..ae50f9e62f1275d0cff6f017ec23e4ebcad46a1d 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -2345,6 +2345,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -2343,6 +2343,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales
|
||||
this.send(new ClientboundSystemChatPacket(PaperAdventure.asAdventure(Component.translatable("chat.disabled.options").withStyle(ChatFormatting.RED)), false)); // Paper - Adventure
|
||||
return Optional.empty();
|
||||
@@ -40,10 +40,10 @@ index 434a671878fedb3dea7423a929def187a9ef4f9c..6e1567de96b77a8eea9f2a3bcb1756e3
|
||||
this.player.resetLastActionTime();
|
||||
return optional;
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 92e758a286a5db079c32d53cc52c8a422457daef..c86c06adc424577de49339760473758ac12d2000 100644
|
||||
index 683b5d78f9e3dc34e40c54683f64be32317797ac..e0e27beebffdbb8fa534899b451cc59f275faef0 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -335,6 +335,8 @@ public abstract class PlayerList {
|
||||
@@ -342,6 +342,8 @@ public abstract class PlayerList {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ License: AGPL-3.0 (https://www.gnu.org/licenses/agpl-3.0.html)
|
||||
Gale - https://galemc.org
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 6e1567de96b77a8eea9f2a3bcb1756e391949ca8..415162e8cee85ec04b8306f1e78caf463813b6fc 100644
|
||||
index ae50f9e62f1275d0cff6f017ec23e4ebcad46a1d..aeeda04840eb8f7b1c05456acecbf9f81fcef54d 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -185,6 +185,7 @@ import net.minecraft.world.phys.shapes.BooleanOp;
|
||||
@@ -18,7 +18,7 @@ index 6e1567de96b77a8eea9f2a3bcb1756e391949ca8..415162e8cee85ec04b8306f1e78caf46
|
||||
import org.galemc.gale.configuration.GaleGlobalConfiguration;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@@ -2557,7 +2558,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -2555,7 +2556,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
// CraftBukkit start
|
||||
String s = message.signedContent();
|
||||
if (s.isEmpty()) {
|
||||
@@ -37,7 +37,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerAdvancements.java b/src/main/java/net/minecraft/server/PlayerAdvancements.java
|
||||
index 26888ebd38280de92e41dd8006d2b24e874afe26..c953f7f2f125985eeec9563a22f9188cc979cd36 100644
|
||||
index acc49f66bf34e2507d0ee6fec0a56b11bfc68f46..8834a32bfb27653062d242144dcd75ce7e289abc 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerAdvancements.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerAdvancements.java
|
||||
@@ -43,6 +43,7 @@ import net.minecraft.server.level.ServerPlayer;
|
||||
@@ -37,7 +37,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/stats/ServerRecipeBook.java b/src/main/java/net/minecraft/stats/ServerRecipeBook.java
|
||||
index d13ed3069e944d138442ea440ac3eaf8d44c18d3..c89b8e5ea10a465160504f7364db47410ee5ec0d 100644
|
||||
index ea29e07a105f3ba6a878bdccf36e7eaf66280280..7b782f705b9f349e914a7192778d5e25bad635b8 100644
|
||||
--- a/src/main/java/net/minecraft/stats/ServerRecipeBook.java
|
||||
+++ b/src/main/java/net/minecraft/stats/ServerRecipeBook.java
|
||||
@@ -18,6 +18,7 @@ import net.minecraft.resources.ResourceLocation;
|
||||
@@ -48,7 +48,7 @@ index d13ed3069e944d138442ea440ac3eaf8d44c18d3..c89b8e5ea10a465160504f7364db4741
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
|
||||
@@ -122,7 +123,7 @@ public class ServerRecipeBook extends RecipeBook {
|
||||
@@ -125,7 +126,7 @@ public class ServerRecipeBook extends RecipeBook {
|
||||
Optional<? extends Recipe<?>> optional = recipeManager.byKey(minecraftkey);
|
||||
|
||||
if (!optional.isPresent()) {
|
||||
@@ -7,10 +7,10 @@ License: AGPL-3.0 (https://www.gnu.org/licenses/agpl-3.0.html)
|
||||
Gale - https://galemc.org
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 415162e8cee85ec04b8306f1e78caf463813b6fc..a63236fb2995e8eea9185a19417dd6464bb832a0 100644
|
||||
index aeeda04840eb8f7b1c05456acecbf9f81fcef54d..fcf395497593704858439f7f9ca8b46b699c42df 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -2335,7 +2335,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -2333,7 +2333,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
|
||||
private Optional<LastSeenMessages> tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) {
|
||||
if (!this.updateChatOrder(timestamp)) {
|
||||
@@ -7,7 +7,7 @@ License: AGPL-3.0 (https://www.gnu.org/licenses/agpl-3.0.html)
|
||||
Gale - https://galemc.org
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
|
||||
index 951a7df30bd70bb3051c04f592529d560be6948e..42ac52d595308e36a4c7e98c0379408057f889a8 100644
|
||||
index 774fb97912f766589f3548f659618ad554e0503f..bec9a8ca016f23352ba51e5f70ecb9a0b66b0385 100644
|
||||
--- a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
|
||||
+++ b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
|
||||
@@ -43,6 +43,7 @@ import org.bukkit.event.player.PlayerChatEvent;
|
||||
@@ -28,7 +28,7 @@ index 951a7df30bd70bb3051c04f592529d560be6948e..42ac52d595308e36a4c7e98c03794080
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index c86c06adc424577de49339760473758ac12d2000..31554b46b0e6c84d8b480b10e1c46649d2518488 100644
|
||||
index e0e27beebffdbb8fa534899b451cc59f275faef0..efc958959b772312acfbcfb0cf52c6aa6be77fb2 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -101,6 +101,7 @@ import net.minecraft.world.scores.Objective;
|
||||
@@ -39,7 +39,7 @@ index c86c06adc424577de49339760473758ac12d2000..31554b46b0e6c84d8b480b10e1c46649
|
||||
import org.slf4j.Logger;
|
||||
|
||||
// CraftBukkit start
|
||||
@@ -1396,7 +1397,7 @@ public abstract class PlayerList {
|
||||
@@ -1403,7 +1404,7 @@ public abstract class PlayerList {
|
||||
// Paper end
|
||||
boolean flag = this.verifyChatTrusted(message);
|
||||
|
||||
@@ -41,7 +41,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 54458601bbda3a4142c09f717e3b87a079ce096f..afdd597c63703cca87b277f0b66786cd8f3bf9aa 100644
|
||||
index e981740075e287ede989e805314a1356b566a2c4..84ffee8934381ba380a2a8cf936968464df7a71e 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -179,7 +179,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -41,7 +41,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index afdd597c63703cca87b277f0b66786cd8f3bf9aa..5a92a8f24d3a6957cc3f8404bf3458f4c4058fb4 100644
|
||||
index 84ffee8934381ba380a2a8cf936968464df7a71e..cafc4391d2ed3df7b0b8d73c663777cdbb3a5de9 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -297,7 +297,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -37,7 +37,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||
index 536856300da929c101f50da5827677bada5feb50..3d05bdbaf3488b5a01d949b9e90b1ebed935adc3 100644
|
||||
index eff81e846f696349b3bd3d26c02442f157b169f0..084a8f42ede16a193ce2a2dae932171424fbc3fb 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||
@@ -131,7 +131,7 @@ public class FallingBlockEntity extends Entity {
|
||||
@@ -45,7 +45,7 @@ index 536856300da929c101f50da5827677bada5feb50..3d05bdbaf3488b5a01d949b9e90b1ebe
|
||||
public void tick() {
|
||||
// Paper start - fix sand duping
|
||||
- if (this.isRemoved()) {
|
||||
+ if (this.level.galeConfig().gameplayMechanics.fixes.sandDuping && this.isRemoved()) { // Gale - Purpur - make sand duping fix configurable
|
||||
+ if (this.level().galeConfig().gameplayMechanics.fixes.sandDuping && this.isRemoved()) { // Gale - Purpur - make sand duping fix configurable
|
||||
return;
|
||||
}
|
||||
// Paper end - fix sand duping
|
||||
@@ -54,7 +54,7 @@ index 536856300da929c101f50da5827677bada5feb50..3d05bdbaf3488b5a01d949b9e90b1ebe
|
||||
|
||||
// Paper start - fix sand duping
|
||||
- if (this.isRemoved()) {
|
||||
+ if (this.level.galeConfig().gameplayMechanics.fixes.sandDuping && this.isRemoved()) { // Gale - Purpur - make sand duping fix configurable
|
||||
+ if (this.level().galeConfig().gameplayMechanics.fixes.sandDuping && this.isRemoved()) { // Gale - Purpur - make sand duping fix configurable
|
||||
return;
|
||||
}
|
||||
// Paper end - fix sand duping
|
||||
@@ -37,7 +37,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/WaterAnimal.java b/src/main/java/net/minecraft/world/entity/animal/WaterAnimal.java
|
||||
index 35cfa366baf6747105faa93f1220bb9cc31a5bd5..2fcdb8173db167a440a5a94d1ec8f6c2eeb08c0b 100644
|
||||
index cd2ce5bcb8c30e4657cd0e340d80544c7e805905..db3574e4ec9bad32bbbcd9d7ab9607da60e1715a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/WaterAnimal.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/WaterAnimal.java
|
||||
@@ -82,6 +82,6 @@ public abstract class WaterAnimal extends PathfinderMob {
|
||||
@@ -37,7 +37,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
|
||||
index 30aec9dff249ae629b22318e52902361a9fa4099..c58fab79c9425a56cd9ffdfa81e4ea97d5dff941 100644
|
||||
index 955316687e2e29ad75a0052317a7b0f89034c82a..4fca705a68422e3829d82e024cbadfb077710a6d 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
|
||||
@@ -287,6 +287,16 @@ public class ItemFrame extends HangingEntity {
|
||||
@@ -47,7 +47,7 @@ index 30aec9dff249ae629b22318e52902361a9fa4099..c58fab79c9425a56cd9ffdfa81e4ea97
|
||||
+ // Gale start - Purpur - fix MC-123848
|
||||
+ @Override
|
||||
+ public @Nullable net.minecraft.world.entity.item.ItemEntity spawnAtLocation(ItemStack stack) {
|
||||
+ if (!this.level.galeConfig().gameplayMechanics.fixes.mc123848) {
|
||||
+ if (!this.level().galeConfig().gameplayMechanics.fixes.mc123848) {
|
||||
+ return super.spawnAtLocation(stack);
|
||||
+ }
|
||||
+ return this.spawnAtLocation(stack, getDirection().equals(Direction.DOWN) ? -0.6F : 0.0F);
|
||||
@@ -37,7 +37,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java b/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java
|
||||
index 68a5ee85e64802e4509ba0d184fc0ceb3cbe2d11..8ee1a0626e5a6c0ad19a25b8f476a2e12d69668d 100644
|
||||
index a04374f91f2fbb31219d86b6ae63bcf8fdf7318c..e3b92e8b2274ee6d07d1e9c74f669aeaab594919 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java
|
||||
@@ -180,12 +180,21 @@ public class MushroomCow extends Cow implements Shearable, VariantHolder<Mushroo
|
||||
@@ -45,7 +45,7 @@ index 68a5ee85e64802e4509ba0d184fc0ceb3cbe2d11..8ee1a0626e5a6c0ad19a25b8f476a2e1
|
||||
entitycow.moveTo(this.getX(), this.getY(), this.getZ(), this.getYRot(), this.getXRot());
|
||||
entitycow.setHealth(this.getHealth());
|
||||
+ // Gale start - Purpur - fix cow rotation when shearing mooshroom
|
||||
+ if (this.level.galeConfig().gameplayMechanics.fixes.keepMooshroomRotationAfterShearing) {
|
||||
+ if (this.level().galeConfig().gameplayMechanics.fixes.keepMooshroomRotationAfterShearing) {
|
||||
+ entitycow.copyPosition(this);
|
||||
+ entitycow.yBodyRot = this.yBodyRot;
|
||||
+ entitycow.setYHeadRot(this.getYHeadRot());
|
||||
@@ -37,10 +37,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/RangedBowAttackGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/RangedBowAttackGoal.java
|
||||
index 6558b0d4bea99948fdc2b51751f3cfdc239d4b67..bedb5b8ee24817a494455f17e1f32b42d64c4dd2 100644
|
||||
index 87fb10096fc9dade33c663234b1cecc34d3d77bb..cb2c6dcdd2be476d0434e7f771bbb25150b8bdac 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/goal/RangedBowAttackGoal.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/RangedBowAttackGoal.java
|
||||
@@ -102,7 +102,10 @@ public class RangedBowAttackGoal<T extends Monster & RangedAttackMob> extends Go
|
||||
@@ -104,7 +104,10 @@ public class RangedBowAttackGoal<T extends Monster & RangedAttackMob> extends Go
|
||||
this.strafingTime = 0;
|
||||
}
|
||||
|
||||
@@ -52,14 +52,14 @@ index 6558b0d4bea99948fdc2b51751f3cfdc239d4b67..bedb5b8ee24817a494455f17e1f32b42
|
||||
if (d > (double)(this.attackRadiusSqr * 0.75F)) {
|
||||
this.strafingBackwards = false;
|
||||
} else if (d < (double)(this.attackRadiusSqr * 0.25F)) {
|
||||
@@ -111,7 +114,10 @@ public class RangedBowAttackGoal<T extends Monster & RangedAttackMob> extends Go
|
||||
@@ -119,7 +122,10 @@ public class RangedBowAttackGoal<T extends Monster & RangedAttackMob> extends Go
|
||||
}
|
||||
|
||||
this.mob.getMoveControl().strafe(this.strafingBackwards ? -0.5F : 0.5F, this.strafingClockwise ? 0.5F : -0.5F);
|
||||
this.mob.lookAt(livingEntity, 30.0F, 30.0F);
|
||||
- } else {
|
||||
+ // Gale start - Purpur - fix MC-121706
|
||||
+ }
|
||||
+ if (!hasStrafingTime || this.mob.level.galeConfig().gameplayMechanics.fixes.mc121706) {
|
||||
+ if (!hasStrafingTime || this.mob.level().galeConfig().gameplayMechanics.fixes.mc121706) {
|
||||
+ // Gale end - Purpur - fix MC-121706
|
||||
this.mob.getLookControl().setLookAt(livingEntity, 30.0F, 30.0F);
|
||||
}
|
||||
@@ -19,7 +19,7 @@ the second will join in the fight against itself,
|
||||
causing it to attack itself repeatedly. See https://bugs.mojang.com/browse/MC-110386.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/target/HurtByTargetGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/target/HurtByTargetGoal.java
|
||||
index 39ea15c7577af186d93d4ad9a48034d746a86fc8..865eb39f4a1d2207c857acccc0695be92af2d6bb 100644
|
||||
index 80ef4b6649da3049f21624926fa38595d76c5da5..7ce47abc44e0dfe8ff90afeb25b14d8d98e6b1cc 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/goal/target/HurtByTargetGoal.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/target/HurtByTargetGoal.java
|
||||
@@ -114,6 +114,11 @@ public class HurtByTargetGoal extends TargetGoal {
|
||||
@@ -27,7 +27,7 @@ index 39ea15c7577af186d93d4ad9a48034d746a86fc8..865eb39f4a1d2207c857acccc0695be9
|
||||
|
||||
protected void alertOther(Mob mob, LivingEntity target) {
|
||||
+ // Gale start - Mirai - fix MC-110386
|
||||
+ if (mob == target && mob.level.galeConfig().gameplayMechanics.fixes.mc110386) {
|
||||
+ if (mob == target && mob.level().galeConfig().gameplayMechanics.fixes.mc110386) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // Gale end - Mirai - fix MC-110386
|
||||
@@ -19,21 +19,21 @@ the displayed hunger bar never goes down. Hunger (or any related value, includin
|
||||
should not go down on peaceful. See https://bugs.mojang.com/browse/MC-31819.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
index 0629c471d38a77c44fc1c86ccdfcb0690f61ca17..65e356449e9c96c937b45eaab94aa6cc4296fcb9 100644
|
||||
index 58152160d609d0e9d105153aeb166a56a7955603..6a906b1f37e52472527e9f19e965be9f155dd404 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
@@ -1902,6 +1902,11 @@ public abstract class Player extends LivingEntity {
|
||||
@@ -1929,6 +1929,11 @@ public abstract class Player extends LivingEntity {
|
||||
}
|
||||
|
||||
public void causeFoodExhaustion(float f, EntityExhaustionEvent.ExhaustionReason reason) {
|
||||
+ // Gale start - Mirai - fix MC-31819
|
||||
+ if (this.level.galeConfig().gameplayMechanics.fixes.mc31819 && this.level.getDifficulty() == Difficulty.PEACEFUL) {
|
||||
+ if (this.level().galeConfig().gameplayMechanics.fixes.mc31819 && this.level().getDifficulty() == Difficulty.PEACEFUL) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // Gale end - Mirai - fix MC-31819
|
||||
// CraftBukkit end
|
||||
if (!this.abilities.invulnerable) {
|
||||
if (!this.level.isClientSide) {
|
||||
if (!this.level().isClientSide) {
|
||||
diff --git a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
||||
index 899aa60e2c20c4d973777d4f82f524e2fb902c93..aab67ad8212bdc5a8afe9b1a9634bde3f78eb496 100644
|
||||
--- a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
||||
@@ -37,14 +37,14 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
||||
index c73024cc62490c336ffe26313580e88d25ca7078..c86dea3e38d72929a4970334e3cc4e93e353c598 100644
|
||||
index d9baa85962236c42219cf09d4f3129be93ff069c..414a47a82927bed02a4f3cf330c78e46f1d66782 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
||||
@@ -178,6 +178,7 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {
|
||||
|
||||
public static void teleportEntity(Level world, BlockPos pos, BlockState state, Entity entity, TheEndGatewayBlockEntity blockEntity) {
|
||||
if (world instanceof ServerLevel && !blockEntity.isCoolingDown()) {
|
||||
+ if (entity.level.galeConfig().gameplayMechanics.fixes.checkCanChangeDimensionsBeforeUseEndGateway && world.galeConfig().gameplayMechanics.fixes.checkCanChangeDimensionsBeforeUseEndGateway && !entity.canChangeDimensions()) return; // Gale - Purpur - end gateway should check if entity can use portal
|
||||
+ if (entity.level().galeConfig().gameplayMechanics.fixes.checkCanChangeDimensionsBeforeUseEndGateway && world.galeConfig().gameplayMechanics.fixes.checkCanChangeDimensionsBeforeUseEndGateway && !entity.canChangeDimensions()) return; // Gale - Purpur - end gateway should check if entity can use portal
|
||||
ServerLevel worldserver = (ServerLevel) world;
|
||||
|
||||
blockEntity.teleportCooldown = 100;
|
||||
@@ -37,7 +37,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/EatBlockGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/EatBlockGoal.java
|
||||
index 80aa539f7c6a6ee44338de084cdcdf5fb4ef996a..cb8fc8a88c14d2374a0bbe35aa1c2056d625b71c 100644
|
||||
index abf796c3369da6b73c8587dfc05f56d0b8933fde..0fe194854a60a8d09f2a793a34132f55cb338713 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/goal/EatBlockGoal.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/EatBlockGoal.java
|
||||
@@ -31,10 +31,16 @@ public class EatBlockGoal extends Goal {
|
||||
@@ -46,8 +46,8 @@ index 80aa539f7c6a6ee44338de084cdcdf5fb4ef996a..cb8fc8a88c14d2374a0bbe35aa1c2056
|
||||
public boolean canUse() {
|
||||
+ // Gale start - Purpur - prevent entities eating blocks in non-ticking chunks
|
||||
+ BlockPos blockposition = this.mob.blockPosition;
|
||||
+ net.minecraft.world.level.chunk.LevelChunk chunk = this.mob.level.getChunkIfLoaded(blockposition);
|
||||
+ if (this.mob.level.galeConfig().gameplayMechanics.entitiesCanEatBlocksInNonTickingChunks && (chunk == null || chunk.playerChunk == null || !((net.minecraft.server.level.ServerLevel) this.mob.level).isPositionEntityTicking(blockposition))) {
|
||||
+ net.minecraft.world.level.chunk.LevelChunk chunk = this.mob.level().getChunkIfLoaded(blockposition);
|
||||
+ if (this.mob.level().galeConfig().gameplayMechanics.entitiesCanEatBlocksInNonTickingChunks && (chunk == null || chunk.playerChunk == null || !((net.minecraft.server.level.ServerLevel) this.mob.level()).isPositionEntityTicking(blockposition))) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ // Gale end - Purpur - prevent entities eating blocks in non-ticking chunks
|
||||
@@ -42,7 +42,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
||||
index 5d6d26cfe8f0ab68a3145214b3fc126ca7a71a66..e190f414ab5af7326d92af3fddf3f7a2c3358fa0 100644
|
||||
index 7226be19248a1ffb8ff2c89b55882529d33a6c0c..cff4d09af11d1741bf3301b457555d71e77e801c 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
||||
@@ -312,7 +312,7 @@ public abstract class AbstractArrow extends Projectile {
|
||||
@@ -50,7 +50,7 @@ index 5d6d26cfe8f0ab68a3145214b3fc126ca7a71a66..e190f414ab5af7326d92af3fddf3f7a2
|
||||
|
||||
this.setDeltaMovement(vec3d.multiply((double) (this.random.nextFloat() * 0.2F), (double) (this.random.nextFloat() * 0.2F), (double) (this.random.nextFloat() * 0.2F)));
|
||||
- this.life = 0;
|
||||
+ if (this.level.galeConfig().gameplayMechanics.arrowMovementResetsDespawnCounter) this.life = 0; // Gale - Purpur - make arrow movement resetting despawn counter configurable
|
||||
+ if (this.level().galeConfig().gameplayMechanics.arrowMovementResetsDespawnCounter) this.life = 0; // Gale - Purpur - make arrow movement resetting despawn counter configurable
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -13,10 +13,10 @@ As part of: JettPack (https://gitlab.com/Titaniumtown/JettPack)
|
||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 31554b46b0e6c84d8b480b10e1c46649d2518488..69d22ca2f2a2b4d85d72eeef36a3843a11ee4c91 100644
|
||||
index efc958959b772312acfbcfb0cf52c6aa6be77fb2..6deac057bae3fe80bbdd39fc6151ee66e754c71e 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -473,7 +473,13 @@ public abstract class PlayerList {
|
||||
@@ -480,7 +480,13 @@ public abstract class PlayerList {
|
||||
}
|
||||
// Paper end
|
||||
// CraftBukkit - Moved from above, added world
|
||||
@@ -81,7 +81,7 @@ index ae60bd96b5284d54676d8e7e4dd5d170b526ec1e..b269b9b55c10542b16af301be3f43798
|
||||
return true;
|
||||
}
|
||||
diff --git a/src/main/java/io/papermc/paper/world/ChunkEntitySlices.java b/src/main/java/io/papermc/paper/world/ChunkEntitySlices.java
|
||||
index f597d65d56964297eeeed6c7e77703764178fee0..d503c0a7c4706af28a7db2face5efd8d595831d1 100644
|
||||
index ce449b7b6f615f2c8240e4207f06d4e54ae0083e..c21398bd39bd1e96f8005539909aa7497fb19c9e 100644
|
||||
--- a/src/main/java/io/papermc/paper/world/ChunkEntitySlices.java
|
||||
+++ b/src/main/java/io/papermc/paper/world/ChunkEntitySlices.java
|
||||
@@ -2,9 +2,9 @@ package io.papermc.paper.world;
|
||||
@@ -94,8 +94,8 @@ index f597d65d56964297eeeed6c7e77703764178fee0..d503c0a7c4706af28a7db2face5efd8d
|
||||
+import me.titaniumtown.ArrayConstants;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.level.ChunkHolder;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
@@ -81,7 +81,7 @@ public final class ChunkEntitySlices {
|
||||
import net.minecraft.server.level.FullChunkStatus;
|
||||
@@ -82,7 +82,7 @@ public final class ChunkEntitySlices {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ index f597d65d56964297eeeed6c7e77703764178fee0..d503c0a7c4706af28a7db2face5efd8d
|
||||
}
|
||||
|
||||
public CompoundTag save() {
|
||||
@@ -298,7 +298,7 @@ public final class ChunkEntitySlices {
|
||||
@@ -299,7 +299,7 @@ public final class ChunkEntitySlices {
|
||||
|
||||
protected static final class BasicEntityList<E extends Entity> {
|
||||
|
||||
@@ -113,7 +113,7 @@ index f597d65d56964297eeeed6c7e77703764178fee0..d503c0a7c4706af28a7db2face5efd8d
|
||||
protected static final int DEFAULT_CAPACITY = 4;
|
||||
|
||||
protected E[] storage;
|
||||
@@ -309,7 +309,7 @@ public final class ChunkEntitySlices {
|
||||
@@ -310,7 +310,7 @@ public final class ChunkEntitySlices {
|
||||
}
|
||||
|
||||
public BasicEntityList(final int cap) {
|
||||
@@ -122,7 +122,7 @@ index f597d65d56964297eeeed6c7e77703764178fee0..d503c0a7c4706af28a7db2face5efd8d
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
@@ -321,7 +321,7 @@ public final class ChunkEntitySlices {
|
||||
@@ -322,7 +322,7 @@ public final class ChunkEntitySlices {
|
||||
}
|
||||
|
||||
private void resize() {
|
||||
@@ -271,7 +271,7 @@ index 25ad2c6ff968f4a6b16b4dea3f67341a4261f2a4..5d95b7164bb576e1722fc2498e5e4966
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/nbt/ListTag.java b/src/main/java/net/minecraft/nbt/ListTag.java
|
||||
index 749d3e67a877d7d1ed47b5fef511a604ee6589b6..54ea449b87e012332a3a99807d7ab8afbd00e8de 100644
|
||||
index b74b77ec2fd45c7a44e4f2696c4f57075c3d4080..beb1f8a3ac601b14a6e7da27ea8c840ce51456c1 100644
|
||||
--- a/src/main/java/net/minecraft/nbt/ListTag.java
|
||||
+++ b/src/main/java/net/minecraft/nbt/ListTag.java
|
||||
@@ -2,6 +2,8 @@ package net.minecraft.nbt;
|
||||
@@ -346,7 +346,7 @@ index a2920b8a9eff77d9c5d1d7f70ad3abdacba8f0fa..43f402d9032e4570a81a80e412215598
|
||||
protected CipherBase(Cipher cipher) {
|
||||
this.cipher = cipher;
|
||||
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
|
||||
index f9e10bf048929886db3c414038d2c7e9f84226a6..0aef4fe2af72e8006f37c02f4f8eaa651b870671 100644
|
||||
index c45c1d519aba414557bf1a4c9260f928bd8d9b14..e152e851db27ea4e43678b91a65ce303cb7004b3 100644
|
||||
--- a/src/main/java/net/minecraft/network/Connection.java
|
||||
+++ b/src/main/java/net/minecraft/network/Connection.java
|
||||
@@ -21,7 +21,6 @@ import io.netty.channel.epoll.EpollSocketChannel;
|
||||
@@ -367,7 +367,7 @@ index f9e10bf048929886db3c414038d2c7e9f84226a6..0aef4fe2af72e8006f37c02f4f8eaa65
|
||||
import net.minecraft.Util;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.MutableComponent;
|
||||
@@ -318,7 +318,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
@@ -316,7 +316,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
}
|
||||
|
||||
public void setListener(PacketListener listener) {
|
||||
@@ -399,7 +399,7 @@ index 8a68baf6bd46b59cf57c94ffe5651d47a7cae99c..bd7fa1b2a6fed82ce66fe2b8e3498e4d
|
||||
private static final FormattedText TEXT_NULL = FormattedText.of("null");
|
||||
private final String key;
|
||||
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
|
||||
index cdbf10339a8e8846a8c364de483a0ccd95cd225a..95462967b057e00b0616857e3c4eb05e5840ba3d 100644
|
||||
index dae36c6452ccd57a436dd918547b64d59957ab0a..f06cafd80d7c027ca97e50bcb45ad520d17c7e55 100644
|
||||
--- a/src/main/java/net/minecraft/server/Main.java
|
||||
+++ b/src/main/java/net/minecraft/server/Main.java
|
||||
@@ -93,7 +93,7 @@ public class Main {
|
||||
@@ -412,7 +412,7 @@ index cdbf10339a8e8846a8c364de483a0ccd95cd225a..95462967b057e00b0616857e3c4eb05e
|
||||
OptionSpec<Integer> optionspec11 = optionparser.accepts("port").withRequiredArg().ofType(Integer.class).defaultsTo(-1, new Integer[0]);
|
||||
OptionSpec<String> optionspec12 = optionparser.accepts("serverId").withRequiredArg();
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index f53370e581b8d07d993323be5df4d737d1e13794..71b4de55621ef7bb2df4fbfc611ce32023cdd628 100644
|
||||
index a6d5dd36d297c976ad3302ae7c3c2080c978f68d..850f2299595e081cbac459304e8c52d94d90f6f4 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -50,6 +50,8 @@ import java.util.stream.Collectors;
|
||||
@@ -425,10 +425,10 @@ index f53370e581b8d07d993323be5df4d737d1e13794..71b4de55621ef7bb2df4fbfc611ce320
|
||||
import net.minecraft.ReportedException;
|
||||
import net.minecraft.SharedConstants;
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
index 48adbfbb8a55f6719c92a1fe83c64d87f1b236d5..834b497053f4fa20cf94c00e1ee2db4838bdf233 100644
|
||||
index 1717844256fe6479e3d7125db3937354578d17d0..0ced61876ad4790c0a0c8e24be721241fa7fd319 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
@@ -338,7 +338,7 @@ public class ServerEntity {
|
||||
@@ -332,7 +332,7 @@ public class ServerEntity {
|
||||
|
||||
if (this.entity instanceof LivingEntity) {
|
||||
List<Pair<EquipmentSlot, ItemStack>> list = Lists.newArrayList();
|
||||
@@ -438,7 +438,7 @@ index 48adbfbb8a55f6719c92a1fe83c64d87f1b236d5..834b497053f4fa20cf94c00e1ee2db48
|
||||
|
||||
for (int j = 0; j < i; ++j) {
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 9676d4523c14559cd13e6c53d220bf7472558d8a..288372fbf6c1e669ee16381be57120e5b569f4a4 100644
|
||||
index efbc8483a51c5272ca81747c82dc65e7f0f5c232..9879599c38db4f3332c347b6b0c26034bc7749bc 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -38,6 +38,8 @@ import java.util.stream.Collectors;
|
||||
@@ -450,7 +450,7 @@ index 9676d4523c14559cd13e6c53d220bf7472558d8a..288372fbf6c1e669ee16381be57120e5
|
||||
import net.minecraft.CrashReport;
|
||||
import net.minecraft.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
@@ -898,7 +900,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1040,7 +1042,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
BlockPos blockposition2 = blockposition.set(j + randomX, randomY, k + randomZ);
|
||||
BlockState iblockdata = com.destroystokyo.paper.util.maplist.IBlockDataList.getBlockDataFromRaw(raw);
|
||||
|
||||
@@ -459,7 +459,7 @@ index 9676d4523c14559cd13e6c53d220bf7472558d8a..288372fbf6c1e669ee16381be57120e5
|
||||
// We drop the fluid tick since LAVA is ALREADY TICKED by the above method (See LiquidBlock).
|
||||
// TODO CHECK ON UPDATE (ping the Canadian)
|
||||
}
|
||||
@@ -1152,7 +1154,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1294,7 +1296,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
|
||||
public static List<Entity> getCurrentlyTickingEntities() {
|
||||
Entity ticking = currentlyTickingEntity.get();
|
||||
@@ -469,7 +469,7 @@ index 9676d4523c14559cd13e6c53d220bf7472558d8a..288372fbf6c1e669ee16381be57120e5
|
||||
return ret;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index a63236fb2995e8eea9185a19417dd6464bb832a0..9f2f019ad39b0aa16ebe0eabd79fc5beba897959 100644
|
||||
index fcf395497593704858439f7f9ca8b46b699c42df..574c8a2680c66d9e8bc14b1128652f1f4d16210b 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -29,6 +29,8 @@ import java.util.function.UnaryOperator;
|
||||
@@ -515,8 +515,8 @@ index a63236fb2995e8eea9185a19417dd6464bb832a0..9f2f019ad39b0aa16ebe0eabd79fc5be
|
||||
}
|
||||
} else {
|
||||
if (elapsedTime >= 15000L) { // 15 seconds
|
||||
@@ -877,13 +875,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
// PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); // Paper - run this async
|
||||
@@ -884,13 +882,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
// PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); // Paper - run this async
|
||||
// CraftBukkit start
|
||||
if (this.chatSpamTickCount.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamLimit && !this.server.getPlayerList().isOp(this.player.getGameProfile())) { // Paper start - split and make configurable
|
||||
- server.scheduleOnMain(() -> this.disconnect(Component.translatable("disconnect.spam", new Object[0]), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM)); // Paper - kick event cause
|
||||
@@ -526,17 +526,17 @@ index a63236fb2995e8eea9185a19417dd6464bb832a0..9f2f019ad39b0aa16ebe0eabd79fc5be
|
||||
// Paper start
|
||||
String str = packet.getCommand(); int index = -1;
|
||||
if (str.length() > 64 && ((index = str.indexOf(' ')) == -1 || index >= 64)) {
|
||||
- server.scheduleOnMain(() -> this.disconnect(Component.translatable("disconnect.spam", new Object[0]), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM)); // Paper - kick event cause
|
||||
- server.scheduleOnMain(() -> this.disconnect(Component.translatable("disconnect.spam", new Object[0]), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM)); // Paper
|
||||
+ server.scheduleOnMain(() -> this.disconnect(Component.translatable("disconnect.spam", ArrayConstants.emptyObjectArray), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM)); // Paper - kick event cause // Gale - JettPack - reduce array allocations
|
||||
return;
|
||||
}
|
||||
// Paper end
|
||||
@@ -3301,7 +3299,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -3300,7 +3298,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
// Paper start
|
||||
if (!org.bukkit.Bukkit.isPrimaryThread()) {
|
||||
if (recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) {
|
||||
- server.scheduleOnMain(() -> this.disconnect(net.minecraft.network.chat.Component.translatable("disconnect.spam", new Object[0]), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM)); // Paper - kick event cause
|
||||
+ server.scheduleOnMain(() -> this.disconnect(net.minecraft.network.chat.Component.translatable("disconnect.spam", ArrayConstants.emptyObjectArray), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM)); // Paper - kick event cause // Gale - JettPack - reduce array allocations
|
||||
if (this.recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) {
|
||||
- this.server.scheduleOnMain(() -> this.disconnect(net.minecraft.network.chat.Component.translatable("disconnect.spam", new Object[0]), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM)); // Paper - kick event cause
|
||||
+ this.server.scheduleOnMain(() -> this.disconnect(net.minecraft.network.chat.Component.translatable("disconnect.spam", ArrayConstants.emptyObjectArray), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM)); // Paper - kick event cause // Gale - JettPack - reduce array allocations
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -578,7 +578,7 @@ index 2ff578e4a953ffcf5176815ba8e3f06f73499989..a436ef49325c9cae1008d5763373cce8
|
||||
final String s;
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 69d22ca2f2a2b4d85d72eeef36a3843a11ee4c91..b03789c629c87d524e24a6e3bb893ae2bac1d5c1 100644
|
||||
index 6deac057bae3fe80bbdd39fc6151ee66e754c71e..ddde03a81d7a39188ac26c16658301e138356453 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -27,6 +27,8 @@ import java.util.UUID;
|
||||
@@ -590,7 +590,7 @@ index 69d22ca2f2a2b4d85d72eeef36a3843a11ee4c91..b03789c629c87d524e24a6e3bb893ae2
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.FileUtil;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
@@ -701,7 +703,7 @@ public abstract class PlayerList {
|
||||
@@ -708,7 +710,7 @@ public abstract class PlayerList {
|
||||
while (iterator.hasNext()) {
|
||||
entityplayer = (ServerPlayer) iterator.next();
|
||||
this.save(entityplayer); // CraftBukkit - Force the player's inventory to be saved
|
||||
@@ -649,7 +649,7 @@ index 0ee04fe6ff6a4d09754f326526ae04fe7226bab2..a4f7fee3ea112c8f7b0b94949f9eb899
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/util/ZeroBitStorage.java b/src/main/java/net/minecraft/util/ZeroBitStorage.java
|
||||
index 5d8e9bdf5538b19681f21949368d862fab8a89ad..75ca7ae6028e971f73988f5e71598696c0765cc8 100644
|
||||
index 311625277a26c9c187025a1036978229241b965f..79b223ef3c86f3bc035e9abd84aa080b5d722f61 100644
|
||||
--- a/src/main/java/net/minecraft/util/ZeroBitStorage.java
|
||||
+++ b/src/main/java/net/minecraft/util/ZeroBitStorage.java
|
||||
@@ -2,10 +2,11 @@ package net.minecraft.util;
|
||||
@@ -679,10 +679,10 @@ index 97ff19efa0b3943ccb7a6e02cba6ed2fea61adac..b2ae2bd8bd4ff3cb6457e8c08172e348
|
||||
private EquipmentSlot(EquipmentSlot.Type type, int entityId, int armorStandId, String name) {
|
||||
this.type = type;
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 848022c049e27d80ceb11f0cee6cbda15edf2ff3..8e739f81455ef41502b195c360d2e4243c29cda4 100644
|
||||
index 1040e76c829521b214e5a96fb41ee60e223641d3..1016a70c2b468463cb74aa6bbfe3aa65eb297786 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -3068,7 +3068,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -3106,7 +3106,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@Nullable
|
||||
private Map<EquipmentSlot, ItemStack> collectEquipmentChanges() {
|
||||
Map<EquipmentSlot, ItemStack> map = null;
|
||||
@@ -692,10 +692,10 @@ index 848022c049e27d80ceb11f0cee6cbda15edf2ff3..8e739f81455ef41502b195c360d2e424
|
||||
|
||||
for (int j = 0; j < i; ++j) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
index a19956dbbb43f64043381bd968af74550b8a359a..728ecec837e9d9051bcf3533d63d5f179d34c81c 100644
|
||||
index 3bc50cc77bc8723dd607134f795aae55784aa657..fa47779f1007325ee77f2b43195bf1892a2d7d65 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -1044,7 +1044,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -1047,7 +1047,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@Override
|
||||
protected void dropCustomDeathLoot(DamageSource source, int lootingMultiplier, boolean allowDrops) {
|
||||
super.dropCustomDeathLoot(source, lootingMultiplier, allowDrops);
|
||||
@@ -704,7 +704,7 @@ index a19956dbbb43f64043381bd968af74550b8a359a..728ecec837e9d9051bcf3533d63d5f17
|
||||
int j = aenumitemslot.length;
|
||||
|
||||
for (int k = 0; k < j; ++k) {
|
||||
@@ -1106,7 +1106,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -1109,7 +1109,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
}
|
||||
|
||||
boolean flag = true;
|
||||
@@ -713,7 +713,7 @@ index a19956dbbb43f64043381bd968af74550b8a359a..728ecec837e9d9051bcf3533d63d5f17
|
||||
int j = aenumitemslot.length;
|
||||
|
||||
for (int k = 0; k < j; ++k) {
|
||||
@@ -1193,7 +1193,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -1196,7 +1196,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
float f = localDifficulty.getSpecialMultiplier();
|
||||
|
||||
this.enchantSpawnedWeapon(random, f);
|
||||
@@ -722,7 +722,7 @@ index a19956dbbb43f64043381bd968af74550b8a359a..728ecec837e9d9051bcf3533d63d5f17
|
||||
int i = aenumitemslot.length;
|
||||
|
||||
for (int j = 0; j < i; ++j) {
|
||||
@@ -1412,7 +1412,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -1415,7 +1415,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
t0.setInvulnerable(this.isInvulnerable());
|
||||
if (flag) {
|
||||
t0.setCanPickUpLoot(this.canPickUpLoot());
|
||||
@@ -732,7 +732,7 @@ index a19956dbbb43f64043381bd968af74550b8a359a..728ecec837e9d9051bcf3533d63d5f17
|
||||
|
||||
for (int j = 0; j < i; ++j) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java
|
||||
index 71a36cf9b976443cca9ab63cd0eb23253f638562..201b0e1b25d0773bbcf9c1ed69fd888a61c6a16f 100644
|
||||
index 25ed5571b24e590bc95056020d84496492b53298..087acc992a83b2a7e40a0e24f00e283cc139ce59 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java
|
||||
@@ -234,7 +234,7 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder {
|
||||
@@ -745,10 +745,10 @@ index 71a36cf9b976443cca9ab63cd0eb23253f638562..201b0e1b25d0773bbcf9c1ed69fd888a
|
||||
|
||||
for (int j = 0; j < i; ++j) {
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
index d81fcbadc5c0b3d4b54dde5d47a0f847d8ec6918..84067c11ee5dd18195afa21dec9d80adb9815866 100644
|
||||
index b367ec1feaccbd67e9e28c0d0515e163f37135fe..7ca7834a1a0593a6d1eb105e215784100076d421 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
@@ -1008,7 +1008,7 @@ public final class ItemStack {
|
||||
@@ -1014,7 +1014,7 @@ public final class ItemStack {
|
||||
int k;
|
||||
|
||||
if (ItemStack.shouldShowInTooltip(i, ItemStack.TooltipPart.MODIFIERS)) {
|
||||
@@ -758,7 +758,7 @@ index d81fcbadc5c0b3d4b54dde5d47a0f847d8ec6918..84067c11ee5dd18195afa21dec9d80ad
|
||||
k = aenumitemslot.length;
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/crafting/ShapedRecipe.java b/src/main/java/net/minecraft/world/item/crafting/ShapedRecipe.java
|
||||
index 117a376f99b1d26c5ffa64c8551ac1e666b15888..e67124e18aec0ac0bd1f21faa73a6259fd33e40c 100644
|
||||
index 9c1285e31d947f92e0b00149e342e793898e0d7c..dccb73d1cf06da3e3180992ea6edce322f4316ee 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/crafting/ShapedRecipe.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/crafting/ShapedRecipe.java
|
||||
@@ -12,6 +12,8 @@ import java.util.Iterator;
|
||||
@@ -797,7 +797,7 @@ index 2bfbdaeb2b0d99dfd956cd5936403fe8b0eeae64..84f1c4c3ded4f201899f3c74e639349b
|
||||
public Enchantments() {}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index d4527b0f11893925c93b1846305fb3b17ba8e89a..b19e842be160748a6969e498952eb02ffece2ecc 100644
|
||||
index b9431be4e6fb366bbdb7e66c9570f26a37379488..4b8736f19c0b968fac27037d2d0eb3f6d3a2fe94 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -12,6 +12,8 @@ import java.util.function.Consumer;
|
||||
@@ -809,7 +809,7 @@ index d4527b0f11893925c93b1846305fb3b17ba8e89a..b19e842be160748a6969e498952eb02f
|
||||
import net.minecraft.CrashReport;
|
||||
import net.minecraft.CrashReportCategory;
|
||||
import net.minecraft.core.BlockPos;
|
||||
@@ -1581,7 +1583,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -1508,7 +1510,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
public org.bukkit.entity.Entity[] getChunkEntities(int chunkX, int chunkZ) {
|
||||
io.papermc.paper.world.ChunkEntitySlices slices = ((ServerLevel)this).getEntityLookup().getChunk(chunkX, chunkZ);
|
||||
if (slices == null) {
|
||||
@@ -819,7 +819,7 @@ index d4527b0f11893925c93b1846305fb3b17ba8e89a..b19e842be160748a6969e498952eb02f
|
||||
return slices.getChunkEntities();
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
|
||||
index 6fab2b69a0af298bd00b309efcd6aa8399e23d1f..29aa7303ce5854a7f2b5ed5f9ff02ca7e00bf6c0 100644
|
||||
index 87153b5576fed05103183a9860d804c2c8cfbe1c..8d741018c7dc9a2ac1b666025a4e041010a745d4 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
|
||||
@@ -3,6 +3,8 @@ package net.minecraft.world.level.block;
|
||||
@@ -831,7 +831,7 @@ index 6fab2b69a0af298bd00b309efcd6aa8399e23d1f..29aa7303ce5854a7f2b5ed5f9ff02ca7
|
||||
import net.minecraft.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
@@ -414,7 +416,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
|
||||
@@ -416,7 +418,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(Direction side) {
|
||||
@@ -840,7 +840,7 @@ index 6fab2b69a0af298bd00b309efcd6aa8399e23d1f..29aa7303ce5854a7f2b5ed5f9ff02ca7
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -463,7 +465,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
|
||||
@@ -465,7 +467,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(Direction side) {
|
||||
@@ -849,7 +849,7 @@ index 6fab2b69a0af298bd00b309efcd6aa8399e23d1f..29aa7303ce5854a7f2b5ed5f9ff02ca7
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -505,7 +507,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
|
||||
@@ -507,7 +509,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(Direction side) {
|
||||
@@ -859,7 +859,7 @@ index 6fab2b69a0af298bd00b309efcd6aa8399e23d1f..29aa7303ce5854a7f2b5ed5f9ff02ca7
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||
index a3f073066f6e2eea8964461ad2b0409ade202f35..13f9226d4f8f591cd0095fda2f68bfad8e89b2d4 100644
|
||||
index 448fa4f4f200430d6ce3051763c7ceb697696146..381818dddc00be81d81456161fe6c6a29603987c 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||
@@ -9,6 +9,8 @@ import java.util.Iterator;
|
||||
@@ -13,10 +13,10 @@ As part of: JettPack (https://gitlab.com/Titaniumtown/JettPack)
|
||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 254feb89dc2bdb7c994fb65b1a345f879ec8ff72..6990b9cf582f32a9ec259f5641eb1d58ffff2a9d 100644
|
||||
index eb395d6498f3f43c20d371efd8e1f410400f1f2a..220880d8a723724174fe948765e108ecaf24872b 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -291,7 +291,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -293,7 +293,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
public double xo;
|
||||
public double yo;
|
||||
public double zo;
|
||||
@@ -25,19 +25,19 @@ index 254feb89dc2bdb7c994fb65b1a345f879ec8ff72..6990b9cf582f32a9ec259f5641eb1d58
|
||||
public BlockPos blockPosition; // Gale - Pufferfish - optimize entity coordinate key - private -> public
|
||||
private ChunkPos chunkPosition;
|
||||
private Vec3 deltaMovement;
|
||||
@@ -1874,9 +1874,17 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -1993,9 +1993,17 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
/** @deprecated */
|
||||
@Deprecated
|
||||
public float getLightLevelDependentMagicValue() {
|
||||
- return this.level.hasChunkAt(this.getBlockX(), this.getBlockZ()) ? this.level.getLightLevelDependentMagicValue(BlockPos.containing(this.getX(), this.getEyeY(), this.getZ())) : 0.0F;
|
||||
+ return this.level.getLightLevelDependentMagicValue(BlockPos.containing(this.getX(), this.getEyeY(), this.getZ())); // Gale - JettPack - optimize sun burn tick - allow passing BlockPos to getLightLevelDependentMagicValue
|
||||
- return this.level().hasChunkAt(this.getBlockX(), this.getBlockZ()) ? this.level().getLightLevelDependentMagicValue(BlockPos.containing(this.getX(), this.getEyeY(), this.getZ())) : 0.0F;
|
||||
+ return this.getLightLevelDependentMagicValue(BlockPos.containing(this.getX(), this.getEyeY(), this.getZ())); // Gale - JettPack - optimize sun burn tick - allow passing BlockPos to getLightLevelDependentMagicValue
|
||||
}
|
||||
|
||||
+ // Gale start - JettPack - optimize sun burn tick - allow passing BlockPos to getLightLevelDependentMagicValue
|
||||
+ /** @deprecated */
|
||||
+ @Deprecated
|
||||
+ public float getLightLevelDependentMagicValue(BlockPos pos) {
|
||||
+ return this.level.hasChunkAt(this.getBlockX(), this.getBlockZ()) ? this.level.getLightLevelDependentMagicValue(pos) : 0.0F;
|
||||
+ return this.level().hasChunkAt(this.getBlockX(), this.getBlockZ()) ? this.level.getLightLevelDependentMagicValue(pos) : 0.0F;
|
||||
+ }
|
||||
+ // Gale end - JettPack - optimize sun burn tick - allow passing BlockPos to getLightLevelDependentMagicValue
|
||||
+
|
||||
@@ -45,10 +45,10 @@ index 254feb89dc2bdb7c994fb65b1a345f879ec8ff72..6990b9cf582f32a9ec259f5641eb1d58
|
||||
this.absMoveTo(x, y, z);
|
||||
this.setYRot(yaw % 360.0F);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
index 728ecec837e9d9051bcf3533d63d5f179d34c81c..f2eca869a9301c8e6536396f55fd5dc871a3dfbc 100644
|
||||
index fa47779f1007325ee77f2b43195bf1892a2d7d65..035a0a8620fc46dbf026c65ccf2542d9f49e22b0 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -1669,13 +1669,29 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -1671,13 +1671,29 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ index 728ecec837e9d9051bcf3533d63d5f179d34c81c..f2eca869a9301c8e6536396f55fd5dc8
|
||||
+ // Gale end - JettPack - optimize sun burn tick - cache eye blockpos
|
||||
+
|
||||
public boolean isSunBurnTick() {
|
||||
if (this.level.isDay() && !this.level.isClientSide) {
|
||||
if (this.level().isDay() && !this.level().isClientSide) {
|
||||
- float f = this.getLightLevelDependentMagicValue();
|
||||
- BlockPos blockposition = BlockPos.containing(this.getX(), this.getEyeY(), this.getZ());
|
||||
+ // Gale start - JettPack - optimize sun burn tick - optimizations and cache eye blockpos
|
||||
@@ -76,8 +76,8 @@ index 728ecec837e9d9051bcf3533d63d5f179d34c81c..f2eca869a9301c8e6536396f55fd5dc8
|
||||
+ // Gale end - JettPack - optimize sun burn tick - optimizations and cache eye blockpos
|
||||
boolean flag = this.isInWaterRainOrBubble() || this.isInPowderSnow || this.wasInPowderSnow;
|
||||
|
||||
- if (f > 0.5F && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && !flag && this.level.canSeeSky(blockposition)) {
|
||||
+ if (!flag && this.level.canSeeSky(this.cached_eye_blockpos)) { // Gale - JettPack - optimize sun burn tick - optimizations and cache eye blockpos
|
||||
- if (f > 0.5F && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && !flag && this.level().canSeeSky(blockposition)) {
|
||||
+ if (!flag && this.level().canSeeSky(this.cached_eye_blockpos)) { // Gale - JettPack - optimize sun burn tick - optimizations and cache eye blockpos
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -33,7 +33,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRA
|
||||
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
|
||||
index 8f52acc03943b18f87b3b2581066496a254b1156..f3bbfb472b9be083dd1f1a317b90dda5c3c4f851 100644
|
||||
index 63cf71940f6480c593a43bd39900c50676367404..2821de09a36fc315897129f4691ba713386737db 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
|
||||
@@ -1,10 +1,11 @@
|
||||
@@ -67,7 +67,7 @@ index 8f52acc03943b18f87b3b2581066496a254b1156..f3bbfb472b9be083dd1f1a317b90dda5
|
||||
+ private static final Object2LongOpenHashMap<InetAddress> throttleTracker = new Object2LongOpenHashMap<>(); // Gale - Dionysus - replace throttle tracker map with optimized collection
|
||||
private static int throttleCounter = 0;
|
||||
// CraftBukkit end
|
||||
private static final Component IGNORE_STATUS_REASON = Component.literal("Ignoring status request");
|
||||
private static final Component IGNORE_STATUS_REASON = Component.translatable("disconnect.ignoring_status_request");
|
||||
@@ -51,7 +53,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
|
||||
InetAddress address = ((java.net.InetSocketAddress) this.connection.getRemoteAddress()).getAddress();
|
||||
|
||||
@@ -82,7 +82,7 @@ index 0000000000000000000000000000000000000000..48c32b224095f606669a38f0e200505a
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
index 4f91e4832a94c3facbc711fcae4cb5ad540a5ca0..7d6fab994d1308cb83057cecfe3d837f5063a5b1 100644
|
||||
index 9522e646529f3d849471931b4b3c0d133e7fcfc5..c4cff3592a39e519fc62664a21d368d8cac55271 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
@@ -11,6 +11,8 @@ import java.util.List;
|
||||
@@ -94,7 +94,7 @@ index 4f91e4832a94c3facbc711fcae4cb5ad540a5ca0..7d6fab994d1308cb83057cecfe3d837f
|
||||
import net.minecraft.SharedConstants;
|
||||
import net.minecraft.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
@@ -68,11 +70,12 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
@@ -67,11 +69,12 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
private final Holder.Reference<Block> builtInRegistryHolder;
|
||||
public static final IdMapper<BlockState> BLOCK_STATE_REGISTRY = new IdMapper<>();
|
||||
@@ -112,7 +112,7 @@ index 4f91e4832a94c3facbc711fcae4cb5ad540a5ca0..7d6fab994d1308cb83057cecfe3d837f
|
||||
public static final int UPDATE_NEIGHBORS = 1;
|
||||
public static final int UPDATE_CLIENTS = 2;
|
||||
public static final int UPDATE_INVISIBLE = 4;
|
||||
@@ -279,7 +282,7 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
@@ -277,7 +280,7 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
}
|
||||
|
||||
public static boolean isShapeFullBlock(VoxelShape shape) {
|
||||
@@ -13,10 +13,10 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
|
||||
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
index 7d6fab994d1308cb83057cecfe3d837f5063a5b1..52743a5865997506b5a53fdfd99cdbab67ae3d3f 100644
|
||||
index c4cff3592a39e519fc62664a21d368d8cac55271..e9d37ab8e2b072454c46d4520491beac5873a7ec 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
@@ -605,11 +605,18 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
@@ -593,11 +593,18 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
private final BlockState first;
|
||||
private final BlockState second;
|
||||
private final Direction direction;
|
||||
@@ -35,7 +35,7 @@ index 7d6fab994d1308cb83057cecfe3d837f5063a5b1..52743a5865997506b5a53fdfd99cdbab
|
||||
}
|
||||
|
||||
public boolean equals(Object object) {
|
||||
@@ -625,11 +632,7 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
@@ -613,11 +620,7 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
@@ -13,10 +13,10 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
|
||||
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 8e739f81455ef41502b195c360d2e4243c29cda4..765835fd7e05e20c6642171a2e431702eebf2835 100644
|
||||
index 1016a70c2b468463cb74aa6bbfe3aa65eb297786..da2b72bdcd2ec7e1992a828c4d5a543b113a2592 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -566,11 +566,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -584,11 +584,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
}
|
||||
|
||||
protected void tryAddFrost() {
|
||||
@@ -29,7 +29,7 @@ index 8e739f81455ef41502b195c360d2e4243c29cda4..765835fd7e05e20c6642171a2e431702
|
||||
|
||||
if (attributemodifiable == null) {
|
||||
return;
|
||||
@@ -580,7 +579,6 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -598,7 +597,6 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
|
||||
attributemodifiable.addTransientModifier(new AttributeModifier(LivingEntity.SPEED_MODIFIER_POWDER_SNOW_UUID, "Powder snow slow", (double) f, AttributeModifier.Operation.ADDITION));
|
||||
}
|
||||
@@ -213,7 +213,7 @@ index 0000000000000000000000000000000000000000..28ece835ca32532c8a3547e7b2122d20
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/util/BitStorage.java b/src/main/java/net/minecraft/util/BitStorage.java
|
||||
index 106610ccc74b70b557b01c61262d56c4f1147acf..ccf2a8544cf4cd1865d29b4e8cb8c058c74c7fe9 100644
|
||||
index 8bafd5fd7499ba4a04bf706cfd1e156073716e21..b7df9eac4ee23fa489368af82ec9c07dea6ebd75 100644
|
||||
--- a/src/main/java/net/minecraft/util/BitStorage.java
|
||||
+++ b/src/main/java/net/minecraft/util/BitStorage.java
|
||||
@@ -1,6 +1,7 @@
|
||||
@@ -232,7 +232,7 @@ index 106610ccc74b70b557b01c61262d56c4f1147acf..ccf2a8544cf4cd1865d29b4e8cb8c058
|
||||
+ <T> void compact(Palette<T> srcPalette, Palette<T> dstPalette, short[] out); // Gale - Lithium - faster chunk serialization
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/util/SimpleBitStorage.java b/src/main/java/net/minecraft/util/SimpleBitStorage.java
|
||||
index 36e33923bf48e56c743ed043bcbc66bc32f0422f..9c8b23640fa45764601242c9345071267795a17f 100644
|
||||
index e4d0d7e8fc58b8f9f614d74a141e452166e0364c..7a1e8033e561b14ca8f04d8888634e91eee32b06 100644
|
||||
--- a/src/main/java/net/minecraft/util/SimpleBitStorage.java
|
||||
+++ b/src/main/java/net/minecraft/util/SimpleBitStorage.java
|
||||
@@ -2,6 +2,7 @@ package net.minecraft.util;
|
||||
@@ -290,7 +290,7 @@ index 36e33923bf48e56c743ed043bcbc66bc32f0422f..9c8b23640fa45764601242c934507126
|
||||
+
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/util/ZeroBitStorage.java b/src/main/java/net/minecraft/util/ZeroBitStorage.java
|
||||
index 75ca7ae6028e971f73988f5e71598696c0765cc8..41e795b67a138dea11f6d0270e7c36072810ef21 100644
|
||||
index 79b223ef3c86f3bc035e9abd84aa080b5d722f61..81ed765bfe50e3e469abbcdb8633bdacd2adf8ba 100644
|
||||
--- a/src/main/java/net/minecraft/util/ZeroBitStorage.java
|
||||
+++ b/src/main/java/net/minecraft/util/ZeroBitStorage.java
|
||||
@@ -2,6 +2,7 @@ package net.minecraft.util;
|
||||
@@ -320,7 +320,7 @@ index acae3eb30e0689048937f479dc3070f0688abdad..4b79f0474a9013dd4fdb68c6363ca194
|
||||
int onResize(int newBits, T object);
|
||||
}
|
||||
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 7c770d131d39da6900fdd22df36707d5f43e8cd0..a5e8c6b99952e2d17831a9622c6f8e457e85cd35 100644
|
||||
index 7f5547dc31aa53b2863f4c09f598fa88e7fe2afd..3cc5ba11eaae07ac7725fd5bbbaa05fef7e7bf3c 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
|
||||
@@ -22,8 +22,25 @@ import net.minecraft.util.Mth;
|
||||
@@ -349,7 +349,7 @@ index 7c770d131d39da6900fdd22df36707d5f43e8cd0..a5e8c6b99952e2d17831a9622c6f8e45
|
||||
private static final int MIN_PALETTE_BITS = 0;
|
||||
private final PaletteResize<T> dummyPaletteResize = (newSize, added) -> {
|
||||
return 0;
|
||||
@@ -303,30 +320,54 @@ public class PalettedContainer<T> implements PaletteResize<T>, PalettedContainer
|
||||
@@ -301,30 +318,54 @@ public class PalettedContainer<T> implements PaletteResize<T>, PalettedContainer
|
||||
public synchronized PalettedContainerRO.PackedData<T> pack(IdMap<T> idList, PalettedContainer.Strategy paletteProvider) { // Paper - synchronize
|
||||
this.acquire();
|
||||
|
||||
@@ -421,7 +421,7 @@ index 7c770d131d39da6900fdd22df36707d5f43e8cd0..a5e8c6b99952e2d17831a9622c6f8e45
|
||||
}
|
||||
|
||||
private static <T> void swapPalette(int[] is, IntUnaryOperator applier) {
|
||||
@@ -366,17 +407,37 @@ public class PalettedContainer<T> implements PaletteResize<T>, PalettedContainer
|
||||
@@ -364,17 +405,37 @@ public class PalettedContainer<T> implements PaletteResize<T>, PalettedContainer
|
||||
|
||||
@Override
|
||||
public void count(PalettedContainer.CountConsumer<T> counter) {
|
||||
@@ -13,7 +13,7 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
|
||||
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/raid/Raid.java b/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
||||
index 879c3bb661e24b9682b654def57c2800f4f8ca92..01f10b57f0e8f82fa60641275a6a920bf67f74aa 100644
|
||||
index f7399737548483905f3b5c08a03876b0da54b714..596ec820ab77bb6486a9bea446989770b775d5a6 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
||||
@@ -107,6 +107,7 @@ public class Raid {
|
||||
@@ -26,7 +26,7 @@ index b8ef0f9c815799d54edcdb26dc0b4c1c281fc03e..9bec8e9e91676238b41d03d8044bfbb3
|
||||
private final ItemPredicate chest;
|
||||
private final ItemPredicate legs;
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/raid/Raid.java b/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
||||
index 01f10b57f0e8f82fa60641275a6a920bf67f74aa..246584452eb01b168d2372e1ccc4b357b63891df 100644
|
||||
index 596ec820ab77bb6486a9bea446989770b775d5a6..0db3cbcdbc7f73dd2c10bfb696209753fa33aa8d 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
||||
@@ -702,7 +702,7 @@ public class Raid {
|
||||
@@ -54,7 +54,7 @@ index 01f10b57f0e8f82fa60641275a6a920bf67f74aa..246584452eb01b168d2372e1ccc4b357
|
||||
public Raider getLeader(int wave) {
|
||||
return (Raider) this.groupToLeaderMap.get(wave);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/raid/Raider.java b/src/main/java/net/minecraft/world/entity/raid/Raider.java
|
||||
index 99e9d46d42ddd0b451c6aeb847f1b295ebe5c697..088b25457f058404bdb535c5369a903768da6457 100644
|
||||
index 57fdcdaf54fd1c92a6e51a3a81789029096e5abe..e9e984959e08c139c8f2b4b9611bdba345ca9a13 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/raid/Raider.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/raid/Raider.java
|
||||
@@ -47,7 +47,7 @@ public abstract class Raider extends PatrollingMonster {
|
||||
@@ -85,7 +85,7 @@ index 99e9d46d42ddd0b451c6aeb847f1b295ebe5c697..088b25457f058404bdb535c5369a9037
|
||||
if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPickupItemEvent(this, item, 0, false).isCancelled()) {
|
||||
return;
|
||||
@@ -322,7 +322,7 @@ public abstract class Raider extends PatrollingMonster {
|
||||
if (!this.mob.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) || !this.mob.canPickUpLoot()) return false; // Paper - respect game and entity rules for picking up items
|
||||
if (!this.mob.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) || !this.mob.canPickUpLoot()) return false; // Paper - respect game and entity rules for picking up items
|
||||
Raid raid = this.mob.getCurrentRaid();
|
||||
|
||||
- if (this.mob.hasActiveRaid() && !this.mob.getCurrentRaid().isOver() && this.mob.canBeLeader() && !ItemStack.matches(this.mob.getItemBySlot(EquipmentSlot.HEAD), Raid.getLeaderBannerInstance())) {
|
||||
@@ -13,7 +13,7 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
|
||||
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java b/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java
|
||||
index 0d8fd4eaf912eb4d40bb9f600dd2a8d5c21ab572..66205f6d99c629ce0e7e7d7b29394674bde115fb 100644
|
||||
index 58609a0911c4e32b6f80f050cd3d23f70ad75b1b..fc6f18f7606f6ede8264e0cf2d1ca60b03a7a364 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java
|
||||
@@ -62,12 +62,17 @@ public final class NoiseBasedChunkGenerator extends ChunkGenerator {
|
||||
@@ -35,7 +35,7 @@ index 0d8fd4eaf912eb4d40bb9f600dd2a8d5c21ab572..66205f6d99c629ce0e7e7d7b29394674
|
||||
});
|
||||
}
|
||||
|
||||
@@ -397,7 +402,7 @@ public final class NoiseBasedChunkGenerator extends ChunkGenerator {
|
||||
@@ -394,7 +399,7 @@ public final class NoiseBasedChunkGenerator extends ChunkGenerator {
|
||||
|
||||
@Override
|
||||
public int getSeaLevel() {
|
||||
@@ -212,10 +212,10 @@ index 75dc06a3041bfdfb08c914eb50cfa282ae9eb2fe..53b0519bbc5d52490040eaf0fe449648
|
||||
} else {
|
||||
brain.eraseMemory(MemoryModuleType.SECONDARY_JOB_SITE);
|
||||
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 cf865df0763ebbe9ebbe74f32b0863e2636de63f..583f8bbb242305bf1bf825e254209108fd323ad4 100644
|
||||
index 10749bebb1c94ec1a74bacdce3b9b7903d8c4322..ae3628efe7628427c53bb7d0f7fc6e457a511b94 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/npc/Villager.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java
|
||||
@@ -88,6 +88,7 @@ import net.minecraft.world.item.trading.MerchantOffers;
|
||||
@@ -89,6 +89,7 @@ import net.minecraft.world.item.trading.MerchantOffers;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.ServerLevelAccessor;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
@@ -223,18 +223,18 @@ index cf865df0763ebbe9ebbe74f32b0863e2636de63f..583f8bbb242305bf1bf825e254209108
|
||||
import org.slf4j.Logger;
|
||||
|
||||
// CraftBukkit start
|
||||
@@ -103,8 +104,9 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
||||
@@ -104,8 +105,9 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
||||
private static final EntityDataAccessor<VillagerData> DATA_VILLAGER_DATA = SynchedEntityData.defineId(Villager.class, EntityDataSerializers.VILLAGER_DATA);
|
||||
public static final int BREEDING_FOOD_THRESHOLD = 12;
|
||||
public static final Map<Item, Integer> FOOD_POINTS = ImmutableMap.of(Items.BREAD, 4, Items.POTATO, 1, Items.CARROT, 1, Items.BEETROOT, 1);
|
||||
+ public static final Item[] FOOD_POINTS_KEY_ARRAY = FOOD_POINTS.keySet().toArray(Item[]::new); // Gale - optimize villager data storage
|
||||
private static final int TRADES_PER_LEVEL = 2;
|
||||
- private static final Set<Item> WANTED_ITEMS = ImmutableSet.of(Items.BREAD, Items.POTATO, Items.CARROT, Items.WHEAT, Items.WHEAT_SEEDS, Items.BEETROOT, new Item[]{Items.BEETROOT_SEEDS});
|
||||
+ private static final Item[] WANTED_ITEMS = {Items.BREAD, Items.POTATO, Items.CARROT, Items.WHEAT, Items.WHEAT_SEEDS, Items.BEETROOT, Items.BEETROOT_SEEDS}; // Gale - optimize villager data storage
|
||||
- private static final Set<Item> WANTED_ITEMS = ImmutableSet.of(Items.BREAD, Items.POTATO, Items.CARROT, Items.WHEAT, Items.WHEAT_SEEDS, Items.BEETROOT, new Item[]{Items.BEETROOT_SEEDS, Items.TORCHFLOWER_SEEDS, Items.PITCHER_POD});
|
||||
+ private static final Item[] WANTED_ITEMS = {Items.BREAD, Items.POTATO, Items.CARROT, Items.WHEAT, Items.WHEAT_SEEDS, Items.BEETROOT, Items.BEETROOT_SEEDS, Items.TORCHFLOWER_SEEDS, Items.PITCHER_POD}; // Gale - optimize villager data storage
|
||||
private static final int MAX_GOSSIP_TOPICS = 10;
|
||||
private static final int GOSSIP_COOLDOWN = 1200;
|
||||
private static final int GOSSIP_DECAY_INTERVAL = 24000;
|
||||
@@ -908,7 +910,28 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
||||
@@ -914,7 +916,28 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
||||
public boolean wantsToPickUp(ItemStack stack) {
|
||||
Item item = stack.getItem();
|
||||
|
||||
@@ -13,10 +13,10 @@ As part of: VMP (https://github.com/RelativityMC/VMP-fabric)
|
||||
Licensed under: MIT (https://opensource.org/licenses/MIT)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 6990b9cf582f32a9ec259f5641eb1d58ffff2a9d..a45081dc23e2602a1ee3fbc05dbae82085604449 100644
|
||||
index 220880d8a723724174fe948765e108ecaf24872b..88e414d74a6b144b7c3db5bcd3a3d9841b9c051d 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -300,6 +300,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -302,6 +302,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
public float yRotO;
|
||||
public float xRotO;
|
||||
private AABB bb;
|
||||
@@ -24,7 +24,7 @@ index 6990b9cf582f32a9ec259f5641eb1d58ffff2a9d..a45081dc23e2602a1ee3fbc05dbae820
|
||||
public boolean onGround;
|
||||
public boolean horizontalCollision;
|
||||
public boolean verticalCollision;
|
||||
@@ -1025,6 +1026,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -1076,6 +1077,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
// Paper end - detailed watchdog information
|
||||
|
||||
public void move(MoverType movementType, Vec3 movement) {
|
||||
@@ -36,7 +36,7 @@ index 6990b9cf582f32a9ec259f5641eb1d58ffff2a9d..a45081dc23e2602a1ee3fbc05dbae820
|
||||
// Paper start - detailed watchdog information
|
||||
io.papermc.paper.util.TickThread.ensureTickThread("Cannot move an entity off-main");
|
||||
synchronized (this.posLock) {
|
||||
@@ -3851,6 +3857,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -3980,6 +3986,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
}
|
||||
|
||||
public final void setBoundingBox(AABB boundingBox) {
|
||||
@@ -13,7 +13,7 @@ As part of: VMP (https://github.com/RelativityMC/VMP-fabric)
|
||||
Licensed under: MIT (https://opensource.org/licenses/MIT)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index 014ca25e17915d2a3a8e2a8d37265a4d7bc09d24..0a39aaf5bc54e1fb7fb4bada2a15fea9b73af731 100644
|
||||
index caa765c6264e14cc66973267f94074c7056fe122..780deea4805dfdd80d47e20ca1c2fcac17e5cabc 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -14,6 +14,7 @@ import com.mojang.datafixers.util.Either;
|
||||
@@ -24,7 +24,7 @@ index 014ca25e17915d2a3a8e2a8d37265a4d7bc09d24..0a39aaf5bc54e1fb7fb4bada2a15fea9
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||
import it.unimi.dsi.fastutil.longs.Long2ByteMap;
|
||||
@@ -297,7 +298,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -294,7 +295,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
// Paper - rewrite chunk system
|
||||
this.tickingGenerated = new AtomicInteger();
|
||||
this.playerMap = new PlayerMap();
|
||||
@@ -46,10 +46,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Sheep.java b/src/main/java/net/minecraft/world/entity/animal/Sheep.java
|
||||
index fb3777e158065a6ce306a2a6e66bec053da2aeb4..8b17dd156aa321686570da1e620107274adca56f 100644
|
||||
index c0e89262c596fbdd0bb3c3f76baccb17a1bb5fcd..d8f99e1221609d481ee79ee31f645731f34e1021 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Sheep.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Sheep.java
|
||||
@@ -391,7 +391,59 @@ public class Sheep extends Animal implements Shearable {
|
||||
@@ -392,7 +392,59 @@ public class Sheep extends Animal implements Shearable {
|
||||
return super.finalizeSpawn(world, difficulty, spawnReason, entityData, entityNbt);
|
||||
}
|
||||
|
||||
@@ -98,11 +98,11 @@ index fb3777e158065a6ce306a2a6e66bec053da2aeb4..8b17dd156aa321686570da1e62010727
|
||||
+
|
||||
private DyeColor getOffspringColor(Animal firstParent, Animal secondParent) {
|
||||
+ // Gale start - carpet-fixes - optimize sheep offspring color
|
||||
+ if (firstParent.level != null && firstParent.level.galeConfig().smallOptimizations.useOptimizedSheepOffspringColor) {
|
||||
+ if (firstParent.level() != null && firstParent.level().galeConfig().smallOptimizations.useOptimizedSheepOffspringColor) {
|
||||
+ DyeColor firstColor = ((Sheep)firstParent).getColor();
|
||||
+ DyeColor secondColor = ((Sheep)secondParent).getColor();
|
||||
+ DyeColor col = properDye(firstColor,secondColor);
|
||||
+ if (col == null) col = this.level.random.nextBoolean() ? firstColor : secondColor;
|
||||
+ if (col == null) col = this.level().random.nextBoolean() ? firstColor : secondColor;
|
||||
+ return col;
|
||||
+ }
|
||||
+ // Gale end - carpet-fixes - optimize sheep offspring color
|
||||
@@ -13,13 +13,13 @@ As part of: Slice (https://github.com/Cryptite/Slice)
|
||||
Licensed under: MIT (https://opensource.org/licenses/MIT)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index a45081dc23e2602a1ee3fbc05dbae82085604449..275184f437b7bdb6035fc468dc4396b915af1d50 100644
|
||||
index 88e414d74a6b144b7c3db5bcd3a3d9841b9c051d..b30e7c2fe1d9247a3aa38e9d2b50f768181c26f8 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -872,7 +872,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -878,7 +878,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
|
||||
this.checkOutOfWorld();
|
||||
if (!this.level.isClientSide) {
|
||||
this.checkBelowWorld();
|
||||
if (!this.level().isClientSide) {
|
||||
+ // Gale start - Slice - hide flames on entities with fire resistance
|
||||
+ if (this instanceof net.minecraft.world.entity.LivingEntity livingEntity) {
|
||||
+ this.setSharedFlagOnFire(this.remainingFireTicks > 0 && (!this.level.galeConfig().gameplayMechanics.hideFlamesOnEntitiesWithFireResistance || !livingEntity.hasEffect(net.minecraft.world.effect.MobEffects.FIRE_RESISTANCE)));
|
||||
@@ -31,10 +31,10 @@ index a45081dc23e2602a1ee3fbc05dbae82085604449..275184f437b7bdb6035fc468dc4396b9
|
||||
|
||||
this.firstTick = false;
|
||||
diff --git a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
||||
index cdc53823b4903ab6a443a626503f62b732cc97cb..be1dc2ec007456f864941bf3e3d246610808888c 100644
|
||||
index 3ebd9c177453bf720c40c7f9d41e28a234c80467..4329d9bbfe002a4e505b0a2f13063aa8ca736f8f 100644
|
||||
--- a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
||||
+++ b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
||||
@@ -294,6 +294,7 @@ public class GaleWorldConfiguration extends ConfigurationPart {
|
||||
@@ -292,6 +292,7 @@ public class GaleWorldConfiguration extends ConfigurationPart {
|
||||
|
||||
public boolean entitiesCanEatBlocksInNonTickingChunks = false; // Gale - Purpur - prevent entities eating blocks in non-ticking chunks
|
||||
public boolean arrowMovementResetsDespawnCounter = true; // Gale - Purpur - make arrow movement resetting despawn counter configurable
|
||||
@@ -1,67 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
||||
Date: Wed, 30 Nov 2022 15:01:42 +0100
|
||||
Subject: [PATCH] Ignore durability change equipment updates
|
||||
|
||||
License: MIT (https://opensource.org/licenses/MIT)
|
||||
Gale - https://galemc.org
|
||||
|
||||
This patch is based on the following patch:
|
||||
"Ignore durability change equipment updates"
|
||||
By: Cryptite <cryptite@gmail.com>
|
||||
As part of: Slice (https://github.com/Cryptite/Slice)
|
||||
Licensed under: MIT (https://opensource.org/licenses/MIT)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 765835fd7e05e20c6642171a2e431702eebf2835..55489052b3472c43c71de3b5ec907f2526d81caf 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -3113,7 +3113,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
}
|
||||
|
||||
public boolean equipmentHasChanged(ItemStack stack, ItemStack stack2) {
|
||||
- return !ItemStack.matches(stack2, stack);
|
||||
+ return this.level.galeConfig().smallOptimizations.processFullEquipmentChangeIfOnlyDurabilityChanged ? !ItemStack.matches(stack2, stack) : !ItemStack.isSameIgnoreDurability(stack2, stack); // Gale - Slice - ignore durability change equipment updates
|
||||
}
|
||||
|
||||
private void handleHandSwap(Map<EquipmentSlot, ItemStack> equipmentChanges) {
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
index 29a11bbcab84e66cb8adf9df2ea9feef4da601e8..f2c3d0913ee37e4f2d5f409f47581be9d8b2fa3d 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
@@ -748,10 +748,22 @@ public final class ItemStack {
|
||||
return left == right ? true : (!left.isEmpty() && !right.isEmpty() ? left.sameItem(right) : false);
|
||||
}
|
||||
|
||||
+ // Gale start - Slice - ignore durability change equipment updates
|
||||
+ public static boolean isSameIgnoreDurability(ItemStack left, ItemStack right) {
|
||||
+ return left == right ? true : (!left.isEmpty() && !right.isEmpty() ? left.sameItemStackIgnoreDurability(right) : false);
|
||||
+ }
|
||||
+ // Gale end - Slice - ignore durability change equipment updates
|
||||
+
|
||||
public boolean sameItem(ItemStack stack) {
|
||||
return !stack.isEmpty() && this.is(stack.getItem());
|
||||
}
|
||||
|
||||
+ // Gale start - Slice - ignore durability change equipment updates
|
||||
+ public boolean sameItemStackIgnoreDurability(ItemStack stack) {
|
||||
+ return !this.isDamageableItem() ? this.sameItem(stack) : !stack.isEmpty() && this.is(stack.getItem());
|
||||
+ }
|
||||
+ // Gale end - Slice - ignore durability change equipment updates
|
||||
+
|
||||
public static boolean isSameItemSameTags(ItemStack stack, ItemStack otherStack) {
|
||||
return stack.is(otherStack.getItem()) && ItemStack.tagMatches(stack, otherStack);
|
||||
}
|
||||
diff --git a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
||||
index 3ebd9c177453bf720c40c7f9d41e28a234c80467..cdc53823b4903ab6a443a626503f62b732cc97cb 100644
|
||||
--- a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
||||
+++ b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
||||
@@ -62,6 +62,8 @@ public class GaleWorldConfiguration extends ConfigurationPart {
|
||||
public boolean useOptimizedSheepOffspringColor = true;
|
||||
// Gale end - carpet-fixes - optimize sheep offspring color
|
||||
|
||||
+ public boolean processFullEquipmentChangeIfOnlyDurabilityChanged = false; // Gale - Slice - ignore durability change equipment updates
|
||||
+
|
||||
// Gale start - Airplane - reduce projectile chunk loading
|
||||
public MaxProjectileChunkLoads maxProjectileChunkLoads;
|
||||
public class MaxProjectileChunkLoads extends ConfigurationPart {
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user