Archiviert
13
0

Some work on the ItemMend events

Dieser Commit ist enthalten in:
Bjarne Koll 2024-06-14 16:01:00 +02:00
Ursprung 69d1d0a4f4
Commit 547f09dfa0
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 27F6CCCF55D2EE62
40 geänderte Dateien mit 91 neuen und 92 gelöschten Zeilen

Datei anzeigen

@ -14,10 +14,10 @@ public net.minecraft.world.entity.ExperienceOrb durabilityToXp(I)I
public net.minecraft.world.entity.ExperienceOrb xpToDurability(I)I public net.minecraft.world.entity.ExperienceOrb xpToDurability(I)I
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 9eddc3ac16645e0a01cc5c2decc8e53f08e7e3dc..44529bfbf7ee1b03bc1f35c0f536fa36dd72b5d4 100644 index 9eddc3ac16645e0a01cc5c2decc8e53f08e7e3dc..aaef5693b044141d2aa8108b74b240903c64e6e6 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1637,7 +1637,38 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1637,7 +1637,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
@Override @Override
@ -36,12 +36,15 @@ index 9eddc3ac16645e0a01cc5c2decc8e53f08e7e3dc..44529bfbf7ee1b03bc1f35c0f536fa36
+ orb.spawnReason = org.bukkit.entity.ExperienceOrb.SpawnReason.CUSTOM; + orb.spawnReason = org.bukkit.entity.ExperienceOrb.SpawnReason.CUSTOM;
+ orb.setPosRaw(handle.getX(), handle.getY(), handle.getZ()); + orb.setPosRaw(handle.getX(), handle.getY(), handle.getZ());
+ +
+ int i = Math.min(orb.xpToDurability(amount), itemstack.getDamageValue()); + final int possibleDurabilityFromXp = net.minecraft.world.item.enchantment.EnchantmentHelper.modifyDurabilityToRepairFromXp(
+ org.bukkit.event.player.PlayerItemMendEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerItemMendEvent(handle, orb, itemstack, stackEntry.getKey(), i); + handle.serverLevel(), itemstack, amount
+ );
+ int i = Math.min(possibleDurabilityFromXp, itemstack.getDamageValue());
+ org.bukkit.event.player.PlayerItemMendEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerItemMendEvent(handle, orb, itemstack, stackEntry.get().inSlot(), i);
+ i = event.getRepairAmount(); + i = event.getRepairAmount();
+ orb.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DESPAWN); + orb.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DESPAWN);
+ if (!event.isCancelled()) { + if (!event.isCancelled()) {
+ amount -= orb.durabilityToXp(i); + amount -= i * amount / possibleDurabilityFromXp;
+ itemstack.setDamageValue(itemstack.getDamageValue() - i); + itemstack.setDamageValue(itemstack.getDamageValue() - i);
+ } + }
+ } + }

Datei anzeigen

@ -77,7 +77,7 @@ index 818df09e9245b5d89b4180b1eaa51470b7539341..461656e1cb095243bfe7a9ee2906e5b0
public Server getServer() { public Server getServer() {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 44529bfbf7ee1b03bc1f35c0f536fa36dd72b5d4..4220223a7282ab5588234497ef2d34128107676a 100644 index aaef5693b044141d2aa8108b74b240903c64e6e6..a6567aa9a3ec9dd17689e907131e5cca05da7c9d 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -249,11 +249,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -249,11 +249,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -92,7 +92,7 @@ index 44529bfbf7ee1b03bc1f35c0f536fa36dd72b5d4..4220223a7282ab5588234497ef2d3412
@Override @Override
public InetSocketAddress getAddress() { public InetSocketAddress getAddress() {
if (this.getHandle().connection.protocol() == null) return null; if (this.getHandle().connection.protocol() == null) return null;
@@ -1788,8 +1783,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1791,8 +1786,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
private void untrackAndHideEntity(org.bukkit.entity.Entity entity) { private void untrackAndHideEntity(org.bukkit.entity.Entity entity) {
// Remove this entity from the hidden player's EntityTrackerEntry // Remove this entity from the hidden player's EntityTrackerEntry
@ -109,7 +109,7 @@ index 44529bfbf7ee1b03bc1f35c0f536fa36dd72b5d4..4220223a7282ab5588234497ef2d3412
ChunkMap.TrackedEntity entry = tracker.entityMap.get(other.getId()); ChunkMap.TrackedEntity entry = tracker.entityMap.get(other.getId());
if (entry != null) { if (entry != null) {
entry.removePlayer(this.getHandle()); entry.removePlayer(this.getHandle());
@@ -1802,8 +1804,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1805,8 +1807,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.getHandle().connection.send(new ClientboundPlayerInfoRemovePacket(List.of(otherPlayer.getUUID()))); this.getHandle().connection.send(new ClientboundPlayerInfoRemovePacket(List.of(otherPlayer.getUUID())));
} }
} }
@ -118,7 +118,7 @@ index 44529bfbf7ee1b03bc1f35c0f536fa36dd72b5d4..4220223a7282ab5588234497ef2d3412
} }
void resetAndHideEntity(org.bukkit.entity.Entity entity) { void resetAndHideEntity(org.bukkit.entity.Entity entity) {
@@ -1868,12 +1868,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1871,12 +1871,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
private void trackAndShowEntity(org.bukkit.entity.Entity entity) { private void trackAndShowEntity(org.bukkit.entity.Entity entity) {
@ -144,7 +144,7 @@ index 44529bfbf7ee1b03bc1f35c0f536fa36dd72b5d4..4220223a7282ab5588234497ef2d3412
} }
ChunkMap.TrackedEntity entry = tracker.entityMap.get(other.getId()); ChunkMap.TrackedEntity entry = tracker.entityMap.get(other.getId());
@@ -1883,6 +1896,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1886,6 +1899,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.server.getPluginManager().callEvent(new PlayerShowEntityEvent(this, entity)); this.server.getPluginManager().callEvent(new PlayerShowEntityEvent(this, entity));
} }
@ -184,7 +184,7 @@ index 44529bfbf7ee1b03bc1f35c0f536fa36dd72b5d4..4220223a7282ab5588234497ef2d3412
void resetAndShowEntity(org.bukkit.entity.Entity entity) { void resetAndShowEntity(org.bukkit.entity.Entity entity) {
// SPIGOT-7312: Can't show/hide self // SPIGOT-7312: Can't show/hide self
@@ -1894,6 +1940,34 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1897,6 +1943,34 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.trackAndShowEntity(entity); this.trackAndShowEntity(entity);
} }
} }

Datei anzeigen

@ -9,7 +9,7 @@ e.g. servers which allow and support the usage of mod packs.
provide an optional flag to disable this check, at your own risk. provide an optional flag to disable this check, at your own risk.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 4220223a7282ab5588234497ef2d34128107676a..0c182241125d9583a4956eb5f05969243aa35acb 100644 index a6567aa9a3ec9dd17689e907131e5cca05da7c9d..27298cd0558b1ff2ab2ca341d62da2922507414b 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -209,6 +209,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -209,6 +209,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -20,7 +20,7 @@ index 4220223a7282ab5588234497ef2d34128107676a..0c182241125d9583a4956eb5f0596924
public CraftPlayer(CraftServer server, ServerPlayer entity) { public CraftPlayer(CraftServer server, ServerPlayer entity) {
super(server, entity); super(server, entity);
@@ -2265,7 +2266,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2268,7 +2269,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
public void addChannel(String channel) { public void addChannel(String channel) {

Datei anzeigen

@ -165,7 +165,7 @@ index dd3377a4f69e5ac10905e52d0eecc2427e72d856..c79607a2f45b7a487a95cf98b9b0eb6b
@Override @Override
public boolean isBlocking() { public boolean isBlocking() {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 0c182241125d9583a4956eb5f05969243aa35acb..a02bae1c51bd6583dfb2bdb07cc589827e3092ac 100644 index 27298cd0558b1ff2ab2ca341d62da2922507414b..38bc1747d2010b9233c64de81eb1c042bd1357b5 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1273,7 +1273,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1273,7 +1273,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Expose attack cooldown methods for Player
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index a02bae1c51bd6583dfb2bdb07cc589827e3092ac..55ccca419524fa74e8978962371d695b42b50d51 100644 index 38bc1747d2010b9233c64de81eb1c042bd1357b5..c0b92358c03d1724e8c134563f9ca98e69081c6a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2976,6 +2976,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2979,6 +2979,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return this.adventure$pointers; return this.adventure$pointers;
} }

Datei anzeigen

@ -423,10 +423,10 @@ index ee3902cbada46ffb78c42dbf6f00c859546c76e1..92bb0c63330ad3a4cb13b2dc65502071
// CraftBukkit end // CraftBukkit end
this.gameEvent(GameEvent.ENTITY_DIE); this.gameEvent(GameEvent.ENTITY_DIE);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 55ccca419524fa74e8978962371d695b42b50d51..0fb6c7b63ac15db4921e7c52f98c9070f403e4f3 100644 index c0b92358c03d1724e8c134563f9ca98e69081c6a..a33fc9288165ec013cef6b90d72871f0058c0857 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2513,7 +2513,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2516,7 +2516,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override @Override
public void sendHealthUpdate() { public void sendHealthUpdate() {
FoodData foodData = this.getHandle().getFoodData(); FoodData foodData = this.getHandle().getFoodData();

Datei anzeigen

@ -106,7 +106,7 @@ index 461656e1cb095243bfe7a9ee2906e5b00574ae78..411b280ac3e27e72091db813c0c9b69b
public Location getLastDeathLocation() { public Location getLastDeathLocation() {
if (this.getData().contains("LastDeathLocation", 10)) { if (this.getData().contains("LastDeathLocation", 10)) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 0fb6c7b63ac15db4921e7c52f98c9070f403e4f3..e5a3d0aa6e800007caea6b0c2ceffa473a40d080 100644 index a33fc9288165ec013cef6b90d72871f0058c0857..d649fd886faf0d4d989362c4ef0e9c50247c280f 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -210,6 +210,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -210,6 +210,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -117,7 +117,7 @@ index 0fb6c7b63ac15db4921e7c52f98c9070f403e4f3..e5a3d0aa6e800007caea6b0c2ceffa47
public CraftPlayer(CraftServer server, ServerPlayer entity) { public CraftPlayer(CraftServer server, ServerPlayer entity) {
super(server, entity); super(server, entity);
@@ -2045,6 +2046,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2048,6 +2049,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.firstPlayed = firstPlayed; this.firstPlayed = firstPlayed;
} }
@ -136,7 +136,7 @@ index 0fb6c7b63ac15db4921e7c52f98c9070f403e4f3..e5a3d0aa6e800007caea6b0c2ceffa47
public void readExtraData(CompoundTag nbttagcompound) { public void readExtraData(CompoundTag nbttagcompound) {
this.hasPlayedBefore = true; this.hasPlayedBefore = true;
if (nbttagcompound.contains("bukkit")) { if (nbttagcompound.contains("bukkit")) {
@@ -2067,6 +2080,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2070,6 +2083,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
public void setExtraData(CompoundTag nbttagcompound) { public void setExtraData(CompoundTag nbttagcompound) {
@ -145,7 +145,7 @@ index 0fb6c7b63ac15db4921e7c52f98c9070f403e4f3..e5a3d0aa6e800007caea6b0c2ceffa47
if (!nbttagcompound.contains("bukkit")) { if (!nbttagcompound.contains("bukkit")) {
nbttagcompound.put("bukkit", new CompoundTag()); nbttagcompound.put("bukkit", new CompoundTag());
} }
@@ -2081,6 +2096,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2084,6 +2099,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
data.putLong("firstPlayed", this.getFirstPlayed()); data.putLong("firstPlayed", this.getFirstPlayed());
data.putLong("lastPlayed", System.currentTimeMillis()); data.putLong("lastPlayed", System.currentTimeMillis());
data.putString("lastKnownName", handle.getScoreboardName()); data.putString("lastKnownName", handle.getScoreboardName());

Datei anzeigen

@ -8,7 +8,7 @@ We just add a check to ensure that the CraftPlayer's handle
is a ServerPlayer is a ServerPlayer
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index e5a3d0aa6e800007caea6b0c2ceffa473a40d080..70b1acee956247e80f7afdbe7cb91ff01a00af81 100644 index d649fd886faf0d4d989362c4ef0e9c50247c280f..a32a3e8aa5108f28f7bda637c50627afb59f7598 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -224,8 +224,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -224,8 +224,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -136,7 +136,7 @@ index a5291e17ab08d1ceeca0bb73f4c8fe433fcbd536..8110cdcdcf9513a71caae38abd235b69
this.adventure$locale = java.util.Objects.requireNonNullElse(net.kyori.adventure.translation.Translator.parseLocale(this.language), java.util.Locale.US); // Paper this.adventure$locale = java.util.Objects.requireNonNullElse(net.kyori.adventure.translation.Translator.parseLocale(this.language), java.util.Locale.US); // Paper
this.requestedViewDistance = clientOptions.viewDistance(); this.requestedViewDistance = clientOptions.viewDistance();
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 70b1acee956247e80f7afdbe7cb91ff01a00af81..490724ddb5fda7c7f0e1ba10d9be1457e3c51a53 100644 index a32a3e8aa5108f28f7bda637c50627afb59f7598..8865dabc729af78fcc306d48e754c54f80dfb2e4 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -653,6 +653,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -653,6 +653,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -57,10 +57,10 @@ index 2d1fad00ee084841618f0da8113c7aac8c0e2b0d..a3c67bdc2c08b3550534f37d15b0db90
} catch (Exception ex) { } catch (Exception ex) {
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex); ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 490724ddb5fda7c7f0e1ba10d9be1457e3c51a53..cbcca58a88b383435b949e0ee3e284635afcb5f1 100644 index 8865dabc729af78fcc306d48e754c54f80dfb2e4..74e40e74f95d366b508d6e746f3ed2710ab0613a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -3135,6 +3135,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -3138,6 +3138,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
// Paper end // Paper end
}; };

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Fix Player spawnParticle x/y/z precision loss
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index cbcca58a88b383435b949e0ee3e284635afcb5f1..057206959ba3f05bb4baad5ab5b1bd420dcf607b 100644 index 74e40e74f95d366b508d6e746f3ed2710ab0613a..803a1d9350276c44eef622436cc4026460436ae7 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2703,7 +2703,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2706,7 +2706,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override @Override
public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) { public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) {

Datei anzeigen

@ -32,7 +32,7 @@ index 5a709e301b336ee2fc62b422a2f3d878b81f9743..f9ecdb537b7cbf4a97888a88a61686d9
public boolean isWhiteListed(GameProfile profile) { public boolean isWhiteListed(GameProfile profile) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 057206959ba3f05bb4baad5ab5b1bd420dcf607b..f74a2808699824a4911363b9ab07eb4a93d8d111 100644 index 803a1d9350276c44eef622436cc4026460436ae7..6924bf3fad82cd055523af835a83aa0ca3490625 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -677,6 +677,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -677,6 +677,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -147,7 +147,7 @@ index 756be0985dad9cd52394ec0144be20d1d34f9d7a..644cf792a1d04b8674d54be627f1fafc
} }
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index f74a2808699824a4911363b9ab07eb4a93d8d111..d1c224a21aa707f4e2876d2dd70dbab767cd3afd 100644 index 6924bf3fad82cd055523af835a83aa0ca3490625..868c6f5ee5d67b92ad5834e05f9f1795cca879db 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1653,7 +1653,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1653,7 +1653,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -480,7 +480,7 @@ index f472dea0bd4f834c0c8f0aa59ae7cdae082b14af..2fa51c3a70f43cd23b8f494fc643d66c
} }
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index d1c224a21aa707f4e2876d2dd70dbab767cd3afd..9f9d6eb6f0d3f51b32a8232a16cd784268d2764a 100644 index 868c6f5ee5d67b92ad5834e05f9f1795cca879db..c8a4677db69b0f4111d550ca457b9196e7acebdd 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -635,7 +635,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -635,7 +635,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -187,7 +187,7 @@ index ba22ad1e4253477572d10d71db6db0ebc14d6755..94d067e9eeee73183de25165d8c97043
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 9f9d6eb6f0d3f51b32a8232a16cd784268d2764a..fe22b3e26498cb08cac1e461b6cb23b181788fb9 100644 index c8a4677db69b0f4111d550ca457b9196e7acebdd..d22990a2e7a1fcaf6e1f2d2f4856bd9b4b25aadb 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1412,9 +1412,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1412,9 +1412,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -24,7 +24,7 @@ index 926ff9be3d9e3f5d620e4c7ccb22b9f64865ff8c..1a37654aff9a9c86c9f7af10a1cf7213
buf.writeLong(this.sectionPos.asLong()); buf.writeLong(this.sectionPos.asLong());
buf.writeVarInt(this.positions.length); buf.writeVarInt(this.positions.length);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index fe22b3e26498cb08cac1e461b6cb23b181788fb9..f39c5c8e99671b6d36ffe118fa9d912eae72e7fc 100644 index d22990a2e7a1fcaf6e1f2d2f4856bd9b4b25aadb..240b00ac76d299994129724372d899427c9604c7 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -930,6 +930,32 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -930,6 +930,32 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -112,7 +112,7 @@ index 47f24e390efd8eb4cb7f62b5203825f4160772b7..243ac4253a1541dba52126bad96682e4
private final org.bukkit.entity.Entity.Spigot spigot = new org.bukkit.entity.Entity.Spigot() private final org.bukkit.entity.Entity.Spigot spigot = new org.bukkit.entity.Entity.Spigot()
{ {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index f39c5c8e99671b6d36ffe118fa9d912eae72e7fc..2951da226070e04b8bd28e1a2165db74321ebf87 100644 index 240b00ac76d299994129724372d899427c9604c7..d0005af63d4ae0081a39797cb62c5ff3e2efa537 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1286,13 +1286,101 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1286,13 +1286,101 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Custom Chat Completion Suggestions API
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 2951da226070e04b8bd28e1a2165db74321ebf87..4fe0a41729a07b3a36b81652f17f53e781850026 100644 index d0005af63d4ae0081a39797cb62c5ff3e2efa537..bffb3c029e917ccfc4b092a5d213a4d0f7a42ce4 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -691,6 +691,24 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -691,6 +691,24 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Elder Guardian appearance API
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 4fe0a41729a07b3a36b81652f17f53e781850026..27358c55ce2dcaeba41deac4b1bc1913ae95b8e3 100644 index bffb3c029e917ccfc4b092a5d213a4d0f7a42ce4..daa4aad117a6cf5f1e4e6da245e5c346122ac324 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -3294,6 +3294,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -3297,6 +3297,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
// Paper end // Paper end

Datei anzeigen

@ -10,10 +10,10 @@ public net.minecraft.world.entity.monster.warden.WardenSpawnTracker cooldownTick
public net.minecraft.world.entity.monster.warden.WardenSpawnTracker increaseWarningLevel()V public net.minecraft.world.entity.monster.warden.WardenSpawnTracker increaseWarningLevel()V
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 27358c55ce2dcaeba41deac4b1bc1913ae95b8e3..688fd24b4b43117173d034d1bcf2ffa2e08e4d1c 100644 index daa4aad117a6cf5f1e4e6da245e5c346122ac324..90ce5c386d46f10e14df67953938168c29d24c6a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -3299,6 +3299,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -3302,6 +3302,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public void showElderGuardian(boolean silent) { public void showElderGuardian(boolean silent) {
if (getHandle().connection != null) getHandle().connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.GUARDIAN_ELDER_EFFECT, silent ? 0F : 1F)); if (getHandle().connection != null) getHandle().connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.GUARDIAN_ELDER_EFFECT, silent ? 0F : 1F));
} }

Datei anzeigen

@ -6,7 +6,7 @@ Subject: [PATCH] fix Instruments
properly handle Player#playNote properly handle Player#playNote
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 688fd24b4b43117173d034d1bcf2ffa2e08e4d1c..869377713260cbaccf8cbcc98ef225d62f381495 100644 index 90ce5c386d46f10e14df67953938168c29d24c6a..6503bce4c0281619489adc01fa1da0c59b433875 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -768,7 +768,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -768,7 +768,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -26,10 +26,10 @@ index 4ff41cc3e2ff69c6f0c3cd7be3e22d6948010599..9706b0df7d0c617a181ba9f78b010e2e
} else { } else {
if (fallDistance >= 2.0F) { if (fallDistance >= 2.0F) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 869377713260cbaccf8cbcc98ef225d62f381495..38929c8a5e5304e9719c44fb7ac3353359a56602 100644 index 6503bce4c0281619489adc01fa1da0c59b433875..207e72cad59a07c0750e9303dd21519c83ab2358 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2577,6 +2577,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2580,6 +2580,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.getHandle().onUpdateAbilities(); this.getHandle().onUpdateAbilities();
} }

Datei anzeigen

@ -7,7 +7,7 @@ Subject: [PATCH] Win Screen API
public net.minecraft.server.level.ServerPlayer seenCredits public net.minecraft.server.level.ServerPlayer seenCredits
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 38929c8a5e5304e9719c44fb7ac3353359a56602..850994ea4e9eccb573ab7b6de1fac5edcbe8bbda 100644 index 207e72cad59a07c0750e9303dd21519c83ab2358..ee5d93cd0c7ea7376e8488265d4e21610edeedc2 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1305,6 +1305,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1305,6 +1305,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -5,55 +5,51 @@ Subject: [PATCH] Expand PlayerItemMendEvent
diff --git a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java diff --git a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
index a758b2456acac23095fe4619ae10300a034cb460..8eacfbc45f68fb01926c3e6363641dfbfd3eb16f 100644 index a758b2456acac23095fe4619ae10300a034cb460..15844971ce2cca8c679ad3aaa2dfe160e6d0b564 100644
--- a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java --- a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
+++ b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java +++ b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
@@ -351,19 +351,19 @@ public class ExperienceOrb extends Entity { @@ -354,7 +354,10 @@ public class ExperienceOrb extends Entity {
int j = EnchantmentHelper.modifyDurabilityToRepairFromXp(player.serverLevel(), itemstack, amount);
if (optional.isPresent()) { int k = Math.min(j, itemstack.getDamageValue());
ItemStack itemstack = ((EnchantedItemInUse) optional.get()).itemStack();
- int j = EnchantmentHelper.modifyDurabilityToRepairFromXp(player.serverLevel(), itemstack, amount);
- int k = Math.min(j, itemstack.getDamageValue());
+ int j = EnchantmentHelper.modifyDurabilityToRepairFromXp(player.serverLevel(), itemstack, amount);; int xpTranslatedToDurability = j; // Paper - mending event - obfhelper
+ int k = Math.min(j, itemstack.getDamageValue()); int durabilityToAddBack = k; // Paper - mending event - obfhelper
// CraftBukkit start // CraftBukkit start
- org.bukkit.event.player.PlayerItemMendEvent event = CraftEventFactory.callPlayerItemMendEvent(player, this, itemstack, optional.get().inSlot(), k); - org.bukkit.event.player.PlayerItemMendEvent event = CraftEventFactory.callPlayerItemMendEvent(player, this, itemstack, optional.get().inSlot(), k);
- k = event.getRepairAmount(); + // Paper start - mending event
+ org.bukkit.event.player.PlayerItemMendEvent event = CraftEventFactory.callPlayerItemMendEvent(player, this, itemstack, optional.get().inSlot(), durabilityToAddBack, d -> d * amount / xpTranslatedToDurability); // Paper - Expand PlayerItemMendEvent + final int consumedExperience = k * amount / j;
+ durabilityToAddBack = event.getRepairAmount(); // Paper - mending event - obfhelper + org.bukkit.event.player.PlayerItemMendEvent event = CraftEventFactory.callPlayerItemMendEvent(player, this, itemstack, optional.get().inSlot(), k, consumedExperience);
+ // Paper end - mending event
k = event.getRepairAmount();
if (event.isCancelled()) { if (event.isCancelled()) {
return amount; return amount;
} @@ -363,7 +366,7 @@ public class ExperienceOrb extends Entity {
// CraftBukkit end
- itemstack.setDamageValue(itemstack.getDamageValue() - k); itemstack.setDamageValue(itemstack.getDamageValue() - k);
+ itemstack.setDamageValue(itemstack.getDamageValue() - durabilityToAddBack); // Paper - mending event - obfhelper
if (k > 0) { if (k > 0) {
- int l = amount - k * amount / j; - int l = amount - k * amount / j;
+ int l = amount - event.getDurabilityToXpOperation().applyAsInt(durabilityToAddBack); // Paper - mending event - obfhelper + int l = amount - k * amount / j; // Paper - diff on change - expand PlayerMendEvents
if (l > 0) { if (l > 0) {
// this.value = l; // CraftBukkit - update exp value of orb for PlayerItemMendEvent calls // Paper - the value field should not be mutated here because it doesn't take "count" into account // this.value = l; // CraftBukkit - update exp value of orb for PlayerItemMendEvent calls // Paper - the value field should not be mutated here because it doesn't take "count" into account
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 850994ea4e9eccb573ab7b6de1fac5edcbe8bbda..ea1171ed7442feaea488a02a8cbe3e3019c409c0 100644 index ee5d93cd0c7ea7376e8488265d4e21610edeedc2..e84337b01ec7e5c530a4c6042b9386385eb58446 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1849,11 +1849,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1852,11 +1852,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
orb.setPosRaw(handle.getX(), handle.getY(), handle.getZ()); handle.serverLevel(), itemstack, amount
);
int i = Math.min(orb.xpToDurability(amount), itemstack.getDamageValue()); int i = Math.min(possibleDurabilityFromXp, itemstack.getDamageValue());
- org.bukkit.event.player.PlayerItemMendEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerItemMendEvent(handle, orb, itemstack, stackEntry.getKey(), i); - org.bukkit.event.player.PlayerItemMendEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerItemMendEvent(handle, orb, itemstack, stackEntry.get().inSlot(), i);
+ org.bukkit.event.player.PlayerItemMendEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerItemMendEvent(handle, orb, itemstack, stackEntry.get().inSlot(), i, orb::durabilityToXp); // Paper - Expand PlayerItemMendEvent + final int consumedExperience = i * amount / possibleDurabilityFromXp; // Paper - taken from ExperienceOrb#repairPlayerItems
+ org.bukkit.event.player.PlayerItemMendEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerItemMendEvent(handle, orb, itemstack, stackEntry.get().inSlot(), i, consumedExperience);
i = event.getRepairAmount(); i = event.getRepairAmount();
orb.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DESPAWN); orb.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DESPAWN);
if (!event.isCancelled()) { if (!event.isCancelled()) {
- amount -= orb.durabilityToXp(i); - amount -= i * amount / possibleDurabilityFromXp;
+ amount -= event.getDurabilityToXpOperation().applyAsInt(i); // Paper - Expand PlayerItemMendEvent + amount -= consumedExperience; // Use previously computed variable to reduce diff on change.
itemstack.setDamageValue(itemstack.getDamageValue() - i); itemstack.setDamageValue(itemstack.getDamageValue() - i);
} }
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 7fa64d9081ce54d91eb7631c7d8623ed11d9954b..c59bb1811dba49571bbb82b17a75ab2363531996 100644 index 7fa64d9081ce54d91eb7631c7d8623ed11d9954b..5a6f954e0d01253cf861ae16c6055744d07acdb9 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1265,10 +1265,10 @@ public class CraftEventFactory { @@ -1265,10 +1265,10 @@ public class CraftEventFactory {
@ -61,11 +57,11 @@ index 7fa64d9081ce54d91eb7631c7d8623ed11d9954b..c59bb1811dba49571bbb82b17a75ab23
} }
- public static PlayerItemMendEvent callPlayerItemMendEvent(net.minecraft.world.entity.player.Player entity, net.minecraft.world.entity.ExperienceOrb orb, net.minecraft.world.item.ItemStack nmsMendedItem, net.minecraft.world.entity.EquipmentSlot slot, int repairAmount) { - public static PlayerItemMendEvent callPlayerItemMendEvent(net.minecraft.world.entity.player.Player entity, net.minecraft.world.entity.ExperienceOrb orb, net.minecraft.world.item.ItemStack nmsMendedItem, net.minecraft.world.entity.EquipmentSlot slot, int repairAmount) {
+ public static PlayerItemMendEvent callPlayerItemMendEvent(net.minecraft.world.entity.player.Player entity, net.minecraft.world.entity.ExperienceOrb orb, net.minecraft.world.item.ItemStack nmsMendedItem, net.minecraft.world.entity.EquipmentSlot slot, int repairAmount, java.util.function.IntUnaryOperator durabilityToXpOp) { // Paper - Expand PlayerItemMendEvent + public static PlayerItemMendEvent callPlayerItemMendEvent(net.minecraft.world.entity.player.Player entity, net.minecraft.world.entity.ExperienceOrb orb, net.minecraft.world.item.ItemStack nmsMendedItem, net.minecraft.world.entity.EquipmentSlot slot, int repairAmount, int consumedExperience) { // Paper - Expand PlayerItemMendEvent
Player player = (Player) entity.getBukkitEntity(); Player player = (Player) entity.getBukkitEntity();
org.bukkit.inventory.ItemStack bukkitStack = CraftItemStack.asCraftMirror(nmsMendedItem); org.bukkit.inventory.ItemStack bukkitStack = CraftItemStack.asCraftMirror(nmsMendedItem);
- PlayerItemMendEvent event = new PlayerItemMendEvent(player, bukkitStack, CraftEquipmentSlot.getSlot(slot), (ExperienceOrb) orb.getBukkitEntity(), repairAmount); - PlayerItemMendEvent event = new PlayerItemMendEvent(player, bukkitStack, CraftEquipmentSlot.getSlot(slot), (ExperienceOrb) orb.getBukkitEntity(), repairAmount);
+ PlayerItemMendEvent event = new PlayerItemMendEvent(player, bukkitStack, CraftEquipmentSlot.getSlot(slot), (ExperienceOrb) orb.getBukkitEntity(), repairAmount, durabilityToXpOp); // Paper - Expand PlayerItemMendEvent + PlayerItemMendEvent event = new PlayerItemMendEvent(player, bukkitStack, CraftEquipmentSlot.getSlot(slot), (ExperienceOrb) orb.getBukkitEntity(), repairAmount, consumedExperience); // Paper - Expand PlayerItemMendEvent
Bukkit.getPluginManager().callEvent(event); Bukkit.getPluginManager().callEvent(event);
return event; return event;
} }

Datei anzeigen

@ -50,7 +50,7 @@ index 96db0b1041a4c0f054d4f3f2bdced960b119664e..78951f50188528718cdb3dbbaabe3f9f
for (int k = 0; k < 5; ++k) { for (int k = 0; k < 5; ++k) {
worldserver.sendParticles(ParticleTypes.SPLASH, (double) blockposition.getX() + worldserver.random.nextDouble(), (double) (blockposition.getY() + 1), (double) blockposition.getZ() + worldserver.random.nextDouble(), 1, 0.0D, 0.0D, 0.0D, 1.0D); worldserver.sendParticles(ParticleTypes.SPLASH, (double) blockposition.getX() + worldserver.random.nextDouble(), (double) (blockposition.getY() + 1), (double) blockposition.getZ() + worldserver.random.nextDouble(), 1, 0.0D, 0.0D, 0.0D, 1.0D);
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index c59bb1811dba49571bbb82b17a75ab2363531996..30aa65060a8039d9b2f52c776bab27304dc97f8e 100644 index 5a6f954e0d01253cf861ae16c6055744d07acdb9..370672a22ce1fdf7eb9708cce8d25e8d0687b07a 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -2127,6 +2127,32 @@ public class CraftEventFactory { @@ -2127,6 +2127,32 @@ public class CraftEventFactory {

Datei anzeigen

@ -208,7 +208,7 @@ index 172202accf4448a933fcf1ff820316c7910dd7f7..50ee7656580d386db473c054f5c5ec57
return null; return null;
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index ea1171ed7442feaea488a02a8cbe3e3019c409c0..7ab19653310daf43900ec34def0b1930d12ce542 100644 index e84337b01ec7e5c530a4c6042b9386385eb58446..85f403c07ff146a0da232ac7bfc0551a2fa2601b 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1746,23 +1746,23 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1746,23 +1746,23 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] ExperienceOrb should call EntitySpawnEvent
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 30aa65060a8039d9b2f52c776bab27304dc97f8e..2f2b09b2b9bd8730b83ade4d7da996b3b6696e0a 100644 index 370672a22ce1fdf7eb9708cce8d25e8d0687b07a..68541f68d884a2d4d35af6dd62dc9062c3758056 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -736,7 +736,8 @@ public class CraftEventFactory { @@ -736,7 +736,8 @@ public class CraftEventFactory {

Datei anzeigen

@ -81,7 +81,7 @@ index 38a24517e30007d3077b48b8b0401c8c361710ca..7927b702f8ce1e170f96a8150c5a7641
// Special case: the axis is optional for ELECTRIC_SPARK // Special case: the axis is optional for ELECTRIC_SPARK
Preconditions.checkArgument(effect.getData() == null || effect == Effect.ELECTRIC_SPARK, "Wrong kind of data for the %s effect", effect); Preconditions.checkArgument(effect.getData() == null || effect == Effect.ELECTRIC_SPARK, "Wrong kind of data for the %s effect", effect);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 7ab19653310daf43900ec34def0b1930d12ce542..62de0a48329d75855466cab5499b72ec09a872a6 100644 index 85f403c07ff146a0da232ac7bfc0551a2fa2601b..296bb88ed34f499535ef0b9fdffa67b7de81c60b 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -917,7 +917,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -917,7 +917,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -119,7 +119,7 @@ index b2fab1e6a83b2603aeb8565b25022f9e99a61029..8ba99f6ef2b50ceb8e279ed559a375ad
// Paper end - Use single player info update packet on join // Paper end - Use single player info update packet on join
player.sentListPacket = true; player.sentListPacket = true;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 62de0a48329d75855466cab5499b72ec09a872a6..1e660aa6039ed6065b2d5ccfe2c04930651e3b86 100644 index 296bb88ed34f499535ef0b9fdffa67b7de81c60b..e4de4ed09b20ed224eadcbc6d650192897c4def5 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -201,6 +201,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -201,6 +201,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -130,7 +130,7 @@ index 62de0a48329d75855466cab5499b72ec09a872a6..1e660aa6039ed6065b2d5ccfe2c04930
private static final WeakHashMap<Plugin, WeakReference<Plugin>> pluginWeakReferences = new WeakHashMap<>(); private static final WeakHashMap<Plugin, WeakReference<Plugin>> pluginWeakReferences = new WeakHashMap<>();
private int hash = 0; private int hash = 0;
private double health = 20; private double health = 20;
@@ -2087,7 +2088,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2091,7 +2092,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
otherPlayer.setUUID(uuidOverride); otherPlayer.setUUID(uuidOverride);
} }
// Paper end // Paper end
@ -139,7 +139,7 @@ index 62de0a48329d75855466cab5499b72ec09a872a6..1e660aa6039ed6065b2d5ccfe2c04930
if (original != null) otherPlayer.setUUID(original); // Paper - uuid override if (original != null) otherPlayer.setUUID(original); // Paper - uuid override
} }
@@ -2191,6 +2192,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2195,6 +2196,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return (entity != null) ? this.canSee(entity) : false; // If we can't find it, we can't see it return (entity != null) ? this.canSee(entity) : false; // If we can't find it, we can't see it
} }

Datei anzeigen

@ -18,7 +18,7 @@ index c680f081ba548f84f07a968a46811090c53e57e3..d839f8df658c894f144ba4637d290ffb
if (blockEvent.isCancelled()) { if (blockEvent.isCancelled()) {
// Let the client know the block still exists // Let the client know the block still exists
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 2f2b09b2b9bd8730b83ade4d7da996b3b6696e0a..69e191d4394e1b22fdf4ba817cb2ec0ae3805414 100644 index 68541f68d884a2d4d35af6dd62dc9062c3758056..913e36497098aa8f6c17d7ec22b7780e6653f30c 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -651,13 +651,13 @@ public class CraftEventFactory { @@ -651,13 +651,13 @@ public class CraftEventFactory {

Datei anzeigen

@ -23,7 +23,7 @@ index 4d654c4f0b6210a9841427789ba70ce5d1d308be..9d93130f23addb18b97d7f5ec013faef
public String getName() { public String getName() {
Player player = this.getPlayer(); Player player = this.getPlayer();
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 1e660aa6039ed6065b2d5ccfe2c04930651e3b86..7ad3a0605be9d89bf7618f2ed8767fdebf25a178 100644 index e4de4ed09b20ed224eadcbc6d650192897c4def5..d5757fa3d4254535448eb040593c8c23995b7bc9 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -256,6 +256,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -256,6 +256,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -79,7 +79,7 @@ index 3d36d79a4e7f16f6face3465cdf54656984f3ebc..41f3cdec7deabf34358b8087df77169f
if (!player.isImmobile()) player.connection.send(new ClientboundOpenScreenPacket(container.containerId, windowType, io.papermc.paper.adventure.PaperAdventure.asVanilla(adventure$title))); // Paper - Prevent opening inventories when frozen if (!player.isImmobile()) player.connection.send(new ClientboundOpenScreenPacket(container.containerId, windowType, io.papermc.paper.adventure.PaperAdventure.asVanilla(adventure$title))); // Paper - Prevent opening inventories when frozen
player.containerMenu = container; player.containerMenu = container;
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 69e191d4394e1b22fdf4ba817cb2ec0ae3805414..70f5a07206453124e7069bb013184038b4def654 100644 index 913e36497098aa8f6c17d7ec22b7780e6653f30c..eee1261127e47ed0250ecb2d8b77993bb8730fc6 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1382,10 +1382,21 @@ public class CraftEventFactory { @@ -1382,10 +1382,21 @@ public class CraftEventFactory {

Datei anzeigen

@ -6,10 +6,10 @@ Subject: [PATCH] Add player idle duration API
Implements API for getting and resetting a player's idle duration. Implements API for getting and resetting a player's idle duration.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 7ad3a0605be9d89bf7618f2ed8767fdebf25a178..651d59330fdbdaf2bdeab5795808ceaabc3dbddb 100644 index d5757fa3d4254535448eb040593c8c23995b7bc9..141b79346d6826a5fcea04f2d65506448cbed254 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -3414,6 +3414,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -3418,6 +3418,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
// Paper end // Paper end

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Allow null itemstack for Player#sendEquipmentChange
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 651d59330fdbdaf2bdeab5795808ceaabc3dbddb..bb2c41e56b6913c9564e0eac99182cc9c2ea4be4 100644 index 141b79346d6826a5fcea04f2d65506448cbed254..c24f27206dea30b99f2c5b80d8e011b7bc2233e8 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1127,7 +1127,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1127,7 +1127,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -165,7 +165,7 @@ index 5bcb9a53ebebeef4bd6ec2458df4b63002ebd804..2f398750bfee5758ad8b1367b6fc1436
} }
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 70f5a07206453124e7069bb013184038b4def654..54c9c19d773df01b0004da6587f7c7a388e61c21 100644 index eee1261127e47ed0250ecb2d8b77993bb8730fc6..2821ad7116b4606a09eab86de63474b85dceaafe 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -965,18 +965,24 @@ public class CraftEventFactory { @@ -965,18 +965,24 @@ public class CraftEventFactory {

Datei anzeigen

@ -18,10 +18,10 @@ index 9706b0df7d0c617a181ba9f78b010e2e58c84454..a77c2847a3bc161f0bf25eb4c78305ce
// Paper start - send while respecting visibility // Paper start - send while respecting visibility
private static void sendSoundEffect(Player fromEntity, double x, double y, double z, SoundEvent soundEffect, SoundSource soundCategory, float volume, float pitch) { private static void sendSoundEffect(Player fromEntity, double x, double y, double z, SoundEvent soundEffect, SoundSource soundCategory, float volume, float pitch) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index bb2c41e56b6913c9564e0eac99182cc9c2ea4be4..ee937b6b6ee1e4b2fcedd7b200a749ded169eea4 100644 index c24f27206dea30b99f2c5b80d8e011b7bc2233e8..4a886f11b10395143879e1c1795afc269eed109d 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1916,6 +1916,49 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1920,6 +1920,49 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
Preconditions.checkArgument(exp >= 0, "Total experience points must not be negative (%s)", exp); Preconditions.checkArgument(exp >= 0, "Total experience points must not be negative (%s)", exp);
this.getHandle().totalExperience = exp; this.getHandle().totalExperience = exp;
} }

Datei anzeigen

@ -275,7 +275,7 @@ index 8420d75865b86e1d8afea2527b5521cac184e8b1..6e290d67b00c88ecd2cf2ce5f612f52e
public boolean readyForShearing() { public boolean readyForShearing() {
return !this.isSheared() && this.isAlive(); return !this.isSheared() && this.isAlive();
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 54c9c19d773df01b0004da6587f7c7a388e61c21..a4ea5d942eb61ee733eb1b8b4a3c50fb93f037ea 100644 index 2821ad7116b4606a09eab86de63474b85dceaafe..bab47ffad0ae43bfed2b1866a2b1a562f9503c9f 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1667,20 +1667,20 @@ public class CraftEventFactory { @@ -1667,20 +1667,20 @@ public class CraftEventFactory {

Datei anzeigen

@ -197,7 +197,7 @@ index 4c6e15535fa40aad8cf1920f392589404f9ba79c..35eb95ef6fb6a0f7ea63351e90741c48
} }
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index a4ea5d942eb61ee733eb1b8b4a3c50fb93f037ea..0b1741cd68d5066114a35cc14ed08b57f4f08fb2 100644 index bab47ffad0ae43bfed2b1866a2b1a562f9503c9f..867450afbdbcd43a9daa6894ae22d0479cd11714 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1085,7 +1085,7 @@ public class CraftEventFactory { @@ -1085,7 +1085,7 @@ public class CraftEventFactory {

Datei anzeigen

@ -7,7 +7,7 @@ Affect the falling stalactite damage type where the
reduction is not applied like in Vanilla reduction is not applied like in Vanilla
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 0b1741cd68d5066114a35cc14ed08b57f4f08fb2..f769f249ada432ee400055deabdb5e4aeaa88c05 100644 index 867450afbdbcd43a9daa6894ae22d0479cd11714..042f6ec4372121fcb755504a64a1746055eb667a 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1213,7 +1213,7 @@ public class CraftEventFactory { @@ -1213,7 +1213,7 @@ public class CraftEventFactory {

Datei anzeigen

@ -35,7 +35,7 @@ index 96355e1da8feb6687ea0069dda4a82fcd7e25e8a..1f696644b958538e9f5d568a2e4bba69
} else { } else {
super.channelRead(ctx, msg); super.channelRead(ctx, msg);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index ee937b6b6ee1e4b2fcedd7b200a749ded169eea4..7aa8da8be9007e2c5037a27f53d25037693ed45c 100644 index 4a886f11b10395143879e1c1795afc269eed109d..67a715a812d700df912834874107078255d7c695 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -275,6 +275,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -275,6 +275,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {