13
0
geforkt von Mirrors/Paper

SPIGOT-782: Don't drop exp if a plugin sets it to zero

By: Thinkofdeath <thinkofdeath@spigotmc.org>
Dieser Commit ist enthalten in:
CraftBukkit/Spigot 2015-04-13 11:25:13 +01:00
Ursprung ab841e7d50
Commit 6bd7443dc3

Datei anzeigen

@ -1,5 +1,5 @@
--- /home/matt/mc-dev-private//net/minecraft/server/EntityFishingHook.java 2015-02-26 22:40:22.543608140 +0000 --- /home/matt/mc-dev-private//net/minecraft/server/EntityFishingHook.java 2015-04-13 11:24:54.120016726 +0100
+++ src/main/java/net/minecraft/server/EntityFishingHook.java 2015-02-26 22:40:22.543608140 +0000 +++ src/main/java/net/minecraft/server/EntityFishingHook.java 2015-04-13 11:24:54.120016726 +0100
@@ -3,6 +3,12 @@ @@ -3,6 +3,12 @@
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
@ -53,13 +53,15 @@
double d5 = this.owner.locX - this.locX; double d5 = this.owner.locX - this.locX;
double d6 = this.owner.locY - this.locY; double d6 = this.owner.locY - this.locY;
double d7 = this.owner.locZ - this.locZ; double d7 = this.owner.locZ - this.locZ;
@@ -403,14 +428,33 @@ @@ -403,14 +428,35 @@
entityitem.motY = d6 * d9 + (double) MathHelper.sqrt(d8) * 0.08D; entityitem.motY = d6 * d9 + (double) MathHelper.sqrt(d8) * 0.08D;
entityitem.motZ = d7 * d9; entityitem.motZ = d7 * d9;
this.world.addEntity(entityitem); this.world.addEntity(entityitem);
- this.owner.world.addEntity(new EntityExperienceOrb(this.owner.world, this.owner.locX, this.owner.locY + 0.5D, this.owner.locZ + 0.5D, this.random.nextInt(6) + 1)); - this.owner.world.addEntity(new EntityExperienceOrb(this.owner.world, this.owner.locX, this.owner.locY + 0.5D, this.owner.locZ + 0.5D, this.random.nextInt(6) + 1));
+ // CraftBukkit - this.random.nextInt(6) + 1 -> playerFishEvent.getExpToDrop() + // CraftBukkit start - this.random.nextInt(6) + 1 -> playerFishEvent.getExpToDrop()
+ if (playerFishEvent.getExpToDrop() > 0) {
+ 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()));
+ } // CraftBukkit end
b0 = 1; b0 = 1;
} }