NOT FINISHED!!! Current Progress on 1.13-pre7 update

This work is 100% unfinished. I am pushing it up so that we as a team
can work on this update.

Do not try to use this branch. You will fail.
This commit is contained in:
Aikar 2018-07-14 21:53:17 -04:00
parent 898b8957a8
commit 6d1a918378
180 changed files with 1801 additions and 5796 deletions

View file

@ -9,7 +9,7 @@ on the real tile entity.
This is useful for where performance is needed This is useful for where performance is needed
diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java
index bda9900e..d5d0e255 100644 index 1aa3373f..9aab043c 100644
--- a/src/main/java/org/bukkit/block/Block.java --- a/src/main/java/org/bukkit/block/Block.java
+++ b/src/main/java/org/bukkit/block/Block.java +++ b/src/main/java/org/bukkit/block/Block.java
@@ -0,0 +0,0 @@ public interface Block extends Metadatable { @@ -0,0 +0,0 @@ public interface Block extends Metadatable {

View file

@ -10,7 +10,7 @@ of giving the player experience points.
Both an API To standalone mend, and apply mending logic to .giveExp has been added. Both an API To standalone mend, and apply mending logic to .giveExp has been added.
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 60cdd620..32ead009 100644 index 362467e5..6709168b 100644
--- a/src/main/java/org/bukkit/entity/Player.java --- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline

View file

@ -69,7 +69,7 @@ index 3ab2e4c7..8daf2ddc 100644
/** /**
* Checks if this player is whitelisted or not * Checks if this player is whitelisted or not
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index cd82ff64..2dd9ecfb 100644 index 99080b27..59c6a097 100644
--- a/src/main/java/org/bukkit/entity/Player.java --- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@

View file

@ -152,15 +152,4 @@ index 0d87d203..d4eee19c 100644
/** /**
* @return The size of the slime * @return The size of the slime
diff --git a/src/main/java/org/bukkit/entity/WaterMob.java b/src/main/java/org/bukkit/entity/WaterMob.java
index 3e89ca0c..8d105e72 100644
--- a/src/main/java/org/bukkit/entity/WaterMob.java
+++ b/src/main/java/org/bukkit/entity/WaterMob.java
@@ -0,0 +0,0 @@ package org.bukkit.entity;
/**
* Represents a Water Mob
*/
-public interface WaterMob extends LivingEntity {}
+public interface WaterMob extends LivingEntity, com.destroystokyo.paper.entity.SentientNPC { // Paper
+}
-- --

View file

@ -7,20 +7,19 @@ This allows you to create already filled textures on Skulls to avoid texture loo
which commonly cause rate limit issues with Mojang API which commonly cause rate limit issues with Mojang API
diff --git a/src/main/java/org/bukkit/inventory/meta/SkullMeta.java b/src/main/java/org/bukkit/inventory/meta/SkullMeta.java diff --git a/src/main/java/org/bukkit/inventory/meta/SkullMeta.java b/src/main/java/org/bukkit/inventory/meta/SkullMeta.java
index c60860e1..3eea5909 100644 index 15c1dfd9..a458000f 100644
--- a/src/main/java/org/bukkit/inventory/meta/SkullMeta.java --- a/src/main/java/org/bukkit/inventory/meta/SkullMeta.java
+++ b/src/main/java/org/bukkit/inventory/meta/SkullMeta.java +++ b/src/main/java/org/bukkit/inventory/meta/SkullMeta.java
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@
package org.bukkit.inventory.meta; package org.bukkit.inventory.meta;
+import com.destroystokyo.paper.profile.PlayerProfile; +import com.destroystokyo.paper.profile.PlayerProfile;
import org.bukkit.Material; +import javax.annotation.Nullable;
import org.bukkit.OfflinePlayer; import org.bukkit.OfflinePlayer;
+import javax.annotation.Nullable;
+ +
/** /**
* Represents a skull ({@link Material#SKULL_ITEM}) that can have an owner. * Represents a skull that can have an owner.
*/ */
@@ -0,0 +0,0 @@ public interface SkullMeta extends ItemMeta { @@ -0,0 +0,0 @@ public interface SkullMeta extends ItemMeta {
@Deprecated @Deprecated

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add String based Action Bar API
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index f1876a05..d06f26b9 100644 index 5638a077..bc2f9621 100644
--- a/src/main/java/org/bukkit/entity/Player.java --- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add World.getEntity(UUID) API
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 2c1056d1..c98349cc 100644 index 04c174f7..121033e9 100644
--- a/src/main/java/org/bukkit/World.java --- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java
@@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable { @@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable {

View file

@ -8,7 +8,7 @@ Currently the server only supports the English language. To override this,
You must replace the language file embedded in the server jar. You must replace the language file embedded in the server jar.
diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
index ab33e09e..061954f9 100644 index 045c26d9..47bbc0f9 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java --- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java +++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -0,0 +0,0 @@ public interface ItemFactory { @@ -0,0 +0,0 @@ public interface ItemFactory {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add methods for working with arrows stuck in living entities
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 5a30fa93..be51e389 100644 index 97c2172b..f6ae0a6d 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java --- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -0,0 +0,0 @@ public interface LivingEntity extends Attributable, Entity, Damageable, Projecti @@ -0,0 +0,0 @@ public interface LivingEntity extends Attributable, Entity, Damageable, Projecti

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Additional world.getNearbyEntities API's
Provides more methods to get nearby entities, and filter by types and predicates Provides more methods to get nearby entities, and filter by types and predicates
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 6417cefa..9b49ed38 100644 index 4cc70326..97badc63 100644
--- a/src/main/java/org/bukkit/World.java --- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java
@@ -0,0 +0,0 @@ package org.bukkit; @@ -0,0 +0,0 @@ package org.bukkit;

View file

@ -1,45 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: willies952002 <admin@domnian.com>
Date: Thu, 20 Jul 2017 18:05:36 -0400
Subject: [PATCH] Allow Changing of Player Sample in ServerListPingEvent
diff --git a/src/main/java/org/bukkit/event/server/ServerListPingEvent.java b/src/main/java/org/bukkit/event/server/ServerListPingEvent.java
index 3c38d857..cb8d0fcd 100644
--- a/src/main/java/org/bukkit/event/server/ServerListPingEvent.java
+++ b/src/main/java/org/bukkit/event/server/ServerListPingEvent.java
@@ -0,0 +0,0 @@ package org.bukkit.event.server;
import java.net.InetAddress;
import java.util.Iterator;
+import java.util.List;
import org.apache.commons.lang.Validate;
import org.bukkit.entity.Player;
@@ -0,0 +0,0 @@ public class ServerListPingEvent extends ServerEvent implements Iterable<Player>
public Iterator<Player> iterator() throws UnsupportedOperationException {
throw new UnsupportedOperationException();
}
+
+ // Paper start
+ private java.util.List<String> sample;
+
+ /**
+ * @deprecated Will be replaced in 1.13
+ */
+ @Deprecated
+ public void setSampleText(java.util.List<String> sample) {
+ this.sample = sample;
+ }
+
+ /**
+ * @deprecated Will be replaced in 1.13
+ */
+ @Deprecated
+ public java.util.List<String> getSampleText() {
+ return sample;
+ }
+ // Paper end
+
}
--

View file

@ -14,7 +14,7 @@ it without having to shade it in the plugin and going through
several layers of logging abstraction. several layers of logging abstraction.
diff --git a/pom.xml b/pom.xml diff --git a/pom.xml b/pom.xml
index e1a39bfe..db9a57b0 100644 index 44a8b2a5..c176dd7b 100644
--- a/pom.xml --- a/pom.xml
+++ b/pom.xml +++ b/pom.xml
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Automatically disable plugins that fail to load
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 81b42822..3af99b5b 100644
--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java --- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
@@ -0,0 +0,0 @@ public final class JavaPluginLoader implements PluginLoader { @@ -0,0 +0,0 @@ public final class JavaPluginLoader implements PluginLoader {

View file

@ -100,7 +100,7 @@ index bd0588a2..cb2b0b9c 100644
lookupNames.clear(); lookupNames.clear();
HandlerList.unregisterAll(); HandlerList.unregisterAll();
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
index 40fd71dc..3e87c3dd 100644 index 72d506d1..3cff01b6 100644
--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java --- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
@@ -0,0 +0,0 @@ public final class JavaPluginLoader implements PluginLoader { @@ -0,0 +0,0 @@ public final class JavaPluginLoader implements PluginLoader {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Complete resource pack API
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 5955b20c..f1876a05 100644 index 1837a14c..5638a077 100644
--- a/src/main/java/org/bukkit/entity/Player.java --- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
@ -77,30 +77,34 @@ index 5955b20c..f1876a05 100644
public class Spigot extends Entity.Spigot public class Spigot extends Entity.Spigot
{ {
diff --git a/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java b/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java diff --git a/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java b/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java
index 4c498016..4c838519 100644 index 4c498016..aa18a766 100644
--- a/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java --- a/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java
+++ b/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java
@@ -0,0 +0,0 @@ import org.bukkit.event.HandlerList; @@ -0,0 +0,0 @@ import org.bukkit.event.HandlerList;
public class PlayerResourcePackStatusEvent extends PlayerEvent { public class PlayerResourcePackStatusEvent extends PlayerEvent {
private static final HandlerList handlers = new HandlerList(); private static final HandlerList handlers = new HandlerList();
+ @Deprecated
+ private final String hash; // Paper + private final String hash; // Paper
private final Status status; private final Status status;
+ @Deprecated // Paper
public PlayerResourcePackStatusEvent(final Player who, Status resourcePackStatus) { public PlayerResourcePackStatusEvent(final Player who, Status resourcePackStatus) {
super(who); super(who);
+ this.hash = null; // Paper + this.hash = null; // Paper
this.status = resourcePackStatus; this.status = resourcePackStatus;
} }
+ // Paper start + @Deprecated // Paper
+ public PlayerResourcePackStatusEvent(final Player who, Status resourcePackStatus, String hash) { + public PlayerResourcePackStatusEvent(final Player who, Status resourcePackStatus, String hash) {
+ super(who); + super(who);
+ this.hash = hash; // Paper + this.hash = hash; // Paper
+ this.status = resourcePackStatus; + this.status = resourcePackStatus;
+ } + }
+ +
+ @Deprecated
+ /**
+ * @deprecated Hash does not seem to ever be set
+ */
+ public String getHash() { + public String getHash() {
+ return this.hash; + return this.hash;
+ } + }

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Enderman.teleportRandomly()
Ability to trigger the vanilla "teleport randomly" mechanic of an enderman. Ability to trigger the vanilla "teleport randomly" mechanic of an enderman.
diff --git a/src/main/java/org/bukkit/entity/Enderman.java b/src/main/java/org/bukkit/entity/Enderman.java diff --git a/src/main/java/org/bukkit/entity/Enderman.java b/src/main/java/org/bukkit/entity/Enderman.java
index c8b4efde..bc2df752 100644 index ab827f83..459ec0c9 100644
--- a/src/main/java/org/bukkit/entity/Enderman.java --- a/src/main/java/org/bukkit/entity/Enderman.java
+++ b/src/main/java/org/bukkit/entity/Enderman.java +++ b/src/main/java/org/bukkit/entity/Enderman.java
@@ -0,0 +0,0 @@ import org.bukkit.material.MaterialData; @@ -0,0 +0,0 @@ import org.bukkit.material.MaterialData;
@ -25,6 +25,6 @@ index c8b4efde..bc2df752 100644
+ // Paper end + // Paper end
+ +
/** /**
* Get the id and data of the block that the Enderman is carrying. * Gets the id and data of the block that the Enderman is carrying.
* *
-- --

View file

@ -25,7 +25,7 @@ index 28b169d2..9b0f97f1 100644
+ // Paper end + // Paper end
} }
diff --git a/src/main/java/org/bukkit/entity/FallingBlock.java b/src/main/java/org/bukkit/entity/FallingBlock.java diff --git a/src/main/java/org/bukkit/entity/FallingBlock.java b/src/main/java/org/bukkit/entity/FallingBlock.java
index 0b5c062f..48d6c951 100644 index 9d34e691..b0b1defc 100644
--- a/src/main/java/org/bukkit/entity/FallingBlock.java --- a/src/main/java/org/bukkit/entity/FallingBlock.java
+++ b/src/main/java/org/bukkit/entity/FallingBlock.java +++ b/src/main/java/org/bukkit/entity/FallingBlock.java
@@ -0,0 +0,0 @@ public interface FallingBlock extends Entity { @@ -0,0 +0,0 @@ public interface FallingBlock extends Entity {

View file

@ -95,7 +95,7 @@ index c1689168..d0d86e1a 100644
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index cc74cf53..2c1056d1 100644 index a22e47ea..04c174f7 100644
--- a/src/main/java/org/bukkit/World.java --- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java
@@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable { @@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable {

View file

@ -410,7 +410,7 @@ index 4d0acaf5..0ae85d85 100644
* Options which can be applied to redstone dust particles - a particle * Options which can be applied to redstone dust particles - a particle
* color and size. * color and size.
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 9b49ed38..cc74cf53 100644 index 97badc63..a22e47ea 100644
--- a/src/main/java/org/bukkit/World.java --- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java
@@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable { @@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable {

View file

@ -55,7 +55,7 @@ index 00000000..9072e384
+ +
+} +}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 5c29c11e..60cdd620 100644 index 47a12d71..362467e5 100644
--- a/src/main/java/org/bukkit/entity/Player.java --- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java
@@ -0,0 +0,0 @@ import org.bukkit.scoreboard.Scoreboard; @@ -0,0 +0,0 @@ import org.bukkit.scoreboard.Scoreboard;

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Fix upstream javadoc warnings and errors
Upstream still refuses to use Java 8 with the API so they are likely unaware these are even issues. Upstream still refuses to use Java 8 with the API so they are likely unaware these are even issues.
diff --git a/src/main/java/org/bukkit/NamespacedKey.java b/src/main/java/org/bukkit/NamespacedKey.java diff --git a/src/main/java/org/bukkit/NamespacedKey.java b/src/main/java/org/bukkit/NamespacedKey.java
index 19632d17..de1b1112 100644 index 1ed8f7e4..bd5238ce 100644
--- a/src/main/java/org/bukkit/NamespacedKey.java --- a/src/main/java/org/bukkit/NamespacedKey.java
+++ b/src/main/java/org/bukkit/NamespacedKey.java +++ b/src/main/java/org/bukkit/NamespacedKey.java
@@ -0,0 +0,0 @@ public final class NamespacedKey { @@ -0,0 +0,0 @@ public final class NamespacedKey {
@ -21,7 +21,7 @@ index 19632d17..de1b1112 100644
*/ */
@Deprecated @Deprecated
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 65156e80..6417cefa 100644 index 1e980d2d..4cc70326 100644
--- a/src/main/java/org/bukkit/World.java --- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java
@@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable { @@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable {
@ -112,7 +112,7 @@ index cfce8fa5..8660070b 100644
*/ */
@Deprecated @Deprecated
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index d06f26b9..5c29c11e 100644 index bc2f9621..47a12d71 100644
--- a/src/main/java/org/bukkit/entity/Player.java --- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline

View file

@ -1,75 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Minecrell <minecrell@minecrell.net>
Date: Mon, 27 Nov 2017 16:21:19 +0100
Subject: [PATCH] Implement deprecated player sample API
diff --git a/src/main/java/com/destroystokyo/paper/event/server/PaperServerListPingEvent.java b/src/main/java/com/destroystokyo/paper/event/server/PaperServerListPingEvent.java
index dd1deafd..db992df2 100644
--- a/src/main/java/com/destroystokyo/paper/event/server/PaperServerListPingEvent.java
+++ b/src/main/java/com/destroystokyo/paper/event/server/PaperServerListPingEvent.java
@@ -0,0 +0,0 @@ import static java.util.Objects.requireNonNull;
import com.destroystokyo.paper.network.StatusClient;
import com.destroystokyo.paper.profile.PlayerProfile;
+import com.google.common.base.Strings;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
@@ -0,0 +0,0 @@ public class PaperServerListPingEvent extends ServerListPingEvent implements Can
}
}
+ // TODO: Remove in 1.13
+
+ @Override
+ @Deprecated
+ public List<String> getSampleText() {
+ List<String> sampleText = new ArrayList<>();
+ for (PlayerProfile profile : getPlayerSample()) {
+ sampleText.add(Strings.nullToEmpty(profile.getName()));
+ }
+ return sampleText;
+ }
+
+ @Override
+ @Deprecated
+ public void setSampleText(List<String> sample) {
+ getPlayerSample().clear();
+ for (String name : sample) {
+ getPlayerSample().add(Bukkit.createProfile(name));
+ }
+ }
+
}
diff --git a/src/main/java/org/bukkit/event/server/ServerListPingEvent.java b/src/main/java/org/bukkit/event/server/ServerListPingEvent.java
index cb8d0fcd..116d7c7a 100644
--- a/src/main/java/org/bukkit/event/server/ServerListPingEvent.java
+++ b/src/main/java/org/bukkit/event/server/ServerListPingEvent.java
@@ -0,0 +0,0 @@ import java.net.InetAddress;
import java.util.Iterator;
import java.util.List;
+import com.destroystokyo.paper.event.server.PaperServerListPingEvent;
import org.apache.commons.lang.Validate;
import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
@@ -0,0 +0,0 @@ public class ServerListPingEvent extends ServerEvent implements Iterable<Player>
private java.util.List<String> sample;
/**
- * @deprecated Will be replaced in 1.13
+ * @deprecated Will be removed in 1.13, use {@link PaperServerListPingEvent#getPlayerSample()}
*/
@Deprecated
public void setSampleText(java.util.List<String> sample) {
@@ -0,0 +0,0 @@ public class ServerListPingEvent extends ServerEvent implements Iterable<Player>
}
/**
- * @deprecated Will be replaced in 1.13
+ * @deprecated Will be removed in 1.13, use {@link PaperServerListPingEvent#getPlayerSample()}
*/
@Deprecated
public java.util.List<String> getSampleText() {
--

View file

@ -6,7 +6,7 @@ Subject: [PATCH] LivingEntity Hand Raised/Item Use API
How long an entity has raised hands to charge an attack or use an item How long an entity has raised hands to charge an attack or use an item
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 5921c952..5ccb8ef3 100644 index 7ea7ccf0..fea831e6 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java --- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -0,0 +0,0 @@ import org.bukkit.Material; @@ -0,0 +0,0 @@ import org.bukkit.Material;

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Make shield blocking delay configurable
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 42cf95e1..5921c952 100644 index 700ed29f..7ea7ccf0 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java --- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -0,0 +0,0 @@ public interface LivingEntity extends Attributable, Entity, Damageable, Projecti @@ -0,0 +0,0 @@ public interface LivingEntity extends Attributable, Entity, Damageable, Projecti

View file

@ -5,7 +5,7 @@ Subject: [PATCH] POM changes
diff --git a/pom.xml b/pom.xml diff --git a/pom.xml b/pom.xml
index 99ff13b3..cc8fca48 100644 index 3e6c8707..c2d0651e 100644
--- a/pom.xml --- a/pom.xml
+++ b/pom.xml +++ b/pom.xml
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@
@ -20,9 +20,8 @@ index 99ff13b3..cc8fca48 100644
+ <version>dev-SNAPSHOT</version> + <version>dev-SNAPSHOT</version>
+ </parent> + </parent>
+ +
+ <groupId>com.destroystokyo.paper</groupId>
+ <artifactId>paper-api</artifactId> + <artifactId>paper-api</artifactId>
<version>1.13-pre5-R0.1-SNAPSHOT</version> <version>1.13-pre7-R0.1-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
- <name>Spigot-API</name> - <name>Spigot-API</name>
@ -32,7 +31,13 @@ index 99ff13b3..cc8fca48 100644
<description>An enhanced plugin API for Minecraft servers.</description> <description>An enhanced plugin API for Minecraft servers.</description>
<properties> <properties>
@@ -0,0 +0,0 @@ - <maven.compiler.source>1.7</maven.compiler.source>
- <maven.compiler.target>1.7</maven.compiler.target>
+ <!-- Paper - #Logic -->
+ <maven.compiler.source>1.8</maven.compiler.source>
+ <maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<distributionManagement> <distributionManagement>
<repository> <repository>
@ -111,7 +116,7 @@ index 99ff13b3..cc8fca48 100644
- <plugin> - <plugin>
- <groupId>org.codehaus.mojo</groupId> - <groupId>org.codehaus.mojo</groupId>
- <artifactId>animal-sniffer-maven-plugin</artifactId> - <artifactId>animal-sniffer-maven-plugin</artifactId>
- <version>1.16</version> - <version>1.17</version>
- <executions> - <executions>
- <execution> - <execution>
- <phase>process-classes</phase> - <phase>process-classes</phase>
@ -123,7 +128,7 @@ index 99ff13b3..cc8fca48 100644
- <configuration> - <configuration>
- <signature> - <signature>
- <groupId>org.codehaus.mojo.signature</groupId> - <groupId>org.codehaus.mojo.signature</groupId>
- <artifactId>java18</artifactId> - <artifactId>java17</artifactId>
- <version>1.0</version> - <version>1.0</version>
- </signature> - </signature>
- </configuration> - </configuration>

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Player.setPlayerProfile API
This can be useful for changing name or skins after a player has logged in. This can be useful for changing name or skins after a player has logged in.
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 32ead009..cd82ff64 100644 index 6709168b..99080b27 100644
--- a/src/main/java/org/bukkit/entity/Player.java --- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java
@@ -0,0 +0,0 @@ package org.bukkit.entity; @@ -0,0 +0,0 @@ package org.bukkit.entity;

View file

@ -3529,7 +3529,7 @@ index bba914d7..00000000
- // Spigot end - // Spigot end
-} -}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 86eca9e1..116a1e7a 100644 index 115c5b0b..90b22bcc 100644
--- a/src/main/java/org/bukkit/entity/Player.java --- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
@ -3602,7 +3602,7 @@ index 8b130abb..80c152ba 100644
} }
} }
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
index 80c6a72e..759c4617 100644 index 113b899c..81b42822 100644
--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java --- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
@@ -0,0 +0,0 @@ import org.bukkit.plugin.PluginLoader; @@ -0,0 +0,0 @@ import org.bukkit.plugin.PluginLoader;

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Use ASM for event executors.
Uses method handles for private or static methods. Uses method handles for private or static methods.
diff --git a/pom.xml b/pom.xml diff --git a/pom.xml b/pom.xml
index f5e8d49d..dfc6c9b5 100644 index 5e2024ca..bd9146dd 100644
--- a/pom.xml --- a/pom.xml
+++ b/pom.xml +++ b/pom.xml
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@
@ -401,7 +401,7 @@ index 3b2c99ea..b45b6c1c 100644
+ // Paper end + // Paper end
} }
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
index d8b9c244..40fd71dc 100644 index 3af99b5b..72d506d1 100644
--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java --- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
@@ -0,0 +0,0 @@ public final class JavaPluginLoader implements PluginLoader { @@ -0,0 +0,0 @@ public final class JavaPluginLoader implements PluginLoader {

View file

@ -7,7 +7,7 @@ This will take a Bukkit ItemStack and run it through any conversions a server pr
to ensure it meets latest minecraft expectations. to ensure it meets latest minecraft expectations.
diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
index f74f8ae9..ab33e09e 100644 index 762c43d6..045c26d9 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java --- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java +++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -0,0 +0,0 @@ public interface ItemFactory { @@ -0,0 +0,0 @@ public interface ItemFactory {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Access items by EquipmentSlot
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java
index 67c54899d..3f58c34e0 100644 index 6cbe06956..7b62f26d7 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java
@@ -0,0 +0,0 @@ public class CraftInventoryPlayer extends CraftInventory implements org.bukkit.i @@ -0,0 +0,0 @@ public class CraftInventoryPlayer extends CraftInventory implements org.bukkit.i

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add BeaconEffectEvent
diff --git a/src/main/java/net/minecraft/server/TileEntityBeacon.java b/src/main/java/net/minecraft/server/TileEntityBeacon.java diff --git a/src/main/java/net/minecraft/server/TileEntityBeacon.java b/src/main/java/net/minecraft/server/TileEntityBeacon.java
index b84a2ce55..a57b17171 100644 index c0db08f61..32b53bcae 100644
--- a/src/main/java/net/minecraft/server/TileEntityBeacon.java --- a/src/main/java/net/minecraft/server/TileEntityBeacon.java
+++ b/src/main/java/net/minecraft/server/TileEntityBeacon.java +++ b/src/main/java/net/minecraft/server/TileEntityBeacon.java
@@ -0,0 +0,0 @@ import org.bukkit.entity.HumanEntity; @@ -0,0 +0,0 @@ import org.bukkit.entity.HumanEntity;
@ -15,15 +15,13 @@ index b84a2ce55..a57b17171 100644
+// Paper start +// Paper start
+import org.bukkit.craftbukkit.event.CraftEventFactory; +import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.entity.Player; +import org.bukkit.entity.Player;
+import org.bukkit.potion.PotionData;
+import org.bukkit.potion.PotionEffect;
+import com.destroystokyo.paper.event.block.BeaconEffectEvent; +import com.destroystokyo.paper.event.block.BeaconEffectEvent;
+// Paper end +// Paper end
+ +
public class TileEntityBeacon extends TileEntityContainer implements ITickable, IWorldInventory { public class TileEntityBeacon extends TileEntityContainer implements IWorldInventory, ITickable {
public static final MobEffectList[][] a = new MobEffectList[][] { { MobEffects.FASTER_MOVEMENT, MobEffects.FASTER_DIG}, { MobEffects.RESISTANCE, MobEffects.JUMP}, { MobEffects.INCREASE_DAMAGE}, { MobEffects.REGENERATION}}; public static final MobEffectList[][] a = new MobEffectList[][] { { MobEffects.FASTER_MOVEMENT, MobEffects.FASTER_DIG}, { MobEffects.RESISTANCE, MobEffects.JUMP}, { MobEffects.INCREASE_DAMAGE}, { MobEffects.REGENERATION}};
@@ -0,0 +0,0 @@ public class TileEntityBeacon extends TileEntityContainer implements ITickable, @@ -0,0 +0,0 @@ public class TileEntityBeacon extends TileEntityContainer implements IWorldInven
} }
private void applyEffect(List list, MobEffectList effects, int i, int b0) { private void applyEffect(List list, MobEffectList effects, int i, int b0) {
@ -55,7 +53,7 @@ index b84a2ce55..a57b17171 100644
} }
} }
} }
@@ -0,0 +0,0 @@ public class TileEntityBeacon extends TileEntityContainer implements ITickable, @@ -0,0 +0,0 @@ public class TileEntityBeacon extends TileEntityContainer implements IWorldInven
int i = getLevel(); int i = getLevel();
List list = getHumansInRange(); List list = getHumansInRange();

View file

@ -5,26 +5,66 @@ Subject: [PATCH] Add MinecraftKey Information to Objects
Stores the reference to the objects respective MinecraftKey Stores the reference to the objects respective MinecraftKey
diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java
index a0ebc1eaa..e4c771a39 100644
--- a/src/main/java/com/destroystokyo/paper/PaperCommand.java
+++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java
@@ -0,0 +0,0 @@ public class PaperCommand extends Command {
List<Entity> entities = world.entityList;
entities.forEach(e -> {
- MinecraftKey key = new MinecraftKey(""); // TODO: update in next patch
+ MinecraftKey key = e.getMinecraftKey();
MutablePair<Integer, Map<ChunkCoordIntPair, Integer>> info = list.computeIfAbsent(key, k -> MutablePair.of(0, Maps.newHashMap()));
ChunkCoordIntPair chunk = new ChunkCoordIntPair(e.getChunkX(), e.getChunkZ());
@@ -0,0 +0,0 @@ public class PaperCommand extends Command {
Command.broadcastCommandMessage(sender, ChatColor.GREEN + "Paper config reload complete.");
}
-
+
}
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index ed39b122e..3a8902bf1 100644 index 515c9d875..53fc37088 100644
--- a/src/main/java/net/minecraft/server/Entity.java --- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java
@@ -0,0 +0,0 @@ import org.bukkit.event.entity.EntityPortalEvent; @@ -0,0 +0,0 @@ import org.bukkit.event.entity.EntityPortalEvent;
import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.PluginManager;
// CraftBukkit end // CraftBukkit end
-public abstract class Entity implements ICommandListener { -public abstract class Entity implements INamableTileEntity, ICommandListener {
+public abstract class Entity implements ICommandListener, KeyedObject { // Paper +public abstract class Entity implements INamableTileEntity, ICommandListener, KeyedObject { // Paper
// CraftBukkit start // CraftBukkit start
private static final int CURRENT_LEVEL = 2; private static final int CURRENT_LEVEL = 2;
@@ -0,0 +0,0 @@ public abstract class Entity implements ICommandListener { @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener {
private static final AxisAlignedBB b = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
private static double c = 1.0D;
private static int entityCount;
- private final EntityTypes<?> g;
+ private final EntityTypes<?> g; public EntityTypes<?> getEntityType() { return g; } // Paper - OBFHELPER
private int id;
public boolean j;
public final List<Entity> passengers;
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener {
} else {
this.defaultActivationState = false;
}
+ // Paper start
+ this.entityKey = EntityTypes.getName(entitytypes);
+ this.entityKeyString = this.entityKey != null ? this.entityKey.toString() : null;
+ // Paper end
// Spigot end
this.datawatcher = new DataWatcher(this);
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener {
return true; return true;
} }
+ // Paper start + // Paper start
+ public final MinecraftKey entityKey = EntityTypes.getKey(this); + public final MinecraftKey entityKey;
+ public final String entityKeyString = entityKey != null ? entityKey.toString() : null; + public final String entityKeyString;
+ +
+ @Override + @Override
+ public MinecraftKey getMinecraftKey() { + public MinecraftKey getMinecraftKey() {
@ -37,14 +77,28 @@ index ed39b122e..3a8902bf1 100644
+ } + }
@Nullable @Nullable
public final String getSaveID() { public final String getSaveID() {
- MinecraftKey minecraftkey = EntityTypes.a(this); - EntityTypes entitytypes = this.P();
- MinecraftKey minecraftkey = EntityTypes.getName(entitytypes);
- -
- return minecraftkey == null ? null : minecraftkey.toString(); - return entitytypes.a() && minecraftkey != null ? minecraftkey.toString() : null;
+ return entityKeyString; + EntityTypes type = this.getEntityType();
+ return type != null && type.isPersistable() ? entityKeyString : null;
+ // Paper end + // Paper end
} }
protected abstract void a(NBTTagCompound nbttagcompound); protected abstract void a(NBTTagCompound nbttagcompound);
diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java
index 557a3f97f..97cfd6695 100644
--- a/src/main/java/net/minecraft/server/EntityTypes.java
+++ b/src/main/java/net/minecraft/server/EntityTypes.java
@@ -0,0 +0,0 @@ public class EntityTypes<T extends Entity> {
}
}
+ public boolean isPersistable() { return a(); } // Paper - OBFHELPER
public boolean a() {
return this.aV;
}
diff --git a/src/main/java/net/minecraft/server/KeyedObject.java b/src/main/java/net/minecraft/server/KeyedObject.java diff --git a/src/main/java/net/minecraft/server/KeyedObject.java b/src/main/java/net/minecraft/server/KeyedObject.java
new file mode 100644 new file mode 100644
index 000000000..61c2b993c index 000000000..61c2b993c
@ -60,7 +114,7 @@ index 000000000..61c2b993c
+ } + }
+} +}
diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java
index 5a5a588e7..672ba3134 100644 index 093e7eb7f..b09325097 100644
--- a/src/main/java/net/minecraft/server/TileEntity.java --- a/src/main/java/net/minecraft/server/TileEntity.java
+++ b/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger; @@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger;
@ -72,15 +126,22 @@ index 5a5a588e7..672ba3134 100644
public CustomTimingsHandler tickTimer = org.bukkit.craftbukkit.SpigotTimings.getTileEntityTimings(this); // Spigot public CustomTimingsHandler tickTimer = org.bukkit.craftbukkit.SpigotTimings.getTileEntityTimings(this); // Spigot
private static final Logger a = LogManager.getLogger(); private static final Logger a = LogManager.getLogger();
- private final TileEntityTypes<?> e;
+ private final TileEntityTypes<?> e; public TileEntityTypes getTileEntityType() { return e; } // Paper - OBFHELPER
protected World world;
protected BlockPosition position;
protected boolean d;
@@ -0,0 +0,0 @@ public abstract class TileEntity { @@ -0,0 +0,0 @@ public abstract class TileEntity {
TileEntity.f.a(new MinecraftKey(s), oclass); public TileEntity(TileEntityTypes<?> tileentitytypes) {
this.position = BlockPosition.ZERO;
this.e = tileentitytypes;
+ // Paper start
+ this.tileEntityKey = TileEntityTypes.a(tileentitytypes);
+ this.tileEntityKeyString = tileEntityKey != null ? tileEntityKey.toString() : null;
} }
- @Nullable + public final MinecraftKey tileEntityKey;
- public static MinecraftKey a(Class<? extends TileEntity> oclass) { + public final String tileEntityKeyString;
+ // Paper start
+ public final MinecraftKey tileEntityKey = getKey(this.getClass());
+ public final String tileEntityKeyString = tileEntityKey != null ? tileEntityKey.toString() : null;
+ +
+ @Override + @Override
+ public MinecraftKey getMinecraftKey() { + public MinecraftKey getMinecraftKey() {
@ -91,9 +152,9 @@ index 5a5a588e7..672ba3134 100644
+ public String getMinecraftKeyString() { + public String getMinecraftKeyString() {
+ return tileEntityKeyString; + return tileEntityKeyString;
+ } + }
+ @Nullable public static MinecraftKey getKey(Class<? extends TileEntity> oclass) { return a(oclass); } // Paper - OBFHELPER + // Paper end
+ @Nullable public static MinecraftKey a(Class<? extends TileEntity> oclass) { +
return (MinecraftKey) TileEntity.f.b(oclass); @Nullable
} public World getWorld() {
return this.world;
-- --

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Add PlayerInitialSpawnEvent
For modifying a player's initial spawn location as they join the server For modifying a player's initial spawn location as they join the server
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 1d9f3e3dd..536534d2e 100644 index 1e3dd22e5..23562388a 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java --- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -0,0 +0,0 @@ public abstract class PlayerList { @@ -0,0 +0,0 @@ public abstract class PlayerList {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerUseUnknownEntityEvent
diff --git a/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java b/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java diff --git a/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java b/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java
index c67cb54a3..521f46262 100644 index 77440ac81..8711462e1 100644
--- a/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java --- a/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java
+++ b/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java +++ b/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java
@@ -0,0 +0,0 @@ import javax.annotation.Nullable; @@ -0,0 +0,0 @@ import javax.annotation.Nullable;
@ -18,7 +18,7 @@ index c67cb54a3..521f46262 100644
private Vec3D c; private Vec3D c;
private EnumHand d; private EnumHand d;
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index e1b85ebae..7c708a0de 100644 index 2cc277e4f..553011d88 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java --- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {

View file

@ -6,65 +6,57 @@ Subject: [PATCH] Add World Util Methods
Methods that can be used for other patches to help improve logic. Methods that can be used for other patches to help improve logic.
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 0788f7712..57b23a018 100644 index fa500e93f..f376b3a34 100644
--- a/src/main/java/net/minecraft/server/Chunk.java --- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -0,0 +0,0 @@ public class Chunk { @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
}
} }
+ public final int getLightSubtracted(BlockPosition blockposition, int i) { return this.a(blockposition, i); } // Paper - OBFHELPER + public final int getLightSubtracted(BlockPosition blockposition, int i) { return this.a(blockposition, i); } // Paper - OBFHELPER
public int a(BlockPosition blockposition, int i) { public int a(BlockPosition blockposition, int i) {
int j = blockposition.getX() & 15; return this.a(blockposition, i, this.world.o().g());
int k = blockposition.getY(); }
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 6be9c1815..b8ae41704 100644 index d51ed0f80..1c939e523 100644
--- a/src/main/java/net/minecraft/server/World.java --- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose
public final List<Entity> j = Lists.newArrayList(); public final List<Entity> k = Lists.newArrayList();
protected final IntHashMap<Entity> entitiesById = new IntHashMap(); protected final IntHashMap<Entity> entitiesById = new IntHashMap();
private final long K = 16777215L; private final long G = 16777215L;
- private int L; - private int H;
+ private int L; private int getSkylightSubtracted() { return this.L; } // Paper - OBFHELPER + private int H; private int getSkylightSubtracted() { return this.H; } // Paper - OBFHELPER
protected int l = (new Random()).nextInt(); protected int m = (new Random()).nextInt();
protected final int m = 1013904223; protected final int n = 1013904223;
protected float n; protected float o;
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose
return (CraftServer) Bukkit.getServer(); return this.getType(blockposition).isAir();
} }
+ // Paper start + // Paper start
+ public Chunk getChunkIfLoaded(BlockPosition blockposition) { + public Chunk getChunkIfLoaded(BlockPosition blockposition) {
+ return ((ChunkProviderServer) this.chunkProvider).getChunkIfLoaded(blockposition.getX() >> 4, blockposition.getZ() >> 4); + return ((ChunkProviderServer) this.chunkProvider).getChunkIfLoaded(blockposition.getX() >> 4, blockposition.getZ() >> 4);
+ } + }
+ // Paper end + // test if meets light level, return faster
+
public Chunk getChunkIfLoaded(int x, int z) {
return ((ChunkProviderServer) this.chunkProvider).getChunkIfLoaded(x, z);
}
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
}
}
+ // Paper start - test if meets light level, return faster
+ // logic copied from below + // logic copied from below
+ public boolean isLightLevel(BlockPosition blockposition, int level) { + public boolean isLightLevel(BlockPosition blockposition, int level) {
+ if (isValidLocation(blockposition)) { + if (isValidLocation(blockposition)) {
+ if (this.getType(blockposition).f()) { + if (this.getType(blockposition).c(this, blockposition)) {
+ if (this.c(blockposition.up(), false) >= level) { + int sky = getSkylightSubtracted();
+ if (this.getLightLevel(blockposition.up(), sky) >= level) {
+ return true; + return true;
+ } + }
+ if (this.c(blockposition.east(), false) >= level) { + if (this.getLightLevel(blockposition.east(), sky) >= level) {
+ return true; + return true;
+ } + }
+ if (this.c(blockposition.west(), false) >= level) { + if (this.getLightLevel(blockposition.west(), sky) >= level) {
+ return true; + return true;
+ } + }
+ if (this.c(blockposition.south(), false) >= level) { + if (this.getLightLevel(blockposition.south(), sky) >= level) {
+ return true; + return true;
+ } + }
+ if (this.c(blockposition.north(), false) >= level) { + if (this.getLightLevel(blockposition.north(), sky) >= level) {
+ return true; + return true;
+ } + }
+ return false; + return false;
@ -80,42 +72,26 @@ index 6be9c1815..b8ae41704 100644
+ return true; + return true;
+ } + }
+ } + }
+ // Paper end + // reduces need to do isLoaded before getType
+
public int getLightLevel(BlockPosition blockposition) {
return this.c(blockposition, true);
}
+ public final int getLight(BlockPosition blockposition, boolean checkNeighbors) { return this.c(blockposition, checkNeighbors); } // Paper - OBFHELPER
public int c(BlockPosition blockposition, boolean flag) {
if (blockposition.getX() >= -30000000 && blockposition.getZ() >= -30000000 && blockposition.getX() < 30000000 && blockposition.getZ() < 30000000) {
if (flag && this.getType(blockposition).f()) {
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
return this.worldProvider.o()[this.getLightLevel(blockposition)];
}
+ // Paper start - reduces need to do isLoaded before getType
+ public IBlockData getTypeIfLoaded(BlockPosition blockposition) { + public IBlockData getTypeIfLoaded(BlockPosition blockposition) {
+ // CraftBukkit start - tree generation + // CraftBukkit start - tree generation
+ if (captureTreeGeneration) { + if (captureTreeGeneration) {
+ Iterator<BlockState> it = capturedBlockStates.iterator(); + for (CraftBlockState previous : capturedBlockStates) {
+ while (it.hasNext()) {
+ BlockState previous = it.next();
+ if (previous.getX() == blockposition.getX() && previous.getY() == blockposition.getY() && previous.getZ() == blockposition.getZ()) { + if (previous.getX() == blockposition.getX() && previous.getY() == blockposition.getY() && previous.getZ() == blockposition.getZ()) {
+ return CraftMagicNumbers.getBlock(previous.getTypeId()).fromLegacyData(previous.getRawData()); + return previous.getHandle();
+ } + }
+ } + }
+ } + }
+ // CraftBukkit end + // CraftBukkit end
+ Chunk chunk = this.getChunkIfLoaded(blockposition); + Chunk chunk = this.getChunkIfLoaded(blockposition);
+ if (chunk != null) { + if (chunk != null) {
+ return this.isValidLocation(blockposition) ? chunk.getBlockData(blockposition) : Blocks.AIR.getBlockData(); + return isValidLocation(blockposition) ? chunk.getBlockData(blockposition) : Blocks.AIR.getBlockData();
+ } + }
+ return null; + return null;
+ } + }
+ // Paper end + // Paper end
+ +
public IBlockData getType(BlockPosition blockposition) { public Chunk getChunkAtWorldCoords(BlockPosition blockposition) {
// CraftBukkit start - tree generation return this.getChunkAt(blockposition.getX() >> 4, blockposition.getZ() >> 4);
if (captureTreeGeneration) { }
-- --

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add async chunk load API
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index ef8165da4..01fc193db 100644 index 0b2a9d09d..4df849eef 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -0,0 +0,0 @@ public class CraftWorld implements World { @@ -0,0 +0,0 @@ public class CraftWorld implements World {

View file

@ -30,7 +30,7 @@ index 1d9dd0e0b..22c1113a1 100644
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
index 7b02b253c..94967e6b6 100644 index 27b01d1ee..c8c191667 100644
--- a/src/main/java/net/minecraft/server/EntityInsentient.java --- a/src/main/java/net/minecraft/server/EntityInsentient.java
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java
@@ -0,0 +0,0 @@ public abstract class EntityInsentient extends EntityLiving { @@ -0,0 +0,0 @@ public abstract class EntityInsentient extends EntityLiving {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add configurable portal search radius
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index a289ba019..38ccabc0d 100644 index 0743db5ac..1ba09df9c 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -0,0 +0,0 @@ public class PaperWorldConfig {
@ -19,17 +19,17 @@ index a289ba019..38ccabc0d 100644
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/PortalTravelAgent.java b/src/main/java/net/minecraft/server/PortalTravelAgent.java diff --git a/src/main/java/net/minecraft/server/PortalTravelAgent.java b/src/main/java/net/minecraft/server/PortalTravelAgent.java
index d1c67e396..f49729796 100644 index 0cb1eeb68..402d8d7d6 100644
--- a/src/main/java/net/minecraft/server/PortalTravelAgent.java --- a/src/main/java/net/minecraft/server/PortalTravelAgent.java
+++ b/src/main/java/net/minecraft/server/PortalTravelAgent.java +++ b/src/main/java/net/minecraft/server/PortalTravelAgent.java
@@ -0,0 +0,0 @@ import org.bukkit.util.Vector; @@ -0,0 +0,0 @@ import org.bukkit.util.Vector;
public class PortalTravelAgent { public class PortalTravelAgent {
private static final BlockPortal a = (BlockPortal) Blocks.NETHER_PORTAL;
- private final WorldServer world; - private final WorldServer world;
+ protected final WorldServer world; // Paper - private -> protected + public final WorldServer world; // Paper - private -> public
private final Random b; private final Random c;
private final Long2ObjectMap<PortalTravelAgent.ChunkCoordinatesPortal> c = new Long2ObjectOpenHashMap(4096); private final Long2ObjectMap<PortalTravelAgent.ChunkCoordinatesPortal> d = new Long2ObjectOpenHashMap(4096);
@@ -0,0 +0,0 @@ public class PortalTravelAgent { @@ -0,0 +0,0 @@ public class PortalTravelAgent {

View file

@ -50,30 +50,39 @@ index 000000000..93397188b
+} +}
\ No newline at end of file \ No newline at end of file
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index a5db14343..0788f7712 100644 index 32f467b37..fa500e93f 100644
--- a/src/main/java/net/minecraft/server/Chunk.java --- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@
package net.minecraft.server; package net.minecraft.server;
+import com.destroystokyo.paper.exception.ServerInternalException; +import com.destroystokyo.paper.exception.ServerInternalException;
import com.google.common.base.Predicate;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.google.common.collect.Queues; import com.google.common.collect.Queues;
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger; import com.google.common.collect.Sets;
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import com.google.common.collect.Lists; // CraftBukkit import com.google.common.collect.Lists; // CraftBukkit
import org.bukkit.Server; // CraftBukkit +import org.bukkit.Server; // CraftBukkit
+import org.bukkit.craftbukkit.util.CraftMagicNumbers; // Paper +import org.bukkit.craftbukkit.util.CraftMagicNumbers; // Paper
public class Chunk { public class Chunk implements IChunkAccess {
@@ -0,0 +0,0 @@ public class Chunk { @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
return this.getBlockData(i, j, k).b(this.world, new BlockPosition(i, j, k));
}
+ public IBlockData getBlockData(BlockPosition blockposition) { return getType(blockposition); } // Paper
public IBlockData getType(BlockPosition blockposition) {
return this.getBlockData(blockposition.getX(), blockposition.getY(), blockposition.getZ());
}
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
this.tileEntities.remove(blockposition); this.tileEntities.remove(blockposition);
// Paper end // Paper end
} else { } else {
- System.out.println("Attempted to place a tile entity (" + tileentity + ") at " + tileentity.position.getX() + "," + tileentity.position.getY() + "," + tileentity.position.getZ() - System.out.println("Attempted to place a tile entity (" + tileentity + ") at " + tileentity.position.getX() + "," + tileentity.position.getY() + "," + tileentity.position.getZ()
- + " (" + org.bukkit.craftbukkit.util.CraftMagicNumbers.getMaterial(getBlockData(blockposition).getBlock()) + ") where there was no entity tile!"); - + " (" + getType(blockposition) + ") where there was no entity tile!");
- System.out.println("Chunk coordinates: " + (this.locX * 16) + "," + (this.locZ * 16)); - System.out.println("Chunk coordinates: " + (this.locX * 16) + "," + (this.locZ * 16));
- new Exception().printStackTrace(); - new Exception().printStackTrace();
+ // Paper start + // Paper start
@ -89,33 +98,20 @@ index a5db14343..0788f7712 100644
} }
} }
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index 2b320cbd1..4e7e8e5fd 100644 index 51bc23daf..bb96a7392 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -0,0 +0,0 @@ import java.util.Iterator; @@ -0,0 +0,0 @@ import java.util.concurrent.ExecutionException;
import java.util.List; import java.util.function.Consumer;
import java.util.Set; import java.util.function.Function;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+import com.destroystokyo.paper.exception.ServerInternalException; +import com.destroystokyo.paper.exception.ServerInternalException;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider {
return chunk;
} catch (Exception exception) {
- ChunkProviderServer.a.error("Couldn\'t load chunk", exception);
+ // Paper start
+ String msg = "Couldn\'t load chunk";
+ ChunkProviderServer.a.error(msg, exception);
+ ServerInternalException.reportInternalException(exception);
+ // Paper end
return null;
}
}
@@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider { @@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider {
try { try {
// this.chunkLoader.b(this.world, chunk); // Spigot // this.chunkLoader.a(this.world, chunk); // Spigot
} catch (Exception exception) { } catch (Exception exception) {
- ChunkProviderServer.a.error("Couldn\'t save entities", exception); - ChunkProviderServer.a.error("Couldn\'t save entities", exception);
+ // Paper start + // Paper start
@ -127,8 +123,8 @@ index 2b320cbd1..4e7e8e5fd 100644
} }
@@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider { @@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider {
chunk.setLastSaved(this.world.getTime()); ichunkaccess.setLastSaved(this.world.getTime());
this.chunkLoader.saveChunk(this.world, chunk, unloaded); // Spigot this.chunkLoader.saveChunk(this.world, ichunkaccess, unloaded); // Spigot
} catch (IOException ioexception) { } catch (IOException ioexception) {
- ChunkProviderServer.a.error("Couldn\'t save chunk", ioexception); - ChunkProviderServer.a.error("Couldn\'t save chunk", ioexception);
+ // Paper start + // Paper start
@ -144,17 +140,16 @@ index 2b320cbd1..4e7e8e5fd 100644
} }
diff --git a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java diff --git a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
index 83322b85b..b943a9b20 100644 index 33e5aaf2c..f13534917 100644
--- a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java --- a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
+++ b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java +++ b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@
package net.minecraft.server; package net.minecraft.server;
+import com.destroystokyo.paper.exception.ServerInternalException; +import com.destroystokyo.paper.exception.ServerInternalException;
+import com.google.common.base.Charsets;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterators;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.io.Files;
@@ -0,0 +0,0 @@ public class NameReferencingFileConverter { @@ -0,0 +0,0 @@ public class NameReferencingFileConverter {
root = NBTCompressedStreamTools.a(new java.io.FileInputStream(file1)); root = NBTCompressedStreamTools.a(new java.io.FileInputStream(file1));
} catch (Exception exception) { } catch (Exception exception) {
@ -172,7 +167,7 @@ index 83322b85b..b943a9b20 100644
} }
// CraftBukkit end // CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/PersistentCollection.java b/src/main/java/net/minecraft/server/PersistentCollection.java diff --git a/src/main/java/net/minecraft/server/PersistentCollection.java b/src/main/java/net/minecraft/server/PersistentCollection.java
index 936d6c640..50056f49a 100644 index 0ffca4301..86d8fd0d9 100644
--- a/src/main/java/net/minecraft/server/PersistentCollection.java --- a/src/main/java/net/minecraft/server/PersistentCollection.java
+++ b/src/main/java/net/minecraft/server/PersistentCollection.java +++ b/src/main/java/net/minecraft/server/PersistentCollection.java
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@
@ -181,15 +176,15 @@ index 936d6c640..50056f49a 100644
+import com.destroystokyo.paper.exception.ServerInternalException; +import com.destroystokyo.paper.exception.ServerInternalException;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import java.io.DataInputStream; import com.mojang.datafixers.DataFixTypes;
@@ -0,0 +0,0 @@ public class PersistentCollection { @@ -0,0 +0,0 @@ public class PersistentCollection {
} nbttagcompound = GameProfileSerializer.a(this.c.i(), DataFixTypes.SAVED_DATA, nbttagcompound1, j, i);
} catch (Exception exception1) { } catch (Throwable throwable1) {
exception1.printStackTrace(); throwable = throwable1;
+ ServerInternalException.reportInternalException(exception1); // Paper + ServerInternalException.reportInternalException(throwable1); // Paper
} throw throwable1;
} } finally {
if (fileinputstream != null) {
@@ -0,0 +0,0 @@ public class PersistentCollection { @@ -0,0 +0,0 @@ public class PersistentCollection {
} }
} catch (Exception exception) { } catch (Exception exception) {
@ -199,7 +194,7 @@ index 936d6c640..50056f49a 100644
} }
diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java
index 1ba26de5c..6a92b5af8 100644 index 94364baae..c80d724f0 100644
--- a/src/main/java/net/minecraft/server/RegionFile.java --- a/src/main/java/net/minecraft/server/RegionFile.java
+++ b/src/main/java/net/minecraft/server/RegionFile.java +++ b/src/main/java/net/minecraft/server/RegionFile.java
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@
@ -218,7 +213,7 @@ index 1ba26de5c..6a92b5af8 100644
} }
@@ -0,0 +0,0 @@ public class RegionFile { @@ -0,0 +0,0 @@ public class RegionFile {
this.b(i, j, (int) (MinecraftServer.aw() / 1000L)); this.b(i, j, (int) (SystemUtils.d() / 1000L));
} catch (IOException ioexception) { } catch (IOException ioexception) {
ioexception.printStackTrace(); ioexception.printStackTrace();
+ ServerInternalException.reportInternalException(ioexception); // Paper + ServerInternalException.reportInternalException(ioexception); // Paper
@ -226,7 +221,7 @@ index 1ba26de5c..6a92b5af8 100644
} }
diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java
index c15a0d1f8..5f9e9ddef 100644 index d394645a5..384628ccc 100644
--- a/src/main/java/net/minecraft/server/RegionFileCache.java --- a/src/main/java/net/minecraft/server/RegionFileCache.java
+++ b/src/main/java/net/minecraft/server/RegionFileCache.java +++ b/src/main/java/net/minecraft/server/RegionFileCache.java
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@
@ -245,11 +240,11 @@ index c15a0d1f8..5f9e9ddef 100644
} }
diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java
index 1c7c187c7..68a045323 100644 index aec9cdae5..6d842df62 100644
--- a/src/main/java/net/minecraft/server/SpawnerCreature.java --- a/src/main/java/net/minecraft/server/SpawnerCreature.java
+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java +++ b/src/main/java/net/minecraft/server/SpawnerCreature.java
@@ -0,0 +0,0 @@ import java.util.Random; @@ -0,0 +0,0 @@ import org.apache.logging.log4j.LogManager;
import java.util.Set; import org.apache.logging.log4j.Logger;
// CraftBukkit start // CraftBukkit start
+import com.destroystokyo.paper.exception.ServerInternalException; +import com.destroystokyo.paper.exception.ServerInternalException;
@ -257,23 +252,23 @@ index 1c7c187c7..68a045323 100644
import org.bukkit.craftbukkit.util.LongHashSet; import org.bukkit.craftbukkit.util.LongHashSet;
import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
@@ -0,0 +0,0 @@ public final class SpawnerCreature { @@ -0,0 +0,0 @@ public final class SpawnerCreature {
entityinsentient = (EntityInsentient) biomebase_biomemeta.b.getConstructor(new Class[] { World.class}).newInstance(new Object[] { worldserver}); entityinsentient = (EntityInsentient) biomebase_biomemeta.b.a((World) worldserver);
} catch (Exception exception) { } catch (Exception exception) {
exception.printStackTrace(); SpawnerCreature.a.warn("Failed to create mob", exception);
+ ServerInternalException.reportInternalException(exception); // Paper + ServerInternalException.reportInternalException(exception); // Paper
return j1; return j1;
} }
@@ -0,0 +0,0 @@ public final class SpawnerCreature { @@ -0,0 +0,0 @@ public final class SpawnerCreature {
entityinsentient = (EntityInsentient) biomebase_biomemeta.b.getConstructor(new Class[] { World.class}).newInstance(new Object[] { world}); entityinsentient = (EntityInsentient) biomebase_biomemeta.b.a(generatoraccess.getMinecraftWorld());
} catch (Exception exception) { } catch (Exception exception) {
exception.printStackTrace(); SpawnerCreature.a.warn("Failed to create mob", exception);
+ ServerInternalException.reportInternalException(exception); // Paper + ServerInternalException.reportInternalException(exception); // Paper
continue; continue;
} }
diff --git a/src/main/java/net/minecraft/server/VillageSiege.java b/src/main/java/net/minecraft/server/VillageSiege.java diff --git a/src/main/java/net/minecraft/server/VillageSiege.java b/src/main/java/net/minecraft/server/VillageSiege.java
index 9ff4f23ab..6fce3015f 100644 index 4ff243dab..67b2e41c7 100644
--- a/src/main/java/net/minecraft/server/VillageSiege.java --- a/src/main/java/net/minecraft/server/VillageSiege.java
+++ b/src/main/java/net/minecraft/server/VillageSiege.java +++ b/src/main/java/net/minecraft/server/VillageSiege.java
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@
@ -285,7 +280,7 @@ index 9ff4f23ab..6fce3015f 100644
import java.util.List; import java.util.List;
import javax.annotation.Nullable; import javax.annotation.Nullable;
@@ -0,0 +0,0 @@ public class VillageSiege { @@ -0,0 +0,0 @@ public class VillageSiege {
entityzombie.prepare(this.a.D(new BlockPosition(entityzombie)), (GroupDataEntity) null); entityzombie.prepare(this.a.getDamageScaler(new BlockPosition(entityzombie)), (GroupDataEntity) null, (NBTTagCompound) null);
} catch (Exception exception) { } catch (Exception exception) {
exception.printStackTrace(); exception.printStackTrace();
+ ServerInternalException.reportInternalException(exception); // Paper + ServerInternalException.reportInternalException(exception); // Paper
@ -293,18 +288,19 @@ index 9ff4f23ab..6fce3015f 100644
} }
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 89197281e..6be9c1815 100644 index 26b2a1fd4..d51ed0f80 100644
--- a/src/main/java/net/minecraft/server/World.java --- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@
package net.minecraft.server; package net.minecraft.server;
import co.aikar.timings.Timings;
+import com.destroystokyo.paper.event.server.ServerExceptionEvent; +import com.destroystokyo.paper.event.server.ServerExceptionEvent;
+import com.destroystokyo.paper.exception.ServerInternalException; +import com.destroystokyo.paper.exception.ServerInternalException;
import com.google.common.base.Function;
import com.google.common.base.MoreObjects; import com.google.common.base.MoreObjects;
import com.google.common.base.Predicate; import com.google.common.collect.Lists;
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { import java.util.ArrayList;
@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose
} catch (Throwable throwable1) { } catch (Throwable throwable1) {
entity.tickTimer.stopTiming(); entity.tickTimer.stopTiming();
// Paper start - Prevent tile entity and entity crashes // Paper start - Prevent tile entity and entity crashes
@ -316,8 +312,8 @@ index 89197281e..6be9c1815 100644
entity.dead = true; entity.dead = true;
continue; continue;
// Paper end // Paper end
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose
this.methodProfiler.b(); this.methodProfiler.e();
} catch (Throwable throwable2) { } catch (Throwable throwable2) {
// Paper start - Prevent tile entity and entity crashes // Paper start - Prevent tile entity and entity crashes
- System.err.println("TileEntity threw exception at " + tileentity.world.getWorld().getName() + ":" + tileentity.position.getX() + "," + tileentity.position.getY() + "," + tileentity.position.getZ()); - System.err.println("TileEntity threw exception at " + tileentity.world.getWorld().getName() + ":" + tileentity.position.getX() + "," + tileentity.position.getY() + "," + tileentity.position.getZ());

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Add handshake event to allow plugins to handle client
diff --git a/src/main/java/net/minecraft/server/HandshakeListener.java b/src/main/java/net/minecraft/server/HandshakeListener.java diff --git a/src/main/java/net/minecraft/server/HandshakeListener.java b/src/main/java/net/minecraft/server/HandshakeListener.java
index c3c9c3c1f..309ab18df 100644 index 7c75433f5..088ec198e 100644
--- a/src/main/java/net/minecraft/server/HandshakeListener.java --- a/src/main/java/net/minecraft/server/HandshakeListener.java
+++ b/src/main/java/net/minecraft/server/HandshakeListener.java +++ b/src/main/java/net/minecraft/server/HandshakeListener.java
@@ -0,0 +0,0 @@ public class HandshakeListener implements PacketHandshakingInListener { @@ -0,0 +0,0 @@ public class HandshakeListener implements PacketHandshakingInListener {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add methods for working with arrows stuck in living entities
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 34f1ef176..d4d51688c 100644 index 2ef1433a7..7e3a9eeb2 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -0,0 +0,0 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { @@ -0,0 +0,0 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add player view distance API
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index dfaab774d..3058dfef0 100644 index cb44bf3a7..0531812fb 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java --- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@ -25,7 +25,7 @@ index dfaab774d..3058dfef0 100644
// CraftBukkit start // CraftBukkit start
public String displayName; public String displayName;
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index e4ed2e991..9627a9be0 100644 index d975c2ccf..6ece565c5 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -0,0 +0,0 @@ public class PlayerChunkMap { @@ -0,0 +0,0 @@ public class PlayerChunkMap {
@ -203,12 +203,12 @@ index e4ed2e991..9627a9be0 100644
+ // Paper end + // Paper end
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index e3ad45aa8..e6ff3fc97 100644 index 79223dfa6..bb3a48e57 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return this.getHandle().affectsSpawning;
} }
// Paper end
+ @Override + @Override
+ public int getViewDistance() { + public int getViewDistance() {

View file

@ -5,11 +5,11 @@ Subject: [PATCH] Add velocity warnings
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 1386bed52..d56966109 100644 index 32a05ca18..eaac1430e 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -0,0 +0,0 @@ public final class CraftServer implements Server { @@ -0,0 +0,0 @@ public final class CraftServer implements Server {
private boolean unrestrictedAdvancements; public boolean ignoreVanillaPermissions = false;
private final List<CraftPlayer> playerView; private final List<CraftPlayer> playerView;
public int reloadCount; public int reloadCount;
+ public static Exception excessiveVelEx; // Paper - Velocity warnings + public static Exception excessiveVelEx; // Paper - Velocity warnings
@ -17,7 +17,7 @@ index 1386bed52..d56966109 100644
private final class BooleanWrapper { private final class BooleanWrapper {
private boolean value = true; private boolean value = true;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 6c23e88a5..3b25b8b73 100644 index 0daa15f1b..2b9c571ca 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -0,0 +0,0 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -0,0 +0,0 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] All chunks are slime spawn chunks toggle
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 4c57b9cbf..a289ba019 100644 index 43aa73e1d..0743db5ac 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -0,0 +0,0 @@ public class PaperWorldConfig {
@ -19,18 +19,16 @@ index 4c57b9cbf..a289ba019 100644
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/EntitySlime.java b/src/main/java/net/minecraft/server/EntitySlime.java diff --git a/src/main/java/net/minecraft/server/EntitySlime.java b/src/main/java/net/minecraft/server/EntitySlime.java
index 272b22652..3d3a9ca04 100644 index 3167c3f5f..3b13b697a 100644
--- a/src/main/java/net/minecraft/server/EntitySlime.java --- a/src/main/java/net/minecraft/server/EntitySlime.java
+++ b/src/main/java/net/minecraft/server/EntitySlime.java +++ b/src/main/java/net/minecraft/server/EntitySlime.java
@@ -0,0 +0,0 @@ public class EntitySlime extends EntityInsentient implements IMonster { @@ -0,0 +0,0 @@ public class EntitySlime extends EntityInsentient implements IMonster {
if (biomebase == Biomes.h && this.locY > 50.0D && this.locY < 70.0D && this.random.nextFloat() < 0.5F && this.random.nextFloat() < this.world.G() && this.world.getLightLevel(new BlockPosition(this)) <= this.random.nextInt(8)) {
return super.P();
} }
-
- if (this.random.nextInt(10) == 0 && chunk.a(world.spigotConfig.slimeSeed).nextInt(10) == 0 && this.locY < 40.0D) { // Spigot ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(blockposition);
+ boolean isSlimeChunk = world.paperConfig.allChunksAreSlimeChunks || chunk.a(world.spigotConfig.slimeSeed).nextInt(10) == 0; // Spigot // Paper - boolean flag = SeededRandom.a(chunkcoordintpair.x, chunkcoordintpair.z, generatoraccess.getSeed(), world.spigotConfig.slimeSeed).nextInt(10) == 0; // Spigot
+ if (this.random.nextInt(10) == 0 && isSlimeChunk && this.locY < 40.0D) { // Paper + boolean flag = world.paperConfig.allChunksAreSlimeChunks || SeededRandom.a(chunkcoordintpair.x, chunkcoordintpair.z, generatoraccess.getSeed(), world.spigotConfig.slimeSeed).nextInt(10) == 0; // Spigot // Paper - add allChunksAreSlime
return super.P();
} if (this.random.nextInt(10) == 0 && flag && this.locY < 40.0D) {
} return super.a(generatoraccess);
-- --

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Allow Reloading of Custom Permissions
https://github.com/PaperMC/Paper/issues/49 https://github.com/PaperMC/Paper/issues/49
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index d482589b3..e53f8c58f 100644 index 6dae117ac..5ffb335f5 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -0,0 +0,0 @@ public final class CraftServer implements Server { @@ -0,0 +0,0 @@ public final class CraftServer implements Server {

View file

@ -20,10 +20,10 @@ index 22c1113a1..0094d1a87 100644
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index d902e2630..759964b0f 100644 index e6b916a5d..05d363171 100644
--- a/src/main/java/net/minecraft/server/World.java --- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose
this.getServer().addWorld(this.world); this.getServer().addWorld(this.world);
// CraftBukkit end // CraftBukkit end
timings = new co.aikar.timings.WorldTimingsHandler(this); // Paper - code below can generate new world and access timings timings = new co.aikar.timings.WorldTimingsHandler(this); // Paper - code below can generate new world and access timings

View file

@ -19,7 +19,7 @@ index 45bddf3f4..1d9dd0e0b 100644
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/ControllerJump.java b/src/main/java/net/minecraft/server/ControllerJump.java diff --git a/src/main/java/net/minecraft/server/ControllerJump.java b/src/main/java/net/minecraft/server/ControllerJump.java
index 4f2fa59ac..8af52a61f 100644 index 4ed5192c6..489beed26 100644
--- a/src/main/java/net/minecraft/server/ControllerJump.java --- a/src/main/java/net/minecraft/server/ControllerJump.java
+++ b/src/main/java/net/minecraft/server/ControllerJump.java +++ b/src/main/java/net/minecraft/server/ControllerJump.java
@@ -0,0 +0,0 @@ public class ControllerJump { @@ -0,0 +0,0 @@ public class ControllerJump {
@ -28,20 +28,20 @@ index 4f2fa59ac..8af52a61f 100644
+ public void jumpIfSet() { this.b(); } // Paper - OBFHELPER + public void jumpIfSet() { this.b(); } // Paper - OBFHELPER
public void b() { public void b() {
this.b.l(this.a); this.b.o(this.a);
this.a = false; this.a = false;
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
index 3c48d9463..7b02b253c 100644 index 5de20721c..27b01d1ee 100644
--- a/src/main/java/net/minecraft/server/EntityInsentient.java --- a/src/main/java/net/minecraft/server/EntityInsentient.java
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java
@@ -0,0 +0,0 @@ public abstract class EntityInsentient extends EntityLiving { @@ -0,0 +0,0 @@ public abstract class EntityInsentient extends EntityLiving {
private boolean bE; private final EntityAIBodyControl b;
private Entity leashHolder; protected NavigationAbstract navigation;
private NBTTagCompound bG; public PathfinderGoalSelector goalSelector;
+ @Nullable public PathfinderGoalFloat goalFloat; // Paper + @Nullable public PathfinderGoalFloat goalFloat; // Paper
public PathfinderGoalSelector targetSelector;
public EntityInsentient(World world) { private EntityLiving goalTarget;
super(world); private final EntitySenses bC;
@@ -0,0 +0,0 @@ public abstract class EntityInsentient extends EntityLiving { @@ -0,0 +0,0 @@ public abstract class EntityInsentient extends EntityLiving {
// Spigot Start // Spigot Start
if ( this.fromMobSpawner ) if ( this.fromMobSpawner )
@ -56,7 +56,7 @@ index 3c48d9463..7b02b253c 100644
} }
// Spigot End // Spigot End
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalFloat.java b/src/main/java/net/minecraft/server/PathfinderGoalFloat.java diff --git a/src/main/java/net/minecraft/server/PathfinderGoalFloat.java b/src/main/java/net/minecraft/server/PathfinderGoalFloat.java
index b3b303b3b..fc6c3bf71 100644 index 4d8876cae..2cb9d1b5a 100644
--- a/src/main/java/net/minecraft/server/PathfinderGoalFloat.java --- a/src/main/java/net/minecraft/server/PathfinderGoalFloat.java
+++ b/src/main/java/net/minecraft/server/PathfinderGoalFloat.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalFloat.java
@@ -0,0 +0,0 @@ public class PathfinderGoalFloat extends PathfinderGoal { @@ -0,0 +0,0 @@ public class PathfinderGoalFloat extends PathfinderGoal {
@ -73,7 +73,7 @@ index b3b303b3b..fc6c3bf71 100644
+ public boolean validConditions() { return this.a(); } // Paper - OBFHELPER + public boolean validConditions() { return this.a(); } // Paper - OBFHELPER
public boolean a() { public boolean a() {
return this.a.isInWater() || this.a.au(); return this.a.isInWater() || this.a.ax();
} }
+ public void update() { this.e(); } // Paper - OBFHELPER + public void update() { this.e(); } // Paper - OBFHELPER

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Always tick falling blocks
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
index 38be7ed71..3265a6c25 100644 index f68e42c4d..1aade75f3 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java --- a/src/main/java/org/spigotmc/ActivationRange.java
+++ b/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java
@@ -0,0 +0,0 @@ import net.minecraft.server.EntityCreature; @@ -0,0 +0,0 @@ import net.minecraft.server.EntityCreature;
@ -22,6 +22,6 @@ index 38be7ed71..3265a6c25 100644
|| entity instanceof EntityTNTPrimed || entity instanceof EntityTNTPrimed
+ || entity instanceof EntityFallingBlock // Paper - Always tick falling blocks + || entity instanceof EntityFallingBlock // Paper - Always tick falling blocks
|| entity instanceof EntityEnderCrystal || entity instanceof EntityEnderCrystal
|| entity instanceof EntityFireworks ) || entity instanceof EntityFireworks
{ || entity instanceof EntityThrownTrident )
-- --

View file

@ -14,52 +14,45 @@ And since minecart hoppers are used _very_ rarely near we can avoid alot of sear
Combined, this adds up a lot. Combined, this adds up a lot.
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index aaf253c89..a5db14343 100644 index e5567701e..32f467b37 100644
--- a/src/main/java/net/minecraft/server/Chunk.java --- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -0,0 +0,0 @@ public class Chunk { @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
public boolean d; }
protected gnu.trove.map.hash.TObjectIntHashMap<Class> entityCount = new gnu.trove.map.hash.TObjectIntHashMap<Class>(); // Spigot }
final PaperLightingQueue.LightingQueue lightingQueue = new PaperLightingQueue.LightingQueue(this);
+ // Paper start
+ // Track the number of minecarts and items + // Track the number of minecarts and items
+ // Keep this synced with entitySlices.add() and entitySlices.remove() + // Keep this synced with entitySlices.add() and entitySlices.remove()
+ private final int[] itemCounts = new int[16]; + private final int[] itemCounts = new int[16];
+ private final int[] inventoryEntityCounts = new int[16]; + private final int[] inventoryEntityCounts = new int[16];
+ // Paper end // Paper end
+ public boolean areNeighborsLoaded(final int radius) {
// CraftBukkit start - Neighbor loaded cache for chunk lighting and entity ticking switch (radius) {
private int neighbors = 0x1 << 12; @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
public long chunkKey; entity.ag = this.locZ;
@@ -0,0 +0,0 @@ public class Chunk {
entity.ac = k;
entity.ad = this.locZ;
this.entitySlices[k].add(entity); this.entitySlices[k].add(entity);
+ // Paper start - update count // Paper start
+ if (entity instanceof EntityItem) { + if (entity instanceof EntityItem) {
+ itemCounts[k]++; + itemCounts[k]++;
+ } else if (entity instanceof IInventory) { + } else if (entity instanceof IInventory) {
+ inventoryEntityCounts[k]++; + inventoryEntityCounts[k]++;
+ } + }
+ // Paper end entity.setCurrentChunk(this);
// Spigot start - increment creature type count entityCounts.increment(entity.entityKeyString);
// Keep this synced up with World.a(Class) // Paper end
if (entity instanceof EntityInsentient) { @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
@@ -0,0 +0,0 @@ public class Chunk { if (!this.entitySlices[i].remove(entity)) {
return;
} }
this.entitySlices[i].remove(entity);
+ // Paper start - update counts
+ if (entity instanceof EntityItem) { + if (entity instanceof EntityItem) {
+ itemCounts[i]--; + itemCounts[i]--;
+ } else if (entity instanceof IInventory) { + } else if (entity instanceof IInventory) {
+ inventoryEntityCounts[i]--; + inventoryEntityCounts[i]--;
+ } + }
+ // Paper end entity.setCurrentChunk(null);
// Spigot start - decrement creature type count entityCounts.decrement(entity.entityKeyString);
// Keep this synced up with World.a(Class) // Paper end
if (entity instanceof EntityInsentient) { @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
@@ -0,0 +0,0 @@ public class Chunk {
if (!this.entitySlices[k].isEmpty()) { if (!this.entitySlices[k].isEmpty()) {
Iterator iterator = this.entitySlices[k].iterator(); Iterator iterator = this.entitySlices[k].iterator();
@ -75,7 +68,7 @@ index aaf253c89..a5db14343 100644
while (iterator.hasNext()) { while (iterator.hasNext()) {
Entity entity1 = (Entity) iterator.next(); Entity entity1 = (Entity) iterator.next();
@@ -0,0 +0,0 @@ public class Chunk { @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
i = MathHelper.clamp(i, 0, this.entitySlices.length - 1); i = MathHelper.clamp(i, 0, this.entitySlices.length - 1);
j = MathHelper.clamp(j, 0, this.entitySlices.length - 1); j = MathHelper.clamp(j, 0, this.entitySlices.length - 1);

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Be a bit more informative in maxHealth exception
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index bf4428e1c..34f1ef176 100644 index 0b12ed819..83e6276b8 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -0,0 +0,0 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { @@ -0,0 +0,0 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Catch Async PlayerChunkMap operations
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 9627a9be0..ad1d90b56 100644 index 6ece565c5..4d888d6d4 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -0,0 +0,0 @@ public class PlayerChunkMap { @@ -0,0 +0,0 @@ public class PlayerChunkMap {

View file

@ -4,77 +4,64 @@ Date: Thu, 3 Mar 2016 02:39:54 -0600
Subject: [PATCH] Change implementation of (tile)entity removal list Subject: [PATCH] Change implementation of (tile)entity removal list
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index aadc426fd..584501787 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -0,0 +0,0 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper
private static final DataWatcherObject<Boolean> aC = DataWatcher.a(Entity.class, DataWatcherRegistry.h);
private static final DataWatcherObject<Boolean> aD = DataWatcher.a(Entity.class, DataWatcherRegistry.h);
private static final DataWatcherObject<Boolean> aE = DataWatcher.a(Entity.class, DataWatcherRegistry.h);
- public boolean aa;
+ public boolean aa; public boolean isAddedToChunk() { return aa; } // Paper - OBFHELPER
public int ab; public int getChunkX() { return ab; } // Paper - OBFHELPER
public int ac; public int getChunkY() { return ac; } // Paper - OBFHELPER
public int ad; public int getChunkZ() { return ad; } // Paper - OBFHELPER
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index e85ed2e33..89197281e 100644 index d988fd007..26b2a1fd4 100644
--- a/src/main/java/net/minecraft/server/World.java --- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; @@ -0,0 +0,0 @@ import org.bukkit.event.block.BlockPhysicsEvent;
import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
import org.bukkit.generator.ChunkGenerator; import org.bukkit.generator.ChunkGenerator;
// CraftBukkit end // CraftBukkit end
-
+// Paper start +// Paper start
+import java.util.Set; +import java.util.Set;
+import com.google.common.collect.Sets; +import com.google.common.collect.Sets;
+// Paper end +// Paper end
+ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoCloseable {
public abstract class World implements IBlockAccess {
private int a = 63; protected static final Logger e = LogManager.getLogger();
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose
} }
}; };
// Spigot end // Spigot end
- protected final List<Entity> f = Lists.newArrayList(); - protected final List<Entity> g = Lists.newArrayList();
+ protected final Set<Entity> f = Sets.newHashSet(); // Paper + protected final Set<Entity> g = Sets.newHashSet(); // Paper
public final List<TileEntity> tileEntityList = Lists.newArrayList(); public final List<TileEntity> tileEntityList = Lists.newArrayList();
public final List<TileEntity> tileEntityListTick = Lists.newArrayList(); public final List<TileEntity> tileEntityListTick = Lists.newArrayList();
private final List<TileEntity> b = Lists.newArrayList(); private final List<TileEntity> c = Lists.newArrayList();
- private final List<TileEntity> tileEntityListUnload = Lists.newArrayList(); - private final List<TileEntity> tileEntityListUnload = Lists.newArrayList();
+ private final Set<TileEntity> tileEntityListUnload = Sets.newHashSet(); // Paper + private final Set<TileEntity> tileEntityListUnload = Sets.newHashSet(); // Paper
public final List<EntityHuman> players = Lists.newArrayList(); public final List<EntityHuman> players = Lists.newArrayList();
public final List<Entity> j = Lists.newArrayList(); public final List<Entity> k = Lists.newArrayList();
protected final IntHashMap<Entity> entitiesById = new IntHashMap(); protected final IntHashMap<Entity> entitiesById = new IntHashMap();
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose
this.entityList.removeAll(this.f); this.entityList.removeAll(this.g);
int j; int j;
+ // Paper start - Set based removal lists + // Paper start - Set based removal lists
+ for (Entity e : this.f) { + for (Entity e : this.g) {
+ j = e.getChunkZ(); + j = e.getChunkZ();
+ int k = e.getChunkX(); + int k = e.getChunkX();
- for (i = 0; i < this.f.size(); ++i) { - for (i = 0; i < this.g.size(); ++i) {
- entity = (Entity) this.f.get(i); - entity = (Entity) this.g.get(i);
- int k = entity.ab; - int k = entity.ae;
- -
- j = entity.ad; - j = entity.ag;
- if (entity.aa && this.isChunkLoaded(k, j, true)) { - if (entity.inChunk && this.isChunkLoaded(k, j, true)) {
- this.getChunkAt(k, j).b(entity); - this.getChunkAt(k, j).b(entity);
+ if (e.isAddedToChunk() && this.isChunkLoaded(k, j, true)) { + if (e.inChunk && this.isChunkLoaded(k, j, true)) {
+ this.getChunkAt(k, j).b(e); + this.getChunkAt(k, j).b(e);
} }
} }
- for (i = 0; i < this.f.size(); ++i) { - for (i = 0; i < this.g.size(); ++i) {
- this.c((Entity) this.f.get(i)); - this.c((Entity) this.g.get(i));
+ for (Entity e : this.f) { + for (Entity e : this.g) {
+ this.c(e); + this.c(e);
} }
+ // Paper end + // Paper end
this.f.clear(); this.g.clear();
this.l(); this.p_();
-- --

View file

@ -1,30 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Zach Brown <1254957+zachbr@users.noreply.github.com>
Date: Sun, 27 Mar 2016 20:24:05 -0500
Subject: [PATCH] Check async, remove unused vars, GH-159
diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java
index 68a045323..45a83ae99 100644
--- a/src/main/java/net/minecraft/server/SpawnerCreature.java
+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java
@@ -0,0 +0,0 @@ public final class SpawnerCreature {
// Spigot end
public int a(WorldServer worldserver, boolean flag, boolean flag1, boolean flag2) {
+ org.spigotmc.AsyncCatcher.catchOp("check for eligible spawn chunks"); // Paper - At least until we figure out what is calling this async
if (!flag && !flag1) {
return 0;
} else {
@@ -0,0 +0,0 @@ public final class SpawnerCreature {
// CraftBukkit end
if ((!enumcreaturetype.d() || flag1) && (enumcreaturetype.d() || flag) && (!enumcreaturetype.e() || flag2)) {
+ /* Paper start - As far as I can tell neither of these are even used
k = worldserver.a(enumcreaturetype.a());
int l1 = limit * i / a; // CraftBukkit - use per-world limits
+ */ // Paper end
if ((mobcnt = getEntityCount(worldserver, enumcreaturetype.a())) <= limit * i / 256) {
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition();
--

View file

@ -5,11 +5,11 @@ Subject: [PATCH] Check online mode before converting and renaming player data
diff --git a/src/main/java/net/minecraft/server/WorldNBTStorage.java b/src/main/java/net/minecraft/server/WorldNBTStorage.java diff --git a/src/main/java/net/minecraft/server/WorldNBTStorage.java b/src/main/java/net/minecraft/server/WorldNBTStorage.java
index b69c6cf97..eba1228fd 100644 index a5157269c..a562e1e46 100644
--- a/src/main/java/net/minecraft/server/WorldNBTStorage.java --- a/src/main/java/net/minecraft/server/WorldNBTStorage.java
+++ b/src/main/java/net/minecraft/server/WorldNBTStorage.java +++ b/src/main/java/net/minecraft/server/WorldNBTStorage.java
@@ -0,0 +0,0 @@ public class WorldNBTStorage implements IDataManager, IPlayerFileData { @@ -0,0 +0,0 @@ public class WorldNBTStorage implements IDataManager, IPlayerFileData {
File file = new File(this.playerDir, entityhuman.bn() + ".dat"); File file = new File(this.playerDir, entityhuman.bu() + ".dat");
// Spigot Start // Spigot Start
boolean usingWrongFile = false; boolean usingWrongFile = false;
- if ( !file.exists() ) - if ( !file.exists() )

View file

@ -6,11 +6,11 @@ Subject: [PATCH] Chunk Save Reattempt
We commonly have "Stream Closed" errors on chunk saving, so this code should re-try to save the chunk in the event of failure and hopefully prevent rollbacks. We commonly have "Stream Closed" errors on chunk saving, so this code should re-try to save the chunk in the event of failure and hopefully prevent rollbacks.
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
index 4c3faa201..12bd558a7 100644 index 17996af9c..faaa1b36b 100644
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { @@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
// CraftBukkit NBTTagCompound nbttagcompound = SupplierUtils.getIfExists(chunk.compoundSupplier); // Spigot // Paper
if (nbttagcompound != null) { if (nbttagcompound != null) {
+ int attempts = 0; Exception laste = null; while (attempts++ < 5) { // Paper + int attempts = 0; Exception laste = null; while (attempts++ < 5) { // Paper
@ -25,15 +25,15 @@ index 4c3faa201..12bd558a7 100644
+ try {Thread.sleep(10);} catch (InterruptedException e) {e.printStackTrace();} } // Paper + try {Thread.sleep(10);} catch (InterruptedException e) {e.printStackTrace();} } // Paper
+ if (laste != null) { com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(laste); MinecraftServer.LOGGER.error("Failed to save chunk", laste); } // Paper + if (laste != null) { com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(laste); MinecraftServer.LOGGER.error("Failed to save chunk", laste); } // Paper
} }
synchronized (lock) { if (this.b.get(chunkcoordintpair) == chunk.compoundSupplier) { this.b.remove(chunkcoordintpair); } }// Paper - This will not equal if a newer version is still pending
flag = true;
diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java
index 6a92b5af8..5bcbd718f 100644 index c80d724f0..3f9aa5923 100644
--- a/src/main/java/net/minecraft/server/RegionFile.java --- a/src/main/java/net/minecraft/server/RegionFile.java
+++ b/src/main/java/net/minecraft/server/RegionFile.java +++ b/src/main/java/net/minecraft/server/RegionFile.java
@@ -0,0 +0,0 @@ public class RegionFile { @@ -0,0 +0,0 @@ public class RegionFile {
this.b(i, j, (int) (MinecraftServer.aw() / 1000L)); this.b(i, j, (int) (SystemUtils.d() / 1000L));
} catch (IOException ioexception) { } catch (IOException ioexception) {
- ioexception.printStackTrace(); - ioexception.printStackTrace();
- ServerInternalException.reportInternalException(ioexception); // Paper - ServerInternalException.reportInternalException(ioexception); // Paper

View file

@ -41,12 +41,12 @@ index 36689db74..3898ad8fa 100644
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
index a401dec60..4c3faa201 100644 index e26860516..17996af9c 100644
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
@@ -0,0 +0,0 @@ import java.util.List; @@ -0,0 +0,0 @@ import java.util.function.Consumer;
import java.util.Map; import java.util.function.Function;
import java.util.Set; import java.util.function.Predicate;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+import java.util.concurrent.ConcurrentLinkedQueue; // Paper +import java.util.concurrent.ConcurrentLinkedQueue; // Paper
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
@ -56,29 +56,70 @@ index a401dec60..4c3faa201 100644
public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
+ private ConcurrentLinkedQueue<QueuedChunk> queue = new ConcurrentLinkedQueue<>(); // Paper - Chunk queue improvements + // Paper start - Chunk queue improvements
+ private final Object lock = new Object(); // Paper - Chunk queue improvements + private static class QueuedChunk {
+ public ChunkCoordIntPair coords;
+ public Supplier<NBTTagCompound> compoundSupplier;
+
+ public QueuedChunk(ChunkCoordIntPair coords, Supplier<NBTTagCompound> compoundSupplier) {
+ this.coords = coords;
+ this.compoundSupplier = compoundSupplier;
+ }
+ }
+ private ConcurrentLinkedQueue<QueuedChunk> queue = new ConcurrentLinkedQueue<>();
+ // Paper end
+
private static final Logger a = LogManager.getLogger(); private static final Logger a = LogManager.getLogger();
private final Map<ChunkCoordIntPair, Supplier<NBTTagCompound>> b = Maps.newConcurrentMap(); // Spigot - private final Object2ObjectMap<ChunkCoordIntPair, Supplier<NBTTagCompound>> b = Object2ObjectMaps.synchronize(new Object2ObjectLinkedOpenHashMap()); // Spigot
// CraftBukkit + private final Object2ObjectMap<ChunkCoordIntPair, Supplier<NBTTagCompound>> b = new Object2ObjectLinkedOpenHashMap(); // Spigot // Paper - remove synchronized
private final File c;
private final DataFixer d;
private PersistentStructureLegacy e;
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { @@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
protected void a(ChunkCoordIntPair chunkcoordintpair, Supplier<NBTTagCompound> nbttagcompound) { // Spigot }
// CraftBukkit };
// if (!this.c.contains(chunkcoordintpair)) } else {
- { - if (this.b.containsKey(chunkcoordintpair) && this.a(this.b.get(chunkcoordintpair).get()) == ChunkStatus.Type.LEVELCHUNK || this.a(this.b(world, chunkcoordintpair.x, chunkcoordintpair.z)) == ChunkStatus.Type.LEVELCHUNK) {
+ synchronized (lock) { // Paper - Chunk queue improvements + // Paper start
this.b.put(chunkcoordintpair, nbttagcompound); + Supplier<NBTTagCompound> existingSave;
} + synchronized (this) {
+ queue.add(new QueuedChunk(chunkcoordintpair, nbttagcompound)); // Paper - Chunk queue improvements + existingSave = this.b.get(chunkcoordintpair);
+ }
+ if (existingSave != null && this.a(existingSave.get()) == ChunkStatus.Type.LEVELCHUNK || this.a(this.b(world, chunkcoordintpair.x, chunkcoordintpair.z)) == ChunkStatus.Type.LEVELCHUNK) { // Paper - extract existingSave to synchronized lookup
+ // Paper end
return;
}
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
}
};
}
-
- this.a(chunkcoordintpair, SupplierUtils.createUnivaluedSupplier(completion, unloaded && this.b.size() < SAVE_QUEUE_TARGET_SIZE));
+ this.a(chunkcoordintpair, SupplierUtils.createUnivaluedSupplier(completion, unloaded)); // Paper - Remove save queue target size
+ // Paper end
// Spigot end
} catch (Exception exception) {
ChunkRegionLoader.a.error("Failed to save chunk", exception);
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
}
protected synchronized void a(ChunkCoordIntPair chunkcoordintpair, Supplier<NBTTagCompound> nbttagcompound) { // Spigot
+ queue.add(new QueuedChunk(chunkcoordintpair, nbttagcompound)); // Paper - Chunk queue improvements
this.b.put(chunkcoordintpair, nbttagcompound);
FileIOThread.a().a(this); FileIOThread.a().a(this);
} }
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
- public synchronized boolean a() {
+ public boolean a() { // Paper - remove synchronized
// CraftBukkit start
return this.processSaveQueueEntry(false);
} }
private synchronized boolean processSaveQueueEntry(boolean logCompletion) { - private synchronized boolean processSaveQueueEntry(boolean logCompletion) {
- Iterator<Map.Entry<ChunkCoordIntPair, Supplier<NBTTagCompound>>> iter = this.b.entrySet().iterator(); // Spigot - Iterator<Map.Entry<ChunkCoordIntPair, Supplier<NBTTagCompound>>> iter = this.b.entrySet().iterator(); // Spigot
- if (!iter.hasNext()) { - if (!iter.hasNext()) {
+ private boolean processSaveQueueEntry(boolean logCompletion) { // Paper - dont synchronize during save
+ // CraftBukkit start + // CraftBukkit start
+ // Paper start - Chunk queue improvements + // Paper start - Chunk queue improvements
+ QueuedChunk chunk = queue.poll(); + QueuedChunk chunk = queue.poll();
@ -86,7 +127,7 @@ index a401dec60..4c3faa201 100644
+ // Paper - end + // Paper - end
if (logCompletion) { if (logCompletion) {
// CraftBukkit end // CraftBukkit end
ChunkRegionLoader.a.info("ThreadedAnvilChunkStorage ({}): All chunks are saved", this.d.getName()); ChunkRegionLoader.a.info("ThreadedAnvilChunkStorage ({}): All chunks are saved", this.c.getName());
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { @@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
return false; return false;
@ -101,64 +142,45 @@ index a401dec60..4c3faa201 100644
boolean flag; boolean flag;
try { try {
// this.c.add(chunkcoordintpair); // NBTTagCompound nbttagcompound = (NBTTagCompound) this.b.get(chunkcoordintpair); // CraftBukkit
- NBTTagCompound nbttagcompound = SupplierUtils.getIfExists(value); // Spigot - NBTTagCompound nbttagcompound = SupplierUtils.getIfExists(value); // Spigot
+ NBTTagCompound nbttagcompound = SupplierUtils.getIfExists(chunk.compoundSupplier); // Spigot // Paper + NBTTagCompound nbttagcompound = SupplierUtils.getIfExists(chunk.compoundSupplier); // Spigot // Paper
// CraftBukkit
if (nbttagcompound != null) { if (nbttagcompound != null) {
try {
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { @@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
ChunkRegionLoader.a.error("Failed to save chunk", exception);
}
}
+ synchronized (lock) { if (this.b.get(chunkcoordintpair) == chunk.compoundSupplier) { this.b.remove(chunkcoordintpair); } }// Paper - This will not equal if a newer version is still pending
flag = true; flag = true;
} finally { } finally {
- this.b.remove(chunkcoordintpair, value); // CraftBukkit // Spigot - this.b.remove(chunkcoordintpair, value); // CraftBukkit // Spigot
+ //this.b.remove(chunkcoordintpair, value); // CraftBukkit // Spigot // Paper + // Paper start - only synchronize here
+ synchronized (this) {
+ // This will not equal if a newer version is still pending - wait until newest is saved to remove
+ if (this.b.get(chunkcoordintpair) == chunk.compoundSupplier) {
+ this.b.remove(chunkcoordintpair);
+ }
+ }
+ // Paper start
} }
return flag; return flag;
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
return entity;
}
}
+
+ // Paper start - Chunk queue improvements
+ private static class QueuedChunk {
+ public ChunkCoordIntPair coords;
+ public Supplier<NBTTagCompound> compoundSupplier;
+
+ public QueuedChunk(ChunkCoordIntPair coords, Supplier<NBTTagCompound> compoundSupplier) {
+ this.coords = coords;
+ this.compoundSupplier = compoundSupplier;
+ }
+ }
+ // Paper end
}
diff --git a/src/main/java/net/minecraft/server/FileIOThread.java b/src/main/java/net/minecraft/server/FileIOThread.java diff --git a/src/main/java/net/minecraft/server/FileIOThread.java b/src/main/java/net/minecraft/server/FileIOThread.java
index 1d6b1874c..9ee4115be 100644 index 34312667a..549fab9a5 100644
--- a/src/main/java/net/minecraft/server/FileIOThread.java --- a/src/main/java/net/minecraft/server/FileIOThread.java
+++ b/src/main/java/net/minecraft/server/FileIOThread.java +++ b/src/main/java/net/minecraft/server/FileIOThread.java
@@ -0,0 +0,0 @@ public class FileIOThread implements Runnable { @@ -0,0 +0,0 @@ public class FileIOThread implements Runnable {
++this.d; ++this.e;
} }
- try { + if (com.destroystokyo.paper.PaperConfig.enableFileIOThreadSleep) { // Paper
- Thread.sleep(this.e ? 0L : 10L); try {
- } catch (InterruptedException interruptedexception) { - Thread.sleep(this.f ? 0L : 10L);
- interruptedexception.printStackTrace(); + Thread.sleep(this.f ? 0L : 1L); // Paper
+ // Paper start - Add toggle } catch (InterruptedException interruptedexception) {
+ if (com.destroystokyo.paper.PaperConfig.enableFileIOThreadSleep) { interruptedexception.printStackTrace();
+ try { - }
+ Thread.sleep(this.e ? 0L : 2L); + }} // Paper
+ } catch (InterruptedException interruptedexception) {
+ interruptedexception.printStackTrace();
+ }
}
+ // Paper end
} }
if (this.b.isEmpty()) { if (this.c.isEmpty()) {
-- --

View file

@ -5,27 +5,36 @@ Subject: [PATCH] Complete resource pack API
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 060301da6..d23fe82db 100644 index 27c255c8d..2cc277e4f 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java --- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
// CraftBukkit start
public void a(PacketPlayInResourcePackStatus packetplayinresourcepackstatus) { }
PlayerConnectionUtils.ensureMainThread(packetplayinresourcepackstatus, this, this.player.x());
- this.server.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(getPlayer(), PlayerResourcePackStatusEvent.Status.values()[packetplayinresourcepackstatus.status.ordinal()])); - public void a(PacketPlayInResourcePackStatus packetplayinresourcepackstatus) {}
+ // Paper start + public void a(PacketPlayInResourcePackStatus packetplayinresourcepackstatus) {
+ //this.server.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(getPlayer(), PlayerResourcePackStatusEvent.Status.values()[packetplayinresourcepackstatus.status.ordinal()])); + // Paper start;
+ final PlayerResourcePackStatusEvent.Status status = PlayerResourcePackStatusEvent.Status.values()[packetplayinresourcepackstatus.status.ordinal()]; + final PlayerResourcePackStatusEvent.Status status = PlayerResourcePackStatusEvent.Status.values()[packetplayinresourcepackstatus.status.ordinal()];
+ this.getPlayer().setResourcePackStatus(status); + this.getPlayer().setResourcePackStatus(status);
+ this.server.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(getPlayer(), status)); + this.server.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(getPlayer(), status));
+ // Paper end + // Paper end
} + }
// CraftBukkit end
public void a(PacketPlayInBoatMove packetplayinboatmove) {
PlayerConnectionUtils.ensureMainThread(packetplayinboatmove, this, this.player.getWorldServer());
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 18a481f2f..ff4512060 100644 index aacf8ea7f..f6a7f08f9 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -0,0 +0,0 @@ import net.minecraft.server.PacketPlayOutCustomSoundEffect;
import net.minecraft.server.PacketPlayOutMap;
import net.minecraft.server.PacketPlayOutNamedSoundEffect;
import net.minecraft.server.PacketPlayOutPlayerInfo;
+import net.minecraft.server.PacketPlayOutPlayerListHeaderFooter;
import net.minecraft.server.PacketPlayOutSpawnPosition;
import net.minecraft.server.PacketPlayOutStopSound;
import net.minecraft.server.PacketPlayOutTitle;
@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
private double health = 20; private double health = 20;
private boolean scaledHealth = false; private boolean scaledHealth = false;

View file

@ -9,7 +9,7 @@ aspects of vanilla gameplay to this factor.
For people who want all chunks to be treated equally, you can disable the timer. For people who want all chunks to be treated equally, you can disable the timer.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index e634c3afd..54f23ea75 100644 index 1c2209270..17fb883f6 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -0,0 +0,0 @@ public class PaperWorldConfig {
@ -23,16 +23,25 @@ index e634c3afd..54f23ea75 100644
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index bf3b64e37..6b13e1d7d 100644 index 75fcc693d..aaa65582b 100644
--- a/src/main/java/net/minecraft/server/Chunk.java --- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -0,0 +0,0 @@ public class Chunk { @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
private long lastSaved;
private boolean y;
private int z;
- private long A;
+ private long A; public long getInhabitedTime() { return A; } // Paper - OBFHELPER
private int B;
private final ConcurrentLinkedQueue<BlockPosition> C;
public boolean d;
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
} }
public long x() { public long m() {
- return this.w; - return this.A;
+ return world.paperConfig.useInhabitedTime ? this.w : 0; // Paper + return world.paperConfig.useInhabitedTime ? getInhabitedTime() : 0; // Paper
} }
public void c(long i) { public void b(long i) {
-- --

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Configurable Grass Spread Tick Rate
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 54f23ea75..6555f1373 100644 index 17fb883f6..eb09be512 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -0,0 +0,0 @@ public class PaperWorldConfig {
@ -19,16 +19,16 @@ index 54f23ea75..6555f1373 100644
+ log("Grass Spread Tick Rate: " + grassUpdateRate); + log("Grass Spread Tick Rate: " + grassUpdateRate);
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/BlockGrass.java b/src/main/java/net/minecraft/server/BlockGrass.java diff --git a/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java b/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java
index 8fc736d6a..b656994b2 100644 index 6343fb1e0..903e8241b 100644
--- a/src/main/java/net/minecraft/server/BlockGrass.java --- a/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java
+++ b/src/main/java/net/minecraft/server/BlockGrass.java +++ b/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java
@@ -0,0 +0,0 @@ public class BlockGrass extends Block implements IBlockFragilePlantElement { @@ -0,0 +0,0 @@ public abstract class BlockDirtSnowSpreadable extends BlockDirtSnow {
} }
public void b(World world, BlockPosition blockposition, IBlockData iblockdata, Random random) { public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Random random) {
+ if (world.paperConfig.grassUpdateRate != 1 && (world.paperConfig.grassUpdateRate < 1 || (MinecraftServer.currentTick + blockposition.hashCode()) % world.paperConfig.grassUpdateRate != 0)) { return; } // Paper + if (this instanceof BlockGrass && world.paperConfig.grassUpdateRate != 1 && (world.paperConfig.grassUpdateRate < 1 || (MinecraftServer.currentTick + blockposition.hashCode()) % world.paperConfig.grassUpdateRate != 0)) { return; } // Paper
if (!world.isClientSide) { if (!world.isClientSide) {
int lightLevel = -1; // Paper if (!a((IWorldReader) world, blockposition)) {
if (world.getType(blockposition.up()).c() > 2 && (lightLevel = world.getLightLevel(blockposition.up())) < 4) { // Paper - move light check to end to avoid unneeded light lookups // CraftBukkit start
-- --

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Configurable Keep Spawn Loaded range per world
This lets you disable it for some worlds and lower it for others. This lets you disable it for some worlds and lower it for others.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 6555f1373..abc1aabdd 100644 index eb09be512..6ac58e5ec 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -0,0 +0,0 @@ public class PaperWorldConfig {
@ -21,28 +21,28 @@ index 6555f1373..abc1aabdd 100644
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 4e8ce79ff..2300ee10b 100644 index 1027b0588..b7aa9e869 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
long j = aw(); ArrayList arraylist = Lists.newArrayList();
i = 0; Set set = Sets.newConcurrentHashSet();
- for (int k = -192; k <= 192 && this.isRunning(); k += 16) { - for (int i = -192; i <= 192 && this.isRunning(); i += 16) {
- for (int l = -192; l <= 192 && this.isRunning(); l += 16) { - for (int j = -192; j <= 192 && this.isRunning(); j += 16) {
+ // Paper start + // Paper start
+ short radius = worldserver.paperConfig.keepLoadedRange; + short radius = worldserver.paperConfig.keepLoadedRange;
+ for (int k = -radius; k <= radius && this.isRunning(); k += 16) { + for (int i = -radius; i <= radius && this.isRunning(); i += 16) {
+ for (int l = -radius; l <= radius && this.isRunning(); l += 16) { + for (int j = -radius; j <= radius && this.isRunning(); j += 16) {
+ // Paper end + // Paper end
long i1 = aw(); arraylist.add(new ChunkCoordIntPair(blockposition.getX() + i >> 4, blockposition.getZ() + j >> 4));
}
if (i1 - j > 1000L) {
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 5d5003920..671927d5c 100644 index e42a334bc..d15afd595 100644
--- a/src/main/java/net/minecraft/server/World.java --- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose
int k = i * 16 + 8 - blockposition.getX(); int k = i * 16 + 8 - blockposition.getX();
int l = j * 16 + 8 - blockposition.getZ(); int l = j * 16 + 8 - blockposition.getZ();
boolean flag = true; boolean flag = true;
@ -54,7 +54,7 @@ index 5d5003920..671927d5c 100644
public void a(Packet<?> packet) { public void a(Packet<?> packet) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index d3e949707..054ac1b47 100644 index f98f355dd..2bcd1c3ca 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -0,0 +0,0 @@ public final class CraftServer implements Server { @@ -0,0 +0,0 @@ public final class CraftServer implements Server {
@ -67,7 +67,7 @@ index d3e949707..054ac1b47 100644
for (int j = -short1; j <= short1; j += 16) { for (int j = -short1; j <= short1; j += 16) {
for (int k = -short1; k <= short1; k += 16) { for (int k = -short1; k <= short1; k += 16) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 01fc193db..69dc11e2b 100644 index 4df849eef..9d88b9ddb 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -0,0 +0,0 @@ public class CraftWorld implements World { @@ -0,0 +0,0 @@ public class CraftWorld implements World {

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Configurable Non Player Arrow Despawn Rate
Can set a much shorter despawn rate for arrows that players can not pick up. Can set a much shorter despawn rate for arrows that players can not pick up.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index faacd86ba..f71580393 100644 index cd20572eb..b9dc0be2c 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -0,0 +0,0 @@ public class PaperWorldConfig {
@ -24,16 +24,16 @@ index faacd86ba..f71580393 100644
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java
index 584782adb..86836a5d0 100644 index e16c8e8d9..75445b00d 100644
--- a/src/main/java/net/minecraft/server/EntityArrow.java --- a/src/main/java/net/minecraft/server/EntityArrow.java
+++ b/src/main/java/net/minecraft/server/EntityArrow.java +++ b/src/main/java/net/minecraft/server/EntityArrow.java
@@ -0,0 +0,0 @@ public abstract class EntityArrow extends Entity implements IProjectile { @@ -0,0 +0,0 @@ public abstract class EntityArrow extends Entity implements IProjectile {
this.ay = 0;
} else { protected void f() {
++this.ax; ++this.despawnCounter;
- if (this.ax >= world.spigotConfig.arrowDespawnRate) { // Spigot - First int after shooter - if (this.despawnCounter >= world.spigotConfig.arrowDespawnRate) { // Spigot
+ if (this.ax >= (fromPlayer != PickupStatus.DISALLOWED ? world.spigotConfig.arrowDespawnRate : world.paperConfig.nonPlayerArrowDespawnRate)) { // Spigot - First int after shooter // Paper + if (this.despawnCounter >= (fromPlayer != PickupStatus.DISALLOWED ? world.spigotConfig.arrowDespawnRate : world.paperConfig.nonPlayerArrowDespawnRate)) { // Spigot // Paper
this.die(); this.die();
} }
}
-- --

View file

@ -18,64 +18,46 @@ index ec4643384..430b5d0cd 100644
+ enablePlayerCollisions = getBoolean("settings.enable-player-collisions", true); + enablePlayerCollisions = getBoolean("settings.enable-player-collisions", true);
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/CommandScoreboard.java b/src/main/java/net/minecraft/server/CommandScoreboard.java
index b08274d93..0607e55d3 100644
--- a/src/main/java/net/minecraft/server/CommandScoreboard.java
+++ b/src/main/java/net/minecraft/server/CommandScoreboard.java
@@ -0,0 +0,0 @@ public class CommandScoreboard extends CommandAbstract {
throw new ExceptionUsage("commands.scoreboard.teams.option.usage", new Object[0]);
}
+ // Paper start - Block setting options on our collideRule team as it is not persistent
+ if (astring[2].equals(MinecraftServer.getServer().getPlayerList().collideRuleTeamName)) {
+ icommandlistener.sendMessage(new ChatMessage("You cannot set team options on the collideRule team"));
+ return;
+ }
+ // Paper end
+
this.c(icommandlistener, astring, 2, minecraftserver);
}
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 2300ee10b..b6c4d98fd 100644 index b7aa9e869..c5670fe8d 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
this.v.setPlayerFileData(this.worldServer);
this.a(this.getDifficulty()); this.a(this.getDifficulty());
this.l(); this.g_();
+ +
+ // Paper start - Handle collideRule team for player collision toggle + // Paper start - Handle collideRule team for player collision toggle
+ final Scoreboard scoreboard = this.getWorld().getScoreboard(); + final Scoreboard scoreboard = this.getScoreboard();
+ final java.util.Collection<String> toRemove = scoreboard.getTeams().stream().filter(team -> team.getName().startsWith("collideRule_")).map(ScoreboardTeam::getName).collect(java.util.stream.Collectors.toList()); + final java.util.Collection<String> toRemove = scoreboard.getTeams().stream().filter(team -> team.getName().startsWith("collideRule_")).map(ScoreboardTeam::getName).collect(java.util.stream.Collectors.toList());
+ for (String teamName : toRemove) { + for (String teamName : toRemove) {
+ scoreboard.removeTeam(scoreboard.getTeam(teamName)); // Clean up after ourselves + scoreboard.removeTeam(scoreboard.getTeam(teamName)); // Clean up after ourselves
+ } + }
+ +
+ if (!com.destroystokyo.paper.PaperConfig.enablePlayerCollisions) { + if (!com.destroystokyo.paper.PaperConfig.enablePlayerCollisions) {
+ this.getPlayerList().collideRuleTeamName = org.apache.commons.lang3.StringUtils.left("collideRule_" + this.getWorld().random.nextInt(), 16); + this.getPlayerList().collideRuleTeamName = org.apache.commons.lang3.StringUtils.left("collideRule_" + worlds.get(0).random.nextInt(), 16);
+ ScoreboardTeam collideTeam = scoreboard.createTeam(this.getPlayerList().collideRuleTeamName); + ScoreboardTeam collideTeam = scoreboard.createTeam(this.getPlayerList().collideRuleTeamName);
+ collideTeam.setCanSeeFriendlyInvisibles(false); // Because we want to mimic them not being on a team at all + collideTeam.setCanSeeFriendlyInvisibles(false); // Because we want to mimic them not being on a team at all
+ } + }
+ // Paper end + // Paper end
} }
protected void l() { protected void a(File file, WorldData worlddata) {
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java b/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java diff --git a/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java b/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java
index 549d4e89d..df11764e0 100644 index 5f54e7b9c..759288b97 100644
--- a/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java --- a/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java
+++ b/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java +++ b/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java
@@ -0,0 +0,0 @@ public class PacketPlayOutScoreboardTeam implements Packet<PacketListenerPlayOut @@ -0,0 +0,0 @@ public class PacketPlayOutScoreboardTeam implements Packet<PacketListenerPlayOut
packetdataserializer.a(this.d); packetdataserializer.a(this.b);
packetdataserializer.writeByte(this.j); packetdataserializer.writeByte(this.j);
packetdataserializer.a(this.e); packetdataserializer.a(this.e);
- packetdataserializer.a(this.f); - packetdataserializer.a(this.f);
+ packetdataserializer.a(!com.destroystokyo.paper.PaperConfig.enablePlayerCollisions ? "never" : this.f); // Paper + packetdataserializer.a(!com.destroystokyo.paper.PaperConfig.enablePlayerCollisions ? "never" : this.f); // Paper
packetdataserializer.writeByte(this.g); packetdataserializer.a((Enum) this.g);
} packetdataserializer.a(this.c);
packetdataserializer.a(this.d);
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index baf288210..950dbdc50 100644 index 8e1edde31..801a147f0 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java --- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -0,0 +0,0 @@ public abstract class PlayerList { @@ -0,0 +0,0 @@ public abstract class PlayerList {
@ -97,7 +79,7 @@ index baf288210..950dbdc50 100644
+ } + }
+ // Paper end + // Paper end
// CraftBukkit - Moved from above, added world // CraftBukkit - Moved from above, added world
PlayerList.f.info(entityplayer.getName() + "[" + s1 + "] logged in with entity id " + entityplayer.getId() + " at ([" + entityplayer.world.worldData.getName() + "]" + entityplayer.locX + ", " + entityplayer.locY + ", " + entityplayer.locZ + ")"); PlayerList.f.info("{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", entityplayer.getDisplayName().getString(), s1, Integer.valueOf(entityplayer.getId()), entityplayer.world.worldData.getName(), Double.valueOf(entityplayer.locX), Double.valueOf(entityplayer.locY), Double.valueOf(entityplayer.locZ));
} }
@@ -0,0 +0,0 @@ public abstract class PlayerList { @@ -0,0 +0,0 @@ public abstract class PlayerList {
entityplayer.playerTick();// SPIGOT-924 entityplayer.playerTick();// SPIGOT-924
@ -115,7 +97,7 @@ index baf288210..950dbdc50 100644
+ +
this.savePlayerFile(entityplayer); this.savePlayerFile(entityplayer);
if (entityplayer.isPassenger()) { if (entityplayer.isPassenger()) {
Entity entity = entityplayer.getVehicle(); Entity entity = entityplayer.getRootVehicle();
@@ -0,0 +0,0 @@ public abstract class PlayerList { @@ -0,0 +0,0 @@ public abstract class PlayerList {
player.playerConnection.disconnect(this.server.server.getShutdownMessage()); // CraftBukkit - add custom shutdown message player.playerConnection.disconnect(this.server.server.getShutdownMessage()); // CraftBukkit - add custom shutdown message
} }

View file

@ -6,16 +6,16 @@ Subject: [PATCH] Configurable RCON IP address
For servers with multiple IP's, ability to bind to a specific interface. For servers with multiple IP's, ability to bind to a specific interface.
diff --git a/src/main/java/net/minecraft/server/RemoteControlListener.java b/src/main/java/net/minecraft/server/RemoteControlListener.java diff --git a/src/main/java/net/minecraft/server/RemoteControlListener.java b/src/main/java/net/minecraft/server/RemoteControlListener.java
index a6a0d5a29..efcafe77f 100644 index 6f0176f6f..1e5caa13a 100644
--- a/src/main/java/net/minecraft/server/RemoteControlListener.java --- a/src/main/java/net/minecraft/server/RemoteControlListener.java
+++ b/src/main/java/net/minecraft/server/RemoteControlListener.java +++ b/src/main/java/net/minecraft/server/RemoteControlListener.java
@@ -0,0 +0,0 @@ public class RemoteControlListener extends RemoteConnectionThread { @@ -0,0 +0,0 @@ public class RemoteControlListener extends RemoteConnectionThread {
super(iminecraftserver, "RCON Listener"); super(iminecraftserver, "RCON Listener");
this.h = iminecraftserver.a("rcon.port", 0); this.h = iminecraftserver.a("rcon.port", 0);
this.l = iminecraftserver.a("rcon.password", ""); this.l = iminecraftserver.a("rcon.password", "");
- this.j = iminecraftserver.d_(); - this.j = iminecraftserver.e();
+ this.j = iminecraftserver.a("rcon.ip", iminecraftserver.d_()); // Paper + this.j = iminecraftserver.a("rcon.ip", iminecraftserver.d_()); // Paper
this.i = iminecraftserver.e_(); this.i = iminecraftserver.f();
if (0 == this.h) { if (0 == this.h) {
this.h = this.i + 10; this.h = this.i + 10;
-- --

View file

@ -20,27 +20,27 @@ index 4a692ac1b..d44cacc7e 100644
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java
index 11c0f24f1..277f1414a 100644 index b24e73f2c..268e4d57b 100644
--- a/src/main/java/net/minecraft/server/EntityZombie.java --- a/src/main/java/net/minecraft/server/EntityZombie.java
+++ b/src/main/java/net/minecraft/server/EntityZombie.java +++ b/src/main/java/net/minecraft/server/EntityZombie.java
@@ -0,0 +0,0 @@ public class EntityZombie extends EntityMonster { @@ -0,0 +0,0 @@ public class EntityZombie extends EntityMonster {
protected static final IAttribute a = (new AttributeRanged((IAttribute) null, "zombie.spawnReinforcements", 0.0D, 0.0D, 1.0D)).a("Spawn Reinforcements Chance"); protected static final IAttribute c = (new AttributeRanged((IAttribute) null, "zombie.spawnReinforcements", 0.0D, 0.0D, 1.0D)).a("Spawn Reinforcements Chance");
private static final UUID b = UUID.fromString("B9766B59-9566-4402-BC1F-2EE2A276D836"); private static final UUID a = UUID.fromString("B9766B59-9566-4402-BC1F-2EE2A276D836");
- private static final AttributeModifier c = new AttributeModifier(EntityZombie.b, "Baby speed boost", 0.5D, 1); - private static final AttributeModifier b = new AttributeModifier(EntityZombie.a, "Baby speed boost", 0.5D, 1);
+ private final AttributeModifier c = new AttributeModifier(EntityZombie.b, "Baby speed boost", world.paperConfig.babyZombieMovementSpeed, 1); // Paper - Remove static - Make baby speed configurable + private final AttributeModifier babyModifier = new AttributeModifier(EntityZombie.a, "Baby speed boost", world.paperConfig.babyZombieMovementSpeed, 1); // Paper - Remove static - Make baby speed configurable
private static final DataWatcherObject<Boolean> bx = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.h); private static final DataWatcherObject<Boolean> bC = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i);
private static final DataWatcherObject<Integer> by = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.b); private static final DataWatcherObject<Integer> bD = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.b);
private static final DataWatcherObject<Boolean> bz = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.h); private static final DataWatcherObject<Boolean> bE = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i);
@@ -0,0 +0,0 @@ public class EntityZombie extends EntityMonster { @@ -0,0 +0,0 @@ public class EntityZombie extends EntityMonster {
if (this.world != null && !this.world.isClientSide) { if (this.world != null && !this.world.isClientSide) {
AttributeInstance attributeinstance = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED); AttributeInstance attributeinstance = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
- attributeinstance.c(EntityZombie.c); - attributeinstance.c(EntityZombie.b);
+ attributeinstance.c(this.c); + attributeinstance.c(this.babyModifier); // Paper
if (flag) { if (flag) {
- attributeinstance.b(EntityZombie.c); - attributeinstance.b(EntityZombie.b);
+ attributeinstance.b(this.c); + attributeinstance.b(this.babyModifier); // Paper
} }
} }

View file

@ -23,29 +23,29 @@ index 621bf7051..4a692ac1b 100644
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/BlockCactus.java b/src/main/java/net/minecraft/server/BlockCactus.java diff --git a/src/main/java/net/minecraft/server/BlockCactus.java b/src/main/java/net/minecraft/server/BlockCactus.java
index 64b7d08fa..d8fb87f7a 100644 index 54685157f..83fb53643 100644
--- a/src/main/java/net/minecraft/server/BlockCactus.java --- a/src/main/java/net/minecraft/server/BlockCactus.java
+++ b/src/main/java/net/minecraft/server/BlockCactus.java +++ b/src/main/java/net/minecraft/server/BlockCactus.java
@@ -0,0 +0,0 @@ public class BlockCactus extends Block { @@ -0,0 +0,0 @@ public class BlockCactus extends Block {
;
}
- if (i < 3) {
+ if (i < world.paperConfig.cactusMaxHeight) { // Paper - Configurable growth height
int j = ((Integer) iblockdata.get(BlockCactus.AGE)).intValue();
if (j >= (byte) range(3, ((100.0F / world.spigotConfig.cactusModifier) * 15) + 0.5F, 15)) { // Spigot
diff --git a/src/main/java/net/minecraft/server/BlockReed.java b/src/main/java/net/minecraft/server/BlockReed.java
index 57f24f55d..d19dce839 100644
--- a/src/main/java/net/minecraft/server/BlockReed.java
+++ b/src/main/java/net/minecraft/server/BlockReed.java
@@ -0,0 +0,0 @@ public class BlockReed extends Block {
; ;
} }
- if (i < 3) { - if (i < 3) {
+ if (i < world.paperConfig.reedMaxHeight) { // Paper - Configurable growth height + if (i < world.paperConfig.cactusMaxHeight) { // Paper - Configurable growth height
int j = ((Integer) iblockdata.get(BlockReed.AGE)).intValue(); int j = ((Integer) iblockdata.get(BlockCactus.AGE)).intValue();
if (j >= (byte) range(3, ((100.0F / world.spigotConfig.caneModifier) * 15) + 0.5F, 15)) { // Spigot if (j >= (byte) range(3, ((100.0F / world.spigotConfig.cactusModifier) * 15) + 0.5F, 15)) { // Spigot
diff --git a/src/main/java/net/minecraft/server/BlockReed.java b/src/main/java/net/minecraft/server/BlockReed.java
index 313821d52..c4e7f318d 100644
--- a/src/main/java/net/minecraft/server/BlockReed.java
+++ b/src/main/java/net/minecraft/server/BlockReed.java
@@ -0,0 +0,0 @@ public class BlockReed extends Block {
;
}
- if (i < 3) {
+ if (i < world.paperConfig.reedMaxHeight) { // Paper - Configurable growth height
int j = ((Integer) iblockdata.get(BlockReed.AGE)).intValue();
if (j >= (byte) range(3, ((100.0F / world.spigotConfig.caneModifier) * 15) + 0.5F, 15)) { // Spigot
-- --

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Configurable container update tick rate
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index f431000d1..abcfb9216 100644 index 47f391243..26d8dbb60 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -0,0 +0,0 @@ public class PaperWorldConfig {
@ -19,7 +19,7 @@ index f431000d1..abcfb9216 100644
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 3058dfef0..ed3546ccc 100644 index 0531812fb..5ca0dec1f 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java --- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Configurable end credits
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 94a173045..db09711e4 100644 index 1e3405cc1..dccccbf5b 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -0,0 +0,0 @@ public class PaperWorldConfig {
@ -20,24 +20,24 @@ index 94a173045..db09711e4 100644
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 730acd971..dfaab774d 100644 index e035025f0..cb44bf3a7 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java --- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
private long cn = System.currentTimeMillis(); private long cv = SystemUtils.b();
private Entity co; private Entity cw;
public boolean worldChangeInvuln; public boolean worldChangeInvuln;
- private boolean cq; - private boolean cy;
+ private boolean cq; private void setHasSeenCredits(boolean has) { this.cq = has; } // Paper - OBFHELPER + private boolean cy; private void setHasSeenCredits(boolean has) { this.cy = has; } // Paper - OBFHELPER
private final RecipeBookServer cr = new RecipeBookServer(); private final RecipeBookServer cz;
private Vec3D cs; private Vec3D cA;
private int ct; private int cB;
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.world.kill(this); this.world.kill(this);
if (!this.viewingCredits) { if (!this.viewingCredits) {
this.viewingCredits = true; this.viewingCredits = true;
+ if (world.paperConfig.disableEndCredits) this.setHasSeenCredits(true); // Paper - Toggle to always disable end credits + if (world.paperConfig.disableEndCredits) this.setHasSeenCredits(true); // Paper - Toggle to always disable end credits
this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(4, this.cq ? 0.0F : 1.0F)); this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(4, this.cy ? 0.0F : 1.0F));
this.cq = true; this.cy = true;
} }
-- --

View file

@ -22,16 +22,16 @@ index d44cacc7e..45bddf3f4 100644
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java
index b4d3bcb41..339d1f1b1 100644 index 2512ad353..866f41980 100644
--- a/src/main/java/net/minecraft/server/EntityFishingHook.java --- a/src/main/java/net/minecraft/server/EntityFishingHook.java
+++ b/src/main/java/net/minecraft/server/EntityFishingHook.java +++ b/src/main/java/net/minecraft/server/EntityFishingHook.java
@@ -0,0 +0,0 @@ public class EntityFishingHook extends Entity { @@ -0,0 +0,0 @@ public class EntityFishingHook extends Entity {
this.at = MathHelper.nextInt(this.random, 20, 80); this.aw = MathHelper.nextInt(this.random, 20, 80);
} }
} else { } else {
- this.h = MathHelper.nextInt(this.random, 100, 600); - this.h = MathHelper.nextInt(this.random, 100, 600);
+ this.h = MathHelper.nextInt(this.random, world.paperConfig.fishingMinTicks, world.paperConfig.fishingMaxTicks); // Paper + this.h = MathHelper.nextInt(this.random, world.paperConfig.fishingMinTicks, world.paperConfig.fishingMaxTicks); // Paper
this.h -= this.ax * 20 * 5; this.h -= this.aA * 20 * 5;
} }
} }
-- --

View file

@ -16,7 +16,7 @@ The wanted destination was on top of the emerald block however the player ended
This only is the case if the player is teleporting between worlds. This only is the case if the player is teleporting between worlds.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 38ccabc0d..b241c0380 100644 index 1ba09df9c..6fc3b7621 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -0,0 +0,0 @@ public class PaperWorldConfig {
@ -30,7 +30,7 @@ index 38ccabc0d..b241c0380 100644
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 536534d2e..bf7aaebd6 100644 index 23562388a..23cab725d 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java --- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -0,0 +0,0 @@ public abstract class PlayerList { @@ -0,0 +0,0 @@ public abstract class PlayerList {
@ -43,7 +43,7 @@ index 536534d2e..bf7aaebd6 100644
entityplayer.getBukkitEntity().setVelocity(velocity); entityplayer.getBukkitEntity().setVelocity(velocity);
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 9b9e02ae1..18a481f2f 100644 index 18f68b925..aacf8ea7f 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View file

@ -1,49 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net>
Date: Wed, 2 Mar 2016 12:27:07 -0600
Subject: [PATCH] Configurable lava flow speed
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index dbd82d5a9..b0b3033e7 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
fastDrainLava = getBoolean("fast-drain.lava", false);
fastDrainWater = getBoolean("fast-drain.water", false);
}
+
+ public int lavaFlowSpeedNormal;
+ public int lavaFlowSpeedNether;
+ private void lavaFlowSpeeds() {
+ lavaFlowSpeedNormal = getInt("lava-flow-speed.normal", 30);
+ lavaFlowSpeedNether = getInt("lava-flow-speed.nether", 10);
+ }
}
diff --git a/src/main/java/net/minecraft/server/BlockFlowing.java b/src/main/java/net/minecraft/server/BlockFlowing.java
index 3aaa19b2f..739b9aac3 100644
--- a/src/main/java/net/minecraft/server/BlockFlowing.java
+++ b/src/main/java/net/minecraft/server/BlockFlowing.java
@@ -0,0 +0,0 @@ public class BlockFlowing extends BlockFluids {
* Paper - Get flow speed. Throttle if its water and flowing adjacent to lava
*/
public int getFlowSpeed(World world, BlockPosition blockposition) {
+ if (this.material == Material.LAVA) {
+ return world.worldProvider.isSkyMissing() ? world.paperConfig.lavaFlowSpeedNether : world.paperConfig.lavaFlowSpeedNormal;
+ }
if (this.material == Material.WATER && (
world.getType(blockposition.north(1)).getBlock().material == Material.LAVA ||
world.getType(blockposition.south(1)).getBlock().material == Material.LAVA ||
diff --git a/src/main/java/net/minecraft/server/WorldProvider.java b/src/main/java/net/minecraft/server/WorldProvider.java
index f3eb2a797..d0265f960 100644
--- a/src/main/java/net/minecraft/server/WorldProvider.java
+++ b/src/main/java/net/minecraft/server/WorldProvider.java
@@ -0,0 +0,0 @@ public abstract class WorldProvider {
return this.f;
}
+ public final boolean isSkyMissing() { return this.n(); } // Paper - OBFHELPER
public boolean n() {
return this.e;
}
--

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Configurable mob spawner tick rate
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 70b02f020..f431000d1 100644 index 0130e5860..47f391243 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -0,0 +0,0 @@ public class PaperWorldConfig {
@ -19,13 +19,13 @@ index 70b02f020..f431000d1 100644
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
index 0149726ea..a5261d70b 100644 index e9650d962..61472a0eb 100644
--- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java --- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
+++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java +++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
@@ -0,0 +0,0 @@ public abstract class MobSpawnerAbstract { @@ -0,0 +0,0 @@ public abstract class MobSpawnerAbstract {
public int maxNearbyEntities = 6; // CraftBukkit private -> public public int maxNearbyEntities = 6;
public int requiredPlayerRange = 16; // CraftBukkit private -> public public int requiredPlayerRange = 16;
public int spawnRange = 4; // CraftBukkit private -> public public int spawnRange = 4;
+ private int tickDelay = 0; // Paper + private int tickDelay = 0; // Paper
public MobSpawnerAbstract() {} public MobSpawnerAbstract() {}
@ -39,18 +39,18 @@ index 0149726ea..a5261d70b 100644
+ tickDelay = this.a().paperConfig.mobSpawnerTickRate; + tickDelay = this.a().paperConfig.mobSpawnerTickRate;
+ // Paper end + // Paper end
if (!this.h()) { if (!this.h()) {
this.e = this.d; this.f = this.e;
} else { } else {
@@ -0,0 +0,0 @@ public abstract class MobSpawnerAbstract { @@ -0,0 +0,0 @@ public abstract class MobSpawnerAbstract {
this.a().addParticle(EnumParticle.SMOKE_NORMAL, d0, d1, d2, 0.0D, 0.0D, 0.0D, new int[0]); this.a().addParticle(Particles.M, d0, d1, d2, 0.0D, 0.0D, 0.0D);
this.a().addParticle(EnumParticle.FLAME, d0, d1, d2, 0.0D, 0.0D, 0.0D, new int[0]); this.a().addParticle(Particles.y, d0, d1, d2, 0.0D, 0.0D, 0.0D);
if (this.spawnDelay > 0) { if (this.spawnDelay > 0) {
- --this.spawnDelay; - --this.spawnDelay;
+ this.spawnDelay -= tickDelay; // Paper + this.spawnDelay -= tickDelay; // Paper
} }
this.e = this.d; this.f = this.e;
this.d = (this.d + (double) (1000.0F / ((float) this.spawnDelay + 200.0F))) % 360.0D; this.e = (this.e + (double) (1000.0F / ((float) this.spawnDelay + 200.0F))) % 360.0D;
} else { } else {
- if (this.spawnDelay == -1) { - if (this.spawnDelay == -1) {
+ if (this.spawnDelay < -tickDelay) { // Paper + if (this.spawnDelay < -tickDelay) { // Paper

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Configurable spawn chances for skeleton horses
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index f71580393..38d664e00 100644 index b9dc0be2c..9f586774d 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -0,0 +0,0 @@ public class PaperWorldConfig {
@ -19,16 +19,16 @@ index f71580393..38d664e00 100644
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index d0ff0adf5..96792300c 100644 index 9bd11a5fd..88868b4c4 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java --- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { @@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler {
if (this.isRainingAt(blockposition)) { if (this.isRainingAt(blockposition)) {
DifficultyDamageScaler difficultydamagescaler = this.D(blockposition); DifficultyDamageScaler difficultydamagescaler = this.getDamageScaler(blockposition);
- if (this.getGameRules().getBoolean("doMobSpawning") && this.random.nextDouble() < (double) difficultydamagescaler.b() * 0.01D) { - if (this.getGameRules().getBoolean("doMobSpawning") && this.random.nextDouble() < (double) difficultydamagescaler.b() * 0.01D) {
+ if (this.getGameRules().getBoolean("doMobSpawning") && this.random.nextDouble() < (double) difficultydamagescaler.b() * paperConfig.skeleHorseSpawnChance) { + if (this.getGameRules().getBoolean("doMobSpawning") && this.random.nextDouble() < (double) difficultydamagescaler.b() * paperConfig.skeleHorseSpawnChance) {
EntityHorseSkeleton entityhorseskeleton = new EntityHorseSkeleton(this); EntityHorseSkeleton entityhorseskeleton = new EntityHorseSkeleton(this);
entityhorseskeleton.p(true); entityhorseskeleton.s(true);
-- --

View file

@ -1,59 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net>
Date: Tue, 1 Mar 2016 14:27:13 -0600
Subject: [PATCH] Configurable speed for water flowing over lava
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 4da846719..d3484489b 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
if (fallingBlockHeightNerf != 0) log("Falling Block Height Limit set to Y: " + fallingBlockHeightNerf);
if (entityTNTHeightNerf != 0) log("TNT Entity Height Limit set to Y: " + entityTNTHeightNerf);
}
+
+ public int waterOverLavaFlowSpeed;
+ private void waterOverLawFlowSpeed() {
+ waterOverLavaFlowSpeed = getInt("water-over-lava-flow-speed", 5);
+ log("Water over lava flow speed: " + waterOverLavaFlowSpeed);
+ }
}
diff --git a/src/main/java/net/minecraft/server/BlockFlowing.java b/src/main/java/net/minecraft/server/BlockFlowing.java
index 7b74df5b9..62234a7c9 100644
--- a/src/main/java/net/minecraft/server/BlockFlowing.java
+++ b/src/main/java/net/minecraft/server/BlockFlowing.java
@@ -0,0 +0,0 @@ public class BlockFlowing extends BlockFluids {
b0 = 2;
}
- int j = this.a(world);
+ int j = this.getFlowSpeed(world, blockposition); // Paper
int k;
if (i > 0) {
@@ -0,0 +0,0 @@ public class BlockFlowing extends BlockFluids {
public void onPlace(World world, BlockPosition blockposition, IBlockData iblockdata) {
if (!this.e(world, blockposition, iblockdata)) {
- world.a(blockposition, (Block) this, this.a(world));
+ world.a(blockposition, (Block) this, this.getFlowSpeed(world, blockposition)); // Paper
}
}
+
+ /**
+ * Paper - Get flow speed. Throttle if its water and flowing adjacent to lava
+ */
+ public int getFlowSpeed(World world, BlockPosition blockposition) {
+ if (this.material == Material.WATER && (
+ world.getType(blockposition.north(1)).getBlock().material == Material.LAVA ||
+ world.getType(blockposition.south(1)).getBlock().material == Material.LAVA ||
+ world.getType(blockposition.west(1)).getBlock().material == Material.LAVA ||
+ world.getType(blockposition.east(1)).getBlock().material == Material.LAVA)) {
+ return world.paperConfig.waterOverLavaFlowSpeed;
+ }
+ return super.a(world);
+ }
}
--

View file

@ -5,12 +5,12 @@ Subject: [PATCH] Configurable top of nether void damage
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index d3484489b..bf7af475c 100644 index 4da846719..a340866f3 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -0,0 +0,0 @@ public class PaperWorldConfig {
waterOverLavaFlowSpeed = getInt("water-over-lava-flow-speed", 5); if (fallingBlockHeightNerf != 0) log("Falling Block Height Limit set to Y: " + fallingBlockHeightNerf);
log("Water over lava flow speed: " + waterOverLavaFlowSpeed); if (entityTNTHeightNerf != 0) log("TNT Entity Height Limit set to Y: " + entityTNTHeightNerf);
} }
+ +
+ public boolean netherVoidTopDamage; + public boolean netherVoidTopDamage;
@ -20,10 +20,10 @@ index d3484489b..bf7af475c 100644
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 43b802855..aadc426fd 100644 index 2288df268..111eeeecc 100644
--- a/src/main/java/net/minecraft/server/Entity.java --- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java
@@ -0,0 +0,0 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
this.fallDistance *= 0.5F; this.fallDistance *= 0.5F;
} }
@ -31,7 +31,7 @@ index 43b802855..aadc426fd 100644
+ // Extracted to own function + // Extracted to own function
+ /* + /*
if (this.locY < -64.0D) { if (this.locY < -64.0D) {
this.ac(); this.aa();
} }
+ */ + */
+ this.checkAndDoHeightDamage(); + this.checkAndDoHeightDamage();
@ -39,35 +39,31 @@ index 43b802855..aadc426fd 100644
if (!this.world.isClientSide) { if (!this.world.isClientSide) {
this.setFlag(0, this.fireTicks > 0); this.setFlag(0, this.fireTicks > 0);
@@ -0,0 +0,0 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
this.world.methodProfiler.b(); this.world.methodProfiler.e();
} }
+ // Paper start - Configurable top of nether void damage + // Paper start
+ private boolean paperNetherCheck() {
+ return this.world.paperConfig.netherVoidTopDamage && this.world.getWorld().getEnvironment() == org.bukkit.World.Environment.NETHER && this.locY >= 128.0D;
+ }
+
+ protected void checkAndDoHeightDamage() { + protected void checkAndDoHeightDamage() {
+ if (this.locY < -64.0D || paperNetherCheck()) { + if (this.locY < -64.0D || (this.world.paperConfig.netherVoidTopDamage && this.world.getWorld().getEnvironment() == org.bukkit.World.Environment.NETHER && this.locY >= 128.0D)) {
+ this.kill(); + this.kill();
+ } + }
+ } + }
+ // Paper end + // Paper end
+ +
protected void I() { protected void E() {
if (this.portalCooldown > 0) { if (this.portalCooldown > 0) {
--this.portalCooldown; --this.portalCooldown;
@@ -0,0 +0,0 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
this.fireTicks = 0; this.fireTicks = 0;
} }
+ protected final void kill() { this.ac(); } // Paper - OBFHELPER + protected final void kill() { this.aa(); } // Paper - OBFHELPER
protected void ac() { protected void aa() {
this.die(); this.die();
} }
diff --git a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java diff --git a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java
index a9412d4e0..1f4025486 100644 index 2f4e1a280..3598998b5 100644
--- a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java --- a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java
+++ b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java +++ b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java
@@ -0,0 +0,0 @@ public abstract class EntityMinecartAbstract extends Entity implements INamableT @@ -0,0 +0,0 @@ public abstract class EntityMinecartAbstract extends Entity implements INamableT
@ -78,7 +74,7 @@ index a9412d4e0..1f4025486 100644
+ // Extracted to own function + // Extracted to own function
+ /* + /*
if (this.locY < -64.0D) { if (this.locY < -64.0D) {
this.ac(); this.aa();
} }
+ */ + */
+ this.checkAndDoHeightDamage(); + this.checkAndDoHeightDamage();

View file

@ -5,12 +5,12 @@ Subject: [PATCH] Custom replacement for eaten items
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 2aaeac324..7e2cc66d7 100644 index f57e0136c..a0af21301 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java --- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity { @@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
protected void v() { protected void q() {
if (!this.activeItem.isEmpty() && this.isHandRaised()) { if (!this.activeItem.isEmpty() && this.isHandRaised()) {
+ PlayerItemConsumeEvent event = null; // Paper + PlayerItemConsumeEvent event = null; // Paper
this.b(this.activeItem, 16); this.b(this.activeItem, 16);
@ -33,11 +33,9 @@ index 2aaeac324..7e2cc66d7 100644
+ itemstack = CraftItemStack.asNMSCopy(event.getReplacement()); + itemstack = CraftItemStack.asNMSCopy(event.getReplacement());
+ } + }
+ // Paper end + // Paper end
+ this.a(this.cT(), itemstack);
this.a(this.cH(), itemstack);
// CraftBukkit end // CraftBukkit end
this.cN(); this.cZ();
+
+ // Paper start - if the replacement is anything but the default, update the client inventory + // Paper start - if the replacement is anything but the default, update the client inventory
+ if (this instanceof EntityPlayer && !com.google.common.base.Objects.equal(defaultReplacement, itemstack)) { + if (this instanceof EntityPlayer && !com.google.common.base.Objects.equal(defaultReplacement, itemstack)) {
+ ((EntityPlayer) this).getBukkitEntity().updateInventory(); + ((EntityPlayer) this).getBukkitEntity().updateInventory();

View file

@ -30,7 +30,7 @@ index 3898ad8fa..2f6e169f5 100644
+ } + }
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index d56966109..d482589b3 100644 index eaac1430e..6dae117ac 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -0,0 +0,0 @@ public final class CraftServer implements Server { @@ -0,0 +0,0 @@ public final class CraftServer implements Server {

View file

@ -11,7 +11,7 @@ So avoid looking up scoreboards and short circuit to the "not on a team"
logic which is most likely to be true. logic which is most likely to be true.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index b241c0380..a4c94845b 100644 index 6fc3b7621..93486b4b8 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -0,0 +0,0 @@ public class PaperWorldConfig {
@ -24,28 +24,28 @@ index b241c0380..a4c94845b 100644
+ nonPlayerEntitiesOnScoreboards = getBoolean("allow-non-player-entities-on-scoreboards", false); + nonPlayerEntitiesOnScoreboards = getBoolean("allow-non-player-entities-on-scoreboards", false);
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/CommandScoreboard.java b/src/main/java/net/minecraft/server/CommandScoreboard.java
index ec9a87239..b08274d93 100644
--- a/src/main/java/net/minecraft/server/CommandScoreboard.java
+++ b/src/main/java/net/minecraft/server/CommandScoreboard.java
@@ -0,0 +0,0 @@ public class CommandScoreboard extends CommandAbstract {
while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next();
+ if (!entity.world.paperConfig.nonPlayerEntitiesOnScoreboards && !(entity instanceof EntityHuman)) { continue; } // Paper
String s2 = f(minecraftserver, icommandlistener, entity.bn());
if (scoreboard.addPlayerToTeam(s2, s)) {
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 804104818..f547dbfd0 100644 index d378f1a9d..e16579116 100644
--- a/src/main/java/net/minecraft/server/Entity.java --- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java
@@ -0,0 +0,0 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@Nullable @Nullable
public ScoreboardTeamBase aY() { public ScoreboardTeamBase be() {
+ if (!this.world.paperConfig.nonPlayerEntitiesOnScoreboards && !(this instanceof EntityHuman)) { return null; } // Paper + if (!this.world.paperConfig.nonPlayerEntitiesOnScoreboards && !(this instanceof EntityHuman)) { return null; } // Paper
return this.world.getScoreboard().getPlayerTeam(this.bn()); return this.world.getScoreboard().getPlayerTeam(this.getName());
} }
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 43715902e..f57e0136c 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
if (nbttagcompound.hasKeyOfType("Team", 8)) {
String s = nbttagcompound.getString("Team");
ScoreboardTeam scoreboardteam = this.world.getScoreboard().getTeam(s);
+ if (!world.paperConfig.nonPlayerEntitiesOnScoreboards && !(this instanceof EntityHuman)) { scoreboardteam = null; } // Paper
boolean flag = scoreboardteam != null && this.world.getScoreboard().addPlayerToTeam(this.bu(), scoreboardteam);
if (!flag) {
-- --

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Disable chest cat detection
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index abcfb9216..4c57b9cbf 100644 index 26d8dbb60..43aa73e1d 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -0,0 +0,0 @@ public class PaperWorldConfig {
@ -19,19 +19,19 @@ index abcfb9216..4c57b9cbf 100644
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/BlockChest.java b/src/main/java/net/minecraft/server/BlockChest.java diff --git a/src/main/java/net/minecraft/server/BlockChest.java b/src/main/java/net/minecraft/server/BlockChest.java
index da2cfe206..bc398ec52 100644 index d55122c66..f8be07258 100644
--- a/src/main/java/net/minecraft/server/BlockChest.java --- a/src/main/java/net/minecraft/server/BlockChest.java
+++ b/src/main/java/net/minecraft/server/BlockChest.java +++ b/src/main/java/net/minecraft/server/BlockChest.java
@@ -0,0 +0,0 @@ public class BlockChest extends BlockTileEntity { @@ -0,0 +0,0 @@ public class BlockChest extends BlockTileEntity implements IFluidSource, IFluidC
} }
private boolean j(World world, BlockPosition blockposition) { private boolean b(World world, BlockPosition blockposition) {
+ // Paper start - Option ti dsiable chest cat detection + // Paper start - Option to disable chest cat detection
+ if (world.paperConfig.disableChestCatDetection) { + if (world.paperConfig.disableChestCatDetection) {
+ return false; + return false;
+ } + }
+ // Paper end + // Paper end
Iterator iterator = world.a(EntityOcelot.class, new AxisAlignedBB((double) blockposition.getX(), (double) (blockposition.getY() + 1), (double) blockposition.getZ(), (double) (blockposition.getX() + 1), (double) (blockposition.getY() + 2), (double) (blockposition.getZ() + 1))).iterator(); List list = world.a(EntityOcelot.class, new AxisAlignedBB((double) blockposition.getX(), (double) (blockposition.getY() + 1), (double) blockposition.getZ(), (double) (blockposition.getX() + 1), (double) (blockposition.getY() + 2), (double) (blockposition.getZ() + 1)));
EntityOcelot entityocelot; if (!list.isEmpty()) {
-- --

View file

@ -5,12 +5,12 @@ Subject: [PATCH] Disable explosion knockback
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index b0b3033e7..afc13e851 100644 index 3626aa717..be92c1af6 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -0,0 +0,0 @@ public class PaperWorldConfig {
lavaFlowSpeedNormal = getInt("lava-flow-speed.normal", 30); optimizeExplosions = getBoolean("optimize-explosions", false);
lavaFlowSpeedNether = getInt("lava-flow-speed.nether", 10); log("Optimize explosions: " + optimizeExplosions);
} }
+ +
+ public boolean disableExplosionKnockback; + public boolean disableExplosionKnockback;
@ -19,7 +19,7 @@ index b0b3033e7..afc13e851 100644
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index d15cfdd76..2aaeac324 100644 index 1ee54fa45..43715902e 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java --- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity { @@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
@ -46,9 +46,9 @@ index d15cfdd76..2aaeac324 100644
+ +
if (this.getHealth() <= 0.0F) { if (this.getHealth() <= 0.0F) {
if (!this.e(damagesource)) { if (!this.e(damagesource)) {
SoundEffect soundeffect = this.cf(); SoundEffect soundeffect = this.cr();
diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java
index e7f0e84d4..e148901e5 100644 index ddbf667c4..2652b1575 100644
--- a/src/main/java/net/minecraft/server/Explosion.java --- a/src/main/java/net/minecraft/server/Explosion.java
+++ b/src/main/java/net/minecraft/server/Explosion.java +++ b/src/main/java/net/minecraft/server/Explosion.java
@@ -0,0 +0,0 @@ public class Explosion { @@ -0,0 +0,0 @@ public class Explosion {
@ -64,9 +64,9 @@ index e7f0e84d4..e148901e5 100644
if (entity instanceof EntityHuman) { if (entity instanceof EntityHuman) {
EntityHuman entityhuman = (EntityHuman) entity; EntityHuman entityhuman = (EntityHuman) entity;
- if (!entityhuman.isSpectator() && (!entityhuman.z() || !entityhuman.abilities.isFlying)) { - if (!entityhuman.isSpectator() && (!entityhuman.u() || !entityhuman.abilities.isFlying)) {
+ if (!entityhuman.isSpectator() && (!entityhuman.z() && !world.paperConfig.disableExplosionKnockback || !entityhuman.abilities.isFlying)) { // Paper - Disable explosion knockback + if (!entityhuman.isSpectator() && (!entityhuman.u() && !world.paperConfig.disableExplosionKnockback || !entityhuman.abilities.isFlying)) { // Paper - Disable explosion knockback
this.k.put(entityhuman, new Vec3D(d8 * d13, d9 * d13, d10 * d13)); this.l.put(entityhuman, new Vec3D(d8 * d13, d9 * d13, d10 * d13));
} }
} }
-- --

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Disable ice and snow
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 4ae2f9af1..70b02f020 100644 index efacd5ea0..0130e5860 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -0,0 +0,0 @@ public class PaperWorldConfig {
@ -19,7 +19,7 @@ index 4ae2f9af1..70b02f020 100644
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index b12c58732..d0ff0adf5 100644 index 7a9cd1398..21b8a1dd9 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java --- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { @@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler {
@ -28,7 +28,7 @@ index b12c58732..d0ff0adf5 100644
this.methodProfiler.c("iceandsnow"); this.methodProfiler.c("iceandsnow");
- if (this.random.nextInt(16) == 0) { - if (this.random.nextInt(16) == 0) {
+ if (!this.paperConfig.disableIceAndSnow && this.random.nextInt(16) == 0) { // Paper - Disable ice and snow + if (!this.paperConfig.disableIceAndSnow && this.random.nextInt(16) == 0) { // Paper - Disable ice and snow
this.l = this.l * 3 + 1013904223; this.m = this.m * 3 + 1013904223;
l = this.l >> 2; l = this.m >> 2;
blockposition = this.p(new BlockPosition(j + (l & 15), 0, k + (l >> 8 & 15))); blockposition = this.getHighestBlockYAt(HeightMap.Type.MOTION_BLOCKING, new BlockPosition(j + (l & 15), 0, k + (l >> 8 & 15)));
-- --

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Disable spigot tick limiters
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index fc7315f7d..e85ed2e33 100644 index 04493a1f9..d988fd007 100644
--- a/src/main/java/net/minecraft/server/World.java --- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose
// CraftBukkit start - Use field for loop variable // CraftBukkit start - Use field for loop variable
co.aikar.timings.TimingHistory.entityTicks += this.entityList.size(); // Paper co.aikar.timings.TimingHistory.entityTicks += this.entityList.size(); // Paper
int entitiesThisCycle = 0; int entitiesThisCycle = 0;
@ -23,7 +23,7 @@ index fc7315f7d..e85ed2e33 100644
tickPosition = (tickPosition < entityList.size()) ? tickPosition : 0; tickPosition = (tickPosition < entityList.size()) ? tickPosition : 0;
entity = (Entity) this.entityList.get(this.tickPosition); entity = (Entity) this.entityList.get(this.tickPosition);
// CraftBukkit end // CraftBukkit end
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose
// Spigot start // Spigot start
// Iterator iterator = this.tileEntityListTick.iterator(); // Iterator iterator = this.tileEntityListTick.iterator();
int tilesThisCycle = 0; int tilesThisCycle = 0;

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Disable thunder
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index afc13e851..4ae2f9af1 100644 index be92c1af6..efacd5ea0 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -0,0 +0,0 @@ public class PaperWorldConfig {
@ -19,7 +19,7 @@ index afc13e851..4ae2f9af1 100644
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 95964c550..b12c58732 100644 index 420cbee6a..7a9cd1398 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java --- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { @@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler {
@ -27,9 +27,8 @@ index 95964c550..b12c58732 100644
BlockPosition blockposition; BlockPosition blockposition;
- if (flag && flag1 && this.random.nextInt(100000) == 0) { - if (flag && flag1 && this.random.nextInt(100000) == 0) {
+ // Paper - Disable thunder + if (!this.paperConfig.disableThunder && flag && flag1 && this.random.nextInt(100000) == 0) { // Paper - Disable thunder
+ if (!this.paperConfig.disableThunder && flag && flag1 && this.random.nextInt(100000) == 0) { this.m = this.m * 3 + 1013904223;
this.l = this.l * 3 + 1013904223; l = this.m >> 2;
l = this.l >> 2;
blockposition = this.a(new BlockPosition(j + (l & 15), 0, k + (l >> 8 & 15))); blockposition = this.a(new BlockPosition(j + (l & 15), 0, k + (l >> 8 & 15)));
-- --

View file

@ -7,15 +7,15 @@ Should only happen for blocks on the edge that uses neighbors light level
(certain blocks). In that case, there will be 3-4 other neighbors to get a light level from. (certain blocks). In that case, there will be 3-4 other neighbors to get a light level from.
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 119cd0636..5d5003920 100644 index e88baae1d..e42a334bc 100644
--- a/src/main/java/net/minecraft/server/World.java --- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose
if (blockposition.getY() >= 256) { if (blockposition.getY() >= 256) {
blockposition = new BlockPosition(blockposition.getX(), 255, blockposition.getZ()); blockposition = new BlockPosition(blockposition.getX(), 255, blockposition.getZ());
} }
+ if (!this.isLoaded(blockposition)) return 0; // Paper + if (!this.isLoaded(blockposition)) return 0; // Paper
Chunk chunk = this.getChunkAtWorldCoords(blockposition); return this.getChunkAtWorldCoords(blockposition).a(blockposition, i);
}
-- --

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Don't nest if we don't need to when cerealising text
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutChat.java b/src/main/java/net/minecraft/server/PacketPlayOutChat.java diff --git a/src/main/java/net/minecraft/server/PacketPlayOutChat.java b/src/main/java/net/minecraft/server/PacketPlayOutChat.java
index 67666d35b..5d1a49623 100644 index 28a262835..eba6aadad 100644
--- a/src/main/java/net/minecraft/server/PacketPlayOutChat.java --- a/src/main/java/net/minecraft/server/PacketPlayOutChat.java
+++ b/src/main/java/net/minecraft/server/PacketPlayOutChat.java +++ b/src/main/java/net/minecraft/server/PacketPlayOutChat.java
@@ -0,0 +0,0 @@ public class PacketPlayOutChat implements Packet<PacketListenerPlayOut> { @@ -0,0 +0,0 @@ public class PacketPlayOutChat implements Packet<PacketListenerPlayOut> {

View file

@ -5,27 +5,28 @@ Subject: [PATCH] Don't spam reload spawn chunks in nether/end
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 1189720de..ad422b24b 100644 index 9fdedc2d7..3bf2cb8d0 100644
--- a/src/main/java/net/minecraft/server/World.java --- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose
return this.P; return this.K;
} }
+ public boolean shouldStayLoaded(int i, int j) { return e(i, j); } // Paper - OBFHELPER + public boolean shouldStayLoaded(int i, int j) { return g(i, j); } // Paper - OBFHELPER
public boolean e(int i, int j) { public boolean g(int i, int j) {
BlockPosition blockposition = this.getSpawn(); BlockPosition blockposition = this.getSpawn();
int k = i * 16 + 8 - blockposition.getX(); int k = i * 16 + 8 - blockposition.getX();
diff --git a/src/main/java/net/minecraft/server/WorldProvider.java b/src/main/java/net/minecraft/server/WorldProvider.java diff --git a/src/main/java/net/minecraft/server/WorldProvider.java b/src/main/java/net/minecraft/server/WorldProvider.java
index d0265f960..35d8d1a6e 100644 index 6b62235e5..26ef3a41f 100644
--- a/src/main/java/net/minecraft/server/WorldProvider.java --- a/src/main/java/net/minecraft/server/WorldProvider.java
+++ b/src/main/java/net/minecraft/server/WorldProvider.java +++ b/src/main/java/net/minecraft/server/WorldProvider.java
@@ -0,0 +0,0 @@ public abstract class WorldProvider { @@ -0,0 +0,0 @@ public abstract class WorldProvider {
public void s() {} public void l() {}
public boolean c(int i, int j) { public boolean a(int i, int j) {
- return true; - return true;
+ return !this.b.shouldStayLoaded(i, j); // Paper - Use shouldStayLoaded check for all worlds + return !this.b.shouldStayLoaded(i, j); // Paper - Use shouldStayLoaded check for all worlds
} }
}
protected abstract void m();
-- --

View file

@ -7,10 +7,10 @@ Had some issue with this in past, and this is the vanilla logic.
Potentially an old CB change that's no longer needed. Potentially an old CB change that's no longer needed.
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index eb07d4233..e2202ed0c 100644 index c0367df20..c37c46e71 100644
--- a/src/main/java/net/minecraft/server/Entity.java --- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java
@@ -0,0 +0,0 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
} }
public Entity teleportTo(Location exit, boolean portal) { public Entity teleportTo(Location exit, boolean portal) {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Don't tick Skulls - unused code
diff --git a/src/main/java/net/minecraft/server/TileEntitySkull.java b/src/main/java/net/minecraft/server/TileEntitySkull.java diff --git a/src/main/java/net/minecraft/server/TileEntitySkull.java b/src/main/java/net/minecraft/server/TileEntitySkull.java
index a796c08ab..dd2665881 100644 index db4967f24..804236547 100644
--- a/src/main/java/net/minecraft/server/TileEntitySkull.java --- a/src/main/java/net/minecraft/server/TileEntitySkull.java
+++ b/src/main/java/net/minecraft/server/TileEntitySkull.java +++ b/src/main/java/net/minecraft/server/TileEntitySkull.java
@@ -0,0 +0,0 @@ import com.mojang.authlib.ProfileLookupCallback; @@ -0,0 +0,0 @@ import com.mojang.authlib.ProfileLookupCallback;
@ -15,6 +15,6 @@ index a796c08ab..dd2665881 100644
-public class TileEntitySkull extends TileEntity implements ITickable { -public class TileEntitySkull extends TileEntity implements ITickable {
+public class TileEntitySkull extends TileEntity /*implements ITickable*/ { // Paper - remove tickable +public class TileEntitySkull extends TileEntity /*implements ITickable*/ { // Paper - remove tickable
private int a; private GameProfile a;
public int rotation; private int e;
-- --

View file

@ -24,11 +24,11 @@ index 0094d1a87..4da846719 100644
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 4540bf9f9..d358ab26a 100644 index a5d0ae1de..12b86ab75 100644
--- a/src/main/java/net/minecraft/server/Entity.java --- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java
@@ -0,0 +0,0 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
return this.a(new ItemStack(item, i, 0), f); return this.a(itemstack, 0.0F);
} }
+ @Nullable public final EntityItem dropItem(ItemStack itemstack, float offset) { return this.a(itemstack, offset); } // Paper - OBFHELPER + @Nullable public final EntityItem dropItem(ItemStack itemstack, float offset) { return this.a(itemstack, offset); } // Paper - OBFHELPER
@ -36,7 +36,7 @@ index 4540bf9f9..d358ab26a 100644
public EntityItem a(ItemStack itemstack, float f) { public EntityItem a(ItemStack itemstack, float f) {
if (itemstack.isEmpty()) { if (itemstack.isEmpty()) {
diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java
index 579e51a0a..2ba5d51a5 100644 index 850436d42..7aa12c3b4 100644
--- a/src/main/java/net/minecraft/server/EntityFallingBlock.java --- a/src/main/java/net/minecraft/server/EntityFallingBlock.java
+++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java +++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java
@@ -0,0 +0,0 @@ public class EntityFallingBlock extends Entity { @@ -0,0 +0,0 @@ public class EntityFallingBlock extends Entity {
@ -56,9 +56,9 @@ index 579e51a0a..2ba5d51a5 100644
+ +
if (!this.world.isClientSide) { if (!this.world.isClientSide) {
blockposition = new BlockPosition(this); blockposition = new BlockPosition(this);
boolean flag = this.block.getBlock() == Blocks.dS; boolean flag = this.block.getBlock() instanceof BlockConcretePowder;
diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
index 44b2d4735..0d70dd1d2 100644 index 7edc02852..5ceb3f206 100644
--- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java --- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java
+++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java +++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
@@ -0,0 +0,0 @@ public class EntityTNTPrimed extends Entity { @@ -0,0 +0,0 @@ public class EntityTNTPrimed extends Entity {

View file

@ -14,7 +14,7 @@ big slowdown in execution but throwing an exception at same time to raise awaren
that it is happening so that plugin authors can fix their code to stop executing commands async. that it is happening so that plugin authors can fix their code to stop executing commands async.
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index da25a8bea..48379f414 100644 index 2adb21e55..27c255c8d 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java --- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
@ -48,7 +48,7 @@ index da25a8bea..48379f414 100644
} else if (this.player.getChatFlags() == EntityHuman.EnumChatVisibility.SYSTEM) { } else if (this.player.getChatFlags() == EntityHuman.EnumChatVisibility.SYSTEM) {
// Do nothing, this is coming from a plugin // Do nothing, this is coming from a plugin
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index bfddd1685..462ad1024 100644 index 2055bf7de..29344593a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -0,0 +0,0 @@ public final class CraftServer implements Server { @@ -0,0 +0,0 @@ public final class CraftServer implements Server {

View file

@ -5,11 +5,11 @@ Subject: [PATCH] Ensure inv drag is in bounds
diff --git a/src/main/java/net/minecraft/server/Container.java b/src/main/java/net/minecraft/server/Container.java diff --git a/src/main/java/net/minecraft/server/Container.java b/src/main/java/net/minecraft/server/Container.java
index 7d80b68b2..3a488ce20 100644 index e86ffb4dc..0bf14b671 100644
--- a/src/main/java/net/minecraft/server/Container.java --- a/src/main/java/net/minecraft/server/Container.java
+++ b/src/main/java/net/minecraft/server/Container.java +++ b/src/main/java/net/minecraft/server/Container.java
@@ -0,0 +0,0 @@ public abstract class Container { @@ -0,0 +0,0 @@ public abstract class Container {
this.d(); this.c();
} }
} else if (this.g == 1) { } else if (this.g == 1) {
- Slot slot = (Slot) this.slots.get(i); - Slot slot = (Slot) this.slots.get(i);

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Entity AddTo/RemoveFrom World Events
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 74ae80646..119cd0636 100644 index c9d0c22d5..e88baae1d 100644
--- a/src/main/java/net/minecraft/server/World.java --- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose
} }
entity.valid = true; // CraftBukkit entity.valid = true; // CraftBukkit
@ -16,8 +16,8 @@ index 74ae80646..119cd0636 100644
} }
protected void c(Entity entity) { protected void c(Entity entity) {
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose
((IWorldAccess) this.u.get(i)).b(entity); ((IWorldAccess) this.v.get(i)).b(entity);
} }
+ new com.destroystokyo.paper.event.entity.EntityRemoveFromWorldEvent(entity.getBukkitEntity()).callEvent(); // Paper - fire while valid + new com.destroystokyo.paper.event.entity.EntityRemoveFromWorldEvent(entity.getBukkitEntity()).callEvent(); // Paper - fire while valid

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Entity Origin API
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index d358ab26a..011cf59c0 100644 index 12b86ab75..2288df268 100644
--- a/src/main/java/net/minecraft/server/Entity.java --- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java
@@ -0,0 +0,0 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
public org.bukkit.projectiles.ProjectileSource projectileSource; // For projectiles only public org.bukkit.projectiles.ProjectileSource projectileSource; // For projectiles only
public boolean forceExplosionKnockback; // SPIGOT-949 public boolean forceExplosionKnockback; // SPIGOT-949
public Timing tickTimer = MinecraftTimings.getEntityTimings(this); // Paper public Timing tickTimer = MinecraftTimings.getEntityTimings(this); // Paper
@ -16,7 +16,7 @@ index d358ab26a..011cf59c0 100644
// Spigot start // Spigot start
public final byte activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this); public final byte activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this);
public final boolean defaultActivationState; public final boolean defaultActivationState;
@@ -0,0 +0,0 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
} }
} }
@ -28,7 +28,7 @@ index d358ab26a..011cf59c0 100644
return nbttagcompound; return nbttagcompound;
} catch (Throwable throwable) { } catch (Throwable throwable) {
CrashReport crashreport = CrashReport.a(throwable, "Saving entity NBT"); CrashReport crashreport = CrashReport.a(throwable, "Saving entity NBT");
@@ -0,0 +0,0 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
} }
// CraftBukkit end // CraftBukkit end
@ -42,7 +42,7 @@ index d358ab26a..011cf59c0 100644
} catch (Throwable throwable) { } catch (Throwable throwable) {
CrashReport crashreport = CrashReport.a(throwable, "Loading entity NBT"); CrashReport crashreport = CrashReport.a(throwable, "Loading entity NBT");
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Entity being loaded"); CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Entity being loaded");
@@ -0,0 +0,0 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
protected abstract void b(NBTTagCompound nbttagcompound); protected abstract void b(NBTTagCompound nbttagcompound);
@ -51,7 +51,7 @@ index d358ab26a..011cf59c0 100644
NBTTagList nbttaglist = new NBTTagList(); NBTTagList nbttaglist = new NBTTagList();
double[] adouble1 = adouble; double[] adouble1 = adouble;
diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java
index 2ba5d51a5..abdc2dea9 100644 index 7aa12c3b4..1d4a7b64d 100644
--- a/src/main/java/net/minecraft/server/EntityFallingBlock.java --- a/src/main/java/net/minecraft/server/EntityFallingBlock.java
+++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java +++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java
@@ -0,0 +0,0 @@ public class EntityFallingBlock extends Entity { @@ -0,0 +0,0 @@ public class EntityFallingBlock extends Entity {
@ -70,7 +70,7 @@ index 2ba5d51a5..abdc2dea9 100644
public void a(boolean flag) { public void a(boolean flag) {
diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
index 0d70dd1d2..bb0904f86 100644 index 5ceb3f206..87f3205f8 100644
--- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java --- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java
+++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java +++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
@@ -0,0 +0,0 @@ public class EntityTNTPrimed extends Entity { @@ -0,0 +0,0 @@ public class EntityTNTPrimed extends Entity {
@ -89,22 +89,22 @@ index 0d70dd1d2..bb0904f86 100644
@Nullable @Nullable
diff --git a/src/main/java/net/minecraft/server/NBTTagList.java b/src/main/java/net/minecraft/server/NBTTagList.java diff --git a/src/main/java/net/minecraft/server/NBTTagList.java b/src/main/java/net/minecraft/server/NBTTagList.java
index bc6383669..ca9eb2f3b 100644 index e56d4836d..0bf8d15d7 100644
--- a/src/main/java/net/minecraft/server/NBTTagList.java --- a/src/main/java/net/minecraft/server/NBTTagList.java
+++ b/src/main/java/net/minecraft/server/NBTTagList.java +++ b/src/main/java/net/minecraft/server/NBTTagList.java
@@ -0,0 +0,0 @@ public class NBTTagList extends NBTBase { @@ -0,0 +0,0 @@ public class NBTTagList extends NBTList<NBTBase> {
return new int[0]; return new int[0];
} }
+ public final double getDoubleAt(int i) { return this.f(i); } // Paper - OBFHELPER + public final double getDoubleAt(int i) { return this.k(i); } // Paper - OBFHELPER
public double f(int i) { public double k(int i) {
if (i >= 0 && i < this.list.size()) { if (i >= 0 && i < this.list.size()) {
NBTBase nbtbase = (NBTBase) this.list.get(i); NBTBase nbtbase = (NBTBase) this.list.get(i);
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 26d4bd690..31b765dea 100644 index fd64b75ed..3f0b6ac26 100644
--- a/src/main/java/net/minecraft/server/World.java --- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose
int j = MathHelper.floor(entity.locZ / 16.0D); int j = MathHelper.floor(entity.locZ / 16.0D);
boolean flag = entity.attachedToPlayer; boolean flag = entity.attachedToPlayer;
@ -118,7 +118,7 @@ index 26d4bd690..31b765dea 100644
flag = true; flag = true;
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 833e3111d..6c23e88a5 100644 index 1e3675e4f..0daa15f1b 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -0,0 +0,0 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -0,0 +0,0 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {

View file

@ -6,7 +6,7 @@ Subject: [PATCH] EntityPathfindEvent
Fires when an Entity decides to start moving to a location. Fires when an Entity decides to start moving to a location.
diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java
index cc44d30b5..3ac6f84d3 100644 index 1964684ac..0c5215657 100644
--- a/src/main/java/net/minecraft/server/NavigationAbstract.java --- a/src/main/java/net/minecraft/server/NavigationAbstract.java
+++ b/src/main/java/net/minecraft/server/NavigationAbstract.java +++ b/src/main/java/net/minecraft/server/NavigationAbstract.java
@@ -0,0 +0,0 @@ import javax.annotation.Nullable; @@ -0,0 +0,0 @@ import javax.annotation.Nullable;
@ -24,7 +24,7 @@ index cc44d30b5..3ac6f84d3 100644
} else { } else {
+ if (!new com.destroystokyo.paper.event.entity.EntityPathfindEvent(getEntity().getBukkitEntity(), MCUtil.toLocation(getEntity().world, blockposition), null).callEvent()) { return null; } // Paper + if (!new com.destroystokyo.paper.event.entity.EntityPathfindEvent(getEntity().getBukkitEntity(), MCUtil.toLocation(getEntity().world, blockposition), null).callEvent()) { return null; } // Paper
this.q = blockposition; this.q = blockposition;
float f = this.i(); float f = this.k();
@@ -0,0 +0,0 @@ public abstract class NavigationAbstract { @@ -0,0 +0,0 @@ public abstract class NavigationAbstract {
if (this.c != null && !this.c.b() && blockposition.equals(this.q)) { if (this.c != null && !this.c.b() && blockposition.equals(this.q)) {
@ -32,6 +32,6 @@ index cc44d30b5..3ac6f84d3 100644
} else { } else {
+ if (!new com.destroystokyo.paper.event.entity.EntityPathfindEvent(getEntity().getBukkitEntity(), MCUtil.toLocation(entity.world, blockposition), entity.getBukkitEntity()).callEvent()) { return null; } // Paper + if (!new com.destroystokyo.paper.event.entity.EntityPathfindEvent(getEntity().getBukkitEntity(), MCUtil.toLocation(entity.world, blockposition), entity.getBukkitEntity()).callEvent()) { return null; } // Paper
this.q = blockposition; this.q = blockposition;
float f = this.i(); float f = this.k();
-- --

View file

@ -6,7 +6,7 @@ Subject: [PATCH] EntityRegainHealthEvent isFastRegen API
Don't even get me started Don't even get me started
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index a92b89d7c..4b6bb38ae 100644 index acf0e0281..b12c9e461 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java --- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity { @@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
@ -28,7 +28,7 @@ index a92b89d7c..4b6bb38ae 100644
if (!event.isCancelled()) { if (!event.isCancelled()) {
diff --git a/src/main/java/net/minecraft/server/FoodMetaData.java b/src/main/java/net/minecraft/server/FoodMetaData.java diff --git a/src/main/java/net/minecraft/server/FoodMetaData.java b/src/main/java/net/minecraft/server/FoodMetaData.java
index d42db9b45..c715138ee 100644 index bbcc488bd..d886e476b 100644
--- a/src/main/java/net/minecraft/server/FoodMetaData.java --- a/src/main/java/net/minecraft/server/FoodMetaData.java
+++ b/src/main/java/net/minecraft/server/FoodMetaData.java +++ b/src/main/java/net/minecraft/server/FoodMetaData.java
@@ -0,0 +0,0 @@ public class FoodMetaData { @@ -0,0 +0,0 @@ public class FoodMetaData {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Expose server CommandMap
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 462ad1024..1386bed52 100644 index 29344593a..32a05ca18 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -0,0 +0,0 @@ public final class CraftServer implements Server { @@ -0,0 +0,0 @@ public final class CraftServer implements Server {

View file

@ -1,111 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net>
Date: Wed, 2 Mar 2016 12:20:52 -0600
Subject: [PATCH] Fast draining
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 15675efbf..dbd82d5a9 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
optimizeExplosions = getBoolean("optimize-explosions", false);
log("Optimize explosions: " + optimizeExplosions);
}
+
+ public boolean fastDrainLava;
+ public boolean fastDrainWater;
+ private void fastDrain() {
+ fastDrainLava = getBoolean("fast-drain.lava", false);
+ fastDrainWater = getBoolean("fast-drain.water", false);
+ }
}
diff --git a/src/main/java/net/minecraft/server/BlockFlowing.java b/src/main/java/net/minecraft/server/BlockFlowing.java
index 3b47253a4..3aaa19b2f 100644
--- a/src/main/java/net/minecraft/server/BlockFlowing.java
+++ b/src/main/java/net/minecraft/server/BlockFlowing.java
@@ -0,0 +0,0 @@ public class BlockFlowing extends BlockFluids {
}
}
- if (this.material == Material.LAVA && i < 8 && i1 < 8 && i1 > i && random.nextInt(4) != 0) {
+ if (!world.paperConfig.fastDrainLava && this.material == Material.LAVA && i < 8 && i1 < 8 && i1 > i && random.nextInt(4) != 0) { // Paper
j *= 4;
}
@@ -0,0 +0,0 @@ public class BlockFlowing extends BlockFluids {
this.f(world, blockposition, iblockdata);
} else {
i = i1;
- if (i1 < 0) {
+ if (i1 < 0 || canFastDrain(world, blockposition)) { // Paper - Fast draining
world.setAir(blockposition);
} else {
iblockdata = iblockdata.set(BlockFlowing.LEVEL, Integer.valueOf(i1));
@@ -0,0 +0,0 @@ public class BlockFlowing extends BlockFluids {
}
+ // Paper start
/**
* Paper - Get flow speed. Throttle if its water and flowing adjacent to lava
*/
@@ -0,0 +0,0 @@ public class BlockFlowing extends BlockFluids {
}
return super.a(world);
}
+
+ private int getFluidLevel(IBlockAccess iblockaccess, BlockPosition blockposition) {
+ return iblockaccess.getType(blockposition).getMaterial() == this.material ? iblockaccess.getType(blockposition).get(BlockFluids.LEVEL) : -1;
+ }
+
+ /**
+ * Paper - Data check method for fast draining
+ */
+ public int getData(World world, BlockPosition position) {
+ int data = this.getFluidLevel((IBlockAccess) world, position);
+ return data < 8 ? data : 0;
+ }
+
+ /**
+ * Paper - Checks surrounding blocks to determine if block can be fast drained
+ */
+ public boolean canFastDrain(World world, BlockPosition position) {
+ boolean result = false;
+ int data = getData(world, position);
+ if (this.material == Material.WATER) {
+ if (world.paperConfig.fastDrainWater) {
+ result = true;
+ if (getData(world, position.down()) < 0) {
+ result = false;
+ } else if (world.getType(position.north()).getBlock().getBlockData().getMaterial() == Material.WATER && getData(world, position.north()) < data) {
+ result = false;
+ } else if (world.getType(position.south()).getBlock().getBlockData().getMaterial() == Material.WATER && getData(world, position.south()) < data) {
+ result = false;
+ } else if (world.getType(position.west()).getBlock().getBlockData().getMaterial() == Material.WATER && getData(world, position.west()) < data) {
+ result = false;
+ } else if (world.getType(position.east()).getBlock().getBlockData().getMaterial() == Material.WATER && getData(world, position.east()) < data) {
+ result = false;
+ }
+ }
+ } else if (this.material == Material.LAVA) {
+ if (world.paperConfig.fastDrainLava) {
+ result = true;
+ if (getData(world, position.down()) < 0 || world.getType(position.up()).getBlock().getBlockData().getMaterial() != Material.AIR) {
+ result = false;
+ } else if (world.getType(position.north()).getBlock().getBlockData().getMaterial() == Material.LAVA && getData(world, position.north()) < data) {
+ result = false;
+ } else if (world.getType(position.south()).getBlock().getBlockData().getMaterial() == Material.LAVA && getData(world, position.south()) < data) {
+ result = false;
+ } else if (world.getType(position.west()).getBlock().getBlockData().getMaterial() == Material.LAVA && getData(world, position.west()) < data) {
+ result = false;
+ } else if (world.getType(position.east()).getBlock().getBlockData().getMaterial() == Material.LAVA && getData(world, position.east()) < data) {
+ result = false;
+ }
+ }
+ }
+ return result;
+ }
+ // Paper end
}
--

View file

@ -5,13 +5,13 @@ Subject: [PATCH] Fix Cancelling BlockPlaceEvent triggering physics
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 671927d5c..1189720de 100644 index d15afd595..9fdedc2d7 100644
--- a/src/main/java/net/minecraft/server/World.java --- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose
} }
public void applyPhysics(BlockPosition blockposition, Block block, boolean flag) { public void applyPhysics(BlockPosition blockposition, Block block) {
+ if (captureBlockStates) { return; } // Paper - Cancel all physics during placement + if (captureBlockStates) { return; } // Paper - Cancel all physics during placement
this.a(blockposition.west(), block, blockposition); this.a(blockposition.west(), block, blockposition);
this.a(blockposition.east(), block, blockposition); this.a(blockposition.east(), block, blockposition);

View file

@ -9,16 +9,16 @@ cook in the expected amount of time as the cook time was not decremented correct
This patch ensures that furnaces cook to the correct wall time expectation. This patch ensures that furnaces cook to the correct wall time expectation.
diff --git a/src/main/java/net/minecraft/server/TileEntityFurnace.java b/src/main/java/net/minecraft/server/TileEntityFurnace.java diff --git a/src/main/java/net/minecraft/server/TileEntityFurnace.java b/src/main/java/net/minecraft/server/TileEntityFurnace.java
index 886a73e93..7a1428105 100644 index 8f9a59693..3a587a766 100644
--- a/src/main/java/net/minecraft/server/TileEntityFurnace.java --- a/src/main/java/net/minecraft/server/TileEntityFurnace.java
+++ b/src/main/java/net/minecraft/server/TileEntityFurnace.java +++ b/src/main/java/net/minecraft/server/TileEntityFurnace.java
@@ -0,0 +0,0 @@ public class TileEntityFurnace extends TileEntityContainer implements ITickable, @@ -0,0 +0,0 @@ public class TileEntityFurnace extends TileEntityContainer implements IWorldInve
if (this.isBurning() && this.canBurn()) { if (this.isBurning() && this.canBurn(irecipe)) {
this.cookTime += elapsedTicks; this.cookTime += elapsedTicks;
if (this.cookTime >= this.cookTimeTotal) { if (this.cookTime >= this.cookTimeTotal) {
- this.cookTime = 0; - this.cookTime = 0;
+ this.cookTime -= this.cookTimeTotal; // Paper + this.cookTime -= this.cookTimeTotal; // Paper
this.cookTimeTotal = this.a((ItemStack) this.items.get(0)); this.cookTimeTotal = this.s();
this.burn(); this.burn(irecipe);
flag1 = true; flag1 = true;
-- --

View file

@ -1,20 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jedediah Smith <jedediah@silencegreys.com>
Date: Tue, 1 Mar 2016 04:32:08 -0500
Subject: [PATCH] Fix cooked fish legacy import
diff --git a/src/main/java/net/minecraft/server/DataConverterMaterialId.java b/src/main/java/net/minecraft/server/DataConverterMaterialId.java
index 87b82eb35..a7c71f406 100644
--- a/src/main/java/net/minecraft/server/DataConverterMaterialId.java
+++ b/src/main/java/net/minecraft/server/DataConverterMaterialId.java
@@ -0,0 +0,0 @@ public class DataConverterMaterialId implements IDataConverter {
DataConverterMaterialId.a[347] = "minecraft:clock";
DataConverterMaterialId.a[348] = "minecraft:glowstone_dust";
DataConverterMaterialId.a[349] = "minecraft:fish";
- DataConverterMaterialId.a[350] = "minecraft:cooked_fished";
+ DataConverterMaterialId.a[350] = "minecraft:cooked_fish"; // Paper - cooked_fished -> cooked_fish
DataConverterMaterialId.a[351] = "minecraft:dye";
DataConverterMaterialId.a[352] = "minecraft:bone";
DataConverterMaterialId.a[353] = "minecraft:sugar";
--

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Fix lag from explosions processing dead entities
diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java
index 98c2bdcf7..a1ebcf858 100644 index 37e6e5922..e30219258 100644
--- a/src/main/java/net/minecraft/server/Explosion.java --- a/src/main/java/net/minecraft/server/Explosion.java
+++ b/src/main/java/net/minecraft/server/Explosion.java +++ b/src/main/java/net/minecraft/server/Explosion.java
@@ -0,0 +0,0 @@ public class Explosion { @@ -0,0 +0,0 @@ public class Explosion {

Some files were not shown because too many files have changed in this diff Show more