Fix some more compile errors

This commit is contained in:
Spottedleaf 2019-05-05 20:53:47 -07:00
parent eeb2ecd789
commit 8dfd5dc0c4
22 changed files with 110 additions and 83 deletions

View File

@ -1,4 +1,4 @@
From 072bc1538cc7c59fb817c5ab3d645f5137bdcee4 Mon Sep 17 00:00:00 2001
From 4bff48bda3c4df4e6896391c5c99aac244f1d070 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 1 Mar 2016 23:09:29 -0600
Subject: [PATCH] Further improve server tick loop
@ -167,7 +167,7 @@ index 13a0918cea..320af3f503 100644
private void executeModerately() {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index def01ae423..72902d2f5d 100644
index def01ae423..ab84c28159 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1923,6 +1923,17 @@ public final class CraftServer implements Server {
@ -178,9 +178,9 @@ index def01ae423..72902d2f5d 100644
+ @Override
+ public double[] getTPS() {
+ return new double[] {
+ MinecraftServer.getServer().tps1.getAverage(),
+ MinecraftServer.getServer().tps5.getAverage(),
+ MinecraftServer.getServer().tps15.getAverage()
+ net.minecraft.server.MinecraftServer.getServer().tps1.getAverage(),
+ net.minecraft.server.MinecraftServer.getServer().tps5.getAverage(),
+ net.minecraft.server.MinecraftServer.getServer().tps15.getAverage()
+ };
+ }
+ // Paper end

View File

@ -1,4 +1,4 @@
From ae519f467fcc1b34f171226dc77c4bad75efebaf Mon Sep 17 00:00:00 2001
From 47e948d519f3c35a4e0eef53c0d0d81eb0ca6dcd Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 7 Jan 2017 15:24:46 -0500
Subject: [PATCH] Provide E/TE/Chunk count stat methods
@ -6,22 +6,41 @@ Subject: [PATCH] Provide E/TE/Chunk count stat methods
Provides counts without the ineffeciency of using .getEntities().size()
which creates copy of the collections.
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index f32c4913c5..606ec3c482 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -51,7 +51,7 @@ import org.bukkit.event.weather.LightningStrikeEvent;
public class WorldServer extends World {
private static final Logger LOGGER = LogManager.getLogger();
- private final List<Entity> globalEntityList = Lists.newArrayList();
+ public final List<Entity> globalEntityList = Lists.newArrayList(); // Paper - private -> public
public final Int2ObjectMap<Entity> entitiesById = new Int2ObjectLinkedOpenHashMap();
private final Map<UUID, Entity> entitiesByUUID = Maps.newHashMap();
private final Queue<Entity> entitiesToAdd = Queues.newArrayDeque();
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index b8de760079..db390ced15 100644
index b8de760079..c79b0f42a6 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -265,6 +265,29 @@ public class CraftWorld implements World {
@@ -265,6 +265,35 @@ public class CraftWorld implements World {
private int waterAnimalSpawn = -1;
private int ambientSpawn = -1;
+ // Paper start - Provide fast information methods
+ // TODO review these changes
+ public int getEntityCount() {
+ return world.entityList.size();
+ return world.globalEntityList.size();
+ }
+ public int getTileEntityCount() {
+ // We don't use the full world tile entity list, so we must iterate chunks
+ Long2ObjectLinkedOpenHashMap<PlayerChunk> chunks = world.getChunkProvider().playerChunkMap.visibleChunks;
+ int size = 0;
+ for (net.minecraft.server.Chunk chunk : ((ChunkProviderServer) world.getChunkProvider()).chunks.values()) {
+ for (net.minecraft.server.PlayerChunk playerchunk : chunks.values()) {
+ net.minecraft.server.Chunk chunk = playerchunk.getChunk();
+ if (chunk == null) {
+ continue;
+ }
+ size += chunk.tileEntities.size();
+ }
+ return size;
@ -30,7 +49,7 @@ index b8de760079..db390ced15 100644
+ return world.tileEntityListTick.size();
+ }
+ public int getChunkCount() {
+ return world.getChunkProvider().chunks.size();
+ return world.getChunkProvider().playerChunkMap.visibleChunks.size();
+ }
+ public int getPlayerCount() {
+ return world.players.size();

View File

@ -1,4 +1,4 @@
From 0707463bba0cc2100576d3b6c1fb29dbfeb64d8c Mon Sep 17 00:00:00 2001
From 20bed4702ddd6ccd81f7105df0bf6d31158555ba Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 19 Dec 2017 16:31:46 -0500
Subject: [PATCH] ExperienceOrbs API for Reason/Source/Triggering player
@ -265,10 +265,10 @@ index adb1a09133..be16fe9a9e 100644
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index db390ced15..453f925cbd 100644
index c79b0f42a6..94178fe8ba 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1620,7 +1620,7 @@ public class CraftWorld implements World {
@@ -1626,7 +1626,7 @@ public class CraftWorld implements World {
} else if (TNTPrimed.class.isAssignableFrom(clazz)) {
entity = new EntityTNTPrimed(world, x, y, z, null);
} else if (ExperienceOrb.class.isAssignableFrom(clazz)) {

View File

@ -1,14 +1,22 @@
From 024f41d77e9e1bf1d59b70e41b1a72e47205c216 Mon Sep 17 00:00:00 2001
From 8f7fbaba6699e1bf6d7bd89a9a805ec36b36fc05 Mon Sep 17 00:00:00 2001
From: Sweepyoface <github@sweepy.pw>
Date: Sat, 17 Jun 2017 18:48:21 -0400
Subject: [PATCH] Add UnknownCommandEvent
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 2bdbc939e..4e5e2d109 100644
index 69f65eec10..4077c54892 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -148,6 +148,7 @@ import org.bukkit.craftbukkit.util.Versioning;
@@ -77,6 +77,7 @@ import net.minecraft.server.WorldServer;
import net.minecraft.server.WorldSettings;
import net.minecraft.server.WorldType;
import org.apache.commons.lang.Validate;
+import org.apache.commons.lang3.StringUtils;
import org.bukkit.BanList;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
@@ -148,6 +149,7 @@ import org.bukkit.craftbukkit.util.Versioning;
import org.bukkit.craftbukkit.util.permissions.CraftDefaultPermissions;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
@ -16,7 +24,7 @@ index 2bdbc939e..4e5e2d109 100644
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.event.player.PlayerChatTabCompleteEvent;
import org.bukkit.event.server.BroadcastMessageEvent;
@@ -734,7 +735,13 @@ public final class CraftServer implements Server {
@@ -734,7 +736,13 @@ public final class CraftServer implements Server {
// Spigot start
if (!org.spigotmc.SpigotConfig.unknownCommandMessage.isEmpty()) {

View File

@ -1,4 +1,4 @@
From 5e0855bcc077ddb925fa8b515ea46f7a0db63789 Mon Sep 17 00:00:00 2001
From dfffc2efdfd62a09c1841b268d036c74300c8ba6 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 15 Jan 2018 22:11:48 -0500
Subject: [PATCH] Basic PlayerProfile API
@ -486,10 +486,10 @@ index 409bc6da9e..9eaf1539f7 100644
private UserCacheEntry(GameProfile gameprofile, Date date) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 6a12d3ba8d..63bfdc052e 100644
index 4077c54892..08f84e5db8 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -195,6 +195,9 @@ import org.yaml.snakeyaml.error.MarkedYAMLException;
@@ -196,6 +196,9 @@ import org.yaml.snakeyaml.error.MarkedYAMLException;
import net.md_5.bungee.api.chat.BaseComponent; // Spigot
@ -499,7 +499,7 @@ index 6a12d3ba8d..63bfdc052e 100644
public final class CraftServer implements Server {
private final String serverName = "Paper"; // Paper
private final String serverVersion;
@@ -2096,5 +2099,24 @@ public final class CraftServer implements Server {
@@ -2097,5 +2100,24 @@ public final class CraftServer implements Server {
public boolean suggestPlayerNamesWhenNullTabCompletions() {
return com.destroystokyo.paper.PaperConfig.suggestPlayersWhenNullTabCompletions;
}

View File

@ -1,4 +1,4 @@
From 2fd4f2215bae93e2d1d55a40969172899d37c545 Mon Sep 17 00:00:00 2001
From 2c8f1fd13bdde1119e2853aa4cd38c7f70944368 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 26 Nov 2017 13:19:58 -0500
Subject: [PATCH] AsyncTabCompleteEvent
@ -70,15 +70,15 @@ index bb276daa72..96ec50f6c6 100644
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 63bfdc052e..9f2aa9570b 100644
index 08f84e5db8..0732a6f218 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1661,7 +1661,7 @@ public final class CraftServer implements Server {
@@ -1662,7 +1662,7 @@ public final class CraftServer implements Server {
offers = tabCompleteChat(player, message);
}
- TabCompleteEvent tabEvent = new TabCompleteEvent(player, message, offers);
+ TabCompleteEvent tabEvent = new TabCompleteEvent(player, message, offers, message.startsWith("/") || forceCommand, pos != null ? MCUtil.toLocation(((CraftWorld) player.getWorld()).getHandle(), new BlockPosition(pos)) : null); // Paper
+ TabCompleteEvent tabEvent = new TabCompleteEvent(player, message, offers, message.startsWith("/") || forceCommand, pos != null ? net.minecraft.server.MCUtil.toLocation(((CraftWorld) player.getWorld()).getHandle(), new BlockPosition(pos)) : null); // Paper
getPluginManager().callEvent(tabEvent);
return tabEvent.isCancelled() ? Collections.EMPTY_LIST : tabEvent.getCompletions();

View File

@ -1,4 +1,4 @@
From 789d81cfb7edd8ad81d1ac6981ff1ca9377e16bd Mon Sep 17 00:00:00 2001
From 31148f6d3e9ada3c1c1a8d78fa006e1f0602dcd9 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
@ -9,10 +9,10 @@ In Offline Mode, will return an Offline UUID
This is a more performant way to obtain a UUID for a name than loading an OfflinePlayer
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 9f2aa9570b..91c86e451f 100644
index 0732a6f218..45710c0d2a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1354,6 +1354,26 @@ public final class CraftServer implements Server {
@@ -1355,6 +1355,26 @@ public final class CraftServer implements Server {
return recipients.size();
}
@ -25,7 +25,7 @@ index 9f2aa9570b..91c86e451f 100644
+ }
+ GameProfile profile;
+ // Only fetch an online UUID in online mode
+ if (MinecraftServer.getServer().getOnlineMode()
+ if (net.minecraft.server.MinecraftServer.getServer().getOnlineMode()
+ || (org.spigotmc.SpigotConfig.bungee && com.destroystokyo.paper.PaperConfig.bungeeOnlineMode)) {
+ profile = console.getUserCache().getProfile( name );
+ } else {

View File

@ -1,4 +1,4 @@
From 29dfb9fa9f5e7daa700a965750d3a5725d1d4339 Mon Sep 17 00:00:00 2001
From 04dc808a5456b9e5689c8902033f5da42cd291f6 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
@ -10,7 +10,7 @@ Adds an option to control the force mode of the particle.
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 f32c4913c5..390ba575f8 100644
index 606ec3c482..e0254fadf2 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -55,7 +55,7 @@ public class WorldServer extends World {
@ -43,10 +43,10 @@ index f32c4913c5..390ba575f8 100644
if (this.a(entityplayer, force, d0, d1, d2, packetplayoutworldparticles)) { // CraftBukkit
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 453f925cbd..54ed349109 100644
index 94178fe8ba..be8ea68546 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -2049,11 +2049,17 @@ public class CraftWorld implements World {
@@ -2055,11 +2055,17 @@ public class CraftWorld implements World {
@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, boolean force) {

View File

@ -1,4 +1,4 @@
From aa531397acf9ab17832ce0b4f2065d8ee20f8526 Mon Sep 17 00:00:00 2001
From 5b983abc918e15dbcd575670bcb74771f08b5194 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 54ed349109..f568538243 100644
index be8ea68546..6d0c0c5a2a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1316,6 +1316,10 @@ public class CraftWorld implements World {
@@ -1322,6 +1322,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);

View File

@ -1,4 +1,4 @@
From f4d4ee382d5d7447231559f075303db9f8083f1d Mon Sep 17 00:00:00 2001
From cf6b0562373033a1db4ead73499260ed6d085f45 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,16 +6,16 @@ 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 f568538243..c4818af828 100644
index 6d0c0c5a2a..c9b11128d7 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -748,6 +748,11 @@ public class CraftWorld implements World {
@@ -754,6 +754,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 ? Explosion.Effect.BREAK : Explosion.Effect.NONE).wasCanceled;
}
+ // Paper start
+ public boolean createExplosion(Entity source, Location loc, float power, boolean setFire, boolean breakBlocks) {
+ return !world.createExplosion(source != null ? ((CraftEntity) source).getHandle() : null, loc.getX(), loc.getY(), loc.getZ(), power, setFire, breakBlocks).wasCanceled;
+ return !world.createExplosion(source != null ? ((org.bukkit.craftbukkit.entity.CraftEntity) source).getHandle() : null, loc.getX(), loc.getY(), loc.getZ(), power, setFire, breakBlocks ? Explosion.Effect.BREAK : Explosion.Effect.NONE).wasCanceled;
+ }
+ // Paper end

View File

@ -1,14 +1,14 @@
From 2f6b011840b265acb30a8a757cdfecbef37f4d10 Mon Sep 17 00:00:00 2001
From e3ee1b876ccf7c884eddca532d5c09f8a66a6245 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 c4818af828..9a92d5b077 100644
index c9b11128d7..209e726485 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1119,6 +1119,15 @@ public class CraftWorld implements World {
@@ -1125,6 +1125,15 @@ public class CraftWorld implements World {
return list;
}

View File

@ -1,4 +1,4 @@
From 3018d73c74402f77573949a1a476cc8690029ceb Mon Sep 17 00:00:00 2001
From ef845ceaf628cfe396b863d966190b3ae1094110 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 28 Jul 2018 12:18:27 -0400
Subject: [PATCH] Ignore Dead Entities in entityList iteration
@ -63,7 +63,7 @@ index cbd7793c53..a217cb0fe7 100644
private float av;
private float aw;
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 8515794059..c7e5d545c0 100644
index 5a6fe15908..305336d8d6 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -843,6 +843,7 @@ public class WorldServer extends World {
@ -91,10 +91,10 @@ index 8515794059..c7e5d545c0 100644
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 9a92d5b077..76cce69ed0 100644
index 209e726485..3b0f9c86f1 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -858,6 +858,7 @@ public class CraftWorld implements World {
@@ -864,6 +864,7 @@ public class CraftWorld implements World {
for (Object o : world.entitiesById.values()) {
if (o instanceof net.minecraft.server.Entity) {
net.minecraft.server.Entity mcEnt = (net.minecraft.server.Entity) o;
@ -102,7 +102,7 @@ index 9a92d5b077..76cce69ed0 100644
Entity bukkitEntity = mcEnt.getBukkitEntity();
// Assuming that bukkitEntity isn't null
@@ -877,6 +878,7 @@ public class CraftWorld implements World {
@@ -883,6 +884,7 @@ public class CraftWorld implements World {
for (Object o : world.entitiesById.values()) {
if (o instanceof net.minecraft.server.Entity) {
net.minecraft.server.Entity mcEnt = (net.minecraft.server.Entity) o;
@ -110,7 +110,7 @@ index 9a92d5b077..76cce69ed0 100644
Entity bukkitEntity = mcEnt.getBukkitEntity();
// Assuming that bukkitEntity isn't null
@@ -903,6 +905,7 @@ public class CraftWorld implements World {
@@ -909,6 +911,7 @@ public class CraftWorld implements World {
for (Object entity: world.entitiesById.values()) {
if (entity instanceof net.minecraft.server.Entity) {
@ -118,7 +118,7 @@ index 9a92d5b077..76cce69ed0 100644
Entity bukkitEntity = ((net.minecraft.server.Entity) entity).getBukkitEntity();
if (bukkitEntity == null) {
@@ -926,6 +929,7 @@ public class CraftWorld implements World {
@@ -932,6 +935,7 @@ public class CraftWorld implements World {
for (Object entity: world.entitiesById.values()) {
if (entity instanceof net.minecraft.server.Entity) {

View File

@ -1,11 +1,11 @@
From 3118518675cbffccd9f4bbad212eab9af81f67c9 Mon Sep 17 00:00:00 2001
From c4527009f9badff9af31566955c34b6e728d1395 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Fri, 20 Jul 2018 23:37:03 -0500
Subject: [PATCH] AnvilDamageEvent
diff --git a/src/main/java/net/minecraft/server/ContainerAnvil.java b/src/main/java/net/minecraft/server/ContainerAnvil.java
index ada5cf982e..64a992152b 100644
index ada5cf982e..9e73e731b5 100644
--- a/src/main/java/net/minecraft/server/ContainerAnvil.java
+++ b/src/main/java/net/minecraft/server/ContainerAnvil.java
@@ -85,6 +85,16 @@ public class ContainerAnvil extends Container {
@ -15,7 +15,7 @@ index ada5cf982e..64a992152b 100644
+ // Paper start
+ com.destroystokyo.paper.event.block.AnvilDamagedEvent event = new com.destroystokyo.paper.event.block.AnvilDamagedEvent(getBukkitView(), iblockdata1 != null ? org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(iblockdata1) : null);
+ if (!event.callEvent()) {
+ return itemstack;
+ return;
+ } else if (event.getDamageState() == com.destroystokyo.paper.event.block.AnvilDamagedEvent.DamageState.BROKEN) {
+ iblockdata1 = null;
+ } else {

View File

@ -1,4 +1,4 @@
From dd43dfd024aa5640ce1d2b6ef234ac02be3f4b69 Mon Sep 17 00:00:00 2001
From 16792e619d00d03fe1e769732a333c78cae274b5 Mon Sep 17 00:00:00 2001
From: miclebrick <miclebrick@outlook.com>
Date: Wed, 8 Aug 2018 15:30:52 -0400
Subject: [PATCH] Add Early Warning Feature to WatchDog
@ -48,10 +48,10 @@ index d3620b18a0..afa6e6644e 100644
long start = System.nanoTime(), curTime, wait, tickSection = start; // Paper - Further improve server tick loop
lastTick = start - TICK_TIME; // Paper
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 91c86e451f..985faf8e90 100644
index 45710c0d2a..e2d2b25dee 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -753,6 +753,7 @@ public final class CraftServer implements Server {
@@ -754,6 +754,7 @@ public final class CraftServer implements Server {
@Override
public void reload() {
@ -59,7 +59,7 @@ index 91c86e451f..985faf8e90 100644
reloadCount++;
configuration = YamlConfiguration.loadConfiguration(getConfigFile());
commandsConfiguration = YamlConfiguration.loadConfiguration(getCommandsConfigFile());
@@ -851,6 +852,7 @@ public final class CraftServer implements Server {
@@ -852,6 +853,7 @@ public final class CraftServer implements Server {
enablePlugins(PluginLoadOrder.STARTUP);
enablePlugins(PluginLoadOrder.POSTWORLD);
getPluginManager().callEvent(new ServerLoadEvent(ServerLoadEvent.LoadType.RELOAD));

View File

@ -1,4 +1,4 @@
From 1c722c8dbab66491dbfd6e1f09b410dd61ce3c33 Mon Sep 17 00:00:00 2001
From c96a46965f8f48e335764278198a4c0c5fcb18dc Mon Sep 17 00:00:00 2001
From: Mystiflow <mystiflow@gmail.com>
Date: Fri, 6 Jul 2018 13:21:30 +0100
Subject: [PATCH] Send nearby packets from world player list not server list
@ -46,7 +46,7 @@ index 58bfafc6b2..97f4f7e1bd 100644
double d5 = d1 - entityplayer.locY;
double d6 = d2 - entityplayer.locZ;
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index c7e5d545c0..281b11f010 100644
index 305336d8d6..37287d85d8 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1189,7 +1189,7 @@ public class WorldServer extends World {
@ -70,10 +70,10 @@ index c7e5d545c0..281b11f010 100644
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 76cce69ed0..244b087f4e 100644
index 3b0f9c86f1..69c43817fe 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1921,7 +1921,7 @@ public class CraftWorld implements World {
@@ -1927,7 +1927,7 @@ public class CraftWorld implements World {
double z = loc.getZ();
PacketPlayOutCustomSoundEffect packet = new PacketPlayOutCustomSoundEffect(new MinecraftKey(sound), SoundCategory.valueOf(category.name()), new Vec3D(x, y, z), volume, pitch);

View File

@ -1,4 +1,4 @@
From 3f0880211dd6f9bf7bc19e34a44d535e26ebd92e Mon Sep 17 00:00:00 2001
From 52313307e1c23168f88eef264d0962646c1252e2 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Sun, 2 Sep 2018 19:34:33 -0700
Subject: [PATCH] Make CraftWorld#loadChunk(int, int, false) load unconverted
@ -6,10 +6,10 @@ Subject: [PATCH] Make CraftWorld#loadChunk(int, int, false) load unconverted
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 244b087f4e..3393347a1f 100644
index 69c43817fe..28c5fd988d 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -472,7 +472,7 @@ public class CraftWorld implements World {
@@ -478,7 +478,7 @@ public class CraftWorld implements World {
@Override
public boolean loadChunk(int x, int z, boolean generate) {
org.spigotmc.AsyncCatcher.catchOp( "chunk load"); // Spigot

View File

@ -1,4 +1,4 @@
From 3118c4cf649446a48c210c0ca63633411951c87f Mon Sep 17 00:00:00 2001
From a2884dc05101e98fad5ead7fba50fa3786c3c84e Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 17 Sep 2018 23:05:31 -0400
Subject: [PATCH] Support Overriding World Seeds
@ -85,10 +85,10 @@ index a794f040e5..ad78f28c42 100644
String s = nbttagcompound.getString("generatorName");
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 985faf8e90..0d0d056cff 100644
index e2d2b25dee..de98e896c2 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -984,7 +984,7 @@ public final class CraftServer implements Server {
@@ -985,7 +985,7 @@ public final class CraftServer implements Server {
WorldSettings worldSettings;
// See MinecraftServer.a(String, String, long, WorldType, JsonElement)
if (worlddata == null) {

View File

@ -1,4 +1,4 @@
From 153b5016a2198566e64fa7ee72e2b1dd557d020e Mon Sep 17 00:00:00 2001
From 7c3871ebd4902e631d039bb26b9b17eae7ce2cc1 Mon Sep 17 00:00:00 2001
From: Brokkonaut <hannos17@gmx.de>
Date: Tue, 25 Sep 2018 06:53:43 +0200
Subject: [PATCH] Avoid dimension id collisions
@ -8,10 +8,10 @@ we would reuse an existing dimension id, if some other dimension was
unloaded before.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 0d0d056cff..1eb60b54b5 100644
index de98e896c2..034716a20a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -970,7 +970,7 @@ public final class CraftServer implements Server {
@@ -971,7 +971,7 @@ public final class CraftServer implements Server {
boolean used = false;
do {
for (WorldServer server : console.getWorlds()) {

View File

@ -1,4 +1,4 @@
From b5b78d51120653d19df7753eb9bbf3bed2eceeee Mon Sep 17 00:00:00 2001
From 764aae7b864fd017c5ffc6d01738695660b2a21d Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Sun, 7 Oct 2018 00:54:21 -0500
Subject: [PATCH] Add sun related API
@ -29,10 +29,10 @@ index bebf5a6e19..136727c280 100644
return this.d < 4;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 3393347a1f..016ed471bb 100644
index 28c5fd988d..ed646bc9db 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -734,6 +734,13 @@ public class CraftWorld implements World {
@@ -740,6 +740,13 @@ public class CraftWorld implements World {
}
}

View File

@ -1,4 +1,4 @@
From 9d75c3fda84b6fb4063b721d83e9da033007aff0 Mon Sep 17 00:00:00 2001
From d366f5f354176e8666c376cd08df53a9ca95e138 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Sun, 18 Nov 2018 19:49:56 +0000
Subject: [PATCH] Make the default permission message configurable
@ -29,10 +29,10 @@ index 3d6101c4db..010d2a7961 100644
private static void savePlayerData() {
savePlayerData = getBoolean("settings.save-player-data", savePlayerData);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 1eb60b54b5..3fe37b3306 100644
index 034716a20a..982dce4800 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2122,6 +2122,11 @@ public final class CraftServer implements Server {
@@ -2123,6 +2123,11 @@ public final class CraftServer implements Server {
return com.destroystokyo.paper.PaperConfig.suggestPlayersWhenNullTabCompletions;
}

View File

@ -1,4 +1,4 @@
From 3725e2b0e67484a0c69c552ed24506a060f62e4b Mon Sep 17 00:00:00 2001
From 8b9290193e5d9a8a5ebd6dad4f644212eed5c96a Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Tue, 1 Jan 2019 02:22:01 -0800
Subject: [PATCH] Add Heightmap API
@ -20,10 +20,10 @@ index 1bec5beab4..9f4cf3f1b3 100644
if (i >= -30000000 && j >= -30000000 && i < 30000000 && j < 30000000) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 016ed471bb..0cbca6870a 100644
index ed646bc9db..d2c3ea0dc3 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -311,6 +311,29 @@ public class CraftWorld implements World {
@@ -317,6 +317,29 @@ public class CraftWorld implements World {
return world.getHighestBlockYAt(HeightMap.Type.MOTION_BLOCKING, new BlockPosition(x, 0, z)).getY();
}

View File

@ -1,4 +1,4 @@
From e51672c6ce2cae36211bfb8e8de57519b8dc53bf Mon Sep 17 00:00:00 2001
From 6203075a3c3cb373fcb1172eecf84f61527020e5 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Mon, 22 Apr 2019 19:51:14 +0100
Subject: [PATCH] don't NPE on dimensionmanager toString
@ -14,10 +14,10 @@ this is not super elegant, but is the only route that promises not to
break stuff.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 3fe37b3306..c906479ac9 100644
index 982dce4800..d18a530a4d 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -996,7 +996,14 @@ public final class CraftServer implements Server {
@@ -997,7 +997,14 @@ public final class CraftServer implements Server {
}
DimensionManager actualDimension = DimensionManager.a(creator.environment().getId());