Updated Upstream (Paper)

Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@4a903d81 Readd dropped diff
PaperMC/Paper@4fe0ac24 Some more comments
PaperMC/Paper@19a36413 Last per file patches
PaperMC/Paper@e49b5e88 Fix compile issues:
PaperMC/Paper@1b30919a Fix
PaperMC/Paper@df964545 Fixup whatever happened here
PaperMC/Paper@5933bd5b TrialSpawner compile fixes
PaperMC/Paper@20136f71 Some initial adoption of ValueInput/Output
PaperMC/Paper@a1bfc19a Some more compilation issues
PaperMC/Paper@d16b93e6 Generator
PaperMC/Paper@c34fb5f8 Test fixes
PaperMC/Paper@f3bad8c8 Prepare work on feature patches
PaperMC/Paper@ed3b39e9 14 first feature patches
PaperMC/Paper@ff05a2df Hacky EAR 2.0 fixes
This commit is contained in:
granny
2025-06-01 13:16:37 -07:00
parent cfd1e070a2
commit 994dd4f476
34 changed files with 128 additions and 238 deletions

View File

@@ -1,14 +1,6 @@
From 10208bcef5c949e133092f588296ebb6e22f36d8 Mon Sep 17 00:00:00 2001
From: File <noreply+automated@papermc.io>
Date: Sun, 20 Apr 1997 06:37:42 -0700
Subject: [PATCH] purpur File Patches
diff --git a/net/minecraft/world/entity/ExperienceOrb.java b/net/minecraft/world/entity/ExperienceOrb.java
index c97a0e500e889b406cb2d679a3870715775f5393..81aa1a91a2ecda3053b22c2eb9e59f0ea2faf7b5 100644
--- a/net/minecraft/world/entity/ExperienceOrb.java
+++ b/net/minecraft/world/entity/ExperienceOrb.java
@@ -328,7 +328,7 @@ public class ExperienceOrb extends Entity {
@@ -358,7 +_,7 @@
public void playerTouch(Player entity) {
if (entity instanceof ServerPlayer serverPlayer) {
if (entity.takeXpDelay == 0 && new com.destroystokyo.paper.event.player.PlayerPickupExperienceEvent(serverPlayer.getBukkitEntity(), (org.bukkit.entity.ExperienceOrb) this.getBukkitEntity()).callEvent()) { // Paper - PlayerPickupExperienceEvent
@@ -17,7 +9,7 @@ index c97a0e500e889b406cb2d679a3870715775f5393..81aa1a91a2ecda3053b22c2eb9e59f0e
entity.take(this, 1);
int i = this.repairPlayerItems(serverPlayer, this.getValue());
if (i > 0) {
@@ -344,7 +344,7 @@ public class ExperienceOrb extends Entity {
@@ -374,7 +_,7 @@
}
private int repairPlayerItems(ServerPlayer player, int value) {

View File

@@ -1,14 +1,6 @@
From 10208bcef5c949e133092f588296ebb6e22f36d8 Mon Sep 17 00:00:00 2001
From: File <noreply+automated@papermc.io>
Date: Sun, 20 Apr 1997 06:37:42 -0700
Subject: [PATCH] purpur File Patches
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
index ef92dc4384f698cc6b5c4e67fe052a3d4af98f4c..20d9856daa5ef4c42010381091c2a85e0755fa77 100644
--- a/net/minecraft/world/entity/LivingEntity.java
+++ b/net/minecraft/world/entity/LivingEntity.java
@@ -430,6 +430,12 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -444,6 +_,12 @@
if (d < 0.0) {
double damagePerBlock = serverLevel1.getWorldBorder().getDamagePerBlock();
if (damagePerBlock > 0.0) {
@@ -21,7 +13,7 @@ index ef92dc4384f698cc6b5c4e67fe052a3d4af98f4c..20d9856daa5ef4c42010381091c2a85e
this.hurtServer(serverLevel1, this.damageSources().outOfBorder(), Math.max(1, Mth.floor(-d * damagePerBlock)));
}
}
@@ -442,10 +448,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -456,10 +_,10 @@
&& (!flag || !((Player)this).getAbilities().invulnerable);
if (flag1) {
this.setAirSupply(this.decreaseAirSupply(this.getAirSupply()));
@@ -34,7 +26,7 @@ index ef92dc4384f698cc6b5c4e67fe052a3d4af98f4c..20d9856daa5ef4c42010381091c2a85e
}
} else if (this.getAirSupply() < this.getMaxAirSupply()) {
this.setAirSupply(this.increaseAirSupply(this.getAirSupply()));
@@ -1014,15 +1020,33 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -1039,14 +_,32 @@
if (lookingEntity != null) {
ItemStack itemBySlot = this.getItemBySlot(EquipmentSlot.HEAD);
EntityType<?> type = lookingEntity.getType();
@@ -44,13 +36,15 @@ index ef92dc4384f698cc6b5c4e67fe052a3d4af98f4c..20d9856daa5ef4c42010381091c2a85e
- || type == EntityType.PIGLIN_BRUTE && itemBySlot.is(Items.PIGLIN_HEAD)
- || type == EntityType.CREEPER && itemBySlot.is(Items.CREEPER_HEAD)) {
- d *= 0.5;
- }
- }
+ // Purpur start - Mob head visibility percent
+ if (type == EntityType.SKELETON && itemBySlot.is(Items.SKELETON_SKULL)) {
+ d *= lookingEntity.level().purpurConfig.skeletonHeadVisibilityPercent;
+ }
+ else if (type == EntityType.ZOMBIE && itemBySlot.is(Items.ZOMBIE_HEAD)) {
+ d *= lookingEntity.level().purpurConfig.zombieHeadVisibilityPercent;
}
+ }
+ else if ((type == EntityType.PIGLIN || type == EntityType.PIGLIN_BRUTE) && itemBySlot.is(Items.PIGLIN_HEAD)) {
+ d *= lookingEntity.level().purpurConfig.piglinHeadVisibilityPercent;
+ }
@@ -58,8 +52,8 @@ index ef92dc4384f698cc6b5c4e67fe052a3d4af98f4c..20d9856daa5ef4c42010381091c2a85e
+ d *= lookingEntity.level().purpurConfig.creeperHeadVisibilityPercent;
+ }
+ // Purpur end - Mob head visibility percent
}
+ }
+
+ // Purpur start - Configurable mob blindness
+ if (lookingEntity instanceof LivingEntity entityliving) {
+ if (entityliving.hasEffect(MobEffects.BLINDNESS)) {
@@ -70,11 +64,10 @@ index ef92dc4384f698cc6b5c4e67fe052a3d4af98f4c..20d9856daa5ef4c42010381091c2a85e
+ }
+ }
+ // Purpur end - Configurable mob blindness
+
return d;
}
@@ -1068,6 +1092,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -1093,6 +_,7 @@
Iterator<MobEffectInstance> iterator = this.activeEffects.values().iterator();
while (iterator.hasNext()) {
MobEffectInstance effect = iterator.next();
@@ -82,7 +75,7 @@ index ef92dc4384f698cc6b5c4e67fe052a3d4af98f4c..20d9856daa5ef4c42010381091c2a85e
EntityPotionEffectEvent event = CraftEventFactory.callEntityPotionEffectChangeEvent(this, effect, null, cause, EntityPotionEffectEvent.Action.CLEARED);
if (event.isCancelled()) {
continue;
@@ -1385,6 +1410,24 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -1417,6 +_,24 @@
this.stopSleeping();
}
@@ -107,7 +100,7 @@ index ef92dc4384f698cc6b5c4e67fe052a3d4af98f4c..20d9856daa5ef4c42010381091c2a85e
this.noActionTime = 0;
if (amount < 0.0F) {
amount = 0.0F;
@@ -1646,10 +1689,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -1678,10 +_,10 @@
protected Player resolvePlayerResponsibleForDamage(DamageSource damageSource) {
Entity entity = damageSource.getEntity();
if (entity instanceof Player player) {
@@ -120,7 +113,7 @@ index ef92dc4384f698cc6b5c4e67fe052a3d4af98f4c..20d9856daa5ef4c42010381091c2a85e
} else {
this.lastHurtByPlayer = null;
this.lastHurtByPlayerMemoryTime = 0;
@@ -1700,6 +1743,18 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -1732,6 +_,18 @@
}
}
@@ -139,7 +132,7 @@ index ef92dc4384f698cc6b5c4e67fe052a3d4af98f4c..20d9856daa5ef4c42010381091c2a85e
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);
@@ -1875,6 +1930,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -1907,6 +_,7 @@
boolean flag = this.lastHurtByPlayerMemoryTime > 0;
this.dropEquipment(level); // CraftBukkit - from below
if (this.shouldDropLoot() && level.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) {
@@ -147,7 +140,7 @@ index ef92dc4384f698cc6b5c4e67fe052a3d4af98f4c..20d9856daa5ef4c42010381091c2a85e
this.dropFromLootTable(level, damageSource, flag);
// Paper start
final boolean prev = this.clearEquipmentSlots;
@@ -1883,6 +1939,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -1915,6 +_,7 @@
// Paper end
this.dropCustomDeathLoot(level, damageSource, flag);
this.clearEquipmentSlots = prev; // Paper
@@ -155,7 +148,7 @@ index ef92dc4384f698cc6b5c4e67fe052a3d4af98f4c..20d9856daa5ef4c42010381091c2a85e
}
// CraftBukkit start - Call death event // Paper start - call advancement triggers with correct entity equipment
@@ -3057,6 +3114,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -3109,6 +_,7 @@
float f = (float)(d * 10.0 - 3.0);
if (f > 0.0F) {
this.playSound(this.getFallDamageSound((int)f), 1.0F, 1.0F);
@@ -163,16 +156,16 @@ index ef92dc4384f698cc6b5c4e67fe052a3d4af98f4c..20d9856daa5ef4c42010381091c2a85e
this.hurt(this.damageSources().flyIntoWall(), f);
}
}
@@ -4452,6 +4510,12 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -4507,6 +_,12 @@
? slot == EquipmentSlot.MAINHAND && this.canUseSlot(EquipmentSlot.MAINHAND)
: slot == equippable.slot() && this.canUseSlot(equippable.slot()) && equippable.canBeEquippedBy(this.getType());
}
+
+ // Purpur start - Dispenser curse of binding protection
+ public @Nullable EquipmentSlot getEquipmentSlotForDispenserItem(ItemStack itemstack) {
+ return EnchantmentHelper.getItemEnchantmentLevel(net.minecraft.world.item.enchantment.Enchantments.BINDING_CURSE, itemstack) > 0 ? null : this.getEquipmentSlotForItem(itemstack);
+ }
+ // Purpur end - Dispenser curse of binding protection
+
private static SlotAccess createEquipmentSlotAccess(LivingEntity entity, EquipmentSlot slot) {
return slot != EquipmentSlot.HEAD && slot != EquipmentSlot.MAINHAND && slot != EquipmentSlot.OFFHAND
? SlotAccess.forEquipmentSlot(entity, slot, itemStack -> itemStack.isEmpty() || entity.getEquipmentSlotForItem(itemStack) == slot)

View File

@@ -1,14 +1,6 @@
From 10208bcef5c949e133092f588296ebb6e22f36d8 Mon Sep 17 00:00:00 2001
From: File <noreply+automated@papermc.io>
Date: Sun, 20 Apr 1997 06:37:42 -0700
Subject: [PATCH] purpur File Patches
diff --git a/net/minecraft/world/entity/item/ItemEntity.java b/net/minecraft/world/entity/item/ItemEntity.java
index 6c0ebfb2be4e8b884456a2aa3d5fdc87e45a0e3c..4ddf1cdf7a47bf06f95c5bfce8f3c4d035e87cfc 100644
--- a/net/minecraft/world/entity/item/ItemEntity.java
+++ b/net/minecraft/world/entity/item/ItemEntity.java
@@ -59,6 +59,12 @@ public class ItemEntity extends Entity implements TraceableEntity {
@@ -56,6 +_,12 @@
public boolean canMobPickup = true; // Paper - Item#canEntityPickup
private int despawnRate = -1; // Paper - Alternative item-despawn-rate
public net.kyori.adventure.util.TriState frictionState = net.kyori.adventure.util.TriState.NOT_SET; // Paper - Friction API
@@ -21,7 +13,7 @@ index 6c0ebfb2be4e8b884456a2aa3d5fdc87e45a0e3c..4ddf1cdf7a47bf06f95c5bfce8f3c4d0
public ItemEntity(EntityType<? extends ItemEntity> entityType, Level level) {
super(entityType, level);
@@ -344,7 +350,16 @@ public class ItemEntity extends Entity implements TraceableEntity {
@@ -334,7 +_,16 @@
@Override
public final boolean hurtServer(ServerLevel level, DamageSource damageSource, float amount) {
@@ -39,7 +31,7 @@ index 6c0ebfb2be4e8b884456a2aa3d5fdc87e45a0e3c..4ddf1cdf7a47bf06f95c5bfce8f3c4d0
return false;
} else if (!level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) && damageSource.getEntity() instanceof Mob) {
return false;
@@ -528,6 +543,12 @@ public class ItemEntity extends Entity implements TraceableEntity {
@@ -513,6 +_,12 @@
public void setItem(ItemStack stack) {
this.getEntityData().set(DATA_ITEM, stack);
this.despawnRate = this.level().paperConfig().entities.spawning.altItemDespawnRate.enabled ? this.level().paperConfig().entities.spawning.altItemDespawnRate.items.getOrDefault(stack.getItem(), this.level().spigotConfig.itemDespawnRate) : this.level().spigotConfig.itemDespawnRate; // Paper - Alternative item-despawn-rate

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/monster/Phantom.java
+++ b/net/minecraft/world/entity/monster/Phantom.java
@@ -169,7 +_,11 @@
@@ -174,7 +_,11 @@
ServerLevelAccessor level, DifficultyInstance difficulty, EntitySpawnReason spawnReason, @Nullable SpawnGroupData spawnGroupData
) {
this.anchorPoint = this.blockPosition().above(5);

View File

@@ -0,0 +1,143 @@
--- a/net/minecraft/world/entity/npc/Villager.java
+++ b/net/minecraft/world/entity/npc/Villager.java
@@ -179,6 +_,8 @@
MemoryModuleType.MEETING_POINT,
(villager, poiType) -> poiType.is(PoiTypes.MEETING)
);
+ private boolean isLobotomized = false; public boolean isLobotomized() { return this.isLobotomized; } // Purpur - Lobotomize stuck villagers
+ private int notLobotomizedCount = 0; // Purpur - Lobotomize stuck villagers
public Villager(EntityType<? extends Villager> entityType, Level level) {
this(entityType, level, VillagerType.PLAINS);
@@ -197,6 +_,57 @@
this.setVillagerData(this.getVillagerData().withType(villagerType).withProfession(level.registryAccess(), VillagerProfession.NONE));
}
+ // Purpur start - Allow leashing villagers
+ @Override
+ public boolean canBeLeashed() {
+ return level().purpurConfig.villagerCanBeLeashed;
+ }
+ // Purpur end - Allow leashing villagers
+
+ // Purpur start - Lobotomize stuck villagers
+ private boolean checkLobotomized() {
+ int interval = this.level().purpurConfig.villagerLobotomizeCheckInterval;
+ boolean shouldCheckForTradeLocked = this.level().purpurConfig.villagerLobotomizeWaitUntilTradeLocked;
+ if (this.notLobotomizedCount > 3) {
+ // check half as often if not lobotomized for the last 3+ consecutive checks
+ interval *= 2;
+ }
+ if (this.level().getGameTime() % interval == 0) {
+ // offset Y for short blocks like dirt_path/farmland
+ this.isLobotomized = !(shouldCheckForTradeLocked && this.getVillagerXp() == 0) && !canTravelFrom(BlockPos.containing(this.position().x, this.getBoundingBox().minY + 0.0625D, this.position().z));
+
+ if (this.isLobotomized) {
+ this.notLobotomizedCount = 0;
+ } else {
+ this.notLobotomizedCount++;
+ }
+ }
+ return this.isLobotomized;
+ }
+
+ private boolean canTravelFrom(BlockPos pos) {
+ return canTravelTo(pos.east()) || canTravelTo(pos.west()) || canTravelTo(pos.north()) || canTravelTo(pos.south());
+ }
+
+ private boolean canTravelTo(BlockPos pos) {
+ net.minecraft.world.level.block.state.BlockState state = this.level().getBlockStateIfLoaded(pos);
+ if (state == null) {
+ // chunk not loaded
+ return false;
+ }
+ net.minecraft.world.level.block.Block bottom = state.getBlock();
+ if (bottom instanceof net.minecraft.world.level.block.FenceBlock ||
+ bottom instanceof net.minecraft.world.level.block.FenceGateBlock ||
+ bottom instanceof net.minecraft.world.level.block.WallBlock) {
+ // bottom block is too tall to get over
+ return false;
+ }
+ net.minecraft.world.level.block.Block top = level().getBlockState(pos.above()).getBlock();
+ // only if both blocks have no collision
+ return !bottom.hasCollision && !top.hasCollision;
+ }
+ // Purpur end - Lobotomize stuck villagers
+
@Override
public Brain<Villager> getBrain() {
return (Brain<Villager>)super.getBrain();
@@ -293,11 +_,24 @@
// Paper start - EAR 2
this.customServerAiStep(level, false);
}
- protected void customServerAiStep(ServerLevel level, final boolean inactive) {
+ protected void customServerAiStep(ServerLevel level, boolean inactive) { // Purpur - Lobotomize stuck villagers - not final
// Paper end - EAR 2
ProfilerFiller profilerFiller = Profiler.get();
profilerFiller.push("villagerBrain");
- if (!inactive) this.getBrain().tick(level, this); // Paper - EAR 2
+ // Purpur start - Lobotomize stuck villagers
+ if (this.level().purpurConfig.villagerLobotomizeEnabled) {
+ // treat as inactive if lobotomized
+ inactive = inactive || checkLobotomized();
+ } else {
+ this.isLobotomized = false;
+ }
+ // Purpur end - Lobotomize stuck villagers
+ // Pufferfish start
+ if (!inactive /*&& this.behaviorTick++ % this.activatedPriority == 0*/) {
+ this.getBrain().tick(level, this); // Paper - EAR 2
+ }
+ else if (this.isLobotomized && shouldRestock()) restock(); // Purpur - Lobotomize stuck villagers
+ // Pufferfish end
profilerFiller.pop();
if (this.assignProfessionWhenSpawned) {
this.assignProfessionWhenSpawned = false;
@@ -369,6 +_,7 @@
return InteractionResult.CONSUME;
}
+ if (this.level().purpurConfig.villagerAllowTrading) // Purpur - Add config for villager trading
this.startTrading(player);
}
@@ -505,7 +_,7 @@
private void updateDemand() {
for (MerchantOffer merchantOffer : this.getOffers()) {
- merchantOffer.updateDemand();
+ merchantOffer.updateDemand(this.level().purpurConfig.villagerMinimumDemand); // Purpur - Configurable minimum demand for trades
}
}
@@ -698,7 +_,7 @@
@Override
public boolean canBreed() {
- return this.foodLevel + this.countFoodPointsInInventory() >= 12 && !this.isSleeping() && this.getAge() == 0;
+ return this.level().purpurConfig.villagerCanBreed && this.foodLevel + this.countFoodPointsInInventory() >= 12 && !this.isSleeping() && this.getAge() == 0; // Purpur - Configurable villager breeding
}
private boolean hungry() {
@@ -920,6 +_,7 @@
}
public void spawnGolemIfNeeded(ServerLevel serverLevel, long gameTime, int minVillagerAmount) {
+ if (serverLevel.purpurConfig.villagerSpawnIronGolemRadius > 0 && serverLevel.getEntitiesOfClass(net.minecraft.world.entity.animal.IronGolem.class, getBoundingBox().inflate(serverLevel.purpurConfig.villagerSpawnIronGolemRadius)).size() > serverLevel.purpurConfig.villagerSpawnIronGolemLimit) return; // Purpur - Implement configurable search radius for villagers to spawn iron golems
if (this.wantsToSpawnGolem(gameTime)) {
AABB aabb = this.getBoundingBox().inflate(10.0, 10.0, 10.0);
List<Villager> entitiesOfClass = serverLevel.getEntitiesOfClass(Villager.class, aabb);
@@ -993,6 +_,12 @@
@Override
public void startSleeping(BlockPos pos) {
+ // Purpur start - Option for beds to explode on villager sleep
+ if (level().purpurConfig.bedExplodeOnVillagerSleep && this.level().getBlockState(pos).getBlock() instanceof net.minecraft.world.level.block.BedBlock) {
+ this.level().explode(null, (double) pos.getX() + 0.5D, (double) pos.getY() + 0.5D, (double) pos.getZ() + 0.5D, (float) this.level().purpurConfig.bedExplosionPower, this.level().purpurConfig.bedExplosionFire, this.level().purpurConfig.bedExplosionEffect);
+ return;
+ }
+ // Purpur end - Option for beds to explode on villager sleep
super.startSleeping(pos);
this.brain.setMemory(MemoryModuleType.LAST_SLEPT, this.level().getGameTime());
this.brain.eraseMemory(MemoryModuleType.WALK_TARGET);

View File

@@ -1,14 +1,6 @@
From 10208bcef5c949e133092f588296ebb6e22f36d8 Mon Sep 17 00:00:00 2001
From: File <noreply+automated@papermc.io>
Date: Sun, 20 Apr 1997 06:37:42 -0700
Subject: [PATCH] purpur File Patches
diff --git a/net/minecraft/world/entity/player/Player.java b/net/minecraft/world/entity/player/Player.java
index 248ee263a853d1d3148746a63ba422115853f6a1..bd4d3a920e015db49436336cc180bc0b937750a0 100644
--- a/net/minecraft/world/entity/player/Player.java
+++ b/net/minecraft/world/entity/player/Player.java
@@ -210,11 +210,20 @@ public abstract class Player extends LivingEntity {
@@ -219,11 +_,20 @@
private int currentImpulseContextResetGraceTime = 0;
public boolean affectsSpawning = true; // Paper - Affects Spawning API
public net.kyori.adventure.util.TriState flyingFallDamage = net.kyori.adventure.util.TriState.NOT_SET; // Paper - flying fall damage
@@ -29,7 +21,7 @@ index 248ee263a853d1d3148746a63ba422115853f6a1..bd4d3a920e015db49436336cc180bc0b
@Override
public org.bukkit.craftbukkit.entity.CraftHumanEntity getBukkitEntity() {
return (org.bukkit.craftbukkit.entity.CraftHumanEntity) super.getBukkitEntity();
@@ -277,6 +286,12 @@ public abstract class Player extends LivingEntity {
@@ -287,6 +_,12 @@
@Override
public void tick() {
@@ -42,7 +34,7 @@ index 248ee263a853d1d3148746a63ba422115853f6a1..bd4d3a920e015db49436336cc180bc0b
this.noPhysics = this.isSpectator();
if (this.isSpectator() || this.isPassenger()) {
this.setOnGround(false);
@@ -355,6 +370,17 @@ public abstract class Player extends LivingEntity {
@@ -365,6 +_,17 @@
this.turtleHelmetTick();
}
@@ -60,7 +52,7 @@ index 248ee263a853d1d3148746a63ba422115853f6a1..bd4d3a920e015db49436336cc180bc0b
this.cooldowns.tick();
this.updatePlayerPose();
if (this.currentImpulseContextResetGraceTime > 0) {
@@ -620,7 +646,7 @@ public abstract class Player extends LivingEntity {
@@ -630,7 +_,7 @@
List<Entity> list = Lists.newArrayList();
for (Entity entity : entities) {
@@ -69,7 +61,7 @@ index 248ee263a853d1d3148746a63ba422115853f6a1..bd4d3a920e015db49436336cc180bc0b
list.add(entity);
} else if (!entity.isRemoved()) {
this.touch(entity);
@@ -1214,7 +1240,7 @@ public abstract class Player extends LivingEntity {
@@ -1226,7 +_,7 @@
flag2 = flag2 && !this.level().paperConfig().entities.behavior.disablePlayerCrits; // Paper - Toggleable player crits
if (flag2) {
damageSource = damageSource.critical(); // Paper - critical damage API
@@ -78,7 +70,7 @@ index 248ee263a853d1d3148746a63ba422115853f6a1..bd4d3a920e015db49436336cc180bc0b
}
float f2 = f + f1;
@@ -1811,7 +1837,23 @@ public abstract class Player extends LivingEntity {
@@ -1823,7 +_,23 @@
@Override
protected int getBaseExperienceReward(ServerLevel level) {
@@ -103,17 +95,17 @@ index 248ee263a853d1d3148746a63ba422115853f6a1..bd4d3a920e015db49436336cc180bc0b
}
@Override
@@ -1850,6 +1892,13 @@ public abstract class Player extends LivingEntity {
@@ -1861,6 +_,13 @@
public boolean addItem(ItemStack stack) {
return this.inventory.add(stack);
}
+
+ // Purpur start - Player ridable in water option
+ @Override
+ public boolean dismountsUnderwater() {
+ return !level().purpurConfig.playerRidableInWater;
+ }
+ // Purpur end - Player ridable in water option
+
public boolean setEntityOnShoulder(CompoundTag entityCompound) {
if (this.isPassenger() || !this.onGround() || this.isInWater() || this.isInPowderSnow) {
return false;

View File

@@ -1,14 +1,6 @@
From 10208bcef5c949e133092f588296ebb6e22f36d8 Mon Sep 17 00:00:00 2001
From: File <noreply+automated@papermc.io>
Date: Sun, 20 Apr 1997 06:37:42 -0700
Subject: [PATCH] purpur File Patches
diff --git a/net/minecraft/world/inventory/AnvilMenu.java b/net/minecraft/world/inventory/AnvilMenu.java
index 65c400444314049d5529f1f76d65fbd6b1ea7af2..bcffac9f7781ea489e8e4d778181b9ae2392590f 100644
--- a/net/minecraft/world/inventory/AnvilMenu.java
+++ b/net/minecraft/world/inventory/AnvilMenu.java
@@ -20,6 +20,12 @@ import net.minecraft.world.level.block.AnvilBlock;
@@ -21,6 +_,12 @@
import net.minecraft.world.level.block.state.BlockState;
import org.slf4j.Logger;
@@ -21,7 +13,7 @@ index 65c400444314049d5529f1f76d65fbd6b1ea7af2..bcffac9f7781ea489e8e4d778181b9ae
public class AnvilMenu extends ItemCombinerMenu {
public static final int INPUT_SLOT = 0;
public static final int ADDITIONAL_SLOT = 1;
@@ -49,6 +55,10 @@ public class AnvilMenu extends ItemCombinerMenu {
@@ -50,6 +_,10 @@
private org.bukkit.craftbukkit.inventory.view.CraftAnvilView bukkitEntity;
// CraftBukkit end
public boolean bypassEnchantmentLevelRestriction = false; // Paper - bypass anvil level restrictions
@@ -32,7 +24,7 @@ index 65c400444314049d5529f1f76d65fbd6b1ea7af2..bcffac9f7781ea489e8e4d778181b9ae
public AnvilMenu(int containerId, Inventory playerInventory) {
this(containerId, playerInventory, ContainerLevelAccess.NULL);
@@ -74,12 +84,17 @@ public class AnvilMenu extends ItemCombinerMenu {
@@ -75,12 +_,17 @@
@Override
protected boolean mayPickup(Player player, boolean hasStack) {
@@ -51,7 +43,7 @@ index 65c400444314049d5529f1f76d65fbd6b1ea7af2..bcffac9f7781ea489e8e4d778181b9ae
player.giveExperienceLevels(-this.cost.get());
}
@@ -126,13 +141,19 @@ public class AnvilMenu extends ItemCombinerMenu {
@@ -133,13 +_,19 @@
@Override
public void createResult() {
@@ -72,7 +64,7 @@ index 65c400444314049d5529f1f76d65fbd6b1ea7af2..bcffac9f7781ea489e8e4d778181b9ae
ItemStack itemStack = item.copy();
ItemStack item1 = this.inputSlots.getItem(1);
ItemEnchantments.Mutable mutable = new ItemEnchantments.Mutable(EnchantmentHelper.getEnchantmentsForCrafting(itemStack));
@@ -190,23 +211,34 @@ public class AnvilMenu extends ItemCombinerMenu {
@@ -197,23 +_,34 @@
int intValue = entry.getIntValue();
intValue = level == intValue ? intValue + 1 : Math.max(intValue, level);
Enchantment enchantment = holder.value();
@@ -111,7 +103,7 @@ index 65c400444314049d5529f1f76d65fbd6b1ea7af2..bcffac9f7781ea489e8e4d778181b9ae
intValue = enchantment.getMaxLevel();
}
@@ -235,6 +267,54 @@ public class AnvilMenu extends ItemCombinerMenu {
@@ -242,6 +_,54 @@
if (!this.itemName.equals(item.getHoverName().getString())) {
i1 = 1;
i += i1;
@@ -166,7 +158,7 @@ index 65c400444314049d5529f1f76d65fbd6b1ea7af2..bcffac9f7781ea489e8e4d778181b9ae
itemStack.set(DataComponents.CUSTOM_NAME, Component.literal(this.itemName));
}
} else if (item.has(DataComponents.CUSTOM_NAME)) {
@@ -259,6 +339,12 @@ public class AnvilMenu extends ItemCombinerMenu {
@@ -266,6 +_,12 @@
this.onlyRenaming = true;
}
@@ -179,7 +171,7 @@ index 65c400444314049d5529f1f76d65fbd6b1ea7af2..bcffac9f7781ea489e8e4d778181b9ae
if (this.cost.get() >= this.maximumRepairCost && !this.player.hasInfiniteMaterials()) { // CraftBukkit
itemStack = ItemStack.EMPTY;
}
@@ -279,6 +365,13 @@ public class AnvilMenu extends ItemCombinerMenu {
@@ -286,6 +_,13 @@
org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(this.getBukkitView(), itemStack); // CraftBukkit
this.broadcastChanges();
@@ -193,7 +185,7 @@ index 65c400444314049d5529f1f76d65fbd6b1ea7af2..bcffac9f7781ea489e8e4d778181b9ae
} else {
org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(this.getBukkitView(), ItemStack.EMPTY); // CraftBukkit
this.cost.set(AnvilMenu.DEFAULT_DENIED_COST); // CraftBukkit - use a variable for set a cost for denied item
@@ -287,7 +380,7 @@ public class AnvilMenu extends ItemCombinerMenu {
@@ -294,7 +_,7 @@
}
public static int calculateIncreasedRepairCost(int oldRepairCost) {

View File

@@ -9,9 +9,9 @@
// Paper start - Fire BlockExpEvent on grindstone use
org.bukkit.event.block.BlockExpEvent event = new org.bukkit.event.block.BlockExpEvent(org.bukkit.craftbukkit.block.CraftBlock.at(level, blockPos), this.getExperienceAmount(level));
event.callEvent();
- ExperienceOrb.award((ServerLevel) level, Vec3.atCenterOf(blockPos), event.getExpToDrop(), org.bukkit.entity.ExperienceOrb.SpawnReason.GRINDSTONE, player);
- ExperienceOrb.awardWithDirection((ServerLevel) level, Vec3.atCenterOf(blockPos), Vec3.ZERO, event.getExpToDrop(), org.bukkit.entity.ExperienceOrb.SpawnReason.GRINDSTONE, player, null);
+ org.purpurmc.purpur.event.inventory.GrindstoneTakeResultEvent grindstoneTakeResultEvent = new org.purpurmc.purpur.event.inventory.GrindstoneTakeResultEvent(player.getBukkitEntity(), getBukkitView(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemstack), event.getExpToDrop()); grindstoneTakeResultEvent.callEvent(); // Purpur - Grindstone API
+ ExperienceOrb.award((ServerLevel) level, Vec3.atCenterOf(blockPos), grindstoneTakeResultEvent.getExperienceAmount(), org.bukkit.entity.ExperienceOrb.SpawnReason.GRINDSTONE, player); // Purpur - Grindstone API
+ ExperienceOrb.awardWithDirection((ServerLevel) level, Vec3.atCenterOf(blockPos), Vec3.ZERO, grindstoneTakeResultEvent.getExperienceAmount(), org.bukkit.entity.ExperienceOrb.SpawnReason.GRINDSTONE, player, null); // Purpur - Grindstone API
// Paper end - Fire BlockExpEvent on grindstone use
}

View File

@@ -1,14 +1,6 @@
From 10208bcef5c949e133092f588296ebb6e22f36d8 Mon Sep 17 00:00:00 2001
From: File <noreply+automated@papermc.io>
Date: Sun, 20 Apr 1997 06:37:42 -0700
Subject: [PATCH] purpur File Patches
diff --git a/net/minecraft/world/level/BaseSpawner.java b/net/minecraft/world/level/BaseSpawner.java
index 650ebce14d618076cec2066d134d2ae51a87076a..0babc951d9fed6d32d3dba549cc5ced4dc6b0588 100644
--- a/net/minecraft/world/level/BaseSpawner.java
+++ b/net/minecraft/world/level/BaseSpawner.java
@@ -54,6 +54,7 @@ public abstract class BaseSpawner {
@@ -61,6 +_,7 @@
}
public boolean isNearPlayer(Level level, BlockPos pos) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/level/Level.java
+++ b/net/minecraft/world/level/Level.java
@@ -152,11 +_,55 @@
@@ -159,11 +_,55 @@
}
// Paper end - add paper world config
@@ -56,7 +56,7 @@
public CraftWorld getWorld() {
return this.world;
}
@@ -199,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 = generator;
this.world = new CraftWorld((ServerLevel) this, generator, biomeProvider, environment);
@@ -1407,4 +_,14 @@
@@ -1417,4 +_,14 @@
return this.id;
}
}

View File

@@ -0,0 +1,11 @@
--- a/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
+++ b/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
@@ -49,7 +_,7 @@
// Paper start
private static void printOversizedLog(String msg, Path file, int x, int z) {
- org.apache.logging.log4j.LogManager.getLogger().fatal(msg + " (" + file.toString().replaceAll(".+[\\\\/]", "") + " - " + x + "," + z + ") Go clean it up to remove this message. /minecraft:tp " + (x<<4)+" 128 "+(z<<4) + " - DO NOT REPORT THIS TO PAPER - You may ask for help on Discord, but do not file an issue. These error messages can not be removed.");
+ org.apache.logging.log4j.LogManager.getLogger().fatal(msg + " (" + file.toString().replaceAll(".+[\\\\/]", "") + " - " + x + "," + z + ") Go clean it up to remove this message. /minecraft:tp " + (x<<4)+" 128 "+(z<<4) + " - DO NOT REPORT THIS TO PURPUR - You may ask for help on Discord, but do not file an issue. These error messages can not be removed."); // Purpur - Rebrand
}
private static CompoundTag readOversizedChunk(RegionFile regionfile, ChunkPos chunkCoordinate) throws IOException {