Update to Minecraft 1.14-pre5

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2019-04-23 12:00:00 +10:00
parent 0e98365784
commit a0f2b74c8d
560 changed files with 10642 additions and 10867 deletions

View File

@@ -1,9 +1,9 @@
--- a/net/minecraft/server/EntityFishingHook.java
+++ b/net/minecraft/server/EntityFishingHook.java
@@ -3,6 +3,11 @@
import java.util.Collections;
@@ -4,6 +4,11 @@
import java.util.Iterator;
import java.util.List;
import javax.annotation.Nullable;
+// CraftBukkit start
+import org.bukkit.entity.Player;
+import org.bukkit.entity.FishHook;
@@ -12,27 +12,27 @@
public class EntityFishingHook extends Entity {
@@ -266,6 +271,7 @@
}
@@ -207,6 +212,7 @@
}, RayTrace.BlockCollisionOption.COLLIDER, true);
if (movingobjectposition != null && movingobjectposition.type != MovingObjectPosition.EnumMovingObjectType.MISS) {
if (movingobjectposition.getType() != MovingObjectPosition.EnumMovingObjectType.MISS) {
+ org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this, movingobjectposition); // Craftbukkit - Call event
if (movingobjectposition.type == MovingObjectPosition.EnumMovingObjectType.ENTITY) {
this.hooked = movingobjectposition.entity;
this.o();
@@ -298,6 +304,10 @@
if (this.g <= 0) {
this.h = 0;
this.aw = 0;
if (movingobjectposition.getType() == MovingObjectPosition.EnumMovingObjectType.ENTITY) {
this.hooked = ((MovingObjectPositionEntity) movingobjectposition).getEntity();
this.n();
@@ -239,6 +245,10 @@
if (this.ar <= 0) {
this.as = 0;
this.at = 0;
+ // CraftBukkit start
+ PlayerFishEvent playerFishEvent = new PlayerFishEvent((Player) this.owner.getBukkitEntity(), null, (FishHook) this.getBukkitEntity(), PlayerFishEvent.State.FAILED_ATTEMPT);
+ this.world.getServer().getPluginManager().callEvent(playerFishEvent);
+ // CraftBukkit end
} else {
this.motY -= 0.2D * (double) this.random.nextFloat() * (double) this.random.nextFloat();
this.setMot(this.getMot().add(0.0D, -0.2D * (double) this.random.nextFloat() * (double) this.random.nextFloat(), 0.0D));
}
@@ -333,6 +343,13 @@
worldserver.a(Particles.x, d0, d1, d2, 0, (double) (-f4), 0.01D, (double) f3, 1.0D);
@@ -274,6 +284,13 @@
worldserver.a(Particles.FISHING, d0, d1, d2, 0, (double) (-f4), 0.01D, (double) f3, 1.0D);
}
} else {
+ // CraftBukkit start
@@ -42,10 +42,10 @@
+ return;
+ }
+ // CraftBukkit end
this.motY = (double) (-0.4F * MathHelper.a(this.random, 0.6F, 1.0F));
this.a(SoundEffects.ENTITY_FISHING_BOBBER_SPLASH, 0.25F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F);
double d3 = this.getBoundingBox().minY + 0.5D;
@@ -389,6 +406,14 @@
Vec3D vec3d = this.getMot();
this.setMot(vec3d.x, (double) (-0.4F * MathHelper.a(this.random, 0.6F, 1.0F)), vec3d.z);
@@ -330,6 +347,14 @@
int i = 0;
if (this.hooked != null) {
@@ -57,10 +57,10 @@
+ return 0;
+ }
+ // CraftBukkit end
this.f();
this.reel();
CriterionTriggers.D.a((EntityPlayer) this.owner, itemstack, this, Collections.emptyList());
this.world.broadcastEntityEffect(this, (byte) 31);
@@ -405,6 +430,15 @@
@@ -345,6 +370,15 @@
while (iterator.hasNext()) {
ItemStack itemstack1 = (ItemStack) iterator.next();
EntityItem entityitem = new EntityItem(this.world, this.locX, this.locY, this.locZ, itemstack1);
@@ -76,9 +76,9 @@
double d0 = this.owner.locX - this.locX;
double d1 = this.owner.locY - this.locY;
double d2 = this.owner.locZ - this.locZ;
@@ -415,7 +449,11 @@
entityitem.motY = d1 * 0.1D + (double) MathHelper.sqrt(d3) * 0.08D;
entityitem.motZ = d2 * 0.1D;
@@ -352,7 +386,11 @@
entityitem.setMot(d0 * 0.1D, d1 * 0.1D + Math.sqrt(Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2)) * 0.08D, d2 * 0.1D);
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));
+ // CraftBukkit start - this.random.nextInt(6) + 1 -> playerFishEvent.getExpToDrop()
@@ -89,7 +89,7 @@
if (itemstack1.getItem().a(TagsItem.FISHES)) {
this.owner.a(StatisticList.FISH_CAUGHT, 1);
}
@@ -425,8 +463,25 @@
@@ -362,8 +400,25 @@
}
if (this.isInGround) {