2017-05-14 20:05:01 +02:00
|
|
|
From 63ae5b4d30b267fadb29c296b011b363297ddf3d Mon Sep 17 00:00:00 2001
|
2017-01-20 16:01:53 +01:00
|
|
|
From: BillyGalbreath <Blake.Galbreath@GMail.com>
|
|
|
|
Date: Sat, 14 Jan 2017 16:15:26 -0600
|
|
|
|
Subject: [PATCH] Add fromBottle flag to Experience Orbs
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java
|
2017-05-14 20:05:01 +02:00
|
|
|
index 64ac6e6a3..19a37bfec 100644
|
2017-01-20 16:01:53 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java
|
|
|
|
@@ -15,6 +15,14 @@ public class EntityExperienceOrb extends Entity {
|
|
|
|
public int value;
|
|
|
|
private EntityHuman targetPlayer;
|
|
|
|
private int targetTime;
|
|
|
|
+ // Paper start
|
|
|
|
+ private boolean fromBottle = false;
|
|
|
|
+
|
|
|
|
+ public EntityExperienceOrb(World world, double d0, double d1, double d2, int i, boolean fromBottle) {
|
|
|
|
+ this(world, d0, d1, d2, i);
|
|
|
|
+ this.fromBottle = fromBottle;
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
|
|
|
|
public EntityExperienceOrb(World world, double d0, double d1, double d2, int i) {
|
|
|
|
super(world);
|
|
|
|
@@ -27,6 +35,12 @@ public class EntityExperienceOrb extends Entity {
|
|
|
|
this.value = i;
|
|
|
|
}
|
|
|
|
|
|
|
|
+ // Paper start
|
|
|
|
+ public boolean isFromBottle() {
|
|
|
|
+ return fromBottle;
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
+
|
|
|
|
protected boolean playStepSound() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityThrownExpBottle.java b/src/main/java/net/minecraft/server/EntityThrownExpBottle.java
|
2017-04-29 12:27:31 +02:00
|
|
|
index 0255986fd..289312950 100644
|
2017-01-20 16:01:53 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityThrownExpBottle.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityThrownExpBottle.java
|
|
|
|
@@ -40,7 +40,7 @@ public class EntityThrownExpBottle extends EntityProjectile {
|
|
|
|
int j = EntityExperienceOrb.getOrbValue(i);
|
|
|
|
|
|
|
|
i -= j;
|
|
|
|
- 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, true)); // Paper - add fromBottle flag
|
|
|
|
}
|
|
|
|
|
|
|
|
this.die();
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java
|
2017-04-29 12:27:31 +02:00
|
|
|
index 3a09cab3d..61e3c6c3e 100644
|
2017-01-20 16:01:53 +01:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java
|
2017-01-20 16:12:47 +01:00
|
|
|
@@ -18,6 +18,13 @@ public class CraftExperienceOrb extends CraftEntity implements ExperienceOrb {
|
2017-01-20 16:01:53 +01:00
|
|
|
getHandle().value = value;
|
|
|
|
}
|
2017-01-20 16:12:47 +01:00
|
|
|
|
|
|
|
+ // Paper start
|
|
|
|
+ @Override
|
2017-01-20 16:01:53 +01:00
|
|
|
+ public boolean isFromBottle() {
|
|
|
|
+ return getHandle().isFromBottle();
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
+
|
|
|
|
@Override
|
|
|
|
public EntityExperienceOrb getHandle() {
|
|
|
|
return (EntityExperienceOrb) entity;
|
|
|
|
--
|
2017-05-14 20:05:01 +02:00
|
|
|
2.13.0
|
2017-01-20 16:01:53 +01:00
|
|
|
|