mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 12:27:59 +01:00
29 lines
1.7 KiB
Diff
29 lines
1.7 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Aikar <aikar@aikar.co>
|
|
Date: Tue, 19 Dec 2017 22:02:53 -0500
|
|
Subject: [PATCH] PlayerPickupExperienceEvent
|
|
|
|
Allows plugins to cancel a player picking up an experience orb
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/EntityExperienceOrb.java b/src/main/java/net/minecraft/world/entity/EntityExperienceOrb.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/EntityExperienceOrb.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/EntityExperienceOrb.java
|
|
@@ -0,0 +0,0 @@ import net.minecraft.core.BlockPosition;
|
|
import net.minecraft.nbt.NBTTagCompound;
|
|
import net.minecraft.network.protocol.Packet;
|
|
import net.minecraft.network.protocol.game.PacketPlayOutSpawnEntityExperienceOrb;
|
|
+import net.minecraft.server.level.EntityPlayer;
|
|
import net.minecraft.sounds.SoundEffects;
|
|
import net.minecraft.tags.Tag;
|
|
import net.minecraft.tags.TagsFluid;
|
|
@@ -0,0 +0,0 @@ public class EntityExperienceOrb extends Entity {
|
|
@Override
|
|
public void pickup(EntityHuman entityhuman) {
|
|
if (!this.world.isClientSide) {
|
|
- if (this.d == 0 && entityhuman.bu == 0) {
|
|
+ if (this.d == 0 && entityhuman.bu == 0 && new com.destroystokyo.paper.event.player.PlayerPickupExperienceEvent(((EntityPlayer) entityhuman).getBukkitEntity(), (org.bukkit.entity.ExperienceOrb) this.getBukkitEntity()).callEvent()) { // Paper
|
|
entityhuman.bu = 2;
|
|
entityhuman.receive(this, 1);
|
|
Entry<EnumItemSlot, ItemStack> entry = EnchantmentManager.a(Enchantments.MENDING, (EntityLiving) entityhuman, ItemStack::f);
|