From d6e3522bf44b0d8be1d7916e6ca1a0786c8fbe0c Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Wed, 7 Jun 2023 19:12:38 -0700 Subject: [PATCH] signing off for now --- .../server/Add-API-for-resetting-a-single-score.patch | 0 .../server/Add-ItemFactory-getSpawnEgg-API.patch | 0 .../server/Add-Raw-Byte-Entity-Serialization.patch | 0 .../{unapplied => }/server/Add-critical-damage-API.patch | 8 ++++---- .../Add-isCollidable-methods-to-various-places.patch | 2 +- .../{unapplied => }/server/Add-more-advancement-API.patch | 0 .../Add-paper-mobcaps-and-paper-playermobcaps.patch | 2 +- ...ot-run-close-logic-for-inventories-on-chunk-unlo.patch | 0 .../server/Fix-GameProfileCache-concurrency.patch | 0 .../server/Fix-issues-with-mob-conversion.patch | 5 ++--- .../server/Get-entity-default-attributes.patch | 0 patches/{unapplied => }/server/Goat-ram-API.patch | 0 .../server/Improve-and-expand-AsyncCatcher.patch | 2 +- patches/{unapplied => }/server/Left-handed-API.patch | 0 .../server/Optimise-general-POI-access.patch | 4 ++-- .../server/Sanitize-ResourceLocation-error-logging.patch | 0 .../server/Vanilla-command-permission-fixes.patch | 0 17 files changed, 11 insertions(+), 12 deletions(-) rename patches/{unapplied => }/server/Add-API-for-resetting-a-single-score.patch (100%) rename patches/{unapplied => }/server/Add-ItemFactory-getSpawnEgg-API.patch (100%) rename patches/{unapplied => }/server/Add-Raw-Byte-Entity-Serialization.patch (100%) rename patches/{unapplied => }/server/Add-critical-damage-API.patch (93%) rename patches/{unapplied => }/server/Add-isCollidable-methods-to-various-places.patch (98%) rename patches/{unapplied => }/server/Add-more-advancement-API.patch (100%) rename patches/{unapplied => }/server/Add-paper-mobcaps-and-paper-playermobcaps.patch (99%) rename patches/{unapplied => }/server/Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch (100%) rename patches/{unapplied => }/server/Fix-GameProfileCache-concurrency.patch (100%) rename patches/{unapplied => }/server/Fix-issues-with-mob-conversion.patch (93%) rename patches/{unapplied => }/server/Get-entity-default-attributes.patch (100%) rename patches/{unapplied => }/server/Goat-ram-API.patch (100%) rename patches/{unapplied => }/server/Improve-and-expand-AsyncCatcher.patch (98%) rename patches/{unapplied => }/server/Left-handed-API.patch (100%) rename patches/{unapplied => }/server/Optimise-general-POI-access.patch (99%) rename patches/{unapplied => }/server/Sanitize-ResourceLocation-error-logging.patch (100%) rename patches/{unapplied => }/server/Vanilla-command-permission-fixes.patch (100%) diff --git a/patches/unapplied/server/Add-API-for-resetting-a-single-score.patch b/patches/server/Add-API-for-resetting-a-single-score.patch similarity index 100% rename from patches/unapplied/server/Add-API-for-resetting-a-single-score.patch rename to patches/server/Add-API-for-resetting-a-single-score.patch diff --git a/patches/unapplied/server/Add-ItemFactory-getSpawnEgg-API.patch b/patches/server/Add-ItemFactory-getSpawnEgg-API.patch similarity index 100% rename from patches/unapplied/server/Add-ItemFactory-getSpawnEgg-API.patch rename to patches/server/Add-ItemFactory-getSpawnEgg-API.patch diff --git a/patches/unapplied/server/Add-Raw-Byte-Entity-Serialization.patch b/patches/server/Add-Raw-Byte-Entity-Serialization.patch similarity index 100% rename from patches/unapplied/server/Add-Raw-Byte-Entity-Serialization.patch rename to patches/server/Add-Raw-Byte-Entity-Serialization.patch diff --git a/patches/unapplied/server/Add-critical-damage-API.patch b/patches/server/Add-critical-damage-API.patch similarity index 93% rename from patches/unapplied/server/Add-critical-damage-API.patch rename to patches/server/Add-critical-damage-API.patch index 38d42e0cd2..3544182693 100644 --- a/patches/unapplied/server/Add-critical-damage-API.patch +++ b/patches/server/Add-critical-damage-API.patch @@ -35,10 +35,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 flag1 = true; } -- boolean flag2 = flag && this.fallDistance > 0.0F && !this.onGround && !this.onClimbable() && !this.isInWater() && !this.hasEffect(MobEffects.BLINDNESS) && !this.isPassenger() && target instanceof LivingEntity; -+ boolean flag2 = flag && this.fallDistance > 0.0F && !this.onGround && !this.onClimbable() && !this.isInWater() && !this.hasEffect(MobEffects.BLINDNESS) && !this.isPassenger() && target instanceof LivingEntity; // Paper - Add critical damage API - conflict on change +- boolean flag2 = flag && this.fallDistance > 0.0F && !this.onGround() && !this.onClimbable() && !this.isInWater() && !this.hasEffect(MobEffects.BLINDNESS) && !this.isPassenger() && target instanceof LivingEntity; ++ boolean flag2 = flag && this.fallDistance > 0.0F && !this.onGround() && !this.onClimbable() && !this.isInWater() && !this.hasEffect(MobEffects.BLINDNESS) && !this.isPassenger() && target instanceof LivingEntity; // Paper - Add critical damage API - conflict on change - flag2 = flag2 && !level.paperConfig().entities.behavior.disablePlayerCrits; // Paper + flag2 = flag2 && !this.level().paperConfig().entities.behavior.disablePlayerCrits; // Paper flag2 = flag2 && !this.isSprinting(); @@ -0,0 +0,0 @@ public abstract class Player extends LivingEntity { } @@ -89,7 +89,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - return CraftEventFactory.callEntityDamageEvent(damager, entity, cause, modifiers, modifierFunctions, cancelled); + return CraftEventFactory.callEntityDamageEvent(damager, entity, cause, modifiers, modifierFunctions, cancelled, source.isCritical()); // Paper - add critical damage API - } else if (source.is(DamageTypes.OUT_OF_WORLD)) { + } else if (source.is(DamageTypes.FELL_OUT_OF_WORLD)) { EntityDamageEvent event = new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.VOID, modifiers, modifierFunctions); event.setCancelled(cancelled); @@ -0,0 +0,0 @@ public class CraftEventFactory { diff --git a/patches/unapplied/server/Add-isCollidable-methods-to-various-places.patch b/patches/server/Add-isCollidable-methods-to-various-places.patch similarity index 98% rename from patches/unapplied/server/Add-isCollidable-methods-to-various-places.patch rename to patches/server/Add-isCollidable-methods-to-various-places.patch index 3b1930c5b4..f90963e6f3 100644 --- a/patches/unapplied/server/Add-isCollidable-methods-to-various-places.patch +++ b/patches/server/Add-isCollidable-methods-to-various-places.patch @@ -12,7 +12,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java @@ -0,0 +0,0 @@ public class CraftBlock implements Block { public boolean isSolid() { - return getNMS().getMaterial().blocksMotion(); + return this.getNMS().blocksMotion(); } + + @Override diff --git a/patches/unapplied/server/Add-more-advancement-API.patch b/patches/server/Add-more-advancement-API.patch similarity index 100% rename from patches/unapplied/server/Add-more-advancement-API.patch rename to patches/server/Add-more-advancement-API.patch diff --git a/patches/unapplied/server/Add-paper-mobcaps-and-paper-playermobcaps.patch b/patches/server/Add-paper-mobcaps-and-paper-playermobcaps.patch similarity index 99% rename from patches/unapplied/server/Add-paper-mobcaps-and-paper-playermobcaps.patch rename to patches/server/Add-paper-mobcaps-and-paper-playermobcaps.patch index 58b49f9790..9d4befe257 100644 --- a/patches/unapplied/server/Add-paper-mobcaps-and-paper-playermobcaps.patch +++ b/patches/server/Add-paper-mobcaps-and-paper-playermobcaps.patch @@ -14,7 +14,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/io/papermc/paper/command/PaperCommand.java +++ b/src/main/java/io/papermc/paper/command/PaperCommand.java @@ -0,0 +0,0 @@ public final class PaperCommand extends Command { - commands.put(Set.of("debug", "chunkinfo", "holderinfo"), new ChunkDebugCommand()); + commands.put(Set.of("fixlight"), new FixLightCommand()); commands.put(Set.of("syncloadinfo"), new SyncLoadInfoCommand()); commands.put(Set.of("dumpitem"), new DumpItemCommand()); + commands.put(Set.of("mobcaps", "playermobcaps"), new MobcapsCommand()); diff --git a/patches/unapplied/server/Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch b/patches/server/Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch similarity index 100% rename from patches/unapplied/server/Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch rename to patches/server/Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch diff --git a/patches/unapplied/server/Fix-GameProfileCache-concurrency.patch b/patches/server/Fix-GameProfileCache-concurrency.patch similarity index 100% rename from patches/unapplied/server/Fix-GameProfileCache-concurrency.patch rename to patches/server/Fix-GameProfileCache-concurrency.patch diff --git a/patches/unapplied/server/Fix-issues-with-mob-conversion.patch b/patches/server/Fix-issues-with-mob-conversion.patch similarity index 93% rename from patches/unapplied/server/Fix-issues-with-mob-conversion.patch rename to patches/server/Fix-issues-with-mob-conversion.patch index d90549926d..506b425df0 100644 --- a/patches/unapplied/server/Fix-issues-with-mob-conversion.patch +++ b/patches/server/Fix-issues-with-mob-conversion.patch @@ -13,10 +13,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 protected void doFreezeConversion() { - this.convertTo(EntityType.STRAY, true, org.bukkit.event.entity.EntityTransformEvent.TransformReason.FROZEN, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.FROZEN); // CraftBukkit - add spawn and transform reasons -- if (!this.isSilent()) { + Stray stray = this.convertTo(EntityType.STRAY, true, org.bukkit.event.entity.EntityTransformEvent.TransformReason.FROZEN, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.FROZEN); // CraftBukkit - add spawn and transform reasons // Paper - track result of conversion -+ if (stray != null && !this.isSilent()) { // Paper - only send event if conversion succeeded - this.level.levelEvent((Player) null, 1048, this.blockPosition(), 0); + if (!this.isSilent()) { + this.level().levelEvent((Player) null, 1048, this.blockPosition(), 0); } + // Paper start - reset conversion time to prevent event spam + if (stray == null) { diff --git a/patches/unapplied/server/Get-entity-default-attributes.patch b/patches/server/Get-entity-default-attributes.patch similarity index 100% rename from patches/unapplied/server/Get-entity-default-attributes.patch rename to patches/server/Get-entity-default-attributes.patch diff --git a/patches/unapplied/server/Goat-ram-API.patch b/patches/server/Goat-ram-API.patch similarity index 100% rename from patches/unapplied/server/Goat-ram-API.patch rename to patches/server/Goat-ram-API.patch diff --git a/patches/unapplied/server/Improve-and-expand-AsyncCatcher.patch b/patches/server/Improve-and-expand-AsyncCatcher.patch similarity index 98% rename from patches/unapplied/server/Improve-and-expand-AsyncCatcher.patch rename to patches/server/Improve-and-expand-AsyncCatcher.patch index 8a77f0e125..9d3401ad10 100644 --- a/patches/unapplied/server/Improve-and-expand-AsyncCatcher.patch +++ b/patches/server/Improve-and-expand-AsyncCatcher.patch @@ -183,7 +183,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/org/spigotmc/AsyncCatcher.java @@ -0,0 +0,0 @@ public class AsyncCatcher { - if ( !io.papermc.paper.util.TickThread.isTickThread() ) // Paper // Paper - rewrite chunk system + if ( (AsyncCatcher.enabled || io.papermc.paper.util.TickThread.STRICT_THREAD_CHECKS) && Thread.currentThread() != MinecraftServer.getServer().serverThread ) // Paper { + MinecraftServer.LOGGER.error("Thread " + Thread.currentThread().getName() + " failed main thread check: " + reason, new Throwable()); // Paper throw new IllegalStateException( "Asynchronous " + reason + "!" ); diff --git a/patches/unapplied/server/Left-handed-API.patch b/patches/server/Left-handed-API.patch similarity index 100% rename from patches/unapplied/server/Left-handed-API.patch rename to patches/server/Left-handed-API.patch diff --git a/patches/unapplied/server/Optimise-general-POI-access.patch b/patches/server/Optimise-general-POI-access.patch similarity index 99% rename from patches/unapplied/server/Optimise-general-POI-access.patch rename to patches/server/Optimise-general-POI-access.patch index 5ef8bc2e7c..ab9192c929 100644 --- a/patches/unapplied/server/Optimise-general-POI-access.patch +++ b/patches/server/Optimise-general-POI-access.patch @@ -972,12 +972,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + private final Map, Set> byType = Maps.newHashMap(); public final Map, Set> getData() { return this.byType; } // Paper - public accessor private final Runnable setDirty; private boolean isValid; - public final Optional noAllocateOptional = Optional.of(this); // Paper - rewrite chunk system + diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java -@@ -0,0 +0,0 @@ public class SectionStorage extends RegionFileStorage implements AutoCloseabl +@@ -0,0 +0,0 @@ public class SectionStorage implements AutoCloseable { } @Nullable diff --git a/patches/unapplied/server/Sanitize-ResourceLocation-error-logging.patch b/patches/server/Sanitize-ResourceLocation-error-logging.patch similarity index 100% rename from patches/unapplied/server/Sanitize-ResourceLocation-error-logging.patch rename to patches/server/Sanitize-ResourceLocation-error-logging.patch diff --git a/patches/unapplied/server/Vanilla-command-permission-fixes.patch b/patches/server/Vanilla-command-permission-fixes.patch similarity index 100% rename from patches/unapplied/server/Vanilla-command-permission-fixes.patch rename to patches/server/Vanilla-command-permission-fixes.patch