2020-05-06 11:48:49 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2017-12-19 22:46:27 +01:00
|
|
|
From: Aikar <aikar@aikar.co>
|
|
|
|
Date: Tue, 19 Dec 2017 16:31:46 -0500
|
|
|
|
Subject: [PATCH] ExperienceOrbs API for Reason/Source/Triggering player
|
|
|
|
|
|
|
|
Adds lots of information about why this orb exists.
|
|
|
|
|
|
|
|
Replaces isFromBottle() with logic that persists entity reloads too.
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java
|
2020-05-06 11:48:49 +02:00
|
|
|
index 5de881371a485957fd8fadc7540a2b549b20dd65..5f261b9b92de4ca8638f41fa2947016cf590cf05 100644
|
2017-12-19 22:46:27 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/Block.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/Block.java
|
2019-05-28 01:01:45 +02:00
|
|
|
@@ -511,13 +511,13 @@ public class Block implements IMaterial {
|
2017-12-19 22:46:27 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
- protected void dropExperience(World world, BlockPosition blockposition, int i) {
|
|
|
|
+ protected void dropExperience(World world, BlockPosition blockposition, int i, EntityPlayer player) { // Paper
|
2019-06-25 03:47:58 +02:00
|
|
|
if (!world.isClientSide && world.getGameRules().getBoolean(GameRules.DO_TILE_DROPS)) {
|
2017-12-19 22:46:27 +01:00
|
|
|
while (i > 0) {
|
|
|
|
int j = EntityExperienceOrb.getOrbValue(i);
|
|
|
|
|
|
|
|
i -= j;
|
|
|
|
- world.addEntity(new EntityExperienceOrb(world, (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, j));
|
|
|
|
+ world.addEntity(new EntityExperienceOrb(world, (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, j, org.bukkit.entity.ExperienceOrb.SpawnReason.BLOCK_BREAK, player)); // Paper
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-04-27 08:26:04 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/ContainerGrindstone.java b/src/main/java/net/minecraft/server/ContainerGrindstone.java
|
2020-05-06 11:48:49 +02:00
|
|
|
index 2d2cd09ad1126b3b6b7a979b8e4dd450806d58d3..ed88e208d00f3b19b5c5916cf87513ab511a5fb1 100644
|
2019-04-27 08:26:04 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/ContainerGrindstone.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/ContainerGrindstone.java
|
|
|
|
@@ -81,7 +81,7 @@ public class ContainerGrindstone extends Container {
|
|
|
|
int k = EntityExperienceOrb.getOrbValue(j);
|
|
|
|
|
|
|
|
j -= k;
|
|
|
|
- world.addEntity(new EntityExperienceOrb(world, (double) blockposition.getX(), (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, k));
|
|
|
|
+ world.addEntity(new EntityExperienceOrb(world, (double) blockposition.getX(), (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, k, org.bukkit.entity.ExperienceOrb.SpawnReason.GRINDSTONE, entityhuman)); // Paper
|
|
|
|
}
|
|
|
|
|
|
|
|
world.triggerEffect(1042, blockposition, 0);
|
2017-12-19 22:46:27 +01:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
2020-05-06 11:48:49 +02:00
|
|
|
index 87625776963d6143d570cda8e72fda6b3f50047f..138e2ea56a91e519a34fd3be9c0ab111a4b17544 100644
|
2017-12-19 22:46:27 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
2019-12-12 00:43:22 +01:00
|
|
|
@@ -616,7 +616,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster {
|
2017-12-19 22:46:27 +01:00
|
|
|
int j = EntityExperienceOrb.getOrbValue(i);
|
|
|
|
|
|
|
|
i -= j;
|
2019-12-12 00:43:22 +01:00
|
|
|
- this.world.addEntity(new EntityExperienceOrb(this.world, this.locX(), this.locY(), this.locZ(), j));
|
|
|
|
+ this.world.addEntity(new EntityExperienceOrb(this.world, this.locX(), this.locY(), this.locZ(), j, org.bukkit.entity.ExperienceOrb.SpawnReason.ENTITY_DEATH, this.killer, this)); // Paper
|
2017-12-19 22:46:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java
|
2020-05-06 11:48:49 +02:00
|
|
|
index 0447800d9dc341af647a928abd8b79938eddbd6f..d4275e733d9996d121efd95ae1ff4676a1ebfbb5 100644
|
2017-12-19 22:46:27 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java
|
2019-04-27 08:26:04 +02:00
|
|
|
@@ -16,9 +16,59 @@ public class EntityExperienceOrb extends Entity {
|
2017-12-19 22:46:27 +01:00
|
|
|
public int value;
|
|
|
|
private EntityHuman targetPlayer;
|
|
|
|
private int targetTime;
|
|
|
|
+ // Paper start
|
|
|
|
+ public java.util.UUID sourceEntityId;
|
|
|
|
+ public java.util.UUID triggerEntityId;
|
|
|
|
+ public org.bukkit.entity.ExperienceOrb.SpawnReason spawnReason = org.bukkit.entity.ExperienceOrb.SpawnReason.UNKNOWN;
|
|
|
|
+
|
|
|
|
+ private void loadPaperNBT(NBTTagCompound nbttagcompound) {
|
|
|
|
+ if (!nbttagcompound.hasKeyOfType("Paper.ExpData", 10)) { // 10 = compound
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ NBTTagCompound comp = nbttagcompound.getCompound("Paper.ExpData");
|
|
|
|
+ if (comp.hasUUID("source")) {
|
|
|
|
+ this.sourceEntityId = comp.getUUID("source");
|
|
|
|
+ }
|
|
|
|
+ if (comp.hasUUID("trigger")) {
|
|
|
|
+ this.triggerEntityId = comp.getUUID("trigger");
|
|
|
|
+ }
|
|
|
|
+ if (comp.hasKey("reason")) {
|
|
|
|
+ String reason = comp.getString("reason");
|
|
|
|
+ try {
|
2019-04-27 08:26:04 +02:00
|
|
|
+ this.spawnReason = org.bukkit.entity.ExperienceOrb.SpawnReason.valueOf(reason);
|
2017-12-19 22:46:27 +01:00
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ this.world.getServer().getLogger().warning("Invalid spawnReason set for experience orb: " + e.getMessage() + " - " + reason);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ private void savePaperNBT(NBTTagCompound nbttagcompound) {
|
|
|
|
+ NBTTagCompound comp = new NBTTagCompound();
|
2019-04-27 08:26:04 +02:00
|
|
|
+ if (this.sourceEntityId != null) {
|
|
|
|
+ comp.setUUID("source", this.sourceEntityId);
|
2017-12-19 22:46:27 +01:00
|
|
|
+ }
|
2019-04-27 08:26:04 +02:00
|
|
|
+ if (this.triggerEntityId != null) {
|
2017-12-19 22:46:27 +01:00
|
|
|
+ comp.setUUID("trigger", triggerEntityId);
|
|
|
|
+ }
|
2019-04-27 08:26:04 +02:00
|
|
|
+ if (this.spawnReason != null && this.spawnReason != org.bukkit.entity.ExperienceOrb.SpawnReason.UNKNOWN) {
|
|
|
|
+ comp.setString("reason", this.spawnReason.name());
|
2017-12-19 22:46:27 +01:00
|
|
|
+ }
|
|
|
|
+ nbttagcompound.set("Paper.ExpData", comp);
|
|
|
|
+ }
|
2018-07-17 22:32:05 +02:00
|
|
|
|
|
|
|
public EntityExperienceOrb(World world, double d0, double d1, double d2, int i) {
|
|
|
|
+ this(world, d0, d1, d2, i, null, null);
|
|
|
|
+ }
|
|
|
|
+
|
2017-12-19 22:46:27 +01:00
|
|
|
+ public EntityExperienceOrb(World world, double d0, double d1, double d2, int i, org.bukkit.entity.ExperienceOrb.SpawnReason reason, Entity triggerId) {
|
|
|
|
+ this(world, d0, d1, d2, i, reason, triggerId, null);
|
|
|
|
+ }
|
2018-07-17 22:32:05 +02:00
|
|
|
+
|
2017-12-19 22:46:27 +01:00
|
|
|
+ public EntityExperienceOrb(World world, double d0, double d1, double d2, int i, org.bukkit.entity.ExperienceOrb.SpawnReason reason, Entity triggerId, Entity sourceId) {
|
2019-04-27 08:26:04 +02:00
|
|
|
this(EntityTypes.EXPERIENCE_ORB, world);
|
2017-12-19 22:46:27 +01:00
|
|
|
+ this.sourceEntityId = sourceId != null ? sourceId.getUniqueID() : null;
|
|
|
|
+ this.triggerEntityId = triggerId != null ? triggerId.getUniqueID() : null;
|
|
|
|
+ this.spawnReason = reason != null ? reason : org.bukkit.entity.ExperienceOrb.SpawnReason.UNKNOWN;
|
|
|
|
+ // Paper end
|
|
|
|
this.setPosition(d0, d1, d2);
|
2019-04-27 08:26:04 +02:00
|
|
|
this.yaw = (float) (this.random.nextDouble() * 360.0D);
|
|
|
|
this.setMot((this.random.nextDouble() * 0.20000000298023224D - 0.10000000149011612D) * 2.0D, this.random.nextDouble() * 0.2D * 2.0D, (this.random.nextDouble() * 0.20000000298023224D - 0.10000000149011612D) * 2.0D);
|
2019-08-26 16:25:58 +02:00
|
|
|
@@ -158,6 +208,7 @@ public class EntityExperienceOrb extends Entity {
|
2019-04-27 08:26:04 +02:00
|
|
|
nbttagcompound.setShort("Health", (short) this.e);
|
|
|
|
nbttagcompound.setShort("Age", (short) this.c);
|
2017-12-19 22:46:27 +01:00
|
|
|
nbttagcompound.setShort("Value", (short) this.value);
|
2019-04-27 08:26:04 +02:00
|
|
|
+ this.savePaperNBT(nbttagcompound); // Paper
|
2017-12-19 22:46:27 +01:00
|
|
|
}
|
|
|
|
|
2019-04-27 08:26:04 +02:00
|
|
|
@Override
|
2019-08-26 16:25:58 +02:00
|
|
|
@@ -165,6 +216,7 @@ public class EntityExperienceOrb extends Entity {
|
2019-04-27 08:26:04 +02:00
|
|
|
this.e = nbttagcompound.getShort("Health");
|
|
|
|
this.c = nbttagcompound.getShort("Age");
|
2017-12-19 22:46:27 +01:00
|
|
|
this.value = nbttagcompound.getShort("Value");
|
2019-04-27 08:26:04 +02:00
|
|
|
+ this.loadPaperNBT(nbttagcompound); // Paper
|
2017-12-19 22:46:27 +01:00
|
|
|
}
|
|
|
|
|
2019-04-27 08:26:04 +02:00
|
|
|
@Override
|
2017-12-19 22:46:27 +01:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java
|
2020-05-06 11:48:49 +02:00
|
|
|
index 807ec3394db7bef29bf92f2c200fd76f96df03ab..73f5961aa331aa94fbbc57c5b4db9bc43ee5cdde 100644
|
2017-12-19 22:46:27 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityFishingHook.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityFishingHook.java
|
2020-02-22 16:00:41 +01:00
|
|
|
@@ -401,7 +401,7 @@ public class EntityFishingHook extends Entity {
|
2017-12-19 22:46:27 +01:00
|
|
|
this.world.addEntity(entityitem);
|
|
|
|
// CraftBukkit start - this.random.nextInt(6) + 1 -> playerFishEvent.getExpToDrop()
|
|
|
|
if (playerFishEvent.getExpToDrop() > 0) {
|
2019-12-12 00:43:22 +01:00
|
|
|
- this.owner.world.addEntity(new EntityExperienceOrb(this.owner.world, this.owner.locX(), this.owner.locY() + 0.5D, this.owner.locZ() + 0.5D, playerFishEvent.getExpToDrop()));
|
|
|
|
+ this.owner.world.addEntity(new EntityExperienceOrb(this.owner.world, this.owner.locX(), this.owner.locY() + 0.5D, this.owner.locZ() + 0.5D, playerFishEvent.getExpToDrop(), org.bukkit.entity.ExperienceOrb.SpawnReason.FISHING, this.owner, this)); // Paper
|
2017-12-19 22:46:27 +01:00
|
|
|
}
|
|
|
|
// CraftBukkit end
|
2018-08-26 20:11:49 +02:00
|
|
|
if (itemstack1.getItem().a(TagsItem.FISHES)) {
|
2017-12-19 22:46:27 +01:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
2020-05-06 11:48:49 +02:00
|
|
|
index 56c8b56b06a67e90c05f21c8141e61df7c9aafb1..306435c1c6f28ad1a891d4ee8c124b14a83ae25b 100644
|
2017-12-19 22:46:27 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
2020-01-22 03:02:07 +01:00
|
|
|
@@ -1379,7 +1379,8 @@ public abstract class EntityLiving extends Entity {
|
2017-12-19 22:46:27 +01:00
|
|
|
int j = EntityExperienceOrb.getOrbValue(i);
|
|
|
|
|
|
|
|
i -= j;
|
2019-12-12 00:43:22 +01:00
|
|
|
- this.world.addEntity(new EntityExperienceOrb(this.world, this.locX(), this.locY(), this.locZ(), j));
|
2017-12-19 22:46:27 +01:00
|
|
|
+ EntityLiving attacker = killer != null ? killer : lastDamager; // Paper
|
2019-12-12 00:43:22 +01:00
|
|
|
+ this.world.addEntity(new EntityExperienceOrb(this.world, this.locX(), this.locY(), this.locZ(), j, this instanceof EntityPlayer ? org.bukkit.entity.ExperienceOrb.SpawnReason.PLAYER_DEATH : org.bukkit.entity.ExperienceOrb.SpawnReason.ENTITY_DEATH, attacker, this)); // Paper
|
2017-12-19 22:46:27 +01:00
|
|
|
}
|
|
|
|
this.expToDrop = 0;
|
2019-12-12 00:43:22 +01:00
|
|
|
}
|
2017-12-19 22:46:27 +01:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityThrownExpBottle.java b/src/main/java/net/minecraft/server/EntityThrownExpBottle.java
|
2020-05-06 11:48:49 +02:00
|
|
|
index 0bfc0a773da3e26cb0188adc8369215dcc953b62..ba2f90cc6ae617fe9bb8e08656b64ded924afa60 100644
|
2017-12-19 22:46:27 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityThrownExpBottle.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityThrownExpBottle.java
|
2019-04-27 08:26:04 +02:00
|
|
|
@@ -43,7 +43,7 @@ public class EntityThrownExpBottle extends EntityProjectileThrowable {
|
2017-12-19 22:46:27 +01:00
|
|
|
int j = EntityExperienceOrb.getOrbValue(i);
|
|
|
|
|
|
|
|
i -= j;
|
2019-12-12 00:43:22 +01:00
|
|
|
- this.world.addEntity(new EntityExperienceOrb(this.world, this.locX(), this.locY(), this.locZ(), j));
|
|
|
|
+ this.world.addEntity(new EntityExperienceOrb(this.world, this.locX(), this.locY(), this.locZ(), j, org.bukkit.entity.ExperienceOrb.SpawnReason.EXP_BOTTLE, getShooter(), this)); // Paper
|
2017-12-19 22:46:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
this.die();
|
2019-04-27 08:26:04 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityTurtle.java b/src/main/java/net/minecraft/server/EntityTurtle.java
|
2020-05-06 11:48:49 +02:00
|
|
|
index c73cc9ae4b1f1f24e017b336b4e0e52275807c8b..76296119a197a433747ee2481079b36aebdb085c 100644
|
2019-04-27 08:26:04 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityTurtle.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityTurtle.java
|
2019-12-12 00:43:22 +01:00
|
|
|
@@ -510,7 +510,7 @@ public class EntityTurtle extends EntityAnimal {
|
2019-04-27 08:26:04 +02:00
|
|
|
Random random = this.animal.getRandom();
|
|
|
|
|
2019-06-25 03:47:58 +02:00
|
|
|
if (this.b.getGameRules().getBoolean(GameRules.DO_MOB_LOOT)) {
|
2019-12-12 00:43:22 +01:00
|
|
|
- this.b.addEntity(new EntityExperienceOrb(this.b, this.animal.locX(), this.animal.locY(), this.animal.locZ(), random.nextInt(7) + 1));
|
|
|
|
+ this.b.addEntity(new EntityExperienceOrb(this.b, this.animal.locX(), this.animal.locY(), this.animal.locZ(), random.nextInt(7) + 1, org.bukkit.entity.ExperienceOrb.SpawnReason.BREED, entityplayer)); // Paper;
|
2019-04-27 08:26:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2017-12-19 22:46:27 +01:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java
|
2020-05-06 11:48:49 +02:00
|
|
|
index 5e3835851d8c5e804542c256a54187e4ed05bace..6ca4fa43c41ad555c093b90cf08cfdb1e73fda22 100644
|
2017-12-19 22:46:27 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityVillager.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityVillager.java
|
2019-12-17 23:39:07 +01:00
|
|
|
@@ -509,7 +509,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
|
2017-12-19 22:46:27 +01:00
|
|
|
}
|
|
|
|
|
2019-05-14 04:20:58 +02:00
|
|
|
if (merchantrecipe.isRewardExp()) {
|
2019-12-12 00:43:22 +01:00
|
|
|
- this.world.addEntity(new EntityExperienceOrb(this.world, this.locX(), this.locY() + 0.5D, this.locZ(), i));
|
|
|
|
+ this.world.addEntity(new EntityExperienceOrb(this.world, this.locX(), this.locY() + 0.5D, this.locZ(), i, org.bukkit.entity.ExperienceOrb.SpawnReason.VILLAGER_TRADE, this.getTrader(), this)); // Paper
|
2017-12-19 22:46:27 +01:00
|
|
|
}
|
|
|
|
|
2019-04-27 08:26:04 +02:00
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityVillagerTrader.java b/src/main/java/net/minecraft/server/EntityVillagerTrader.java
|
2020-05-06 11:48:49 +02:00
|
|
|
index 530c69996470ad79b93254ed39aa1b101c007c89..2ad8dba5c0f8424becacda44232813c5f4451fd4 100644
|
2019-04-27 08:26:04 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityVillagerTrader.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityVillagerTrader.java
|
|
|
|
@@ -147,7 +147,7 @@ public class EntityVillagerTrader extends EntityVillagerAbstract {
|
2019-05-14 04:20:58 +02:00
|
|
|
if (merchantrecipe.isRewardExp()) {
|
2019-04-27 08:26:04 +02:00
|
|
|
int i = 3 + this.random.nextInt(4);
|
|
|
|
|
2019-12-12 00:43:22 +01:00
|
|
|
- this.world.addEntity(new EntityExperienceOrb(this.world, this.locX(), this.locY() + 0.5D, this.locZ(), i));
|
|
|
|
+ this.world.addEntity(new EntityExperienceOrb(this.world, this.locX(), this.locY() + 0.5D, this.locZ(), i, org.bukkit.entity.ExperienceOrb.SpawnReason.VILLAGER_TRADE, this.getTrader(), this)); // Paper
|
2019-04-27 08:26:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2017-12-19 22:46:27 +01:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalBreed.java b/src/main/java/net/minecraft/server/PathfinderGoalBreed.java
|
2020-05-06 11:48:49 +02:00
|
|
|
index 1ab2668e910dca6c02d03b88b27fe709cbee785c..2b708761d0401ead80d8ff832decc8d725c5f61c 100644
|
2017-12-19 22:46:27 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalBreed.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalBreed.java
|
2019-04-27 08:26:04 +02:00
|
|
|
@@ -117,7 +117,7 @@ public class PathfinderGoalBreed extends PathfinderGoal {
|
2019-06-25 03:47:58 +02:00
|
|
|
if (this.b.getGameRules().getBoolean(GameRules.DO_MOB_LOOT)) {
|
2017-12-19 22:46:27 +01:00
|
|
|
// CraftBukkit start - use event experience
|
|
|
|
if (experience > 0) {
|
2019-12-12 00:43:22 +01:00
|
|
|
- this.b.addEntity(new EntityExperienceOrb(this.b, this.animal.locX(), this.animal.locY(), this.animal.locZ(), experience));
|
|
|
|
+ this.b.addEntity(new EntityExperienceOrb(this.b, this.animal.locX(), this.animal.locY(), this.animal.locZ(), experience, org.bukkit.entity.ExperienceOrb.SpawnReason.BREED, entityplayer, entityageable)); // Paper
|
2017-12-19 22:46:27 +01:00
|
|
|
}
|
|
|
|
// CraftBukkit end
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java
|
2020-05-06 11:48:49 +02:00
|
|
|
index f6c6ea4aaf16fae057c356bc4f42fb3a86c63f91..dff3eb118856bb4b79e4378b5c39100d65a09767 100644
|
2017-12-19 22:46:27 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/PlayerInteractManager.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java
|
2019-12-12 00:43:22 +01:00
|
|
|
@@ -374,7 +374,7 @@ public class PlayerInteractManager {
|
2017-12-19 22:46:27 +01:00
|
|
|
|
2019-07-20 06:01:24 +02:00
|
|
|
// Drop event experience
|
2017-12-19 22:46:27 +01:00
|
|
|
if (flag && event != null) {
|
|
|
|
- iblockdata.getBlock().dropExperience(this.world, blockposition, event.getExpToDrop());
|
|
|
|
+ iblockdata.getBlock().dropExperience(this.world, blockposition, event.getExpToDrop(), this.player); // Paper
|
|
|
|
}
|
|
|
|
|
2019-07-20 06:01:24 +02:00
|
|
|
return true;
|
2017-12-19 22:46:27 +01:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/SlotFurnaceResult.java b/src/main/java/net/minecraft/server/SlotFurnaceResult.java
|
2020-05-06 11:48:49 +02:00
|
|
|
index d2698e847cfcbc4d2f91b4f5d66b38b47f86c10e..edc4a5c34e8064d900668d132b3496e354408eaf 100644
|
2017-12-19 22:46:27 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/SlotFurnaceResult.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/SlotFurnaceResult.java
|
2019-04-27 08:26:04 +02:00
|
|
|
@@ -2,7 +2,7 @@ package net.minecraft.server;
|
2017-12-19 22:46:27 +01:00
|
|
|
|
|
|
|
public class SlotFurnaceResult extends Slot {
|
|
|
|
|
|
|
|
- private final EntityHuman a;
|
2019-04-27 08:26:04 +02:00
|
|
|
+ private final EntityHuman a; public final EntityHuman getPlayer() { return this.a; } // Paper OBFHELPER
|
2017-12-19 22:46:27 +01:00
|
|
|
private int b;
|
|
|
|
|
|
|
|
public SlotFurnaceResult(EntityHuman entityhuman, IInventory iinventory, int i, int j, int k) {
|
2019-04-27 08:26:04 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/TileEntityFurnace.java b/src/main/java/net/minecraft/server/TileEntityFurnace.java
|
2020-05-06 11:48:49 +02:00
|
|
|
index 8dc47452a453023e332303575b36732417abd84e..560e2f42b702c5c4870640ad7da3aa48c3f4b1eb 100644
|
2019-04-27 08:26:04 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/TileEntityFurnace.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/TileEntityFurnace.java
|
|
|
|
@@ -554,7 +554,7 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I
|
|
|
|
while (i > 0) {
|
|
|
|
j = EntityExperienceOrb.getOrbValue(i);
|
|
|
|
i -= j;
|
2019-12-12 00:43:22 +01:00
|
|
|
- entityhuman.world.addEntity(new EntityExperienceOrb(entityhuman.world, entityhuman.locX(), entityhuman.locY() + 0.5D, entityhuman.locZ() + 0.5D, j));
|
|
|
|
+ entityhuman.world.addEntity(new EntityExperienceOrb(entityhuman.world, entityhuman.locX(), entityhuman.locY() + 0.5D, entityhuman.locZ() + 0.5D, j, org.bukkit.entity.ExperienceOrb.SpawnReason.FURNACE, entityhuman)); // Paper
|
2019-04-27 08:26:04 +02:00
|
|
|
}
|
2017-12-19 22:46:27 +01:00
|
|
|
|
2019-04-27 08:26:04 +02:00
|
|
|
}
|
2017-12-19 22:46:27 +01:00
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
2020-05-06 11:48:49 +02:00
|
|
|
index 32e96bc05704f10ac4830a661bd6abb71b71f487..265af7ac7fba984ed3d486d6c5d01b54dd2592d9 100644
|
2017-12-19 22:46:27 +01:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
2020-05-02 00:03:47 +02:00
|
|
|
@@ -1799,7 +1799,7 @@ public class CraftWorld implements World {
|
2017-12-19 22:46:27 +01:00
|
|
|
} else if (TNTPrimed.class.isAssignableFrom(clazz)) {
|
|
|
|
entity = new EntityTNTPrimed(world, x, y, z, null);
|
|
|
|
} else if (ExperienceOrb.class.isAssignableFrom(clazz)) {
|
|
|
|
- entity = new EntityExperienceOrb(world, x, y, z, 0);
|
|
|
|
+ entity = new EntityExperienceOrb(world, x, y, z, 0, org.bukkit.entity.ExperienceOrb.SpawnReason.CUSTOM, null, null); // Paper
|
2019-04-27 08:26:04 +02:00
|
|
|
} else if (LightningStrike.class.isAssignableFrom(clazz)) {
|
|
|
|
entity = new EntityLightning(world, x, y, z, false);
|
|
|
|
} else if (Firework.class.isAssignableFrom(clazz)) {
|
2017-12-19 22:46:27 +01:00
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java
|
2020-05-06 11:48:49 +02:00
|
|
|
index 1b512cc45c7a185b8a7950ff9882e1f2af171cc8..fbad0456757cadea4d7f50c63dbb07bad7e8baa9 100644
|
2017-12-19 22:46:27 +01:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java
|
2019-05-06 04:58:04 +02:00
|
|
|
@@ -20,6 +20,18 @@ public class CraftExperienceOrb extends CraftEntity implements ExperienceOrb {
|
2017-12-19 22:46:27 +01:00
|
|
|
getHandle().value = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
+ // Paper start
|
|
|
|
+ public java.util.UUID getTriggerEntityId() {
|
|
|
|
+ return getHandle().triggerEntityId;
|
|
|
|
+ }
|
|
|
|
+ public java.util.UUID getSourceEntityId() {
|
|
|
|
+ return getHandle().sourceEntityId;
|
|
|
|
+ }
|
|
|
|
+ public SpawnReason getSpawnReason() {
|
|
|
|
+ return getHandle().spawnReason;
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
+
|
|
|
|
@Override
|
|
|
|
public EntityExperienceOrb getHandle() {
|
|
|
|
return (EntityExperienceOrb) entity;
|