13
0
geforkt von Mirrors/Paper

NOT FINISHED! 1.13 pre-7

I need more creative commit messages.
Dieser Commit ist enthalten in:
Shane Freeder 2018-07-19 00:16:19 +01:00
Ursprung f3b00978d9
Commit c99e4a22aa
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: A3F61EA5A085289C
61 geänderte Dateien mit 330 neuen und 439 gelöschten Zeilen

Datei anzeigen

@ -1,4 +1,4 @@
From 9f2c6acdcb96192da5d2ca929a2d729b450b95c2 Mon Sep 17 00:00:00 2001
From 0530d0a31a3a726c633b09f58e383402b3f291a6 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Sat, 27 Jan 2018 17:04:14 -0500
Subject: [PATCH] Add ArmorStand Item Meta

Datei anzeigen

@ -1,27 +0,0 @@
From 97ab3dbce9bd88f8593e8cb5f1f01a1c9866fd72 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 24 Jan 2018 20:06:39 -0500
Subject: [PATCH] MC-99321 - Dont check for blocked double chest for hoppers
etc
This is a source of MAJOR lag for hoppers, as well as a gameplay bug.
This removes the necessity to disable the cat on chest behavior to improve performance.
now performance will be improved even if you have cat chest detection on.
diff --git a/src/main/java/net/minecraft/server/BlockChest.java b/src/main/java/net/minecraft/server/BlockChest.java
index 633c75ffe..68cdd3970 100644
--- a/src/main/java/net/minecraft/server/BlockChest.java
+++ b/src/main/java/net/minecraft/server/BlockChest.java
@@ -208,6 +208,7 @@ public class BlockChest extends BlockTileEntity implements IFluidSource, IFluidC
if (blockpropertychesttype1 != BlockPropertyChestType.SINGLE && blockpropertychesttype != blockpropertychesttype1 && iblockdata1.get(BlockChest.FACING) == iblockdata.get(BlockChest.FACING)) {
if (!flag && this.a(world, blockposition1)) {
+ //if (!flag && this.e(world, blockposition1)) { // Paper - check for allowBlocked flag - MC-99321
return null;
}
--
2.18.0

Datei anzeigen

@ -1,4 +1,4 @@
From a4c8b999c8aaed77e0ec747c47b33db32c02b26d Mon Sep 17 00:00:00 2001
From 2693e4099bc86fa04f9ea27d357ba5fe079d0133 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Sun, 11 Feb 2018 10:43:46 +0000
Subject: [PATCH] Extend Player Interact cancellation

Datei anzeigen

@ -1,4 +1,4 @@
From e325606ca11e0456e20de6f72ca536770e5a021c Mon Sep 17 00:00:00 2001
From c96eff12be30c749b2571ac7d834fc2612402a0b Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 24 Feb 2018 01:14:55 -0500
Subject: [PATCH] Tameable#getOwnerUniqueId API

Datei anzeigen

@ -1,4 +1,4 @@
From 1ecf02a1bf80ad65f162f01219f809c6863cdcff Mon Sep 17 00:00:00 2001
From e402212a84679d84734f72481807a00cad6f71a8 Mon Sep 17 00:00:00 2001
From: MiniDigger <admin@minidigger.me>
Date: Sat, 10 Mar 2018 00:50:24 +0100
Subject: [PATCH] Toggleable player crits, helps mitigate hacked clients.

Datei anzeigen

@ -1,4 +1,4 @@
From 9fda01cd67b4a4ad9eb1ee84b3094affa5ea844e Mon Sep 17 00:00:00 2001
From 075334edd39aa0e1e1ac778032caea4ad9e6f4bc Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Sat, 10 Mar 2018 13:03:49 +0000
Subject: [PATCH] Fix NPE when getting location from InventoryEnderChest opened

Datei anzeigen

@ -1,4 +1,4 @@
From 93093b0262f159749ed17fe570dc6c53640d2942 Mon Sep 17 00:00:00 2001
From ab69b644e187d1ddfe69ff12be345f5d29a3f294 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 10 Mar 2018 16:33:15 -0500
Subject: [PATCH] Prevent Frosted Ice from loading/holding chunks

Datei anzeigen

@ -1,4 +1,4 @@
From 2c3e67315b5181b36cb57ac67ebdd9597143ef48 Mon Sep 17 00:00:00 2001
From 983d36016f7b3064b7a04143e990c790965a838b Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 11 Mar 2018 14:13:33 -0400
Subject: [PATCH] Disable Explicit Network Manager Flushing

Datei anzeigen

@ -1,4 +1,4 @@
From 2ba4f6de1959bc2a38b489f254828ff3706a03a4 Mon Sep 17 00:00:00 2001
From bf57920113426fb120ded5d0a7e25304dd7948b6 Mon Sep 17 00:00:00 2001
From: Minecrell <minecrell@minecrell.net>
Date: Wed, 11 Oct 2017 15:56:26 +0200
Subject: [PATCH] Implement extended PaperServerListPingEvent

Datei anzeigen

@ -1,4 +1,4 @@
From d3414ed95127b00fea16ba31ff5bffabb265c257 Mon Sep 17 00:00:00 2001
From d16134eac30d00f1045815dab121d243f25310d8 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 16 Mar 2018 22:59:43 -0400
Subject: [PATCH] Improved Async Task Scheduler

Datei anzeigen

@ -1,4 +1,4 @@
From 19cf35731b41ad71fec4fb25af08f7f1a7d0c935 Mon Sep 17 00:00:00 2001
From 67709b897f88439ceea818e724fb08d91212b97b Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 18 Mar 2018 11:45:57 -0400
Subject: [PATCH] Ability to change PlayerProfile in AsyncPreLoginEvent

Datei anzeigen

@ -1,4 +1,4 @@
From d8cf6f1f10e675b557b889766262bef7af449357 Mon Sep 17 00:00:00 2001
From 772d05f6f0ea7b1618a3b09a976f96f896ba347b Mon Sep 17 00:00:00 2001
From: MiniDigger <admin@minidigger.me>
Date: Sun, 18 Mar 2018 15:44:44 +0100
Subject: [PATCH] Call PortalCreateEvent for exit portals

Datei anzeigen

@ -1,4 +1,4 @@
From dcfb0b8e176f2f568f19bc1b4277dc320fea2a49 Mon Sep 17 00:00:00 2001
From 91ffaff0c7c58bb3cb3e6be558a3885e768adfac Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 18 Mar 2018 12:29:48 -0400
Subject: [PATCH] Player.setPlayerProfile API
@ -6,7 +6,7 @@ Subject: [PATCH] Player.setPlayerProfile API
This can be useful for changing name or skins after a player has logged in.
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
index 4fb300468..02f5d61c8 100644
index 4fb300468..65f4ea6cc 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -67,7 +67,7 @@ public abstract class EntityHuman extends EntityLiving {
@ -14,7 +14,7 @@ index 4fb300468..02f5d61c8 100644
protected float ca = 0.02F;
private int g;
- private final GameProfile h;
+ private final GameProfile h; public void setProfile(GameProfile profile) { this.h = profile; } // Paper - OBFHELPER
+ private GameProfile h; public void setProfile(GameProfile profile) { this.h = profile; } // Paper - OBFHELPER
private ItemStack cd;
private final ItemCooldown ce;
@Nullable

Datei anzeigen

@ -1,4 +1,4 @@
From 728da88527f9ef0f97324222e0e3266ace89829b Mon Sep 17 00:00:00 2001
From a301af865d9f1156ef56ff89782acc29abafc24b Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 21 Mar 2018 20:52:07 -0400
Subject: [PATCH] Fix Dragon Server Crashes

Datei anzeigen

@ -1,4 +1,4 @@
From 1239414baf466c554e8b32f4d0a2b62888dbd362 Mon Sep 17 00:00:00 2001
From 5f0ce62baa4376aafa88151d7368bf7f7fd18b42 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 22 Mar 2018 01:40:24 -0400
Subject: [PATCH] getPlayerUniqueId API

Datei anzeigen

@ -1,4 +1,4 @@
From 10565b35573ebcedd4d04cd758e98b2ae9378382 Mon Sep 17 00:00:00 2001
From f10e8a5ef24dc16f21bcd5dd130133f2e67d5cca Mon Sep 17 00:00:00 2001
From: Mark Vainomaa <mikroskeem@mikroskeem.eu>
Date: Mon, 26 Mar 2018 18:30:53 +0300
Subject: [PATCH] Make player data saving configurable

Datei anzeigen

@ -1,4 +1,4 @@
From b14bde8370c3facc41743eccbbdca1c9d214a16e Mon Sep 17 00:00:00 2001
From ea72b8b34d10d9f02cf2be8e5f7794398e5f5b6d Mon Sep 17 00:00:00 2001
From: Minecrell <minecrell@minecrell.net>
Date: Wed, 11 Oct 2017 18:22:50 +0200
Subject: [PATCH] Make legacy ping handler more reliable

Datei anzeigen

@ -1,4 +1,4 @@
From 5e73439660c4df0b0212c9f7024fdc4c0fb2a8d2 Mon Sep 17 00:00:00 2001
From 7cf04502231cc70d52e9c3e0ac1c51b472bae3db Mon Sep 17 00:00:00 2001
From: Minecrell <minecrell@minecrell.net>
Date: Wed, 11 Oct 2017 19:30:51 +0200
Subject: [PATCH] Call PaperServerListPingEvent for legacy pings

Datei anzeigen

@ -1,4 +1,4 @@
From 475d170af8eca9b33672045e8ec912903c1e1721 Mon Sep 17 00:00:00 2001
From f86f71a94e99da011a39ed9a64eab9061f32fdb0 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Sat, 31 Mar 2018 17:04:26 +0100
Subject: [PATCH] Flag to disable the channel limit

Datei anzeigen

@ -1,4 +1,4 @@
From de65a13614de10f2b1156623744886ef1972815b Mon Sep 17 00:00:00 2001
From 56a8afcb50c96195f362c2437f93e18f4e0c084c Mon Sep 17 00:00:00 2001
From: Mark Vainomaa <mikroskeem@mikroskeem.eu>
Date: Sun, 1 Apr 2018 02:29:37 +0300
Subject: [PATCH] Add method to open already placed sign

Datei anzeigen

@ -1,4 +1,4 @@
From 0603e9586214f19e3688d2e77b0cceda6d0af5a3 Mon Sep 17 00:00:00 2001
From c087731552e99e275dd9e77406c2047402cc000e Mon Sep 17 00:00:00 2001
From: Kyle Wood <demonwav@gmail.com>
Date: Thu, 1 Mar 2018 19:38:14 -0600
Subject: [PATCH] Load version history at server start

Datei anzeigen

@ -1,4 +1,4 @@
From 86b8ecd4561a6f79d1fc63cf647acdb61988f002 Mon Sep 17 00:00:00 2001
From 3769a500e46acd96215769b0495c589417820678 Mon Sep 17 00:00:00 2001
From: Brokkonaut <hannos17@gmx.de>
Date: Sat, 14 Apr 2018 20:20:46 +0200
Subject: [PATCH] Configurable sprint interruption on attack
@ -19,7 +19,7 @@ index 830b99cd7..87d2dd131 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
index 02f5d61c8..fc5263f08 100644
index 65f4ea6cc..a766a1467 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -1073,7 +1073,11 @@ public abstract class EntityHuman extends EntityLiving {

Datei anzeigen

@ -1,4 +1,4 @@
From d9383d732dda96c14becde6ac9fec90dfea7f475 Mon Sep 17 00:00:00 2001
From 287e5fb213e2806e4e9ecfc08d7d98e55bdb6a12 Mon Sep 17 00:00:00 2001
From: 0x22 <0x22@futureclient.net>
Date: Thu, 26 Apr 2018 04:41:11 -0400
Subject: [PATCH] Fix exploit that allowed colored signs to be created

Datei anzeigen

@ -1,4 +1,4 @@
From 03cfbe82ae05485c6623a88ff810729f97e83ea3 Mon Sep 17 00:00:00 2001
From 716a9a72b32bac7bb06d4b971a4ad877c69aed57 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 30 Apr 2018 13:15:55 -0400
Subject: [PATCH] EndermanEscapeEvent
@ -8,21 +8,18 @@ Fires an event anytime an enderman intends to teleport away from the player
You may cancel this, enabling ranged attacks to damage the enderman for example.
diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java
index 96e29539b..a9020083d 100644
index 96e29539b..e5eb0189d 100644
--- a/src/main/java/net/minecraft/server/EntityEnderman.java
+++ b/src/main/java/net/minecraft/server/EntityEnderman.java
@@ -1,6 +1,10 @@
@@ -1,6 +1,7 @@
package net.minecraft.server;
import java.util.Optional;
+import com.destroystokyo.paper.event.entity.EndermanEscapeEvent;
+import com.google.common.base.Function;
+import com.google.common.base.Predicate;
+
+import com.destroystokyo.paper.event.entity.EndermanEscapeEvent; // Paper
import java.util.Random;
import java.util.UUID;
import java.util.function.Function;
@@ -56,6 +60,12 @@ public class EntityEnderman extends EntityMonster {
@@ -56,6 +57,12 @@ public class EntityEnderman extends EntityMonster {
setGoalTarget(entityliving, org.bukkit.event.entity.EntityTargetEvent.TargetReason.UNKNOWN, true);
}
@ -35,7 +32,7 @@ index 96e29539b..a9020083d 100644
@Override
public boolean setGoalTarget(EntityLiving entityliving, org.bukkit.event.entity.EntityTargetEvent.TargetReason reason, boolean fireEvent) {
if (!super.setGoalTarget(entityliving, reason, fireEvent)) {
@@ -168,7 +178,7 @@ public class EntityEnderman extends EntityMonster {
@@ -168,7 +175,7 @@ public class EntityEnderman extends EntityMonster {
if (this.world.K() && this.ticksLived >= this.bE + 600) {
float f = this.az();
@ -44,7 +41,7 @@ index 96e29539b..a9020083d 100644
this.setGoalTarget((EntityLiving) null);
this.dz();
}
@@ -247,7 +257,7 @@ public class EntityEnderman extends EntityMonster {
@@ -247,7 +254,7 @@ public class EntityEnderman extends EntityMonster {
public boolean damageEntity(DamageSource damagesource, float f) {
if (this.isInvulnerable(damagesource)) {
return false;
@ -53,7 +50,7 @@ index 96e29539b..a9020083d 100644
for (int i = 0; i < 64; ++i) {
if (this.dz()) {
return true;
@@ -258,7 +268,7 @@ public class EntityEnderman extends EntityMonster {
@@ -258,7 +265,7 @@ public class EntityEnderman extends EntityMonster {
} else {
boolean flag = super.damageEntity(damagesource, f);
@ -62,7 +59,7 @@ index 96e29539b..a9020083d 100644
this.dz();
}
@@ -347,7 +357,7 @@ public class EntityEnderman extends EntityMonster {
@@ -347,7 +354,7 @@ public class EntityEnderman extends EntityMonster {
static class PathfinderGoalPlayerWhoLookedAtTarget extends PathfinderGoalNearestAttackableTarget<EntityHuman> {
@ -71,7 +68,7 @@ index 96e29539b..a9020083d 100644
private EntityHuman j;
private int k;
private int l;
@@ -399,7 +409,7 @@ public class EntityEnderman extends EntityMonster {
@@ -399,7 +406,7 @@ public class EntityEnderman extends EntityMonster {
} else {
if (this.d != null) {
if (this.i.f((EntityHuman) this.d)) {

Datei anzeigen

@ -1,4 +1,4 @@
From f097db6d202bd03f02c915f70be4b4fc49923676 Mon Sep 17 00:00:00 2001
From a458c0efb737ec62b90c43fa2c0b98d61a821a2c Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 30 Apr 2018 13:29:44 -0400
Subject: [PATCH] Enderman.teleportRandomly()
@ -6,10 +6,10 @@ Subject: [PATCH] Enderman.teleportRandomly()
Ability to trigger the vanilla "teleport randomly" mechanic of an enderman.
diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java
index a9020083d..a5b517ba9 100644
index e5eb0189d..df94b4ca9 100644
--- a/src/main/java/net/minecraft/server/EntityEnderman.java
+++ b/src/main/java/net/minecraft/server/EntityEnderman.java
@@ -187,6 +187,7 @@ public class EntityEnderman extends EntityMonster {
@@ -184,6 +184,7 @@ public class EntityEnderman extends EntityMonster {
super.mobTick();
}

Datei anzeigen

@ -1,4 +1,4 @@
From a14f188ea1d13b35c826a3639d2258ade1e36df7 Mon Sep 17 00:00:00 2001
From ddfb42a51f7d673527b1b54e5ca22574f7cd417c Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 30 Apr 2018 17:15:26 -0400
Subject: [PATCH] Block Enderpearl Travel Exploit

Datei anzeigen

@ -1,4 +1,4 @@
From d1902f093f9e9e05aa983daa6f46cf1c06269faa Mon Sep 17 00:00:00 2001
From b994e6878b8b8ad432be2825adfbe0418b93321f Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 15 Aug 2017 22:29:12 -0400
Subject: [PATCH] Expand World.spawnParticle API and add Builder
@ -9,38 +9,43 @@ the standard API is to send the packet to everyone in the world, which is ineffe
This adds a new Builder API which is much friendlier to use.
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index c06158e02..49019d54d 100644
index c5da2cde3..4ac2d39c5 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1399,12 +1399,17 @@ public class WorldServer extends World implements IAsyncTaskHandler {
sendParticles(null, enumparticle, flag, d0, d1, d2, i, d3, d4, d5, d6, aint);
@@ -1205,14 +1205,20 @@ public class WorldServer extends World implements IAsyncTaskHandler {
// CraftBukkit - visibility api support
return sendParticles(null, t0, d0, d1, d2, i, d3, d4, d5, d6);
}
-
+ // Paper start - Particle API Expansion
public void sendParticles(EntityPlayer sender, EnumParticle enumparticle, boolean flag, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6, int... aint) {
+ sendParticles(this.players, sender, enumparticle, flag, d0, d1, d2, i, d3, d4, d5, d6, aint);
+ // TODO: rework this, "flag" should probably be exposed as it was before
public <T extends ParticleParam> int sendParticles(EntityPlayer sender, T t0, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6) {
+ return sendParticles(this.players, sender, t0, d0, d1, d2, i, d3, d5, d5, d6);
+ }
+ public void sendParticles(List<? extends EntityHuman> receivers, EntityPlayer sender, EnumParticle enumparticle, boolean flag, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6, int... aint) {
+
+ public <T extends ParticleParam> int sendParticles(List<EntityHuman> receivers, EntityPlayer sender, T t0, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6) {
+ // Paper end
// CraftBukkit end
PacketPlayOutWorldParticles packetplayoutworldparticles = new PacketPlayOutWorldParticles(enumparticle, flag, (float) d0, (float) d1, (float) d2, (float) d3, (float) d4, (float) d5, (float) d6, i, aint);
PacketPlayOutWorldParticles packetplayoutworldparticles = new PacketPlayOutWorldParticles(t0, false, (float) d0, (float) d1, (float) d2, (float) d3, (float) d4, (float) d5, (float) d6, i);
int j = 0;
- for (int j = 0; j < this.players.size(); ++j) {
- EntityPlayer entityplayer = (EntityPlayer) this.players.get(j);
- for (int k = 0; k < this.players.size(); ++k) {
- EntityPlayer entityplayer = (EntityPlayer) this.players.get(k);
+ for (EntityHuman entityhuman : receivers) { // Paper - Particle API Expansion
+ EntityPlayer entityplayer = (EntityPlayer) entityhuman; // Paper - Particle API Expansion
if (sender != null && !entityplayer.getBukkitEntity().canSee(sender.getBukkitEntity())) continue; // CraftBukkit
BlockPosition blockposition = entityplayer.getChunkCoordinates();
double d7 = blockposition.distanceSquared(d0, d1, d2);
if (this.a(entityplayer, false, d0, d1, d2, packetplayoutworldparticles)) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 568a50ec4..36dd8ad60 100644
index 817e29474..3ee663293 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1568,13 +1568,16 @@ public class CraftWorld implements World {
@@ -1596,13 +1596,17 @@ public class CraftWorld implements World {
spawnParticle(particle, location.getX(), location.getY(), location.getZ(), count, offsetX, offsetY, offsetZ, extra, data);
}
+ // Paper start - Particle API Expansion
+ // TODO: Add back extended?
@Override
- public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) {
+ public <T> void spawnParticle(Particle particle, List<Player> receivers, Player sender, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) {
@ -52,9 +57,9 @@ index 568a50ec4..36dd8ad60 100644
- null, // Sender
+ receivers == null ? getHandle().players : receivers.stream().map(player -> ((CraftPlayer) player).getHandle()).collect(java.util.stream.Collectors.toList()), // Paper - Particle API Expansion
+ sender != null ? ((CraftPlayer) sender).getHandle() : null, // Sender // Paper - Particle API Expansion
CraftParticle.toNMS(particle), // Particle
true, // Extended range
CraftParticle.toNMS(particle, data), // Particle
x, y, z, // Position
count, // Count
--
2.18.0

Datei anzeigen

@ -1,4 +1,4 @@
From c21ae9b442a22278ea808e3aca2ce55db5e3b4e2 Mon Sep 17 00:00:00 2001
From bd1fc6d404b1757f48cf368e015fa2cd926ddc41 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 1 May 2018 20:18:54 -0400
Subject: [PATCH] EndermanAttackPlayerEvent
@ -8,10 +8,10 @@ Allow control over whether or not an enderman aggros a player.
This allows you to override/extend the pumpkin/stare logic.
diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java
index 4f8dd320f..2472edfc9 100644
index df94b4ca9..f2fcba3d9 100644
--- a/src/main/java/net/minecraft/server/EntityEnderman.java
+++ b/src/main/java/net/minecraft/server/EntityEnderman.java
@@ -149,7 +149,15 @@ public class EntityEnderman extends EntityMonster {
@@ -135,7 +135,15 @@ public class EntityEnderman extends EntityMonster {
this.setCarried(iblockdata);
}
@ -26,7 +26,7 @@ index 4f8dd320f..2472edfc9 100644
+ // Paper end
ItemStack itemstack = (ItemStack) entityhuman.inventory.armor.get(3);
if (itemstack.getItem() == Item.getItemOf(Blocks.PUMPKIN)) {
if (itemstack.getItem() == Blocks.CARVED_PUMPKIN.getItem()) {
--
2.18.0

Datei anzeigen

@ -1,4 +1,4 @@
From fecfe061f41f0aaced5637ec3813aac206c4bbfc Mon Sep 17 00:00:00 2001
From 78e4b1a11e9bbbff769024b2c6b03f53703c4c96 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 16 May 2018 20:35:16 -0400
Subject: [PATCH] WitchConsumePotionEvent
@ -6,10 +6,10 @@ Subject: [PATCH] WitchConsumePotionEvent
Fires when a witch consumes the potion in their hand
diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java
index ffe72e037..3a00a37eb 100644
index 71d8b6f8f..cf0669589 100644
--- a/src/main/java/net/minecraft/server/EntityWitch.java
+++ b/src/main/java/net/minecraft/server/EntityWitch.java
@@ -71,7 +71,11 @@ public class EntityWitch extends EntityMonster implements IRangedEntity {
@@ -67,7 +67,11 @@ public class EntityWitch extends EntityMonster implements IRangedEntity {
this.setSlot(EnumItemSlot.MAINHAND, ItemStack.a);
if (itemstack.getItem() == Items.POTION) {

Datei anzeigen

@ -1,4 +1,4 @@
From f74306caa08b873b6451ea83f6266b636f92a846 Mon Sep 17 00:00:00 2001
From 65cfb1a62b8a056b7df0cf88f36c9d1f91e794d7 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 16 May 2018 20:44:58 -0400
Subject: [PATCH] WitchThrowPotionEvent
@ -6,11 +6,11 @@ Subject: [PATCH] WitchThrowPotionEvent
Fired when a witch throws a potion at a player
diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java
index 3a00a37eb..bf029ad1c 100644
index cf0669589..59f3f4404 100644
--- a/src/main/java/net/minecraft/server/EntityWitch.java
+++ b/src/main/java/net/minecraft/server/EntityWitch.java
@@ -158,7 +158,15 @@ public class EntityWitch extends EntityMonster implements IRangedEntity {
potionregistry = Potions.I;
@@ -154,7 +154,15 @@ public class EntityWitch extends EntityMonster implements IRangedEntity {
potionregistry = Potions.M;
}
- EntityPotion entitypotion = new EntityPotion(this.world, this, PotionUtil.a(new ItemStack(Items.SPLASH_POTION), potionregistry));

Datei anzeigen

@ -1,4 +1,4 @@
From 4bc77441489cc2558b2ce88fa55a8ba6f424f4c5 Mon Sep 17 00:00:00 2001
From be82462fb805084618fd8d81ff669d755683b5f8 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 4 Jun 2018 20:39:20 -0400
Subject: [PATCH] Allow spawning Item entities with World.spawnEntity
@ -8,10 +8,10 @@ This API has more capabilities than .dropItem with the Consumer function
Item can be set inside of the Consumer pre spawn function.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 36dd8ad60..e88846bb5 100644
index 3ee663293..65ad8e588 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -953,6 +953,10 @@ public class CraftWorld implements World {
@@ -956,6 +956,10 @@ public class CraftWorld implements World {
if (Boat.class.isAssignableFrom(clazz)) {
entity = new EntityBoat(world, x, y, z);
entity.setPositionRotation(x, y, z, yaw, pitch);

Datei anzeigen

@ -0,0 +1,27 @@
From 167ec27d5b5c5e20f65383f55148e8594a74e71c Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 5 Jun 2018 00:32:22 -0400
Subject: [PATCH] Don't load chunks for villager door checks
This avoids villages spam loading chunks sync
diff --git a/src/main/java/net/minecraft/server/Village.java b/src/main/java/net/minecraft/server/Village.java
index dfcabb83a..22fe23e8e 100644
--- a/src/main/java/net/minecraft/server/Village.java
+++ b/src/main/java/net/minecraft/server/Village.java
@@ -313,6 +313,12 @@ public class Village {
private boolean g(BlockPosition blockposition) {
IBlockData iblockdata = this.a.getType(blockposition);
+ // Paper start
+ if (!this.a.isChunkLoaded(blockposition.getX() >> 4, blockposition.getZ() >> 4, true )) {
+ return false;
+ }
+ // Paper end
+
Block block = iblockdata.getBlock();
return block instanceof BlockDoor ? iblockdata.getMaterial() == Material.WOOD : false;
--
2.18.0

Datei anzeigen

@ -1,14 +1,14 @@
From 9b2c59ff0e6e55277a90fb849e165628e655b557 Mon Sep 17 00:00:00 2001
From c595540dc8bbe9c2513d490d4f24da14ac678e90 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 5 Jun 2018 22:47:26 -0400
Subject: [PATCH] WitchReadyPotionEvent
diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java
index bf029ad1c..035aa4a90 100644
index 59f3f4404..45b6e2b7b 100644
--- a/src/main/java/net/minecraft/server/EntityWitch.java
+++ b/src/main/java/net/minecraft/server/EntityWitch.java
@@ -104,7 +104,11 @@ public class EntityWitch extends EntityMonster implements IRangedEntity {
@@ -100,7 +100,11 @@ public class EntityWitch extends EntityMonster implements IRangedEntity {
}
if (potionregistry != null) {
@ -18,9 +18,9 @@ index bf029ad1c..035aa4a90 100644
+ org.bukkit.inventory.ItemStack bukkitStack = com.destroystokyo.paper.event.entity.WitchReadyPotionEvent.process((org.bukkit.entity.Witch) this.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(potion));
+ this.setSlot(EnumItemSlot.MAINHAND, org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(bukkitStack));
+ // Paper end
this.bx = this.getItemInMainHand().m();
this.bC = this.getItemInMainHand().k();
this.a(true);
this.world.a((EntityHuman) null, this.locX, this.locY, this.locZ, SoundEffects.iz, this.bK(), 1.0F, 0.8F + this.random.nextFloat() * 0.4F);
this.world.a((EntityHuman) null, this.locX, this.locY, this.locZ, SoundEffects.ENTITY_WITCH_DRINK, this.bV(), 1.0F, 0.8F + this.random.nextFloat() * 0.4F);
--
2.18.0

Datei anzeigen

@ -1,4 +1,4 @@
From addea0ca53003e381887f658b0a8bbd823c8c921 Mon Sep 17 00:00:00 2001
From 742b78090e01bf2da099c7aa1cfb579b55a22404 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 5 Jun 2018 23:00:29 -0400
Subject: [PATCH] ItemStack#getMaxItemUseDuration
@ -6,22 +6,22 @@ Subject: [PATCH] ItemStack#getMaxItemUseDuration
Allows you to determine how long it takes to use a usable/consumable item
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
index f6b802dc8..6521bb508 100644
index be6205275..a4a5058da 100644
--- a/src/main/java/net/minecraft/server/ItemStack.java
+++ b/src/main/java/net/minecraft/server/ItemStack.java
@@ -561,6 +561,7 @@ public final class ItemStack {
@@ -508,6 +508,7 @@ public final class ItemStack {
this.getItem().b(this, world, entityhuman);
}
+ public int getItemUseMaxDuration() { return m(); } // Paper - OBFHELPER
public int m() {
return this.getItem().e(this);
+ public int getItemUseMaxDuration() { return k(); } // Paper - OBFHELPER
public int k() {
return this.getItem().c(this);
}
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
index aa99254ff..be6589dbf 100644
index b1e0d6185..03f611518 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@@ -180,6 +180,13 @@ public final class CraftItemStack extends ItemStack {
@@ -182,6 +182,13 @@ public final class CraftItemStack extends ItemStack {
return (handle == null) ? Material.AIR.getMaxStackSize() : handle.getItem().getMaxStackSize();
}

Datei anzeigen

@ -1,14 +1,14 @@
From 9c9d717e44fe7c7f4eb708505ce8efde66b5902c Mon Sep 17 00:00:00 2001
From b62ffab61e8f8a6ca78f1acb1da95db871cf408d Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Sat, 9 Jun 2018 14:08:39 +0200
Subject: [PATCH] Implement EntityTeleportEndGatewayEvent
diff --git a/src/main/java/net/minecraft/server/TileEntityEndGateway.java b/src/main/java/net/minecraft/server/TileEntityEndGateway.java
index ecbc48b0c..557f06017 100644
index c3d30dc94..fd9be7574 100644
--- a/src/main/java/net/minecraft/server/TileEntityEndGateway.java
+++ b/src/main/java/net/minecraft/server/TileEntityEndGateway.java
@@ -136,8 +136,19 @@ public class TileEntityEndGateway extends TileEntityEnderPortal implements ITick
@@ -138,8 +138,19 @@ public class TileEntityEndGateway extends TileEntityEnderPortal implements ITick
}
// CraftBukkit end
@ -28,7 +28,7 @@ index ecbc48b0c..557f06017 100644
+ // Paper end - EntityTeleportEndGatewayEvent
}
this.h();
this.f();
--
2.18.0

Datei anzeigen

@ -1,4 +1,4 @@
From 1509b59adc8a4d13fa996e12d2cd82db842edaa5 Mon Sep 17 00:00:00 2001
From bb4b850e8fbe86ec7922235c37213b0fef34992c Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 10 Jun 2018 01:18:49 -0400
Subject: [PATCH] Unset Ignited flag on cancel of Explosion Event
@ -6,20 +6,20 @@ Subject: [PATCH] Unset Ignited flag on cancel of Explosion Event
Otherwise the creeper infinite explodes
diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java
index 8098d4d9f..67ba72fc1 100644
index f37169d73..86935f70a 100644
--- a/src/main/java/net/minecraft/server/EntityCreeper.java
+++ b/src/main/java/net/minecraft/server/EntityCreeper.java
@@ -12,7 +12,7 @@ public class EntityCreeper extends EntityMonster {
private static final DataWatcherObject<Integer> a = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.b);
private static final DataWatcherObject<Boolean> b = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.h);
- private static final DataWatcherObject<Boolean> c = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.h);
+ private static final DataWatcherObject<Boolean> c = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.h); private static final DataWatcherObject<Boolean> isIgnitedDW = c; // Paper OBFHELPER
private int bx;
private static final DataWatcherObject<Boolean> b = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.i);
- private static final DataWatcherObject<Boolean> c = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.i);
+ private static final DataWatcherObject<Boolean> c = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.i);private static final DataWatcherObject<Boolean> isIgnitedDW = c; // Paper OBFHELPER
private int bC;
private int fuseTicks;
public int maxFuseTicks = 30; // PAIL private -> public
@@ -213,6 +213,7 @@ public class EntityCreeper extends EntityMonster {
this.ds();
public int maxFuseTicks = 30;
@@ -205,6 +205,7 @@ public class EntityCreeper extends EntityMonster {
this.dF();
} else {
fuseTicks = 0;
+ this.datawatcher.set(isIgnitedDW, Boolean.valueOf(false)); // Paper

Datei anzeigen

@ -1,4 +1,4 @@
From b770be1d1eb24d049cd7ca1af1a96bb87aed62e3 Mon Sep 17 00:00:00 2001
From 0eda9304279c487452a245265cbe6424c3ffe621 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 10 Jun 2018 20:04:42 -0400
Subject: [PATCH] Properly remove entities on dimension teleport
@ -22,10 +22,10 @@ requirement, but plugins (such as my own) use this method to
trigger a "reload" of the entity on the client.
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 7b17c32bb..d03e7c24f 100644
index cd1639e26..ea42800ae 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -2449,7 +2449,7 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper
@@ -2594,7 +2594,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
}
// CraftBukkit end */
@ -35,10 +35,10 @@ index 7b17c32bb..d03e7c24f 100644
this.world.methodProfiler.a("reposition");
/* CraftBukkit start - Handled in calculateTarget
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 49019d54d..9fe5c4406 100644
index 4ac2d39c5..d6d3ffa6f 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1205,6 +1205,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
@@ -1025,6 +1025,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
}
protected void c(Entity entity) {

Datei anzeigen

@ -1,4 +1,4 @@
From 1918db5df9aff0309e3d25610f655a31c2cac838 Mon Sep 17 00:00:00 2001
From 911bd570a1600cea8bd2063db8034d5f6ce2abf1 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 10 Jun 2018 20:20:15 -0400
Subject: [PATCH] Fix CraftEntity hashCode
@ -21,10 +21,10 @@ check is essentially the same as this.getHandle() == other.getHandle()
However, replaced it too to make it clearer of intent.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index bf7e6ed3f..47edc0494 100644
index 6d4dc539c..7da6a25f1 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -510,14 +510,15 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@@ -525,14 +525,15 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
return false;
}
final CraftEntity other = (CraftEntity) obj;

Datei anzeigen

@ -1,4 +1,4 @@
From 344d6a6d7a9064a574630afb79761a5f9fe55811 Mon Sep 17 00:00:00 2001
From 54edbfe52febfcb3b7c58362af32cfcab27a5121 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 15 Jun 2018 00:30:32 -0400
Subject: [PATCH] Configurable Alternative LootPool Luck Formula
@ -53,7 +53,7 @@ index b602bbf12..62bce1806 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/LotoSelectorEntry.java b/src/main/java/net/minecraft/server/LotoSelectorEntry.java
index b2860555d..b5544bcf3 100644
index a540167d6..d8a882191 100644
--- a/src/main/java/net/minecraft/server/LotoSelectorEntry.java
+++ b/src/main/java/net/minecraft/server/LotoSelectorEntry.java
@@ -14,8 +14,8 @@ import java.util.Random;

Datei anzeigen

@ -1,18 +1,18 @@
From 2948ef6de198c4a1fb763df1d5590c77a3dc0128 Mon Sep 17 00:00:00 2001
From 1264d06b00fbafc737c7ca4f6baf8b2276352e9a Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 15 Jun 2018 20:37:03 -0400
Subject: [PATCH] Print Error details when failing to save player data
diff --git a/src/main/java/net/minecraft/server/WorldNBTStorage.java b/src/main/java/net/minecraft/server/WorldNBTStorage.java
index 4e33cc2f2..4bb6f600d 100644
index cbfdb3cf7..9a243010d 100644
--- a/src/main/java/net/minecraft/server/WorldNBTStorage.java
+++ b/src/main/java/net/minecraft/server/WorldNBTStorage.java
@@ -155,7 +155,7 @@ public class WorldNBTStorage implements IDataManager, IPlayerFileData {
@@ -157,7 +157,7 @@ public class WorldNBTStorage implements IDataManager, IPlayerFileData {
file.renameTo(file1);
} catch (Exception exception) {
- WorldNBTStorage.b.warn("Failed to save player data for {}", entityhuman.getName());
- WorldNBTStorage.b.warn("Failed to save player data for {}", entityhuman.getDisplayName().getString());
+ WorldNBTStorage.b.error("Failed to save player data for {}", entityhuman.getName(), exception); // Paper
}

Datei anzeigen

@ -1,14 +1,14 @@
From 29599c88d5f36c9ade555f7a6d7890cc78c126f1 Mon Sep 17 00:00:00 2001
From e3a3b4b4a047ad0c09193b186e6345da16427ef2 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Sat, 16 Jun 2018 01:18:16 -0500
Subject: [PATCH] Make shield blocking delay configurable
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 03a9a96fc..99ad40fa3 100644
index 5a9c68e4f..650addb84 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -519,4 +519,9 @@ public class PaperWorldConfig {
@@ -434,4 +434,9 @@ public class PaperWorldConfig {
disableEnderpearlExploit = getBoolean("game-mechanics.disable-unloaded-chunk-enderpearl-exploit", disableEnderpearlExploit);
log("Disable Unloaded Chunk Enderpearl Exploit: " + (disableEnderpearlExploit ? "enabled" : "disabled"));
}
@ -19,20 +19,20 @@ index 03a9a96fc..99ad40fa3 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 9adcabd4f..65bc19b17 100644
index 401410b87..1932d38a8 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -2481,7 +2481,7 @@ public abstract class EntityLiving extends Entity {
@@ -2584,7 +2584,7 @@ public abstract class EntityLiving extends Entity {
if (this.isHandRaised() && !this.activeItem.isEmpty()) {
Item item = this.activeItem.getItem();
- return item.f(this.activeItem) != EnumAnimation.BLOCK ? false : item.e(this.activeItem) - this.bp >= 5;
+ return item.f(this.activeItem) != EnumAnimation.BLOCK ? false : item.e(this.activeItem) - this.bp >= getShieldBlockingDelay(); // Paper - shieldBlockingDelay
- return item.d(this.activeItem) != EnumAnimation.BLOCK ? false : item.c(this.activeItem) - this.bu >= 5;
+ return item.d(this.activeItem) != EnumAnimation.BLOCK ? false : item.c(this.activeItem) - this.bu >= getShieldBlockingDelay(); // Paper - shieldBlockingDelay
} else {
return false;
}
@@ -2569,4 +2569,16 @@ public abstract class EntityLiving extends Entity {
public boolean cS() {
@@ -2672,4 +2672,16 @@ public abstract class EntityLiving extends Entity {
public boolean de() {
return true;
}
+
@ -49,10 +49,10 @@ index 9adcabd4f..65bc19b17 100644
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index a7b076377..14fb474f7 100644
index 487bb9ece..0237ac769 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -515,5 +515,15 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
@@ -529,5 +529,15 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
public void setArrowsStuck(int arrows) {
getHandle().setArrowCount(arrows);
}

Datei anzeigen

@ -0,0 +1,39 @@
From 3699a4c4a5985731a052980b1daf296832225ba7 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 16 Jun 2018 16:23:38 -0400
Subject: [PATCH] Ignore Missing Recipes in RecipeBook to avoid data errors
This code was causing NPE's in saving player data, potentially related to reloads.
diff --git a/src/main/java/net/minecraft/server/RecipeBookServer.java b/src/main/java/net/minecraft/server/RecipeBookServer.java
index 71d6c4552..893f67094 100644
--- a/src/main/java/net/minecraft/server/RecipeBookServer.java
+++ b/src/main/java/net/minecraft/server/RecipeBookServer.java
@@ -77,7 +77,11 @@ public class RecipeBookServer extends RecipeBook {
while (iterator.hasNext()) {
MinecraftKey minecraftkey = (MinecraftKey) iterator.next();
- nbttaglist.add((NBTBase) (new NBTTagString(minecraftkey.toString())));
+ // Paper start - ignore missing recipes
+ IRecipe recipe = this.h.a(minecraftkey);
+ if (recipe == null) continue;
+ nbttaglist.add(new NBTTagString(minecraftkey.toString()))
+ // Paper end
}
nbttagcompound.set("recipes", nbttaglist);
@@ -87,6 +91,11 @@ public class RecipeBookServer extends RecipeBook {
while (iterator1.hasNext()) {
MinecraftKey minecraftkey1 = (MinecraftKey) iterator1.next();
+ // Paper start - ignore missing recipes
+ IRecipe recipe = this.h.a(minecraftkey1);
+ if (recipe == null) continue;
+ // Paper end
+
nbttaglist1.add((NBTBase) (new NBTTagString(minecraftkey1.toString())));
}
--
2.18.0

Datei anzeigen

@ -1,4 +1,4 @@
From 1d8b96b5181f2c507c7022b773c8fcf384f065e4 Mon Sep 17 00:00:00 2001
From 33ad36b25fb1f912a2f7c9af192694bcc0caf386 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 15 Jun 2013 19:51:17 -0400
Subject: [PATCH] EntityShootBowEvent consumeArrow and getArrowItem API
@ -6,10 +6,10 @@ Subject: [PATCH] EntityShootBowEvent consumeArrow and getArrowItem API
Adds ability to get what arrow was shot, and control if it should be consumed.
diff --git a/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java b/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java
index b92cf8e62..8f4b63c8d 100644
index c2bc8060a..1ae967d1c 100644
--- a/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java
+++ b/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java
@@ -161,7 +161,7 @@ public abstract class EntitySkeletonAbstract extends EntityMonster implements IR
@@ -160,7 +160,7 @@ public abstract class EntitySkeletonAbstract extends EntityMonster implements IR
entityarrow.shoot(d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - this.world.getDifficulty().a() * 4));
// CraftBukkit start
@ -19,10 +19,10 @@ index b92cf8e62..8f4b63c8d 100644
event.getProjectile().remove();
return;
diff --git a/src/main/java/net/minecraft/server/ItemBow.java b/src/main/java/net/minecraft/server/ItemBow.java
index e943f8054..327d31e19 100644
index 4aa3b6249..c8fc18045 100644
--- a/src/main/java/net/minecraft/server/ItemBow.java
+++ b/src/main/java/net/minecraft/server/ItemBow.java
@@ -53,6 +53,7 @@ public class ItemBow extends Item {
@@ -57,6 +57,7 @@ public class ItemBow extends Item {
if ((double) f >= 0.1D) {
boolean flag1 = flag && itemstack1.getItem() == Items.ARROW;
@ -30,7 +30,7 @@ index e943f8054..327d31e19 100644
if (!world.isClientSide) {
ItemArrow itemarrow = (ItemArrow) ((ItemArrow) (itemstack1.getItem() instanceof ItemArrow ? itemstack1.getItem() : Items.ARROW));
EntityArrow entityarrow = itemarrow.a(world, itemstack1, (EntityLiving) entityhuman);
@@ -85,14 +86,15 @@ public class ItemBow extends Item {
@@ -89,14 +90,15 @@ public class ItemBow extends Item {
// CraftBukkit end
}
// CraftBukkit start
@ -48,17 +48,17 @@ index e943f8054..327d31e19 100644
entityarrow.fromPlayer = EntityArrow.PickupStatus.CREATIVE_ONLY;
}
@@ -108,7 +110,7 @@ public class ItemBow extends Item {
@@ -112,7 +114,7 @@ public class ItemBow extends Item {
}
world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.w, SoundCategory.PLAYERS, 1.0F, 1.0F / (ItemBow.j.nextFloat() * 0.4F + 1.2F) + f * 0.5F);
world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_ARROW_SHOOT, SoundCategory.PLAYERS, 1.0F, 1.0F / (ItemBow.k.nextFloat() * 0.4F + 1.2F) + f * 0.5F);
- if (!flag1 && !entityhuman.abilities.canInstantlyBuild) {
+ if (!flag1 && !entityhuman.abilities.canInstantlyBuild && consumeArrow) { // Paper
itemstack1.subtract(1);
if (itemstack1.isEmpty()) {
entityhuman.inventory.f(itemstack1);
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 5f816e44f..9b19c055d 100644
index 3f9a66002..77973c1e8 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -241,7 +241,7 @@ public class CraftEventFactory {

Datei anzeigen

@ -1,4 +1,4 @@
From dd4eb3f1e29bd1c58e58a7cc75e02bd284c11938 Mon Sep 17 00:00:00 2001
From cfa73fb04d7d4cdaba5282465c28d6abeed5f533 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 18 Jun 2018 01:12:53 -0400
Subject: [PATCH] PlayerReadyArrowEvent
@ -7,7 +7,7 @@ Called when a player is firing a bow and the server is choosing an arrow to use.
Plugins can skip selection of certain arrows and control which is used.
diff --git a/src/main/java/net/minecraft/server/ItemBow.java b/src/main/java/net/minecraft/server/ItemBow.java
index 327d31e19..44e7be58e 100644
index c8fc18045..de0d80361 100644
--- a/src/main/java/net/minecraft/server/ItemBow.java
+++ b/src/main/java/net/minecraft/server/ItemBow.java
@@ -1,5 +1,6 @@
@ -17,35 +17,35 @@ index 327d31e19..44e7be58e 100644
import org.bukkit.event.entity.EntityCombustEvent; // CraftBukkit
public class ItemBow extends Item {
@@ -14,16 +15,16 @@ public class ItemBow extends Item {
});
@@ -18,16 +19,16 @@ public class ItemBow extends Item {
// CraftBukkit end
}
- private ItemStack a(EntityHuman entityhuman) {
- if (this.d(entityhuman.b(EnumHand.OFF_HAND))) {
- if (this.e_(entityhuman.b(EnumHand.OFF_HAND))) {
+ private ItemStack a(EntityHuman entityhuman, ItemStack bow) { // Paper
+ if (this.d(entityhuman, bow, entityhuman.b(EnumHand.OFF_HAND))) { // Paper
+ if (this.e_(entityhuman, bow, entityhuman.b(EnumHand.OFF_HAND))) { // Paper
return entityhuman.b(EnumHand.OFF_HAND);
- } else if (this.d(entityhuman.b(EnumHand.MAIN_HAND))) {
+ } else if (this.d(entityhuman, bow, entityhuman.b(EnumHand.MAIN_HAND))) { // Paper
- } else if (this.e_(entityhuman.b(EnumHand.MAIN_HAND))) {
+ } else if (this.e_(entityhuman, bow, entityhuman.b(EnumHand.MAIN_HAND))) {
return entityhuman.b(EnumHand.MAIN_HAND);
} else {
for (int i = 0; i < entityhuman.inventory.getSize(); ++i) {
ItemStack itemstack = entityhuman.inventory.getItem(i);
- if (this.d(itemstack)) {
+ if (this.d(entityhuman, bow, itemstack)) { // Paper
- if (this.e_(itemstack)) {
+ if (this.e_(entityhuman, bow, itemstack)) {
return itemstack;
}
}
@@ -32,15 +33,23 @@ public class ItemBow extends Item {
@@ -36,15 +37,23 @@ public class ItemBow extends Item {
}
}
- protected boolean d(ItemStack itemstack) {
- protected boolean e_(ItemStack itemstack) {
- return itemstack.getItem() instanceof ItemArrow;
+ // Paper start
+ protected boolean d(EntityHuman player, ItemStack bow, ItemStack itemstack) {
+ protected boolean e_(EntityHuman player, ItemStack bow, ItemStack itemstack) {
+ return itemstack.getItem() instanceof ItemArrow && (
+ !(player instanceof EntityPlayer) ||
+ new com.destroystokyo.paper.event.player.PlayerReadyArrowEvent(
@ -65,7 +65,7 @@ index 327d31e19..44e7be58e 100644
if (!itemstack1.isEmpty() || flag) {
if (itemstack1.isEmpty()) {
@@ -144,7 +153,7 @@ public class ItemBow extends Item {
@@ -148,7 +157,7 @@ public class ItemBow extends Item {
public InteractionResultWrapper<ItemStack> a(World world, EntityHuman entityhuman, EnumHand enumhand) {
ItemStack itemstack = entityhuman.b(enumhand);

Datei anzeigen

@ -1,11 +1,11 @@
From 81e31ca23b57f80911c332ec7fe349b793807ff7 Mon Sep 17 00:00:00 2001
From f1f4d49df927e056071d0adf4b9bfafdab70d248 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 18 Jun 2018 22:19:36 -0400
Subject: [PATCH] Fire EntityShootBowEvent for Illusioner
diff --git a/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java b/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java
index e03650448..ad81bd059 100644
index d03fa6318..16c3be42e 100644
--- a/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java
+++ b/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java
@@ -123,8 +123,18 @@ public class EntityIllagerIllusioner extends EntityIllagerWizard implements IRan
@ -22,12 +22,12 @@ index e03650448..ad81bd059 100644
+ if (event.getProjectile() == entityarrow.getBukkitEntity()) {
+ this.world.addEntity(entityarrow);
+ }
this.a(SoundEffects.gW, 1.0F, 1.0F / (this.getRandom().nextFloat() * 0.4F + 0.8F));
this.a(SoundEffects.ENTITY_SKELETON_SHOOT, 1.0F, 1.0F / (this.getRandom().nextFloat() * 0.4F + 0.8F));
- this.world.addEntity(entityarrow);
+ // Paper end
}
protected EntityArrow r(float f) {
protected EntityArrow v(float f) {
--
2.18.0

Datei anzeigen

@ -1,4 +1,4 @@
From ac9417f28697dc1441c73a1580541752f9dea2c3 Mon Sep 17 00:00:00 2001
From 8388c79bcacf4deee2c48182f5e38a22cf27b937 Mon Sep 17 00:00:00 2001
From: Brokkonaut <hannos17@gmx.de>
Date: Mon, 18 Jun 2018 15:46:23 +0200
Subject: [PATCH] Implement EntityKnockbackByEntityEvent
@ -6,10 +6,10 @@ Subject: [PATCH] Implement EntityKnockbackByEntityEvent
This event is called when an entity receives knockback by another entity.
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 65bc19b17..156bf8ee0 100644
index 1932d38a8..1d7b9c525 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -1160,6 +1160,12 @@ public abstract class EntityLiving extends Entity {
@@ -1168,6 +1168,12 @@ public abstract class EntityLiving extends Entity {
this.impulse = true;
float f1 = MathHelper.sqrt(d0 * d0 + d1 * d1);
@ -22,7 +22,7 @@ index 65bc19b17..156bf8ee0 100644
this.motX /= 2.0D;
this.motZ /= 2.0D;
this.motX -= d0 / (double) f1 * (double) f;
@@ -1172,6 +1178,18 @@ public abstract class EntityLiving extends Entity {
@@ -1180,6 +1186,18 @@ public abstract class EntityLiving extends Entity {
}
}

Datei anzeigen

@ -1,4 +1,4 @@
From 20e4111eafc2445a21fcfea8cee7670cf559ad23 Mon Sep 17 00:00:00 2001
From 26362a9e57b185137802bd03984d13350fbb1c66 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 20 Jun 2018 23:17:24 -0400
Subject: [PATCH] Expand Explosions API
@ -6,10 +6,10 @@ Subject: [PATCH] Expand Explosions API
Add Entity as a Source capability, and add more API choices, and on Location.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index e88846bb5..e2da30d88 100644
index 65ad8e588..0640ca094 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -579,6 +579,11 @@ public class CraftWorld implements World {
@@ -568,6 +568,11 @@ public class CraftWorld implements World {
public boolean createExplosion(double x, double y, double z, float power, boolean setFire, boolean breakBlocks) {
return !world.createExplosion(null, x, y, z, power, setFire, breakBlocks).wasCanceled;
}

Datei anzeigen

@ -1,4 +1,4 @@
From 14736699b8f04a3ba9fe7e1ded6ab047a0e9cb4d Mon Sep 17 00:00:00 2001
From 35c788a70a57c803f5042576501d679b63acac95 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 29 Jun 2018 00:21:28 -0400
Subject: [PATCH] LivingEntity Hand Raised/Item Use API
@ -6,32 +6,32 @@ Subject: [PATCH] LivingEntity Hand Raised/Item Use API
How long an entity has raised hands to charge an attack or use an item
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 156bf8ee0..14637be49 100644
index 1d7b9c525..6036915a8 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -2466,14 +2466,17 @@ public abstract class EntityLiving extends Entity {
@@ -2569,14 +2569,17 @@ public abstract class EntityLiving extends Entity {
}
+ public ItemStack getActiveItem() { return cJ(); } // Paper - OBFHELPER
public ItemStack cJ() {
+ public ItemStack getActiveItem() { return cV(); } // Paper - OBFHELPER
public ItemStack cV() {
return this.activeItem;
}
+ public int getItemUseRemainingTime() { return cK(); } // Paper - OBFHELPER
public int cK() {
return this.bp;
+ public int getItemUseRemainingTime() { return cW(); } // Paper - OBFHELPER
public int cW() {
return this.bu;
}
+ public int getHandRaisedTime() { return cL(); } // Paper - OBFHELPER
public int cL() {
return this.isHandRaised() ? this.activeItem.m() - this.cK() : 0;
+ public int getHandRaisedTime() { return cX(); } // Paper - OBFHELPER
public int cX() {
return this.isHandRaised() ? this.activeItem.k() - this.cW() : 0;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 14fb474f7..9c750efc7 100644
index 0237ac769..8b3659c82 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -525,5 +525,25 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
@@ -539,5 +539,25 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
public void setShieldBlockingDelay(int delay) {
getHandle().setShieldBlockingDelay(delay);
}

Datei anzeigen

@ -1,4 +1,4 @@
From 52f2f41cf15f8c3bb9903e8e97692a3d903b6a1c Mon Sep 17 00:00:00 2001
From c763b60d79c10df70c2010fd45cfc5c614ea4989 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 26 Jun 2018 22:00:49 -0400
Subject: [PATCH] RangedEntity API
@ -32,19 +32,18 @@ index 000000000..696660b08
+ }
+}
diff --git a/src/main/java/net/minecraft/server/IRangedEntity.java b/src/main/java/net/minecraft/server/IRangedEntity.java
index a8af5917c..ba8b47c02 100644
index 4fd69850f..7fe65b7c2 100644
--- a/src/main/java/net/minecraft/server/IRangedEntity.java
+++ b/src/main/java/net/minecraft/server/IRangedEntity.java
@@ -2,7 +2,8 @@ package net.minecraft.server;
@@ -2,7 +2,7 @@ package net.minecraft.server;
public interface IRangedEntity {
- void a(EntityLiving entityliving, float f);
+ void a(EntityLiving entityliving, float f); default void rangedAttack(EntityLiving entityliving, float f) { a(entityliving, f); } // Paper OBF HELPER
- void p(boolean flag);
+
+ void p(boolean flag); default void setChargingAttack(boolean flag) { p(flag); } // Paper OBF HELPER
- void s(boolean flag);
+ void s(boolean flag); default void setChargingAttack(boolean flag) { s(flag); } // Paper OBF HELPER
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftIllusioner.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftIllusioner.java
index 2ec1af8be..f31d3eed3 100644

Datei anzeigen

@ -1,4 +1,4 @@
From 5c342142d7b1abdbce2e22f61a6bcf1cdda3e2e4 Mon Sep 17 00:00:00 2001
From 923fa0b5285af72441ed22be05ac210c2a88ea2d Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 1 Jul 2018 22:06:29 -0400
Subject: [PATCH] Add SentientNPC Interface to Entities
@ -160,25 +160,6 @@ index 6bf30c834..3768b9573 100644
public CraftSlime(CraftServer server, EntitySlime entity) {
super(server, entity);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWaterMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWaterMob.java
index ee21d7b6e..f67dff38f 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWaterMob.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWaterMob.java
@@ -1,12 +1,13 @@
package org.bukkit.craftbukkit.entity;
+import com.destroystokyo.paper.entity.CraftSentientNPC;
import net.minecraft.server.EntityWaterAnimal;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.WaterMob;
-public class CraftWaterMob extends CraftLivingEntity implements WaterMob {
+public class CraftWaterMob extends CraftLivingEntity implements WaterMob, CraftSentientNPC { // Paper
public CraftWaterMob(CraftServer server, EntityWaterAnimal entity) {
super(server, entity);
--
2.18.0

Datei anzeigen

@ -1,4 +1,4 @@
From e66cac106ad45ebee9efc27046d70074f702add0 Mon Sep 17 00:00:00 2001
From 2d3a37ac2163232c2248522bb60d1df3c5debeab Mon Sep 17 00:00:00 2001
From: Brokkonaut <hannos17@gmx.de>
Date: Sat, 30 Jun 2018 05:45:39 +0200
Subject: [PATCH] Improve ProjectileHitEvent to include the BlockFace where the
@ -6,10 +6,10 @@ Subject: [PATCH] Improve ProjectileHitEvent to include the BlockFace where the
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 9b19c055d..248873fb4 100644
index 77973c1e8..c129e8629 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -836,7 +836,7 @@ public class CraftEventFactory {
@@ -821,7 +821,7 @@ public class CraftEventFactory {
hitBlock = entity.getBukkitEntity().getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
}

Datei anzeigen

@ -1,14 +1,14 @@
From 0928ca54d1f1a8ff9ab5cf229712c4eb7cf08359 Mon Sep 17 00:00:00 2001
From 5c3b9b90ff445eb042d1153c33ee12c99abe7320 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Fri, 22 Jun 2018 10:38:31 -0500
Subject: [PATCH] Add config to disable ender dragon legacy check
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 99ad40fa3..06c54690f 100644
index 650addb84..b2855f3ca 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -524,4 +524,9 @@ public class PaperWorldConfig {
@@ -439,4 +439,9 @@ public class PaperWorldConfig {
private void shieldBlockingDelay() {
shieldBlockingDelay = getInt("game-mechanics.shield-blocking-delay", 5);
}
@ -19,10 +19,10 @@ index 99ad40fa3..06c54690f 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/EnderDragonBattle.java b/src/main/java/net/minecraft/server/EnderDragonBattle.java
index ce0dcbc68..286069746 100644
index a20d54ee3..48bcda0f5 100644
--- a/src/main/java/net/minecraft/server/EnderDragonBattle.java
+++ b/src/main/java/net/minecraft/server/EnderDragonBattle.java
@@ -30,9 +30,12 @@ public class EnderDragonBattle {
@@ -29,9 +29,12 @@ public class EnderDragonBattle {
private int h;
private int i;
private int j;
@ -35,9 +35,9 @@ index ce0dcbc68..286069746 100644
private boolean n;
private BlockPosition o;
private EnumDragonRespawn p;
@@ -42,7 +45,10 @@ public class EnderDragonBattle {
@@ -41,7 +44,10 @@ public class EnderDragonBattle {
public EnderDragonBattle(WorldServer worldserver, NBTTagCompound nbttagcompound) {
this.c = (BossBattleServer) (new BossBattleServer(new ChatMessage("entity.EnderDragon.name", new Object[0]), BossBattle.BarColor.PINK, BossBattle.BarStyle.PROGRESS)).setPlayMusic(true).c(true);
this.c = (BossBattleServer) (new BossBattleServer(new ChatMessage("entity.minecraft.ender_dragon", new Object[0]), BossBattle.BarColor.PINK, BossBattle.BarStyle.PROGRESS)).setPlayMusic(true).c(true);
this.e = Lists.newArrayList();
- this.n = true;
+ // Paper start

Datei anzeigen

@ -1,14 +1,14 @@
From 5ec6400e2dacd349692bfb12ae6dadce5fa2d394 Mon Sep 17 00:00:00 2001
From d1cd6c4e02129546254dadf0314ac6da5c3027e5 Mon Sep 17 00:00:00 2001
From: Brokkonaut <hannos17@gmx.de>
Date: Tue, 3 Jul 2018 16:08:14 +0200
Subject: [PATCH] Implement World.getEntity(UUID) API
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index e2da30d88..210e3bc4e 100644
index 0640ca094..6705864a7 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -791,6 +791,14 @@ public class CraftWorld implements World {
@@ -776,6 +776,14 @@ public class CraftWorld implements World {
return list;
}

Datei anzeigen

@ -1,4 +1,4 @@
From c5d1182aa2daec8a3627d2295b105756845013b7 Mon Sep 17 00:00:00 2001
From 99179af42801ba828a667ca89553996a07dc5389 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 3 Jul 2018 21:56:23 -0400
Subject: [PATCH] InventoryCloseEvent Reason API
@ -7,10 +7,10 @@ Allows you to determine why an inventory was closed, enabling plugin developers
to "confirm" things based on if it was player triggered close or not.
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 8c96e7318..3e80825f7 100644
index f31524eb0..2612d4207 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -873,7 +873,7 @@ public class Chunk {
@@ -886,7 +886,7 @@ public class Chunk implements IChunkAccess {
{
if ( h instanceof org.bukkit.craftbukkit.entity.CraftHumanEntity )
{
@ -19,7 +19,7 @@ index 8c96e7318..3e80825f7 100644
}
}
}
@@ -898,7 +898,7 @@ public class Chunk {
@@ -911,7 +911,7 @@ public class Chunk implements IChunkAccess {
{
if ( h instanceof org.bukkit.craftbukkit.entity.CraftHumanEntity )
{
@ -29,19 +29,19 @@ index 8c96e7318..3e80825f7 100644
}
}
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
index 0b51903e2..aa0b27f0e 100644
index a766a1467..cbf663573 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -145,7 +145,7 @@ public abstract class EntityHuman extends EntityLiving {
super.B_();
@@ -153,7 +153,7 @@ public abstract class EntityHuman extends EntityLiving {
this.df();
super.tick();
if (!this.world.isClientSide && this.activeContainer != null && !this.activeContainer.canUse(this)) {
- this.closeInventory();
+ this.closeInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason.CANT_USE); // Paper
this.activeContainer = this.defaultContainer;
}
@@ -294,6 +294,13 @@ public abstract class EntityHuman extends EntityLiving {
@@ -355,6 +355,13 @@ public abstract class EntityHuman extends EntityLiving {
return this.getHealth() <= 0.0F || this.isSleeping();
}
@ -56,10 +56,10 @@ index 0b51903e2..aa0b27f0e 100644
this.activeContainer = this.defaultContainer;
}
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index cce3f98da..4ff505cfa 100644
index c91caf578..59dc239b8 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -287,7 +287,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -343,7 +343,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
}
// Paper end
if (!this.world.isClientSide && !this.activeContainer.canUse(this)) {
@ -68,7 +68,7 @@ index cce3f98da..4ff505cfa 100644
this.activeContainer = this.defaultContainer;
}
@@ -483,7 +483,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -534,7 +534,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.inventory.clear();
}
@ -77,8 +77,8 @@ index cce3f98da..4ff505cfa 100644
this.setSpectatorTarget(this); // Remove spectated target
// CraftBukkit end
@@ -837,7 +837,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.a((new ChatMessage("container.spectatorCantOpen", new Object[0])).setChatModifier((new ChatModifier()).setColor(EnumChatFormat.RED)), true);
@@ -846,7 +846,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.a((new ChatMessage("container.spectatorCantOpen", new Object[0])).a(EnumChatFormat.RED), true);
} else {
if (this.activeContainer != this.defaultContainer) {
- this.closeInventory();
@ -86,7 +86,7 @@ index cce3f98da..4ff505cfa 100644
}
if (iinventory instanceof ITileInventory) {
@@ -903,7 +903,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -912,7 +912,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
}
// CraftBukkit end
if (this.activeContainer != this.defaultContainer) {
@ -95,7 +95,7 @@ index cce3f98da..4ff505cfa 100644
}
this.nextContainerCounter();
@@ -968,7 +968,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -977,7 +977,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
}
public void closeInventory() {
@ -107,27 +107,27 @@ index cce3f98da..4ff505cfa 100644
+ CraftEventFactory.handleInventoryCloseEvent(this, reason); // CraftBukkit
+ // Paper end
this.playerConnection.sendPacket(new PacketPlayOutCloseWindow(this.activeContainer.windowId));
this.r();
this.m();
}
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 36833b961..a54203c56 100644
index 5fe01e7ef..4ed107eac 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -1759,7 +1759,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
PlayerConnectionUtils.ensureMainThread(packetplayinclosewindow, this, this.player.x());
@@ -2033,7 +2033,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
PlayerConnectionUtils.ensureMainThread(packetplayinclosewindow, this, this.player.getWorldServer());
if (this.player.isFrozen()) return; // CraftBukkit
- CraftEventFactory.handleInventoryCloseEvent(this.player); // CraftBukkit
+ CraftEventFactory.handleInventoryCloseEvent(this.player, org.bukkit.event.inventory.InventoryCloseEvent.Reason.PLAYER); // CraftBukkit // Paper
this.player.r();
this.player.m();
}
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index b478f385a..eaaa54acd 100644
index c1de6564a..d397c6c74 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -423,7 +423,7 @@ public abstract class PlayerList {
entityplayer.b(StatisticList.f);
@@ -421,7 +421,7 @@ public abstract class PlayerList {
entityplayer.a(StatisticList.LEAVE_GAME);
// CraftBukkit start - Quitting must be before we do final save of data, in case plugins need to modify it
- org.bukkit.craftbukkit.event.CraftEventFactory.handleInventoryCloseEvent(entityplayer);
@ -136,10 +136,10 @@ index b478f385a..eaaa54acd 100644
PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(cserver.getPlayer(entityplayer), "\u00A7e" + entityplayer.getName() + " left the game");
cserver.getPluginManager().callEvent(playerQuitEvent);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
index d85b5defc..05ca403e8 100644
index 4b9ecb4a6..b602a5d1b 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
@@ -401,8 +401,13 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
@@ -402,8 +402,13 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
}
public void closeInventory() {
@ -155,10 +155,10 @@ index d85b5defc..05ca403e8 100644
public boolean isBlocking() {
return getHandle().isBlocking();
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index c0f4cec4d..6cbf429ff 100644
index 3b76c7080..79ade89c5 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -644,7 +644,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -687,7 +687,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
// Close any foreign inventory
if (getHandle().activeContainer != getHandle().defaultContainer) {
@ -168,10 +168,10 @@ index c0f4cec4d..6cbf429ff 100644
// Check if the fromWorld and toWorld are the same.
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 248873fb4..cce4acc0b 100644
index c129e8629..81ba63bab 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -927,8 +927,19 @@ public class CraftEventFactory {
@@ -911,8 +911,19 @@ public class CraftEventFactory {
return event;
}

Datei anzeigen

@ -1,4 +1,4 @@
From 855c50b43725ac1167d2735d0d0b0b60de73499f Mon Sep 17 00:00:00 2001
From 9a8a8ceae6eaf17fa915b512f1ec3596e06973c7 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 4 Jul 2018 03:39:51 -0400
Subject: [PATCH] Avoid Chunk Lookups for Entity/TileEntity Current Chunk
@ -10,59 +10,58 @@ to the object directly on the Entity/TileEntity object we can directly grab.
Use that local value instead to reduce lookups in many hot places.
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 3e80825f7..4a94fd5a6 100644
index 2612d4207..b3cdc0b7d 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -704,6 +704,7 @@ public class Chunk {
// Spigot end
@@ -721,6 +721,7 @@ public class Chunk implements IChunkAccess {
((HeightMap) this.heightMap.get(heightmap_type)).a(along);
}
+ public void removeEntity(Entity entity) { b(entity); } // Paper - OBFHELPER
public void b(Entity entity) {
this.a(entity, entity.ac);
this.a(entity, entity.af);
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index c0816b9f8..52adee880 100644
index ee061d693..1b9013ab4 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -1511,12 +1511,15 @@ public abstract class World implements IBlockAccess {
@@ -1213,12 +1213,15 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose
int j;
// Paper start - Set based removal lists
for (Entity e : this.f) {
for (Entity e : this.g) {
+ /*
j = e.getChunkZ();
int k = e.getChunkX();
if (e.isAddedToChunk() && this.isChunkLoaded(k, j, true)) {
if (e.inChunk && this.isChunkLoaded(k, j, true)) {
this.getChunkAt(k, j).b(e);
- }
+ }*/
+ Chunk chunk = e.isAddedToChunk() ? e.getCurrentChunk() : null;
+ Chunk chunk = e.inChunk ? e.getCurrentChunk() : null;
+ if (chunk != null) chunk.removeEntity(e);
}
for (Entity e : this.f) {
@@ -1577,12 +1580,17 @@ public abstract class World implements IBlockAccess {
this.methodProfiler.b();
for (Entity e : this.g) {
@@ -1279,12 +1282,17 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose
this.methodProfiler.e();
this.methodProfiler.a("remove");
if (entity.dead) {
+ // Paper start
+ /*
j = entity.ab;
int l = entity.ad;
j = entity.ae;
int l = entity.ag;
- if (entity.aa && this.isChunkLoaded(j, l, true)) {
+ /*if (entity.aa && this.isChunkLoaded(j, l, true)) {
if (entity.inChunk && this.isChunkLoaded(j, l, true)) {
this.getChunkAt(j, l).b(entity);
- }
+ }*/
+ Chunk chunk = entity.isAddedToChunk() ? entity.getCurrentChunk() : null;
+ Chunk chunk = entity.inChunk ? entity.getCurrentChunk() : null;
+ if (chunk != null) chunk.removeEntity(entity);
+ // Paper end
guardEntityList = false; // Spigot
this.entityList.remove(this.tickPosition--); // CraftBukkit - Use field for loop variable
@@ -1627,7 +1635,7 @@ public abstract class World implements IBlockAccess {
@@ -1329,7 +1337,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose
BlockPosition blockposition = tileentity.getPosition();
// Paper start - Skip ticking in chunks scheduled for unload
@ -71,7 +70,7 @@ index c0816b9f8..52adee880 100644
boolean shouldTick = chunk != null;
if(this.paperConfig.skipEntityTickingInChunksScheduledForUnload)
shouldTick = shouldTick && !chunk.isUnloading() && chunk.scheduledForUnload == null;
@@ -1663,8 +1671,11 @@ public abstract class World implements IBlockAccess {
@@ -1365,8 +1373,11 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose
tilesThisCycle--;
this.tileEntityListTick.remove(tileTickPosition--);
//this.tileEntityList.remove(tileentity); // Paper - remove unused list

Datei anzeigen

@ -1,4 +1,4 @@
From a246ceabeb00b56874af023516184f8ef320c62f Mon Sep 17 00:00:00 2001
From ddc34e5fcf2fe579484ac244370c4bca24a5adc7 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 4 Jul 2018 15:22:06 -0400
Subject: [PATCH] Configurable Bed Search Radius
@ -10,10 +10,10 @@ player at their bed should it of became obstructed.
Defaults to vanilla 1.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 06c54690f..50416f40a 100644
index b2855f3ca..d30a8ff6c 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -529,4 +529,15 @@ public class PaperWorldConfig {
@@ -444,4 +444,15 @@ public class PaperWorldConfig {
private void scanForLegacyEnderDragon() {
scanForLegacyEnderDragon = getBoolean("game-mechanics.scan-for-legacy-ender-dragon", true);
}
@ -30,13 +30,16 @@ index 06c54690f..50416f40a 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/BlockBed.java b/src/main/java/net/minecraft/server/BlockBed.java
index 9346bddff..f1a107991 100644
index 6832eaac5..b9cb59fa7 100644
--- a/src/main/java/net/minecraft/server/BlockBed.java
+++ b/src/main/java/net/minecraft/server/BlockBed.java
@@ -155,6 +155,51 @@ public class BlockBed extends BlockFacingHorizontal implements ITileEntity {
@@ -172,7 +172,54 @@ public class BlockBed extends BlockFacingHorizontal implements ITileEntity {
@Nullable
public static BlockPosition a(World world, BlockPosition blockposition, int i) {
EnumDirection enumdirection = (EnumDirection) world.getType(blockposition).get(BlockBed.FACING);
public static BlockPosition a(IBlockAccess iblockaccess, BlockPosition blockposition, int i) {
+ World world = (World) iblockaccess;
+
EnumDirection enumdirection = (EnumDirection) iblockaccess.getType(blockposition).get(BlockBed.FACING);
+ // Paper - replace whole method
+ int radius = world.paperConfig.bedSearchRadius;
+ for (int r = 1; r <= radius; r++) {
@ -85,7 +88,7 @@ index 9346bddff..f1a107991 100644
int j = blockposition.getX();
int k = blockposition.getY();
int l = blockposition.getZ();
@@ -180,9 +225,12 @@ public class BlockBed extends BlockFacingHorizontal implements ITileEntity {
@@ -198,9 +245,12 @@ public class BlockBed extends BlockFacingHorizontal implements ITileEntity {
}
}
@ -93,11 +96,11 @@ index 9346bddff..f1a107991 100644
+ return null;*/ // Paper
}
+ protected static boolean isSafeRespawn(World world, BlockPosition blockposition) { // Paper - OBFHELPER + behavior improvement
+ return b(world, blockposition) && world.getType(blockposition.down()).getMaterial().isBuildable(); // Paper - ensure solid block
+ protected static boolean isSafeRespawn(IBlockAccess iblockaccess, BlockPosition blockposition) { // Paper - OBFHELPER + behavior improvement
+ return a(iblockaccess, blockposition) && iblockaccess.getType(blockposition.down()).getMaterial().isBuildable(); // Paper - ensure solid block
+ }
protected static boolean b(World world, BlockPosition blockposition) {
return world.getType(blockposition.down()).q() && !world.getType(blockposition).getMaterial().isBuildable() && !world.getType(blockposition.up()).getMaterial().isBuildable();
protected static boolean a(IBlockAccess iblockaccess, BlockPosition blockposition) {
return iblockaccess.getType(blockposition.down()).q() && !iblockaccess.getType(blockposition).getMaterial().isBuildable() && !iblockaccess.getType(blockposition.up()).getMaterial().isBuildable();
}
--
2.18.0

Datei anzeigen

@ -1,4 +1,4 @@
From 5a08e37a76a354a044fa503b8f4f4c0d4f9be59a Mon Sep 17 00:00:00 2001
From 2de376809dbe86316ab433888c0591c299dc6186 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 4 Jul 2018 15:30:22 -0400
Subject: [PATCH] Vex#getOwner API
@ -6,15 +6,15 @@ Subject: [PATCH] Vex#getOwner API
Get's the NPC that summoned this Vex
diff --git a/src/main/java/net/minecraft/server/EntityVex.java b/src/main/java/net/minecraft/server/EntityVex.java
index a0abaf431..673c3ff3c 100644
index 897d7c681..ba1109e03 100644
--- a/src/main/java/net/minecraft/server/EntityVex.java
+++ b/src/main/java/net/minecraft/server/EntityVex.java
@@ -90,6 +90,7 @@ public class EntityVex extends EntityMonster {
@@ -86,6 +86,7 @@ public class EntityVex extends EntityMonster {
}
+ public EntityInsentient getOwner() { return p(); } // Paper - OBFHELPER
public EntityInsentient p() {
+ public EntityInsentient getOwner() { return l(); } // Paper - OBFHELPER
public EntityInsentient l() {
return this.b;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java

Datei anzeigen

@ -1,4 +1,4 @@
From 2d88ccd486565ced7b650bed5f15c8d4bbf3c809 Mon Sep 17 00:00:00 2001
From 4070e274a65887963631e09cf88e08da8d644bcc Mon Sep 17 00:00:00 2001
From: Minecrell <minecrell@minecrell.net>
Date: Fri, 13 Jul 2018 14:54:43 +0200
Subject: [PATCH] Refresh player inventory when cancelling
@ -16,10 +16,10 @@ Refresh the player inventory when PlayerInteractEntityEvent is
cancelled to avoid this problem.
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index a54203c56..cc1152739 100644
index 4ed107eac..472f40709 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -1673,6 +1673,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
@@ -1947,6 +1947,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
}
if (event.isCancelled()) {

Datei anzeigen

@ -1,46 +0,0 @@
From d6a8a38833e30365423d53a34ce66c467f13c403 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 5 Jun 2018 00:32:22 -0400
Subject: [PATCH] Don't load chunks for villager door checks
This avoids villages spam loading chunks sync
diff --git a/src/main/java/net/minecraft/server/PersistentVillage.java b/src/main/java/net/minecraft/server/PersistentVillage.java
index 01f7cee38..a3aa9f82e 100644
--- a/src/main/java/net/minecraft/server/PersistentVillage.java
+++ b/src/main/java/net/minecraft/server/PersistentVillage.java
@@ -226,7 +226,12 @@ public class PersistentVillage extends PersistentBase {
}
private boolean f(BlockPosition blockposition) {
- IBlockData iblockdata = this.world.getType(blockposition);
+ // Paper start
+ IBlockData iblockdata = this.world.getTypeIfLoaded(blockposition);
+ if (iblockdata == null) {
+ return false;
+ }
+ // Paper end
Block block = iblockdata.getBlock();
return block instanceof BlockDoor ? iblockdata.getMaterial() == Material.WOOD : false;
diff --git a/src/main/java/net/minecraft/server/Village.java b/src/main/java/net/minecraft/server/Village.java
index 2eb33a986..9f1867ddd 100644
--- a/src/main/java/net/minecraft/server/Village.java
+++ b/src/main/java/net/minecraft/server/Village.java
@@ -327,7 +327,12 @@ public class Village {
}
private boolean f(BlockPosition blockposition) {
- IBlockData iblockdata = this.a.getType(blockposition);
+ // Paper start
+ IBlockData iblockdata = this.a.getTypeIfLoaded(blockposition);
+ if (iblockdata == null) {
+ return false;
+ }
+ // Paper end
Block block = iblockdata.getBlock();
return block instanceof BlockDoor ? iblockdata.getMaterial() == Material.WOOD : false;
--
2.18.0

Datei anzeigen

@ -1,43 +0,0 @@
From 34db39b1a0906f9fce82f2970d924b95289a4bc7 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 16 Jun 2018 16:23:38 -0400
Subject: [PATCH] Ignore Missing Recipes in RecipeBook to avoid data errors
This code was causing NPE's in saving player data, potentially related to reloads.
diff --git a/src/main/java/net/minecraft/server/RecipeBookServer.java b/src/main/java/net/minecraft/server/RecipeBookServer.java
index 7eecdc9da..f65e74ebd 100644
--- a/src/main/java/net/minecraft/server/RecipeBookServer.java
+++ b/src/main/java/net/minecraft/server/RecipeBookServer.java
@@ -63,7 +63,11 @@ public class RecipeBookServer extends RecipeBook {
while (iterator.hasNext()) {
IRecipe irecipe = (IRecipe) iterator.next();
- nbttaglist.add(new NBTTagString(((MinecraftKey) CraftingManager.recipes.b(irecipe)).toString()));
+ // Paper start - ignore missing recipes
+ MinecraftKey key = CraftingManager.recipes.b(irecipe);
+ if (key == null) continue;
+ nbttaglist.add(new NBTTagString(key.toString()));
+ // Paper end
}
nbttagcompound.set("recipes", nbttaglist);
@@ -71,9 +75,13 @@ public class RecipeBookServer extends RecipeBook {
Iterator iterator1 = this.e().iterator();
while (iterator1.hasNext()) {
- IRecipe irecipe1 = (IRecipe) iterator1.next();
+ // Paper start - ignore missing recipes
+ IRecipe irecipe = (IRecipe) iterator1.next();
- nbttaglist1.add(new NBTTagString(((MinecraftKey) CraftingManager.recipes.b(irecipe1)).toString()));
+ MinecraftKey key = CraftingManager.recipes.b(irecipe);
+ if (key == null) continue;
+ nbttaglist1.add(new NBTTagString(key.toString()));
+ // Paper end
}
nbttagcompound.set("toBeDisplayed", nbttaglist1);
--
2.18.0

Datei anzeigen

@ -1,43 +0,0 @@
From b42d9cfdd497370e9fe6d0b2b684ebcd6fe28ffd Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Tue, 3 Jul 2018 19:14:38 +0100
Subject: [PATCH] Cleanup allocated favicon ByteBuf
Cleanups a bytebuffer which was allocated during the encoding of the
favicon to be sent to the client.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index f82e22b23..0399a48e1 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -724,6 +724,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs
if (file.isFile()) {
ByteBuf bytebuf = Unpooled.buffer();
+ ByteBuf bytebuf1 = null; // Paper - cleanup favicon bytebuf
try {
BufferedImage bufferedimage = ImageIO.read(file);
@@ -731,13 +732,18 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs
Validate.validState(bufferedimage.getWidth() == 64, "Must be 64 pixels wide", new Object[0]);
Validate.validState(bufferedimage.getHeight() == 64, "Must be 64 pixels high", new Object[0]);
ImageIO.write(bufferedimage, "PNG", new ByteBufOutputStream(bytebuf));
- ByteBuf bytebuf1 = Base64.encode(bytebuf);
+ /*ByteBuf */ bytebuf1 = Base64.encode(bytebuf); // Paper - cleanup favicon bytebuf
serverping.setFavicon("data:image/png;base64," + bytebuf1.toString(StandardCharsets.UTF_8));
} catch (Exception exception) {
MinecraftServer.LOGGER.error("Couldn\'t load server icon", exception);
} finally {
bytebuf.release();
+ // Paper start - cleanup favicon bytebuf
+ if (bytebuf1 != null) {
+ bytebuf1.release();
+ }
+ // Paper end - cleanup favicon bytebuf
}
}
--
2.18.0