Updated Upstream (CraftBukkit/Spigot)

Doesn't compile yet.

CraftBukkit Changes:
90d6905b Repackage NMS
69cf961d Repackage patches

Spigot Changes:
79d53c28 Repackage NMS
This commit is contained in:
jmp 2021-03-16 00:19:45 -07:00 committed by Mariell Hoversholm
parent b28d461145
commit 1718f61bf8
612 changed files with 15496 additions and 15660 deletions

View File

@ -5,7 +5,7 @@ Subject: [PATCH] POM Changes
diff --git a/pom.xml b/pom.xml
index 8b6cb74b255017dced20347c9fd97bbf4d834f9e..b89112912a5b70fb0d77645e4b140f3ee6e6c55a 100644
index a31f1513a90c753deba35320a6698a933bc9782f..2559c83c1b811177ade56537aeab1982ac53ee67 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,15 +1,14 @@
@ -186,7 +186,7 @@ index 8b6cb74b255017dced20347c9fd97bbf4d834f9e..b89112912a5b70fb0d77645e4b140f3e
<relocation>
<pattern>org.apache.commons.codec</pattern>
<shadedPattern>org.bukkit.craftbukkit.libs.org.apache.commons.codec</shadedPattern>
@@ -252,10 +268,6 @@
@@ -258,10 +274,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>

View File

@ -7,7 +7,7 @@ Loads each yml file for early init too so it can be used for early options
diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java
new file mode 100644
index 0000000000000000000000000000000000000000..ed7e4220199f9c57d0ffe67f552027c0bade3af1
index 0000000000000000000000000000000000000000..68cd4134cb6a00c1768100462f8e9e94f3fa6279
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java
@@ -0,0 +1,286 @@
@ -19,13 +19,13 @@ index 0000000000000000000000000000000000000000..ed7e4220199f9c57d0ffe67f552027c0
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import net.minecraft.server.ChunkCoordIntPair;
+import net.minecraft.server.ChunkProviderServer;
+import net.minecraft.server.Entity;
+import net.minecraft.server.EntityTypes;
+import net.minecraft.server.MinecraftKey;
+import net.minecraft.resources.MinecraftKey;
+import net.minecraft.server.MinecraftServer;
+import net.minecraft.server.WorldServer;
+import net.minecraft.server.level.ChunkProviderServer;
+import net.minecraft.server.level.WorldServer;
+import net.minecraft.world.entity.Entity;
+import net.minecraft.world.entity.EntityTypes;
+import net.minecraft.world.level.ChunkCoordIntPair;
+import org.apache.commons.lang3.tuple.MutablePair;
+import org.apache.commons.lang3.tuple.Pair;
+import org.bukkit.Bukkit;
@ -562,78 +562,11 @@ index 0000000000000000000000000000000000000000..b31109d2dadd29e8852468c19265066b
+ return config.getString("world-settings." + worldName + "." + path, config.getString("world-settings.default." + path));
+ }
+}
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index d1051f05933be093fa598504e169e5cfdaa1b0e3..056e1fced00dff1d6507a90c13f2448a04ca0558 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -281,15 +281,15 @@ public class ChunkProviderServer extends IChunkProvider {
}
}
- @Override
- public boolean a(Entity entity) {
+ public final boolean isInEntityTickingChunk(Entity entity) { return this.a(entity); } // Paper - OBFHELPER
+ @Override public boolean a(Entity entity) {
long i = ChunkCoordIntPair.pair(MathHelper.floor(entity.locX()) >> 4, MathHelper.floor(entity.locZ()) >> 4);
return this.a(i, (Function<PlayerChunk, CompletableFuture<Either<Chunk, PlayerChunk.Failure>>>) PlayerChunk::b); // CraftBukkit - decompile error
}
- @Override
- public boolean a(ChunkCoordIntPair chunkcoordintpair) {
+ public final boolean isEntityTickingChunk(ChunkCoordIntPair chunkcoordintpair) { return this.a(chunkcoordintpair); } // Paper - OBFHELPER
+ @Override public boolean a(ChunkCoordIntPair chunkcoordintpair) {
return this.a(chunkcoordintpair.pair(), (Function<PlayerChunk, CompletableFuture<Either<Chunk, PlayerChunk.Failure>>>) PlayerChunk::b); // CraftBukkit - decompile error
}
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
index bb06a7e3f3f9e4740cf6b874586e44f479d99cc4..d91b029c95b6380300db81e7c0fb172ff57958a1 100644
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
@@ -148,6 +148,15 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
org.spigotmc.SpigotConfig.init((java.io.File) options.valueOf("spigot-settings"));
org.spigotmc.SpigotConfig.registerCommands();
// Spigot end
+ // Paper start
+ try {
+ com.destroystokyo.paper.PaperConfig.init((java.io.File) options.valueOf("paper-settings"));
+ } catch (Exception e) {
+ DedicatedServer.LOGGER.error("Unable to load server configuration", e);
+ return false;
+ }
+ com.destroystokyo.paper.PaperConfig.registerCommands();
+ // Paper end
this.setPVP(dedicatedserverproperties.pvp);
this.setAllowFlight(dedicatedserverproperties.allowFlight);
diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java
index 18f510c2be4f6630c25b3f404234f3843ece817b..a314ed0106cbf4359dd1920bb4b3c6095b2550ee 100644
--- a/src/main/java/net/minecraft/server/EntityTypes.java
+++ b/src/main/java/net/minecraft/server/EntityTypes.java
@@ -2,6 +2,7 @@ package net.minecraft.server;
import com.google.common.collect.ImmutableSet;
import java.util.Optional;
+import java.util.Set; // Paper
import java.util.UUID;
import java.util.function.Function;
import java.util.stream.Stream;
@@ -469,4 +470,10 @@ public class EntityTypes<T extends Entity> {
return new EntityTypes<>(this.a, this.b, this.d, this.e, this.f, this.g, this.c, this.j, this.h, this.i);
}
}
+
+ // Paper start
+ public static Set<MinecraftKey> getEntityNameList() {
+ return IRegistry.ENTITY_TYPE.keySet();
+ }
+ // Paper end
}
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index 6d1012cc652780189a5d849125abe09b27b88422..d8c8bf2466be362b424fde611fe42b73fea42ef9 100644
index b746e30e6fc5ea0c17465b510d737316f1ab7004..89db31061fcc3420bc8e668533a4051cdbd12253 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
@@ -64,6 +64,12 @@ public class Main {
@@ -103,6 +103,12 @@ public class Main {
DedicatedServerSettings dedicatedserversettings = new DedicatedServerSettings(iregistrycustom_dimension, optionset); // CraftBukkit - CLI argument support
dedicatedserversettings.save();
@ -646,7 +579,7 @@ index 6d1012cc652780189a5d849125abe09b27b88422..d8c8bf2466be362b424fde611fe42b73
java.nio.file.Path java_nio_file_path1 = Paths.get("eula.txt");
EULA eula = new EULA(java_nio_file_path1);
@@ -205,6 +211,20 @@ public class Main {
@@ -244,6 +250,20 @@ public class Main {
}
@ -667,11 +600,78 @@ index 6d1012cc652780189a5d849125abe09b27b88422..d8c8bf2466be362b424fde611fe42b73
public static void convertWorld(Convertable.ConversionSession convertable_conversionsession, DataFixer datafixer, boolean flag, BooleanSupplier booleansupplier, ImmutableSet<ResourceKey<DimensionManager>> immutableset) { // CraftBukkit
Main.LOGGER.info("Forcing world upgrade! {}", convertable_conversionsession.getLevelName()); // CraftBukkit
WorldUpgrader worldupgrader = new WorldUpgrader(convertable_conversionsession, datafixer, immutableset, flag);
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 4c5683bcb45ea500adb0775fc81f296bb2583f80..1606a7b4727fffef27d6bb08633b652b7e7fe588 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -77,6 +77,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index d5628a0197125506f7aaeb89bab7bd8a811b3ad5..8e2e415a022ccd486465f19d9bbf1f287b21fb95 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -187,6 +187,15 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
org.spigotmc.SpigotConfig.init((java.io.File) options.valueOf("spigot-settings"));
org.spigotmc.SpigotConfig.registerCommands();
// Spigot end
+ // Paper start
+ try {
+ com.destroystokyo.paper.PaperConfig.init((java.io.File) options.valueOf("paper-settings"));
+ } catch (Exception e) {
+ DedicatedServer.LOGGER.error("Unable to load server configuration", e);
+ return false;
+ }
+ com.destroystokyo.paper.PaperConfig.registerCommands();
+ // Paper end
this.setPVP(dedicatedserverproperties.pvp);
this.setAllowFlight(dedicatedserverproperties.allowFlight);
diff --git a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
index e95f516756b2613972f20636443b3ff753342917..7fd6893c30fbb34367181620aa159ed79b803455 100644
--- a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
@@ -306,15 +306,15 @@ public class ChunkProviderServer extends IChunkProvider {
}
}
- @Override
- public boolean a(Entity entity) {
+ public final boolean isInEntityTickingChunk(Entity entity) { return this.a(entity); } // Paper - OBFHELPER
+ @Override public boolean a(Entity entity) {
long i = ChunkCoordIntPair.pair(MathHelper.floor(entity.locX()) >> 4, MathHelper.floor(entity.locZ()) >> 4);
return this.a(i, (Function<PlayerChunk, CompletableFuture<Either<Chunk, PlayerChunk.Failure>>>) PlayerChunk::b); // CraftBukkit - decompile error
}
- @Override
- public boolean a(ChunkCoordIntPair chunkcoordintpair) {
+ public final boolean isEntityTickingChunk(ChunkCoordIntPair chunkcoordintpair) { return this.a(chunkcoordintpair); } // Paper - OBFHELPER
+ @Override public boolean a(ChunkCoordIntPair chunkcoordintpair) {
return this.a(chunkcoordintpair.pair(), (Function<PlayerChunk, CompletableFuture<Either<Chunk, PlayerChunk.Failure>>>) PlayerChunk::b); // CraftBukkit - decompile error
}
diff --git a/src/main/java/net/minecraft/world/entity/EntityTypes.java b/src/main/java/net/minecraft/world/entity/EntityTypes.java
index 4b0b782ab19a6cea4412b5e9d8c0524aee1402e4..a32bc63ff1960bdb874d546ee42633063834da24 100644
--- a/src/main/java/net/minecraft/world/entity/EntityTypes.java
+++ b/src/main/java/net/minecraft/world/entity/EntityTypes.java
@@ -2,6 +2,7 @@ package net.minecraft.world.entity;
import com.google.common.collect.ImmutableSet;
import java.util.Optional;
+import java.util.Set; // Paper
import java.util.UUID;
import java.util.function.Function;
import java.util.stream.Stream;
@@ -599,4 +600,10 @@ public class EntityTypes<T extends Entity> {
return new EntityTypes<>(this.a, this.b, this.d, this.e, this.f, this.g, this.c, this.j, this.h, this.i);
}
}
+
+ // Paper start
+ public static Set<MinecraftKey> getEntityNameList() {
+ return IRegistry.ENTITY_TYPE.keySet();
+ }
+ // Paper end
}
diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java
index 344b7f52e85af3e543da0bb1dd14b68eb41ebb84..f794113e7cc5809d1da0c85648fb7311fb633f40 100644
--- a/src/main/java/net/minecraft/world/level/World.java
+++ b/src/main/java/net/minecraft/world/level/World.java
@@ -129,6 +129,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
public boolean populating;
public final org.spigotmc.SpigotWorldConfig spigotConfig; // Spigot
@ -680,16 +680,16 @@ index 4c5683bcb45ea500adb0775fc81f296bb2583f80..1606a7b4727fffef27d6bb08633b652b
public final SpigotTimings.WorldTimingsHandler timings; // Spigot
public static BlockPosition lastPhysicsProblem; // Spigot
private org.spigotmc.TickLimiter entityLimiter;
@@ -97,6 +99,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@@ -149,6 +151,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
protected World(WorldDataMutable worlddatamutable, ResourceKey<World> resourcekey, final DimensionManager dimensionmanager, Supplier<GameProfilerFiller> supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.World.Environment env) {
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((WorldDataServer) worlddatamutable).getName()); // Spigot
+ this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig(((WorldDataServer) worlddatamutable).getName(), this.spigotConfig); // Paper
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.WorldDataServer) worlddatamutable).getName()); // Spigot
+ this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig(((net.minecraft.world.level.storage.WorldDataServer) worlddatamutable).getName(), this.spigotConfig); // Paper
this.generator = gen;
this.world = new CraftWorld((WorldServer) this, gen, env);
this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 7c52aa2eabbf1eb09a3749f71fdaf2430e75a225..9b3f9b11abe89cabb3044766dda60a8842c149f4 100644
index 20a5e136a8967311026111b4c246c200596cd019..bd62288b6951c6b5962497a3c93989cab5d66ad4 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -808,6 +808,7 @@ public final class CraftServer implements Server {

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Add MinecraftKey Information to Objects
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 ed7e4220199f9c57d0ffe67f552027c0bade3af1..411aebed946991b899205fcc1fcf7f3bf83718c0 100644
index 68cd4134cb6a00c1768100462f8e9e94f3fa6279..6943524c2dd8b12691b8ac5b08daee823ce50c3d 100644
--- a/src/main/java/com/destroystokyo/paper/PaperCommand.java
+++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java
@@ -208,7 +208,7 @@ public class PaperCommand extends Command {
@ -18,20 +18,37 @@ index ed7e4220199f9c57d0ffe67f552027c0bade3af1..411aebed946991b899205fcc1fcf7f3b
MutablePair<Integer, Map<ChunkCoordIntPair, Integer>> info = list.computeIfAbsent(key, k -> MutablePair.of(0, Maps.newHashMap()));
ChunkCoordIntPair chunk = new ChunkCoordIntPair(e.chunkX, e.chunkZ);
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index f2fb9e661b6c2d87348c9144d32e568cc6ada5dc..b8267cf23f795fd7e586b0e567037eae5048d08e 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -51,7 +51,7 @@ import org.bukkit.event.player.PlayerTeleportEvent;
diff --git a/src/main/java/net/minecraft/server/KeyedObject.java b/src/main/java/net/minecraft/server/KeyedObject.java
new file mode 100644
index 0000000000000000000000000000000000000000..500477f0d98a277145c2b0dbb4d1496e2a588542
--- /dev/null
+++ b/src/main/java/net/minecraft/server/KeyedObject.java
@@ -0,0 +1,11 @@
+package net.minecraft.server;
+
+import net.minecraft.resources.MinecraftKey;
+
+public interface KeyedObject {
+ MinecraftKey getMinecraftKey();
+ default String getMinecraftKeyString() {
+ MinecraftKey key = getMinecraftKey();
+ return key != null ? key.toString() : null;
+ }
+}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 3c8767d5fab575e61ca179b517f0bff1a38405ce..ec553e7d7595ef3652bfa3325a07483bb3c32245 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -136,7 +136,7 @@ import org.bukkit.event.player.PlayerTeleportEvent;
import org.bukkit.plugin.PluginManager;
// CraftBukkit end
-public abstract class Entity implements INamableTileEntity, ICommandListener {
+public abstract class Entity implements INamableTileEntity, ICommandListener, KeyedObject { // Paper
+public abstract class Entity implements INamableTileEntity, ICommandListener, net.minecraft.server.KeyedObject { // Paper
// CraftBukkit start
private static final int CURRENT_LEVEL = 2;
@@ -1677,12 +1677,31 @@ public abstract class Entity implements INamableTileEntity, ICommandListener {
@@ -1762,12 +1762,31 @@ public abstract class Entity implements INamableTileEntity, ICommandListener {
return true;
}
@ -64,11 +81,11 @@ index f2fb9e661b6c2d87348c9144d32e568cc6ada5dc..b8267cf23f795fd7e586b0e567037eae
}
protected abstract void loadData(NBTTagCompound nbttagcompound);
diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java
index ef2a276fa2bdcac789e2f195a9d06ecce38daa45..9946985407561596c6c364526d2fe7477771303a 100644
--- a/src/main/java/net/minecraft/server/EntityTypes.java
+++ b/src/main/java/net/minecraft/server/EntityTypes.java
@@ -254,6 +254,7 @@ public class EntityTypes<T extends Entity> {
diff --git a/src/main/java/net/minecraft/world/entity/EntityTypes.java b/src/main/java/net/minecraft/world/entity/EntityTypes.java
index ac57ab9992e141c91cf48f033148ad78433b364c..dc92b112770955f9fa49a408262da2e5bbc4bf98 100644
--- a/src/main/java/net/minecraft/world/entity/EntityTypes.java
+++ b/src/main/java/net/minecraft/world/entity/EntityTypes.java
@@ -384,6 +384,7 @@ public class EntityTypes<T extends Entity> {
}
}
@ -76,35 +93,20 @@ index ef2a276fa2bdcac789e2f195a9d06ecce38daa45..9946985407561596c6c364526d2fe747
public boolean a() {
return this.bi;
}
diff --git a/src/main/java/net/minecraft/server/KeyedObject.java b/src/main/java/net/minecraft/server/KeyedObject.java
new file mode 100644
index 0000000000000000000000000000000000000000..743142d0303fa25fe48a2abb07040d1228d04402
--- /dev/null
+++ b/src/main/java/net/minecraft/server/KeyedObject.java
@@ -0,0 +1,9 @@
+package net.minecraft.server;
+
+public interface KeyedObject {
+ MinecraftKey getMinecraftKey();
+ default String getMinecraftKeyString() {
+ MinecraftKey key = getMinecraftKey();
+ return key != null ? key.toString() : null;
+ }
+}
diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java
index 134c7a9567c97ecf206b272a0e0a28a8a7534009..c80f964aef02ac6edd0dcf9f4af9f849e8ac3da9 100644
--- a/src/main/java/net/minecraft/server/TileEntity.java
+++ b/src/main/java/net/minecraft/server/TileEntity.java
@@ -13,7 +13,7 @@ import org.bukkit.inventory.InventoryHolder;
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntity.java
index 72d43b38de3e797a509de6591874af12fa7b9ec0..2b58ae6d91fe0d0f36eedbb78a3c8a8a66d92405 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntity.java
@@ -23,7 +23,7 @@ import org.bukkit.inventory.InventoryHolder;
import org.spigotmc.CustomTimingsHandler; // Spigot
-public abstract class TileEntity {
+public abstract class TileEntity implements KeyedObject { // Paper
+public abstract class TileEntity implements net.minecraft.server.KeyedObject { // Paper
public CustomTimingsHandler tickTimer = org.bukkit.craftbukkit.SpigotTimings.getTileEntityTimings(this); // Spigot
// CraftBukkit start - data containers
@@ -21,7 +21,7 @@ public abstract class TileEntity {
@@ -31,7 +31,7 @@ public abstract class TileEntity {
public CraftPersistentDataContainer persistentDataContainer;
// CraftBukkit end
private static final Logger LOGGER = LogManager.getLogger();
@ -113,7 +115,7 @@ index 134c7a9567c97ecf206b272a0e0a28a8a7534009..c80f964aef02ac6edd0dcf9f4af9f849
@Nullable
protected World world;
protected BlockPosition position;
@@ -35,6 +35,26 @@ public abstract class TileEntity {
@@ -45,6 +45,26 @@ public abstract class TileEntity {
this.tileType = tileentitytypes;
}

View File

@ -7,11 +7,68 @@ Subject: [PATCH] Store reference to current Chunk for Entity and Block
This enables us a fast reference to the entities current chunk instead
of having to look it up by hashmap lookups.
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index c8ff99ef5c7574292ee66a4aec45d1550eab1624..7c5f79124d2f2c69548263e79752484e07e77d48 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -56,11 +56,36 @@ public class Chunk implements IChunkAccess {
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index ec553e7d7595ef3652bfa3325a07483bb3c32245..9af9d9463e9b50f8a627ffd79dcd3716c506f7e7 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -261,7 +261,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
}
public boolean isChunkLoaded() {
- return world.isChunkLoaded((int) Math.floor(this.locX()) >> 4, (int) Math.floor(this.locZ()) >> 4);
+ return getCurrentChunk() != null;
}
// CraftBukkit end
@@ -1763,6 +1763,23 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
}
// Paper start
+ java.lang.ref.WeakReference<net.minecraft.world.level.chunk.Chunk> currentChunk = null;
+
+ public void setCurrentChunk(net.minecraft.world.level.chunk.Chunk chunk) {
+ this.currentChunk = chunk != null ? new java.lang.ref.WeakReference<>(chunk) : null;
+ }
+ /**
+ * Returns the entities current registered chunk. If the entity is not added to a chunk yet, it will return null
+ */
+ public net.minecraft.world.level.chunk.Chunk getCurrentChunk() {
+ final net.minecraft.world.level.chunk.Chunk chunk = currentChunk != null ? currentChunk.get() : null;
+ if (chunk != null && chunk.loaded) {
+ return chunk;
+ }
+
+ return !inChunk ? null : ((WorldServer)world).getChunkProvider().getChunkAtIfLoadedMainThreadNoCache(chunkX, chunkZ);
+ }
+
private MinecraftKey entityKey;
private String entityKeyString;
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntity.java
index 2b58ae6d91fe0d0f36eedbb78a3c8a8a66d92405..8300bb425f7fc3fa8a5a8832a0bb432a2947793b 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntity.java
@@ -63,6 +63,15 @@ public abstract class TileEntity implements net.minecraft.server.KeyedObject { /
getMinecraftKey(); // Try to load if it doesn't exists.
return tileEntityKeyString;
}
+
+ private java.lang.ref.WeakReference<Chunk> currentChunk = null;
+ public Chunk getCurrentChunk() {
+ final Chunk chunk = currentChunk != null ? currentChunk.get() : null;
+ return chunk != null && chunk.loaded ? chunk : null;
+ }
+ public void setCurrentChunk(Chunk chunk) {
+ this.currentChunk = chunk != null ? new java.lang.ref.WeakReference<>(chunk) : null;
+ }
// Paper end
@Nullable
diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
index b15200c2a3923bd8be2ee5e73fdadfeea3e3a8dc..929f6fcd4b9f1b9a1488e170d6a77a5d64beecf3 100644
--- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
@@ -90,11 +90,36 @@ public class Chunk implements IChunkAccess {
this(world, chunkcoordintpair, biomestorage, ChunkConverter.a, TickListEmpty.b(), TickListEmpty.b(), 0L, (ChunkSection[]) null, (Consumer) null);
}
@ -49,7 +106,7 @@ index c8ff99ef5c7574292ee66a4aec45d1550eab1624..7c5f79124d2f2c69548263e79752484e
this.l = Maps.newHashMap();
this.m = Maps.newHashMap();
this.n = new ShortList[16];
@@ -471,6 +496,7 @@ public class Chunk implements IChunkAccess {
@@ -505,6 +530,7 @@ public class Chunk implements IChunkAccess {
}
entity.inChunk = true;
@ -57,7 +114,7 @@ index c8ff99ef5c7574292ee66a4aec45d1550eab1624..7c5f79124d2f2c69548263e79752484e
entity.chunkX = this.loc.x;
entity.chunkY = k;
entity.chunkZ = this.loc.z;
@@ -483,6 +509,7 @@ public class Chunk implements IChunkAccess {
@@ -517,6 +543,7 @@ public class Chunk implements IChunkAccess {
((HeightMap) this.heightMap.get(heightmap_type)).a(along);
}
@ -65,7 +122,7 @@ index c8ff99ef5c7574292ee66a4aec45d1550eab1624..7c5f79124d2f2c69548263e79752484e
public void b(Entity entity) {
this.a(entity, entity.chunkY);
}
@@ -497,7 +524,12 @@ public class Chunk implements IChunkAccess {
@@ -531,7 +558,12 @@ public class Chunk implements IChunkAccess {
i = this.entitySlices.length - 1;
}
@ -79,71 +136,14 @@ index c8ff99ef5c7574292ee66a4aec45d1550eab1624..7c5f79124d2f2c69548263e79752484e
this.entities.remove(entity); // Paper
}
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index b8267cf23f795fd7e586b0e567037eae5048d08e..b35ffae9f88cc14aec01482c2a3ed2e2428c2012 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -176,7 +176,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
}
public boolean isChunkLoaded() {
- return world.isChunkLoaded((int) Math.floor(this.locX()) >> 4, (int) Math.floor(this.locZ()) >> 4);
+ return getCurrentChunk() != null;
}
// CraftBukkit end
@@ -1678,6 +1678,23 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
}
// Paper start
+ java.lang.ref.WeakReference<Chunk> currentChunk = null;
+
+ public void setCurrentChunk(Chunk chunk) {
+ this.currentChunk = chunk != null ? new java.lang.ref.WeakReference<>(chunk) : null;
+ }
+ /**
+ * Returns the entities current registered chunk. If the entity is not added to a chunk yet, it will return null
+ */
+ public Chunk getCurrentChunk() {
+ final Chunk chunk = currentChunk != null ? currentChunk.get() : null;
+ if (chunk != null && chunk.loaded) {
+ return chunk;
+ }
+
+ return !inChunk ? null : ((WorldServer)world).getChunkProvider().getChunkAtIfLoadedMainThreadNoCache(chunkX, chunkZ);
+ }
+
private MinecraftKey entityKey;
private String entityKeyString;
diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java
index c80f964aef02ac6edd0dcf9f4af9f849e8ac3da9..43757f60d091414befe7daa192b17e2fe1ddbef9 100644
--- a/src/main/java/net/minecraft/server/TileEntity.java
+++ b/src/main/java/net/minecraft/server/TileEntity.java
@@ -53,6 +53,15 @@ public abstract class TileEntity implements KeyedObject { // Paper
getMinecraftKey(); // Try to load if it doesn't exists.
return tileEntityKeyString;
}
+
+ private java.lang.ref.WeakReference<Chunk> currentChunk = null;
+ public Chunk getCurrentChunk() {
+ final Chunk chunk = currentChunk != null ? currentChunk.get() : null;
+ return chunk != null && chunk.loaded ? chunk : null;
+ }
+ public void setCurrentChunk(Chunk chunk) {
+ this.currentChunk = chunk != null ? new java.lang.ref.WeakReference<>(chunk) : null;
+ }
// Paper end
@Nullable
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 48747fada4f982ada8c8598fb8ba756d901b40f1..a2048d2dd71381ee5e878c87e0d727ab62756b20 100644
index df7e5f1d17ddfeffc15df02906c3bf9f9461d82b..eea242af23825ad29ada6e997205e87edffb6bb9 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -145,6 +145,7 @@ import net.minecraft.server.EntityZombieVillager;
import net.minecraft.server.IChatBaseComponent;
import net.minecraft.server.NBTBase;
import net.minecraft.server.NBTTagCompound;
@@ -145,6 +145,7 @@ import net.minecraft.world.entity.vehicle.EntityMinecartMobSpawner;
import net.minecraft.world.entity.vehicle.EntityMinecartRideable;
import net.minecraft.world.entity.vehicle.EntityMinecartTNT;
import net.minecraft.world.phys.AxisAlignedBB;
+import org.bukkit.Chunk; // Paper
import org.bukkit.EntityEffect;
import org.bukkit.Location;
@ -154,7 +154,7 @@ index 48747fada4f982ada8c8598fb8ba756d901b40f1..a2048d2dd71381ee5e878c87e0d727ab
+ @Override
+ public Chunk getChunk() {
+ net.minecraft.server.Chunk currentChunk = entity.getCurrentChunk();
+ net.minecraft.world.level.chunk.Chunk currentChunk = entity.getCurrentChunk();
+ return currentChunk != null ? currentChunk.bukkitChunk : getLocation().getChunk();
+ }
+

View File

@ -5,11 +5,11 @@ Subject: [PATCH] Store counts for each Entity/Block Entity Type
Opens door for future patches to optimize performance
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 7c5f79124d2f2c69548263e79752484e07e77d48..853e11836b6c4eadd03feead101bf578b17b86a3 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -57,15 +57,19 @@ public class Chunk implements IChunkAccess {
diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
index 929f6fcd4b9f1b9a1488e170d6a77a5d64beecf3..acdcece38a4b30d6c89eb4342918ae8997db9f0b 100644
--- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
@@ -91,15 +91,19 @@ public class Chunk implements IChunkAccess {
}
// Paper start
@ -29,7 +29,7 @@ index 7c5f79124d2f2c69548263e79752484e07e77d48..853e11836b6c4eadd03feead101bf578
}
return replaced;
}
@@ -75,6 +79,7 @@ public class Chunk implements IChunkAccess {
@@ -109,6 +113,7 @@ public class Chunk implements IChunkAccess {
TileEntity removed = super.remove(key);
if (removed != null) {
removed.setCurrentChunk(null);
@ -37,7 +37,7 @@ index 7c5f79124d2f2c69548263e79752484e07e77d48..853e11836b6c4eadd03feead101bf578
}
return removed;
}
@@ -495,6 +500,7 @@ public class Chunk implements IChunkAccess {
@@ -529,6 +534,7 @@ public class Chunk implements IChunkAccess {
k = this.entitySlices.length - 1;
}
@ -45,7 +45,7 @@ index 7c5f79124d2f2c69548263e79752484e07e77d48..853e11836b6c4eadd03feead101bf578
entity.inChunk = true;
entity.setCurrentChunk(this); // Paper
entity.chunkX = this.loc.x;
@@ -529,6 +535,7 @@ public class Chunk implements IChunkAccess {
@@ -563,6 +569,7 @@ public class Chunk implements IChunkAccess {
if (!this.entitySlices[i].remove(entity)) {
return;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -28,11 +28,11 @@ index b31109d2dadd29e8852468c19265066b773d2be0..3618cc017feb60e257a28f67cbddca3f
+
+ }
}
diff --git a/src/main/java/net/minecraft/server/BlockBamboo.java b/src/main/java/net/minecraft/server/BlockBamboo.java
index f208ab50985d71996c65fcf31615052b967acc93..535535214119c2c0f080c328b70a02bb1f94a5cd 100644
--- a/src/main/java/net/minecraft/server/BlockBamboo.java
+++ b/src/main/java/net/minecraft/server/BlockBamboo.java
@@ -99,7 +99,7 @@ public class BlockBamboo extends Block implements IBlockFragilePlantElement {
diff --git a/src/main/java/net/minecraft/world/level/block/BlockBamboo.java b/src/main/java/net/minecraft/world/level/block/BlockBamboo.java
index 00bae3689c4d53ef8e6055c16995e6069acba049..21be9869bf995e6235c874ebb269f3918382e18c 100644
--- a/src/main/java/net/minecraft/world/level/block/BlockBamboo.java
+++ b/src/main/java/net/minecraft/world/level/block/BlockBamboo.java
@@ -124,7 +124,7 @@ public class BlockBamboo extends Block implements IBlockFragilePlantElement {
if (random.nextInt(Math.max(1, (int) (100.0F / worldserver.spigotConfig.bambooModifier) * 3)) == 0 && worldserver.isEmpty(blockposition.up()) && worldserver.getLightLevel(blockposition.up(), 0) >= 9) { // Spigot
int i = this.b(worldserver, blockposition) + 1;
@ -41,7 +41,7 @@ index f208ab50985d71996c65fcf31615052b967acc93..535535214119c2c0f080c328b70a02bb
this.a(iblockdata, (World) worldserver, blockposition, random, i);
}
}
@@ -130,7 +130,7 @@ public class BlockBamboo extends Block implements IBlockFragilePlantElement {
@@ -155,7 +155,7 @@ public class BlockBamboo extends Block implements IBlockFragilePlantElement {
int i = this.a(iblockaccess, blockposition);
int j = this.b(iblockaccess, blockposition);
@ -50,7 +50,7 @@ index f208ab50985d71996c65fcf31615052b967acc93..535535214119c2c0f080c328b70a02bb
}
@Override
@@ -149,7 +149,7 @@ public class BlockBamboo extends Block implements IBlockFragilePlantElement {
@@ -174,7 +174,7 @@ public class BlockBamboo extends Block implements IBlockFragilePlantElement {
BlockPosition blockposition1 = blockposition.up(i);
IBlockData iblockdata1 = worldserver.getType(blockposition1);
@ -59,7 +59,7 @@ index f208ab50985d71996c65fcf31615052b967acc93..535535214119c2c0f080c328b70a02bb
return;
}
@@ -190,7 +190,7 @@ public class BlockBamboo extends Block implements IBlockFragilePlantElement {
@@ -215,7 +215,7 @@ public class BlockBamboo extends Block implements IBlockFragilePlantElement {
}
int j = (Integer) iblockdata.get(BlockBamboo.d) != 1 && !iblockdata2.a(Blocks.BAMBOO) ? 0 : 1;
@ -68,7 +68,7 @@ index f208ab50985d71996c65fcf31615052b967acc93..535535214119c2c0f080c328b70a02bb
// CraftBukkit start
if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(world, blockposition, blockposition.up(), (IBlockData) ((IBlockData) ((IBlockData) this.getBlockData().set(BlockBamboo.d, j)).set(BlockBamboo.e, blockpropertybamboosize)).set(BlockBamboo.f, k), 3)) {
@@ -205,7 +205,7 @@ public class BlockBamboo extends Block implements IBlockFragilePlantElement {
@@ -230,7 +230,7 @@ public class BlockBamboo extends Block implements IBlockFragilePlantElement {
protected int a(IBlockAccess iblockaccess, BlockPosition blockposition) {
int i;
@ -77,7 +77,7 @@ index f208ab50985d71996c65fcf31615052b967acc93..535535214119c2c0f080c328b70a02bb
;
}
@@ -215,7 +215,7 @@ public class BlockBamboo extends Block implements IBlockFragilePlantElement {
@@ -240,7 +240,7 @@ public class BlockBamboo extends Block implements IBlockFragilePlantElement {
protected int b(IBlockAccess iblockaccess, BlockPosition blockposition) {
int i;
@ -86,11 +86,11 @@ index f208ab50985d71996c65fcf31615052b967acc93..535535214119c2c0f080c328b70a02bb
;
}
diff --git a/src/main/java/net/minecraft/server/BlockCactus.java b/src/main/java/net/minecraft/server/BlockCactus.java
index 4a3049575ad78e1c75d1b43a35311974c1d489de..13e4517bd04096001ca1caf32b9949abb3cf9c7f 100644
--- a/src/main/java/net/minecraft/server/BlockCactus.java
+++ b/src/main/java/net/minecraft/server/BlockCactus.java
@@ -35,7 +35,7 @@ public class BlockCactus extends Block {
diff --git a/src/main/java/net/minecraft/world/level/block/BlockCactus.java b/src/main/java/net/minecraft/world/level/block/BlockCactus.java
index c2316e346f9b647edae4c9709defa4531e04eaa6..9f1e9fc5361cd051b909e2e1b2095722064185da 100644
--- a/src/main/java/net/minecraft/world/level/block/BlockCactus.java
+++ b/src/main/java/net/minecraft/world/level/block/BlockCactus.java
@@ -55,7 +55,7 @@ public class BlockCactus extends Block {
;
}
@ -99,11 +99,11 @@ index 4a3049575ad78e1c75d1b43a35311974c1d489de..13e4517bd04096001ca1caf32b9949ab
int j = (Integer) iblockdata.get(BlockCactus.AGE);
if (j >= (byte) range(3, ((100.0F / worldserver.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 30282f73d263a96a14bd7bf7d3ac520e315b093a..c051decd19ff763a061822bc2a4b03289dfe3ac7 100644
--- a/src/main/java/net/minecraft/server/BlockReed.java
+++ b/src/main/java/net/minecraft/server/BlockReed.java
@@ -35,7 +35,7 @@ public class BlockReed extends Block {
diff --git a/src/main/java/net/minecraft/world/level/block/BlockReed.java b/src/main/java/net/minecraft/world/level/block/BlockReed.java
index eb95d65e1a37b91a71a9ad8968710ba9047f3980..a4ede7968ba0134f0d2cf880a6b4a6b9a81f2fcd 100644
--- a/src/main/java/net/minecraft/world/level/block/BlockReed.java
+++ b/src/main/java/net/minecraft/world/level/block/BlockReed.java
@@ -51,7 +51,7 @@ public class BlockReed extends Block {
;
}

View File

@ -24,11 +24,11 @@ index 3618cc017feb60e257a28f67cbddca3f792a9833..796c17e0941922a9716212c6eae91643
+ log("Baby zombies will move at the speed of " + babyZombieMovementModifier);
+ }
}
diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java
index 3533df35b9fc942b0e34f162a0524a65857370a7..f8b969b203cec7341382abf884a084cb4adbd7f9 100644
--- a/src/main/java/net/minecraft/server/EntityZombie.java
+++ b/src/main/java/net/minecraft/server/EntityZombie.java
@@ -20,7 +20,7 @@ import org.bukkit.event.entity.EntityTransformEvent;
diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityZombie.java b/src/main/java/net/minecraft/world/entity/monster/EntityZombie.java
index daa6d1ca20f952971a2ad6a0c4cba0bef6e43bf6..219e3b1626d68ede57b08a706d24bb6bc4b13fac 100644
--- a/src/main/java/net/minecraft/world/entity/monster/EntityZombie.java
+++ b/src/main/java/net/minecraft/world/entity/monster/EntityZombie.java
@@ -82,7 +82,7 @@ import org.bukkit.event.entity.EntityTransformEvent;
public class EntityZombie extends EntityMonster {
private static final UUID b = UUID.fromString("B9766B59-9566-4402-BC1F-2EE2A276D836");
@ -37,7 +37,7 @@ index 3533df35b9fc942b0e34f162a0524a65857370a7..f8b969b203cec7341382abf884a084cb
private static final DataWatcherObject<Boolean> d = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i);
private static final DataWatcherObject<Integer> bo = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.b);
public static final DataWatcherObject<Boolean> DROWN_CONVERTING = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i);
@@ -123,9 +123,9 @@ public class EntityZombie extends EntityMonster {
@@ -185,9 +185,9 @@ public class EntityZombie extends EntityMonster {
if (this.world != null && !this.world.isClientSide) {
AttributeModifiable attributemodifiable = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);

View File

@ -21,11 +21,11 @@ index 796c17e0941922a9716212c6eae91643d8360418..78948c42b13194005bdbbbc69c2b7ae0
+ log("Fishing time ranges are between " + fishingMinTicks +" and " + fishingMaxTicks + " ticks");
+ }
}
diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java
index 99a18a6c4d42b05cdcfd154c4ff24d9764e73057..b9243b0a2d429828f2a2b68c221129e23c6212ca 100644
--- a/src/main/java/net/minecraft/server/EntityFishingHook.java
+++ b/src/main/java/net/minecraft/server/EntityFishingHook.java
@@ -47,6 +47,10 @@ public class EntityFishingHook extends IProjectile {
diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntityFishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/EntityFishingHook.java
index 2b75eab985b0f39e1624e5f4cab7e5b5bde6ae14..bcc411107d531529dbce9d1d43896a3c70e63012 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/EntityFishingHook.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/EntityFishingHook.java
@@ -85,6 +85,10 @@ public class EntityFishingHook extends IProjectile {
entityhuman.hookedFish = this;
this.an = Math.max(0, i);
this.lureLevel = Math.max(0, j);

View File

@ -18,23 +18,11 @@ index 78948c42b13194005bdbbbc69c2b7ae0732a78c5..b41e7922dd96c3358eb849ab39982a75
+ nerfedMobsShouldJump = getBoolean("spawner-nerfed-mobs-should-jump", false);
+ }
}
diff --git a/src/main/java/net/minecraft/server/ControllerJump.java b/src/main/java/net/minecraft/server/ControllerJump.java
index 2e869004c8c6b8bfbb002fb4eda04519d50390c8..22eb89df768819f0a18f91b806b56acec8489281 100644
--- a/src/main/java/net/minecraft/server/ControllerJump.java
+++ b/src/main/java/net/minecraft/server/ControllerJump.java
@@ -13,6 +13,7 @@ public class ControllerJump {
this.a = true;
}
+ public final void jumpIfSet() { this.b(); } // Paper - OBFHELPER
public void b() {
this.b.setJumping(this.a);
this.a = false;
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index ace7d5a36c0a44763d554d5d83cee7817f77fcc1..b6ca0c88fbfec5cc0a3d06a33f1ab7cddd52cbe3 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -1020,6 +1020,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index db8970539f7f69c9087abe43286bca008cb4594d..0b86c697541e3ee6083b3c10ab3618ef740b1904 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1105,6 +1105,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
return this.isInWater() || this.isInRain();
}
@ -42,11 +30,11 @@ index ace7d5a36c0a44763d554d5d83cee7817f77fcc1..b6ca0c88fbfec5cc0a3d06a33f1ab7cd
public boolean aG() {
return this.isInWater() || this.isInRain() || this.k();
}
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
index 03bfd29c12e7dd6e359481ffb56fddad1a44492a..be24030f9c23da21e2f7c98cb0df5e7229109d26 100644
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
@@ -33,6 +33,7 @@ public abstract class EntityInsentient extends EntityLiving {
diff --git a/src/main/java/net/minecraft/world/entity/EntityInsentient.java b/src/main/java/net/minecraft/world/entity/EntityInsentient.java
index dbfcdc3cc7c1dccf785f5e13634e84c5af088985..28aa0a9361e8a32763d7fe1af060f0016e8c1e50 100644
--- a/src/main/java/net/minecraft/world/entity/EntityInsentient.java
+++ b/src/main/java/net/minecraft/world/entity/EntityInsentient.java
@@ -98,6 +98,7 @@ public abstract class EntityInsentient extends EntityLiving {
private final EntityAIBodyControl c;
protected NavigationAbstract navigation;
public PathfinderGoalSelector goalSelector;
@ -54,7 +42,7 @@ index 03bfd29c12e7dd6e359481ffb56fddad1a44492a..be24030f9c23da21e2f7c98cb0df5e72
public PathfinderGoalSelector targetSelector;
private EntityLiving goalTarget;
private final EntitySenses bo;
@@ -719,7 +720,17 @@ public abstract class EntityInsentient extends EntityLiving {
@@ -784,7 +785,17 @@ public abstract class EntityInsentient extends EntityLiving {
@Override
protected final void doTick() {
++this.ticksFarFromPlayer;
@ -73,11 +61,23 @@ index 03bfd29c12e7dd6e359481ffb56fddad1a44492a..be24030f9c23da21e2f7c98cb0df5e72
this.world.getMethodProfiler().enter("sensing");
this.bo.a();
this.world.getMethodProfiler().exit();
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalFloat.java b/src/main/java/net/minecraft/server/PathfinderGoalFloat.java
index fd861cbc007c164f9a18ebfe7e4d0e4fe01db54c..8030376804823264bb5a701c1304414ac932af9c 100644
--- a/src/main/java/net/minecraft/server/PathfinderGoalFloat.java
+++ b/src/main/java/net/minecraft/server/PathfinderGoalFloat.java
@@ -8,15 +8,18 @@ public class PathfinderGoalFloat extends PathfinderGoal {
diff --git a/src/main/java/net/minecraft/world/entity/ai/control/ControllerJump.java b/src/main/java/net/minecraft/world/entity/ai/control/ControllerJump.java
index 9767ac416fcd60a8a57b648dcb3f1e427bacd54d..1a9b3e0e0c090683e332dfa53708f8a62c8f14e0 100644
--- a/src/main/java/net/minecraft/world/entity/ai/control/ControllerJump.java
+++ b/src/main/java/net/minecraft/world/entity/ai/control/ControllerJump.java
@@ -15,6 +15,7 @@ public class ControllerJump {
this.a = true;
}
+ public final void jumpIfSet() { this.b(); } // Paper - OBFHELPER
public void b() {
this.b.setJumping(this.a);
this.a = false;
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalFloat.java b/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalFloat.java
index 8dfa1a6ade7f51e5d68b290f5376d999bb4c60ab..a6c8763139ed18fe73b2d6f6ec511e59666dc843 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalFloat.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalFloat.java
@@ -11,15 +11,18 @@ public class PathfinderGoalFloat extends PathfinderGoal {
public PathfinderGoalFloat(EntityInsentient entityinsentient) {
this.a = entityinsentient;

View File

@ -29,11 +29,11 @@ index b41e7922dd96c3358eb849ab39982a75736e3476..2f0d582baf0eb2bb477944d0cb1369db
+ hardDespawnDistance = hardDespawnDistance*hardDespawnDistance;
+ }
}
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
index be24030f9c23da21e2f7c98cb0df5e7229109d26..15b0d48e9dfe707b2859564b33206085f5a4e0db 100644
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
@@ -698,14 +698,14 @@ public abstract class EntityInsentient extends EntityLiving {
diff --git a/src/main/java/net/minecraft/world/entity/EntityInsentient.java b/src/main/java/net/minecraft/world/entity/EntityInsentient.java
index 28aa0a9361e8a32763d7fe1af060f0016e8c1e50..f93af56f68d5fd27eca38d333ca429ce22fc397b 100644
--- a/src/main/java/net/minecraft/world/entity/EntityInsentient.java
+++ b/src/main/java/net/minecraft/world/entity/EntityInsentient.java
@@ -763,14 +763,14 @@ public abstract class EntityInsentient extends EntityLiving {
int i = this.getEntityType().e().f();
int j = i * i;

View File

@ -19,11 +19,11 @@ index 2f0d582baf0eb2bb477944d0cb1369db6ca33956..89e76dd73811fd0f6f8c8e7e5af804d5
+ log("Keep spawn chunk loaded: " + keepSpawnInMemory);
+ }
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index b4aeea40ee04fd2ed10484f40d25dbd2a3a01b53..ab1285ed371f7848cddd959c33019a8ff10e1c28 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -165,6 +165,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java
index 1b03c69fa7ffeca4083470a179e18be828b0a957..62735e7908f86e31f7a89ce2071ddebe176c0385 100644
--- a/src/main/java/net/minecraft/world/level/World.java
+++ b/src/main/java/net/minecraft/world/level/World.java
@@ -217,6 +217,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
});
// CraftBukkit end
timings = new co.aikar.timings.WorldTimingsHandler(this); // Paper - code below can generate new world and access timings

View File

@ -24,11 +24,11 @@ index 89e76dd73811fd0f6f8c8e7e5af804d5a4bb5a75..d16ae924bcbe31c964f7fb448757c748
+ if (entityTNTHeightNerf != 0) log("TNT Entity Height Limit set to Y: " + entityTNTHeightNerf);
+ }
}
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index ae96ff73f78a514328862de86d3ecdb29fa9c145..09bab3828197e3078a4ed95e7c8a9f34e8bf1b8d 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -1765,6 +1765,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 0b86c697541e3ee6083b3c10ab3618ef740b1904..d7dfb89faa47817c51257bb124cfb3806c5e27da 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1850,6 +1850,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
return this.a(itemstack, 0.0F);
}
@ -36,11 +36,11 @@ index ae96ff73f78a514328862de86d3ecdb29fa9c145..09bab3828197e3078a4ed95e7c8a9f34
@Nullable
public EntityItem a(ItemStack itemstack, float f) {
if (itemstack.isEmpty()) {
diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java
index 55e6d9a94c648bac68b80a76eda041fb952db09f..6b226c04d40adff8b0f1d28c0cc79439df002b3d 100644
--- a/src/main/java/net/minecraft/server/EntityFallingBlock.java
+++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java
@@ -85,6 +85,17 @@ public class EntityFallingBlock extends Entity {
diff --git a/src/main/java/net/minecraft/world/entity/item/EntityFallingBlock.java b/src/main/java/net/minecraft/world/entity/item/EntityFallingBlock.java
index b3dea8d65c3d1e27e59be142ec9e2ebb4164aed0..901522f24b8bc58861e46eda400dbab92bb6401d 100644
--- a/src/main/java/net/minecraft/world/entity/item/EntityFallingBlock.java
+++ b/src/main/java/net/minecraft/world/entity/item/EntityFallingBlock.java
@@ -124,6 +124,17 @@ public class EntityFallingBlock extends Entity {
}
this.move(EnumMoveType.SELF, this.getMot());
@ -58,28 +58,11 @@ index 55e6d9a94c648bac68b80a76eda041fb952db09f..6b226c04d40adff8b0f1d28c0cc79439
if (!this.world.isClientSide) {
blockposition = this.getChunkCoordinates();
boolean flag = this.block.getBlock() instanceof BlockConcretePowder;
diff --git a/src/main/java/net/minecraft/server/EntityMinecartTNT.java b/src/main/java/net/minecraft/server/EntityMinecartTNT.java
index 50d7c2899deb707dbbe333242e049b963d9b549c..3dfe3d13ac713c963256a662b52f54716e397672 100644
--- a/src/main/java/net/minecraft/server/EntityMinecartTNT.java
+++ b/src/main/java/net/minecraft/server/EntityMinecartTNT.java
@@ -26,6 +26,12 @@ public class EntityMinecartTNT extends EntityMinecartAbstract {
public void tick() {
super.tick();
if (this.b > 0) {
+ // Paper start - Configurable TNT entity height nerf
+ if (this.world.paperConfig.entityTNTHeightNerf != 0 && this.locY() > this.world.paperConfig.entityTNTHeightNerf) {
+ this.die();
+ return;
+ }
+ // Paper end
--this.b;
this.world.addParticle(Particles.SMOKE, this.locX(), this.locY() + 0.5D, this.locZ(), 0.0D, 0.0D, 0.0D);
} else if (this.b == 0) {
diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
index 7064fd8e8318797a94b5292d675992a902b681ab..914ff5b7a9787ae5e8d5b8829e6888ba2637cc26 100644
--- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java
+++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
@@ -55,6 +55,12 @@ public class EntityTNTPrimed extends Entity {
diff --git a/src/main/java/net/minecraft/world/entity/item/EntityTNTPrimed.java b/src/main/java/net/minecraft/world/entity/item/EntityTNTPrimed.java
index c2e7161dc103c971908ff217eaf972e9f175d044..4f4b2b8d58223fa22d6a7af5c94cfb36399b9641 100644
--- a/src/main/java/net/minecraft/world/entity/item/EntityTNTPrimed.java
+++ b/src/main/java/net/minecraft/world/entity/item/EntityTNTPrimed.java
@@ -70,6 +70,12 @@ public class EntityTNTPrimed extends Entity {
}
this.move(EnumMoveType.SELF, this.getMot());
@ -92,3 +75,20 @@ index 7064fd8e8318797a94b5292d675992a902b681ab..914ff5b7a9787ae5e8d5b8829e6888ba
this.setMot(this.getMot().a(0.98D));
if (this.onGround) {
this.setMot(this.getMot().d(0.7D, -0.5D, 0.7D));
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/EntityMinecartTNT.java b/src/main/java/net/minecraft/world/entity/vehicle/EntityMinecartTNT.java
index ee31704ffb88ab68702657554d386e8ebfa05d03..4bec5c1d504b9456dafe1b76bdbb523d0a324abe 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/EntityMinecartTNT.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/EntityMinecartTNT.java
@@ -47,6 +47,12 @@ public class EntityMinecartTNT extends EntityMinecartAbstract {
public void tick() {
super.tick();
if (this.b > 0) {
+ // Paper start - Configurable TNT entity height nerf
+ if (this.world.paperConfig.entityTNTHeightNerf != 0 && this.locY() > this.world.paperConfig.entityTNTHeightNerf) {
+ this.die();
+ return;
+ }
+ // Paper end
--this.b;
this.world.addParticle(Particles.SMOKE, this.locX(), this.locY() + 0.5D, this.locZ(), 0.0D, 0.0D, 0.0D);
} else if (this.b == 0) {

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Show 'Paper' in client crashes, server lists, and Mojang
diff --git a/src/main/java/net/minecraft/server/EULA.java b/src/main/java/net/minecraft/server/EULA.java
index aab33df7a36eb69300fedfce733985d6c239ca01..550232cb3819138b3bae0fa1c51429485e8bc593 100644
index a5171d28b960b12c2743ea68a36d747bc967697d..a0f53c9eff04a40780b3ba568dbfc5bbe9bd8504 100644
--- a/src/main/java/net/minecraft/server/EULA.java
+++ b/src/main/java/net/minecraft/server/EULA.java
@@ -70,7 +70,7 @@ public class EULA {
@@ -72,7 +72,7 @@ public class EULA {
Properties properties = new Properties();
properties.setProperty("eula", "false");
@ -19,10 +19,10 @@ index aab33df7a36eb69300fedfce733985d6c239ca01..550232cb3819138b3bae0fa1c5142948
throwable = throwable1;
throw throwable1;
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index c1a651a1c2d5ffed80e4517e465901bb39274548..82768ab4663b6dc220212581f92bf8c5188c73b5 100644
index 422ee5fb0d917399b2b1e5d893219405c5dbe82d..60a768ea8ffa965dd309c05bebddf5563b5e1992 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1225,7 +1225,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
@@ -1332,7 +1332,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
}
public String getServerModName() {
@ -32,7 +32,7 @@ index c1a651a1c2d5ffed80e4517e465901bb39274548..82768ab4663b6dc220212581f92bf8c5
public CrashReport b(CrashReport crashreport) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 17f4e5a6fcf58ba74678f8a004fc3d5f4a81ae50..6352c45db0053ce75356494ffa3b31b42d6e6414 100644
index 2f6b49e3ae7a7407eaec9810af8bf72e3a4896de..1818a6af3a55d15be698d5219e0eea63e2077611 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -226,7 +226,7 @@ import org.yaml.snakeyaml.error.MarkedYAMLException;
@ -76,7 +76,7 @@ index 3a6578170765a472d36b169b999e9dc57bf8070b..a34b1ba17e6f7121ed70c3d95ec8f4aa
net.minecraft.server.Main.main(options);
} catch (Throwable t) {
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
index d7adcdceecb48d8ae605ddd305dcc06ec05ed3dd..bf240231b70dbaf71f359318e5c0f8ba1490a067 100644
index b4eeeb0d001e692180874bd26385a0e786a8b752..1b3a14784cac8e855633fae6172ad5479ebe9877 100644
--- a/src/main/java/org/spigotmc/WatchdogThread.java
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
@@ -19,7 +19,7 @@ public class WatchdogThread extends Thread
@ -104,7 +104,7 @@ index d7adcdceecb48d8ae605ddd305dcc06ec05ed3dd..bf240231b70dbaf71f359318e5c0f8ba
- log.log( Level.SEVERE, "Spigot version: " + Bukkit.getServer().getVersion() );
+ log.log( Level.SEVERE, "Paper version: " + Bukkit.getServer().getVersion() );
//
if ( net.minecraft.server.World.lastPhysicsProblem != null )
if ( net.minecraft.world.level.World.lastPhysicsProblem != null )
{
@@ -82,7 +82,7 @@ public class WatchdogThread extends Thread
}

View File

@ -201,11 +201,11 @@ index 0000000000000000000000000000000000000000..aac3f66cb23d260729c2a48d8710a9de
+ }
+ }
+}
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
index 218071260dec39dd4f7eb733ae6f832aacd6fd6f..7b52bf335e60a700b4c4e25cab1b0261f32775bc 100644
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
@@ -157,6 +157,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 59942eb6bb6e8e1e9a988bce0d09757e575018b9..faf4d00bf288359db806913c4d2964324e8706b7 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -196,6 +196,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
return false;
}
com.destroystokyo.paper.PaperConfig.registerCommands();

View File

@ -4,11 +4,11 @@ Date: Tue, 1 Mar 2016 14:47:52 -0600
Subject: [PATCH] Player affects spawning API
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 09bab3828197e3078a4ed95e7c8a9f34e8bf1b8d..dc996792df6046d442565a7993ec299af6605d92 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -1269,6 +1269,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index d7dfb89faa47817c51257bb124cfb3806c5e27da..ca620977666f4d4173089876f506f041ab278bd3 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1354,6 +1354,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
return MathHelper.c(f * f + f1 * f1 + f2 * f2);
}
@ -16,11 +16,54 @@ index 09bab3828197e3078a4ed95e7c8a9f34e8bf1b8d..dc996792df6046d442565a7993ec299a
public double h(double d0, double d1, double d2) {
double d3 = this.locX() - d0;
double d4 = this.locY() - d1;
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
index 1a4f49a019134ecd50542f0099e44f164aa9b690..dcc9984665a1b6458cee317bb79a3343656cea23 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -70,6 +70,9 @@ public abstract class EntityHuman extends EntityLiving {
diff --git a/src/main/java/net/minecraft/world/entity/EntityInsentient.java b/src/main/java/net/minecraft/world/entity/EntityInsentient.java
index f93af56f68d5fd27eca38d333ca429ce22fc397b..0631cd531647239858b2a7298f58cc770720f69a 100644
--- a/src/main/java/net/minecraft/world/entity/EntityInsentient.java
+++ b/src/main/java/net/minecraft/world/entity/EntityInsentient.java
@@ -756,7 +756,7 @@ public abstract class EntityInsentient extends EntityLiving {
if (this.world.getDifficulty() == EnumDifficulty.PEACEFUL && this.L()) {
this.die();
} else if (!this.isPersistent() && !this.isSpecialPersistence()) {
- EntityHuman entityhuman = this.world.findNearbyPlayer(this, -1.0D);
+ EntityHuman entityhuman = this.world.findNearbyPlayer(this, -1.0D, IEntitySelector.affectsSpawning); // Paper
if (entityhuman != null) {
double d0 = entityhuman.h((Entity) this); // CraftBukkit - decompile error
diff --git a/src/main/java/net/minecraft/world/entity/IEntitySelector.java b/src/main/java/net/minecraft/world/entity/IEntitySelector.java
index 6e78192a5898df017d96acba845a288011d24e35..dfcfdb31ca9531913d705aaaf85fb67399cfdc8c 100644
--- a/src/main/java/net/minecraft/world/entity/IEntitySelector.java
+++ b/src/main/java/net/minecraft/world/entity/IEntitySelector.java
@@ -29,6 +29,12 @@ public final class IEntitySelector {
return !entity.isSpectator();
};
+ // Paper start
+ public static final Predicate<Entity> affectsSpawning = (entity) -> {
+ return !entity.isSpectator() && entity.isAlive() && (entity instanceof EntityPlayer) && ((EntityPlayer) entity).affectsSpawning;
+ };
+ // Paper end
+
public static Predicate<Entity> a(double d0, double d1, double d2, double d3) {
double d4 = d3 * d3;
diff --git a/src/main/java/net/minecraft/world/entity/monster/EntitySilverfish.java b/src/main/java/net/minecraft/world/entity/monster/EntitySilverfish.java
index 0b3b430766fba602e74727f78173567ca10fabc6..e1fcb1be102822e87eaf7757fbd64a516b2f58ac 100644
--- a/src/main/java/net/minecraft/world/entity/monster/EntitySilverfish.java
+++ b/src/main/java/net/minecraft/world/entity/monster/EntitySilverfish.java
@@ -122,7 +122,7 @@ public class EntitySilverfish extends EntityMonster {
if (c(entitytypes, generatoraccess, enummobspawn, blockposition, random)) {
EntityHuman entityhuman = generatoraccess.a((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, 5.0D, true);
- return entityhuman == null;
+ return !(entityhuman != null && !entityhuman.affectsSpawning) && entityhuman == null; // Paper - Affects Spawning API
} else {
return false;
}
diff --git a/src/main/java/net/minecraft/world/entity/player/EntityHuman.java b/src/main/java/net/minecraft/world/entity/player/EntityHuman.java
index 1017ee73b8617ce2b6734469fa49aaff7563c2b1..f42e16589476c1bd10b13214dda5ac7bb3e52131 100644
--- a/src/main/java/net/minecraft/world/entity/player/EntityHuman.java
+++ b/src/main/java/net/minecraft/world/entity/player/EntityHuman.java
@@ -164,6 +164,9 @@ public abstract class EntityHuman extends EntityLiving {
private final ItemCooldown bM;
@Nullable
public EntityFishingHook hookedFish;
@ -30,37 +73,11 @@ index 1a4f49a019134ecd50542f0099e44f164aa9b690..dcc9984665a1b6458cee317bb79a3343
// CraftBukkit start
public boolean fauxSleeping;
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
index 15b0d48e9dfe707b2859564b33206085f5a4e0db..a819fc46bebc4b1aaae63f822087574e976e2ab8 100644
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
@@ -691,7 +691,7 @@ public abstract class EntityInsentient extends EntityLiving {
if (this.world.getDifficulty() == EnumDifficulty.PEACEFUL && this.L()) {
this.die();
} else if (!this.isPersistent() && !this.isSpecialPersistence()) {
- EntityHuman entityhuman = this.world.findNearbyPlayer(this, -1.0D);
+ EntityHuman entityhuman = this.world.findNearbyPlayer(this, -1.0D, IEntitySelector.affectsSpawning); // Paper
if (entityhuman != null) {
double d0 = entityhuman.h((Entity) this); // CraftBukkit - decompile error
diff --git a/src/main/java/net/minecraft/server/EntitySilverfish.java b/src/main/java/net/minecraft/server/EntitySilverfish.java
index f5899fc014cfcc4b7e769d51e867ce1eaf625188..28b490cc14f5881eb83acfbd6f30f9163ffe1926 100644
--- a/src/main/java/net/minecraft/server/EntitySilverfish.java
+++ b/src/main/java/net/minecraft/server/EntitySilverfish.java
@@ -95,7 +95,7 @@ public class EntitySilverfish extends EntityMonster {
if (c(entitytypes, generatoraccess, enummobspawn, blockposition, random)) {
EntityHuman entityhuman = generatoraccess.a((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, 5.0D, true);
- return entityhuman == null;
+ return !(entityhuman != null && !entityhuman.affectsSpawning) && entityhuman == null; // Paper - Affects Spawning API
} else {
return false;
}
diff --git a/src/main/java/net/minecraft/server/IEntityAccess.java b/src/main/java/net/minecraft/server/IEntityAccess.java
index f433e1f6e6d430bd35a0fb54ee85295ea06f53bd..14400d0e4b0713e852861ed55e289e4dead95cea 100644
--- a/src/main/java/net/minecraft/server/IEntityAccess.java
+++ b/src/main/java/net/minecraft/server/IEntityAccess.java
@@ -83,8 +83,9 @@ public interface IEntityAccess {
diff --git a/src/main/java/net/minecraft/world/level/IEntityAccess.java b/src/main/java/net/minecraft/world/level/IEntityAccess.java
index 4ece69851e7b05016f52c291ce911eb791cf3a23..6d5d4c3df65995b9a13b66d070ba08d553cc98a2 100644
--- a/src/main/java/net/minecraft/world/level/IEntityAccess.java
+++ b/src/main/java/net/minecraft/world/level/IEntityAccess.java
@@ -92,8 +92,9 @@ public interface IEntityAccess {
}
}
@ -72,7 +89,7 @@ index f433e1f6e6d430bd35a0fb54ee85295ea06f53bd..14400d0e4b0713e852861ed55e289e4d
double d4 = -1.0D;
EntityHuman entityhuman = null;
Iterator iterator = this.getPlayers().iterator();
@@ -117,6 +118,27 @@ public interface IEntityAccess {
@@ -126,6 +127,27 @@ public interface IEntityAccess {
return this.a(d0, d1, d2, d3, predicate);
}
@ -100,28 +117,11 @@ index f433e1f6e6d430bd35a0fb54ee85295ea06f53bd..14400d0e4b0713e852861ed55e289e4d
default boolean isPlayerNearby(double d0, double d1, double d2, double d3) {
Iterator iterator = this.getPlayers().iterator();
diff --git a/src/main/java/net/minecraft/server/IEntitySelector.java b/src/main/java/net/minecraft/server/IEntitySelector.java
index 143cfd9e99e9e0639bc32dd19efa84535a1fe03d..ff1ddb4db5406f81453a8f075033d00e06bce6a5 100644
--- a/src/main/java/net/minecraft/server/IEntitySelector.java
+++ b/src/main/java/net/minecraft/server/IEntitySelector.java
@@ -24,6 +24,12 @@ public final class IEntitySelector {
return !entity.isSpectator();
};
+ // Paper start
+ public static final Predicate<Entity> affectsSpawning = (entity) -> {
+ return !entity.isSpectator() && entity.isAlive() && (entity instanceof EntityPlayer) && ((EntityPlayer) entity).affectsSpawning;
+ };
+ // Paper end
+
public static Predicate<Entity> a(double d0, double d1, double d2, double d3) {
double d4 = d3 * d3;
diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
index 90af43930f9141b0c7f51bb3d887d7b9c4d935eb..1741ec5e241f8ae7a3c30a9021d14cb0224da840 100644
--- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
+++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
@@ -49,7 +49,7 @@ public abstract class MobSpawnerAbstract {
diff --git a/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java b/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java
index 33cba4e475edc0573b901f70c61d3659fd63ad62..8d8b03074df1635946f81bec0feae18d2f3e20aa 100644
--- a/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java
+++ b/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java
@@ -66,7 +66,7 @@ public abstract class MobSpawnerAbstract {
private boolean h() {
BlockPosition blockposition = this.b();
@ -131,7 +131,7 @@ index 90af43930f9141b0c7f51bb3d887d7b9c4d935eb..1741ec5e241f8ae7a3c30a9021d14cb0
public void c() {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index c0154a14a4da53b933b121fea585d1c1e4d0e87f..5d446eb731621e2205b684923a06b932d41ba421 100644
index 137870c7d18c9ef3ae637e83c5457d42ec40c669..e9f5ef73de6fd100dda7ed006dde6635f65b1ab5 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1767,8 +1767,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -4,11 +4,11 @@ Date: Tue, 1 Mar 2016 15:08:03 -0600
Subject: [PATCH] Remove invalid mob spawner tile entities
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 0aea16df16b55b1d4756b51d10c8c22d37aef9a3..0d0f36c62d260390827321aa6472f51a3a204c95 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -614,6 +614,10 @@ public class Chunk implements IChunkAccess {
diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
index ac576d268b23148089d404cb22d8c2f9d1a79d6e..0312d68f0f64fa9e5816fe12a09430208ae2b8ce 100644
--- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
@@ -648,6 +648,10 @@ public class Chunk implements IChunkAccess {
}
// CraftBukkit start
@ -17,5 +17,5 @@ index 0aea16df16b55b1d4756b51d10c8c22d37aef9a3..0d0f36c62d260390827321aa6472f51a
+ this.tileEntities.remove(blockposition);
+ // Paper end
} 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.getPosition().getX() + "," + tileentity.getPosition().getY() + "," + tileentity.getPosition().getZ()
+ " (" + getType(blockposition) + ") where there was no entity tile!");

View File

@ -28,11 +28,11 @@ index d4ebcf8f66197299256bd6b65710a1488c90ea41..c9164dfdb27ddf3709129c8aec54903a
pair("gamerules", toObjectMapper(world.getWorld().getGameRules(), rule -> {
return pair(rule, world.getWorld().getGameRuleValue(rule));
})),
diff --git a/src/main/java/net/minecraft/server/BlockChest.java b/src/main/java/net/minecraft/server/BlockChest.java
index 1441d096d44ea653539ba20ccda94eb62ffc32df..fb7c0d45765e36181c809b250ba4eee5d21c5894 100644
--- a/src/main/java/net/minecraft/server/BlockChest.java
+++ b/src/main/java/net/minecraft/server/BlockChest.java
@@ -10,8 +10,8 @@ import javax.annotation.Nullable;
diff --git a/src/main/java/net/minecraft/world/level/block/BlockChest.java b/src/main/java/net/minecraft/world/level/block/BlockChest.java
index 60e7dc1910ae9214d84d65b011cfec278b6b32ae..b229faad99120c67b089f7680d800fbe594fe7da 100644
--- a/src/main/java/net/minecraft/world/level/block/BlockChest.java
+++ b/src/main/java/net/minecraft/world/level/block/BlockChest.java
@@ -54,8 +54,8 @@ import net.minecraft.world.phys.shapes.VoxelShapeCollision;
public class BlockChest extends BlockChestAbstract<TileEntityChest> implements IBlockWaterlogged {
public static final BlockStateDirection FACING = BlockFacingHorizontal.FACING;
@ -43,23 +43,11 @@ index 1441d096d44ea653539ba20ccda94eb62ffc32df..fb7c0d45765e36181c809b250ba4eee5
protected static final VoxelShape e = Block.a(1.0D, 0.0D, 0.0D, 15.0D, 14.0D, 15.0D);
protected static final VoxelShape f = Block.a(1.0D, 0.0D, 1.0D, 15.0D, 14.0D, 16.0D);
protected static final VoxelShape g = Block.a(0.0D, 0.0D, 1.0D, 15.0D, 14.0D, 15.0D);
diff --git a/src/main/java/net/minecraft/server/IBlockDataHolder.java b/src/main/java/net/minecraft/server/IBlockDataHolder.java
index 98616f0db75d0e2b2e960dbf88289c87ba426ab6..b19c694cf01bc868dd7c4ec6432b613d19f2ca40 100644
--- a/src/main/java/net/minecraft/server/IBlockDataHolder.java
+++ b/src/main/java/net/minecraft/server/IBlockDataHolder.java
@@ -83,6 +83,7 @@ public abstract class IBlockDataHolder<O, S> {
return Collections.unmodifiableCollection(this.b.keySet());
}
+ public <T extends Comparable<T>> boolean contains(IBlockState<T> iblockstate) { return this.b(iblockstate); } // Paper - OBFHELPER
public <T extends Comparable<T>> boolean b(IBlockState<T> iblockstate) {
return this.b.containsKey(iblockstate);
}
diff --git a/src/main/java/net/minecraft/server/TileEntityChest.java b/src/main/java/net/minecraft/server/TileEntityChest.java
index 8e5ceacf7f6ed0d639d7850334d8a01a74aef6e3..54cad33750efd80b104664723e1115d107c7a72d 100644
--- a/src/main/java/net/minecraft/server/TileEntityChest.java
+++ b/src/main/java/net/minecraft/server/TileEntityChest.java
@@ -8,7 +8,7 @@ import org.bukkit.craftbukkit.entity.CraftHumanEntity;
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntityChest.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntityChest.java
index eed95b370d1d624ffc6b7a35357b7028ec58c584..aafd1f7c6c811f9eb2796d865e327f374be9b461 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityChest.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityChest.java
@@ -33,7 +33,7 @@ import org.bukkit.craftbukkit.entity.CraftHumanEntity;
import org.bukkit.entity.HumanEntity;
// CraftBukkit end
@ -68,7 +56,7 @@ index 8e5ceacf7f6ed0d639d7850334d8a01a74aef6e3..54cad33750efd80b104664723e1115d1
private NonNullList<ItemStack> items;
protected float a;
@@ -86,14 +86,20 @@ public class TileEntityChest extends TileEntityLootable implements ITickable {
@@ -111,14 +111,20 @@ public class TileEntityChest extends TileEntityLootable implements ITickable {
return nbttagcompound;
}
@ -91,7 +79,7 @@ index 8e5ceacf7f6ed0d639d7850334d8a01a74aef6e3..54cad33750efd80b104664723e1115d1
this.b = this.a;
float f = 0.1F;
@@ -107,8 +113,11 @@ public class TileEntityChest extends TileEntityLootable implements ITickable {
@@ -132,8 +138,11 @@ public class TileEntityChest extends TileEntityLootable implements ITickable {
if (this.viewingCount > 0 && this.a == 0.0F) {
this.playOpenSound(SoundEffects.BLOCK_CHEST_OPEN);
}
@ -104,7 +92,7 @@ index 8e5ceacf7f6ed0d639d7850334d8a01a74aef6e3..54cad33750efd80b104664723e1115d1
float f1 = this.a;
if (this.viewingCount > 0) {
@@ -124,8 +133,11 @@ public class TileEntityChest extends TileEntityLootable implements ITickable {
@@ -149,8 +158,11 @@ public class TileEntityChest extends TileEntityLootable implements ITickable {
float f2 = 0.5F;
if (this.a < 0.5F && f1 >= 0.5F) {
@ -117,7 +105,7 @@ index 8e5ceacf7f6ed0d639d7850334d8a01a74aef6e3..54cad33750efd80b104664723e1115d1
if (this.a < 0.0F) {
this.a = 0.0F;
@@ -164,6 +176,7 @@ public class TileEntityChest extends TileEntityLootable implements ITickable {
@@ -189,6 +201,7 @@ public class TileEntityChest extends TileEntityLootable implements ITickable {
}
public void playOpenSound(SoundEffect soundeffect) {
@ -125,7 +113,7 @@ index 8e5ceacf7f6ed0d639d7850334d8a01a74aef6e3..54cad33750efd80b104664723e1115d1
BlockPropertyChestType blockpropertychesttype = (BlockPropertyChestType) this.getBlock().get(BlockChest.c);
if (blockpropertychesttype != BlockPropertyChestType.LEFT) {
@@ -202,6 +215,7 @@ public class TileEntityChest extends TileEntityLootable implements ITickable {
@@ -227,6 +240,7 @@ public class TileEntityChest extends TileEntityLootable implements ITickable {
++this.viewingCount;
if (this.world == null) return; // CraftBukkit
@ -133,7 +121,7 @@ index 8e5ceacf7f6ed0d639d7850334d8a01a74aef6e3..54cad33750efd80b104664723e1115d1
// CraftBukkit start - Call redstone event
if (this.getBlock().getBlock() == Blocks.TRAPPED_CHEST) {
@@ -224,6 +238,7 @@ public class TileEntityChest extends TileEntityLootable implements ITickable {
@@ -249,6 +263,7 @@ public class TileEntityChest extends TileEntityLootable implements ITickable {
--this.viewingCount;
// CraftBukkit start - Call redstone event
@ -141,19 +129,20 @@ index 8e5ceacf7f6ed0d639d7850334d8a01a74aef6e3..54cad33750efd80b104664723e1115d1
if (this.getBlock().getBlock() == Blocks.TRAPPED_CHEST) {
int newPower = Math.max(0, Math.min(15, this.viewingCount));
diff --git a/src/main/java/net/minecraft/server/TileEntityEnderChest.java b/src/main/java/net/minecraft/server/TileEntityEnderChest.java
index 4ee3520882df2f6f358f3f61dc42c20129984b72..80440aa24f546dd151e89b705322d9c3e906b139 100644
--- a/src/main/java/net/minecraft/server/TileEntityEnderChest.java
+++ b/src/main/java/net/minecraft/server/TileEntityEnderChest.java
@@ -1,6 +1,6 @@
package net.minecraft.server;
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntityEnderChest.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntityEnderChest.java
index 930f1bd091d9754f7ca5d9e36cdf49b2be03eb23..385aed0f8bd9992e0c30d8fca5be4f49bc321183 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityEnderChest.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityEnderChest.java
@@ -5,7 +5,7 @@ import net.minecraft.sounds.SoundEffects;
import net.minecraft.world.entity.player.EntityHuman;
import net.minecraft.world.level.block.Blocks;
-public class TileEntityEnderChest extends TileEntity implements ITickable {
+public class TileEntityEnderChest extends TileEntity { // Paper - Remove ITickable
public float a;
public float b;
@@ -11,18 +11,28 @@ public class TileEntityEnderChest extends TileEntity implements ITickable {
@@ -16,18 +16,28 @@ public class TileEntityEnderChest extends TileEntity implements ITickable {
super(TileEntityTypes.ENDER_CHEST);
}
@ -183,7 +172,7 @@ index 4ee3520882df2f6f358f3f61dc42c20129984b72..80440aa24f546dd151e89b705322d9c3
if (this.c > 0 && this.a == 0.0F) {
double d1 = (double) i + 0.5D;
@@ -30,8 +40,17 @@ public class TileEntityEnderChest extends TileEntity implements ITickable {
@@ -35,8 +45,17 @@ public class TileEntityEnderChest extends TileEntity implements ITickable {
d0 = (double) k + 0.5D;
this.world.playSound((EntityHuman) null, d1, (double) j + 0.5D, d0, SoundEffects.BLOCK_ENDER_CHEST_OPEN, SoundCategory.BLOCKS, 0.5F, this.world.random.nextFloat() * 0.1F + 0.9F);
}
@ -202,7 +191,7 @@ index 4ee3520882df2f6f358f3f61dc42c20129984b72..80440aa24f546dd151e89b705322d9c3
float f1 = this.a;
if (this.c > 0) {
@@ -47,11 +66,14 @@ public class TileEntityEnderChest extends TileEntity implements ITickable {
@@ -52,11 +71,14 @@ public class TileEntityEnderChest extends TileEntity implements ITickable {
float f2 = 0.5F;
if (this.a < 0.5F && f1 >= 0.5F) {
@ -218,7 +207,7 @@ index 4ee3520882df2f6f358f3f61dc42c20129984b72..80440aa24f546dd151e89b705322d9c3
if (this.a < 0.0F) {
this.a = 0.0F;
@@ -79,11 +101,13 @@ public class TileEntityEnderChest extends TileEntity implements ITickable {
@@ -84,11 +106,13 @@ public class TileEntityEnderChest extends TileEntity implements ITickable {
public void d() {
++this.c;
this.world.playBlockAction(this.position, Blocks.ENDER_CHEST, 1, this.c);
@ -232,3 +221,15 @@ index 4ee3520882df2f6f358f3f61dc42c20129984b72..80440aa24f546dd151e89b705322d9c3
}
public boolean a(EntityHuman entityhuman) {
diff --git a/src/main/java/net/minecraft/world/level/block/state/IBlockDataHolder.java b/src/main/java/net/minecraft/world/level/block/state/IBlockDataHolder.java
index e4b59a85ee9b435b2e86d4c7d78b7224773f6967..ba046cffdd8331c7e0427f19fa54d0c7a99077d9 100644
--- a/src/main/java/net/minecraft/world/level/block/state/IBlockDataHolder.java
+++ b/src/main/java/net/minecraft/world/level/block/state/IBlockDataHolder.java
@@ -84,6 +84,7 @@ public abstract class IBlockDataHolder<O, S> {
return Collections.unmodifiableCollection(this.b.keySet());
}
+ public <T extends Comparable<T>> boolean contains(IBlockState<T> iblockstate) { return this.b(iblockstate); } // Paper - OBFHELPER
public <T extends Comparable<T>> boolean b(IBlockState<T> iblockstate) {
return this.b.containsKey(iblockstate);
}

View File

@ -12,10 +12,10 @@ Previous implementation did not calculate TPS correctly.
Switch to a realistic rolling average and factor in std deviation as an extra reporting variable
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 82768ab4663b6dc220212581f92bf8c5188c73b5..f54300a107477e6b6aa79114212f0088dc4f5be5 100644
index 60a768ea8ffa965dd309c05bebddf5563b5e1992..2b3c32bda846b1a559f9a9d9d6870cb4ec6bfe12 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -146,7 +146,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
@@ -253,7 +253,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
public org.bukkit.command.ConsoleCommandSender console;
public org.bukkit.command.RemoteConsoleCommandSender remoteConsole;
public ConsoleReader reader;
@ -24,7 +24,7 @@ index 82768ab4663b6dc220212581f92bf8c5188c73b5..f54300a107477e6b6aa79114212f0088
public java.util.Queue<Runnable> processQueue = new java.util.concurrent.ConcurrentLinkedQueue<Runnable>();
public int autosavePeriod;
public CommandDispatcher vanillaCommandDispatcher;
@@ -155,7 +155,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
@@ -262,7 +262,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
// Spigot start
public static final int TPS = 20;
public static final int TICK_TIME = 1000000000 / TPS;
@ -33,7 +33,7 @@ index 82768ab4663b6dc220212581f92bf8c5188c73b5..f54300a107477e6b6aa79114212f0088
public final double[] recentTps = new double[ 3 ];
public final SlackActivityAccountant slackActivityAccountant = new SlackActivityAccountant();
// Spigot end
@@ -808,6 +808,57 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
@@ -915,6 +915,57 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
{
return ( avg * exp ) + ( tps * ( 1 - exp ) );
}
@ -91,7 +91,7 @@ index 82768ab4663b6dc220212581f92bf8c5188c73b5..f54300a107477e6b6aa79114212f0088
// Spigot End
protected void w() {
@@ -820,30 +871,38 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
@@ -927,30 +978,38 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
// Spigot start
Arrays.fill( recentTps, 20 );
@ -140,7 +140,7 @@ index 82768ab4663b6dc220212581f92bf8c5188c73b5..f54300a107477e6b6aa79114212f0088
GameProfilerTick gameprofilertick = GameProfilerTick.a("Server");
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 6352c45db0053ce75356494ffa3b31b42d6e6414..2832610d080db4d8a6c26d946c441306404f6aba 100644
index 1818a6af3a55d15be698d5219e0eea63e2077611..f84fe5929cb7bcedff5fc587163380172bc1e8be 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2113,6 +2113,17 @@ public final class CraftServer implements Server {

View File

@ -4,11 +4,39 @@ Date: Tue, 1 Mar 2016 23:45:08 -0600
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
index dc996792df6046d442565a7993ec299af6605d92..c6b91de58c0190aca0455aacc04994f8ea5d81b7 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -162,6 +162,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
diff --git a/src/main/java/net/minecraft/nbt/NBTTagList.java b/src/main/java/net/minecraft/nbt/NBTTagList.java
index 4f6f6f51f9807bafa88482c0fe776c8b163107d7..ce6572df63c4e7341708aee60330fb214a3fe416 100644
--- a/src/main/java/net/minecraft/nbt/NBTTagList.java
+++ b/src/main/java/net/minecraft/nbt/NBTTagList.java
@@ -190,6 +190,7 @@ public class NBTTagList extends NBTList<NBTBase> {
return new int[0];
}
+ public final double getDoubleAt(int i) { return this.h(i); } // Paper - OBFHELPER
public double h(int i) {
if (i >= 0 && i < this.list.size()) {
NBTBase nbtbase = (NBTBase) this.list.get(i);
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
index 038944613b6687c057e73eaa038c9492bda7116d..09fa1f8e4e2ccf03fafe477bb9dc32b2a72b41bb 100644
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
@@ -1244,6 +1244,11 @@ public class WorldServer extends World implements GeneratorAccessSeed {
this.navigators.add(((EntityInsentient) entity).getNavigation());
}
entity.valid = true; // CraftBukkit
+ // Paper start - Set origin location when the entity is being added to the world
+ if (entity.origin == null) {
+ entity.origin = entity.getBukkitEntity().getLocation();
+ }
+ // Paper end
}
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index ca620977666f4d4173089876f506f041ab278bd3..dce47ec1fc186d12ffa30bfd3d71870aecb95d40 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -247,6 +247,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
public org.bukkit.projectiles.ProjectileSource projectileSource; // For projectiles only
public boolean forceExplosionKnockback; // SPIGOT-949
public boolean persistentInvisibility = false;
@ -16,7 +44,7 @@ index dc996792df6046d442565a7993ec299af6605d92..c6b91de58c0190aca0455aacc04994f8
// Spigot start
public final org.spigotmc.ActivationRange.ActivationType activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this);
public final boolean defaultActivationState;
@@ -1540,6 +1541,11 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -1625,6 +1626,11 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
this.bukkitEntity.storeBukkitValues(nbttagcompound);
}
// CraftBukkit end
@ -28,7 +56,7 @@ index dc996792df6046d442565a7993ec299af6605d92..c6b91de58c0190aca0455aacc04994f8
return nbttagcompound;
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.a(throwable, "Saving entity NBT");
@@ -1662,6 +1668,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -1747,6 +1753,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
}
// CraftBukkit end
@ -42,7 +70,7 @@ index dc996792df6046d442565a7993ec299af6605d92..c6b91de58c0190aca0455aacc04994f8
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.a(throwable, "Loading entity NBT");
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Entity being loaded");
@@ -1723,6 +1736,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -1808,6 +1821,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
protected abstract void saveData(NBTTagCompound nbttagcompound);
@ -50,11 +78,11 @@ index dc996792df6046d442565a7993ec299af6605d92..c6b91de58c0190aca0455aacc04994f8
protected NBTTagList a(double... adouble) {
NBTTagList nbttaglist = new NBTTagList();
double[] adouble1 = adouble;
diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java
index 6b226c04d40adff8b0f1d28c0cc79439df002b3d..bdeabfaeb17778a12ab4ad72689a72b043efcff4 100644
--- a/src/main/java/net/minecraft/server/EntityFallingBlock.java
+++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java
@@ -254,6 +254,14 @@ public class EntityFallingBlock extends Entity {
diff --git a/src/main/java/net/minecraft/world/entity/item/EntityFallingBlock.java b/src/main/java/net/minecraft/world/entity/item/EntityFallingBlock.java
index 901522f24b8bc58861e46eda400dbab92bb6401d..3f10e41b18e09186635fd6f7c653b04db7b39d8e 100644
--- a/src/main/java/net/minecraft/world/entity/item/EntityFallingBlock.java
+++ b/src/main/java/net/minecraft/world/entity/item/EntityFallingBlock.java
@@ -293,6 +293,14 @@ public class EntityFallingBlock extends Entity {
this.block = Blocks.SAND.getBlockData();
}
@ -69,11 +97,11 @@ index 6b226c04d40adff8b0f1d28c0cc79439df002b3d..bdeabfaeb17778a12ab4ad72689a72b0
}
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
index 914ff5b7a9787ae5e8d5b8829e6888ba2637cc26..f71e82c365947de822be7b87083b46bd7ce4b902 100644
--- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java
+++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
@@ -105,6 +105,14 @@ public class EntityTNTPrimed extends Entity {
diff --git a/src/main/java/net/minecraft/world/entity/item/EntityTNTPrimed.java b/src/main/java/net/minecraft/world/entity/item/EntityTNTPrimed.java
index 4f4b2b8d58223fa22d6a7af5c94cfb36399b9641..535e7d7297d81026b8586d5049b72fa65519b464 100644
--- a/src/main/java/net/minecraft/world/entity/item/EntityTNTPrimed.java
+++ b/src/main/java/net/minecraft/world/entity/item/EntityTNTPrimed.java
@@ -120,6 +120,14 @@ public class EntityTNTPrimed extends Entity {
@Override
protected void loadData(NBTTagCompound nbttagcompound) {
this.setFuseTicks(nbttagcompound.getShort("Fuse"));
@ -88,39 +116,11 @@ index 914ff5b7a9787ae5e8d5b8829e6888ba2637cc26..f71e82c365947de822be7b87083b46bd
}
@Nullable
diff --git a/src/main/java/net/minecraft/server/NBTTagList.java b/src/main/java/net/minecraft/server/NBTTagList.java
index ad8a506bb430b26fe147a657a2f826daf9bf4d45..ad4807e0bdd6409bd798f995da8f43cec1d0b385 100644
--- a/src/main/java/net/minecraft/server/NBTTagList.java
+++ b/src/main/java/net/minecraft/server/NBTTagList.java
@@ -188,6 +188,7 @@ public class NBTTagList extends NBTList<NBTBase> {
return new int[0];
}
+ public final double getDoubleAt(int i) { return this.h(i); } // Paper - OBFHELPER
public double h(int i) {
if (i >= 0 && i < this.list.size()) {
NBTBase nbtbase = (NBTBase) this.list.get(i);
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 3d915105b277a7cbf330ba2cb3c2f1451ee868e4..02dac635cce43edea05ed4961711ea5394613971 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1135,6 +1135,11 @@ public class WorldServer extends World implements GeneratorAccessSeed {
this.navigators.add(((EntityInsentient) entity).getNavigation());
}
entity.valid = true; // CraftBukkit
+ // Paper start - Set origin location when the entity is being added to the world
+ if (entity.origin == null) {
+ entity.origin = entity.getBukkitEntity().getLocation();
+ }
+ // Paper end
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index d46ba8d0e3b02a76c02dcc39c87a8bb6c9073149..2ed97dc772535f2364406c298d06fada8167fb74 100644
index 3cf81734c8580f4d88ea97b6ac737a370b413c84..220bad90bbb9a90c3f23562bf0fb109fce379682 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -1063,4 +1063,12 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@@ -1062,4 +1062,12 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
return spigot;
}
// Spigot end

View File

@ -4,29 +4,11 @@ Date: Tue, 1 Mar 2016 23:52:34 -0600
Subject: [PATCH] Prevent tile entity and entity crashes
diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java
index c8aa347baf100b25694ed9172590b073db810fe9..5414858ba241c13d4e568191d11111d3d3ec3fc4 100644
--- a/src/main/java/net/minecraft/server/TileEntity.java
+++ b/src/main/java/net/minecraft/server/TileEntity.java
@@ -197,7 +197,12 @@ public abstract class TileEntity implements KeyedObject { // Paper
return IRegistry.BLOCK_ENTITY_TYPE.getKey(this.getTileType()) + " // " + this.getClass().getCanonicalName();
});
if (this.world != null) {
- CrashReportSystemDetails.a(crashreportsystemdetails, this.position, this.getBlock());
+ // Paper start - Prevent TileEntity and Entity crashes
+ IBlockData block = this.getBlock();
+ if (block != null) {
+ CrashReportSystemDetails.a(crashreportsystemdetails, this.position, block);
+ }
+ // Paper end
CrashReportSystemDetails.a(crashreportsystemdetails, this.position, this.world.getType(this.position));
}
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 0f602de85bc7002150247b6cb26c6905f0e4f585..bc1946ea3060220f4598aae2e1aed3d84ab18387 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -685,11 +685,13 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java
index 62735e7908f86e31f7a89ce2071ddebe176c0385..87e37c38825ad20fc11f41ea2a4512753266d2b4 100644
--- a/src/main/java/net/minecraft/world/level/World.java
+++ b/src/main/java/net/minecraft/world/level/World.java
@@ -737,11 +737,13 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
gameprofilerfiller.exit();
} catch (Throwable throwable) {
@ -45,7 +27,7 @@ index 0f602de85bc7002150247b6cb26c6905f0e4f585..bc1946ea3060220f4598aae2e1aed3d8
// Spigot start
} finally {
tileentity.tickTimer.stopTiming();
@@ -754,11 +756,12 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@@ -806,11 +808,12 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
try {
consumer.accept(entity);
} catch (Throwable throwable) {
@ -63,3 +45,21 @@ index 0f602de85bc7002150247b6cb26c6905f0e4f585..bc1946ea3060220f4598aae2e1aed3d8
}
}
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntity.java
index da39fcb22d7656eedb8bf7d0774f50018b9fb02b..b1c220df7e00af79b548895cc9333ba85d5a447f 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntity.java
@@ -207,7 +207,12 @@ public abstract class TileEntity implements net.minecraft.server.KeyedObject { /
return IRegistry.BLOCK_ENTITY_TYPE.getKey(this.getTileType()) + " // " + this.getClass().getCanonicalName();
});
if (this.world != null) {
- CrashReportSystemDetails.a(crashreportsystemdetails, this.position, this.getBlock());
+ // Paper start - Prevent TileEntity and Entity crashes
+ IBlockData block = this.getBlock();
+ if (block != null) {
+ CrashReportSystemDetails.a(crashreportsystemdetails, this.position, block);
+ }
+ // Paper end
CrashReportSystemDetails.a(crashreportsystemdetails, this.position, this.world.getType(this.position));
}
}

View File

@ -28,11 +28,11 @@ index d16ae924bcbe31c964f7fb448757c748e5c4418c..4bba6977a0287837b8927718c040ac61
+ }
+ }
}
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 48ebaa4cdb5d5f52334e7bd4f80309a10ecedfa9..8850047050ca8a608c156b63bc6e05eaef140d03 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -415,9 +415,16 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index dce47ec1fc186d12ffa30bfd3d71870aecb95d40..cf92de7c138ef9cbbc1263bee29b9d0017b45827 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -500,9 +500,16 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
this.fallDistance *= 0.5F;
}
@ -49,7 +49,7 @@ index 48ebaa4cdb5d5f52334e7bd4f80309a10ecedfa9..8850047050ca8a608c156b63bc6e05ea
if (!this.world.isClientSide) {
this.setFlag(0, this.fireTicks > 0);
@@ -510,6 +517,17 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -595,6 +602,17 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
this.setFireTicks(0);
}
@ -67,11 +67,11 @@ index 48ebaa4cdb5d5f52334e7bd4f80309a10ecedfa9..8850047050ca8a608c156b63bc6e05ea
protected void an() {
this.die();
}
diff --git a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java
index dcd381069c2fd4d037ae0bcf710b9ff6ee30bb8f..35b5d41084b47de6a1185e23970ebe21875668d6 100644
--- a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java
+++ b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java
@@ -292,9 +292,15 @@ public abstract class EntityMinecartAbstract extends Entity {
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.java b/src/main/java/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.java
index 37785b27c3d9ffd010f09f53b2ca09941f609872..1f94cc096d95129d85a6278b1e369729df93d27d 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.java
@@ -330,9 +330,15 @@ public abstract class EntityMinecartAbstract extends Entity {
this.setDamage(this.getDamage() - 1.0F);
}

View File

@ -4,11 +4,11 @@ Date: Wed, 2 Mar 2016 00:03:55 -0600
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
index 88e0c5167ce545ef98868947b2722c55bbc46687..6a9e0e644801ddc5f18a47d15d5f6d5b6dc13004 100644
--- a/src/main/java/net/minecraft/server/WorldNBTStorage.java
+++ b/src/main/java/net/minecraft/server/WorldNBTStorage.java
@@ -49,7 +49,7 @@ public class WorldNBTStorage {
diff --git a/src/main/java/net/minecraft/world/level/storage/WorldNBTStorage.java b/src/main/java/net/minecraft/world/level/storage/WorldNBTStorage.java
index c3a1b5943b0dad8701d566c45b9b474dac7e5c8a..191c9e9a00b9871038f60d54bc22620322f6bdbd 100644
--- a/src/main/java/net/minecraft/world/level/storage/WorldNBTStorage.java
+++ b/src/main/java/net/minecraft/world/level/storage/WorldNBTStorage.java
@@ -56,7 +56,7 @@ public class WorldNBTStorage {
File file = new File(this.playerDir, entityhuman.getUniqueIDString() + ".dat");
// Spigot Start
boolean usingWrongFile = false;

View File

@ -5,18 +5,10 @@ Subject: [PATCH] Always tick falling blocks
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
index 093a11b6e355f9e1236ecca921ea55488d70451d..d44ef056bdab3bcff39aea45b40a4c7e9c62398f 100644
index 69c5d4e51ebf747d931fadc819973e36f001f5bc..58d22363124a9343188d8c19476e5a92f2f0b80b 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java
+++ b/src/main/java/org/spigotmc/ActivationRange.java
@@ -12,6 +12,7 @@ import net.minecraft.server.EntityCreature;
import net.minecraft.server.EntityCreeper;
import net.minecraft.server.EntityEnderCrystal;
import net.minecraft.server.EntityEnderDragon;
+import net.minecraft.server.EntityFallingBlock; // Paper
import net.minecraft.server.EntityFireball;
import net.minecraft.server.EntityFireworks;
import net.minecraft.server.EntityHuman;
@@ -91,6 +92,7 @@ public class ActivationRange
@@ -91,6 +91,7 @@ public class ActivationRange
|| entity instanceof EntityFireball
|| entity instanceof EntityLightning
|| entity instanceof EntityTNTPrimed

View File

@ -19,11 +19,11 @@ index 4bba6977a0287837b8927718c040ac61463f0469..e6e18f309dc09ea9416ea37dcc697ddc
+ log("End credits disabled: " + disableEndCredits);
+ }
}
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 0445bffdd1a6c9548c5c98c1ea4fd2c0c517acf4..317d9688fb4bc8a885314a6879f561d5cb44fa26 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -63,7 +63,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
diff --git a/src/main/java/net/minecraft/server/level/EntityPlayer.java b/src/main/java/net/minecraft/server/level/EntityPlayer.java
index 0ff92d701d6ee5ce56eec624eece11de15195b41..a9eb414843381e7697c46af4b68f61b68755afde 100644
--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java
@@ -190,7 +190,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
private long ca = SystemUtils.getMonotonicMillis();
private Entity spectatedEntity;
public boolean worldChangeInvuln;
@ -32,7 +32,7 @@ index 0445bffdd1a6c9548c5c98c1ea4fd2c0c517acf4..317d9688fb4bc8a885314a6879f561d5
private final RecipeBookServer recipeBook = new RecipeBookServer();
private Vec3D cf;
private int cg;
@@ -768,6 +768,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -895,6 +895,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.decouple();
this.getWorldServer().removePlayer(this);
if (!this.viewingCredits) {

View File

@ -4,11 +4,11 @@ Date: Wed, 2 Mar 2016 01:39:52 -0600
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
index 583833f8634cb5b02cd8dcbb74c9876fb854bceb..afe61a1ddc75f155836411b6749198f71ed09919 100644
--- a/src/main/java/net/minecraft/server/Explosion.java
+++ b/src/main/java/net/minecraft/server/Explosion.java
@@ -154,7 +154,7 @@ public class Explosion {
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
index 9c1ad56e4362cd86e7ffe2aef7fd9ec301cf9002..7786a06ba09aacaa70c346e85a9eeed9f2ffec6e 100644
--- a/src/main/java/net/minecraft/world/level/Explosion.java
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
@@ -182,7 +182,7 @@ public class Explosion {
int i1 = MathHelper.floor(this.posY + (double) f2 + 1.0D);
int j1 = MathHelper.floor(this.posZ - (double) f2 - 1.0D);
int k1 = MathHelper.floor(this.posZ + (double) f2 + 1.0D);

View File

@ -24,11 +24,23 @@ index e6e18f309dc09ea9416ea37dcc697ddc2b571a96..4881b03d470646843bad1bc343eb6a6a
+ log("Optimize explosions: " + optimizeExplosions);
+ }
}
diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java
index afe61a1ddc75f155836411b6749198f71ed09919..ac39b02ec5f02f6f2db9f293513686d2d29d4036 100644
--- a/src/main/java/net/minecraft/server/Explosion.java
+++ b/src/main/java/net/minecraft/server/Explosion.java
@@ -173,7 +173,7 @@ public class Explosion {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 2b3c32bda846b1a559f9a9d9d6870cb4ec6bfe12..2c295e070a0418c7d3bc4a4a531df699acadb0ff 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1316,6 +1316,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
this.methodProfiler.exit();
this.methodProfiler.exit();
+ worldserver.explosionDensityCache.clear(); // Paper - Optimize explosions
}
this.methodProfiler.exitEnter("connection");
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
index 7786a06ba09aacaa70c346e85a9eeed9f2ffec6e..6a7af2c0c3c294b10c6ddbf98babb0f30d7d5f56 100644
--- a/src/main/java/net/minecraft/world/level/Explosion.java
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
@@ -201,7 +201,7 @@ public class Explosion {
d8 /= d11;
d9 /= d11;
d10 /= d11;
@ -37,7 +49,7 @@ index afe61a1ddc75f155836411b6749198f71ed09919..ac39b02ec5f02f6f2db9f293513686d2
double d13 = (1.0D - d7) * d12;
// CraftBukkit start
@@ -392,4 +392,84 @@ public class Explosion {
@@ -420,4 +420,84 @@ public class Explosion {
private Effect() {}
}
@ -122,23 +134,11 @@ index afe61a1ddc75f155836411b6749198f71ed09919..ac39b02ec5f02f6f2db9f293513686d2
+ }
+ // Paper end
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index f54300a107477e6b6aa79114212f0088dc4f5be5..38b0863bf470682b9afaab016c5c41af65800e5d 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1209,6 +1209,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
this.methodProfiler.exit();
this.methodProfiler.exit();
+ worldserver.explosionDensityCache.clear(); // Paper - Optimize explosions
}
this.methodProfiler.exitEnter("connection");
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index bc1946ea3060220f4598aae2e1aed3d84ab18387..e062f68b87bd70b128f46394881c09ad63278fdc 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -84,6 +84,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java
index 87e37c38825ad20fc11f41ea2a4512753266d2b4..06455fb3916e347c075c6aa84977dca7e25760c2 100644
--- a/src/main/java/net/minecraft/world/level/World.java
+++ b/src/main/java/net/minecraft/world/level/World.java
@@ -136,6 +136,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
private org.spigotmc.TickLimiter entityLimiter;
private org.spigotmc.TickLimiter tileLimiter;
private int tileTickPosition;

View File

@ -18,11 +18,11 @@ index 4881b03d470646843bad1bc343eb6a6ab9072d8e..2222c1bb5f8625eee4d88946e4bfdfa2
+ disableExplosionKnockback = getBoolean("disable-explosion-knockback", false);
+ }
}
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index d41638b97188ba58d2456d2f6c3c71fc79fe572a..9295f72aa5a2a95efa89fdc90ae7106540403042 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -1190,6 +1190,7 @@ public abstract class EntityLiving extends Entity {
diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java
index 98f5f1dcd0abf9272533bf3801bab316c9f0a12c..3598db4144141a8701a2879be13a81a8ee48018c 100644
--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java
+++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java
@@ -1283,6 +1283,7 @@ public abstract class EntityLiving extends Entity {
}
}
@ -30,7 +30,7 @@ index d41638b97188ba58d2456d2f6c3c71fc79fe572a..9295f72aa5a2a95efa89fdc90ae71065
if (flag1) {
if (flag) {
this.world.broadcastEntityEffect(this, (byte) 29);
@@ -1208,6 +1209,7 @@ public abstract class EntityLiving extends Entity {
@@ -1301,6 +1302,7 @@ public abstract class EntityLiving extends Entity {
b0 = 2;
}
@ -38,7 +38,7 @@ index d41638b97188ba58d2456d2f6c3c71fc79fe572a..9295f72aa5a2a95efa89fdc90ae71065
this.world.broadcastEntityEffect(this, b0);
}
@@ -1231,6 +1233,7 @@ public abstract class EntityLiving extends Entity {
@@ -1324,6 +1326,7 @@ public abstract class EntityLiving extends Entity {
}
}
@ -46,11 +46,11 @@ index d41638b97188ba58d2456d2f6c3c71fc79fe572a..9295f72aa5a2a95efa89fdc90ae71065
if (this.dl()) {
if (!this.f(damagesource)) {
SoundEffect soundeffect = this.getSoundDeath();
diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java
index ac39b02ec5f02f6f2db9f293513686d2d29d4036..471b48a52d564cb4989d211188f5c5b561ac7827 100644
--- a/src/main/java/net/minecraft/server/Explosion.java
+++ b/src/main/java/net/minecraft/server/Explosion.java
@@ -189,14 +189,14 @@ public class Explosion {
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
index 6a7af2c0c3c294b10c6ddbf98babb0f30d7d5f56..618cf4e0d71b4b04085807314e79a02785f8a498 100644
--- a/src/main/java/net/minecraft/world/level/Explosion.java
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
@@ -217,14 +217,14 @@ public class Explosion {
double d14 = d13;
if (entity instanceof EntityLiving) {

View File

@ -18,11 +18,11 @@ index 2222c1bb5f8625eee4d88946e4bfdfa2fe598977..083e421f8496b5336af473b108498ed2
+ disableThunder = getBoolean("disable-thunder", false);
+ }
}
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 89c22be536a45199a29d328b125bdcb9c2848d65..d61d1d5b15c14e673ca17648c66335991194b7bf 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -475,7 +475,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
index 09fa1f8e4e2ccf03fafe477bb9dc32b2a72b41bb..b9d9affab30c60a355552f92b44b574dc5074a5c 100644
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
@@ -584,7 +584,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
gameprofilerfiller.enter("thunder");
BlockPosition blockposition;

View File

@ -18,11 +18,11 @@ index 083e421f8496b5336af473b108498ed28b984774..2f7a5a4a5a7b29750cfd777e0bc5d19a
+ disableIceAndSnow = getBoolean("disable-ice-and-snow", false);
+ }
}
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index d61d1d5b15c14e673ca17648c66335991194b7bf..07f2cf8461343f054828a32f8bf48563321e666a 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -499,7 +499,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
index b9d9affab30c60a355552f92b44b574dc5074a5c..eddfbd25953e8ef410f1617a1edecbc7d07696c0 100644
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
@@ -608,7 +608,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
}
gameprofilerfiller.exitEnter("iceandsnow");

View File

@ -18,11 +18,11 @@ index 2f7a5a4a5a7b29750cfd777e0bc5d19a14e93fa2..4de86b09c6bc3c1974ce61b550ccb73d
+ mobSpawnerTickRate = getInt("mob-spawner-tick-rate", 1);
+ }
}
diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
index 1741ec5e241f8ae7a3c30a9021d14cb0224da840..259713339217660e8b81a9500f57c6995ea59dde 100644
--- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
+++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
@@ -24,6 +24,7 @@ public abstract class MobSpawnerAbstract {
diff --git a/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java b/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java
index 8d8b03074df1635946f81bec0feae18d2f3e20aa..76c98d576d3e567ec4482b30219f5a9107cb9703 100644
--- a/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java
+++ b/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java
@@ -41,6 +41,7 @@ public abstract class MobSpawnerAbstract {
public int maxNearbyEntities = 6;
public int requiredPlayerRange = 16;
public int spawnRange = 4;
@ -30,7 +30,7 @@ index 1741ec5e241f8ae7a3c30a9021d14cb0224da840..259713339217660e8b81a9500f57c699
public MobSpawnerAbstract() {}
@@ -53,6 +54,10 @@ public abstract class MobSpawnerAbstract {
@@ -70,6 +71,10 @@ public abstract class MobSpawnerAbstract {
}
public void c() {
@ -41,7 +41,7 @@ index 1741ec5e241f8ae7a3c30a9021d14cb0224da840..259713339217660e8b81a9500f57c699
if (!this.h()) {
this.f = this.e;
} else {
@@ -67,18 +72,18 @@ public abstract class MobSpawnerAbstract {
@@ -84,18 +89,18 @@ public abstract class MobSpawnerAbstract {
world.addParticle(Particles.SMOKE, d0, d1, d2, 0.0D, 0.0D, 0.0D);
world.addParticle(Particles.FLAME, d0, d1, d2, 0.0D, 0.0D, 0.0D);
if (this.spawnDelay > 0) {

View File

@ -4,10 +4,10 @@ Date: Wed, 2 Mar 2016 23:13:07 -0600
Subject: [PATCH] Send absolute position the first time an entity is seen
diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
index 62a7db8c7d2604d248ec5c1efb3c43356c3d513c..dec48226d713ef0198ef3c679daf553a9d05a099 100644
--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java
+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
diff --git a/src/main/java/net/minecraft/server/level/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/level/EntityTrackerEntry.java
index a95867c0ba7dec750e07a4ac623ee30b4522fe55..f5227aa761d326376d057eaadcdbef024ed30241 100644
--- a/src/main/java/net/minecraft/server/level/EntityTrackerEntry.java
+++ b/src/main/java/net/minecraft/server/level/EntityTrackerEntry.java
@@ -4,6 +4,7 @@ import com.google.common.collect.Lists;
import com.mojang.datafixers.util.Pair;
import java.util.Collection;
@ -16,7 +16,7 @@ index 62a7db8c7d2604d248ec5c1efb3c43356c3d513c..dec48226d713ef0198ef3c679daf553a
import java.util.Iterator;
import java.util.List;
import java.util.Set;
@@ -23,7 +24,7 @@ public class EntityTrackerEntry {
@@ -52,7 +53,7 @@ public class EntityTrackerEntry {
private final Entity tracker;
private final int d;
private final boolean e;
@ -25,7 +25,7 @@ index 62a7db8c7d2604d248ec5c1efb3c43356c3d513c..dec48226d713ef0198ef3c679daf553a
private long xLoc;
private long yLoc;
private long zLoc;
@@ -38,8 +39,23 @@ public class EntityTrackerEntry {
@@ -67,8 +68,23 @@ public class EntityTrackerEntry {
private boolean r;
// CraftBukkit start
private final Set<EntityPlayer> trackedPlayers;
@ -49,7 +49,7 @@ index 62a7db8c7d2604d248ec5c1efb3c43356c3d513c..dec48226d713ef0198ef3c679daf553a
this.trackedPlayers = trackedPlayers;
// CraftBukkit end
this.m = Vec3D.ORIGIN;
@@ -161,7 +177,25 @@ public class EntityTrackerEntry {
@@ -190,7 +206,25 @@ public class EntityTrackerEntry {
}
if (packet1 != null) {
@ -76,11 +76,11 @@ index 62a7db8c7d2604d248ec5c1efb3c43356c3d513c..dec48226d713ef0198ef3c679daf553a
}
this.c();
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 5ca081e8be411aee98efce3e41876efe3bb2e327..2ba10ed683788219c734a565a163ba553ec72c75 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -1250,10 +1250,14 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
diff --git a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
index 8219ffea086a446a682479ae21ca7d56a598751a..21282ce37e55cbca027c7542c148928fd4e69dfc 100644
--- a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
@@ -1294,10 +1294,14 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
private final Entity tracker;
private final int trackingDistance;
private SectionPosition e;
@ -97,7 +97,7 @@ index 5ca081e8be411aee98efce3e41876efe3bb2e327..2ba10ed683788219c734a565a163ba55
this.tracker = entity;
this.trackingDistance = i;
this.e = SectionPosition.a(entity);
@@ -1335,7 +1339,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1379,7 +1383,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
entityplayer.removeQueue.remove(Integer.valueOf(this.tracker.getId()));
// CraftBukkit end

View File

@ -4,11 +4,11 @@ Date: Wed, 2 Mar 2016 23:30:53 -0600
Subject: [PATCH] Add BeaconEffectEvent
diff --git a/src/main/java/net/minecraft/server/TileEntityBeacon.java b/src/main/java/net/minecraft/server/TileEntityBeacon.java
index 1305506d27010e4be03032c9863bed186e2bff06..fdf73eca821bab5ec7a742645893793679b5d42c 100644
--- a/src/main/java/net/minecraft/server/TileEntityBeacon.java
+++ b/src/main/java/net/minecraft/server/TileEntityBeacon.java
@@ -12,6 +12,11 @@ import javax.annotation.Nullable;
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntityBeacon.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntityBeacon.java
index c6914c8d2a3d1057c98537a3538097d3ac6149e0..f9b1ab0e19ff398a16b1452e86f1a165a4b54219 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityBeacon.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityBeacon.java
@@ -42,6 +42,11 @@ import net.minecraft.world.phys.AxisAlignedBB;
import org.bukkit.craftbukkit.potion.CraftPotionUtil;
import org.bukkit.potion.PotionEffect;
// CraftBukkit end
@ -20,7 +20,7 @@ index 1305506d27010e4be03032c9863bed186e2bff06..fdf73eca821bab5ec7a7426458937936
public class TileEntityBeacon extends TileEntity implements ITileInventory, ITickable {
@@ -238,14 +243,31 @@ public class TileEntityBeacon extends TileEntity implements ITileInventory, ITic
@@ -268,14 +273,31 @@ public class TileEntityBeacon extends TileEntity implements ITileInventory, ITic
}
private void applyEffect(List list, MobEffectList effects, int i, int b0) {
@ -53,7 +53,7 @@ index 1305506d27010e4be03032c9863bed186e2bff06..fdf73eca821bab5ec7a7426458937936
}
}
}
@@ -268,10 +290,10 @@ public class TileEntityBeacon extends TileEntity implements ITileInventory, ITic
@@ -298,10 +320,10 @@ public class TileEntityBeacon extends TileEntity implements ITileInventory, ITic
int i = getLevel();
List list = getHumansInRange();

View File

@ -18,11 +18,11 @@ index 4de86b09c6bc3c1974ce61b550ccb73d37f6f170..5a4c3a8c511f22c8c3240c9c7cd83a65
+ containerUpdateTickRate = getInt("container-update-tick-rate", 1);
+ }
}
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 317d9688fb4bc8a885314a6879f561d5cb44fa26..5dd83b62d8d6f8f7b8483064be5658a439824052 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -82,6 +82,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
diff --git a/src/main/java/net/minecraft/server/level/EntityPlayer.java b/src/main/java/net/minecraft/server/level/EntityPlayer.java
index a9eb414843381e7697c46af4b68f61b68755afde..1f31104a1a350f3b53ce45b034cafe528d406291 100644
--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java
@@ -209,6 +209,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public boolean e;
public int ping;
public boolean viewingCredits;
@ -30,7 +30,7 @@ index 317d9688fb4bc8a885314a6879f561d5cb44fa26..5dd83b62d8d6f8f7b8483064be5658a4
// CraftBukkit start
public String displayName;
@@ -406,7 +407,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -533,7 +534,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
--this.noDamageTicks;
}

View File

@ -4,11 +4,11 @@ Date: Wed, 2 Mar 2016 23:45:17 -0600
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
index ca874ef00a925095c01767f5b41737302645f149..564e252a366ed5df602ea4d608f482c80a187606 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -655,9 +655,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java
index 06455fb3916e347c075c6aa84977dca7e25760c2..26d9388badb0328735abf0319a42bd633c90dc4b 100644
--- a/src/main/java/net/minecraft/world/level/World.java
+++ b/src/main/java/net/minecraft/world/level/World.java
@@ -707,9 +707,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
// Spigot start
// Iterator iterator = this.tileEntityListTick.iterator();
int tilesThisCycle = 0;

View File

@ -8,11 +8,11 @@ For modifying a player's initial spawn location as they join the server
This is a duplicate API from spigot, so use our duplicate subclass and
improve setPosition to use raw
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index d1b26d753774ef89638a1c5130b10f16a6c743d8..c71dea3e51c93cf1ad60b8a76408774d67552de8 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -140,7 +140,7 @@ public abstract class PlayerList {
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 15418868c2b92498139e66d913ee1c35b3abf0cf..cfd0af520dd3dcf364a3ffd03a74e3b9ee6045af 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -213,7 +213,7 @@ public abstract class PlayerList {
// Spigot start - spawn location event
Player bukkitPlayer = entityplayer.getBukkitEntity();
@ -21,12 +21,28 @@ index d1b26d753774ef89638a1c5130b10f16a6c743d8..c71dea3e51c93cf1ad60b8a76408774d
cserver.getPluginManager().callEvent(ev);
Location loc = ev.getSpawnLocation();
@@ -148,7 +148,7 @@ public abstract class PlayerList {
@@ -221,7 +221,10 @@ public abstract class PlayerList {
entityplayer.spawnIn(worldserver1);
entityplayer.playerInteractManager.a((WorldServer) entityplayer.world);
- entityplayer.setPosition(loc.getX(), loc.getY(), loc.getZ());
+ entityplayer.setPositionRaw(loc.getX(), loc.getY(), loc.getZ()); // Paper - set raw so we aren't fully joined to the world (not added to chunk or world)
entityplayer.setYawPitch(loc.getYaw(), loc.getPitch());
- entityplayer.setLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch());
+ // Paper start - set raw so we aren't fully joined to the world (not added to chunk or world)
+ entityplayer.setPositionRaw(loc.getX(), loc.getY(), loc.getZ());
+ entityplayer.setYawPitch(loc.getYaw(), loc.getPitch());
+ // Paper end
// Spigot end
// CraftBukkit - Moved message to after join
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index cf92de7c138ef9cbbc1263bee29b9d0017b45827..10cbf66f06b31c9a4cae2359b3fbb9988abb9278 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -398,7 +398,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
return d1 * d1 + d2 * d2 + d3 * d3 < d0 * d0;
}
- protected void setYawPitch(float f, float f1) {
+ public void setYawPitch(float f, float f1) { // Paper - protected -> public
// CraftBukkit start - yaw was sometimes set to NaN, so we need to set it back to 0
if (Float.isNaN(f)) {
f = 0;

View File

@ -19,11 +19,11 @@ index 5a4c3a8c511f22c8c3240c9c7cd83a65119c1054..70e074cdf2087e638af8e0f3878d0ef8
+ disableChestCatDetection = getBoolean("game-mechanics.disable-chest-cat-detection", false);
+ }
}
diff --git a/src/main/java/net/minecraft/server/BlockChest.java b/src/main/java/net/minecraft/server/BlockChest.java
index fb7c0d45765e36181c809b250ba4eee5d21c5894..12a0230448dd8d56f6dc20e23cacaf0b8a9433d1 100644
--- a/src/main/java/net/minecraft/server/BlockChest.java
+++ b/src/main/java/net/minecraft/server/BlockChest.java
@@ -268,6 +268,11 @@ public class BlockChest extends BlockChestAbstract<TileEntityChest> implements I
diff --git a/src/main/java/net/minecraft/world/level/block/BlockChest.java b/src/main/java/net/minecraft/world/level/block/BlockChest.java
index b229faad99120c67b089f7680d800fbe594fe7da..b2c29cff5883868cb56a4e376ab946ac929abc94 100644
--- a/src/main/java/net/minecraft/world/level/block/BlockChest.java
+++ b/src/main/java/net/minecraft/world/level/block/BlockChest.java
@@ -312,6 +312,11 @@ public class BlockChest extends BlockChestAbstract<TileEntityChest> implements I
}
private static boolean b(GeneratorAccess generatoraccess, BlockPosition blockposition) {

View File

@ -13,11 +13,11 @@ This change will synchronize the command execution back to the main thread, caus
big slowdown in execution but throwing an exception at same time to raise awareness
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
index 5636a76f1a893dc0609f16a240ae559396a4b46d..bb74049fb2baffbe67f9e34cc0ee0b83180d02eb 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -1706,6 +1706,29 @@ public class PlayerConnection implements PacketListenerPlayIn {
diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java
index c417250f66805788d63434e2c360349a39996176..a70fb56b0f44372cc62adbb9a263684224c264d2 100644
--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java
@@ -1851,6 +1851,29 @@ public class PlayerConnection implements PacketListenerPlayIn {
}
if (!async && s.startsWith("/")) {
@ -48,7 +48,7 @@ index 5636a76f1a893dc0609f16a240ae559396a4b46d..bb74049fb2baffbe67f9e34cc0ee0b83
} else if (this.player.getChatFlags() == EnumChatVisibility.SYSTEM) {
// 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
index 4fdc38de35ce2f3ec20c6892bc9eb39ec0366498..66cbc94b8d5cb9e435e0fb32596f8f3cef0a49a5 100644
index f84fe5929cb7bcedff5fc587163380172bc1e8be..8e9547fc745e8244ca1f439770571ca1175ff632 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -762,6 +762,29 @@ public final class CraftServer implements Server {
@ -106,7 +106,7 @@ index aeed7697254af17ffefe8e578353ad216e15f9f3..9f7d2ef932ab41cef5d3d0736d20a7c7
public static void catchOp(String reason)
{
diff --git a/src/main/java/org/spigotmc/RestartCommand.java b/src/main/java/org/spigotmc/RestartCommand.java
index 56445844c7f542dd74c166bb09abd79cc17e1e12..26795b22e3ebc9594af79f93506a3c217cb784e2 100644
index d76e01d73da7413f192132134caf201d7780e3f1..a45155cdd7d7a302c119f75bfe2b428ae5e8ab47 100644
--- a/src/main/java/org/spigotmc/RestartCommand.java
+++ b/src/main/java/org/spigotmc/RestartCommand.java
@@ -43,6 +43,7 @@ public class RestartCommand extends Command

View File

@ -18,11 +18,11 @@ index 70e074cdf2087e638af8e0f3878d0ef8eb7305cc..416a6760883cb40367535c7c5acd7797
+ allChunksAreSlimeChunks = getBoolean("all-chunks-are-slime-chunks", false);
+ }
}
diff --git a/src/main/java/net/minecraft/server/EntitySlime.java b/src/main/java/net/minecraft/server/EntitySlime.java
index d6ecdbfcebeda8e9f599d7ac28e7cdaa8dc852a8..d774a0893b2e6599bade3a9edf22668a30587503 100644
--- a/src/main/java/net/minecraft/server/EntitySlime.java
+++ b/src/main/java/net/minecraft/server/EntitySlime.java
@@ -286,7 +286,7 @@ public class EntitySlime extends EntityInsentient implements IMonster {
diff --git a/src/main/java/net/minecraft/world/entity/monster/EntitySlime.java b/src/main/java/net/minecraft/world/entity/monster/EntitySlime.java
index 292789d76da400d15d0742e2e0979f4ac6ec4b75..01d5b0db9a34d88172e8c7c84c4e1d0b2562217c 100644
--- a/src/main/java/net/minecraft/world/entity/monster/EntitySlime.java
+++ b/src/main/java/net/minecraft/world/entity/monster/EntitySlime.java
@@ -325,7 +325,7 @@ public class EntitySlime extends EntityInsentient implements IMonster {
}
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(blockposition);

View File

@ -4,23 +4,11 @@ Date: Thu, 3 Mar 2016 02:32:10 -0600
Subject: [PATCH] Player Tab List and Title APIs
diff --git a/src/main/java/net/minecraft/server/IChatBaseComponent.java b/src/main/java/net/minecraft/server/IChatBaseComponent.java
index 921fe6399745318c18570360fb438c45762b1b8e..2b8916e3b3ecfd3917b5acf3ea6dfc2793e242c8 100644
--- a/src/main/java/net/minecraft/server/IChatBaseComponent.java
+++ b/src/main/java/net/minecraft/server/IChatBaseComponent.java
@@ -359,6 +359,7 @@ public interface IChatBaseComponent extends Message, IChatFormatted, Iterable<IC
return IChatBaseComponent.ChatSerializer.a.toJsonTree(ichatbasecomponent);
}
+ @Nullable public static IChatBaseComponent jsonToComponent(String json) { return a(json);} // Paper - OBFHELPER
@Nullable
public static IChatMutableComponent a(String s) {
return (IChatMutableComponent) ChatDeserializer.a(IChatBaseComponent.ChatSerializer.a, s, IChatMutableComponent.class, false);
diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java
index 6c9aed49d5e63d6df608719ed17e813f86e93fcc..391f96e585d80f7921fd96f207b0b60d88961ae7 100644
--- a/src/main/java/net/minecraft/server/PacketDataSerializer.java
+++ b/src/main/java/net/minecraft/server/PacketDataSerializer.java
@@ -158,6 +158,11 @@ public class PacketDataSerializer extends ByteBuf {
diff --git a/src/main/java/net/minecraft/network/PacketDataSerializer.java b/src/main/java/net/minecraft/network/PacketDataSerializer.java
index 5f1c5dd7902f6cff5acae05e8c6bf58a1ba5bdf1..df459918c14589155a574730205cb35d463b8079 100644
--- a/src/main/java/net/minecraft/network/PacketDataSerializer.java
+++ b/src/main/java/net/minecraft/network/PacketDataSerializer.java
@@ -171,6 +171,11 @@ public class PacketDataSerializer extends ByteBuf {
public PacketDataSerializer writeComponent(final net.kyori.adventure.text.Component component) {
return this.writeUtf(PaperAdventure.asJsonString(component, this.adventure$locale), 262144);
}
@ -32,11 +20,23 @@ index 6c9aed49d5e63d6df608719ed17e813f86e93fcc..391f96e585d80f7921fd96f207b0b60d
// Paper end
public PacketDataSerializer a(IChatBaseComponent ichatbasecomponent) {
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutTitle.java b/src/main/java/net/minecraft/server/PacketPlayOutTitle.java
index 772ca6256964692a2b9c12e2edc532d2a8f51f7b..71168d9d0252e93253fa3b3f0bface3ae58757b7 100644
--- a/src/main/java/net/minecraft/server/PacketPlayOutTitle.java
+++ b/src/main/java/net/minecraft/server/PacketPlayOutTitle.java
@@ -44,6 +44,17 @@ public class PacketPlayOutTitle implements Packet<PacketListenerPlayOut> {
diff --git a/src/main/java/net/minecraft/network/chat/IChatBaseComponent.java b/src/main/java/net/minecraft/network/chat/IChatBaseComponent.java
index c7c191b0a9889450fdf495f5aa45d59f159f1401..e0fe2ba95bd3cb6afcf9c804007438a513c095b7 100644
--- a/src/main/java/net/minecraft/network/chat/IChatBaseComponent.java
+++ b/src/main/java/net/minecraft/network/chat/IChatBaseComponent.java
@@ -363,6 +363,7 @@ public interface IChatBaseComponent extends Message, IChatFormatted, Iterable<IC
return IChatBaseComponent.ChatSerializer.a.toJsonTree(ichatbasecomponent);
}
+ @Nullable public static IChatBaseComponent jsonToComponent(String json) { return a(json);} // Paper - OBFHELPER
@Nullable
public static IChatMutableComponent a(String s) {
return (IChatMutableComponent) ChatDeserializer.a(IChatBaseComponent.ChatSerializer.a, s, IChatMutableComponent.class, false);
diff --git a/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutTitle.java b/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutTitle.java
index fff22c40ba38575951e8e4821ade22b29d580a89..c397c52e8e24b85d892e4906178720cc70edc143 100644
--- a/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutTitle.java
+++ b/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutTitle.java
@@ -47,6 +47,17 @@ public class PacketPlayOutTitle implements Packet<PacketListenerPlayOut> {
}
}
@ -54,7 +54,7 @@ index 772ca6256964692a2b9c12e2edc532d2a8f51f7b..71168d9d0252e93253fa3b3f0bface3a
@Override
public void b(PacketDataSerializer packetdataserializer) throws IOException {
@@ -52,6 +63,8 @@ public class PacketPlayOutTitle implements Packet<PacketListenerPlayOut> {
@@ -55,6 +66,8 @@ public class PacketPlayOutTitle implements Packet<PacketListenerPlayOut> {
// Paper start
if (this.adventure$text != null) {
packetdataserializer.writeComponent(this.adventure$text);
@ -64,7 +64,7 @@ index 772ca6256964692a2b9c12e2edc532d2a8f51f7b..71168d9d0252e93253fa3b3f0bface3a
// Paper end
packetdataserializer.a(this.b);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 2e7e2ed1bb7d42a6ac26a6da965ed4eed9c8b554..efc8f23b43f9b9765b3c49f9dde9fdbe64291cd4 100644
index 62f8d96f996ece87b7ab8d5d05d1dc214d10dbfa..9837f7364f3efd0aa22d33058bec369c41cd03ef 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1,5 +1,6 @@

View File

@ -4,11 +4,11 @@ Date: Thu, 3 Mar 2016 02:33:53 -0600
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
index 4ae2f06f527503bfdd366d8210a55ced073f0c52..1045bd6eaa977b0142b4496c3f872ffae767a0f1 100644
--- a/src/main/java/net/minecraft/server/Container.java
+++ b/src/main/java/net/minecraft/server/Container.java
@@ -223,7 +223,7 @@ public abstract class Container {
diff --git a/src/main/java/net/minecraft/world/inventory/Container.java b/src/main/java/net/minecraft/world/inventory/Container.java
index 2410214a300407ef20ea14244db5db2ebede2759..e9733fd9dac89d31dbad391cb22a8c84216045db 100644
--- a/src/main/java/net/minecraft/world/inventory/Container.java
+++ b/src/main/java/net/minecraft/world/inventory/Container.java
@@ -239,7 +239,7 @@ public abstract class Container {
this.d();
}
} else if (this.h == 1) {

View File

@ -5,11 +5,11 @@ Subject: [PATCH] Change implementation of (tile)entity removal list
use sets for faster removal
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 564e252a366ed5df602ea4d608f482c80a187606..895436e36e6ef6f78dfd42e3ef3a0132506663f2 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -37,7 +37,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java
index 26d9388badb0328735abf0319a42bd633c90dc4b..33469b719d679c65d4bcb8366008e6e107eb3a0b 100644
--- a/src/main/java/net/minecraft/world/level/World.java
+++ b/src/main/java/net/minecraft/world/level/World.java
@@ -89,7 +89,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
public final List<TileEntity> tileEntityList = Lists.newArrayList();
public final List<TileEntity> tileEntityListTick = Lists.newArrayList();
protected final List<TileEntity> tileEntityListPending = Lists.newArrayList();

View File

@ -22,11 +22,11 @@ index 416a6760883cb40367535c7c5acd779742bb8af5..670efbe53241a0ae32d618c83da601cc
+ portalSearchVanillaDimensionScaling = getBoolean("portal-search-vanilla-dimension-scaling", true);
+ }
}
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 8850047050ca8a608c156b63bc6e05eaef140d03..295fbae9946fda8061c5c7294cdaefc426d0edce 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -2528,7 +2528,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 10cbf66f06b31c9a4cae2359b3fbb9988abb9278..40eb6bae8ca4e2b57d4f91547808eb00ac1fd455 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2613,7 +2613,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
double d4 = DimensionManager.a(this.world.getDimensionManager(), worldserver.getDimensionManager());
BlockPosition blockposition = new BlockPosition(MathHelper.a(this.locX() * d4, d0, d2), this.locY(), MathHelper.a(this.locZ() * d4, d1, d3));
// CraftBukkit start
@ -41,11 +41,11 @@ index 8850047050ca8a608c156b63bc6e05eaef140d03..295fbae9946fda8061c5c7294cdaefc4
if (event == null) {
return null;
}
diff --git a/src/main/java/net/minecraft/server/PortalTravelAgent.java b/src/main/java/net/minecraft/server/PortalTravelAgent.java
index 150c688262e79b3b675685dbd1754b9e01cb4d75..e10995ec30dd9a10d781b3c1709fd2db5a9becdd 100644
--- a/src/main/java/net/minecraft/server/PortalTravelAgent.java
+++ b/src/main/java/net/minecraft/server/PortalTravelAgent.java
@@ -14,7 +14,7 @@ public class PortalTravelAgent {
diff --git a/src/main/java/net/minecraft/world/level/portal/PortalTravelAgent.java b/src/main/java/net/minecraft/world/level/portal/PortalTravelAgent.java
index 7b8e8a7dae47ecc42a57e3f9444caa2ee5b1ef3b..77dfa7eaf178baa55041a829c9dec4851efeedfc 100644
--- a/src/main/java/net/minecraft/world/level/portal/PortalTravelAgent.java
+++ b/src/main/java/net/minecraft/world/level/portal/PortalTravelAgent.java
@@ -31,7 +31,7 @@ public class PortalTravelAgent {
public Optional<BlockUtil.Rectangle> findPortal(BlockPosition blockposition, boolean flag) {
// CraftBukkit start

View File

@ -5,7 +5,7 @@ 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
index 5e97a52222dbccbdde7d478d76363495784facb8..f1aae33917fc8a61e38b410421c205a7bc5a13dd 100644
index 96d4049f8a42f00dbbc092b391ae11c1326a5501..f6a1d52239216984da4a9c87312c6ed085213935 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -262,6 +262,7 @@ public final class CraftServer implements Server {
@ -17,10 +17,10 @@ index 5e97a52222dbccbdde7d478d76363495784facb8..f1aae33917fc8a61e38b410421c205a7
static {
ConfigurationSerialization.registerClass(CraftOfflinePlayer.class);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 0582d15e14d4fde7630759849b573cb2e08fabe6..14c06298157c4a6c6061df01b213e69b6c3481d5 100644
index 220bad90bbb9a90c3f23562bf0fb109fce379682..a58626b1a0160983a738a45c8a1d411eb347e6a2 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -425,10 +425,41 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@@ -424,10 +424,41 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
public void setVelocity(Vector velocity) {
Preconditions.checkArgument(velocity != null, "velocity");
velocity.checkFinite();
@ -63,12 +63,12 @@ index 0582d15e14d4fde7630759849b573cb2e08fabe6..14c06298157c4a6c6061df01b213e69b
public double getHeight() {
return getHandle().getHeight();
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
index bf240231b70dbaf71f359318e5c0f8ba1490a067..0cb3028872041ce9f75e57fdd84b79636d8809f3 100644
index 1b3a14784cac8e855633fae6172ad5479ebe9877..69e5054886b5858664fed333aca8c25a76e5cb11 100644
--- a/src/main/java/org/spigotmc/WatchdogThread.java
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
@@ -80,7 +80,19 @@ public class WatchdogThread extends Thread
log.log( Level.SEVERE, "During the run of the server, a physics stackoverflow was supressed" );
log.log( Level.SEVERE, "near " + net.minecraft.server.World.lastPhysicsProblem );
log.log( Level.SEVERE, "near " + net.minecraft.world.level.World.lastPhysicsProblem );
}
- //
+ // Paper start - Warn in watchdog if an excessive velocity was ever set

View File

@ -48,22 +48,141 @@ index 0000000000000000000000000000000000000000..f699ce18ca044f813e194ef2786b7ea8
+ return internalTask;
+ }
+}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 0d0f36c62d260390827321aa6472f51a3a204c95..01655fd86f9a3218036f8b5404e233d32e0904a5 100644
--- 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/level/PlayerChunkMap.java b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
index 21282ce37e55cbca027c7542c148928fd4e69dfc..7702b0b86a5ccfe6eab81025cfc8c4a83ba52b7c 100644
--- a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
@@ -806,6 +806,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
return true;
} catch (Exception exception) {
PlayerChunkMap.LOGGER.error("Failed to save chunk {},{}", chunkcoordintpair.x, chunkcoordintpair.z, exception);
+ com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(exception); // Paper
return false;
}
}
diff --git a/src/main/java/net/minecraft/server/players/NameReferencingFileConverter.java b/src/main/java/net/minecraft/server/players/NameReferencingFileConverter.java
index 107979178e8be5ee6cf885d42f992fabf3bd00b0..8a343a857dc4661ba256e39cf391dd2c7a1cc970 100644
--- a/src/main/java/net/minecraft/server/players/NameReferencingFileConverter.java
+++ b/src/main/java/net/minecraft/server/players/NameReferencingFileConverter.java
@@ -1,5 +1,6 @@
package net.minecraft.server;
package net.minecraft.server.players;
+import com.destroystokyo.paper.exception.ServerInternalException;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.io.Files;
@@ -363,6 +364,7 @@ public class NameReferencingFileConverter {
root = NBTCompressedStreamTools.a(new java.io.FileInputStream(file5));
} catch (Exception exception) {
exception.printStackTrace();
+ ServerInternalException.reportInternalException(exception); // Paper
}
if (root != null) {
@@ -376,6 +378,7 @@ public class NameReferencingFileConverter {
NBTCompressedStreamTools.a(root, new java.io.FileOutputStream(file2));
} catch (Exception exception) {
exception.printStackTrace();
+ ServerInternalException.reportInternalException(exception); // Paper
}
}
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/world/entity/ai/village/VillageSiege.java b/src/main/java/net/minecraft/world/entity/ai/village/VillageSiege.java
index 928ca3189af1ddaba797628a087cd6c6a9016f5c..eaa97eb11d893266253fb108249ced1e0e96a4dc 100644
--- a/src/main/java/net/minecraft/world/entity/ai/village/VillageSiege.java
+++ b/src/main/java/net/minecraft/world/entity/ai/village/VillageSiege.java
@@ -1,5 +1,7 @@
package net.minecraft.world.entity.ai.village;
+import com.destroystokyo.paper.exception.ServerInternalException;
+
import java.util.Iterator;
import javax.annotation.Nullable;
import net.minecraft.core.BaseBlockPosition;
@@ -119,6 +121,7 @@ public class VillageSiege implements MobSpawner {
entityzombie.prepare(worldserver, worldserver.getDamageScaler(entityzombie.getChunkCoordinates()), EnumMobSpawn.EVENT, (GroupDataEntity) null, (NBTTagCompound) null);
} catch (Exception exception) {
VillageSiege.LOGGER.warn("Failed to create zombie for village siege at {}", vec3d, exception);
+ ServerInternalException.reportInternalException(exception); // Paper
return;
}
diff --git a/src/main/java/net/minecraft/world/level/SpawnerCreature.java b/src/main/java/net/minecraft/world/level/SpawnerCreature.java
index 2d02b2fc502a0f7e541f7943ed647ff7177acee8..fd0595fd584046326eccacdf0a6afe40c5e84eed 100644
--- a/src/main/java/net/minecraft/world/level/SpawnerCreature.java
+++ b/src/main/java/net/minecraft/world/level/SpawnerCreature.java
@@ -301,6 +301,7 @@ public final class SpawnerCreature {
}
} catch (Exception exception) {
SpawnerCreature.LOGGER.warn("Failed to create mob", exception);
+ com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(exception); // Paper
return null;
}
}
@@ -407,6 +408,7 @@ public final class SpawnerCreature {
entity = biomesettingsmobs_c.c.a((World) worldaccess.getMinecraftWorld());
} catch (Exception exception) {
SpawnerCreature.LOGGER.warn("Failed to create mob", exception);
+ com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(exception); // Paper
continue;
}
diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java
index 33469b719d679c65d4bcb8366008e6e107eb3a0b..b0ad55f35285cc1bc339859a8deae65e930082b8 100644
--- a/src/main/java/net/minecraft/world/level/World.java
+++ b/src/main/java/net/minecraft/world/level/World.java
@@ -1,5 +1,10 @@
package net.minecraft.world.level;
+import co.aikar.timings.Timing;
+import co.aikar.timings.Timings;
+import com.destroystokyo.paper.event.server.ServerExceptionEvent;
+import com.destroystokyo.paper.exception.ServerInternalException;
+import com.google.common.base.MoreObjects;
import com.google.common.collect.Lists;
import com.mojang.serialization.Codec;
import java.io.IOException;
@@ -737,8 +742,11 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
gameprofilerfiller.exit();
} catch (Throwable throwable) {
// 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());
+ String msg = "TileEntity threw exception at " + tileentity.world.getWorld().getName() + ":" + tileentity.position.getX() + "," + tileentity.position.getY() + "," + tileentity.position.getZ();
+ System.err.println(msg);
throwable.printStackTrace();
+ getServer().getPluginManager().callEvent(new ServerExceptionEvent(new ServerInternalException(msg, throwable)));
+ // Paper end
tilesThisCycle--;
this.tileEntityListTick.remove(tileTickPosition--);
continue;
@@ -808,8 +816,10 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
consumer.accept(entity);
} catch (Throwable throwable) {
// Paper start - Prevent tile entity and entity crashes
- System.err.println("Entity threw exception at " + entity.world.getWorld().getName() + ":" + entity.locX() + "," + entity.locY() + "," + entity.locZ());
+ String msg = "Entity threw exception at " + entity.world.getWorld().getName() + ":" + entity.locX() + "," + entity.locY() + "," + entity.locZ();
+ System.err.println(msg);
throwable.printStackTrace();
+ getServer().getPluginManager().callEvent(new ServerExceptionEvent(new ServerInternalException(msg, throwable)));
entity.dead = true;
return;
// Paper end
diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
index 0312d68f0f64fa9e5816fe12a09430208ae2b8ce..4f86aa618ab0b497b1ad46cc9a4443c6874d388b 100644
--- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
@@ -1,5 +1,6 @@
package net.minecraft.world.level.chunk;
+import com.destroystokyo.paper.exception.ServerInternalException;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import it.unimi.dsi.fastutil.longs.LongOpenHashSet;
@@ -619,10 +620,15 @@ public class Chunk implements IChunkAccess {
@@ -653,10 +654,15 @@ public class Chunk implements IChunkAccess {
this.tileEntities.remove(blockposition);
// Paper end
} 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.getPosition().getX() + "," + tileentity.getPosition().getY() + "," + tileentity.getPosition().getZ()
- + " (" + getType(blockposition) + ") where there was no entity tile!");
- System.out.println("Chunk coordinates: " + (this.loc.x * 16) + "," + (this.loc.z * 16));
- new Exception().printStackTrace();
@ -79,50 +198,11 @@ index 0d0f36c62d260390827321aa6472f51a3a204c95..01655fd86f9a3218036f8b5404e233d3
// CraftBukkit end
}
}
diff --git a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
index bf0ccfb9bf20422b90ef26370d113b49be7d730b..060887d765604e4be82913607bb6266a278f5db6 100644
--- a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
+++ b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
@@ -1,5 +1,6 @@
package net.minecraft.server;
+import com.destroystokyo.paper.exception.ServerInternalException;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.io.Files;
@@ -353,6 +354,7 @@ public class NameReferencingFileConverter {
root = NBTCompressedStreamTools.a(new java.io.FileInputStream(file5));
} catch (Exception exception) {
exception.printStackTrace();
+ ServerInternalException.reportInternalException(exception); // Paper
}
if (root != null) {
@@ -366,6 +368,7 @@ public class NameReferencingFileConverter {
NBTCompressedStreamTools.a(root, new java.io.FileOutputStream(file2));
} catch (Exception exception) {
exception.printStackTrace();
+ ServerInternalException.reportInternalException(exception); // Paper
}
}
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 2ba10ed683788219c734a565a163ba553ec72c75..612eb16bce1bce1cad40ea0f279d2b8397263dea 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -762,6 +762,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
return true;
} catch (Exception exception) {
PlayerChunkMap.LOGGER.error("Failed to save chunk {},{}", chunkcoordintpair.x, chunkcoordintpair.z, exception);
+ com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(exception); // Paper
return false;
}
}
diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java
index 135f38cc5d5d2fa3866aa1063df49a96b5e72ac2..f722b148464b7b8e515dba25aeffe8dfd3c0d6c3 100644
--- a/src/main/java/net/minecraft/server/RegionFile.java
+++ b/src/main/java/net/minecraft/server/RegionFile.java
@@ -261,6 +261,7 @@ public class RegionFile implements AutoCloseable {
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
index f2694e46123ac2edcfdc53ef1abae283227eaa51..7f695f2b49df3400cd263fd6ffff77e753a65ea1 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
@@ -264,6 +264,7 @@ public class RegionFile implements AutoCloseable {
return true;
}
} catch (IOException ioexception) {
@ -130,7 +210,7 @@ index 135f38cc5d5d2fa3866aa1063df49a96b5e72ac2..f722b148464b7b8e515dba25aeffe8df
return false;
}
}
@@ -333,6 +334,7 @@ public class RegionFile implements AutoCloseable {
@@ -336,6 +337,7 @@ public class RegionFile implements AutoCloseable {
filechannel.write(bytebuffer);
} catch (Throwable throwable1) {
throwable = throwable1;
@ -138,99 +218,11 @@ index 135f38cc5d5d2fa3866aa1063df49a96b5e72ac2..f722b148464b7b8e515dba25aeffe8df
throw throwable1;
} finally {
if (filechannel != null) {
diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java
index d787fab2c25e31ca6caa56c5e47409512c5ac568..137ee1b453b80e96c1a8fa3271f6350f9294cafb 100644
--- a/src/main/java/net/minecraft/server/SpawnerCreature.java
+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java
@@ -14,6 +14,7 @@ import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
// CraftBukkit start
+import com.destroystokyo.paper.exception.ServerInternalException;
import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
// CraftBukkit end
@@ -268,6 +269,7 @@ public final class SpawnerCreature {
}
} catch (Exception exception) {
SpawnerCreature.LOGGER.warn("Failed to create mob", exception);
+ ServerInternalException.reportInternalException(exception); // Paper
return null;
}
}
@@ -374,6 +376,7 @@ public final class SpawnerCreature {
entity = biomesettingsmobs_c.c.a((World) worldaccess.getMinecraftWorld());
} catch (Exception exception) {
SpawnerCreature.LOGGER.warn("Failed to create mob", exception);
+ ServerInternalException.reportInternalException(exception); // Paper
continue;
}
diff --git a/src/main/java/net/minecraft/server/VillageSiege.java b/src/main/java/net/minecraft/server/VillageSiege.java
index 1844a6504acc420bdfaaf8f045c569e970d055db..d6aadbda5c5a17976659f57ee04cf9b917e09160 100644
--- a/src/main/java/net/minecraft/server/VillageSiege.java
+++ b/src/main/java/net/minecraft/server/VillageSiege.java
@@ -1,5 +1,7 @@
package net.minecraft.server;
+import com.destroystokyo.paper.exception.ServerInternalException;
+
import java.util.Iterator;
import javax.annotation.Nullable;
import org.apache.logging.log4j.LogManager;
@@ -104,6 +106,7 @@ public class VillageSiege implements MobSpawner {
entityzombie.prepare(worldserver, worldserver.getDamageScaler(entityzombie.getChunkCoordinates()), EnumMobSpawn.EVENT, (GroupDataEntity) null, (NBTTagCompound) null);
} catch (Exception exception) {
VillageSiege.LOGGER.warn("Failed to create zombie for village siege at {}", vec3d, exception);
+ ServerInternalException.reportInternalException(exception); // Paper
return;
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index eb0af6775d60e2cd610dde6e7c4874d4b01d6054..3638ae7c0eba5b1ef811bc1629334e9c483bef6f 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -1,5 +1,10 @@
package net.minecraft.server;
+import co.aikar.timings.Timing;
+import co.aikar.timings.Timings;
+import com.destroystokyo.paper.event.server.ServerExceptionEvent;
+import com.destroystokyo.paper.exception.ServerInternalException;
+import com.google.common.base.MoreObjects;
import com.google.common.collect.Lists;
import com.mojang.serialization.Codec;
import java.io.IOException;
@@ -685,8 +690,11 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
gameprofilerfiller.exit();
} catch (Throwable throwable) {
// 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());
+ String msg = "TileEntity threw exception at " + tileentity.world.getWorld().getName() + ":" + tileentity.position.getX() + "," + tileentity.position.getY() + "," + tileentity.position.getZ();
+ System.err.println(msg);
throwable.printStackTrace();
+ getServer().getPluginManager().callEvent(new ServerExceptionEvent(new ServerInternalException(msg, throwable)));
+ // Paper end
tilesThisCycle--;
this.tileEntityListTick.remove(tileTickPosition--);
continue;
@@ -756,8 +764,10 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
consumer.accept(entity);
} catch (Throwable throwable) {
// Paper start - Prevent tile entity and entity crashes
- System.err.println("Entity threw exception at " + entity.world.getWorld().getName() + ":" + entity.locX() + "," + entity.locY() + "," + entity.locZ());
+ String msg = "Entity threw exception at " + entity.world.getWorld().getName() + ":" + entity.locX() + "," + entity.locY() + "," + entity.locZ();
+ System.err.println(msg);
throwable.printStackTrace();
+ getServer().getPluginManager().callEvent(new ServerExceptionEvent(new ServerInternalException(msg, throwable)));
entity.dead = true;
return;
// Paper end
diff --git a/src/main/java/net/minecraft/server/WorldPersistentData.java b/src/main/java/net/minecraft/server/WorldPersistentData.java
index 141a8e31151010e5a0bd8d4661033f109f6a2e67..138c6d707e33cd352aa4b26dfb279c5b77448de0 100644
--- a/src/main/java/net/minecraft/server/WorldPersistentData.java
+++ b/src/main/java/net/minecraft/server/WorldPersistentData.java
@@ -144,6 +144,7 @@ public class WorldPersistentData {
diff --git a/src/main/java/net/minecraft/world/level/storage/WorldPersistentData.java b/src/main/java/net/minecraft/world/level/storage/WorldPersistentData.java
index 3910daeaa177639fa8055301304634c2014dc20f..d61960d80599dc5e7b70cc990e4b0b174eb6e34e 100644
--- a/src/main/java/net/minecraft/world/level/storage/WorldPersistentData.java
+++ b/src/main/java/net/minecraft/world/level/storage/WorldPersistentData.java
@@ -150,6 +150,7 @@ public class WorldPersistentData {
}
} catch (Throwable throwable6) {
throwable = throwable6;

View File

@ -5,11 +5,11 @@ Subject: [PATCH] Don't nest if we don't need to when cerealising text
components
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutChat.java b/src/main/java/net/minecraft/server/PacketPlayOutChat.java
index 47328ca5e3f1e71ed25ba89df5b666f041e49b76..b9cb21c5eb6f4a0318c3c63ec66f88b1750782ac 100644
--- a/src/main/java/net/minecraft/server/PacketPlayOutChat.java
+++ b/src/main/java/net/minecraft/server/PacketPlayOutChat.java
@@ -35,7 +35,14 @@ public class PacketPlayOutChat implements Packet<PacketListenerPlayOut> {
diff --git a/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutChat.java b/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutChat.java
index bc7de641a37b2f4c8fe7ed8272c55a30ac4bc313..c47427fd2eed173726cb856aae62c02a2b46bbf0 100644
--- a/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutChat.java
+++ b/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutChat.java
@@ -39,7 +39,14 @@ public class PacketPlayOutChat implements Packet<PacketListenerPlayOut> {
// Paper end
// Spigot start
if (components != null) {

View File

@ -24,11 +24,11 @@ index abbbe1786eb68af02f9d39650aad730ac44aac8a..3ac2ac3db9b1c271b3c21930bb137166
+ nonPlayerEntitiesOnScoreboards = getBoolean("allow-non-player-entities-on-scoreboards", false);
+ }
}
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 295fbae9946fda8061c5c7294cdaefc426d0edce..31857636a08eeb281b4d21dd72811d40eb00055c 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -2199,6 +2199,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 40eb6bae8ca4e2b57d4f91547808eb00ac1fd455..b7df4d8eb3ccb9e8dc85898352f41c5c20abcb34 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2284,6 +2284,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
@Nullable
public ScoreboardTeamBase getScoreboardTeam() {
@ -36,11 +36,11 @@ index 295fbae9946fda8061c5c7294cdaefc426d0edce..31857636a08eeb281b4d21dd72811d40
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 9295f72aa5a2a95efa89fdc90ae7106540403042..276f06982b3c17b8ae29497e1f561bb7d1559e29 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -648,6 +648,7 @@ public abstract class EntityLiving extends Entity {
diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java
index 3598db4144141a8701a2879be13a81a8ee48018c..318c96ee92fc8c6f5926aeadaa597d32ad590974 100644
--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java
+++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java
@@ -741,6 +741,7 @@ public abstract class EntityLiving extends Entity {
if (nbttagcompound.hasKeyOfType("Team", 8)) {
String s = nbttagcompound.getString("Team");
ScoreboardTeam scoreboardteam = this.world.getScoreboard().getTeam(s);

View File

@ -4,11 +4,11 @@ Date: Sat, 4 Apr 2015 23:17:52 -0400
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
index bb74049fb2baffbe67f9e34cc0ee0b83180d02eb..9a9847c217a6f7a2e2bc09b68b3d2821fcecbbc3 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -1457,7 +1457,11 @@ public class PlayerConnection implements PacketListenerPlayIn {
diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java
index a70fb56b0f44372cc62adbb9a263684224c264d2..98189c2f4c973427563c48a231bf8e6c21e0391d 100644
--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java
@@ -1602,7 +1602,11 @@ public class PlayerConnection implements PacketListenerPlayIn {
// CraftBukkit start
public void a(PacketPlayInResourcePackStatus packetplayinresourcepackstatus) {
PlayerConnectionUtils.ensureMainThread(packetplayinresourcepackstatus, this, this.player.getWorldServer());
@ -22,7 +22,7 @@ index bb74049fb2baffbe67f9e34cc0ee0b83180d02eb..9a9847c217a6f7a2e2bc09b68b3d2821
// CraftBukkit end
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 928492e9dd30cf75aff891ac098cac653b46d822..15a515535d6c8c71e0de4a7ab4c0a8759ca3537f 100644
index da193bfc1d98e489eedc373ee87ab58b75d4377e..144faef77e69c6c3bf963327179a51bb4c37cc18 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -138,6 +138,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -5,11 +5,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.
diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java
index f722b148464b7b8e515dba25aeffe8dfd3c0d6c3..be7165098fcb814d7b301a1670c33c78461d8d95 100644
--- a/src/main/java/net/minecraft/server/RegionFile.java
+++ b/src/main/java/net/minecraft/server/RegionFile.java
@@ -261,7 +261,7 @@ public class RegionFile implements AutoCloseable {
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
index 7f695f2b49df3400cd263fd6ffff77e753a65ea1..6efbb8a3502f86e105d4dfb9cef114a790966e95 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
@@ -264,7 +264,7 @@ public class RegionFile implements AutoCloseable {
return true;
}
} catch (IOException ioexception) {
@ -18,11 +18,11 @@ index f722b148464b7b8e515dba25aeffe8dfd3c0d6c3..be7165098fcb814d7b301a1670c33c78
return false;
}
}
diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java
index caa1eb3ea5d2e97944adc735895708a76215ee7b..26fabb4e5d3945ace851cf6e4474e91611c45b1d 100644
--- a/src/main/java/net/minecraft/server/RegionFileCache.java
+++ b/src/main/java/net/minecraft/server/RegionFileCache.java
@@ -88,6 +88,7 @@ public final class RegionFileCache implements AutoCloseable {
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileCache.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileCache.java
index de125077656f249d5cf9b76f07981b55e690e015..44c09e3b8d5abe4fdf9c4a46c21bc82e9dfefa0b 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileCache.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileCache.java
@@ -92,6 +92,7 @@ public final class RegionFileCache implements AutoCloseable {
protected void write(ChunkCoordIntPair chunkcoordintpair, NBTTagCompound nbttagcompound) throws IOException {
RegionFile regionfile = this.getFile(chunkcoordintpair, false); // CraftBukkit
@ -30,7 +30,7 @@ index caa1eb3ea5d2e97944adc735895708a76215ee7b..26fabb4e5d3945ace851cf6e4474e916
DataOutputStream dataoutputstream = regionfile.c(chunkcoordintpair);
Throwable throwable = null;
@@ -111,6 +112,18 @@ public final class RegionFileCache implements AutoCloseable {
@@ -115,6 +116,18 @@ public final class RegionFileCache implements AutoCloseable {
}

View File

@ -17,10 +17,10 @@ was added, resulting in 2 different ways to modify an items enchantments.
For consistency, the old API methods now forward to use the
ItemMeta API equivalents, and should deprecate the old API's.
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
index 7d98fe348d6b4a3bc2972217f9a9f0c9d902edbd..eee69f9ac8936cf7ad84629aba91bf09371762f3 100644
--- a/src/main/java/net/minecraft/server/ItemStack.java
+++ b/src/main/java/net/minecraft/server/ItemStack.java
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index 4010152dccc93019f2e7f284d80b92bae0d91c34..d7c5065457d910f3e5481fda046d368d5f66f67b 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -9,6 +9,8 @@ import com.mojang.serialization.Codec;
import com.mojang.serialization.codecs.RecordCodecBuilder;
import java.text.DecimalFormat;
@ -30,7 +30,7 @@ index 7d98fe348d6b4a3bc2972217f9a9f0c9d902edbd..eee69f9ac8936cf7ad84629aba91bf09
import java.util.Locale;
import java.util.Objects;
import java.util.Optional;
@@ -66,6 +68,23 @@ public final class ItemStack {
@@ -120,6 +122,23 @@ public final class ItemStack {
private ShapeDetectorBlock n;
private boolean o;
@ -54,7 +54,7 @@ index 7d98fe348d6b4a3bc2972217f9a9f0c9d902edbd..eee69f9ac8936cf7ad84629aba91bf09
public ItemStack(IMaterial imaterial) {
this(imaterial, 1);
}
@@ -108,6 +127,7 @@ public final class ItemStack {
@@ -162,6 +181,7 @@ public final class ItemStack {
if (nbttagcompound.hasKeyOfType("tag", 10)) {
// CraftBukkit start - make defensive copy as this data may be coming from the save thread
this.tag = (NBTTagCompound) nbttagcompound.getCompound("tag").clone();
@ -62,7 +62,7 @@ index 7d98fe348d6b4a3bc2972217f9a9f0c9d902edbd..eee69f9ac8936cf7ad84629aba91bf09
this.getItem().b(this.tag);
// CraftBukkit end
}
@@ -626,6 +646,7 @@ public final class ItemStack {
@@ -680,6 +700,7 @@ public final class ItemStack {
// Paper end
public void setTag(@Nullable NBTTagCompound nbttagcompound) {
this.tag = nbttagcompound;
@ -70,7 +70,7 @@ index 7d98fe348d6b4a3bc2972217f9a9f0c9d902edbd..eee69f9ac8936cf7ad84629aba91bf09
if (this.getItem().usesDurability()) {
this.setDamage(this.getDamage());
}
@@ -716,6 +737,7 @@ public final class ItemStack {
@@ -770,6 +791,7 @@ public final class ItemStack {
nbttagcompound.setString("id", String.valueOf(IRegistry.ENCHANTMENT.getKey(enchantment)));
nbttagcompound.setShort("lvl", (short) ((byte) i));
nbttaglist.add(nbttagcompound);
@ -79,7 +79,7 @@ index 7d98fe348d6b4a3bc2972217f9a9f0c9d902edbd..eee69f9ac8936cf7ad84629aba91bf09
public boolean hasEnchantments() {
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
index 721a1c6bd4505cb132e7004c45b795d4959389e3..9913d0136841dac35b6649cb1afbe1e93b36bf4c 100644
index 275b943a59ef28c831a068987e111e84ebba3bb7..7221ac52c9f66ae0af6f6cbf15c8d47f9c0291a0 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@@ -178,28 +178,11 @@ public final class CraftItemStack extends ItemStack {
@ -115,7 +115,7 @@ index 721a1c6bd4505cb132e7004c45b795d4959389e3..9913d0136841dac35b6649cb1afbe1e9
+ // Paper end
}
static boolean makeTag(net.minecraft.server.ItemStack item) {
static boolean makeTag(net.minecraft.world.item.ItemStack item) {
@@ -216,66 +199,33 @@ public final class CraftItemStack extends ItemStack {
@Override
@ -192,9 +192,9 @@ index 721a1c6bd4505cb132e7004c45b795d4959389e3..9913d0136841dac35b6649cb1afbe1e9
+ return hasItemMeta() ? getItemMeta().getEnchants() : ImmutableMap.<Enchantment, Integer>of(); // Paper - use Item Meta
}
static Map<Enchantment, Integer> getEnchantments(net.minecraft.server.ItemStack item) {
static Map<Enchantment, Integer> getEnchantments(net.minecraft.world.item.ItemStack item) {
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
index ac6be3da812c927a5486809c096b5a2e1aba617b..da1af372453b0e32177454d87437bda5c5b530d0 100644
index 7a11b2ddfa4244459253c918315aaab78ef2eb4a..57a6e66866ea82caccbbbfd55948a081f50f6bbe 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -6,6 +6,7 @@ import com.google.common.collect.ImmutableList;

View File

@ -29,11 +29,11 @@ index 3ac2ac3db9b1c271b3c21930bb13716669ff64d3..3c78d3234054ce2dc46ef77decb6adb0
+ log("Creative Arrow Despawn Rate: " + creativeArrowDespawnRate);
+ }
}
diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java
index 1bd522f84f034552e4a82fc07f93ce32c5532f81..2a86d4b8af5e436e82e003f50c1929702af700c4 100644
--- a/src/main/java/net/minecraft/server/EntityArrow.java
+++ b/src/main/java/net/minecraft/server/EntityArrow.java
@@ -245,7 +245,7 @@ public abstract class EntityArrow extends IProjectile {
diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntityArrow.java b/src/main/java/net/minecraft/world/entity/projectile/EntityArrow.java
index a05ee898bd360f49ea2807d06f93e27ada11ef63..9bd4a283a99f86c9a26f73e0bad0c3414d66ad55 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/EntityArrow.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/EntityArrow.java
@@ -283,7 +283,7 @@ public abstract class EntityArrow extends IProjectile {
protected void h() {
++this.despawnCounter;

View File

@ -5,11 +5,24 @@ Subject: [PATCH] Add World Util Methods
Methods that can be used for other patches to help improve logic.
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 1c54c081c6ea1f422c19db1aa9e1935ce066d910..4aa4a8d10b5126125ae420037c5e1faabdbe147b 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -245,11 +245,27 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
index eddfbd25953e8ef410f1617a1edecbc7d07696c0..b04a6cd626fceed26aec6121e20fb1b6dd1c716d 100644
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
@@ -197,7 +197,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
public final Convertable.ConversionSession convertable;
public final UUID uuid;
- public Chunk getChunkIfLoaded(int x, int z) {
+ @Override public Chunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI
return this.chunkProvider.getChunkAt(x, z, false);
}
diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java
index b0ad55f35285cc1bc339859a8deae65e930082b8..067f5e46ad2f28ab119db77b19c4897bed9b3d80 100644
--- a/src/main/java/net/minecraft/world/level/World.java
+++ b/src/main/java/net/minecraft/world/level/World.java
@@ -297,11 +297,27 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
}
@Override
@ -38,11 +51,11 @@ index 1c54c081c6ea1f422c19db1aa9e1935ce066d910..4aa4a8d10b5126125ae420037c5e1faa
// Paper end
@Override
diff --git a/src/main/java/net/minecraft/server/WorldBorder.java b/src/main/java/net/minecraft/server/WorldBorder.java
index bb0f30f182856d2701fde9b1a65eeb987462104a..717f495abd63218bb7ce9241e7cfeac809ef02de 100644
--- a/src/main/java/net/minecraft/server/WorldBorder.java
+++ b/src/main/java/net/minecraft/server/WorldBorder.java
@@ -21,6 +21,7 @@ public class WorldBorder {
diff --git a/src/main/java/net/minecraft/world/level/border/WorldBorder.java b/src/main/java/net/minecraft/world/level/border/WorldBorder.java
index 2bb03f1cb9671a7754a68059219f783d4508eeb9..f16c76df5d7b184d57f4cc397f069eac9cc430cb 100644
--- a/src/main/java/net/minecraft/world/level/border/WorldBorder.java
+++ b/src/main/java/net/minecraft/world/level/border/WorldBorder.java
@@ -31,6 +31,7 @@ public class WorldBorder {
public WorldBorder() {}
@ -50,16 +63,3 @@ index bb0f30f182856d2701fde9b1a65eeb987462104a..717f495abd63218bb7ce9241e7cfeac8
public boolean a(BlockPosition blockposition) {
return (double) (blockposition.getX() + 1) > this.e() && (double) blockposition.getX() < this.g() && (double) (blockposition.getZ() + 1) > this.f() && (double) blockposition.getZ() < this.h();
}
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 07f2cf8461343f054828a32f8bf48563321e666a..6a57b9337d3f345197a127b16e3799d0c58fab2d 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -88,7 +88,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
public final Convertable.ConversionSession convertable;
public final UUID uuid;
- public Chunk getChunkIfLoaded(int x, int z) {
+ @Override public Chunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI
return this.chunkProvider.getChunkAt(x, z, false);
}

View File

@ -4,11 +4,11 @@ Date: Sun, 21 Jun 2015 15:07:20 -0400
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
index 276f06982b3c17b8ae29497e1f561bb7d1559e29..a001629eda462ba34555aed6fe162078c18e0c02 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -3112,9 +3112,10 @@ public abstract class EntityLiving extends Entity {
diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java
index 318c96ee92fc8c6f5926aeadaa597d32ad590974..9b12e15a6c377ae90193596a35114dd452cf6e0c 100644
--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java
+++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java
@@ -3205,9 +3205,10 @@ public abstract class EntityLiving extends Entity {
this.b(this.activeItem, 16);
// CraftBukkit start - fire PlayerItemConsumeEvent
ItemStack itemstack;
@ -20,7 +20,7 @@ index 276f06982b3c17b8ae29497e1f561bb7d1559e29..a001629eda462ba34555aed6fe162078
world.getServer().getPluginManager().callEvent(event);
if (event.isCancelled()) {
@@ -3128,6 +3129,13 @@ public abstract class EntityLiving extends Entity {
@@ -3221,6 +3222,13 @@ public abstract class EntityLiving extends Entity {
} else {
itemstack = this.activeItem.a(this.world, this);
}
@ -34,7 +34,7 @@ index 276f06982b3c17b8ae29497e1f561bb7d1559e29..a001629eda462ba34555aed6fe162078
// CraftBukkit end
if (itemstack != this.activeItem) {
@@ -3135,6 +3143,11 @@ public abstract class EntityLiving extends Entity {
@@ -3228,6 +3236,11 @@ public abstract class EntityLiving extends Entity {
}
this.clearActiveItem();

View File

@ -4,11 +4,11 @@ Date: Sun, 27 Sep 2015 01:18:02 -0400
Subject: [PATCH] handle NaN health/absorb values and repair bad data
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 7c74a13d875d12d4264e394c682ab515a14f8915..1fb7e29b29adef72bd5a49c87d954973f46f9c81 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -609,7 +609,13 @@ public abstract class EntityLiving extends Entity {
diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java
index 9b12e15a6c377ae90193596a35114dd452cf6e0c..acbd10432b09172f7541b2f4081d1aa9812194ac 100644
--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java
+++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java
@@ -702,7 +702,13 @@ public abstract class EntityLiving extends Entity {
@Override
public void loadData(NBTTagCompound nbttagcompound) {
@ -23,7 +23,7 @@ index 7c74a13d875d12d4264e394c682ab515a14f8915..1fb7e29b29adef72bd5a49c87d954973
if (nbttagcompound.hasKeyOfType("Attributes", 9) && this.world != null && !this.world.isClientSide) {
this.getAttributeMap().a(nbttagcompound.getList("Attributes", 10));
}
@@ -1058,6 +1064,10 @@ public abstract class EntityLiving extends Entity {
@@ -1151,6 +1157,10 @@ public abstract class EntityLiving extends Entity {
}
public void setHealth(float f) {
@ -34,7 +34,7 @@ index 7c74a13d875d12d4264e394c682ab515a14f8915..1fb7e29b29adef72bd5a49c87d954973
// CraftBukkit start - Handle scaled health
if (this instanceof EntityPlayer) {
org.bukkit.craftbukkit.entity.CraftPlayer player = ((EntityPlayer) this).getBukkitEntity();
@@ -2952,7 +2962,7 @@ public abstract class EntityLiving extends Entity {
@@ -3045,7 +3055,7 @@ public abstract class EntityLiving extends Entity {
}
public void setAbsorptionHearts(float f) {
@ -44,7 +44,7 @@ index 7c74a13d875d12d4264e394c682ab515a14f8915..1fb7e29b29adef72bd5a49c87d954973
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 15a515535d6c8c71e0de4a7ab4c0a8759ca3537f..0a24eab942354a03d5ddf4899cf7a80401b669a4 100644
index 144faef77e69c6c3bf963327179a51bb4c37cc18..b4a2758ee246252d6076e861b45d11dae6e33096 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1682,6 +1682,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -5,11 +5,11 @@ Subject: [PATCH] Use a Shared Random for Entities
Reduces memory usage and provides ensures more randomness, Especially since a lot of garbage entity objects get created.
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 31857636a08eeb281b4d21dd72811d40eb00055c..dba28796a921beda2e5d15ba1565c55f54e36435 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -58,6 +58,21 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index b7df4d8eb3ccb9e8dc85898352f41c5c20abcb34..6cbb797cb0de4b26d8ddd7f0bf567f49bd36f9c0 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -143,6 +143,21 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
return tag.hasKey("Bukkit.updateLevel") && tag.getInt("Bukkit.updateLevel") >= level;
}
@ -31,7 +31,7 @@ index 31857636a08eeb281b4d21dd72811d40eb00055c..dba28796a921beda2e5d15ba1565c55f
private CraftEntity bukkitEntity;
public CraftEntity getBukkitEntity() {
@@ -187,7 +202,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -272,7 +287,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
this.x = Vec3D.ORIGIN;
this.am = 1.0F;
this.an = 1.0F;

View File

@ -21,11 +21,11 @@ index 3c78d3234054ce2dc46ef77decb6adb0cbd10620..cd64fb9d0c6d123e1c86cb33f12cd9ce
+ }
+ }
}
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 6a57b9337d3f345197a127b16e3799d0c58fab2d..4029f090d7b01c10b4f3f99004ab92f04653e884 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -479,7 +479,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
index b04a6cd626fceed26aec6121e20fb1b6dd1c716d..3403ed91e7ec98116438398fb7247e7f05171feb 100644
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
@@ -588,7 +588,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
blockposition = this.a(this.a(j, 0, k, 15));
if (this.isRainingAt(blockposition)) {
DifficultyDamageScaler difficultydamagescaler = this.getDamageScaler(blockposition);

View File

@ -12,11 +12,11 @@ Replace all calls to the new place to the unnecessary forward.
Optimize getType and getBlockData to manually inline and optimize the calls
diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/main/java/net/minecraft/server/BaseBlockPosition.java
index f6a5ebd4c7ec045c8dd6841831f8fcc0b32d964e..63a9ce32fb8b98695e104f7d820cd9b1a8f230b1 100644
--- a/src/main/java/net/minecraft/server/BaseBlockPosition.java
+++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java
@@ -20,6 +20,15 @@ public class BaseBlockPosition implements Comparable<BaseBlockPosition> {
diff --git a/src/main/java/net/minecraft/core/BaseBlockPosition.java b/src/main/java/net/minecraft/core/BaseBlockPosition.java
index 25fdd55a7548cfaa45a541ad77f22f33c33e7471..4b56683336fdab06804efdc8ca1f7c130b77291f 100644
--- a/src/main/java/net/minecraft/core/BaseBlockPosition.java
+++ b/src/main/java/net/minecraft/core/BaseBlockPosition.java
@@ -22,6 +22,15 @@ public class BaseBlockPosition implements Comparable<BaseBlockPosition> {
private int b;public final void setY(final int y) { this.b = y; } // Paper - OBFHELPER
private int e;public final void setZ(final int z) { this.e = z; } // Paper - OBFHELPER
@ -32,11 +32,24 @@ index f6a5ebd4c7ec045c8dd6841831f8fcc0b32d964e..63a9ce32fb8b98695e104f7d820cd9b1
public BaseBlockPosition(int i, int j, int k) {
this.a = i;
this.b = j;
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 81c6ce3ba87da692675bca8b2831a90fabfa4e37..b6ff6095543d720382786e159a9f1cdd6eb6f166 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -312,12 +312,27 @@ public class Chunk implements IChunkAccess {
diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java
index 067f5e46ad2f28ab119db77b19c4897bed9b3d80..07b5ff3ae319776bc1d85d113007a9afbad1c29a 100644
--- a/src/main/java/net/minecraft/world/level/World.java
+++ b/src/main/java/net/minecraft/world/level/World.java
@@ -239,7 +239,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
}
public static boolean isValidLocation(BlockPosition blockposition) {
- return !isOutsideWorld(blockposition) && D(blockposition);
+ return blockposition.isValidLocation(); // Paper - use better/optimized check
}
public static boolean l(BlockPosition blockposition) {
diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
index 4f86aa618ab0b497b1ad46cc9a4443c6874d388b..ace0566626338f02cbfcc8b40d29dc6a66ede58d 100644
--- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
@@ -346,12 +346,27 @@ public class Chunk implements IChunkAccess {
return this.sections;
}
@ -68,11 +81,11 @@ index 81c6ce3ba87da692675bca8b2831a90fabfa4e37..b6ff6095543d720382786e159a9f1cdd
if (this.world.isDebugWorld()) {
IBlockData iblockdata = null;
diff --git a/src/main/java/net/minecraft/server/ChunkEmpty.java b/src/main/java/net/minecraft/server/ChunkEmpty.java
index 84207e7da6df97246f756940142a2af9eb9ca815..ed22ff28ea6c0978ec0d9d1ecf7baa3f422ed677 100644
--- a/src/main/java/net/minecraft/server/ChunkEmpty.java
+++ b/src/main/java/net/minecraft/server/ChunkEmpty.java
@@ -7,7 +7,7 @@ import javax.annotation.Nullable;
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkEmpty.java b/src/main/java/net/minecraft/world/level/chunk/ChunkEmpty.java
index 395d21afaabcbd99f9ce0551d647f5db9507a518..89efd0b68b04457e1cd617dcc8bb1a6ea1c4717c 100644
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkEmpty.java
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkEmpty.java
@@ -23,7 +23,7 @@ import net.minecraft.world.phys.AxisAlignedBB;
public class ChunkEmpty extends Chunk {
@ -81,7 +94,7 @@ index 84207e7da6df97246f756940142a2af9eb9ca815..ed22ff28ea6c0978ec0d9d1ecf7baa3f
Arrays.fill(abiomebase, BiomeRegistry.a);
});
@@ -15,6 +15,11 @@ public class ChunkEmpty extends Chunk {
@@ -31,6 +31,11 @@ public class ChunkEmpty extends Chunk {
super(world, chunkcoordintpair, new BiomeStorage(world.r().b(IRegistry.ay), ChunkEmpty.b));
}
@ -93,11 +106,11 @@ index 84207e7da6df97246f756940142a2af9eb9ca815..ed22ff28ea6c0978ec0d9d1ecf7baa3f
@Override
public IBlockData getType(BlockPosition blockposition) {
return Blocks.VOID_AIR.getBlockData();
diff --git a/src/main/java/net/minecraft/server/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java
index 882c2733beaff1df68b892d44fc77cacf4364ff4..5c7068cd93806d67c643ed6aabdfcab8888ed94e 100644
--- a/src/main/java/net/minecraft/server/ChunkSection.java
+++ b/src/main/java/net/minecraft/server/ChunkSection.java
@@ -7,10 +7,10 @@ public class ChunkSection {
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkSection.java b/src/main/java/net/minecraft/world/level/chunk/ChunkSection.java
index a4e2eb1a753e8fcb48982d78fe80e505bce5c476..eea4a30428293eaf7afbe303a37adec60b44c2b4 100644
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkSection.java
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkSection.java
@@ -13,10 +13,10 @@ public class ChunkSection {
public static final DataPalette<IBlockData> GLOBAL_PALETTE = new DataPaletteGlobal<>(Block.REGISTRY_ID, Blocks.AIR.getBlockData());
private final int yPos;
@ -110,7 +123,7 @@ index 882c2733beaff1df68b892d44fc77cacf4364ff4..5c7068cd93806d67c643ed6aabdfcab8
public ChunkSection(int i) {
this(i, (short) 0, (short) 0, (short) 0);
@@ -24,8 +24,8 @@ public class ChunkSection {
@@ -30,8 +30,8 @@ public class ChunkSection {
this.blockIds = new DataPaletteBlock<>(ChunkSection.GLOBAL_PALETTE, Block.REGISTRY_ID, GameProfileSerializer::c, GameProfileSerializer::a, Blocks.AIR.getBlockData());
}
@ -121,11 +134,11 @@ index 882c2733beaff1df68b892d44fc77cacf4364ff4..5c7068cd93806d67c643ed6aabdfcab8
}
public Fluid b(int i, int j, int k) {
diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java
index 32849e360a396128bd228db269ad1a8f7c6583a8..eabc9d7b934f27c823e012f3f10fffc23b461292 100644
--- a/src/main/java/net/minecraft/server/DataPaletteBlock.java
+++ b/src/main/java/net/minecraft/server/DataPaletteBlock.java
@@ -124,7 +124,7 @@ public class DataPaletteBlock<T> implements DataPaletteExpandable<T> {
diff --git a/src/main/java/net/minecraft/world/level/chunk/DataPaletteBlock.java b/src/main/java/net/minecraft/world/level/chunk/DataPaletteBlock.java
index e397b871b846c3a90bc75d0e1cf0683b6a3d0ca9..8928157b01bb4f0dfe043732777b33708c23cda7 100644
--- a/src/main/java/net/minecraft/world/level/chunk/DataPaletteBlock.java
+++ b/src/main/java/net/minecraft/world/level/chunk/DataPaletteBlock.java
@@ -133,7 +133,7 @@ public class DataPaletteBlock<T> implements DataPaletteExpandable<T> {
}
public T a(int i, int j, int k) {
@ -134,11 +147,11 @@ index 32849e360a396128bd228db269ad1a8f7c6583a8..eabc9d7b934f27c823e012f3f10fffc2
}
protected T a(int i) {
diff --git a/src/main/java/net/minecraft/server/IChunkAccess.java b/src/main/java/net/minecraft/server/IChunkAccess.java
index e0672c3c0bf30d88ea1cc609459050499a7271f3..887366f4c2ab608974113e75760b58c47f2afa00 100644
--- a/src/main/java/net/minecraft/server/IChunkAccess.java
+++ b/src/main/java/net/minecraft/server/IChunkAccess.java
@@ -12,6 +12,7 @@ import org.apache.logging.log4j.LogManager;
diff --git a/src/main/java/net/minecraft/world/level/chunk/IChunkAccess.java b/src/main/java/net/minecraft/world/level/chunk/IChunkAccess.java
index 2cd04abd72f1135446182ad6294003e526f99a4b..e570dc58efa56bd0aa5ada5575b4054ee38d505e 100644
--- a/src/main/java/net/minecraft/world/level/chunk/IChunkAccess.java
+++ b/src/main/java/net/minecraft/world/level/chunk/IChunkAccess.java
@@ -25,6 +25,7 @@ import org.apache.logging.log4j.LogManager;
public interface IChunkAccess extends IBlockAccess, IStructureAccess {
@ -146,11 +159,11 @@ index e0672c3c0bf30d88ea1cc609459050499a7271f3..887366f4c2ab608974113e75760b58c4
@Nullable
IBlockData setType(BlockPosition blockposition, IBlockData iblockdata, boolean flag);
diff --git a/src/main/java/net/minecraft/server/ProtoChunk.java b/src/main/java/net/minecraft/server/ProtoChunk.java
index e356bd73901ac7f230492e654af579d21c8fc086..2bcd26ccccf4503241c6b77600ed6ce1d94ccfcc 100644
--- a/src/main/java/net/minecraft/server/ProtoChunk.java
+++ b/src/main/java/net/minecraft/server/ProtoChunk.java
@@ -95,16 +95,18 @@ public class ProtoChunk implements IChunkAccess {
diff --git a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
index 7572ca53a5cca8ca5085d18c24048b85dda4daa9..9eeb99a21a6ed7f71ff64cf4cfdff646d31abbcf 100644
--- a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
@@ -113,16 +113,18 @@ public class ProtoChunk implements IChunkAccess {
@Override
public IBlockData getType(BlockPosition blockposition) {
@ -175,11 +188,11 @@ index e356bd73901ac7f230492e654af579d21c8fc086..2bcd26ccccf4503241c6b77600ed6ce1
@Override
public Fluid getFluid(BlockPosition blockposition) {
diff --git a/src/main/java/net/minecraft/server/ProtoChunkExtension.java b/src/main/java/net/minecraft/server/ProtoChunkExtension.java
index 5cfddbfe0bd84c994ed7fa4968bcf4fc13381001..420bf7116def909d3dd7dc9a799723446ddf8f7f 100644
--- a/src/main/java/net/minecraft/server/ProtoChunkExtension.java
+++ b/src/main/java/net/minecraft/server/ProtoChunkExtension.java
@@ -26,6 +26,11 @@ public class ProtoChunkExtension extends ProtoChunk {
diff --git a/src/main/java/net/minecraft/world/level/chunk/ProtoChunkExtension.java b/src/main/java/net/minecraft/world/level/chunk/ProtoChunkExtension.java
index c059d3d055c35b492680556e8605966e2caaf7fd..9351e6ba541d440c485b6e4a3209170c5756e31e 100644
--- a/src/main/java/net/minecraft/world/level/chunk/ProtoChunkExtension.java
+++ b/src/main/java/net/minecraft/world/level/chunk/ProtoChunkExtension.java
@@ -42,6 +42,11 @@ public class ProtoChunkExtension extends ProtoChunk {
public IBlockData getType(BlockPosition blockposition) {
return this.a.getType(blockposition);
}
@ -191,16 +204,3 @@ index 5cfddbfe0bd84c994ed7fa4968bcf4fc13381001..420bf7116def909d3dd7dc9a79972344
@Override
public Fluid getFluid(BlockPosition blockposition) {
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 4aa4a8d10b5126125ae420037c5e1faabdbe147b..096a1d3bf0e9c51244ecd9ad2fbd240f3e01f461 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -187,7 +187,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
}
public static boolean isValidLocation(BlockPosition blockposition) {
- return !isOutsideWorld(blockposition) && D(blockposition);
+ return blockposition.isValidLocation(); // Paper - use better/optimized check
}
public static boolean l(BlockPosition blockposition) {

View File

@ -5,37 +5,11 @@ Subject: [PATCH] Only process BlockPhysicsEvent if a plugin has a listener
Saves on some object allocation and processing when no plugin listens to this
diff --git a/src/main/java/net/minecraft/server/BlockPlant.java b/src/main/java/net/minecraft/server/BlockPlant.java
index 47e370667926e59f036be3f2befe8820668cf892..a830305f0e334ad87e6b9ed94230ff611d997d7e 100644
--- a/src/main/java/net/minecraft/server/BlockPlant.java
+++ b/src/main/java/net/minecraft/server/BlockPlant.java
@@ -14,7 +14,7 @@ public class BlockPlant extends Block {
public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) {
// CraftBukkit start
if (!iblockdata.canPlace(generatoraccess, blockposition)) {
- if (!org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPhysicsEvent(generatoraccess, blockposition).isCancelled()) {
+ if (!(generatoraccess instanceof WorldServer && ((WorldServer) generatoraccess).hasPhysicsEvent) || !org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPhysicsEvent(generatoraccess, blockposition).isCancelled()) { // Paper
return Blocks.AIR.getBlockData();
}
}
diff --git a/src/main/java/net/minecraft/server/BlockTallPlant.java b/src/main/java/net/minecraft/server/BlockTallPlant.java
index 48eb9c8a68d45c88c7a42e8e400446a374fb4fc9..2c8d49501664862559ed8974b4821bdd36fabebf 100644
--- a/src/main/java/net/minecraft/server/BlockTallPlant.java
+++ b/src/main/java/net/minecraft/server/BlockTallPlant.java
@@ -67,7 +67,7 @@ public class BlockTallPlant extends BlockPlant {
protected static void b(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman) {
// CraftBukkit start
- if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPhysicsEvent(world, blockposition).isCancelled()) {
+ if (((WorldServer)world).hasPhysicsEvent && org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPhysicsEvent(world, blockposition).isCancelled()) { // Paper
return;
}
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 38b0863bf470682b9afaab016c5c41af65800e5d..575b4e670810b0be51067ba3e4c838e547a1f1dc 100644
index 2c295e070a0418c7d3bc4a4a531df699acadb0ff..555b99c45e0785750c48b0db2bc0b8da98c52295 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1175,6 +1175,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
@@ -1282,6 +1282,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
while (iterator.hasNext()) {
WorldServer worldserver = (WorldServer) iterator.next();
@ -43,11 +17,23 @@ index 38b0863bf470682b9afaab016c5c41af65800e5d..575b4e670810b0be51067ba3e4c838e5
this.methodProfiler.a(() -> {
return worldserver + " " + worldserver.getDimensionKey().a();
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 7c6127739f1d88ee0dc411db5fcaa37d7fff36f7..5ce86030a71c181c4c28b8934be4fa8c7eafc299 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -406,7 +406,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
index 3403ed91e7ec98116438398fb7247e7f05171feb..3b82b358d53454dcde4e64123e6262a68a5ed1b0 100644
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
@@ -196,6 +196,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
private int tickPosition;
public final Convertable.ConversionSession convertable;
public final UUID uuid;
+ boolean hasPhysicsEvent = true; // Paper
@Override public Chunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI
return this.chunkProvider.getChunkAt(x, z, false);
diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java
index 07b5ff3ae319776bc1d85d113007a9afbad1c29a..70db5312ac556ea53247efdbc7759910ba0c9a95 100644
--- a/src/main/java/net/minecraft/world/level/World.java
+++ b/src/main/java/net/minecraft/world/level/World.java
@@ -458,7 +458,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
// CraftBukkit start
iblockdata1.b(this, blockposition, k, j - 1); // Don't call an event for the old block to limit event spam
CraftWorld world = ((WorldServer) this).getWorld();
@ -56,7 +42,7 @@ index 7c6127739f1d88ee0dc411db5fcaa37d7fff36f7..5ce86030a71c181c4c28b8934be4fa8c
BlockPhysicsEvent event = new BlockPhysicsEvent(world.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), CraftBlockData.fromData(iblockdata));
this.getServer().getPluginManager().callEvent(event);
@@ -508,7 +508,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@@ -560,7 +560,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
try {
// CraftBukkit start
CraftWorld world = ((WorldServer) this).getWorld();
@ -65,15 +51,29 @@ index 7c6127739f1d88ee0dc411db5fcaa37d7fff36f7..5ce86030a71c181c4c28b8934be4fa8c
BlockPhysicsEvent event = new BlockPhysicsEvent(world.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), CraftBlockData.fromData(iblockdata), world.getBlockAt(blockposition1.getX(), blockposition1.getY(), blockposition1.getZ()));
this.getServer().getPluginManager().callEvent(event);
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index a7b78b317dc70816fb0b23989bebe30a300ed561..7a1f6d446fb62b0aa72212b44899606c8ec99b55 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -87,6 +87,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
private int tickPosition;
public final Convertable.ConversionSession convertable;
public final UUID uuid;
+ boolean hasPhysicsEvent = true; // Paper
diff --git a/src/main/java/net/minecraft/world/level/block/BlockPlant.java b/src/main/java/net/minecraft/world/level/block/BlockPlant.java
index 33a5c5a4dc1478ab211dbb2e09df87570b06644f..81fbdda5e87b07259db206316cb4b423d9acdc3c 100644
--- a/src/main/java/net/minecraft/world/level/block/BlockPlant.java
+++ b/src/main/java/net/minecraft/world/level/block/BlockPlant.java
@@ -23,7 +23,7 @@ public class BlockPlant extends Block {
public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) {
// CraftBukkit start
if (!iblockdata.canPlace(generatoraccess, blockposition)) {
- if (!org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPhysicsEvent(generatoraccess, blockposition).isCancelled()) {
+ if (!(generatoraccess instanceof WorldServer && ((WorldServer) generatoraccess).hasPhysicsEvent) || !org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPhysicsEvent(generatoraccess, blockposition).isCancelled()) { // Paper
return Blocks.AIR.getBlockData();
}
}
diff --git a/src/main/java/net/minecraft/world/level/block/BlockTallPlant.java b/src/main/java/net/minecraft/world/level/block/BlockTallPlant.java
index ca22187625f7ac6c43b663fd4d66cbf0c943c655..7c34cc7c0b74a336d0f0e705deab6d0f86e2e5f8 100644
--- a/src/main/java/net/minecraft/world/level/block/BlockTallPlant.java
+++ b/src/main/java/net/minecraft/world/level/block/BlockTallPlant.java
@@ -83,7 +83,7 @@ public class BlockTallPlant extends BlockPlant {
@Override public Chunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI
return this.chunkProvider.getChunkAt(x, z, false);
protected static void b(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman) {
// CraftBukkit start
- if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPhysicsEvent(world, blockposition).isCancelled()) {
+ if (((WorldServer)world).hasPhysicsEvent && org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPhysicsEvent(world, blockposition).isCancelled()) { // Paper
return;
}
// CraftBukkit end

View File

@ -4,11 +4,11 @@ Date: Mon, 28 Mar 2016 20:32:58 -0400
Subject: [PATCH] Entity AddTo/RemoveFrom World Events
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 7e44af3e933f16fc00cd2b43e913f87380fb1cae..d199191220b5afc42d639f316878501c91514a50 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1103,7 +1103,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
index 3b82b358d53454dcde4e64123e6262a68a5ed1b0..acff0752aba49bb360d944e5f648b80a82bc984d 100644
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
@@ -1212,7 +1212,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
if (entity instanceof EntityInsentient) {
this.navigators.remove(((EntityInsentient) entity).getNavigation());
}
@ -17,7 +17,7 @@ index 7e44af3e933f16fc00cd2b43e913f87380fb1cae..d199191220b5afc42d639f316878501c
entity.valid = false; // CraftBukkit
}
@@ -1141,6 +1141,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -1250,6 +1250,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
entity.origin = entity.getBukkitEntity().getLocation();
}
// Paper end

View File

@ -29,11 +29,11 @@ index cd64fb9d0c6d123e1c86cb33f12cd9cefc9f80d0..74ba5dbb83c13ce1721619b755036a78
+ fixedInhabitedTime = getInt("fixed-chunk-inhabited-time", -1);
+ }
}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 9ef17a2ad31c8e11ba433b49aa9a31cf8df57dc8..83858165764a7459843433de1a077037692a2a97 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -986,7 +986,7 @@ public class Chunk implements IChunkAccess {
diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
index ace0566626338f02cbfcc8b40d29dc6a66ede58d..c24315a329b3076a022fdf2aa7459e7117323e20 100644
--- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
@@ -1020,7 +1020,7 @@ public class Chunk implements IChunkAccess {
@Override
public long getInhabitedTime() {

View File

@ -5,11 +5,11 @@ Subject: [PATCH] EntityPathfindEvent
Fires when an Entity decides to start moving to a location.
diff --git a/src/main/java/net/minecraft/server/Navigation.java b/src/main/java/net/minecraft/server/Navigation.java
index 95f916d5a08a7781278080c4f4abd4e152a945b5..da15615a19474d5db9bd46c3d772f467ec58b133 100644
--- a/src/main/java/net/minecraft/server/Navigation.java
+++ b/src/main/java/net/minecraft/server/Navigation.java
@@ -60,7 +60,7 @@ public class Navigation extends NavigationAbstract {
diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/Navigation.java b/src/main/java/net/minecraft/world/entity/ai/navigation/Navigation.java
index 942e03578836524ba746bc37699677eb06cc7803..703d06b2b29f1500301d82df78dc377141085145 100644
--- a/src/main/java/net/minecraft/world/entity/ai/navigation/Navigation.java
+++ b/src/main/java/net/minecraft/world/entity/ai/navigation/Navigation.java
@@ -75,7 +75,7 @@ public class Navigation extends NavigationAbstract {
@Override
public PathEntity a(Entity entity, int i) {
@ -18,11 +18,11 @@ index 95f916d5a08a7781278080c4f4abd4e152a945b5..da15615a19474d5db9bd46c3d772f467
}
private int u() {
diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java
index edcc8af6ee36b937f61d3e52cb001b24fa16f690..48cf95db7226b23fc688aba47aea3b378faec14c 100644
--- a/src/main/java/net/minecraft/server/NavigationAbstract.java
+++ b/src/main/java/net/minecraft/server/NavigationAbstract.java
@@ -8,7 +8,7 @@ import javax.annotation.Nullable;
diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java b/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java
index 8848a7552a0ef3944560a71f71620c6bd0f08c10..8c699279a3553da2888669c64269a1dfd8152e22 100644
--- a/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java
+++ b/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java
@@ -28,7 +28,7 @@ import net.minecraft.world.phys.Vec3D;
public abstract class NavigationAbstract {
@ -31,7 +31,7 @@ index edcc8af6ee36b937f61d3e52cb001b24fa16f690..48cf95db7226b23fc688aba47aea3b37
protected final World b;
@Nullable
protected PathEntity c;
@@ -95,16 +95,26 @@ public abstract class NavigationAbstract {
@@ -115,16 +115,26 @@ public abstract class NavigationAbstract {
@Nullable
public PathEntity a(BlockPosition blockposition, int i) {
@ -60,7 +60,7 @@ index edcc8af6ee36b937f61d3e52cb001b24fa16f690..48cf95db7226b23fc688aba47aea3b37
if (set.isEmpty()) {
return null;
} else if (this.a.locY() < 0.0D) {
@@ -114,6 +124,23 @@ public abstract class NavigationAbstract {
@@ -134,6 +144,23 @@ public abstract class NavigationAbstract {
} else if (this.c != null && !this.c.c() && set.contains(this.p)) {
return this.c;
} else {
@ -84,11 +84,11 @@ index edcc8af6ee36b937f61d3e52cb001b24fa16f690..48cf95db7226b23fc688aba47aea3b37
this.b.getMethodProfiler().enter("pathfind");
float f = (float) this.a.b(GenericAttributes.FOLLOW_RANGE);
BlockPosition blockposition = flag ? this.a.getChunkCoordinates().up() : this.a.getChunkCoordinates();
diff --git a/src/main/java/net/minecraft/server/NavigationFlying.java b/src/main/java/net/minecraft/server/NavigationFlying.java
index feed11b62a4df63c1782e7124a3f006d7a8019a3..013bdfe5540ae594a7f9cbe3ef8dc54dfb25afd4 100644
--- a/src/main/java/net/minecraft/server/NavigationFlying.java
+++ b/src/main/java/net/minecraft/server/NavigationFlying.java
@@ -25,7 +25,7 @@ public class NavigationFlying extends NavigationAbstract {
diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationFlying.java b/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationFlying.java
index 2e1efe7a048f64d494260d10a4ae5dba86af5e6c..f5664b8c0762f775f3cd106d156eb74b48bcedc2 100644
--- a/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationFlying.java
+++ b/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationFlying.java
@@ -37,7 +37,7 @@ public class NavigationFlying extends NavigationAbstract {
@Override
public PathEntity a(Entity entity, int i) {

View File

@ -24,11 +24,11 @@ index 716f285e67019b8a62922d09c15883c99f9421aa..439dcc6effdc91830d2b7ede90639829
+ regionFileCacheSize = Math.max(getInt("settings.region-file-cache-size", 256), 4);
+ }
}
diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java
index 26fabb4e5d3945ace851cf6e4474e91611c45b1d..6be04e230fe96c1f2345a00de4f648d9eb712a82 100644
--- a/src/main/java/net/minecraft/server/RegionFileCache.java
+++ b/src/main/java/net/minecraft/server/RegionFileCache.java
@@ -28,7 +28,7 @@ public final class RegionFileCache implements AutoCloseable {
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileCache.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileCache.java
index 44c09e3b8d5abe4fdf9c4a46c21bc82e9dfefa0b..13d0d6e7e03322f20ef5666d5299d26d51d1714c 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileCache.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileCache.java
@@ -32,7 +32,7 @@ public final class RegionFileCache implements AutoCloseable {
if (regionfile != null) {
return regionfile;
} else {

View File

@ -4,11 +4,11 @@ Date: Thu, 31 Mar 2016 19:17:58 -0400
Subject: [PATCH] Do not load chunks for Pathfinding
diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java
index 48cf95db7226b23fc688aba47aea3b378faec14c..5a8fbad220ed535a79539a4e25830c370ca1c89c 100644
--- a/src/main/java/net/minecraft/server/NavigationAbstract.java
+++ b/src/main/java/net/minecraft/server/NavigationAbstract.java
@@ -27,7 +27,7 @@ public abstract class NavigationAbstract {
diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java b/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java
index 8c699279a3553da2888669c64269a1dfd8152e22..c50d792c3ef3277ecab229e866f052854edac19d 100644
--- a/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java
+++ b/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java
@@ -47,7 +47,7 @@ public abstract class NavigationAbstract {
private BlockPosition p;
private int q;
private float r;
@ -17,11 +17,11 @@ index 48cf95db7226b23fc688aba47aea3b378faec14c..5a8fbad220ed535a79539a4e25830c37
private boolean t;
public NavigationAbstract(EntityInsentient entityinsentient, World world) {
diff --git a/src/main/java/net/minecraft/server/Pathfinder.java b/src/main/java/net/minecraft/server/Pathfinder.java
index 8ba6dd459a863717c91dd59f3f2ee5e3a5ed8170..b31d1f73ce0f067e352868b53eab7557c34b17eb 100644
--- a/src/main/java/net/minecraft/server/Pathfinder.java
+++ b/src/main/java/net/minecraft/server/Pathfinder.java
@@ -17,7 +17,7 @@ public class Pathfinder {
diff --git a/src/main/java/net/minecraft/world/level/pathfinder/Pathfinder.java b/src/main/java/net/minecraft/world/level/pathfinder/Pathfinder.java
index 39cd22a820fdc4c75aefb625b45b0c8c6ce1f199..5784be69098805e4d550a0923ac8daa5aada73f9 100644
--- a/src/main/java/net/minecraft/world/level/pathfinder/Pathfinder.java
+++ b/src/main/java/net/minecraft/world/level/pathfinder/Pathfinder.java
@@ -20,7 +20,7 @@ public class Pathfinder {
private final PathPoint[] a = new PathPoint[32];
private final int b;
@ -30,11 +30,11 @@ index 8ba6dd459a863717c91dd59f3f2ee5e3a5ed8170..b31d1f73ce0f067e352868b53eab7557
private final Path d = new Path();
public Pathfinder(PathfinderAbstract pathfinderabstract, int i) {
diff --git a/src/main/java/net/minecraft/server/PathfinderNormal.java b/src/main/java/net/minecraft/server/PathfinderNormal.java
index 449665f52c5f241d2119919abe4d4cde638ebe6f..07b021bd1fb174d1c1a0c83b415c84e582c4f681 100644
--- a/src/main/java/net/minecraft/server/PathfinderNormal.java
+++ b/src/main/java/net/minecraft/server/PathfinderNormal.java
@@ -456,7 +456,12 @@ public class PathfinderNormal extends PathfinderAbstract {
diff --git a/src/main/java/net/minecraft/world/level/pathfinder/PathfinderNormal.java b/src/main/java/net/minecraft/world/level/pathfinder/PathfinderNormal.java
index ed9c1dfbc84b9573784e6531186b3cd9513ddf75..d14f2800237c2a80912bf6f2d418a9ba9031070d 100644
--- a/src/main/java/net/minecraft/world/level/pathfinder/PathfinderNormal.java
+++ b/src/main/java/net/minecraft/world/level/pathfinder/PathfinderNormal.java
@@ -479,7 +479,12 @@ public class PathfinderNormal extends PathfinderAbstract {
for (int j1 = -1; j1 <= 1; ++j1) {
if (l != 0 || j1 != 0) {
blockposition_mutableblockposition.d(i + l, j + i1, k + j1);
@ -48,7 +48,7 @@ index 449665f52c5f241d2119919abe4d4cde638ebe6f..07b021bd1fb174d1c1a0c83b415c84e5
if (iblockdata.a(Blocks.CACTUS)) {
return PathType.DANGER_CACTUS;
@@ -473,6 +478,7 @@ public class PathfinderNormal extends PathfinderAbstract {
@@ -496,6 +501,7 @@ public class PathfinderNormal extends PathfinderAbstract {
if (iblockaccess.getFluid(blockposition_mutableblockposition).a((Tag) TagsFluid.WATER)) {
return PathType.WATER_BORDER;
}
@ -56,7 +56,7 @@ index 449665f52c5f241d2119919abe4d4cde638ebe6f..07b021bd1fb174d1c1a0c83b415c84e5
}
}
}
@@ -482,7 +488,8 @@ public class PathfinderNormal extends PathfinderAbstract {
@@ -505,7 +511,8 @@ public class PathfinderNormal extends PathfinderAbstract {
}
protected static PathType b(IBlockAccess iblockaccess, BlockPosition blockposition) {

View File

@ -4,11 +4,11 @@ Date: Sat, 2 Apr 2016 05:09:16 -0400
Subject: [PATCH] Add PlayerUseUnknownEntityEvent
diff --git a/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java b/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java
index 49c911e54eb3b20d820f3e1895c057eead6d312b..09c757a3bb1d9a49343cf58e18f736e1fa9e10c7 100644
--- a/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java
+++ b/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java
@@ -5,7 +5,7 @@ import javax.annotation.Nullable;
diff --git a/src/main/java/net/minecraft/network/protocol/game/PacketPlayInUseEntity.java b/src/main/java/net/minecraft/network/protocol/game/PacketPlayInUseEntity.java
index 9f3f8568ef9484ba226deaa6429f819c325b7a26..ce63f3e5ac4d1a4311c0ebeb7574d999d45987d9 100644
--- a/src/main/java/net/minecraft/network/protocol/game/PacketPlayInUseEntity.java
+++ b/src/main/java/net/minecraft/network/protocol/game/PacketPlayInUseEntity.java
@@ -11,7 +11,7 @@ import net.minecraft.world.phys.Vec3D;
public class PacketPlayInUseEntity implements Packet<PacketListenerPlayIn> {
@ -17,11 +17,11 @@ index 49c911e54eb3b20d820f3e1895c057eead6d312b..09c757a3bb1d9a49343cf58e18f736e1
private PacketPlayInUseEntity.EnumEntityUseAction action;
private Vec3D c;
private EnumHand d;
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 2436ee100bdf7cb2166595f41af61af806ecdd46..f021568601198ddcf4c1c312eb5d3eef4b9eb5e5 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -2052,6 +2052,16 @@ public class PlayerConnection implements PacketListenerPlayIn {
diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java
index 98189c2f4c973427563c48a231bf8e6c21e0391d..7aec9a349ea941153863d95eb8df4f8c884b5617 100644
--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java
@@ -2197,6 +2197,16 @@ public class PlayerConnection implements PacketListenerPlayIn {
}
}
}

View File

@ -4,11 +4,11 @@ Date: Sat, 2 Apr 2016 20:37:03 -0400
Subject: [PATCH] Fix reducedDebugInfo not initialized on client
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index c71dea3e51c93cf1ad60b8a76408774d67552de8..acbdc4736c2f6f181e25b776a2c025bd2af85af2 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -171,6 +171,7 @@ public abstract class PlayerList {
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index cfd0af520dd3dcf364a3ffd03a74e3b9ee6045af..152aa38788a21638aab7cfe2dc187671f1143bde 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -246,6 +246,7 @@ public abstract class PlayerList {
playerconnection.sendPacket(new PacketPlayOutHeldItemSlot(entityplayer.inventory.itemInHandIndex));
playerconnection.sendPacket(new PacketPlayOutRecipeUpdate(this.server.getCraftingManager().b()));
playerconnection.sendPacket(new PacketPlayOutTags(this.server.getTagRegistry()));

View File

@ -19,11 +19,11 @@ index 74ba5dbb83c13ce1721619b755036a7864a1fb90..db2dddd12f54e6d15916c4cee6236765
+ log("Grass Spread Tick Rate: " + grassUpdateRate);
+ }
}
diff --git a/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java b/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java
index 5eb62e9b9a228eaa50526e4203998246783a33d0..7b29d47dfdef7611db58068af285f76d92a9f12a 100644
--- a/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java
+++ b/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java
@@ -31,6 +31,7 @@ public abstract class BlockDirtSnowSpreadable extends BlockDirtSnow {
diff --git a/src/main/java/net/minecraft/world/level/block/BlockDirtSnowSpreadable.java b/src/main/java/net/minecraft/world/level/block/BlockDirtSnowSpreadable.java
index a98392f06e66959ec1b75df8d2ecf3b5267980af..b8b0ac69a4114936cfe86ab90f95bba5bf125069 100644
--- a/src/main/java/net/minecraft/world/level/block/BlockDirtSnowSpreadable.java
+++ b/src/main/java/net/minecraft/world/level/block/BlockDirtSnowSpreadable.java
@@ -41,6 +41,7 @@ public abstract class BlockDirtSnowSpreadable extends BlockDirtSnow {
@Override
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {

View File

@ -4,11 +4,11 @@ Date: Sun, 3 Apr 2016 17:48:50 -0400
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
index e04d2182915ca3ac69353ef967ae3f703ab9fc30..3dd789131e8ebe5ac82b1fac2cd15aa5893704ee 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -466,6 +466,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java
index 70db5312ac556ea53247efdbc7759910ba0c9a95..7611481db980a230d42b3cec1d81fae2622ca634 100644
--- a/src/main/java/net/minecraft/world/level/World.java
+++ b/src/main/java/net/minecraft/world/level/World.java
@@ -518,6 +518,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
public void b(BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1) {}
public void applyPhysics(BlockPosition blockposition, Block block) {

View File

@ -10,11 +10,11 @@ After: http://i.imgur.com/nJ46crB.png
Optimize redundant converting of static fields into an unsigned long each call by precomputing it in ctor
diff --git a/src/main/java/net/minecraft/server/DataBits.java b/src/main/java/net/minecraft/server/DataBits.java
index 53e7bac2f7a99238f509bb0f871ebed103fda568..2a01a48ad347fb123492218a60404b034cfcfbc5 100644
--- a/src/main/java/net/minecraft/server/DataBits.java
+++ b/src/main/java/net/minecraft/server/DataBits.java
@@ -12,8 +12,8 @@ public class DataBits {
diff --git a/src/main/java/net/minecraft/util/DataBits.java b/src/main/java/net/minecraft/util/DataBits.java
index 0c0576c8730069fb5364d8383dec8ab7e698658d..c4f3b680512fb15cea01ad12d0a00c6e60bf34b7 100644
--- a/src/main/java/net/minecraft/util/DataBits.java
+++ b/src/main/java/net/minecraft/util/DataBits.java
@@ -13,8 +13,8 @@ public class DataBits {
private final long d;
private final int e;
private final int f;
@ -25,7 +25,7 @@ index 53e7bac2f7a99238f509bb0f871ebed103fda568..2a01a48ad347fb123492218a60404b03
private final int i;
public DataBits(int i, int j) {
@@ -28,8 +28,8 @@ public class DataBits {
@@ -29,8 +29,8 @@ public class DataBits {
this.f = (char) (64 / i);
int k = 3 * (this.f - 1);
@ -36,7 +36,7 @@ index 53e7bac2f7a99238f509bb0f871ebed103fda568..2a01a48ad347fb123492218a60404b03
this.i = DataBits.a[k + 2];
int l = (j + this.f - 1) / this.f;
@@ -46,15 +46,15 @@ public class DataBits {
@@ -47,15 +47,15 @@ public class DataBits {
}
private int b(int i) {
@ -58,7 +58,7 @@ index 53e7bac2f7a99238f509bb0f871ebed103fda568..2a01a48ad347fb123492218a60404b03
int k = this.b(i);
long l = this.b[k];
int i1 = (i - k * this.f) * this.c;
@@ -64,9 +64,9 @@ public class DataBits {
@@ -65,9 +65,9 @@ public class DataBits {
return j1;
}
@ -71,7 +71,7 @@ index 53e7bac2f7a99238f509bb0f871ebed103fda568..2a01a48ad347fb123492218a60404b03
int k = this.b(i);
long l = this.b[k];
int i1 = (i - k * this.f) * this.c;
@@ -74,8 +74,8 @@ public class DataBits {
@@ -75,8 +75,8 @@ public class DataBits {
this.b[k] = l & ~(this.d << i1) | ((long) j & this.d) << i1;
}

View File

@ -26,22 +26,22 @@ index db2dddd12f54e6d15916c4cee623676541de37fb..1942f5224aaebb18adb591d6f70a419c
+ }
}
diff --git a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
index aa509a1f382991e0f5683b75b0af4094f84d2844..e8d699b01a3bae60720c81e4427a310e2a2b1640 100644
index d92a454adc9773883563eb0efff9c6445b89c0d4..712ca6b3857c6e5cae25a71228365508e514a0f4 100644
--- a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
+++ b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
@@ -14,7 +14,11 @@ import net.kyori.adventure.text.event.ClickEvent;
import net.minecraft.server.EntityPlayer;
import net.minecraft.server.IChatBaseComponent;
@@ -16,7 +16,11 @@ import net.kyori.adventure.text.format.TextDecoration;
import net.minecraft.network.chat.IChatBaseComponent;
import net.minecraft.server.MinecraftServer;
+import net.minecraft.server.ScoreboardTeam;
+import net.minecraft.server.ScoreboardTeamBase;
import net.minecraft.server.level.EntityPlayer;
+import net.minecraft.world.scores.ScoreboardTeam;
+import net.minecraft.world.scores.ScoreboardTeamBase;
import org.bukkit.Bukkit;
+import org.bukkit.ChatColor;
+import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.craftbukkit.entity.CraftPlayer;
import org.bukkit.craftbukkit.util.LazyPlayerSet;
import org.bukkit.craftbukkit.util.Waitable;
@@ -175,10 +179,22 @@ public final class ChatProcessor {
@@ -104,10 +108,22 @@ public final class ChatProcessor {
}
private static String legacyDisplayName(final CraftPlayer player) {

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Workaround for setting passengers on players
SPIGOT-1915 & GH-114
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 0a00d043c1fcddcfab8638eab8feb2993060b9b8..ecec8a27009f2296e078fdb9bf1ed2f1df209de8 100644
index b4a2758ee246252d6076e861b45d11dae6e33096..facf2a79144a2d0fbea907c084becaea7bbdc48c 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -874,6 +874,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -18,7 +18,7 @@ index 0a00d043c1fcddcfab8638eab8feb2993060b9b8..ecec8a27009f2296e078fdb9bf1ed2f1
+ public boolean setPassenger(org.bukkit.entity.Entity passenger) {
+ boolean wasSet = super.setPassenger(passenger);
+ if (wasSet) {
+ this.getHandle().playerConnection.sendPacket(new net.minecraft.server.PacketPlayOutMount(this.getHandle()));
+ this.getHandle().playerConnection.sendPacket(new net.minecraft.network.protocol.game.PacketPlayOutMount(this.getHandle()));
+ }
+ return wasSet;
+ }

View File

@ -5,11 +5,33 @@ Subject: [PATCH] Remove unused World Tile Entity List
Massive hit to performance and it is completely unnecessary.
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index d6ee6aae693519a379b4a6ba26642d5ef78e4deb..369a6b42a89fd75aeb3da4930f47b6917a1ae393 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -39,7 +39,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
index acff0752aba49bb360d944e5f648b80a82bc984d..e96a92119dce25c34509e502e8dce8596af6fd67 100644
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
@@ -1720,7 +1720,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
}
bufferedwriter.write(String.format("entities: %d\n", this.entitiesById.size()));
- bufferedwriter.write(String.format("block_entities: %d\n", this.tileEntityList.size()));
+ bufferedwriter.write(String.format("block_entities: %d\n", this.tileEntityListTick.size())); // Paper - remove unused list
bufferedwriter.write(String.format("block_ticks: %d\n", this.getBlockTickList().a()));
bufferedwriter.write(String.format("fluid_ticks: %d\n", this.getFluidTickList().a()));
bufferedwriter.write("distance_manager: " + playerchunkmap.e().c() + "\n");
@@ -1859,7 +1859,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
private void a(Writer writer) throws IOException {
CSVWriter csvwriter = CSVWriter.a().a("x").a("y").a("z").a("type").a(writer);
- Iterator iterator = this.tileEntityList.iterator();
+ Iterator iterator = this.tileEntityListTick.iterator(); // Paper - remove unused list
while (iterator.hasNext()) {
TileEntity tileentity = (TileEntity) iterator.next();
diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java
index 7611481db980a230d42b3cec1d81fae2622ca634..2bb85896df999675d33f70a90f1c68865099ee83 100644
--- a/src/main/java/net/minecraft/world/level/World.java
+++ b/src/main/java/net/minecraft/world/level/World.java
@@ -91,7 +91,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
public static final ResourceKey<World> THE_NETHER = ResourceKey.a(IRegistry.L, new MinecraftKey("the_nether"));
public static final ResourceKey<World> THE_END = ResourceKey.a(IRegistry.L, new MinecraftKey("the_end"));
private static final EnumDirection[] a = EnumDirection.values();
@ -18,7 +40,7 @@ index d6ee6aae693519a379b4a6ba26642d5ef78e4deb..369a6b42a89fd75aeb3da4930f47b691
public final List<TileEntity> tileEntityListTick = Lists.newArrayList();
protected final List<TileEntity> tileEntityListPending = Lists.newArrayList();
protected final java.util.Set<TileEntity> tileEntityListUnload = com.google.common.collect.Sets.newHashSet();
@@ -631,9 +631,9 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@@ -683,9 +683,9 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
}, tileentity::getPosition});
}
@ -30,7 +52,7 @@ index d6ee6aae693519a379b4a6ba26642d5ef78e4deb..369a6b42a89fd75aeb3da4930f47b691
this.tileEntityListTick.add(tileentity);
}
@@ -669,7 +669,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@@ -721,7 +721,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
timings.tileEntityTick.startTiming(); // Spigot
if (!this.tileEntityListUnload.isEmpty()) {
this.tileEntityListTick.removeAll(this.tileEntityListUnload);
@ -39,7 +61,7 @@ index d6ee6aae693519a379b4a6ba26642d5ef78e4deb..369a6b42a89fd75aeb3da4930f47b691
this.tileEntityListUnload.clear();
}
@@ -729,7 +729,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@@ -781,7 +781,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
tilesThisCycle--;
this.tileEntityListTick.remove(tileTickPosition--);
// Spigot end
@ -48,7 +70,7 @@ index d6ee6aae693519a379b4a6ba26642d5ef78e4deb..369a6b42a89fd75aeb3da4930f47b691
if (this.isLoaded(tileentity.getPosition())) {
this.getChunkAtWorldCoords(tileentity.getPosition()).removeTileEntity(tileentity.getPosition());
}
@@ -759,7 +759,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@@ -811,7 +811,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
this.notify(tileentity1.getPosition(), iblockdata, iblockdata, 3);
// CraftBukkit start
// From above, don't screw this up - SPIGOT-1746
@ -57,7 +79,7 @@ index d6ee6aae693519a379b4a6ba26642d5ef78e4deb..369a6b42a89fd75aeb3da4930f47b691
this.a(tileentity1);
}
// CraftBukkit end
@@ -905,7 +905,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@@ -957,7 +957,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
} else {
if (tileentity != null) {
this.tileEntityListPending.remove(tileentity);
@ -66,25 +88,3 @@ index d6ee6aae693519a379b4a6ba26642d5ef78e4deb..369a6b42a89fd75aeb3da4930f47b691
this.tileEntityListTick.remove(tileentity);
}
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index dbb022fb186b181b9b1912adfaebbb00fa1c7d4b..486ba1efc934c6851d2b570493af6e1079a7abd5 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1611,7 +1611,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
}
bufferedwriter.write(String.format("entities: %d\n", this.entitiesById.size()));
- bufferedwriter.write(String.format("block_entities: %d\n", this.tileEntityList.size()));
+ bufferedwriter.write(String.format("block_entities: %d\n", this.tileEntityListTick.size())); // Paper - remove unused list
bufferedwriter.write(String.format("block_ticks: %d\n", this.getBlockTickList().a()));
bufferedwriter.write(String.format("fluid_ticks: %d\n", this.getFluidTickList().a()));
bufferedwriter.write("distance_manager: " + playerchunkmap.e().c() + "\n");
@@ -1750,7 +1750,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
private void a(Writer writer) throws IOException {
CSVWriter csvwriter = CSVWriter.a().a("x").a("y").a("z").a("type").a(writer);
- Iterator iterator = this.tileEntityList.iterator();
+ Iterator iterator = this.tileEntityListTick.iterator(); // Paper - remove unused list
while (iterator.hasNext()) {
TileEntity tileentity = (TileEntity) iterator.next();

View File

@ -4,12 +4,12 @@ Date: Wed, 13 Apr 2016 00:30:10 -0400
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
index 5528df3d07a2649a5248ff3b26720a2e2a4a0c25..4fae1b3274a96b871b39de083e9b28ab6129533f 100644
--- a/src/main/java/net/minecraft/server/TileEntitySkull.java
+++ b/src/main/java/net/minecraft/server/TileEntitySkull.java
@@ -24,7 +24,7 @@ import com.mojang.authlib.ProfileLookupCallback;
import java.util.concurrent.Callable;
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntitySkull.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntitySkull.java
index 5e778fcc1bce3339890933c0c769701a432240d8..06ab45e0927403beb6b5e11d2b5ea93d4786f1d3 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntitySkull.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntitySkull.java
@@ -32,7 +32,7 @@ import net.minecraft.server.MinecraftServer;
import net.minecraft.world.entity.player.EntityHuman;
// Spigot end
-public class TileEntitySkull extends TileEntity implements ITickable {
@ -17,7 +17,7 @@ index 5528df3d07a2649a5248ff3b26720a2e2a4a0c25..4fae1b3274a96b871b39de083e9b28ab
@Nullable
private static UserCache userCache;
@@ -127,7 +127,7 @@ public class TileEntitySkull extends TileEntity implements ITickable {
@@ -135,7 +135,7 @@ public class TileEntitySkull extends TileEntity implements ITickable {
}

View File

@ -18,11 +18,24 @@ index 439dcc6effdc91830d2b7ede9063982998b37120..504efea7b6f50a0d17f4f353781953df
+ enablePlayerCollisions = getBoolean("settings.enable-player-collisions", true);
+ }
}
diff --git a/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutScoreboardTeam.java b/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutScoreboardTeam.java
index bc40f2cbe1645fd60c4cee106b90f17cd043d32d..c1bb5c325286119891e8d68ce8f7328c99edb486 100644
--- a/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutScoreboardTeam.java
+++ b/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutScoreboardTeam.java
@@ -112,7 +112,7 @@ public class PacketPlayOutScoreboardTeam implements Packet<PacketListenerPlayOut
packetdataserializer.a(this.b);
packetdataserializer.writeByte(this.j);
packetdataserializer.a(this.e);
- packetdataserializer.a(this.f);
+ packetdataserializer.a(!com.destroystokyo.paper.PaperConfig.enablePlayerCollisions ? "never" : this.f); // Paper
packetdataserializer.a((Enum) this.g);
packetdataserializer.a(this.c);
packetdataserializer.a(this.d);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 575b4e670810b0be51067ba3e4c838e547a1f1dc..5fd43537ced63947cab0e179f88109d63d1c87e7 100644
index 555b99c45e0785750c48b0db2bc0b8da98c52295..bea6cd6cf4dceece74de9cbb12a094334d129c4a 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -434,6 +434,20 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
@@ -541,6 +541,20 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldLoadEvent(worldserver.getWorld()));
}
@ -43,24 +56,11 @@ index 575b4e670810b0be51067ba3e4c838e547a1f1dc..5fd43537ced63947cab0e179f88109d6
this.server.enablePlugins(org.bukkit.plugin.PluginLoadOrder.POSTWORLD);
this.server.getPluginManager().callEvent(new ServerLoadEvent(ServerLoadEvent.LoadType.STARTUP));
this.serverConnection.acceptConnections();
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java b/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java
index d1581c9d9838797eb425020d21bd0fba432e5652..99dc43159f240135957aee35f6129f19419c6c25 100644
--- a/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java
+++ b/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java
@@ -105,7 +105,7 @@ public class PacketPlayOutScoreboardTeam implements Packet<PacketListenerPlayOut
packetdataserializer.a(this.b);
packetdataserializer.writeByte(this.j);
packetdataserializer.a(this.e);
- packetdataserializer.a(this.f);
+ packetdataserializer.a(!com.destroystokyo.paper.PaperConfig.enablePlayerCollisions ? "never" : this.f); // Paper
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
index acbdc4736c2f6f181e25b776a2c025bd2af85af2..5652462008dd857f2dc36b80e3fe5d3d83867ce5 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -72,6 +72,7 @@ public abstract class PlayerList {
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 152aa38788a21638aab7cfe2dc187671f1143bde..aeda31ccd2829bc7ad60c6941174addc8b02c4eb 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -145,6 +145,7 @@ public abstract class PlayerList {
// CraftBukkit start
private CraftServer cserver;
private final Map<String,EntityPlayer> playersByName = new java.util.HashMap<>();
@ -68,7 +68,7 @@ index acbdc4736c2f6f181e25b776a2c025bd2af85af2..5652462008dd857f2dc36b80e3fe5d3d
public PlayerList(MinecraftServer minecraftserver, IRegistryCustom.Dimension iregistrycustom_dimension, WorldNBTStorage worldnbtstorage, int i) {
this.cserver = minecraftserver.server = new CraftServer((DedicatedServer) minecraftserver, this);
@@ -301,6 +302,13 @@ public abstract class PlayerList {
@@ -376,6 +377,13 @@ public abstract class PlayerList {
}
entityplayer.syncInventory();
@ -82,7 +82,7 @@ index acbdc4736c2f6f181e25b776a2c025bd2af85af2..5652462008dd857f2dc36b80e3fe5d3d
// CraftBukkit - Moved from above, added world
PlayerList.LOGGER.info("{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", entityplayer.getDisplayName().getString(), s1, entityplayer.getId(), worldserver1.worldDataServer.getName(), entityplayer.locX(), entityplayer.locY(), entityplayer.locZ());
}
@@ -421,6 +429,16 @@ public abstract class PlayerList {
@@ -496,6 +504,16 @@ public abstract class PlayerList {
entityplayer.playerTick(); // SPIGOT-924
// CraftBukkit end
@ -99,7 +99,7 @@ index acbdc4736c2f6f181e25b776a2c025bd2af85af2..5652462008dd857f2dc36b80e3fe5d3d
this.savePlayerFile(entityplayer);
if (entityplayer.isPassenger()) {
Entity entity = entityplayer.getRootVehicle();
@@ -1069,6 +1087,13 @@ public abstract class PlayerList {
@@ -1144,6 +1162,13 @@ public abstract class PlayerList {
}
// CraftBukkit end

View File

@ -5,11 +5,11 @@ Subject: [PATCH] Add handshake event to allow plugins to handle client
handshaking logic themselves
diff --git a/src/main/java/net/minecraft/server/HandshakeListener.java b/src/main/java/net/minecraft/server/HandshakeListener.java
index 69fd0a7b230c6f6eb46a43477465f77b265cc3c9..bad5d4f165d1e469ed583b036f78e467b94691fd 100644
--- a/src/main/java/net/minecraft/server/HandshakeListener.java
+++ b/src/main/java/net/minecraft/server/HandshakeListener.java
@@ -14,7 +14,7 @@ public class HandshakeListener implements PacketHandshakingInListener {
diff --git a/src/main/java/net/minecraft/server/network/HandshakeListener.java b/src/main/java/net/minecraft/server/network/HandshakeListener.java
index b1714750538a0107d9922812d08471921b755925..31011ec34e5eeae29705f6ec167fb2e832284873 100644
--- a/src/main/java/net/minecraft/server/network/HandshakeListener.java
+++ b/src/main/java/net/minecraft/server/network/HandshakeListener.java
@@ -25,7 +25,7 @@ public class HandshakeListener implements PacketHandshakingInListener {
// CraftBukkit end
private static final IChatBaseComponent a = new ChatComponentText("Ignoring status request");
private final MinecraftServer b;
@ -18,7 +18,7 @@ index 69fd0a7b230c6f6eb46a43477465f77b265cc3c9..bad5d4f165d1e469ed583b036f78e467
public HandshakeListener(MinecraftServer minecraftserver, NetworkManager networkmanager) {
this.b = minecraftserver;
@@ -73,8 +73,34 @@ public class HandshakeListener implements PacketHandshakingInListener {
@@ -84,8 +84,34 @@ public class HandshakeListener implements PacketHandshakingInListener {
this.c.close(chatmessage);
} else {
this.c.setPacketListener(new LoginListener(this.b, this.c));

View File

@ -5,11 +5,11 @@ Subject: [PATCH] Configurable RCON IP address
For servers with multiple IP's, ability to bind to a specific interface.
diff --git a/src/main/java/net/minecraft/server/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/DedicatedServerProperties.java
index ebeea0df593bc82e7740203bec6b45e16318ab35..205d56f88440789df8a028b3827dd388fea56f63 100644
--- a/src/main/java/net/minecraft/server/DedicatedServerProperties.java
+++ b/src/main/java/net/minecraft/server/DedicatedServerProperties.java
@@ -61,6 +61,8 @@ public class DedicatedServerProperties extends PropertyManager<DedicatedServerPr
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
index 0ecff9f5e2ba444b196d80da341ff851dd5ce26f..b7cf02301c02ed0a6b696384e656426762ae2105 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
@@ -67,6 +67,8 @@ public class DedicatedServerProperties extends PropertyManager<DedicatedServerPr
public final PropertyManager<DedicatedServerProperties>.EditableProperty<Boolean> whiteList;
public final GeneratorSettings generatorSettings;
@ -18,7 +18,7 @@ index ebeea0df593bc82e7740203bec6b45e16318ab35..205d56f88440789df8a028b3827dd388
// CraftBukkit start
public DedicatedServerProperties(Properties properties, IRegistryCustom iregistrycustom, OptionSet optionset) {
super(properties, optionset);
@@ -112,6 +114,10 @@ public class DedicatedServerProperties extends PropertyManager<DedicatedServerPr
@@ -118,6 +120,10 @@ public class DedicatedServerProperties extends PropertyManager<DedicatedServerPr
this.textFilteringConfig = this.getString("text-filtering-config", "");
this.playerIdleTimeout = this.b("player-idle-timeout", 0);
this.whiteList = this.b("white-list", false);
@ -29,11 +29,11 @@ index ebeea0df593bc82e7740203bec6b45e16318ab35..205d56f88440789df8a028b3827dd388
this.generatorSettings = GeneratorSettings.a(iregistrycustom, properties);
}
diff --git a/src/main/java/net/minecraft/server/PropertyManager.java b/src/main/java/net/minecraft/server/PropertyManager.java
index 3aa05fd2b38562039960b58cab0ea40743ef06bb..2170d539a72a3e254a688e6148b282975e84e491 100644
--- a/src/main/java/net/minecraft/server/PropertyManager.java
+++ b/src/main/java/net/minecraft/server/PropertyManager.java
@@ -127,8 +127,8 @@ public abstract class PropertyManager<T extends PropertyManager<T>> {
diff --git a/src/main/java/net/minecraft/server/dedicated/PropertyManager.java b/src/main/java/net/minecraft/server/dedicated/PropertyManager.java
index cb85d8bc1b81f9e5fa95c4dfeffbe689667f56a2..03dd6dc3a1aa8d1be6990c750f96e8a280bc1f25 100644
--- a/src/main/java/net/minecraft/server/dedicated/PropertyManager.java
+++ b/src/main/java/net/minecraft/server/dedicated/PropertyManager.java
@@ -129,8 +129,8 @@ public abstract class PropertyManager<T extends PropertyManager<T>> {
};
}
@ -44,11 +44,11 @@ index 3aa05fd2b38562039960b58cab0ea40743ef06bb..2170d539a72a3e254a688e6148b28297
return (String) getOverride(s, this.properties.getProperty(s)); // CraftBukkit
}
diff --git a/src/main/java/net/minecraft/server/RemoteControlListener.java b/src/main/java/net/minecraft/server/RemoteControlListener.java
index 44afacf7ebbdf09a25189cc636e9c8149e03c9f2..8006659f167879863b5e89e527813e6f664e90d6 100644
--- a/src/main/java/net/minecraft/server/RemoteControlListener.java
+++ b/src/main/java/net/minecraft/server/RemoteControlListener.java
@@ -60,7 +60,7 @@ public class RemoteControlListener extends RemoteConnectionThread {
diff --git a/src/main/java/net/minecraft/server/rcon/thread/RemoteControlListener.java b/src/main/java/net/minecraft/server/rcon/thread/RemoteControlListener.java
index 797a450a08da1b799e32fae2a71a7a50bb90d127..3b3e21d1d86629d6c5e06108e53d1c5e807074d8 100644
--- a/src/main/java/net/minecraft/server/rcon/thread/RemoteControlListener.java
+++ b/src/main/java/net/minecraft/server/rcon/thread/RemoteControlListener.java
@@ -62,7 +62,7 @@ public class RemoteControlListener extends RemoteConnectionThread {
@Nullable
public static RemoteControlListener a(IMinecraftServer iminecraftserver) {
DedicatedServerProperties dedicatedserverproperties = iminecraftserver.getDedicatedServerProperties();

View File

@ -8,11 +8,11 @@ bad behavior.
This also stops fire from spreading to illegal locations.
diff --git a/src/main/java/net/minecraft/server/BlockFire.java b/src/main/java/net/minecraft/server/BlockFire.java
index 3d6aae40cab0cefbfc56389d9d2d37d2f0badd98..e79f3872de2989d0b9b28a8b49cc399968f5bdbf 100644
--- a/src/main/java/net/minecraft/server/BlockFire.java
+++ b/src/main/java/net/minecraft/server/BlockFire.java
@@ -115,7 +115,7 @@ public class BlockFire extends BlockFireAbstract {
diff --git a/src/main/java/net/minecraft/world/level/block/BlockFire.java b/src/main/java/net/minecraft/world/level/block/BlockFire.java
index ee5400fd3e493e1f0518a9e47ddbc997e7a0fb92..c22fad0038fdb0769e23db782e3341206fbd80f9 100644
--- a/src/main/java/net/minecraft/world/level/block/BlockFire.java
+++ b/src/main/java/net/minecraft/world/level/block/BlockFire.java
@@ -135,7 +135,7 @@ public class BlockFire extends BlockFireAbstract {
BlockStateBoolean blockstateboolean = (BlockStateBoolean) BlockFire.h.get(enumdirection);
if (blockstateboolean != null) {
@ -21,7 +21,7 @@ index 3d6aae40cab0cefbfc56389d9d2d37d2f0badd98..e79f3872de2989d0b9b28a8b49cc3999
}
}
@@ -195,6 +195,7 @@ public class BlockFire extends BlockFireAbstract {
@@ -215,6 +215,7 @@ public class BlockFire extends BlockFireAbstract {
}
blockposition_mutableblockposition.a((BaseBlockPosition) blockposition, l, j1, i1);
@ -29,7 +29,7 @@ index 3d6aae40cab0cefbfc56389d9d2d37d2f0badd98..e79f3872de2989d0b9b28a8b49cc3999
int l1 = this.a((IWorldReader) worldserver, (BlockPosition) blockposition_mutableblockposition);
if (l1 > 0) {
@@ -240,10 +241,16 @@ public class BlockFire extends BlockFireAbstract {
@@ -260,10 +261,16 @@ public class BlockFire extends BlockFireAbstract {
}
private void trySpread(World world, BlockPosition blockposition, int i, Random random, int j, BlockPosition sourceposition) { // CraftBukkit add sourceposition
@ -48,7 +48,7 @@ index 3d6aae40cab0cefbfc56389d9d2d37d2f0badd98..e79f3872de2989d0b9b28a8b49cc3999
// CraftBukkit start
org.bukkit.block.Block theBlock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
@@ -289,7 +296,7 @@ public class BlockFire extends BlockFireAbstract {
@@ -309,7 +316,7 @@ public class BlockFire extends BlockFireAbstract {
for (int j = 0; j < i; ++j) {
EnumDirection enumdirection = aenumdirection[j];
@ -57,7 +57,7 @@ index 3d6aae40cab0cefbfc56389d9d2d37d2f0badd98..e79f3872de2989d0b9b28a8b49cc3999
return true;
}
}
@@ -307,7 +314,12 @@ public class BlockFire extends BlockFireAbstract {
@@ -327,7 +334,12 @@ public class BlockFire extends BlockFireAbstract {
for (int k = 0; k < j; ++k) {
EnumDirection enumdirection = aenumdirection[k];
@ -71,7 +71,7 @@ index 3d6aae40cab0cefbfc56389d9d2d37d2f0badd98..e79f3872de2989d0b9b28a8b49cc3999
i = Math.max(this.getFlameChance(iblockdata), i);
}
@@ -318,7 +330,7 @@ public class BlockFire extends BlockFireAbstract {
@@ -338,7 +350,7 @@ public class BlockFire extends BlockFireAbstract {
@Override
protected boolean e(IBlockData iblockdata) {

View File

@ -4,11 +4,11 @@ Date: Tue, 19 Apr 2016 14:09:31 -0500
Subject: [PATCH] Implement PlayerLocaleChangeEvent
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 74727e9e1d689e4a280fb223db9196fef16103f7..103a7fe192182d92ae21783c728e494b5533917a 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -1558,7 +1558,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
diff --git a/src/main/java/net/minecraft/server/level/EntityPlayer.java b/src/main/java/net/minecraft/server/level/EntityPlayer.java
index 1f31104a1a350f3b53ce45b034cafe528d406291..3d5d1b83094b5ca45fae47055db397630fdd4f04 100644
--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java
@@ -1685,7 +1685,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
return s;
}
@ -17,7 +17,7 @@ index 74727e9e1d689e4a280fb223db9196fef16103f7..103a7fe192182d92ae21783c728e494b
public java.util.Locale adventure$locale = java.util.Locale.US; // Paper
public void a(PacketPlayInSettings packetplayinsettings) {
// CraftBukkit start
@@ -1566,9 +1566,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -1693,9 +1693,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
PlayerChangedMainHandEvent event = new PlayerChangedMainHandEvent(getBukkitEntity(), getMainHand() == EnumMainHand.LEFT ? MainHand.LEFT : MainHand.RIGHT);
this.server.server.getPluginManager().callEvent(event);
}
@ -30,7 +30,7 @@ index 74727e9e1d689e4a280fb223db9196fef16103f7..103a7fe192182d92ae21783c728e494b
this.locale = packetplayinsettings.locale;
// Paper start
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index b93e6c6ec058c3cc73c7fec47e081a5295c1ec6b..f2cb1d8d82f07019d79a3b967f999b26270f7c29 100644
index facf2a79144a2d0fbea907c084becaea7bbdc48c..6d7f1dee9ae2fb0b9620d85969de86eee09020cc 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1874,8 +1874,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -5,11 +5,11 @@ Subject: [PATCH] EntityRegainHealthEvent isFastRegen API
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
index 1fb7e29b29adef72bd5a49c87d954973f46f9c81..f54d05f59342231434a70c3b12b7cf9b73f98508 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -1037,10 +1037,16 @@ public abstract class EntityLiving extends Entity {
diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java
index acbd10432b09172f7541b2f4081d1aa9812194ac..ecb07130be80b484e0f2241a368db967775148e8 100644
--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java
+++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java
@@ -1130,10 +1130,16 @@ public abstract class EntityLiving extends Entity {
}
public void heal(float f, EntityRegainHealthEvent.RegainReason regainReason) {
@ -27,11 +27,11 @@ index 1fb7e29b29adef72bd5a49c87d954973f46f9c81..f54d05f59342231434a70c3b12b7cf9b
// Suppress during worldgen
if (this.valid) {
this.world.getServer().getPluginManager().callEvent(event);
diff --git a/src/main/java/net/minecraft/server/FoodMetaData.java b/src/main/java/net/minecraft/server/FoodMetaData.java
index f40b67c8bf3048b24b7c7b16effd3c18646d589c..077ff94ec57278f71ea6afb5d7a0e55ecb0fa5ef 100644
--- a/src/main/java/net/minecraft/server/FoodMetaData.java
+++ b/src/main/java/net/minecraft/server/FoodMetaData.java
@@ -74,7 +74,7 @@ public class FoodMetaData {
diff --git a/src/main/java/net/minecraft/world/food/FoodMetaData.java b/src/main/java/net/minecraft/world/food/FoodMetaData.java
index 7ed321acba6d46159f7d67b8d10a0a3e06ac88a9..e455b25b0809af15f6fde957121d0110da7eb08f 100644
--- a/src/main/java/net/minecraft/world/food/FoodMetaData.java
+++ b/src/main/java/net/minecraft/world/food/FoodMetaData.java
@@ -87,7 +87,7 @@ public class FoodMetaData {
if (this.foodTickTimer >= this.saturatedRegenRate) { // CraftBukkit
float f = Math.min(this.saturationLevel, 6.0F);

View File

@ -23,11 +23,11 @@ index 1942f5224aaebb18adb591d6f70a419cfc1a7bdd..5baccb8d50c135ab20c38ffd0690f585
+ log("Frosted Ice: " + (this.frostedIceEnabled ? "enabled" : "disabled") + " / delay: min=" + this.frostedIceDelayMin + ", max=" + this.frostedIceDelayMax);
+ }
}
diff --git a/src/main/java/net/minecraft/server/BlockIceFrost.java b/src/main/java/net/minecraft/server/BlockIceFrost.java
index 00e19300f7f0c9873ca7abb0560f3a9308d2a73d..061b157f66999a733c3c4e990371b6f8d7860de2 100644
--- a/src/main/java/net/minecraft/server/BlockIceFrost.java
+++ b/src/main/java/net/minecraft/server/BlockIceFrost.java
@@ -18,6 +18,7 @@ public class BlockIceFrost extends BlockIce {
diff --git a/src/main/java/net/minecraft/world/level/block/BlockIceFrost.java b/src/main/java/net/minecraft/world/level/block/BlockIceFrost.java
index 7239a30bd4a5dc4ed09802eea8f7126485ebb635..e32e94868386ff06ff29254e6cc3bee9b446a293 100644
--- a/src/main/java/net/minecraft/world/level/block/BlockIceFrost.java
+++ b/src/main/java/net/minecraft/world/level/block/BlockIceFrost.java
@@ -30,6 +30,7 @@ public class BlockIceFrost extends BlockIce {
@Override
public void tickAlways(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
@ -35,7 +35,7 @@ index 00e19300f7f0c9873ca7abb0560f3a9308d2a73d..061b157f66999a733c3c4e990371b6f8
if ((random.nextInt(3) == 0 || this.a(worldserver, blockposition, 4)) && worldserver.getLightLevel(blockposition) > 11 - (Integer) iblockdata.get(BlockIceFrost.a) - iblockdata.b((IBlockAccess) worldserver, blockposition) && this.e(iblockdata, (World) worldserver, blockposition)) {
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition();
EnumDirection[] aenumdirection = EnumDirection.values();
@@ -30,12 +31,12 @@ public class BlockIceFrost extends BlockIce {
@@ -42,12 +43,12 @@ public class BlockIceFrost extends BlockIce {
IBlockData iblockdata1 = worldserver.getType(blockposition_mutableblockposition);
if (iblockdata1.a((Block) this) && !this.e(iblockdata1, (World) worldserver, blockposition_mutableblockposition)) {

View File

@ -6,10 +6,10 @@ Subject: [PATCH] remove null possibility for getServer singleton
to stop IDE complaining about potential NPE
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 5fd43537ced63947cab0e179f88109d63d1c87e7..5c84033df42b2cba1719010e75aeeb00c817eb61 100644
index bea6cd6cf4dceece74de9cbb12a094334d129c4a..3b2fcb4338d56a8e1dd2de799571db4e2a79ec9f 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -72,6 +72,7 @@ import org.spigotmc.SlackActivityAccountant; // Spigot
@@ -179,6 +179,7 @@ import org.spigotmc.SlackActivityAccountant; // Spigot
public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTask> implements IMojangStatistics, ICommandListener, AutoCloseable {
@ -17,7 +17,7 @@ index 5fd43537ced63947cab0e179f88109d63d1c87e7..5c84033df42b2cba1719010e75aeeb00
public static final Logger LOGGER = LogManager.getLogger();
public static final File b = new File("usercache.json");
public static final WorldSettings c = new WorldSettings("Demo World", EnumGamemode.SURVIVAL, false, EnumDifficulty.NORMAL, false, new GameRules(), DataPackConfiguration.a);
@@ -178,6 +179,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
@@ -285,6 +286,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
public MinecraftServer(OptionSet options, DataPackConfiguration datapackconfiguration, Thread thread, IRegistryCustom.Dimension iregistrycustom_dimension, Convertable.ConversionSession convertable_conversionsession, SaveData savedata, ResourcePackRepository resourcepackrepository, Proxy proxy, DataFixer datafixer, DataPackResources datapackresources, MinecraftSessionService minecraftsessionservice, GameProfileRepository gameprofilerepository, UserCache usercache, WorldLoadListenerFactory worldloadlistenerfactory) {
super("Server");
@ -25,7 +25,7 @@ index 5fd43537ced63947cab0e179f88109d63d1c87e7..5c84033df42b2cba1719010e75aeeb00
this.m = new GameProfilerSwitcher(SystemUtils.a, this::ai);
this.methodProfiler = GameProfilerDisabled.a;
this.serverPing = new ServerPing();
@@ -2045,7 +2047,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
@@ -2152,7 +2154,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
@Deprecated
public static MinecraftServer getServer() {

View File

@ -12,11 +12,23 @@ custom renderers are in use, defaulting to the much simpler Vanilla system.
Additionally, numerous issues to player position tracking on maps has been fixed.
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
index dcc9984665a1b6458cee317bb79a3343656cea23..ed2c39502a123063996c7d36cacf5a7164d75438 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -595,6 +595,12 @@ public abstract class EntityHuman extends EntityLiving {
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
index e96a92119dce25c34509e502e8dce8596af6fd67..62430c61047f288ce6df6f77302c3bfb2817b299 100644
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
@@ -1168,6 +1168,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
{
if ( iter.next().trackee == entity )
{
+ map.decorations.remove(entity.getDisplayName().getString()); // Paper
iter.remove();
}
}
diff --git a/src/main/java/net/minecraft/world/entity/player/EntityHuman.java b/src/main/java/net/minecraft/world/entity/player/EntityHuman.java
index f42e16589476c1bd10b13214dda5ac7bb3e52131..291bd9b70a8404a09511fd902b6f376c3d5ca0d4 100644
--- a/src/main/java/net/minecraft/world/entity/player/EntityHuman.java
+++ b/src/main/java/net/minecraft/world/entity/player/EntityHuman.java
@@ -689,6 +689,12 @@ public abstract class EntityHuman extends EntityLiving {
return null;
}
// CraftBukkit end
@ -29,11 +41,11 @@ index dcc9984665a1b6458cee317bb79a3343656cea23..ed2c39502a123063996c7d36cacf5a71
return entityitem;
}
diff --git a/src/main/java/net/minecraft/server/WorldMap.java b/src/main/java/net/minecraft/server/WorldMap.java
index d11725d61b888ceb08c4ea30f23d563170ce944d..7251793423e5413dacc1e031ed75d41fc35cd32e 100644
--- a/src/main/java/net/minecraft/server/WorldMap.java
+++ b/src/main/java/net/minecraft/server/WorldMap.java
@@ -37,6 +37,7 @@ public class WorldMap extends PersistentBase {
diff --git a/src/main/java/net/minecraft/world/level/saveddata/maps/WorldMap.java b/src/main/java/net/minecraft/world/level/saveddata/maps/WorldMap.java
index 3f057f0bd23bc1c693c8f04ee8acd6626c620008..d470af1814af332595c1c0beb1cdc552e186a6bb 100644
--- a/src/main/java/net/minecraft/world/level/saveddata/maps/WorldMap.java
+++ b/src/main/java/net/minecraft/world/level/saveddata/maps/WorldMap.java
@@ -57,6 +57,7 @@ public class WorldMap extends PersistentBase {
private final Map<String, MapIconBanner> m = Maps.newHashMap();
public final Map<String, MapIcon> decorations = Maps.newLinkedHashMap();
private final Map<String, WorldMapFrame> n = Maps.newHashMap();
@ -41,7 +53,7 @@ index d11725d61b888ceb08c4ea30f23d563170ce944d..7251793423e5413dacc1e031ed75d41f
// CraftBukkit start
public final CraftMapView mapView;
@@ -49,6 +50,7 @@ public class WorldMap extends PersistentBase {
@@ -69,6 +70,7 @@ public class WorldMap extends PersistentBase {
// CraftBukkit start
mapView = new CraftMapView(this);
server = (CraftServer) org.bukkit.Bukkit.getServer();
@ -49,7 +61,7 @@ index d11725d61b888ceb08c4ea30f23d563170ce944d..7251793423e5413dacc1e031ed75d41f
// CraftBukkit end
}
@@ -116,6 +118,7 @@ public class WorldMap extends PersistentBase {
@@ -136,6 +138,7 @@ public class WorldMap extends PersistentBase {
this.m.put(mapiconbanner.f(), mapiconbanner);
this.a(mapiconbanner.c(), (GeneratorAccess) null, mapiconbanner.f(), (double) mapiconbanner.a().getX(), (double) mapiconbanner.a().getZ(), 180.0D, mapiconbanner.d());
}
@ -57,7 +69,7 @@ index d11725d61b888ceb08c4ea30f23d563170ce944d..7251793423e5413dacc1e031ed75d41f
NBTTagList nbttaglist1 = nbttagcompound.getList("frames", 10);
@@ -196,6 +199,7 @@ public class WorldMap extends PersistentBase {
@@ -216,6 +219,7 @@ public class WorldMap extends PersistentBase {
this.b();
}
@ -65,7 +77,7 @@ index d11725d61b888ceb08c4ea30f23d563170ce944d..7251793423e5413dacc1e031ed75d41f
public void a(EntityHuman entityhuman, ItemStack itemstack) {
if (!this.humans.containsKey(entityhuman)) {
WorldMap.WorldMapHumanTracker worldmap_worldmaphumantracker = new WorldMap.WorldMapHumanTracker(entityhuman);
@@ -431,6 +435,21 @@ public class WorldMap extends PersistentBase {
@@ -451,6 +455,21 @@ public class WorldMap extends PersistentBase {
public class WorldMapHumanTracker {
@ -87,7 +99,7 @@ index d11725d61b888ceb08c4ea30f23d563170ce944d..7251793423e5413dacc1e031ed75d41f
public final EntityHuman trackee;
private boolean d = true;
private int e;
@@ -447,9 +466,12 @@ public class WorldMap extends PersistentBase {
@@ -467,9 +486,12 @@ public class WorldMap extends PersistentBase {
@Nullable
public Packet<?> a(ItemStack itemstack) {
// CraftBukkit start
@ -101,18 +113,6 @@ index d11725d61b888ceb08c4ea30f23d563170ce944d..7251793423e5413dacc1e031ed75d41f
for ( org.bukkit.map.MapCursor cursor : render.cursors) {
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 486ba1efc934c6851d2b570493af6e1079a7abd5..03b81f40e1ad394d7d287825dabe2ad4b905ac60 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1059,6 +1059,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
{
if ( iter.next().trackee == entity )
{
+ map.decorations.remove(entity.getDisplayName().getString()); // Paper
iter.remove();
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/map/RenderData.java b/src/main/java/org/bukkit/craftbukkit/map/RenderData.java
index 256a131781721c86dd6cdbc329335964570cbe8c..5768cd512ec166f1e8d1f4a28792015347297c3f 100644
--- a/src/main/java/org/bukkit/craftbukkit/map/RenderData.java

View File

@ -43,15 +43,15 @@ index 5baccb8d50c135ab20c38ffd0690f585514ce5af..eb04fdb172a50ec1f5b7fe78fa0e7655
}
diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperLootableBlockInventory.java b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableBlockInventory.java
new file mode 100644
index 0000000000000000000000000000000000000000..d6fce3112ebd8ef208c6fe45e0d887ec778fc092
index 0000000000000000000000000000000000000000..5dfc3c8008d64ad4ed71b4904c897f5005491349
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableBlockInventory.java
@@ -0,0 +1,33 @@
+package com.destroystokyo.paper.loottable;
+
+import net.minecraft.server.BlockPosition;
+import net.minecraft.server.TileEntityLootable;
+import net.minecraft.server.World;
+import net.minecraft.core.BlockPosition;
+import net.minecraft.world.level.World;
+import net.minecraft.world.level.block.entity.TileEntityLootable;
+import org.bukkit.Chunk;
+import org.bukkit.block.Block;
+
@ -82,18 +82,18 @@ index 0000000000000000000000000000000000000000..d6fce3112ebd8ef208c6fe45e0d887ec
+}
diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperLootableEntityInventory.java b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableEntityInventory.java
new file mode 100644
index 0000000000000000000000000000000000000000..5e637782d555cd68952e8bdbd47a63a636348ec6
index 0000000000000000000000000000000000000000..019a06fa2b43cacd3bbd4d58aba71b3728f37581
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableEntityInventory.java
@@ -0,0 +1,28 @@
+package com.destroystokyo.paper.loottable;
+
+import net.minecraft.server.World;
+import net.minecraft.world.level.World;
+import org.bukkit.entity.Entity;
+
+public interface PaperLootableEntityInventory extends LootableEntityInventory, PaperLootableInventory {
+
+ net.minecraft.server.Entity getHandle();
+ net.minecraft.world.entity.Entity getHandle();
+
+ @Override
+ default LootableInventory getAPILootableInventory() {
@ -116,13 +116,13 @@ index 0000000000000000000000000000000000000000..5e637782d555cd68952e8bdbd47a63a6
+}
diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventory.java b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventory.java
new file mode 100644
index 0000000000000000000000000000000000000000..856843fc917ff6a7252b7900f7772cc9debe3649
index 0000000000000000000000000000000000000000..59e8aea749bbba079e3304d9a5854280db2692e9
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventory.java
@@ -0,0 +1,71 @@
+package com.destroystokyo.paper.loottable;
+
+import net.minecraft.server.World;
+import net.minecraft.world.level.World;
+import org.bukkit.loot.Lootable;
+
+import java.util.UUID;
@ -193,14 +193,16 @@ index 0000000000000000000000000000000000000000..856843fc917ff6a7252b7900f7772cc9
+}
diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java
new file mode 100644
index 0000000000000000000000000000000000000000..b5401eaf974857455c17c3f9cfdedf2eb4bde321
index 0000000000000000000000000000000000000000..904332454ede006f4ee33337d46b11674d78bef7
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java
@@ -0,0 +1,179 @@
@@ -0,0 +1,181 @@
+package com.destroystokyo.paper.loottable;
+
+import com.destroystokyo.paper.PaperWorldConfig;
+import net.minecraft.server.*;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.nbt.NBTTagList;
+import net.minecraft.world.entity.player.EntityHuman;
+import org.bukkit.entity.Player;
+import org.bukkit.loot.LootTable;
+
@ -378,16 +380,15 @@ index 0000000000000000000000000000000000000000..b5401eaf974857455c17c3f9cfdedf2e
+}
diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperMinecartLootableInventory.java b/src/main/java/com/destroystokyo/paper/loottable/PaperMinecartLootableInventory.java
new file mode 100644
index 0000000000000000000000000000000000000000..8c1fa60a55570be91ab5ea63cb2005caa09e3600
index 0000000000000000000000000000000000000000..c682bd7700d8103533026d46cfc63a7abde5a5f4
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/loottable/PaperMinecartLootableInventory.java
@@ -0,0 +1,63 @@
@@ -0,0 +1,62 @@
+package com.destroystokyo.paper.loottable;
+
+import net.minecraft.server.Entity;
+import net.minecraft.server.EntityMinecartContainer;
+import net.minecraft.server.MinecraftKey;
+import net.minecraft.server.World;
+import net.minecraft.world.entity.Entity;
+import net.minecraft.world.entity.vehicle.EntityMinecartContainer;
+import net.minecraft.world.level.World;
+import org.bukkit.Bukkit;
+import org.bukkit.craftbukkit.util.CraftNamespacedKey;
+
@ -447,16 +448,15 @@ index 0000000000000000000000000000000000000000..8c1fa60a55570be91ab5ea63cb2005ca
+}
diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperTileEntityLootableInventory.java b/src/main/java/com/destroystokyo/paper/loottable/PaperTileEntityLootableInventory.java
new file mode 100644
index 0000000000000000000000000000000000000000..a1923aff2b5e2e867670a5a064a767915fc1cc2a
index 0000000000000000000000000000000000000000..9dae34370d014a291f025f83b55e18bff4619a23
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/loottable/PaperTileEntityLootableInventory.java
@@ -0,0 +1,66 @@
@@ -0,0 +1,65 @@
+package com.destroystokyo.paper.loottable;
+
+import net.minecraft.server.MCUtil;
+import net.minecraft.server.MinecraftKey;
+import net.minecraft.server.TileEntityLootable;
+import net.minecraft.server.World;
+import net.minecraft.world.level.World;
+import net.minecraft.world.level.block.entity.TileEntityLootable;
+import org.bukkit.Bukkit;
+import org.bukkit.craftbukkit.util.CraftNamespacedKey;
+
@ -517,11 +517,11 @@ index 0000000000000000000000000000000000000000..a1923aff2b5e2e867670a5a064a76791
+ return tileEntityLootable.getWorld();
+ }
+}
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 487d041999fd1edc4b48790dbc975cf8cea8ba54..0dd63d2e0ed16eb08cf97dbf8c293e24a5a1bda9 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -73,6 +73,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 6cbb797cb0de4b26d8ddd7f0bf567f49bd36f9c0..2b1b46bda48c0b137fe914c47a387e6e72a1be40 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -158,6 +158,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
};
// Paper end
@ -529,11 +529,11 @@ index 487d041999fd1edc4b48790dbc975cf8cea8ba54..0dd63d2e0ed16eb08cf97dbf8c293e24
private CraftEntity bukkitEntity;
public CraftEntity getBukkitEntity() {
diff --git a/src/main/java/net/minecraft/server/EntityMinecartContainer.java b/src/main/java/net/minecraft/server/EntityMinecartContainer.java
index 3258bf53761dbed2bfe9fd92e011161b914796d0..8e13aebb7043ddfb4b1c02bac46081eb15e906bf 100644
--- a/src/main/java/net/minecraft/server/EntityMinecartContainer.java
+++ b/src/main/java/net/minecraft/server/EntityMinecartContainer.java
@@ -20,6 +20,7 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/EntityMinecartContainer.java b/src/main/java/net/minecraft/world/entity/vehicle/EntityMinecartContainer.java
index c4b970c37b1792ac0022936f2df4740183621a0d..0166d11cb540a536390f486e1069d6119d8d23d6 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/EntityMinecartContainer.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/EntityMinecartContainer.java
@@ -46,6 +46,7 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp
public long lootTableSeed;
// CraftBukkit start
@ -541,7 +541,7 @@ index 3258bf53761dbed2bfe9fd92e011161b914796d0..8e13aebb7043ddfb4b1c02bac46081eb
public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();
private int maxStack = MAX_STACK;
@@ -177,12 +178,13 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp
@@ -203,12 +204,13 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp
@Override
protected void saveData(NBTTagCompound nbttagcompound) {
super.saveData(nbttagcompound);
@ -556,7 +556,7 @@ index 3258bf53761dbed2bfe9fd92e011161b914796d0..8e13aebb7043ddfb4b1c02bac46081eb
ContainerUtil.a(nbttagcompound, this.items);
}
@@ -191,11 +193,12 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp
@@ -217,11 +219,12 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp
@Override
protected void loadData(NBTTagCompound nbttagcompound) {
super.loadData(nbttagcompound);
@ -570,7 +570,7 @@ index 3258bf53761dbed2bfe9fd92e011161b914796d0..8e13aebb7043ddfb4b1c02bac46081eb
ContainerUtil.b(nbttagcompound, this.items);
}
@@ -226,14 +229,15 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp
@@ -252,14 +255,15 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp
}
public void d(@Nullable EntityHuman entityhuman) {
@ -588,11 +588,11 @@ index 3258bf53761dbed2bfe9fd92e011161b914796d0..8e13aebb7043ddfb4b1c02bac46081eb
LootTableInfo.Builder loottableinfo_builder = (new LootTableInfo.Builder((WorldServer) this.world)).set(LootContextParameters.ORIGIN, this.getPositionVector()).a(this.lootTableSeed);
if (entityhuman != null) {
diff --git a/src/main/java/net/minecraft/server/TileEntityLootable.java b/src/main/java/net/minecraft/server/TileEntityLootable.java
index 9265bc7331f5d3cb43394a7457ab89140b731c8b..d9be182a574daaedcc7a106c759c2bde2e4eb19a 100644
--- a/src/main/java/net/minecraft/server/TileEntityLootable.java
+++ b/src/main/java/net/minecraft/server/TileEntityLootable.java
@@ -8,6 +8,7 @@ public abstract class TileEntityLootable extends TileEntityContainer {
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntityLootable.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntityLootable.java
index 62e6833a90d7adae3c7df33e3bc73b4288e0370b..1508e267a38555820e2d31f3075adca185fbd4b6 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityLootable.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityLootable.java
@@ -27,6 +27,7 @@ public abstract class TileEntityLootable extends TileEntityContainer {
@Nullable
public MinecraftKey lootTable;
public long lootTableSeed;
@ -600,7 +600,7 @@ index 9265bc7331f5d3cb43394a7457ab89140b731c8b..d9be182a574daaedcc7a106c759c2bde
protected TileEntityLootable(TileEntityTypes<?> tileentitytypes) {
super(tileentitytypes);
@@ -23,16 +24,19 @@ public abstract class TileEntityLootable extends TileEntityContainer {
@@ -42,16 +43,19 @@ public abstract class TileEntityLootable extends TileEntityContainer {
}
protected boolean b(NBTTagCompound nbttagcompound) {
@ -621,7 +621,7 @@ index 9265bc7331f5d3cb43394a7457ab89140b731c8b..d9be182a574daaedcc7a106c759c2bde
if (this.lootTable == null) {
return false;
} else {
@@ -41,19 +45,20 @@ public abstract class TileEntityLootable extends TileEntityContainer {
@@ -60,19 +64,20 @@ public abstract class TileEntityLootable extends TileEntityContainer {
nbttagcompound.setLong("LootTableSeed", this.lootTableSeed);
}
@ -646,7 +646,7 @@ index 9265bc7331f5d3cb43394a7457ab89140b731c8b..d9be182a574daaedcc7a106c759c2bde
if (entityhuman != null) {
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
index df71eb9672ecc69ac92c773925d9b692ad343fee..8a7e9302b4b6be086144add8df610b76b58e00d6 100644
index 524f27830752f424493c3ae8d793b871f6495594..dcf3f9265b0b00a7bbb9ff428e10da3c198ba08a 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
@@ -64,7 +64,7 @@ public class CraftBlockEntityState<T extends TileEntity> extends CraftBlockState
@ -659,7 +659,7 @@ index df71eb9672ecc69ac92c773925d9b692ad343fee..8a7e9302b4b6be086144add8df610b76
}
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java b/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java
index 89df1d7f8b1221014affec459244223491fafaa2..c0fed05d3b68258a61980bdb84fe16dd6adba4c5 100644
index 486fa8937d644f59a770db163482259525a7e465..54eb170fd533b0e91572601268fcbc167ed9bb5c 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java
@@ -12,8 +12,9 @@ import org.bukkit.craftbukkit.CraftWorld;
@ -674,26 +674,19 @@ index 89df1d7f8b1221014affec459244223491fafaa2..c0fed05d3b68258a61980bdb84fe16dd
public CraftChest(final Block block) {
super(block, TileEntityChest.class);
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java b/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java
index e1ad26a242b9bff8f5a567c24cf58b2150c24144..678aa09d477f653461276e5eab277e1abc253dd8 100644
index f0a7e61a26c4668a9aa823d641f29bdecd42dd1f..3512054ede5fd1dd7605444e827e30a0be47f935 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java
@@ -1,5 +1,6 @@
package org.bukkit.craftbukkit.block;
+import com.destroystokyo.paper.loottable.PaperLootableBlockInventory;
import net.minecraft.server.MinecraftKey;
import net.minecraft.server.TileEntityLootable;
import org.bukkit.Bukkit;
@@ -10,7 +11,7 @@ import org.bukkit.craftbukkit.util.CraftNamespacedKey;
@@ -10,7 +10,7 @@ import org.bukkit.craftbukkit.util.CraftNamespacedKey;
import org.bukkit.loot.LootTable;
import org.bukkit.loot.Lootable;
-public abstract class CraftLootable<T extends TileEntityLootable> extends CraftContainer<T> implements Nameable, Lootable {
+public abstract class CraftLootable<T extends TileEntityLootable> extends CraftContainer<T> implements Nameable, Lootable, PaperLootableBlockInventory { // Paper
+public abstract class CraftLootable<T extends TileEntityLootable> extends CraftContainer<T> implements Nameable, Lootable, com.destroystokyo.paper.loottable.PaperLootableBlockInventory { // Paper
public CraftLootable(Block block, Class<T> tileEntityClass) {
super(block, tileEntityClass);
@@ -54,7 +55,7 @@ public abstract class CraftLootable<T extends TileEntityLootable> extends CraftC
@@ -54,7 +54,7 @@ public abstract class CraftLootable<T extends TileEntityLootable> extends CraftC
setLootTable(getLootTable(), seed);
}
@ -703,27 +696,20 @@ index e1ad26a242b9bff8f5a567c24cf58b2150c24144..678aa09d477f653461276e5eab277e1a
getSnapshot().setLootTable(key, seed);
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartChest.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartChest.java
index e05624e6432f55c3efff3f9d765975557d1be16f..ab4807b2cd3cdcd61d8ac4ae2825df69dd2b7c64 100644
index cbd121c21adfaf098dadca33de16a2e68d83c19a..d9a2552782c9242fb84cc0c8309a614a44777509 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartChest.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartChest.java
@@ -1,5 +1,6 @@
package org.bukkit.craftbukkit.entity;
+import com.destroystokyo.paper.loottable.PaperLootableEntityInventory; // Paper
import net.minecraft.server.EntityMinecartChest;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.craftbukkit.inventory.CraftInventory;
@@ -8,7 +9,7 @@ import org.bukkit.entity.minecart.StorageMinecart;
@@ -8,7 +8,7 @@ import org.bukkit.entity.minecart.StorageMinecart;
import org.bukkit.inventory.Inventory;
@SuppressWarnings("deprecation")
-public class CraftMinecartChest extends CraftMinecartContainer implements StorageMinecart {
+public class CraftMinecartChest extends CraftMinecartContainer implements StorageMinecart, PaperLootableEntityInventory { // Paper
+public class CraftMinecartChest extends CraftMinecartContainer implements StorageMinecart, com.destroystokyo.paper.loottable.PaperLootableEntityInventory { // Paper
private final CraftInventory inventory;
public CraftMinecartChest(CraftServer server, EntityMinecartChest entity) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java
index 2d776b520bd9b0b8f7475f10e59b02b2ad7b9d8b..fcc9787848c0a0a4025bdf698debf9592c818bff 100644
index 5ffb8108f456c2f7f3ed1a25249baccb4cbf4add..bf8b5b25d1af0c5129261e10abf2866521b2c375 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java
@@ -47,7 +47,7 @@ public abstract class CraftMinecartContainer extends CraftMinecart implements Lo
@ -736,22 +722,15 @@ index 2d776b520bd9b0b8f7475f10e59b02b2ad7b9d8b..fcc9787848c0a0a4025bdf698debf959
getHandle().setLootTable(newKey, seed);
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartHopper.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartHopper.java
index 334bd5bb3ffc8b2bcdfca3995cdbe543cee8f311..f5b31237fc6e62345edcc3d6b02ff9e94237ae31 100644
index 17a42aec76f32a28b0c9885c60d1ed50c6727161..bfdcf01d2c6570493e86330d56500427dbb23146 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartHopper.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartHopper.java
@@ -1,5 +1,6 @@
package org.bukkit.craftbukkit.entity;
+import com.destroystokyo.paper.loottable.PaperLootableEntityInventory; // Paper
import net.minecraft.server.EntityMinecartHopper;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.craftbukkit.inventory.CraftInventory;
@@ -7,7 +8,7 @@ import org.bukkit.entity.EntityType;
@@ -7,7 +7,7 @@ import org.bukkit.entity.EntityType;
import org.bukkit.entity.minecart.HopperMinecart;
import org.bukkit.inventory.Inventory;
-public final class CraftMinecartHopper extends CraftMinecartContainer implements HopperMinecart {
+public final class CraftMinecartHopper extends CraftMinecartContainer implements HopperMinecart, PaperLootableEntityInventory { // Paper
+public final class CraftMinecartHopper extends CraftMinecartContainer implements HopperMinecart, com.destroystokyo.paper.loottable.PaperLootableEntityInventory { // Paper
private final CraftInventory inventory;
public CraftMinecartHopper(CraftServer server, EntityMinecartHopper entity) {

View File

@ -18,11 +18,11 @@ index 504efea7b6f50a0d17f4f353781953dfb18bdeca..1b8e5671c9dc8c15ce33d351c1bb20f2
+ saveEmptyScoreboardTeams = getBoolean("settings.save-empty-scoreboard-teams", false);
+ }
}
diff --git a/src/main/java/net/minecraft/server/PersistentScoreboard.java b/src/main/java/net/minecraft/server/PersistentScoreboard.java
index 17bb9512e65f1a158efdc39813b04159000d9b33..a08c54da92d87fcd24ef8e2556901d3b1977c5ea 100644
--- a/src/main/java/net/minecraft/server/PersistentScoreboard.java
+++ b/src/main/java/net/minecraft/server/PersistentScoreboard.java
@@ -174,6 +174,7 @@ public class PersistentScoreboard extends PersistentBase {
diff --git a/src/main/java/net/minecraft/world/scores/PersistentScoreboard.java b/src/main/java/net/minecraft/world/scores/PersistentScoreboard.java
index 3998565ccd87c966c0fb9e6757cd1861faa5bc15..52f27bdbd0df8bbbf2ad5144bc262b5093d83413 100644
--- a/src/main/java/net/minecraft/world/scores/PersistentScoreboard.java
+++ b/src/main/java/net/minecraft/world/scores/PersistentScoreboard.java
@@ -182,6 +182,7 @@ public class PersistentScoreboard extends PersistentBase {
while (iterator.hasNext()) {
ScoreboardTeam scoreboardteam = (ScoreboardTeam) iterator.next();

View File

@ -9,24 +9,11 @@ easier to do this than replace the entire thing.
Additionally, move Saving of the User cache to be done async, incase
the user never changed the default setting for Spigot's save on stop only.
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
index 7b52bf335e60a700b4c4e25cab1b0261f32775bc..dc0cb79525adf0d5afee1f677e1fde546529cf97 100644
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
@@ -212,7 +212,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
}
if (this.convertNames()) {
- this.getUserCache().b();
+ this.getUserCache().b(false); // Paper
}
if (!NameReferencingFileConverter.e(this)) {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 5c84033df42b2cba1719010e75aeeb00c817eb61..110184bd18f689cff1f37ceefe97416b5dcfd405 100644
index 3b2fcb4338d56a8e1dd2de799571db4e2a79ec9f..c6ab645397911d984a28e40583bdb8f782a4f934 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -789,7 +789,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
@@ -896,7 +896,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
} catch (java.lang.InterruptedException ignored) {} // Paper
if (org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) {
LOGGER.info("Saving usercache.json");
@ -35,11 +22,24 @@ index 5c84033df42b2cba1719010e75aeeb00c817eb61..110184bd18f689cff1f37ceefe97416b
}
// Spigot end
diff --git a/src/main/java/net/minecraft/server/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java
index 337ae3f8d57c665db796f4498aeffb2e4581da76..f61cf940f21288fc6e8faf9519d2366436146d1f 100644
--- a/src/main/java/net/minecraft/server/UserCache.java
+++ b/src/main/java/net/minecraft/server/UserCache.java
@@ -106,7 +106,7 @@ public class UserCache {
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index faf4d00bf288359db806913c4d2964324e8706b7..8ae72e8c8325d9b03803f29fcdd83a0ce8d34450 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -251,7 +251,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
}
if (this.convertNames()) {
- this.getUserCache().b();
+ this.getUserCache().b(false); // Paper
}
if (!NameReferencingFileConverter.e(this)) {
diff --git a/src/main/java/net/minecraft/server/players/UserCache.java b/src/main/java/net/minecraft/server/players/UserCache.java
index 581e036f598b51a4e9f2dafd7e92c700c3e04407..9bb949ff4cbfc87ce179653939454a1e44dcdd77 100644
--- a/src/main/java/net/minecraft/server/players/UserCache.java
+++ b/src/main/java/net/minecraft/server/players/UserCache.java
@@ -107,7 +107,7 @@ public class UserCache {
return UserCache.b;
}
@ -48,7 +48,7 @@ index 337ae3f8d57c665db796f4498aeffb2e4581da76..f61cf940f21288fc6e8faf9519d23664
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
@@ -115,7 +115,7 @@ public class UserCache {
@@ -116,7 +116,7 @@ public class UserCache {
UserCache.UserCacheEntry usercache_usercacheentry = new UserCache.UserCacheEntry(gameprofile, date);
this.a(usercache_usercacheentry);
@ -57,7 +57,7 @@ index 337ae3f8d57c665db796f4498aeffb2e4581da76..f61cf940f21288fc6e8faf9519d23664
}
private long d() {
@@ -123,7 +123,7 @@ public class UserCache {
@@ -124,7 +124,7 @@ public class UserCache {
}
@Nullable
@ -66,7 +66,7 @@ index 337ae3f8d57c665db796f4498aeffb2e4581da76..f61cf940f21288fc6e8faf9519d23664
String s1 = s.toLowerCase(Locale.ROOT);
UserCache.UserCacheEntry usercache_usercacheentry = (UserCache.UserCacheEntry) this.c.get(s1);
boolean flag = false;
@@ -149,7 +149,7 @@ public class UserCache {
@@ -150,7 +150,7 @@ public class UserCache {
}
if (flag && !org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) { // Spigot - skip saving if disabled
@ -75,7 +75,7 @@ index 337ae3f8d57c665db796f4498aeffb2e4581da76..f61cf940f21288fc6e8faf9519d23664
}
return gameprofile;
@@ -231,7 +231,7 @@ public class UserCache {
@@ -232,7 +232,7 @@ public class UserCache {
return arraylist;
}
@ -84,7 +84,7 @@ index 337ae3f8d57c665db796f4498aeffb2e4581da76..f61cf940f21288fc6e8faf9519d23664
JsonArray jsonarray = new JsonArray();
DateFormat dateformat = e();
@@ -239,6 +239,7 @@ public class UserCache {
@@ -240,6 +240,7 @@ public class UserCache {
jsonarray.add(a(usercache_usercacheentry, dateformat));
});
String s = this.f.toJson(jsonarray);
@ -92,7 +92,7 @@ index 337ae3f8d57c665db796f4498aeffb2e4581da76..f61cf940f21288fc6e8faf9519d23664
try {
BufferedWriter bufferedwriter = Files.newWriter(this.g, StandardCharsets.UTF_8);
@@ -266,6 +267,14 @@ public class UserCache {
@@ -267,6 +268,14 @@ public class UserCache {
} catch (IOException ioexception) {
;
}

View File

@ -5,11 +5,11 @@ Subject: [PATCH] Avoid blocking on Network Manager creation
Per Paper issue 294
diff --git a/src/main/java/net/minecraft/server/ServerConnection.java b/src/main/java/net/minecraft/server/ServerConnection.java
index 399420916da4c924cd28c0c4a45b4eca3972acb6..8fcd8f4056620713d0c02fdd9b829053ba95e851 100644
--- a/src/main/java/net/minecraft/server/ServerConnection.java
+++ b/src/main/java/net/minecraft/server/ServerConnection.java
@@ -39,6 +39,15 @@ public class ServerConnection {
diff --git a/src/main/java/net/minecraft/server/network/ServerConnection.java b/src/main/java/net/minecraft/server/network/ServerConnection.java
index f66a5ba901601c1d359a287861a2edd8e3a106a7..d992cb5cd827e0fe655809e1088939cdad9c2301 100644
--- a/src/main/java/net/minecraft/server/network/ServerConnection.java
+++ b/src/main/java/net/minecraft/server/network/ServerConnection.java
@@ -52,6 +52,15 @@ public class ServerConnection {
public volatile boolean c;
private final List<ChannelFuture> listeningChannels = Collections.synchronizedList(Lists.newArrayList());
private final List<NetworkManager> connectedChannels = Collections.synchronizedList(Lists.newArrayList());
@ -25,7 +25,7 @@ index 399420916da4c924cd28c0c4a45b4eca3972acb6..8fcd8f4056620713d0c02fdd9b829053
public ServerConnection(MinecraftServer minecraftserver) {
this.e = minecraftserver;
@@ -74,7 +83,8 @@ public class ServerConnection {
@@ -87,7 +96,8 @@ public class ServerConnection {
int j = ServerConnection.this.e.k();
Object object = j > 0 ? new NetworkManagerServer(j) : new NetworkManager(EnumProtocolDirection.SERVERBOUND);
@ -35,7 +35,7 @@ index 399420916da4c924cd28c0c4a45b4eca3972acb6..8fcd8f4056620713d0c02fdd9b829053
channel.pipeline().addLast("packet_handler", (ChannelHandler) object);
((NetworkManager) object).setPacketListener(new HandshakeListener(ServerConnection.this.e, (NetworkManager) object));
}
@@ -113,6 +123,7 @@ public class ServerConnection {
@@ -126,6 +136,7 @@ public class ServerConnection {
synchronized (this.connectedChannels) {
// Spigot Start

View File

@ -31,11 +31,24 @@ index eb04fdb172a50ec1f5b7fe78fa0e7655246abd60..6eca3f300020006f02dd36253b522db4
+ log("Prevent TNT from moving in water: " + preventTntFromMovingInWater);
+ }
}
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 0dd63d2e0ed16eb08cf97dbf8c293e24a5a1bda9..6aa29495802b7d52c4c0f283495c7d1762f657fa 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -2681,6 +2681,11 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
diff --git a/src/main/java/net/minecraft/server/level/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/level/EntityTrackerEntry.java
index f5227aa761d326376d057eaadcdbef024ed30241..44b79c97d5cc7570683e1b7f025b4f3ad65beb81 100644
--- a/src/main/java/net/minecraft/server/level/EntityTrackerEntry.java
+++ b/src/main/java/net/minecraft/server/level/EntityTrackerEntry.java
@@ -67,7 +67,7 @@ public class EntityTrackerEntry {
private boolean q;
private boolean r;
// CraftBukkit start
- private final Set<EntityPlayer> trackedPlayers;
+ final Set<EntityPlayer> trackedPlayers; // Paper - private -> package
// Paper start
private java.util.Map<EntityPlayer, Boolean> trackedPlayerMap = null;
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 2b1b46bda48c0b137fe914c47a387e6e72a1be40..ee160558d84b24e1309262874a9d433bbe6593f3 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2766,6 +2766,11 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
}
public boolean bV() {
@ -47,11 +60,11 @@ index 0dd63d2e0ed16eb08cf97dbf8c293e24a5a1bda9..6aa29495802b7d52c4c0f283495c7d17
return true;
}
diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
index f71e82c365947de822be7b87083b46bd7ce4b902..6e77dc89f5441f0f483571fee9aa9f34b6d1dd1c 100644
--- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java
+++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
@@ -81,7 +81,27 @@ public class EntityTNTPrimed extends Entity {
diff --git a/src/main/java/net/minecraft/world/entity/item/EntityTNTPrimed.java b/src/main/java/net/minecraft/world/entity/item/EntityTNTPrimed.java
index 535e7d7297d81026b8586d5049b72fa65519b464..ca954912c798a7f4f7c9903a53156075ab688e46 100644
--- a/src/main/java/net/minecraft/world/entity/item/EntityTNTPrimed.java
+++ b/src/main/java/net/minecraft/world/entity/item/EntityTNTPrimed.java
@@ -96,7 +96,27 @@ public class EntityTNTPrimed extends Entity {
this.world.addParticle(Particles.SMOKE, this.locX(), this.locY() + 0.5D, this.locZ(), 0.0D, 0.0D, 0.0D);
}
}
@ -80,7 +93,7 @@ index f71e82c365947de822be7b87083b46bd7ce4b902..6e77dc89f5441f0f483571fee9aa9f34
}
private void explode() {
@@ -150,4 +170,11 @@ public class EntityTNTPrimed extends Entity {
@@ -165,4 +185,11 @@ public class EntityTNTPrimed extends Entity {
public Packet<?> P() {
return new PacketPlayOutSpawnEntity(this);
}
@ -92,16 +105,3 @@ index f71e82c365947de822be7b87083b46bd7ce4b902..6e77dc89f5441f0f483571fee9aa9f34
+ }
+ // Paper end
}
diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
index dec48226d713ef0198ef3c679daf553a9d05a099..c346ca8ba30da401ea1a421e8ce6ed1d5b6e4c13 100644
--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java
+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
@@ -38,7 +38,7 @@ public class EntityTrackerEntry {
private boolean q;
private boolean r;
// CraftBukkit start
- private final Set<EntityPlayer> trackedPlayers;
+ final Set<EntityPlayer> trackedPlayers; // Paper - private -> package
// Paper start
private java.util.Map<EntityPlayer, Boolean> trackedPlayerMap = null;

View File

@ -5,11 +5,23 @@ Subject: [PATCH] Faster redstone torch rapid clock removal
Only resize the the redstone torch list once, since resizing arrays / lists is costly
diff --git a/src/main/java/net/minecraft/server/BlockRedstoneTorch.java b/src/main/java/net/minecraft/server/BlockRedstoneTorch.java
index d88d435b7777f731bc0bb728ebe4d4cb31c6376e..a63a60348fe45f63deec6fcb27b6be09cd2f088c 100644
--- a/src/main/java/net/minecraft/server/BlockRedstoneTorch.java
+++ b/src/main/java/net/minecraft/server/BlockRedstoneTorch.java
@@ -11,7 +11,7 @@ import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java
index 2bb85896df999675d33f70a90f1c68865099ee83..b954b2f3c6e2d6725f9a134699f0d218f8ce1d05 100644
--- a/src/main/java/net/minecraft/world/level/World.java
+++ b/src/main/java/net/minecraft/world/level/World.java
@@ -142,6 +142,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
private org.spigotmc.TickLimiter tileLimiter;
private int tileTickPosition;
public final Map<Explosion.CacheKey, Float> explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions
+ public java.util.ArrayDeque<BlockRedstoneTorch.RedstoneUpdateInfo> redstoneUpdateInfos; // Paper - Move from Map in BlockRedstoneTorch to here
public CraftWorld getWorld() {
return this.world;
diff --git a/src/main/java/net/minecraft/world/level/block/BlockRedstoneTorch.java b/src/main/java/net/minecraft/world/level/block/BlockRedstoneTorch.java
index 8142c0be2978d8975612488b17da9c2e25f3b5dd..6771c16b4228c1495950484422b73928f6184929 100644
--- a/src/main/java/net/minecraft/world/level/block/BlockRedstoneTorch.java
+++ b/src/main/java/net/minecraft/world/level/block/BlockRedstoneTorch.java
@@ -22,7 +22,7 @@ import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
public class BlockRedstoneTorch extends BlockTorch {
public static final BlockStateBoolean LIT = BlockProperties.r;
@ -18,7 +30,7 @@ index d88d435b7777f731bc0bb728ebe4d4cb31c6376e..a63a60348fe45f63deec6fcb27b6be09
protected BlockRedstoneTorch(BlockBase.Info blockbase_info) {
super(blockbase_info, ParticleParamRedstone.a);
@@ -58,11 +58,15 @@ public class BlockRedstoneTorch extends BlockTorch {
@@ -69,11 +69,15 @@ public class BlockRedstoneTorch extends BlockTorch {
@Override
public void tickAlways(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
boolean flag = this.a((World) worldserver, blockposition, iblockdata);
@ -38,7 +50,7 @@ index d88d435b7777f731bc0bb728ebe4d4cb31c6376e..a63a60348fe45f63deec6fcb27b6be09
// CraftBukkit start
org.bukkit.plugin.PluginManager manager = worldserver.getServer().getPluginManager();
@@ -127,9 +131,12 @@ public class BlockRedstoneTorch extends BlockTorch {
@@ -138,9 +142,12 @@ public class BlockRedstoneTorch extends BlockTorch {
}
private static boolean a(World world, BlockPosition blockposition, boolean flag) {
@ -54,7 +66,7 @@ index d88d435b7777f731bc0bb728ebe4d4cb31c6376e..a63a60348fe45f63deec6fcb27b6be09
if (flag) {
list.add(new BlockRedstoneTorch.RedstoneUpdateInfo(blockposition.immutableCopy(), world.getTime()));
@@ -137,9 +144,9 @@ public class BlockRedstoneTorch extends BlockTorch {
@@ -148,9 +155,9 @@ public class BlockRedstoneTorch extends BlockTorch {
int i = 0;
@ -67,7 +79,7 @@ index d88d435b7777f731bc0bb728ebe4d4cb31c6376e..a63a60348fe45f63deec6fcb27b6be09
if (blockredstonetorch_redstoneupdateinfo.a.equals(blockposition)) {
++i;
if (i >= 8) {
@@ -154,7 +161,7 @@ public class BlockRedstoneTorch extends BlockTorch {
@@ -165,7 +172,7 @@ public class BlockRedstoneTorch extends BlockTorch {
public static class RedstoneUpdateInfo {
private final BlockPosition a;
@ -76,15 +88,3 @@ index d88d435b7777f731bc0bb728ebe4d4cb31c6376e..a63a60348fe45f63deec6fcb27b6be09
public RedstoneUpdateInfo(BlockPosition blockposition, long i) {
this.a = blockposition;
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 05bd9dd542ddb2508cb0c7138833371b52f1164e..dbc7cbba7134ff0281c6e77cd246073bba8b9ce2 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -90,6 +90,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
private org.spigotmc.TickLimiter tileLimiter;
private int tileTickPosition;
public final Map<Explosion.CacheKey, Float> explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions
+ public java.util.ArrayDeque<BlockRedstoneTorch.RedstoneUpdateInfo> redstoneUpdateInfos; // Paper - Move from Map in BlockRedstoneTorch to here
public CraftWorld getWorld() {
return this.world;

View File

@ -5,27 +5,27 @@ Subject: [PATCH] Only send Dragon/Wither Death sounds to same world
Also fix view distance lookup
diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java
index 48f3695861ad7f9c480d3bdf68c6820c2ca0a00a..81c926e506c1b6e5c0d909b71f1db81beb645699 100644
--- a/src/main/java/net/minecraft/server/EntityEnderDragon.java
+++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java
@@ -570,8 +570,9 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster {
diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java
index 6c58cf9d39cc0f0eb0dc7ddb126b8a3cf6a08fe7..74802de01dba30e38e09f6fc1f61e7bb64cf5f09 100644
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java
@@ -619,8 +619,9 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster {
if (this.deathAnimationTicks == 1 && !this.isSilent()) {
// CraftBukkit start - Use relative location for far away sounds
// this.world.b(1028, this.getChunkCoordinates(), 0);
- int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16;
- for (EntityPlayer player : (List<EntityPlayer>) MinecraftServer.getServer().getPlayerList().players) {
- for (net.minecraft.server.level.EntityPlayer player : this.world.getMinecraftServer().getPlayerList().players) {
+ //int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API
+ for (EntityPlayer player : (List<EntityPlayer>) ((WorldServer)world).getPlayers()) {
+ for (net.minecraft.server.level.EntityPlayer player : (List<net.minecraft.server.level.EntityPlayer>) ((WorldServer)world).getPlayers()) {
+ final int viewDistance = player.getViewDistance(); // TODO apply view distance api patch
double deltaX = this.locX() - player.locX();
double deltaZ = this.locZ() - player.locZ();
double distanceSquared = deltaX * deltaX + deltaZ * deltaZ;
diff --git a/src/main/java/net/minecraft/server/EntityWither.java b/src/main/java/net/minecraft/server/EntityWither.java
index b9501a2f5f60b70eb7f0b4ac8ef6c883585adaa5..ad5a7cbe83fb61b79203369895e82edca2ffcb72 100644
--- a/src/main/java/net/minecraft/server/EntityWither.java
+++ b/src/main/java/net/minecraft/server/EntityWither.java
@@ -208,8 +208,9 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/EntityWither.java b/src/main/java/net/minecraft/world/entity/boss/wither/EntityWither.java
index f74949c855aea32ceb16d8cb07f266d50045b57e..145767e8b0fc4105a0afa47af17dcdbb75e952bc 100644
--- a/src/main/java/net/minecraft/world/entity/boss/wither/EntityWither.java
+++ b/src/main/java/net/minecraft/world/entity/boss/wither/EntityWither.java
@@ -258,8 +258,9 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
if (!this.isSilent()) {
// CraftBukkit start - Use relative location for far away sounds
// this.world.b(1023, new BlockPosition(this), 0);

View File

@ -7,11 +7,11 @@ Vanilla will double add Spider Jockeys to the world, so ignore already added.
Also add debug if something else tries to, and abort before world gets bad state
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index a4d666480f0211d39e62b82e43100e3d436f4d90..b27ebc0726ecd13062f5cbf49edca2e5cfa4a4c3 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -927,6 +927,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
index 62430c61047f288ce6df6f77302c3bfb2817b299..fd7767d420fe58b1bbd4d8f20d7a7bd8048afe31 100644
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
@@ -1036,6 +1036,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
// CraftBukkit start
private boolean addEntity0(Entity entity, CreatureSpawnEvent.SpawnReason spawnReason) {
org.spigotmc.AsyncCatcher.catchOp("entity add"); // Spigot

View File

@ -8,27 +8,11 @@ Subject: [PATCH] Fix Old Sign Conversion
2) New Mojang Schematic system has Tile Entities in the new converted format, but missing the Bukkit.isConverted flag
This causes Igloos and such to render broken signs. We fix this by ignoring sign conversion for Defined Structures
diff --git a/src/main/java/net/minecraft/server/DefinedStructure.java b/src/main/java/net/minecraft/server/DefinedStructure.java
index 58e9c99b44fd8e77e62c4098d9872d5378d4f5e5..8974d7944f159b9346680c639daf0f8c06767cfe 100644
--- a/src/main/java/net/minecraft/server/DefinedStructure.java
+++ b/src/main/java/net/minecraft/server/DefinedStructure.java
@@ -242,9 +242,11 @@ public class DefinedStructure {
definedstructure_blockinfo.c.setLong("LootTableSeed", random.nextLong());
}
+ tileentity.isLoadingStructure = true; // Paper
tileentity.load(definedstructure_blockinfo.b, definedstructure_blockinfo.c);
tileentity.a(definedstructureinfo.c());
tileentity.a(definedstructureinfo.d());
+ tileentity.isLoadingStructure = false; // Paper
}
}
diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java
index 5414858ba241c13d4e568191d11111d3d3ec3fc4..524f84ad2c50f8b837eefd0465901b1e22359410 100644
--- a/src/main/java/net/minecraft/server/TileEntity.java
+++ b/src/main/java/net/minecraft/server/TileEntity.java
@@ -23,6 +23,7 @@ public abstract class TileEntity implements KeyedObject { // Paper
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntity.java
index b1c220df7e00af79b548895cc9333ba85d5a447f..2e1ce36fedac351f4320c6379ce73f8ffb0f5918 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntity.java
@@ -33,6 +33,7 @@ public abstract class TileEntity implements net.minecraft.server.KeyedObject { /
public CraftPersistentDataContainer persistentDataContainer;
// CraftBukkit end
private static final Logger LOGGER = LogManager.getLogger();
@ -36,11 +20,11 @@ index 5414858ba241c13d4e568191d11111d3d3ec3fc4..524f84ad2c50f8b837eefd0465901b1e
private final TileEntityTypes<?> tileType; public TileEntityTypes getTileEntityType() { return tileType; } // Paper - OBFHELPER
@Nullable
protected World world;
diff --git a/src/main/java/net/minecraft/server/TileEntitySign.java b/src/main/java/net/minecraft/server/TileEntitySign.java
index 810603bc03950580aa4d81233a9dd1c2f51d8a0b..5d0c5d856a66ce6c0594b618e8f6e892585ce665 100644
--- a/src/main/java/net/minecraft/server/TileEntitySign.java
+++ b/src/main/java/net/minecraft/server/TileEntitySign.java
@@ -58,13 +58,14 @@ public class TileEntitySign extends TileEntity implements ICommandListener { //
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntitySign.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntitySign.java
index 29db550d91cf9e5a23052772df6e482a5e2b0b90..ec550aaa4e7943af4ecdd2275f1f32c21edf770a 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntitySign.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntitySign.java
@@ -78,13 +78,14 @@ public class TileEntitySign extends TileEntity implements ICommandListener { //
}
try {
@ -57,3 +41,19 @@ index 810603bc03950580aa4d81233a9dd1c2f51d8a0b..5d0c5d856a66ce6c0594b618e8f6e892
if (this.world instanceof WorldServer) {
try {
diff --git a/src/main/java/net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructure.java b/src/main/java/net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructure.java
index a2bc771df054923a9a96c0024a426ef707624359..9b82ff37faaafc3a799413f6949fb88a993aa9a0 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructure.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructure.java
@@ -278,9 +278,11 @@ public class DefinedStructure {
definedstructure_blockinfo.c.setLong("LootTableSeed", random.nextLong());
}
+ tileentity.isLoadingStructure = true; // Paper
tileentity.load(definedstructure_blockinfo.b, definedstructure_blockinfo.c);
tileentity.a(definedstructureinfo.c());
tileentity.a(definedstructureinfo.d());
+ tileentity.isLoadingStructure = false; // Paper
}
}

View File

@ -4,11 +4,11 @@ Date: Sat, 16 Jul 2016 19:11:17 -0500
Subject: [PATCH] Don't lookup game profiles that have no UUID and no name
diff --git a/src/main/java/net/minecraft/server/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java
index f61cf940f21288fc6e8faf9519d2366436146d1f..e89c92aded564fe689cc1aa8d0c83abb72f7b10c 100644
--- a/src/main/java/net/minecraft/server/UserCache.java
+++ b/src/main/java/net/minecraft/server/UserCache.java
@@ -89,7 +89,7 @@ public class UserCache {
diff --git a/src/main/java/net/minecraft/server/players/UserCache.java b/src/main/java/net/minecraft/server/players/UserCache.java
index 9bb949ff4cbfc87ce179653939454a1e44dcdd77..85ca2a3b19d27a0dbe1c8dee6bd5b31ae11bbce2 100644
--- a/src/main/java/net/minecraft/server/players/UserCache.java
+++ b/src/main/java/net/minecraft/server/players/UserCache.java
@@ -90,7 +90,7 @@ public class UserCache {
gameprofilerepository.findProfilesByNames(new String[]{s}, Agent.MINECRAFT, profilelookupcallback);
GameProfile gameprofile = (GameProfile) atomicreference.get();

View File

@ -30,11 +30,11 @@ index 1b8e5671c9dc8c15ce33d351c1bb20f28919b9a2..c52dc0346f93527965ef29a0ccdc4bf3
+ return Bukkit.getOnlineMode() || (SpigotConfig.bungee && bungeeOnlineMode);
+ }
}
diff --git a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
index 060887d765604e4be82913607bb6266a278f5db6..c5957c2d6c54b076ebe7f9a432e30551d2b6febc 100644
--- a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
+++ b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
@@ -56,7 +56,8 @@ public class NameReferencingFileConverter {
diff --git a/src/main/java/net/minecraft/server/players/NameReferencingFileConverter.java b/src/main/java/net/minecraft/server/players/NameReferencingFileConverter.java
index 8a343a857dc4661ba256e39cf391dd2c7a1cc970..8c1f328ca1ba12ed63ec7bd7efad54ff633ba802 100644
--- a/src/main/java/net/minecraft/server/players/NameReferencingFileConverter.java
+++ b/src/main/java/net/minecraft/server/players/NameReferencingFileConverter.java
@@ -66,7 +66,8 @@ public class NameReferencingFileConverter {
return new String[i];
});
@ -45,7 +45,7 @@ index 060887d765604e4be82913607bb6266a278f5db6..c5957c2d6c54b076ebe7f9a432e30551
} else {
String[] astring1 = astring;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 8e25929a7d1294a7cd764cd29e43977c9b2ca826..719e8117f06a14147587626eb03e1778408f2ce3 100644
index 96abe76ab9d71561740499b4dfcfa94ded1c1b53..f1572f708911d61ae6dc0077475fee8d815e28db 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1507,7 +1507,8 @@ public final class CraftServer implements Server {

View File

@ -8,10 +8,10 @@ object identity checks safely.
Use a simpler optimized hashcode
diff --git a/src/main/java/net/minecraft/server/BlockStateBoolean.java b/src/main/java/net/minecraft/server/BlockStateBoolean.java
index 8df150f4cabb3dd98cb66c9d1af7fae035a6a6fe..4ca8db630434915de4eaeac6c4ecd60714d7f5d9 100644
--- a/src/main/java/net/minecraft/server/BlockStateBoolean.java
+++ b/src/main/java/net/minecraft/server/BlockStateBoolean.java
diff --git a/src/main/java/net/minecraft/world/level/block/state/properties/BlockStateBoolean.java b/src/main/java/net/minecraft/world/level/block/state/properties/BlockStateBoolean.java
index 0701c1a178852345b6bf01bce8b1d0559c535d45..f2f94950681b198ae7a4c31a044fd62e98e448ab 100644
--- a/src/main/java/net/minecraft/world/level/block/state/properties/BlockStateBoolean.java
+++ b/src/main/java/net/minecraft/world/level/block/state/properties/BlockStateBoolean.java
@@ -30,8 +30,7 @@ public class BlockStateBoolean extends IBlockState<Boolean> {
return obool.toString();
}
@ -22,11 +22,11 @@ index 8df150f4cabb3dd98cb66c9d1af7fae035a6a6fe..4ca8db630434915de4eaeac6c4ecd607
if (this == object) {
return true;
} else if (object instanceof BlockStateBoolean && super.equals(object)) {
diff --git a/src/main/java/net/minecraft/server/BlockStateEnum.java b/src/main/java/net/minecraft/server/BlockStateEnum.java
index 8162c11d14b8e88c2b572f9ddf6b7a15977047f8..8dc620b22bb904aa6a82e2127aa9da861986525c 100644
--- a/src/main/java/net/minecraft/server/BlockStateEnum.java
+++ b/src/main/java/net/minecraft/server/BlockStateEnum.java
@@ -49,8 +49,7 @@ public class BlockStateEnum<T extends Enum<T> & INamable> extends IBlockState<T>
diff --git a/src/main/java/net/minecraft/world/level/block/state/properties/BlockStateEnum.java b/src/main/java/net/minecraft/world/level/block/state/properties/BlockStateEnum.java
index de85894beae7ee7d276cf2af3daa77377ce131c3..3079cd13ea1465f4221fde4fec7df639f7c1eb49 100644
--- a/src/main/java/net/minecraft/world/level/block/state/properties/BlockStateEnum.java
+++ b/src/main/java/net/minecraft/world/level/block/state/properties/BlockStateEnum.java
@@ -50,8 +50,7 @@ public class BlockStateEnum<T extends Enum<T> & INamable> extends IBlockState<T>
return ((INamable) t0).getName();
}
@ -36,10 +36,10 @@ index 8162c11d14b8e88c2b572f9ddf6b7a15977047f8..8dc620b22bb904aa6a82e2127aa9da86
if (this == object) {
return true;
} else if (object instanceof BlockStateEnum && super.equals(object)) {
diff --git a/src/main/java/net/minecraft/server/BlockStateInteger.java b/src/main/java/net/minecraft/server/BlockStateInteger.java
index 5bd7a236b948666ca31e53cb3a8aa0dc147e274b..36b84446e96faefad3b783f73df74e0f3bce8255 100644
--- a/src/main/java/net/minecraft/server/BlockStateInteger.java
+++ b/src/main/java/net/minecraft/server/BlockStateInteger.java
diff --git a/src/main/java/net/minecraft/world/level/block/state/properties/BlockStateInteger.java b/src/main/java/net/minecraft/world/level/block/state/properties/BlockStateInteger.java
index 518c2ebe4cdfe4704bbec2abe81522cbca38da55..190978c889222185b47065e9e5f96a82e59c7b4e 100644
--- a/src/main/java/net/minecraft/world/level/block/state/properties/BlockStateInteger.java
+++ b/src/main/java/net/minecraft/world/level/block/state/properties/BlockStateInteger.java
@@ -38,8 +38,7 @@ public class BlockStateInteger extends IBlockState<Integer> {
return this.a;
}
@ -50,11 +50,11 @@ index 5bd7a236b948666ca31e53cb3a8aa0dc147e274b..36b84446e96faefad3b783f73df74e0f
if (this == object) {
return true;
} else if (object instanceof BlockStateInteger && super.equals(object)) {
diff --git a/src/main/java/net/minecraft/server/IBlockState.java b/src/main/java/net/minecraft/server/IBlockState.java
index d63a4e4916ed5f5d901be0f4dd2c13cf66239055..6550b55067db31dbbc903fe17a13849383651c5a 100644
--- a/src/main/java/net/minecraft/server/IBlockState.java
+++ b/src/main/java/net/minecraft/server/IBlockState.java
@@ -59,23 +59,17 @@ public abstract class IBlockState<T extends Comparable<T>> {
diff --git a/src/main/java/net/minecraft/world/level/block/state/properties/IBlockState.java b/src/main/java/net/minecraft/world/level/block/state/properties/IBlockState.java
index e3969bad5be64bb41e2973751605d6820c16f021..759d6a4adaa511488ace5e2650eb685cbb6c4c16 100644
--- a/src/main/java/net/minecraft/world/level/block/state/properties/IBlockState.java
+++ b/src/main/java/net/minecraft/world/level/block/state/properties/IBlockState.java
@@ -60,23 +60,17 @@ public abstract class IBlockState<T extends Comparable<T>> {
}
public boolean equals(Object object) {

View File

@ -22,11 +22,11 @@ index c52dc0346f93527965ef29a0ccdc4bf3debe302e..64d7c9058ee757a6d3cf3b648596092a
+ packetInSpamThreshold = getInt("settings.incoming-packet-spam-threshold", 300);
+ }
}
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 283ff4a255f310ab0a8900531c397a1ad4b99018..9af1176497735f465fb06ff326d1c32125f7407f 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -1317,13 +1317,14 @@ public class PlayerConnection implements PacketListenerPlayIn {
diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java
index 7aec9a349ea941153863d95eb8df4f8c884b5617..d809984d4a0032a2e27d01524c662a09da9d5eab 100644
--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java
@@ -1462,13 +1462,14 @@ public class PlayerConnection implements PacketListenerPlayIn {
// Spigot start - limit place/interactions
private int limitedPackets;
private long lastLimitedPacket = -1;

View File

@ -20,11 +20,11 @@ index 64d7c9058ee757a6d3cf3b648596092a810e105c..4e2f243faa209925dcb7c3ef89df3ed8
+ flyingKickVehicleMessage = getString("messages.kick.flying-vehicle", flyingKickVehicleMessage);
+ }
}
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 9af1176497735f465fb06ff326d1c32125f7407f..697edff8d2a1435c8831dadfd5c2fa60753d6d18 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -160,7 +160,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java
index d809984d4a0032a2e27d01524c662a09da9d5eab..010d4d33a2044bd54bf0bab055708711865b8d12 100644
--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java
@@ -305,7 +305,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
if (this.B && !this.player.isSleeping()) {
if (++this.C > 80) {
PlayerConnection.LOGGER.warn("{} was kicked for floating too long!", this.player.getDisplayName().getString());
@ -33,7 +33,7 @@ index 9af1176497735f465fb06ff326d1c32125f7407f..697edff8d2a1435c8831dadfd5c2fa60
return;
}
} else {
@@ -179,7 +179,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -324,7 +324,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
if (this.D && this.player.getRootVehicle().getRidingPassenger() == this.player) {
if (++this.E > 80) {
PlayerConnection.LOGGER.warn("{} was kicked for floating a vehicle too long!", this.player.getDisplayName().getString());

View File

@ -7,11 +7,11 @@ World checks and the Chunk Add logic are inconsistent on how Y > 256, < 0, is tr
Keep them consistent
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index b27ebc0726ecd13062f5cbf49edca2e5cfa4a4c3..e23a5f446a1e357493f5232c39baa45f7386a637 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -736,7 +736,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
index fd7767d420fe58b1bbd4d8f20d7a7bd8048afe31..1e9884e819ac2afe58b5f50b89355c2d58ed73d5 100644
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
@@ -845,7 +845,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
if (entity.cl()) {
this.getMethodProfiler().enter("chunkCheck");
int i = MathHelper.floor(entity.locX() / 16.0D);

View File

@ -5,11 +5,11 @@ Subject: [PATCH] Auto fix bad Y levels on player login
Bring down to a saner Y level if super high, as this can cause the server to crash
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 89b1561bfce8b0a0b34e3f2ce706e3149fb5949d..a0bc829ed49661bc381f535d1e462bf8e0dc6ae1 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -212,6 +212,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
diff --git a/src/main/java/net/minecraft/server/level/EntityPlayer.java b/src/main/java/net/minecraft/server/level/EntityPlayer.java
index 3d5d1b83094b5ca45fae47055db397630fdd4f04..82085f30e4eefa1867536a8c591210380ebad725 100644
--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java
@@ -339,6 +339,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@Override
public void loadData(NBTTagCompound nbttagcompound) {
super.loadData(nbttagcompound);

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