Updated Upstream (Paper)

Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@7b66699b 26.2-rc-2
PaperMC/Paper@bb676e22 actual 26.2-rc-2
PaperMC/Paper@a737972b Fix isAllowedInPeaceful call
PaperMC/Paper@c35810c3 Update deps to match Vanilla
PaperMC/Paper@e5643cd4 Update Vex#getSummoner return type
PaperMC/Paper@e00936a3 [ci/skip] update log4j for the api
PaperMC/Paper@eb5df78f fix wither spawning parity and remove openSign var
PaperMC/Paper@d1aca9a6 Apply most remaining feature patches
This commit is contained in:
granny
2026-06-12 17:35:54 -07:00
parent 779f1f2613
commit 0c913568e6
42 changed files with 274 additions and 287 deletions

View File

@@ -3,12 +3,12 @@
@@ -165,6 +_,7 @@
SlotProvider,
DebugValueSource,
TypedInstance<EntityType<?>> {
TypedInstance<EntityType<?>>, ca.spottedleaf.moonrise.patches.chunk_system.entity.ChunkSystemEntity, ca.spottedleaf.moonrise.patches.entity_tracker.EntityTrackerEntity { // Paper - rewrite chunk system // Paper - optimise entity tracker
+ public static javax.script.ScriptEngine scriptEngine = new javax.script.ScriptEngineManager().getEngineByName("rhino"); // Purpur - Configurable entity base attributes
// CraftBukkit start
private static final int CURRENT_LEVEL = 2;
static boolean isLevelAtLeast(ValueInput input, int level) {
@@ -341,8 +_,9 @@
@@ -297,8 +_,9 @@
public double xOld;
public double yOld;
public double zOld;
@@ -19,7 +19,7 @@
public int tickCount;
private int remainingFireTicks;
private final EntityFluidInteraction fluidInteraction = new EntityFluidInteraction(Set.of(FluidTags.WATER, FluidTags.LAVA));
@@ -375,8 +_,8 @@
@@ -331,8 +_,8 @@
public @Nullable PortalProcessor portalProcess;
public int portalCooldown;
private boolean invulnerable;
@@ -30,7 +30,7 @@
private boolean hasGlowingTag;
private final Set<String> tags = new io.papermc.paper.util.SizeLimitedSet<>(new it.unimi.dsi.fastutil.objects.ObjectOpenHashSet<>(), MAX_ENTITY_TAG_COUNT); // Paper - fully limit tag size - replace set impl
private final double[] pistonDeltas = new double[]{0.0, 0.0, 0.0};
@@ -427,6 +_,7 @@
@@ -382,6 +_,7 @@
private final int despawnTime; // Paper - entity despawn time limit
public int totalEntityAge; // Paper - age-like counter for all entities
public final io.papermc.paper.entity.activation.ActivationType activationType = io.papermc.paper.entity.activation.ActivationType.activationTypeFor(this); // Paper - EAR 2/tracking ranges
@@ -38,9 +38,9 @@
// Paper start - EAR 2
public final boolean defaultActivationState;
public long activatedTick = Integer.MIN_VALUE;
@@ -444,11 +_,23 @@
@@ -549,11 +_,23 @@
}
// Paper end
// Paper end - optimise entity tracker
+ // Purpur start - Add canSaveToDisk to Entity
+ public boolean canSaveToDisk() {
@@ -62,7 +62,7 @@
this.position = Vec3.ZERO;
this.blockPosition = BlockPos.ZERO;
this.chunkPosition = ChunkPos.ZERO;
@@ -850,6 +_,7 @@
@@ -955,6 +_,7 @@
&& this.level.paperConfig().environment.netherCeilingVoidDamageHeight.test(v -> this.getY() >= v)
&& (!(this instanceof Player player) || !player.getAbilities().invulnerable))) {
// Paper end - Configurable nether ceiling damage
@@ -70,7 +70,7 @@
this.onBelowWorld();
}
}
@@ -1945,7 +_,7 @@
@@ -2092,7 +_,7 @@
}
public boolean fireImmune() {
@@ -79,7 +79,7 @@
}
public boolean causeFallDamage(final double fallDistance, final float damageModifier, final DamageSource damageSource) {
@@ -2531,7 +_,7 @@
@@ -2682,7 +_,7 @@
output.putBoolean("Bukkit.invisible", this.persistentInvisibility);
}
// SPIGOT-6907: re-implement LivingEntity#setMaximumAir()
@@ -88,7 +88,7 @@
output.putInt("Bukkit.MaxAirSupply", this.getMaxAirSupply());
}
output.putInt("Spigot.ticksLived", this.totalEntityAge); // Paper
@@ -2617,6 +_,11 @@
@@ -2768,6 +_,11 @@
output.putBoolean("Paper.FreezeLock", true);
}
// Paper end
@@ -100,7 +100,7 @@
} catch (Throwable t) {
CrashReport report = CrashReport.forThrowable(t, "Saving entity NBT");
CrashReportCategory category = report.addCategory("Entity being saved");
@@ -2740,6 +_,9 @@
@@ -2891,6 +_,9 @@
}
freezeLocked = input.getBooleanOr("Paper.FreezeLock", false);
// Paper end
@@ -110,7 +110,7 @@
} catch (Throwable t) {
CrashReport report = CrashReport.forThrowable(t, "Loading entity NBT");
CrashReportCategory category = report.addCategory("Entity being loaded");
@@ -2916,6 +_,7 @@
@@ -3156,6 +_,7 @@
if (this.isAlive() && this instanceof Leashable leashable) {
if (leashable.getLeashHolder() == player) {
if (!this.level().isClientSide()) {
@@ -118,7 +118,7 @@
// Paper start - EntityUnleashEvent
if (!org.bukkit.craftbukkit.event.CraftEventFactory.handlePlayerUnleashEntityEvent(
leashable, player, hand, !player.hasInfiniteMaterials(), true
@@ -3323,15 +_,18 @@
@@ -3563,15 +_,18 @@
return Vec3.directionFromRotation(this.getRotationVector());
}
@@ -138,7 +138,7 @@
}
}
}
@@ -4065,7 +_,7 @@
@@ -4311,7 +_,7 @@
}
public boolean canUsePortal(final boolean ignorePassenger) {
@@ -147,7 +147,7 @@
}
public boolean canTeleport(final Level from, final Level to) {
@@ -4615,6 +_,12 @@
@@ -4863,6 +_,12 @@
return Mth.lerp(partial, this.yRotO, this.yRot);
}
@@ -160,7 +160,7 @@
public boolean touchingUnloadedChunk() {
AABB box = this.getBoundingBox().inflate(1.0);
int x0 = Mth.floor(box.minX);
@@ -4909,7 +_,7 @@
@@ -5166,7 +_,7 @@
}
public float maxUpStep() {

View File

@@ -105,7 +105,7 @@
if (damage < 0.0F) {
damage = 0.0F;
}
@@ -1724,10 +_,10 @@
@@ -1722,10 +_,10 @@
protected @Nullable Player resolvePlayerResponsibleForDamage(final DamageSource source) {
Entity sourceEntity = source.getEntity();
if (sourceEntity instanceof Player playerSource) {
@@ -118,7 +118,7 @@
} else {
this.lastHurtByPlayer = null;
this.lastHurtByPlayerMemoryTime = 0;
@@ -1779,6 +_,17 @@
@@ -1777,6 +_,17 @@
}
}
@@ -136,23 +136,18 @@
final org.bukkit.inventory.EquipmentSlot handSlot = (usedHand != null) ? org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(usedHand) : null;
final EntityResurrectEvent event = new EntityResurrectEvent((org.bukkit.entity.LivingEntity) this.getBukkitEntity(), handSlot);
event.setCancelled(protectionItem == null);
@@ -1956,6 +_,7 @@
@@ -1930,8 +_,10 @@
protected void dropAllDeathLoot(final ServerLevel level, final DamageSource source) {
boolean playerKilled = this.lastHurtByPlayerMemoryTime > 0;
this.dropEquipment(level); // CraftBukkit - from below
if (this.shouldDropLoot(level)) {
+ if (!(source.is(net.minecraft.world.damagesource.DamageTypes.CRAMMING) && level().purpurConfig.disableDropsOnCrammingDeath)) { // Purpur - Disable loot drops on death by cramming
this.dropFromLootTable(level, source, playerKilled);
// Paper start
final boolean prev = this.clearEquipmentSlots;
@@ -1964,6 +_,7 @@
// Paper end
this.dropCustomDeathLoot(level, source, playerKilled);
this.clearEquipmentSlots = prev; // Paper
+ } // Purpur - Disable loot drops on death by cramming
+ }
}
// CraftBukkit start - Call death event // Paper start - call advancement triggers with correct entity equipment
@@ -3323,6 +_,7 @@
this.dropEquipment(level);
@@ -3280,6 +_,7 @@
float dmg = (float)(diff * 10.0 - 3.0);
if (dmg > 0.0F) {
this.playSound(this.getFallDamageSound((int)dmg), 1.0F, 1.0F);
@@ -160,7 +155,7 @@
this.hurt(this.damageSources().flyIntoWall(), dmg);
}
}
@@ -4816,6 +_,12 @@
@@ -4773,6 +_,12 @@
? slot == EquipmentSlot.MAINHAND && this.canUseSlot(EquipmentSlot.MAINHAND)
: slot == equippable.slot() && this.canUseSlot(equippable.slot()) && equippable.canBeEquippedBy(this.typeHolder());
}

View File

@@ -61,7 +61,7 @@
// Paper start - allow changing despawnInPeaceful
this.despawnInPeacefulOverride = readDespawnInPeacefulOverride(input);
}
@@ -1289,7 +_,7 @@
@@ -1287,7 +_,7 @@
);
}
@@ -70,7 +70,7 @@
return groupData;
}
@@ -1646,6 +_,7 @@
@@ -1644,6 +_,7 @@
}
this.postPiercingAttack();

View File

@@ -1,11 +1,11 @@
--- a/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
+++ b/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
@@ -95,7 +_,7 @@
return true;
@@ -96,7 +_,7 @@
};
Set<Pair<Holder<PoiType>, BlockPos>> poiPositions = poiManager.findAllClosestFirstWithType(
- poiType, cacheTest, body.blockPosition(), SCAN_RANGE, PoiManager.Occupancy.HAS_SPACE
+ poiType, cacheTest, body.blockPosition(), level.purpurConfig.villagerAcquirePoiSearchRadius, PoiManager.Occupancy.HAS_SPACE // Purpur - Configurable villager search radius
)
.limit(5L)
.filter(px -> validPoi.test(level, (BlockPos)px.getSecond()))
// Paper start - optimise POI searches
java.util.List<Pair<Holder<PoiType>, BlockPos>> poiPositionsRaw = new java.util.ArrayList<>();
- ca.spottedleaf.moonrise.patches.poi_lookup.PoiAccess.findNearestPoiPositions(poiManager, poiType, cacheTest, body.blockPosition(), SCAN_RANGE, Double.MAX_VALUE, PoiManager.Occupancy.HAS_SPACE, ca.spottedleaf.moonrise.patches.poi_lookup.PoiAccess.LOAD_FOR_SEARCHING, 5, poiPositionsRaw);
+ ca.spottedleaf.moonrise.patches.poi_lookup.PoiAccess.findNearestPoiPositions(poiManager, poiType, cacheTest, body.blockPosition(), level.purpurConfig.villagerAcquirePoiSearchRadius, Double.MAX_VALUE, PoiManager.Occupancy.HAS_SPACE, ca.spottedleaf.moonrise.patches.poi_lookup.PoiAccess.LOAD_FOR_SEARCHING, 5, poiPositionsRaw); // Purpur - Configurable villager search radius
Set<Pair<Holder<PoiType>, BlockPos>> poiPositions = new java.util.HashSet<>(poiPositionsRaw.size());
for (Pair<Holder<PoiType>, BlockPos> pair : poiPositionsRaw) {
if (validPoi.test(level, pair.getSecond())) {

View File

@@ -20,10 +20,10 @@
}
@Override
@@ -722,6 +_,29 @@
return slot == EquipmentSlot.MAINHAND;
@@ -715,6 +_,29 @@
private boolean trusts(final LivingEntity entity) {
return this.getTrustedEntities().anyMatch(trusted -> trusted.matches(entity));
}
// Paper end
+
+ // Purpur start - Tulips change fox type
+ @Override
@@ -49,4 +49,4 @@
+ // Purpur end - Tulips change fox type
@Override
// Paper start - Cancellable death event
// Paper start - Fix MC-153010 (dropCustomDeathLoot is only called when shouldDropLoot = true)

View File

@@ -1,6 +1,15 @@
--- a/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
+++ b/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
@@ -968,6 +_,7 @@
@@ -615,7 +_,7 @@
}
int xpCount = 500;
- if (this.dragonFight != null && !this.dragonFight.hasPreviouslyKilledDragon()) {
+ if (this.dragonFight != null && (level().purpurConfig.enderDragonAlwaysDropsFullExp || !this.dragonFight.hasPreviouslyKilledDragon())) { // Purpur - Ender dragon always drop full exp
xpCount = 12000;
}
xpCount = this.expToDrop; // CraftBukkit - SPIGOT-2420: Moved up to #getExpReward method
@@ -960,6 +_,7 @@
@Override
protected boolean canRide(final Entity vehicle) {
@@ -8,12 +17,3 @@
return false;
}
@@ -1003,7 +_,7 @@
boolean shouldDrop = level.getGameRules().get(GameRules.MOB_DROPS);
int xpCount = 500;
- if (this.dragonFight != null && !this.dragonFight.hasPreviouslyKilledDragon()) {
+ if (this.dragonFight != null && (level().purpurConfig.enderDragonAlwaysDropsFullExp || !this.dragonFight.hasPreviouslyKilledDragon())) { // Purpur - Ender dragon always drop full exp
xpCount = 12000;
}

View File

@@ -14,7 +14,7 @@
}
public ArmorStand(final Level level, final double x, final double y, final double z) {
@@ -547,6 +_,7 @@
@@ -550,6 +_,7 @@
// Paper start - Allow ArmorStands not to tick
@Override
public void tick() {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/monster/piglin/Piglin.java
+++ b/net/minecraft/world/entity/monster/piglin/Piglin.java
@@ -182,6 +_,11 @@
@@ -183,6 +_,11 @@
public static boolean checkPiglinSpawnRules(
final EntityType<Piglin> type, final LevelAccessor level, final EntitySpawnReason spawnReason, final BlockPos pos, final RandomSource random
) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/monster/piglin/PiglinAi.java
+++ b/net/minecraft/world/entity/monster/piglin/PiglinAi.java
@@ -664,14 +_,24 @@
@@ -660,14 +_,24 @@
}
public static boolean isWearingSafeArmor(final LivingEntity livingEntity) {