Updated Upstream (Paper)

Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@fa0dd15d add missed nullability annotations
PaperMC/Paper@b6d70a9c Generators
PaperMC/Paper@b92137c1 load the PDC for new block entities
PaperMC/Paper@06a26ec2 update legacy test
PaperMC/Paper@c4f0b2b0 update more test
PaperMC/Paper@77382fcb fix unbreakable shields
PaperMC/Paper@9e08de6e Re-add old SmithingTrimRecipe constructors
PaperMC/Paper@d2afd149 Bump some more numbers to 1.21.5
PaperMC/Paper@cf1455e5 Ignore private methods in MaterialReroutingTest
PaperMC/Paper@ce91a8ca Move out unapplied feature patches
This commit is contained in:
granny
2025-03-27 16:40:47 -07:00
parent 73e0e17b6d
commit 4907125796
18 changed files with 74 additions and 72 deletions

View File

@@ -1,8 +1,8 @@
--- a/net/minecraft/core/BlockPos.java
+++ b/net/minecraft/core/BlockPos.java
@@ -61,6 +_,12 @@
private static final int X_OFFSET = PACKED_Y_LENGTH + PACKED_HORIZONTAL_LENGTH;
public static final int MAX_HORIZONTAL_COORDINATE = (1 << PACKED_HORIZONTAL_LENGTH) / 2 - 1;
@@ -63,6 +_,12 @@
public static final int MAX_HORIZONTAL_COORDINATE = 33554431;
// Paper end - Optimize Bit Operations by inlining
+ // Purpur start - Ridables
+ public BlockPos(net.minecraft.world.entity.Entity entity) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/level/ServerPlayerGameMode.java
+++ b/net/minecraft/server/level/ServerPlayerGameMode.java
@@ -347,6 +_,7 @@
@@ -348,6 +_,7 @@
}
return false;
}
@@ -8,7 +8,7 @@
}
// CraftBukkit end
@@ -460,6 +_,7 @@
@@ -461,6 +_,7 @@
public InteractionHand interactHand;
public ItemStack interactItemStack;
public InteractionResult useItemOn(ServerPlayer player, Level level, ItemStack stack, InteractionHand hand, BlockHitResult hitResult) {
@@ -16,7 +16,7 @@
BlockPos blockPos = hitResult.getBlockPos();
BlockState blockState = level.getBlockState(blockPos);
boolean cancelledBlock = false;
@@ -502,7 +_,7 @@
@@ -503,7 +_,7 @@
boolean flag = !player.getMainHandItem().isEmpty() || !player.getOffhandItem().isEmpty();
boolean flag1 = player.isSecondaryUseActive() && flag;
ItemStack itemStack = stack.copy();
@@ -25,7 +25,7 @@
InteractionResult interactionResult = blockState.useItemOn(player.getItemInHand(hand), level, player, hand, hitResult);
if (interactionResult.consumesAction()) {
CriteriaTriggers.ITEM_USED_ON_BLOCK.trigger(player, blockPos, itemStack);
@@ -548,4 +_,18 @@
@@ -549,4 +_,18 @@
public void setLevel(ServerLevel serverLevel) {
this.level = serverLevel;
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -308,7 +_,7 @@
@@ -306,7 +_,7 @@
ServerLoginPacketListenerImpl.LOGGER.warn("Failed to verify username but will let them in anyway!");
ServerLoginPacketListenerImpl.this.startClientVerification(ServerLoginPacketListenerImpl.this.createOfflineProfile(string1)); // Spigot
} else {

View File

@@ -8,7 +8,7 @@
// CraftBukkit start
private static final org.slf4j.Logger LOGGER = com.mojang.logging.LogUtils.getLogger();
private static final int CURRENT_LEVEL = 2;
@@ -303,8 +_,9 @@
@@ -304,8 +_,9 @@
public double xOld;
public double yOld;
public double zOld;
@@ -19,7 +19,7 @@
public int tickCount;
private int remainingFireTicks = -this.getFireImmuneTicks();
public boolean wasTouchingWater;
@@ -338,8 +_,8 @@
@@ -339,8 +_,8 @@
public 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};
@@ -393,6 +_,7 @@
@@ -394,6 +_,7 @@
public long activatedTick = Integer.MIN_VALUE;
public boolean isTemporarilyActive;
public long activatedImmunityTick = Integer.MIN_VALUE;
@@ -38,7 +38,7 @@
public void inactiveTick() {
}
@@ -405,10 +_,21 @@
@@ -406,10 +_,21 @@
}
// Paper end
@@ -60,7 +60,7 @@
this.position = Vec3.ZERO;
this.blockPosition = BlockPos.ZERO;
this.chunkPosition = ChunkPos.ZERO;
@@ -778,6 +_,7 @@
@@ -779,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
@@ -68,7 +68,7 @@
this.onBelowWorld();
}
}
@@ -1681,7 +_,7 @@
@@ -1682,7 +_,7 @@
}
public boolean fireImmune() {
@@ -77,7 +77,7 @@
}
public boolean causeFallDamage(double fallDistance, float damageMultiplier, DamageSource damageSource) {
@@ -1741,7 +_,7 @@
@@ -1742,7 +_,7 @@
return this.isInWater() || flag;
}
@@ -86,7 +86,7 @@
if (this.getVehicle() instanceof AbstractBoat abstractBoat && !abstractBoat.isUnderWater()) {
this.wasTouchingWater = false;
} else if (this.updateFluidHeightAndDoFluidPushing(FluidTags.WATER, 0.014)) {
@@ -2363,6 +_,13 @@
@@ -2364,6 +_,13 @@
compound.putBoolean("Paper.FreezeLock", true);
}
// Paper end
@@ -100,7 +100,7 @@
return compound;
} catch (Throwable var8) {
CrashReport crashReport = CrashReport.forThrowable(var8, "Saving entity NBT");
@@ -2480,6 +_,13 @@
@@ -2481,6 +_,13 @@
freezeLocked = compound.getBooleanOr("Paper.FreezeLock", false);
}
// Paper end
@@ -114,7 +114,7 @@
} catch (Throwable var8) {
CrashReport crashReport = CrashReport.forThrowable(var8, "Loading entity NBT");
CrashReportCategory crashReportCategory = crashReport.addCategory("Entity being loaded");
@@ -2619,6 +_,7 @@
@@ -2620,6 +_,7 @@
if (this.isAlive() && this instanceof Leashable leashable) {
if (leashable.getLeashHolder() == player) {
if (!this.level().isClientSide()) {
@@ -122,7 +122,7 @@
// CraftBukkit start - fire PlayerUnleashEntityEvent
// Paper start - Expand EntityUnleashEvent
org.bukkit.event.player.PlayerUnleashEntityEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerUnleashEntityEvent(this, player, hand, !player.hasInfiniteMaterials());
@@ -2935,15 +_,18 @@
@@ -2936,15 +_,18 @@
return Vec3.directionFromRotation(this.getRotationVector());
}
@@ -142,7 +142,7 @@
}
}
}
@@ -3148,7 +_,7 @@
@@ -3149,7 +_,7 @@
}
public int getMaxAirSupply() {
@@ -151,7 +151,7 @@
}
public int getAirSupply() {
@@ -3676,7 +_,7 @@
@@ -3677,7 +_,7 @@
// CraftBukkit end
public boolean canUsePortal(boolean allowPassengers) {
@@ -160,7 +160,7 @@
}
public boolean canTeleport(Level fromLevel, Level toLevel) {
@@ -4211,6 +_,12 @@
@@ -4212,6 +_,12 @@
return Mth.lerp(partialTick, this.yRotO, this.yRot);
}
@@ -173,7 +173,7 @@
public boolean updateFluidHeightAndDoFluidPushing(TagKey<Fluid> fluidTag, double motionScale) {
if (this.touchingUnloadedChunk()) {
return false;
@@ -4551,7 +_,7 @@
@@ -4552,7 +_,7 @@
}
public float maxUpStep() {

View File

@@ -100,7 +100,7 @@
this.noActionTime = 0;
if (amount < 0.0F) {
amount = 0.0F;
@@ -1647,10 +_,10 @@
@@ -1646,10 +_,10 @@
protected Player resolvePlayerResponsibleForDamage(DamageSource damageSource) {
Entity entity = damageSource.getEntity();
if (entity instanceof Player player) {
@@ -113,7 +113,7 @@
} else {
this.lastHurtByPlayer = null;
this.lastHurtByPlayerMemoryTime = 0;
@@ -1701,6 +_,18 @@
@@ -1700,6 +_,18 @@
}
}
@@ -132,7 +132,7 @@
final org.bukkit.inventory.EquipmentSlot handSlot = (hand != null) ? org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(hand) : null;
final EntityResurrectEvent event = new EntityResurrectEvent((org.bukkit.entity.LivingEntity) this.getBukkitEntity(), handSlot);
event.setCancelled(itemStack == null);
@@ -1876,6 +_,7 @@
@@ -1875,6 +_,7 @@
boolean flag = this.lastHurtByPlayerMemoryTime > 0;
this.dropEquipment(level); // CraftBukkit - from below
if (this.shouldDropLoot() && level.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) {
@@ -140,7 +140,7 @@
this.dropFromLootTable(level, damageSource, flag);
// Paper start
final boolean prev = this.clearEquipmentSlots;
@@ -1884,6 +_,7 @@
@@ -1883,6 +_,7 @@
// Paper end
this.dropCustomDeathLoot(level, damageSource, flag);
this.clearEquipmentSlots = prev; // Paper
@@ -148,7 +148,7 @@
}
// CraftBukkit start - Call death event // Paper start - call advancement triggers with correct entity equipment
@@ -3058,6 +_,7 @@
@@ -3057,6 +_,7 @@
float f = (float)(d * 10.0 - 3.0);
if (f > 0.0F) {
this.playSound(this.getFallDamageSound((int)f), 1.0F, 1.0F);
@@ -156,7 +156,7 @@
this.hurt(this.damageSources().flyIntoWall(), f);
}
}
@@ -4452,6 +_,12 @@
@@ -4451,6 +_,12 @@
? slot == EquipmentSlot.MAINHAND && this.canUseSlot(EquipmentSlot.MAINHAND)
: slot == equippable.slot() && this.canUseSlot(equippable.slot()) && equippable.canBeEquippedBy(this.getType());
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/level/Level.java
+++ b/net/minecraft/world/level/Level.java
@@ -158,11 +_,55 @@
@@ -159,11 +_,55 @@
}
// Paper end - add paper world config
@@ -56,7 +56,7 @@
public CraftWorld getWorld() {
return this.world;
}
@@ -205,6 +_,8 @@
@@ -207,6 +_,8 @@
) {
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) levelData).getLevelName()); // Spigot
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config
@@ -65,7 +65,7 @@
this.generator = gen;
this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env);
@@ -1409,4 +_,14 @@
@@ -1413,4 +_,14 @@
return this.id;
}
}