mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@cc491a3 Finish updating chunk system patch PaperMC/Paper@619d7c9 Add in some patches PaperMC/Paper@902691b Apply last patch PaperMC/Paper@efb4197 Fix final compilation issues PaperMC/Paper@57a5924 Fix boot errors PaperMC/Paper@c1def9d Updated Upstream (CraftBukkit/Spigot) PaperMC/Paper@a0a2e72 fix sculk npe PaperMC/Paper@318a08c add missing block entity type to CraftBlockStates PaperMC/Paper@aed9ef0 Update adventure PaperMC/Paper@9d42879 Fix breaking pots throwing exception PaperMC/Paper@59060aa fix some failing tests PaperMC/Paper@e325e37 add missing call to EntityInsideBlockEvent PaperMC/Paper@8ce5219 Fix inconsistent chunk sending with vanilla PaperMC/Paper@04509f0 Fix crash relating to "Already sent chunk" PaperMC/Paper@c9eb393 Updated Upstream (Bukkit) PaperMC/Paper@21f2d15 Avoid duplicate poi entries from the first section (#9235) PaperMC/Paper@3621d76 Fix collision between AABB and a dot (#8733) PaperMC/Paper@ccb194b Move block farther away for Player#setRotation (#8514) PaperMC/Paper@03c3587 fix not editable sign after openSign PaperMC/Paper@6d74ad1 Finish tests & bad calls PaperMC/Paper@e829a9d Fix javadoc PaperMC/Paper@82c6479 Add back Anti-Xray patch (#9283) PaperMC/Paper@0d969f0 comment out update logic from build.gradle.kts PaperMC/Paper@ea9fdc3 Ignore inline definitions of trim material & pattern PaperMC/Paper@9ada4bd Prevent the rcon thread from attempting connections after shutdown PaperMC/Paper@c9e125f Fix setListenerRange for calibrated sculk sensors PaperMC/Paper@9ebf75d fix some more 1.20 tracking issues PaperMC/Paper@f9fc44f add side to PlayerSignCommandPreprocessEvent PaperMC/Paper@4e3febb fix missing trigger entity for xp orb from breeding PaperMC/Paper@4b5f847 Minimise EntityFertilizeEggEvent and add sniffer (#9280)
57 lines
4.1 KiB
Diff
57 lines
4.1 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: BillyGalbreath <Blake.Galbreath@Gmail.com>
|
|
Date: Mon, 10 Jan 2022 10:04:31 -0600
|
|
Subject: [PATCH] Configurable player pickup exp delay
|
|
|
|
Default vanilla value is to delay 2 ticks between picking up exp orbs.
|
|
Players only pick up 1 orb at a time, so even with setting this to 0
|
|
players still only pick up one orb every tick. However, setting this
|
|
to any negative number will pick up all orbs instantly.
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
|
|
index 2bd576849403bc2cfae298c2210616192ddc38db..b2233635b6acc35ea3668c36c56e57f15420ac62 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
|
|
@@ -313,7 +313,7 @@ public class ExperienceOrb extends Entity {
|
|
public void playerTouch(Player player) {
|
|
if (!this.level().isClientSide) {
|
|
if (player.takeXpDelay == 0 && new com.destroystokyo.paper.event.player.PlayerPickupExperienceEvent(((net.minecraft.server.level.ServerPlayer) player).getBukkitEntity(), (org.bukkit.entity.ExperienceOrb) this.getBukkitEntity()).callEvent()) { // Paper
|
|
- player.takeXpDelay = CraftEventFactory.callPlayerXpCooldownEvent(player, 2, PlayerExpCooldownChangeEvent.ChangeReason.PICKUP_ORB).getNewCooldown(); // CraftBukkit - entityhuman.takeXpDelay = 2;
|
|
+ player.takeXpDelay = CraftEventFactory.callPlayerXpCooldownEvent(player, this.level().purpurConfig.playerExpPickupDelay, PlayerExpCooldownChangeEvent.ChangeReason.PICKUP_ORB).getNewCooldown(); // CraftBukkit - entityhuman.takeXpDelay = 2; // Purpur
|
|
player.take(this, 1);
|
|
int i = this.repairPlayerItems(player, this.value);
|
|
|
|
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 0a9d8b22c7127b87826d9d256a5f36c34f2bfc0f..d00035e31cf4773a418d1cc6a6018d08e6b558f0 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
|
@@ -630,7 +630,7 @@ public abstract class Player extends LivingEntity {
|
|
for (int i = 0; i < list.size(); ++i) {
|
|
Entity entity = (Entity) list.get(i);
|
|
|
|
- if (entity.getType() == EntityType.EXPERIENCE_ORB) {
|
|
+ if (entity.getType() == EntityType.EXPERIENCE_ORB && entity.level().purpurConfig.playerExpPickupDelay >= 0) { // Purpur
|
|
list1.add(entity);
|
|
} else if (!entity.isRemoved()) {
|
|
this.touch(entity);
|
|
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
index d53a4fef85b4b0e43db8b655604cfc6c08e7c6d6..01b862bf567649a80efa487c9fdcea9436f884f8 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -426,6 +426,7 @@ public class PurpurWorldConfig {
|
|
public boolean playerRidableInWater = false;
|
|
public boolean playerRemoveBindingWithWeakness = false;
|
|
public int shiftRightClickRepairsMendingPoints = 0;
|
|
+ public int playerExpPickupDelay = 2;
|
|
private void playerSettings() {
|
|
if (PurpurConfig.version < 19) {
|
|
boolean oldVal = getBoolean("gameplay-mechanics.player.idle-timeout.mods-target", idleTimeoutTargetPlayer);
|
|
@@ -455,6 +456,7 @@ public class PurpurWorldConfig {
|
|
playerRidableInWater = getBoolean("gameplay-mechanics.player.ridable-in-water", playerRidableInWater);
|
|
playerRemoveBindingWithWeakness = getBoolean("gameplay-mechanics.player.curse-of-binding.remove-with-weakness", playerRemoveBindingWithWeakness);
|
|
shiftRightClickRepairsMendingPoints = getInt("gameplay-mechanics.player.shift-right-click-repairs-mending-points", shiftRightClickRepairsMendingPoints);
|
|
+ playerExpPickupDelay = getInt("gameplay-mechanics.player.exp-pickup-delay-ticks", playerExpPickupDelay);
|
|
}
|
|
|
|
private static boolean projectileDespawnRateSettingsMigrated = false;
|