Move to configurate for paper.yml (#7609)

This commit is contained in:
Jake Potrebic 2022-06-09 01:51:45 -07:00 committed by GitHub
parent da8027352c
commit 172d260d67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
872 changed files with 5923 additions and 5664 deletions

View File

@ -10,3 +10,9 @@ indent_style=tab
[*.bat] [*.bat]
end_of_line=crlf end_of_line=crlf
[*.yml]
indent_size=2
[*.patch]
trim_trailing_whitespace=false

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Add FastUtil to Bukkit
Doesn't expose to plugins, just allows Paper-API to use it for optimization Doesn't expose to plugins, just allows Paper-API to use it for optimization
diff --git a/build.gradle.kts b/build.gradle.kts diff --git a/build.gradle.kts b/build.gradle.kts
index b929458b72f26568b4c87571113eb2f867359312..31cd1ba937c364447e32220ffef1d9ef95b634c6 100644 index 044b7c49b569e1170108c912e9307f7fec278762..f0423df165bf7d0f3fad21d26b64f31ba3e6aeee 100644
--- a/build.gradle.kts --- a/build.gradle.kts
+++ b/build.gradle.kts +++ b/build.gradle.kts
@@ -18,6 +18,7 @@ dependencies { @@ -18,6 +18,7 @@ dependencies {

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Use ASM for event executors.
Uses method handles for private or static methods. Uses method handles for private or static methods.
diff --git a/build.gradle.kts b/build.gradle.kts diff --git a/build.gradle.kts b/build.gradle.kts
index da855f2208b50f024bb7577167a6da53c06a9a4a..ac5cb57d590363ad7b827672f756224d2857fa2c 100644 index 6f31679c2944fae3b37847c683abb0d2e5791449..733fed7b0a7259a831e976d443b907830703bda6 100644
--- a/build.gradle.kts --- a/build.gradle.kts
+++ b/build.gradle.kts +++ b/build.gradle.kts
@@ -38,6 +38,9 @@ dependencies { @@ -38,6 +38,9 @@ dependencies {

View File

@ -14,7 +14,7 @@ it without having to shade it in the plugin and going through
several layers of logging abstraction. several layers of logging abstraction.
diff --git a/build.gradle.kts b/build.gradle.kts diff --git a/build.gradle.kts b/build.gradle.kts
index 9ec782b00f9f2ac5a38a75667d36de4582a25a03..ac0a4aea48436201b5712b166413bb7dc0d0b9d8 100644 index 733fed7b0a7259a831e976d443b907830703bda6..921b301de020ce73126ca518556b3435e776783d 100644
--- a/build.gradle.kts --- a/build.gradle.kts
+++ b/build.gradle.kts +++ b/build.gradle.kts
@@ -38,6 +38,8 @@ dependencies { @@ -38,6 +38,8 @@ dependencies {

File diff suppressed because it is too large Load Diff

View File

@ -141,10 +141,10 @@ index 82764c462f82163ee49f4e9466f383366cd23b8b..8da1226a6c293abb038d10c7921a77ed
}); });
} }
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index e24b27eb8647a90eb83ec0f78f3bb9568161ba9b..46fb83911e353f3682a250e62c4ecd7aceabaff8 100644 index 73662a463fc9d38b39c4c779fcfaa09a4689d704..415f2191c10c39f8a48e6c9a2d74426ac4bdfb82 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1736,7 +1736,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1737,7 +1737,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
PackRepository resourcepackrepository = this.packRepository; PackRepository resourcepackrepository = this.packRepository;
Objects.requireNonNull(this.packRepository); Objects.requireNonNull(this.packRepository);

View File

@ -17,7 +17,7 @@ Subject: [PATCH] CB fixes
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com> Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 5f7965076b14a694f644bf8fef9ba4f7b7a473ad..44f6e5cfdceb30934c2aafa85dc5492677d177d7 100644 index 2cf12d6429eb46398069d9bfa60ebcc3a840f60f..a0140ea91f51e52174cff43738a9a159c3d24536 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -289,7 +289,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -289,7 +289,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@ -67,10 +67,10 @@ index 9998e1c94b72b90dd3ba4bcce1b4b3653b9b1b2b..963ad3ce1ef83888ae1537ff01accdbb
this.registryAccess = registryManager; this.registryAccess = registryManager;
this.structureTemplateManager = structureTemplateManager; this.structureTemplateManager = structureTemplateManager;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index cd6ef8cfba7367fec87dd238add23cfd365a5ceb..daf5dc59a1883570569798630c4991e676e34c1c 100644 index cb03d577ee25ceba3263febe186f6f668d1c7e7a..036aa7daa097c2ba0f08a1fcc66c2962883ca72f 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2249,7 +2249,13 @@ public final class CraftServer implements Server { @@ -2248,7 +2248,13 @@ public final class CraftServer implements Server {
Validate.notNull(key, "NamespacedKey cannot be null"); Validate.notNull(key, "NamespacedKey cannot be null");
LootTables registry = this.getServer().getLootTables(); LootTables registry = this.getServer().getLootTables();

View File

@ -5016,18 +5016,18 @@ index 0000000000000000000000000000000000000000..9f292deee1b793d52b5774304318e940
+ } + }
+} +}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 46fb83911e353f3682a250e62c4ecd7aceabaff8..c763b4d9cc16f8c3ced91ce8656bd238205dedc0 100644 index 415f2191c10c39f8a48e6c9a2d74426ac4bdfb82..1ad7797dbef61f8e8011ae6db3089939a279071c 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -279,6 +279,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -280,6 +280,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
private static final int SAMPLE_INTERVAL = 100;
public final double[] recentTps = new double[ 3 ]; public final double[] recentTps = new double[ 3 ];
// Spigot end // Spigot end
public final io.papermc.paper.configuration.PaperConfigurations paperConfigurations;
+ public static long currentTickLong = 0L; // Paper + public static long currentTickLong = 0L; // Paper
public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) { public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
AtomicReference<S> atomicreference = new AtomicReference(); AtomicReference<S> atomicreference = new AtomicReference();
@@ -918,6 +919,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -919,6 +920,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
MinecraftServer.LOGGER.error("Failed to unlock level {}", this.storageSource.getLevelId(), ioexception1); MinecraftServer.LOGGER.error("Failed to unlock level {}", this.storageSource.getLevelId(), ioexception1);
} }
// Spigot start // Spigot start
@ -5037,7 +5037,7 @@ index 46fb83911e353f3682a250e62c4ecd7aceabaff8..c763b4d9cc16f8c3ced91ce8656bd238
if (org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) { if (org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) {
MinecraftServer.LOGGER.info("Saving usercache.json"); MinecraftServer.LOGGER.info("Saving usercache.json");
this.getProfileCache().save(); this.getProfileCache().save();
@@ -984,6 +988,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -985,6 +989,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.lastOverloadWarning = this.nextTickTime; this.lastOverloadWarning = this.nextTickTime;
} }
@ -5045,7 +5045,7 @@ index 46fb83911e353f3682a250e62c4ecd7aceabaff8..c763b4d9cc16f8c3ced91ce8656bd238
if ( tickCount++ % MinecraftServer.SAMPLE_INTERVAL == 0 ) if ( tickCount++ % MinecraftServer.SAMPLE_INTERVAL == 0 )
{ {
double currentTps = 1E3 / ( curTime - tickSection ) * MinecraftServer.SAMPLE_INTERVAL; double currentTps = 1E3 / ( curTime - tickSection ) * MinecraftServer.SAMPLE_INTERVAL;
@@ -1222,7 +1227,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1223,7 +1228,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
MinecraftServer.LOGGER.debug("Autosave finished"); MinecraftServer.LOGGER.debug("Autosave finished");
SpigotTimings.worldSaveTimer.stopTiming(); // Spigot SpigotTimings.worldSaveTimer.stopTiming(); // Spigot
} }
@ -5054,7 +5054,7 @@ index 46fb83911e353f3682a250e62c4ecd7aceabaff8..c763b4d9cc16f8c3ced91ce8656bd238
this.profiler.push("tallying"); this.profiler.push("tallying");
long l = this.tickTimes[this.tickCount % 100] = Util.getNanos() - i; long l = this.tickTimes[this.tickCount % 100] = Util.getNanos() - i;
@@ -1284,6 +1289,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1285,6 +1290,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
try { try {
worldserver.timings.doTick.startTiming(); // Spigot worldserver.timings.doTick.startTiming(); // Spigot
worldserver.tick(shouldKeepTicking); worldserver.tick(shouldKeepTicking);
@ -5504,7 +5504,7 @@ index 6c98676827ceb6999f340fa2b06a0b3e1cb4cae2..f08089b8672454acf8c2309e850466b3
while (objectiterator.hasNext()) { while (objectiterator.hasNext()) {
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index d0b3fdec88ca7e8b1a57b742c1c9b785750123e8..b0c46312dfb00c13421bb643dbf246610aff897b 100644 index ce88976db29b9e9524dbe45b16721ef90afb692b..186a8f5895fedbaf27a7949d9bdbb1a9f2e36fbf 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -50,6 +50,7 @@ import net.minecraft.world.level.storage.LevelStorageSource; @@ -50,6 +50,7 @@ import net.minecraft.world.level.storage.LevelStorageSource;
@ -5900,8 +5900,21 @@ index d0b3fdec88ca7e8b1a57b742c1c9b785750123e8..b0c46312dfb00c13421bb643dbf24661
@Nullable @Nullable
@Override @Override
public ChunkAccess getChunk(int x, int z, ChunkStatus leastStatus, boolean create) { public ChunkAccess getChunk(int x, int z, ChunkStatus leastStatus, boolean create) {
@@ -327,6 +699,12 @@ public class ServerChunkCache extends ChunkSource {
}
}
+ // Paper start
+ public boolean isPositionTicking(Entity entity) {
+ return this.isPositionTicking(ChunkPos.asLong(net.minecraft.util.Mth.floor(entity.getX()) >> 4, net.minecraft.util.Mth.floor(entity.getZ()) >> 4));
+ }
+ // Paper end
+
public boolean isPositionTicking(long pos) {
ChunkHolder playerchunk = this.getVisibleChunkIfPresent(pos);
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 44f6e5cfdceb30934c2aafa85dc5492677d177d7..501fd02fedf1a47da28d07fd04b63f89368723ce 100644 index a0140ea91f51e52174cff43738a9a159c3d24536..54bff89aed25ba49bf9fbf01c59efa61e021fd03 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -166,6 +166,7 @@ import org.bukkit.event.weather.LightningStrikeEvent; @@ -166,6 +166,7 @@ import org.bukkit.event.weather.LightningStrikeEvent;
@ -6301,7 +6314,7 @@ index 3c707d6674b2594b09503b959a31c1f4ad3981e6..db61b6b0158a9bcc0e1d735e34fe3671
public BlockState getBlockState(BlockPos pos) { public BlockState getBlockState(BlockPos pos) {
return Blocks.AIR.defaultBlockState(); return Blocks.AIR.defaultBlockState();
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 5576da91821926cdd9c5ef09534deb843986d202..914e42e983d56d9c85b1583f57afab699054f4d6 100644 index 45191c9d8dfe0c5e94d08f2c3b3fd20fe9903e18..c351e38cc12b5c58a2f85b707a7d04b59a1ef198 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -85,6 +85,7 @@ import org.bukkit.craftbukkit.CraftServer; @@ -85,6 +85,7 @@ import org.bukkit.craftbukkit.CraftServer;
@ -6312,7 +6325,7 @@ index 5576da91821926cdd9c5ef09534deb843986d202..914e42e983d56d9c85b1583f57afab69
import org.bukkit.craftbukkit.block.data.CraftBlockData; import org.bukkit.craftbukkit.block.data.CraftBlockData;
import org.bukkit.craftbukkit.util.CraftSpawnCategory; import org.bukkit.craftbukkit.util.CraftSpawnCategory;
import org.bukkit.craftbukkit.util.CraftNamespacedKey; import org.bukkit.craftbukkit.util.CraftNamespacedKey;
@@ -280,18 +281,51 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -284,18 +285,51 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
return y < -20000000 || y >= 20000000; return y < -20000000 || y >= 20000000;
} }
@ -6368,7 +6381,7 @@ index 5576da91821926cdd9c5ef09534deb843986d202..914e42e983d56d9c85b1583f57afab69
ChunkAccess ichunkaccess = this.getChunkSource().getChunk(chunkX, chunkZ, leastStatus, create); ChunkAccess ichunkaccess = this.getChunkSource().getChunk(chunkX, chunkZ, leastStatus, create);
if (ichunkaccess == null && create) { if (ichunkaccess == null && create) {
@@ -302,7 +336,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -306,7 +340,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
} }
@Override @Override
@ -6377,7 +6390,7 @@ index 5576da91821926cdd9c5ef09534deb843986d202..914e42e983d56d9c85b1583f57afab69
return this.setBlock(pos, state, flags, 512); return this.setBlock(pos, state, flags, 512);
} }
@@ -546,7 +580,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -550,7 +584,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
if (this.isOutsideBuildHeight(pos)) { if (this.isOutsideBuildHeight(pos)) {
return Blocks.VOID_AIR.defaultBlockState(); return Blocks.VOID_AIR.defaultBlockState();
} else { } else {
@ -7072,7 +7085,7 @@ index d40c0d8be1b0153d62021b8bcb6e8b37fd0acb4e..e38e57b1f9ef27020de35d7ddcb36a66
public void clear() { public void clear() {
// Create new array to reset memory usage to initial capacity // Create new array to reset memory usage to initial capacity
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
index a96cb7a5f7c94cd9a46b31cf8ec90b544221557b..43aa6b0129892b8ab8ec25c16a131541c6607487 100644 index 8a63098d821b7aacec8529811865e0743d78c021..3dacdbb28db72ecd8ddf82f75d6d19bb386f8df0 100644
--- a/src/main/java/org/spigotmc/SpigotConfig.java --- a/src/main/java/org/spigotmc/SpigotConfig.java
+++ b/src/main/java/org/spigotmc/SpigotConfig.java +++ b/src/main/java/org/spigotmc/SpigotConfig.java
@@ -118,7 +118,11 @@ public class SpigotConfig @@ -118,7 +118,11 @@ public class SpigotConfig

View File

@ -6,24 +6,6 @@ Subject: [PATCH] Adventure
Co-authored-by: zml <zml@stellardrift.ca> Co-authored-by: zml <zml@stellardrift.ca>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com> Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index 80a3d5890aab91e6a48d5734140187851106bde3..c1eb4201ecb0541c606ef0d05b828ae9c87c8a2c 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -185,4 +185,13 @@ public class PaperConfig {
config.addDefault(path, def);
return config.getString(path, config.getString(path));
}
+
+ public static boolean useDisplayNameInQuit = false;
+ private static void useDisplayNameInQuit() {
+ if (version < 21) {
+ boolean oldValue = getBoolean("use-display-name-in-quit-message", useDisplayNameInQuit);
+ set("settings.use-display-name-in-quit-message", oldValue);
+ }
+ useDisplayNameInQuit = getBoolean("settings.use-display-name-in-quit-message", useDisplayNameInQuit);
+ }
}
diff --git a/src/main/java/io/papermc/paper/adventure/AdventureComponent.java b/src/main/java/io/papermc/paper/adventure/AdventureComponent.java diff --git a/src/main/java/io/papermc/paper/adventure/AdventureComponent.java b/src/main/java/io/papermc/paper/adventure/AdventureComponent.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..07cd02c6f9df00844b808218be2afd793c24b69a index 0000000000000000000000000000000000000000..07cd02c6f9df00844b808218be2afd793c24b69a
@ -1435,7 +1417,7 @@ index 56996af65ef7478adb90d3b2f4cd3351fc49200b..7002d5f5700570e32ebf0b63e340d87d
// CraftBukkit end // CraftBukkit end
this.chatVisibility = packet.chatVisibility(); this.chatVisibility = packet.chatVisibility();
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 2cbe0230173ad391fe70b0a31d8999927461b5e6..f5f2a60b0c20d64a7523a4339b14f40e15c62633 100644 index 2cbe0230173ad391fe70b0a31d8999927461b5e6..56e1886b4cf63fd1f14cd8420ccdba1271cf2d6c 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -172,6 +172,8 @@ import org.apache.commons.lang3.StringUtils; @@ -172,6 +172,8 @@ import org.apache.commons.lang3.StringUtils;
@ -1473,7 +1455,7 @@ index 2cbe0230173ad391fe70b0a31d8999927461b5e6..f5f2a60b0c20d64a7523a4339b14f40e
return; return;
} }
- String leaveMessage = ChatFormatting.YELLOW + this.player.getScoreboardName() + " left the game."; - String leaveMessage = ChatFormatting.YELLOW + this.player.getScoreboardName() + " left the game.";
+ net.kyori.adventure.text.Component leaveMessage = net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, com.destroystokyo.paper.PaperConfig.useDisplayNameInQuit ? this.player.getBukkitEntity().displayName() : net.kyori.adventure.text.Component.text(this.player.getScoreboardName())); // Paper - Adventure + net.kyori.adventure.text.Component leaveMessage = net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? this.player.getBukkitEntity().displayName() : net.kyori.adventure.text.Component.text(this.player.getScoreboardName())); // Paper - Adventure
- PlayerKickEvent event = new PlayerKickEvent(this.player.getBukkitEntity(), s, leaveMessage); - PlayerKickEvent event = new PlayerKickEvent(this.player.getBukkitEntity(), s, leaveMessage);
+ PlayerKickEvent event = new PlayerKickEvent(this.player.getBukkitEntity(), reason, leaveMessage); // Paper - Adventure + PlayerKickEvent event = new PlayerKickEvent(this.player.getBukkitEntity(), reason, leaveMessage); // Paper - Adventure
@ -1599,7 +1581,7 @@ index 8670f3fab7ec2a80d69e5dd3f945fc15aaa1a36f..5d368e34c90fc5191d9ed2352f7aa44c
@Override @Override
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 2fc5519020af0f18e93bf11cc0d33f65f1b23b55..821b9c0ba003163195a461dd0bce1fa9ffd0a146 100644 index 2fc5519020af0f18e93bf11cc0d33f65f1b23b55..9e0c61b63cc402c26ca1306313ca6054efb108b8 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -8,6 +8,7 @@ import com.mojang.logging.LogUtils; @@ -8,6 +8,7 @@ import com.mojang.logging.LogUtils;
@ -1666,7 +1648,7 @@ index 2fc5519020af0f18e93bf11cc0d33f65f1b23b55..821b9c0ba003163195a461dd0bce1fa9
} }
- PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), entityplayer.kickLeaveMessage != null ? entityplayer.kickLeaveMessage : "\u00A7e" + entityplayer.getScoreboardName() + " left the game"); - PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), entityplayer.kickLeaveMessage != null ? entityplayer.kickLeaveMessage : "\u00A7e" + entityplayer.getScoreboardName() + " left the game");
+ PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, com.destroystokyo.paper.PaperConfig.useDisplayNameInQuit ? entityplayer.getBukkitEntity().displayName() : net.kyori.adventure.text.Component.text(entityplayer.getScoreboardName()))); + PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? entityplayer.getBukkitEntity().displayName() : net.kyori.adventure.text.Component.text(entityplayer.getScoreboardName())));
this.cserver.getPluginManager().callEvent(playerQuitEvent); this.cserver.getPluginManager().callEvent(playerQuitEvent);
entityplayer.getBukkitEntity().disconnect(playerQuitEvent.getQuitMessage()); entityplayer.getBukkitEntity().disconnect(playerQuitEvent.getQuitMessage());
@ -1832,7 +1814,7 @@ index 595b56b2ab9a813ba71399d306117294fa90dc65..3527d40102d512d0e276edc969ea3c18
} }
collection = icons; collection = icons;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index daf5dc59a1883570569798630c4991e676e34c1c..d3d8935bafb2e0773c96c5807ebd23f20de26592 100644 index 036aa7daa097c2ba0f08a1fcc66c2962883ca72f..f9ddb9835cad1b76eecd639dff8fa29472954421 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -581,8 +581,10 @@ public final class CraftServer implements Server { @@ -581,8 +581,10 @@ public final class CraftServer implements Server {
@ -1846,7 +1828,7 @@ index daf5dc59a1883570569798630c4991e676e34c1c..d3d8935bafb2e0773c96c5807ebd23f2
} }
@Override @Override
@@ -1404,7 +1406,15 @@ public final class CraftServer implements Server { @@ -1403,7 +1405,15 @@ public final class CraftServer implements Server {
return this.configuration.getInt("settings.spawn-radius", -1); return this.configuration.getInt("settings.spawn-radius", -1);
} }
@ -1862,7 +1844,7 @@ index daf5dc59a1883570569798630c4991e676e34c1c..d3d8935bafb2e0773c96c5807ebd23f2
public String getShutdownMessage() { public String getShutdownMessage() {
return this.configuration.getString("settings.shutdown-message"); return this.configuration.getString("settings.shutdown-message");
} }
@@ -1562,7 +1572,20 @@ public final class CraftServer implements Server { @@ -1561,7 +1571,20 @@ public final class CraftServer implements Server {
} }
@Override @Override
@ -1883,7 +1865,7 @@ index daf5dc59a1883570569798630c4991e676e34c1c..d3d8935bafb2e0773c96c5807ebd23f2
Set<CommandSender> recipients = new HashSet<>(); Set<CommandSender> recipients = new HashSet<>();
for (Permissible permissible : this.getPluginManager().getPermissionSubscriptions(permission)) { for (Permissible permissible : this.getPluginManager().getPermissionSubscriptions(permission)) {
if (permissible instanceof CommandSender && permissible.hasPermission(permission)) { if (permissible instanceof CommandSender && permissible.hasPermission(permission)) {
@@ -1570,14 +1593,14 @@ public final class CraftServer implements Server { @@ -1569,14 +1592,14 @@ public final class CraftServer implements Server {
} }
} }
@ -1900,7 +1882,7 @@ index daf5dc59a1883570569798630c4991e676e34c1c..d3d8935bafb2e0773c96c5807ebd23f2
for (CommandSender recipient : recipients) { for (CommandSender recipient : recipients) {
recipient.sendMessage(message); recipient.sendMessage(message);
@@ -1828,6 +1851,14 @@ public final class CraftServer implements Server { @@ -1827,6 +1850,14 @@ public final class CraftServer implements Server {
return CraftInventoryCreator.INSTANCE.createInventory(owner, type); return CraftInventoryCreator.INSTANCE.createInventory(owner, type);
} }
@ -1915,7 +1897,7 @@ index daf5dc59a1883570569798630c4991e676e34c1c..d3d8935bafb2e0773c96c5807ebd23f2
@Override @Override
public Inventory createInventory(InventoryHolder owner, InventoryType type, String title) { public Inventory createInventory(InventoryHolder owner, InventoryType type, String title) {
Validate.isTrue(type.isCreatable(), "Cannot open an inventory of type ", type); Validate.isTrue(type.isCreatable(), "Cannot open an inventory of type ", type);
@@ -1840,13 +1871,28 @@ public final class CraftServer implements Server { @@ -1839,13 +1870,28 @@ public final class CraftServer implements Server {
return CraftInventoryCreator.INSTANCE.createInventory(owner, size); return CraftInventoryCreator.INSTANCE.createInventory(owner, size);
} }
@ -1944,7 +1926,7 @@ index daf5dc59a1883570569798630c4991e676e34c1c..d3d8935bafb2e0773c96c5807ebd23f2
public Merchant createMerchant(String title) { public Merchant createMerchant(String title) {
return new CraftMerchantCustom(title == null ? InventoryType.MERCHANT.getDefaultTitle() : title); return new CraftMerchantCustom(title == null ? InventoryType.MERCHANT.getDefaultTitle() : title);
} }
@@ -1906,6 +1952,12 @@ public final class CraftServer implements Server { @@ -1905,6 +1951,12 @@ public final class CraftServer implements Server {
return Thread.currentThread().equals(console.serverThread) || this.console.hasStopped() || !org.spigotmc.AsyncCatcher.enabled; // All bets are off if we have shut down (e.g. due to watchdog) return Thread.currentThread().equals(console.serverThread) || this.console.hasStopped() || !org.spigotmc.AsyncCatcher.enabled; // All bets are off if we have shut down (e.g. due to watchdog)
} }
@ -1957,10 +1939,10 @@ index daf5dc59a1883570569798630c4991e676e34c1c..d3d8935bafb2e0773c96c5807ebd23f2
@Override @Override
public String getMotd() { public String getMotd() {
return this.console.getMotd(); return this.console.getMotd();
@@ -2353,5 +2405,15 @@ public final class CraftServer implements Server { @@ -2322,4 +2374,15 @@ public final class CraftServer implements Server {
return null; return this.spigot;
}
} }
// Spigot end
+ +
+ // Paper start + // Paper start
+ private Iterable<? extends net.kyori.adventure.audience.Audience> adventure$audiences; + private Iterable<? extends net.kyori.adventure.audience.Audience> adventure$audiences;
@ -1971,7 +1953,7 @@ index daf5dc59a1883570569798630c4991e676e34c1c..d3d8935bafb2e0773c96c5807ebd23f2
+ } + }
+ return this.adventure$audiences; + return this.adventure$audiences;
+ } + }
// Paper end + // Paper end
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 40421cc8ef25f1bef32a0a5d2f0f25165efe230a..1357bc97801f892e59fc8e89c3cc2d697894ccfb 100644 index 40421cc8ef25f1bef32a0a5d2f0f25165efe230a..1357bc97801f892e59fc8e89c3cc2d697894ccfb 100644

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Paper command
diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..0c7738412ce5c9b8c66e3f1c1e13fcd2a2154195 index 0000000000000000000000000000000000000000..e75134a6aa92c86aa86430c7603e111280077d16
--- /dev/null --- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java +++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java
@@ -0,0 +1,289 @@ @@ -0,0 +1,286 @@
+package com.destroystokyo.paper; +package com.destroystokyo.paper;
+ +
+import com.google.common.base.Functions; +import com.google.common.base.Functions;
@ -83,7 +83,7 @@ index 0000000000000000000000000000000000000000..0c7738412ce5c9b8c66e3f1c1e13fcd2
+ if (args.length == 2) + if (args.length == 2)
+ return getListMatchingLast(sender, args, "help", "list"); + return getListMatchingLast(sender, args, "help", "list");
+ if (args.length == 3) + if (args.length == 3)
+ return getListMatchingLast(sender, args, EntityType.getEntityNameList().stream().map(ResourceLocation::toString).sorted().toArray(String[]::new)); + return getListMatchingLast(sender, args, Registry.ENTITY_TYPE.keySet().stream().map(ResourceLocation::toString).sorted().toArray(String[]::new));
+ break; + break;
+ } + }
+ return Collections.emptyList(); + return Collections.emptyList();
@ -188,7 +188,7 @@ index 0000000000000000000000000000000000000000..0c7738412ce5c9b8c66e3f1c1e13fcd2
+ filter = args[2]; + filter = args[2];
+ } + }
+ final String cleanfilter = filter.replace("?", ".?").replace("*", ".*?"); + final String cleanfilter = filter.replace("?", ".?").replace("*", ".*?");
+ Set<ResourceLocation> names = EntityType.getEntityNameList().stream() + Set<ResourceLocation> names = Registry.ENTITY_TYPE.keySet().stream()
+ .filter(n -> n.toString().matches(cleanfilter)) + .filter(n -> n.toString().matches(cleanfilter))
+ .collect(Collectors.toSet()); + .collect(Collectors.toSet());
+ +
@ -289,13 +289,68 @@ index 0000000000000000000000000000000000000000..0c7738412ce5c9b8c66e3f1c1e13fcd2
+ Command.broadcastCommandMessage(sender, text("Please note that this command is not supported and may cause issues.", RED)); + Command.broadcastCommandMessage(sender, text("Please note that this command is not supported and may cause issues.", RED));
+ Command.broadcastCommandMessage(sender, text("If you encounter any issues please use the /stop command to restart your server.", RED)); + Command.broadcastCommandMessage(sender, text("If you encounter any issues please use the /stop command to restart your server.", RED));
+ +
+ MinecraftServer console = MinecraftServer.getServer(); + MinecraftServer server = ((CraftServer) sender.getServer()).getServer();
+ com.destroystokyo.paper.PaperConfig.init((File) console.options.valueOf("paper-settings")); + server.paperConfigurations.reloadConfigs(server);
+ for (ServerLevel world : console.getAllLevels()) { + server.server.reloadCount++;
+ world.paperConfig.init();
+ }
+ console.server.reloadCount++;
+ +
+ Command.broadcastCommandMessage(sender, text("Paper config reload complete.", GREEN)); + Command.broadcastCommandMessage(sender, text("Paper config reload complete.", GREEN));
+ } + }
+} +}
diff --git a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
index 6c19825de43b82ba3fe6e44123e7d24748698614..f06f130b2fa703e105f9d49bc755e8374d023f2e 100644
--- a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
+++ b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
@@ -1,5 +1,6 @@
package io.papermc.paper.configuration;
+import com.destroystokyo.paper.PaperCommand;
import com.google.common.collect.Table;
import com.mojang.logging.LogUtils;
import io.leangen.geantyref.TypeToken;
@@ -283,6 +284,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
private static final Map<String, Command> COMMANDS = new HashMap<>();
static {
+ COMMANDS.put("paper", new PaperCommand("paper"));
}
public static void registerCommands(final MinecraftServer server) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index f9ddb9835cad1b76eecd639dff8fa29472954421..268715e19a6fa7d26510d9d0a8f19b158835b279 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2376,6 +2376,34 @@ public final class CraftServer implements Server {
// Spigot end
// Paper start
+ @SuppressWarnings({"rawtypes", "unchecked"})
+ public static java.nio.file.Path dumpHeap(java.nio.file.Path dir, String name) {
+ try {
+ java.nio.file.Files.createDirectories(dir);
+
+ javax.management.MBeanServer server = java.lang.management.ManagementFactory.getPlatformMBeanServer();
+ java.nio.file.Path file;
+
+ try {
+ Class clazz = Class.forName("openj9.lang.management.OpenJ9DiagnosticsMXBean");
+ Object openj9Mbean = java.lang.management.ManagementFactory.newPlatformMXBeanProxy(server, "openj9.lang.management:type=OpenJ9Diagnostics", clazz);
+ java.lang.reflect.Method m = clazz.getMethod("triggerDumpToFile", String.class, String.class);
+ file = dir.resolve(name + ".phd");
+ m.invoke(openj9Mbean, "heap", file.toString());
+ } catch (ClassNotFoundException e) {
+ Class clazz = Class.forName("com.sun.management.HotSpotDiagnosticMXBean");
+ Object hotspotMBean = java.lang.management.ManagementFactory.newPlatformMXBeanProxy(server, "com.sun.management:type=HotSpotDiagnostic", clazz);
+ java.lang.reflect.Method m = clazz.getMethod("dumpHeap", String.class, boolean.class);
+ file = dir.resolve(name + ".hprof");
+ m.invoke(hotspotMBean, file.toString(), true);
+ }
+
+ return file;
+ } catch (Throwable t) {
+ Bukkit.getLogger().log(Level.SEVERE, "Could not write heap", t);
+ return null;
+ }
+ }
private Iterable<? extends net.kyori.adventure.audience.Audience> adventure$audiences;
@Override
public Iterable<? extends net.kyori.adventure.audience.Audience> audiences() {

View File

@ -15,7 +15,7 @@ decisions on behalf of the project.
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..e3b74dbdf8e14219a56fab939f3174e0c2f66de6 index 0000000000000000000000000000000000000000..5a19e30a9b7e65a70f68a429b8ca741f788a303b
--- /dev/null --- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java +++ b/src/main/java/com/destroystokyo/paper/Metrics.java
@@ -0,0 +1,670 @@ @@ -0,0 +1,670 @@
@ -576,8 +576,8 @@ index 0000000000000000000000000000000000000000..e3b74dbdf8e14219a56fab939f3174e0
+ +
+ } + }
+ +
+ static class PaperMetrics { + public static class PaperMetrics {
+ static void startMetrics() { + public static void startMetrics() {
+ // Get the config file + // Get the config file
+ File configFile = new File(new File((File) MinecraftServer.getServer().options.valueOf("plugins"), "bStats"), "config.yml"); + File configFile = new File(new File((File) MinecraftServer.getServer().options.valueOf("plugins"), "bStats"), "config.yml");
+ YamlConfiguration config = YamlConfiguration.loadConfiguration(configFile); + YamlConfiguration config = YamlConfiguration.loadConfiguration(configFile);
@ -689,22 +689,29 @@ index 0000000000000000000000000000000000000000..e3b74dbdf8e14219a56fab939f3174e0
+ } + }
+ } + }
+} +}
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java diff --git a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
index c1eb4201ecb0541c606ef0d05b828ae9c87c8a2c..52e9dca37dab4cacdded3b084c40d4dd75182bb5 100644 index f06f130b2fa703e105f9d49bc755e8374d023f2e..ef407d6a961c327631656cfd4cc610a22a9e53ac 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java --- a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
@@ -42,6 +42,7 @@ public class PaperConfig { @@ -1,5 +1,6 @@
private static boolean verbose; package io.papermc.paper.configuration;
private static boolean fatalError;
/*========================================================================*/
+ private static boolean metricsStarted;
public static void init(File configFile) { +import com.destroystokyo.paper.Metrics;
CONFIG_FILE = configFile; import com.destroystokyo.paper.PaperCommand;
@@ -84,6 +85,11 @@ public class PaperConfig { import com.google.common.collect.Table;
for (Map.Entry<String, Command> entry : commands.entrySet()) { import com.mojang.logging.LogUtils;
MinecraftServer.getServer().server.getCommandMap().register(entry.getKey(), "Paper", entry.getValue()); @@ -283,6 +284,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
} }
private static final Map<String, Command> COMMANDS = new HashMap<>();
+ private static boolean metricsStarted = false;
static {
COMMANDS.put("paper", new PaperCommand("paper"));
}
@@ -291,6 +293,11 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
COMMANDS.forEach((s, command) -> {
server.server.getCommandMap().register(s, "Paper", command);
});
+ +
+ if (!metricsStarted) { + if (!metricsStarted) {
+ Metrics.PaperMetrics.startMetrics(); + Metrics.PaperMetrics.startMetrics();
@ -712,9 +719,9 @@ index c1eb4201ecb0541c606ef0d05b828ae9c87c8a2c..52e9dca37dab4cacdded3b084c40d4dd
+ } + }
} }
static void readConfig(Class<?> clazz, Object instance) { @Deprecated
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
index 43aa6b0129892b8ab8ec25c16a131541c6607487..9d3d65de7cb0be25aa7fc40353390280943b55f4 100644 index ed8ae212fc0ca781438fa9667f3f5cccc0af4cee..051d7c7fc5796ad056ae1ba5e5e630fde8794108 100644
--- a/src/main/java/org/spigotmc/SpigotConfig.java --- a/src/main/java/org/spigotmc/SpigotConfig.java
+++ b/src/main/java/org/spigotmc/SpigotConfig.java +++ b/src/main/java/org/spigotmc/SpigotConfig.java
@@ -83,6 +83,7 @@ public class SpigotConfig @@ -83,6 +83,7 @@ public class SpigotConfig
@ -732,4 +739,4 @@ index 43aa6b0129892b8ab8ec25c16a131541c6607487..9d3d65de7cb0be25aa7fc40353390280
+ */ // Paper end + */ // Paper end
} }
static void readConfig(Class<?> clazz, Object instance) public static void readConfig(Class<?> clazz, Object instance) // Paper - package-private -> public

View File

@ -6,13 +6,14 @@ Subject: [PATCH] Timings v2
diff --git a/src/main/java/co/aikar/timings/MinecraftTimings.java b/src/main/java/co/aikar/timings/MinecraftTimings.java diff --git a/src/main/java/co/aikar/timings/MinecraftTimings.java b/src/main/java/co/aikar/timings/MinecraftTimings.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..b47b7dce26805badd422c1867733ff4bfd00e9f4 index 0000000000000000000000000000000000000000..9fdc3e9936262b8eb8d502c4dd2ba47a7eceacce
--- /dev/null --- /dev/null
+++ b/src/main/java/co/aikar/timings/MinecraftTimings.java +++ b/src/main/java/co/aikar/timings/MinecraftTimings.java
@@ -0,0 +1,151 @@ @@ -0,0 +1,168 @@
+package co.aikar.timings; +package co.aikar.timings;
+ +
+import com.google.common.collect.MapMaker; +import com.google.common.collect.MapMaker;
+import io.papermc.paper.configuration.GlobalConfiguration;
+import net.minecraft.commands.CommandFunction; +import net.minecraft.commands.CommandFunction;
+import net.minecraft.network.protocol.Packet; +import net.minecraft.network.protocol.Packet;
+import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.Block;
@ -160,6 +161,22 @@ index 0000000000000000000000000000000000000000..b47b7dce26805badd422c1867733ff4b
+ public static Timing getCommandFunctionTiming(CommandFunction function) { + public static Timing getCommandFunctionTiming(CommandFunction function) {
+ return Timings.ofSafe("Command Function - " + function.getId()); + return Timings.ofSafe("Command Function - " + function.getId());
+ } + }
+
+ public static void processConfig(GlobalConfiguration.Timings config) {
+ TimingsManager.url = config.url;
+ if (!TimingsManager.url.endsWith("/")) {
+ TimingsManager.url += "/";
+ }
+ TimingsManager.privacy = config.serverNamePrivacy;
+ if (!config.hiddenConfigEntries.contains("proxies.velocity.secret")) {
+ config.hiddenConfigEntries.add("proxies.velocity.secret");
+ }
+ TimingsManager.hiddenConfigs = config.hiddenConfigEntries;
+ co.aikar.timings.Timings.setVerboseTimingsEnabled(config.verbose);
+ co.aikar.timings.Timings.setTimingsEnabled(config.enabled);
+ co.aikar.timings.Timings.setHistoryInterval(config.historyInterval * 20);
+ co.aikar.timings.Timings.setHistoryLength(config.historyLength * 20);
+ }
+} +}
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
new file mode 100644 new file mode 100644
@ -677,62 +694,6 @@ index 0000000000000000000000000000000000000000..0fda52841b5e1643efeda92106124998
+ return Timings.ofSafe(((PrimaryLevelData) worldserver.getLevelData()).getLevelName() + " - Scheduled " + timingsType); + return Timings.ofSafe(((PrimaryLevelData) worldserver.getLevelData()).getLevelName() + " - Scheduled " + timingsType);
+ } + }
+} +}
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index 52e9dca37dab4cacdded3b084c40d4dd75182bb5..7bbcee19248933f67fd40f46db43363890593c73 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -14,12 +14,15 @@ import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.regex.Pattern;
+import com.google.common.collect.Lists;
import net.minecraft.server.MinecraftServer;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.YamlConfiguration;
+import co.aikar.timings.Timings;
+import co.aikar.timings.TimingsManager;
public class PaperConfig {
@@ -200,4 +203,35 @@ public class PaperConfig {
}
useDisplayNameInQuit = getBoolean("settings.use-display-name-in-quit-message", useDisplayNameInQuit);
}
+
+ public static String timingsServerName;
+ private static void timings() {
+ boolean timings = getBoolean("timings.enabled", true);
+ boolean verboseTimings = getBoolean("timings.verbose", true);
+ TimingsManager.url = getString("timings.url", "https://timings.aikar.co/");
+ if (!TimingsManager.url.endsWith("/")) {
+ TimingsManager.url += "/";
+ }
+ TimingsManager.privacy = getBoolean("timings.server-name-privacy", false);
+ TimingsManager.hiddenConfigs = getList("timings.hidden-config-entries", Lists.newArrayList("database", "settings.bungeecord-addresses", "settings.velocity-support.secret"));
+ if (!TimingsManager.hiddenConfigs.contains("settings.velocity-support.secret")) {
+ TimingsManager.hiddenConfigs.add("settings.velocity-support.secret");
+ }
+ int timingHistoryInterval = getInt("timings.history-interval", 300);
+ int timingHistoryLength = getInt("timings.history-length", 3600);
+ timingsServerName = getString("timings.server-name", "Unknown Server");
+
+
+ Timings.setVerboseTimingsEnabled(verboseTimings);
+ Timings.setTimingsEnabled(timings);
+ Timings.setHistoryInterval(timingHistoryInterval * 20);
+ Timings.setHistoryLength(timingHistoryLength * 20);
+
+ log("Timings: " + timings +
+ " - Url: " + TimingsManager.url +
+ " - Verbose: " + verboseTimings +
+ " - Interval: " + timeSummary(Timings.getHistoryInterval() / 20) +
+ " - Length: " + timeSummary(Timings.getHistoryLength() / 20) +
+ " - Server Name: " + timingsServerName);
+ }
}
diff --git a/src/main/java/net/minecraft/commands/CommandFunction.java b/src/main/java/net/minecraft/commands/CommandFunction.java diff --git a/src/main/java/net/minecraft/commands/CommandFunction.java b/src/main/java/net/minecraft/commands/CommandFunction.java
index ca1a9884ab09fc7e575b1d30e2dd0aaff324fb73..b94038e2da0f986403c1ec9b27384344e2bb22f0 100644 index ca1a9884ab09fc7e575b1d30e2dd0aaff324fb73..b94038e2da0f986403c1ec9b27384344e2bb22f0 100644
--- a/src/main/java/net/minecraft/commands/CommandFunction.java --- a/src/main/java/net/minecraft/commands/CommandFunction.java
@ -768,7 +729,7 @@ index 13421daa96b4ba302581f36abcd730952713d8cd..049e64c355d5f064009b1107ad15d28c
} catch (Exception exception) { } catch (Exception exception) {
if (listener.shouldPropagateHandlingExceptions()) { if (listener.shouldPropagateHandlingExceptions()) {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index c763b4d9cc16f8c3ced91ce8656bd238205dedc0..9be29fbb97aced80da8adb693521a8bd870870c5 100644 index 1ad7797dbef61f8e8011ae6db3089939a279071c..1190d62594c5b1be1c11d55e646ee0bac27307cb 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -175,7 +175,7 @@ import org.bukkit.craftbukkit.generator.CustomWorldChunkManager; @@ -175,7 +175,7 @@ import org.bukkit.craftbukkit.generator.CustomWorldChunkManager;
@ -780,7 +741,7 @@ index c763b4d9cc16f8c3ced91ce8656bd238205dedc0..9be29fbb97aced80da8adb693521a8bd
public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements CommandSource, AutoCloseable { public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements CommandSource, AutoCloseable {
@@ -850,6 +850,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -851,6 +851,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
MinecraftServer.LOGGER.info("Stopping server"); MinecraftServer.LOGGER.info("Stopping server");
@ -788,7 +749,7 @@ index c763b4d9cc16f8c3ced91ce8656bd238205dedc0..9be29fbb97aced80da8adb693521a8bd
// CraftBukkit start // CraftBukkit start
if (this.server != null) { if (this.server != null) {
this.server.disablePlugins(); this.server.disablePlugins();
@@ -1093,9 +1094,21 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1094,9 +1095,21 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
private boolean haveTime() { private boolean haveTime() {
// CraftBukkit start // CraftBukkit start
@ -810,7 +771,7 @@ index c763b4d9cc16f8c3ced91ce8656bd238205dedc0..9be29fbb97aced80da8adb693521a8bd
private void executeModerately() { private void executeModerately() {
this.runAllTasks(); this.runAllTasks();
java.util.concurrent.locks.LockSupport.parkNanos("executing tasks", 1000L); java.util.concurrent.locks.LockSupport.parkNanos("executing tasks", 1000L);
@@ -1103,9 +1116,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1104,9 +1117,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// CraftBukkit end // CraftBukkit end
protected void waitUntilNextTick() { protected void waitUntilNextTick() {
@ -822,7 +783,7 @@ index c763b4d9cc16f8c3ced91ce8656bd238205dedc0..9be29fbb97aced80da8adb693521a8bd
}); });
} }
@@ -1191,9 +1204,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1192,9 +1205,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public void onServerExit() {} public void onServerExit() {}
public void tickServer(BooleanSupplier shouldKeepTicking) { public void tickServer(BooleanSupplier shouldKeepTicking) {
@ -841,7 +802,7 @@ index c763b4d9cc16f8c3ced91ce8656bd238205dedc0..9be29fbb97aced80da8adb693521a8bd
++this.tickCount; ++this.tickCount;
this.tickChildren(shouldKeepTicking); this.tickChildren(shouldKeepTicking);
if (i - this.lastServerStatus >= 5000000000L) { if (i - this.lastServerStatus >= 5000000000L) {
@@ -1219,15 +1240,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1220,15 +1241,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
if (this.autosavePeriod > 0 && this.tickCount % this.autosavePeriod == 0) { // CraftBukkit if (this.autosavePeriod > 0 && this.tickCount % this.autosavePeriod == 0) { // CraftBukkit
@ -862,7 +823,7 @@ index c763b4d9cc16f8c3ced91ce8656bd238205dedc0..9be29fbb97aced80da8adb693521a8bd
this.profiler.push("tallying"); this.profiler.push("tallying");
long l = this.tickTimes[this.tickCount % 100] = Util.getNanos() - i; long l = this.tickTimes[this.tickCount % 100] = Util.getNanos() - i;
@@ -1237,30 +1261,29 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1238,30 +1262,29 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.frameTimer.logFrameDuration(i1 - i); this.frameTimer.logFrameDuration(i1 - i);
this.profiler.pop(); this.profiler.pop();
org.spigotmc.WatchdogThread.tick(); // Spigot org.spigotmc.WatchdogThread.tick(); // Spigot
@ -901,7 +862,7 @@ index c763b4d9cc16f8c3ced91ce8656bd238205dedc0..9be29fbb97aced80da8adb693521a8bd
// Send time updates to everyone, it will get the right time from the world the player is in. // Send time updates to everyone, it will get the right time from the world the player is in.
if (this.tickCount % 20 == 0) { if (this.tickCount % 20 == 0) {
for (int i = 0; i < this.getPlayerList().players.size(); ++i) { for (int i = 0; i < this.getPlayerList().players.size(); ++i) {
@@ -1268,7 +1291,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1269,7 +1292,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
entityplayer.connection.send(new ClientboundSetTimePacket(entityplayer.level.getGameTime(), entityplayer.getPlayerTime(), entityplayer.level.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT))); // Add support for per player time entityplayer.connection.send(new ClientboundSetTimePacket(entityplayer.level.getGameTime(), entityplayer.getPlayerTime(), entityplayer.level.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT))); // Add support for per player time
} }
} }
@ -910,7 +871,7 @@ index c763b4d9cc16f8c3ced91ce8656bd238205dedc0..9be29fbb97aced80da8adb693521a8bd
while (iterator.hasNext()) { while (iterator.hasNext()) {
ServerLevel worldserver = (ServerLevel) iterator.next(); ServerLevel worldserver = (ServerLevel) iterator.next();
@@ -1314,24 +1337,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1315,24 +1338,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
this.profiler.popPush("connection"); this.profiler.popPush("connection");
@ -955,7 +916,7 @@ index b7a06306614087dfab4d4dcf83797b5a92c376c5..00a50196f6a4768d84acfbbeec79a075
i = this.context.runTopCommand(function, source); i = this.context.runTopCommand(function, source);
} finally { } finally {
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index a8d69168fd7aefb2ef1639ab7d57e627f0a2cd68..6a0985781a5189d80e998c3991f691c8d8debfb4 100644 index 297bb691759ed5be375f49441778892e1c816fc1..0811659ffcd27c1befe1b5263c5b950bc500bd13 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -63,8 +63,9 @@ import org.apache.logging.log4j.Level; @@ -63,8 +63,9 @@ import org.apache.logging.log4j.Level;
@ -969,7 +930,7 @@ index a8d69168fd7aefb2ef1639ab7d57e627f0a2cd68..6a0985781a5189d80e998c3991f691c8
import org.bukkit.event.server.RemoteServerCommandEvent; import org.bukkit.event.server.RemoteServerCommandEvent;
// CraftBukkit end // CraftBukkit end
@@ -413,7 +414,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -409,7 +410,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
} }
public void handleConsoleInputs() { public void handleConsoleInputs() {
@ -978,7 +939,7 @@ index a8d69168fd7aefb2ef1639ab7d57e627f0a2cd68..6a0985781a5189d80e998c3991f691c8
while (!this.consoleInput.isEmpty()) { while (!this.consoleInput.isEmpty()) {
ConsoleInput servercommand = (ConsoleInput) this.consoleInput.remove(0); ConsoleInput servercommand = (ConsoleInput) this.consoleInput.remove(0);
@@ -428,7 +429,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -424,7 +425,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
// CraftBukkit end // CraftBukkit end
} }
@ -987,7 +948,7 @@ index a8d69168fd7aefb2ef1639ab7d57e627f0a2cd68..6a0985781a5189d80e998c3991f691c8
} }
@Override @Override
@@ -679,6 +680,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -675,6 +676,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@Override @Override
public String runCommand(String command) { public String runCommand(String command) {
@ -995,7 +956,7 @@ index a8d69168fd7aefb2ef1639ab7d57e627f0a2cd68..6a0985781a5189d80e998c3991f691c8
this.rconConsoleSource.prepareForCommand(); this.rconConsoleSource.prepareForCommand();
this.executeBlocking(() -> { this.executeBlocking(() -> {
// CraftBukkit start - fire RemoteServerCommandEvent // CraftBukkit start - fire RemoteServerCommandEvent
@@ -687,10 +689,39 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -683,10 +685,39 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
if (event.isCancelled()) { if (event.isCancelled()) {
return; return;
} }
@ -1093,7 +1054,7 @@ index ef23f9f81a909348ee4ae3d7eb51dbcc430530ca..e9a2a71b1f2bf6c701d4eba8dc31a100
} }
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index b0c46312dfb00c13421bb643dbf246610aff897b..63e11397d6efb293b140c4c4bca91e49464e8ea6 100644 index 186a8f5895fedbaf27a7949d9bdbb1a9f2e36fbf..86acdd910eebb8beac4536942119c9e97580ff2e 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -517,13 +517,15 @@ public class ServerChunkCache extends ChunkSource { @@ -517,13 +517,15 @@ public class ServerChunkCache extends ChunkSource {
@ -1185,7 +1146,7 @@ index b0c46312dfb00c13421bb643dbf246610aff897b..63e11397d6efb293b140c4c4bca91e49
} }
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 501fd02fedf1a47da28d07fd04b63f89368723ce..53280aeb1ec8088dfb34068e16fd2743c0cf86cb 100644 index 006d7ee33542fe6eba955410fc0054786662f82b..379e546faa873d4d13751e54d38942f98c0bdf35 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1,6 +1,8 @@ @@ -1,6 +1,8 @@
@ -1301,7 +1262,7 @@ index 501fd02fedf1a47da28d07fd04b63f89368723ce..53280aeb1ec8088dfb34068e16fd2743
this.entityManager.saveAll(); this.entityManager.saveAll();
} else { } else {
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index f5f2a60b0c20d64a7523a4339b14f40e15c62633..a75353e96d0e0a017e4a5dc84c04a5c594535439 100644 index 56e1886b4cf63fd1f14cd8420ccdba1271cf2d6c..e65175696d4d99225e87d79cf3e59cf2f29637e1 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -310,7 +310,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -310,7 +310,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@ -1348,7 +1309,7 @@ index f5f2a60b0c20d64a7523a4339b14f40e15c62633..a75353e96d0e0a017e4a5dc84c04a5c5
} }
// CraftBukkit end // CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 821b9c0ba003163195a461dd0bce1fa9ffd0a146..870fb4ffb01ba291d9d3aabfd722e669a477e209 100644 index 9e0c61b63cc402c26ca1306313ca6054efb108b8..dbd53de61057eb9eb8be651abf9abcad18423ab1 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
@ -1408,7 +1369,7 @@ index 277a9fc7b61361f472eae171a3546c85da4f30b4..76dc492e9c2239a09de9ead5de50abb8
protected boolean isHorizontalCollisionMinor(Vec3 adjustedMovement) { protected boolean isHorizontalCollisionMinor(Vec3 adjustedMovement) {
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
index d14757d30040c3c9030309a8bb4a37e0c9a4d8db..0c7c8b8671738d9ec408f5dc7f2950a9991858b8 100644 index cdf8020194f2ec1fe7b65b22c8e1f5b1c23eaefa..2db27f5e3e3c1bb0502c055f78c4a81eb00fcf1b 100644
--- a/src/main/java/net/minecraft/world/entity/EntityType.java --- a/src/main/java/net/minecraft/world/entity/EntityType.java
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java +++ b/src/main/java/net/minecraft/world/entity/EntityType.java
@@ -305,7 +305,14 @@ public class EntityType<T extends Entity> implements EntityTypeTest<Entity, T> { @@ -305,7 +305,14 @@ public class EntityType<T extends Entity> implements EntityTypeTest<Entity, T> {
@ -1542,7 +1503,7 @@ index ba7037a44b2fba6aafcbc4081c5c481a2cdcfd3b..c7017b86a3268aef0baff2ae0a56155a
if (!this.level.isClientSide && this.isSensitiveToWater() && this.isInWaterRainOrBubble()) { if (!this.level.isClientSide && this.isSensitiveToWater() && this.isInWaterRainOrBubble()) {
this.hurt(DamageSource.DROWN, 1.0F); this.hurt(DamageSource.DROWN, 1.0F);
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 914e42e983d56d9c85b1583f57afab699054f4d6..861ebb82ab009588809fe2c8a4f05fbdcfe6f750 100644 index 0fa91ed5ed41c944f7398a88f9352742f34d4af5..39d64f3aeb998df5452699e098148d86fdd48c98 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -83,7 +83,6 @@ import org.bukkit.Bukkit; @@ -83,7 +83,6 @@ import org.bukkit.Bukkit;
@ -1553,16 +1514,16 @@ index 914e42e983d56d9c85b1583f57afab699054f4d6..861ebb82ab009588809fe2c8a4f05fbd
import org.bukkit.craftbukkit.block.CapturedBlockState; import org.bukkit.craftbukkit.block.CapturedBlockState;
import org.bukkit.craftbukkit.block.CraftBlockState; import org.bukkit.craftbukkit.block.CraftBlockState;
import org.bukkit.craftbukkit.block.data.CraftBlockData; import org.bukkit.craftbukkit.block.data.CraftBlockData;
@@ -153,7 +152,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -157,7 +156,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
}
public final com.destroystokyo.paper.PaperWorldConfig paperConfig; // Paper // Paper end
- public final SpigotTimings.WorldTimingsHandler timings; // Spigot - public final SpigotTimings.WorldTimingsHandler timings; // Spigot
+ public final co.aikar.timings.WorldTimingsHandler timings; // Paper + public final co.aikar.timings.WorldTimingsHandler timings; // Paper
public static BlockPos lastPhysicsProblem; // Spigot public static BlockPos lastPhysicsProblem; // Spigot
private org.spigotmc.TickLimiter entityLimiter; private org.spigotmc.TickLimiter entityLimiter;
private org.spigotmc.TickLimiter tileLimiter; private org.spigotmc.TickLimiter tileLimiter;
@@ -249,7 +248,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -253,7 +252,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public void onBorderSetDamageSafeZOne(WorldBorder border, double safeZoneRadius) {} public void onBorderSetDamageSafeZOne(WorldBorder border, double safeZoneRadius) {}
}); });
// CraftBukkit end // CraftBukkit end
@ -1571,7 +1532,7 @@ index 914e42e983d56d9c85b1583f57afab699054f4d6..861ebb82ab009588809fe2c8a4f05fbd
this.entityLimiter = new org.spigotmc.TickLimiter(spigotConfig.entityMaxTickTime); this.entityLimiter = new org.spigotmc.TickLimiter(spigotConfig.entityMaxTickTime);
this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime); this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime);
} }
@@ -685,15 +684,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -689,15 +688,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
timings.tileEntityTick.stopTiming(); // Spigot timings.tileEntityTick.stopTiming(); // Spigot
this.tickingBlockEntities = false; this.tickingBlockEntities = false;
@ -1673,10 +1634,10 @@ index 98ba88896c73651591b8ad8e070868fb443ae999..864e2e0355a5fb8c1d4a5b0896ba299f
}; };
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index d3d8935bafb2e0773c96c5807ebd23f20de26592..d2267cd447a7666f4404500ccd6bde5f3b932a32 100644 index 268715e19a6fa7d26510d9d0a8f19b158835b279..c9e528c66cc2dab4895ff8b33e63d458c44cfc36 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2344,12 +2344,31 @@ public final class CraftServer implements Server { @@ -2343,12 +2343,31 @@ public final class CraftServer implements Server {
private final org.bukkit.Server.Spigot spigot = new org.bukkit.Server.Spigot() private final org.bukkit.Server.Spigot spigot = new org.bukkit.Server.Spigot()
{ {
@ -1702,7 +1663,7 @@ index d3d8935bafb2e0773c96c5807ebd23f20de26592..d2267cd447a7666f4404500ccd6bde5f
+ @Override + @Override
+ public YamlConfiguration getPaperConfig() + public YamlConfiguration getPaperConfig()
+ { + {
+ return com.destroystokyo.paper.PaperConfig.config; + return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console);
+ } + }
+ +
@Override @Override
@ -2074,7 +2035,7 @@ index e52ef47b783785dc214746b678e7b549aea9a274..3d90b3426873a3528af14f7f1ab0adae
this.value = value; this.value = value;
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 43e31362a980a4f300864321224bdf3ca92110ff..482be6fc06d034fe41ac3aab9201295f529c574f 100644 index 43e31362a980a4f300864321224bdf3ca92110ff..cf49ba1e6a8b7f62deefbbf2fc645034d5d27bef 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -217,6 +217,12 @@ public final class CraftMagicNumbers implements UnsafeValues { @@ -217,6 +217,12 @@ public final class CraftMagicNumbers implements UnsafeValues {
@ -2097,7 +2058,7 @@ index 43e31362a980a4f300864321224bdf3ca92110ff..482be6fc06d034fe41ac3aab9201295f
+ // Paper start + // Paper start
+ @Override + @Override
+ public String getTimingsServerName() { + public String getTimingsServerName() {
+ return com.destroystokyo.paper.PaperConfig.timingsServerName; + return io.papermc.paper.configuration.GlobalConfiguration.get().timings.serverName;
+ } + }
+ // Paper end + // Paper end
+ +

View File

@ -7,7 +7,7 @@ Subject: [PATCH] Add command line option to load extra plugin jars not in the
ex: java -jar paperclip.jar nogui -add-plugin=/path/to/plugin.jar -add-plugin=/path/to/another/plugin_jar.jar ex: java -jar paperclip.jar nogui -add-plugin=/path/to/plugin.jar -add-plugin=/path/to/another/plugin_jar.jar
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index b3061e6f6c2d645520cecc6cfd8f2a079a8f7f96..4764f4da6dd6a0a8d197d9ddb0a641316a2d5f2d 100644 index c9e528c66cc2dab4895ff8b33e63d458c44cfc36..7c82bce3d17ff466ea4bd157fd4961826e31ae1d 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -394,10 +394,15 @@ public final class CraftServer implements Server { @@ -394,10 +394,15 @@ public final class CraftServer implements Server {

View File

@ -6,29 +6,8 @@ Subject: [PATCH] Configurable cactus bamboo and reed growth heights
Bamboo - Both the minimum fully-grown heights and the maximum are configurable Bamboo - Both the minimum fully-grown heights and the maximum are configurable
- Machine_Maker - Machine_Maker
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 0853ff7641103447f458b2dc08076c27e3937074..3f7ec17466e4fae7139672854e2c8223ada16b76 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -101,4 +101,16 @@ public class PaperWorldConfig {
config.addDefault("world-settings.default." + path, def.stream().map(Enum::name).collect(Collectors.toList()));
return ((List<String>) (config.getList("world-settings." + worldName + "." + path, config.getList("world-settings.default." + path)))).stream().map(s -> Enum.valueOf(type, s)).collect(Collectors.toList());
}
+
+ public int cactusMaxHeight;
+ public int reedMaxHeight;
+ public int bambooMaxHeight;
+ public int bambooMinHeight;
+ private void blockGrowthHeight() {
+ cactusMaxHeight = getInt("max-growth-height.cactus", 3);
+ reedMaxHeight = getInt("max-growth-height.reeds", 3);
+ bambooMaxHeight = getInt("max-growth-height.bamboo.max", 16);
+ bambooMinHeight = getInt("max-growth-height.bamboo.min", 11);
+ log("Max height for cactus growth " + cactusMaxHeight + ". Max height for reed growth " + reedMaxHeight + ". Max height for bamboo growth " + bambooMaxHeight + ". Min height for fully-grown bamboo " + bambooMinHeight + ".");
+ }
}
diff --git a/src/main/java/net/minecraft/world/level/block/BambooBlock.java b/src/main/java/net/minecraft/world/level/block/BambooBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/BambooBlock.java b/src/main/java/net/minecraft/world/level/block/BambooBlock.java
index 4d9c6b462101dd533b0d08c40e0257e39ccbead3..081c6732e78bf732d6f2328249dc4fe8b04397b8 100644 index 4d9c6b462101dd533b0d08c40e0257e39ccbead3..4eaf778f43b67210321ffafa3da622cb4262d57b 100644
--- a/src/main/java/net/minecraft/world/level/block/BambooBlock.java --- a/src/main/java/net/minecraft/world/level/block/BambooBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/BambooBlock.java +++ b/src/main/java/net/minecraft/world/level/block/BambooBlock.java
@@ -130,7 +130,7 @@ public class BambooBlock extends Block implements BonemealableBlock { @@ -130,7 +130,7 @@ public class BambooBlock extends Block implements BonemealableBlock {
@ -36,7 +15,7 @@ index 4d9c6b462101dd533b0d08c40e0257e39ccbead3..081c6732e78bf732d6f2328249dc4fe8
int i = this.getHeightBelowUpToMax(world, pos) + 1; int i = this.getHeightBelowUpToMax(world, pos) + 1;
- if (i < 16) { - if (i < 16) {
+ if (i < world.paperConfig.bambooMaxHeight) { // Paper + if (i < world.paperConfig().maxGrowthHeight.bamboo.max) { // Paper
this.growBamboo(state, world, pos, random, i); this.growBamboo(state, world, pos, random, i);
} }
} }
@ -45,7 +24,7 @@ index 4d9c6b462101dd533b0d08c40e0257e39ccbead3..081c6732e78bf732d6f2328249dc4fe8
int j = this.getHeightBelowUpToMax(world, pos); int j = this.getHeightBelowUpToMax(world, pos);
- return i + j + 1 < 16 && (Integer) world.getBlockState(pos.above(i)).getValue(BambooBlock.STAGE) != 1; - return i + j + 1 < 16 && (Integer) world.getBlockState(pos.above(i)).getValue(BambooBlock.STAGE) != 1;
+ return i + j + 1 < ((Level) world).paperConfig.bambooMaxHeight && (Integer) world.getBlockState(pos.above(i)).getValue(BambooBlock.STAGE) != 1; // Paper + return i + j + 1 < ((Level) world).paperConfig().maxGrowthHeight.bamboo.max && (Integer) world.getBlockState(pos.above(i)).getValue(BambooBlock.STAGE) != 1; // Paper
} }
@Override @Override
@ -54,7 +33,7 @@ index 4d9c6b462101dd533b0d08c40e0257e39ccbead3..081c6732e78bf732d6f2328249dc4fe8
BlockState iblockdata1 = world.getBlockState(blockposition1); BlockState iblockdata1 = world.getBlockState(blockposition1);
- if (k >= 16 || !iblockdata1.is(Blocks.BAMBOO) || (Integer) iblockdata1.getValue(BambooBlock.STAGE) == 1 || !world.isEmptyBlock(blockposition1.above())) { // CraftBukkit - If the BlockSpreadEvent was cancelled, we have no bamboo here - if (k >= 16 || !iblockdata1.is(Blocks.BAMBOO) || (Integer) iblockdata1.getValue(BambooBlock.STAGE) == 1 || !world.isEmptyBlock(blockposition1.above())) { // CraftBukkit - If the BlockSpreadEvent was cancelled, we have no bamboo here
+ if (k >= world.paperConfig.bambooMaxHeight || !iblockdata1.is(Blocks.BAMBOO) || (Integer) iblockdata1.getValue(BambooBlock.STAGE) == 1 || !world.isEmptyBlock(blockposition1.above())) { // CraftBukkit - If the BlockSpreadEvent was cancelled, we have no bamboo here // Paper - Configurable cactus bamboo and reed growth heights + if (k >= world.paperConfig().maxGrowthHeight.bamboo.max || !iblockdata1.is(Blocks.BAMBOO) || (Integer) iblockdata1.getValue(BambooBlock.STAGE) == 1 || !world.isEmptyBlock(blockposition1.above())) { // CraftBukkit - If the BlockSpreadEvent was cancelled, we have no bamboo here // Paper - Configurable cactus bamboo and reed growth heights
return; return;
} }
@ -63,7 +42,7 @@ index 4d9c6b462101dd533b0d08c40e0257e39ccbead3..081c6732e78bf732d6f2328249dc4fe8
int j = (Integer) state.getValue(BambooBlock.AGE) != 1 && !iblockdata2.is(Blocks.BAMBOO) ? 0 : 1; int j = (Integer) state.getValue(BambooBlock.AGE) != 1 && !iblockdata2.is(Blocks.BAMBOO) ? 0 : 1;
- int k = (height < 11 || random.nextFloat() >= 0.25F) && height != 15 ? 0 : 1; - int k = (height < 11 || random.nextFloat() >= 0.25F) && height != 15 ? 0 : 1;
+ int k = (height < world.paperConfig.bambooMinHeight || random.nextFloat() >= 0.25F) && height != (world.paperConfig.bambooMaxHeight - 1) ? 0 : 1; // Paper + int k = (height < world.paperConfig().maxGrowthHeight.bamboo.min || random.nextFloat() >= 0.25F) && height != (world.paperConfig().maxGrowthHeight.bamboo.max - 1) ? 0 : 1; // Paper
// CraftBukkit start // CraftBukkit start
if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(world, pos, pos.above(), (BlockState) ((BlockState) ((BlockState) this.defaultBlockState().setValue(BambooBlock.AGE, j)).setValue(BambooBlock.LEAVES, blockpropertybamboosize)).setValue(BambooBlock.STAGE, k), 3)) { if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(world, pos, pos.above(), (BlockState) ((BlockState) ((BlockState) this.defaultBlockState().setValue(BambooBlock.AGE, j)).setValue(BambooBlock.LEAVES, blockpropertybamboosize)).setValue(BambooBlock.STAGE, k), 3)) {
@ -72,7 +51,7 @@ index 4d9c6b462101dd533b0d08c40e0257e39ccbead3..081c6732e78bf732d6f2328249dc4fe8
int i; int i;
- for (i = 0; i < 16 && world.getBlockState(pos.above(i + 1)).is(Blocks.BAMBOO); ++i) { - for (i = 0; i < 16 && world.getBlockState(pos.above(i + 1)).is(Blocks.BAMBOO); ++i) {
+ for (i = 0; i < ((Level) world).paperConfig.bambooMaxHeight && world.getBlockState(pos.above(i + 1)).is(Blocks.BAMBOO); ++i) { // Paper + for (i = 0; i < ((Level) world).paperConfig().maxGrowthHeight.bamboo.max && world.getBlockState(pos.above(i + 1)).is(Blocks.BAMBOO); ++i) { // Paper
; ;
} }
@ -81,12 +60,12 @@ index 4d9c6b462101dd533b0d08c40e0257e39ccbead3..081c6732e78bf732d6f2328249dc4fe8
int i; int i;
- for (i = 0; i < 16 && world.getBlockState(pos.below(i + 1)).is(Blocks.BAMBOO); ++i) { - for (i = 0; i < 16 && world.getBlockState(pos.below(i + 1)).is(Blocks.BAMBOO); ++i) {
+ for (i = 0; i < ((Level) world).paperConfig.bambooMaxHeight && world.getBlockState(pos.below(i + 1)).is(Blocks.BAMBOO); ++i) { // Paper + for (i = 0; i < ((Level) world).paperConfig().maxGrowthHeight.bamboo.max && world.getBlockState(pos.below(i + 1)).is(Blocks.BAMBOO); ++i) { // Paper
; ;
} }
diff --git a/src/main/java/net/minecraft/world/level/block/CactusBlock.java b/src/main/java/net/minecraft/world/level/block/CactusBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/CactusBlock.java b/src/main/java/net/minecraft/world/level/block/CactusBlock.java
index 3b4be44e4204435a360bc224a9b2651952dedf02..0d255201ebce3bb495a4e086da5e4d9195cbc091 100644 index 3b4be44e4204435a360bc224a9b2651952dedf02..cb3d26af146859b87fc471174f8f63dfe7caa5fd 100644
--- a/src/main/java/net/minecraft/world/level/block/CactusBlock.java --- a/src/main/java/net/minecraft/world/level/block/CactusBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/CactusBlock.java +++ b/src/main/java/net/minecraft/world/level/block/CactusBlock.java
@@ -55,7 +55,7 @@ public class CactusBlock extends Block { @@ -55,7 +55,7 @@ public class CactusBlock extends Block {
@ -94,12 +73,12 @@ index 3b4be44e4204435a360bc224a9b2651952dedf02..0d255201ebce3bb495a4e086da5e4d91
} }
- if (i < 3) { - if (i < 3) {
+ if (i < world.paperConfig.cactusMaxHeight) { // Paper - Configurable growth height + if (i < world.paperConfig().maxGrowthHeight.cactus) { // Paper - Configurable growth height
int j = (Integer) state.getValue(CactusBlock.AGE); int j = (Integer) state.getValue(CactusBlock.AGE);
if (j >= (byte) range(3, ((100.0F / world.spigotConfig.cactusModifier) * 15) + 0.5F, 15)) { // Spigot if (j >= (byte) range(3, ((100.0F / world.spigotConfig.cactusModifier) * 15) + 0.5F, 15)) { // Spigot
diff --git a/src/main/java/net/minecraft/world/level/block/SugarCaneBlock.java b/src/main/java/net/minecraft/world/level/block/SugarCaneBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/SugarCaneBlock.java b/src/main/java/net/minecraft/world/level/block/SugarCaneBlock.java
index e5956a2a68f168a4c08c6c409ae7b288eb792660..3c893c7b1cdb56e527553f07c2bd8ba4b6707b77 100644 index e5956a2a68f168a4c08c6c409ae7b288eb792660..5554889adbade3af627b11348e9cc04191bfea36 100644
--- a/src/main/java/net/minecraft/world/level/block/SugarCaneBlock.java --- a/src/main/java/net/minecraft/world/level/block/SugarCaneBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/SugarCaneBlock.java +++ b/src/main/java/net/minecraft/world/level/block/SugarCaneBlock.java
@@ -52,7 +52,7 @@ public class SugarCaneBlock extends Block { @@ -52,7 +52,7 @@ public class SugarCaneBlock extends Block {
@ -107,7 +86,7 @@ index e5956a2a68f168a4c08c6c409ae7b288eb792660..3c893c7b1cdb56e527553f07c2bd8ba4
} }
- if (i < 3) { - if (i < 3) {
+ if (i < world.paperConfig.reedMaxHeight) { // Paper - Configurable growth height + if (i < world.paperConfig().maxGrowthHeight.reeds) { // Paper - Configurable growth height
int j = (Integer) state.getValue(SugarCaneBlock.AGE); int j = (Integer) state.getValue(SugarCaneBlock.AGE);
if (j >= (byte) range(3, ((100.0F / world.spigotConfig.caneModifier) * 15) + 0.5F, 15)) { // Spigot if (j >= (byte) range(3, ((100.0F / world.spigotConfig.caneModifier) * 15) + 0.5F, 15)) { // Spigot

View File

@ -4,40 +4,19 @@ Date: Tue, 1 Mar 2016 13:09:16 -0600
Subject: [PATCH] Configurable baby zombie movement speed Subject: [PATCH] Configurable baby zombie movement speed
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 3f7ec17466e4fae7139672854e2c8223ada16b76..4d787f0596be1a44724ade309cc00e115778a797 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -113,4 +113,15 @@ public class PaperWorldConfig {
bambooMinHeight = getInt("max-growth-height.bamboo.min", 11);
log("Max height for cactus growth " + cactusMaxHeight + ". Max height for reed growth " + reedMaxHeight + ". Max height for bamboo growth " + bambooMaxHeight + ". Min height for fully-grown bamboo " + bambooMinHeight + ".");
}
+
+ public double babyZombieMovementModifier;
+ private void babyZombieMovementModifier() {
+ babyZombieMovementModifier = getDouble("baby-zombie-movement-modifier", 0.5D);
+ if (PaperConfig.version < 20) {
+ babyZombieMovementModifier = getDouble("baby-zombie-movement-speed", 0.5D);
+ set("baby-zombie-movement-modifier", babyZombieMovementModifier);
+ }
+
+ log("Baby zombies will move at the speed of " + babyZombieMovementModifier);
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
index ee91459775aada8cc2e5c4403436b11c15e8e674..cf80a2592e923967fa440f8c383a9dc977177638 100644 index ee91459775aada8cc2e5c4403436b11c15e8e674..1b48576beca178af14bfab297bd427b5f5bdaf42 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java --- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java +++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
@@ -76,7 +76,7 @@ import org.bukkit.event.entity.EntityTransformEvent; @@ -77,6 +77,7 @@ public class Zombie extends Monster {
public class Zombie extends Monster {
private static final UUID SPEED_MODIFIER_BABY_UUID = UUID.fromString("B9766B59-9566-4402-BC1F-2EE2A276D836"); private static final UUID SPEED_MODIFIER_BABY_UUID = UUID.fromString("B9766B59-9566-4402-BC1F-2EE2A276D836");
- private static final AttributeModifier SPEED_MODIFIER_BABY = new AttributeModifier(Zombie.SPEED_MODIFIER_BABY_UUID, "Baby speed boost", 0.5D, AttributeModifier.Operation.MULTIPLY_BASE); private static final AttributeModifier SPEED_MODIFIER_BABY = new AttributeModifier(Zombie.SPEED_MODIFIER_BABY_UUID, "Baby speed boost", 0.5D, AttributeModifier.Operation.MULTIPLY_BASE);
+ private final AttributeModifier SPEED_MODIFIER_BABY = new AttributeModifier(Zombie.SPEED_MODIFIER_BABY_UUID, "Baby speed boost", 0.5D, AttributeModifier.Operation.MULTIPLY_BASE); private final AttributeModifier babyModifier = this.SPEED_MODIFIER_BABY; // Paper - remove static - Make baby speed configurable + private final AttributeModifier babyModifier = new net.minecraft.world.entity.ai.attributes.AttributeModifier(SPEED_MODIFIER_BABY.getId(), SPEED_MODIFIER_BABY.getName(), this.level.paperConfig().entities.behavior.babyZombieMovementModifier, SPEED_MODIFIER_BABY.getOperation()); // Paper - Make baby speed configurable
private static final EntityDataAccessor<Boolean> DATA_BABY_ID = SynchedEntityData.defineId(Zombie.class, EntityDataSerializers.BOOLEAN); private static final EntityDataAccessor<Boolean> DATA_BABY_ID = SynchedEntityData.defineId(Zombie.class, EntityDataSerializers.BOOLEAN);
private static final EntityDataAccessor<Integer> DATA_SPECIAL_TYPE_ID = SynchedEntityData.defineId(Zombie.class, EntityDataSerializers.INT); private static final EntityDataAccessor<Integer> DATA_SPECIAL_TYPE_ID = SynchedEntityData.defineId(Zombie.class, EntityDataSerializers.INT);
public static final EntityDataAccessor<Boolean> DATA_DROWNED_CONVERSION_ID = SynchedEntityData.defineId(Zombie.class, EntityDataSerializers.BOOLEAN); public static final EntityDataAccessor<Boolean> DATA_DROWNED_CONVERSION_ID = SynchedEntityData.defineId(Zombie.class, EntityDataSerializers.BOOLEAN);
@@ -184,9 +184,9 @@ public class Zombie extends Monster { @@ -184,9 +185,9 @@ public class Zombie extends Monster {
if (this.level != null && !this.level.isClientSide) { if (this.level != null && !this.level.isClientSide) {
AttributeInstance attributemodifiable = this.getAttribute(Attributes.MOVEMENT_SPEED); AttributeInstance attributemodifiable = this.getAttribute(Attributes.MOVEMENT_SPEED);

View File

@ -4,25 +4,8 @@ Date: Tue, 1 Mar 2016 13:14:11 -0600
Subject: [PATCH] Configurable fishing time ranges Subject: [PATCH] Configurable fishing time ranges
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 4d787f0596be1a44724ade309cc00e115778a797..4b9122a3e094aa9e0a789f35fb6b0f9a7a53f772 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -124,4 +124,12 @@ public class PaperWorldConfig {
log("Baby zombies will move at the speed of " + babyZombieMovementModifier);
}
+
+ public int fishingMinTicks;
+ public int fishingMaxTicks;
+ private void fishingTickRange() {
+ fishingMinTicks = getInt("fishing-time-range.MinimumTicks", 100);
+ fishingMaxTicks = getInt("fishing-time-range.MaximumTicks", 600);
+ log("Fishing time ranges are between " + fishingMinTicks +" and " + fishingMaxTicks + " ticks");
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java diff --git a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
index 792d85ea46d392a27ac89c42e037dc90d33fad7f..91fde59289100133a4f473bee176ff1b6805faae 100644 index 792d85ea46d392a27ac89c42e037dc90d33fad7f..00fe96650e4d973e97b46968297f55f4c3674629 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java --- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java +++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
@@ -85,6 +85,10 @@ public class FishingHook extends Projectile { @@ -85,6 +85,10 @@ public class FishingHook extends Projectile {
@ -30,8 +13,8 @@ index 792d85ea46d392a27ac89c42e037dc90d33fad7f..91fde59289100133a4f473bee176ff1b
this.luck = Math.max(0, luckOfTheSeaLevel); this.luck = Math.max(0, luckOfTheSeaLevel);
this.lureSpeed = Math.max(0, lureLevel); this.lureSpeed = Math.max(0, lureLevel);
+ // Paper start + // Paper start
+ minWaitTime = world.paperConfig.fishingMinTicks; + minWaitTime = world.paperConfig().fishingTimeRange.minimum;
+ maxWaitTime = world.paperConfig.fishingMaxTicks; + maxWaitTime = world.paperConfig().fishingTimeRange.maximum;
+ // Paper end + // Paper end
} }

View File

@ -4,32 +4,6 @@ Date: Tue, 1 Mar 2016 13:24:16 -0600
Subject: [PATCH] Allow nerfed mobs to jump and take water damage Subject: [PATCH] Allow nerfed mobs to jump and take water damage
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 4b9122a3e094aa9e0a789f35fb6b0f9a7a53f772..d2ac0123812224181afae8fca96058ddc8cdff1e 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -132,4 +132,9 @@ public class PaperWorldConfig {
fishingMaxTicks = getInt("fishing-time-range.MaximumTicks", 600);
log("Fishing time ranges are between " + fishingMinTicks +" and " + fishingMaxTicks + " ticks");
}
+
+ public boolean nerfedMobsShouldJump;
+ private void nerfedMobsShouldJump() {
+ nerfedMobsShouldJump = getBoolean("spawner-nerfed-mobs-should-jump", false);
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 76dc492e9c2239a09de9ead5de50abb86a97f452..4b55e1a3b373f141f60f4ba392abeda37d2364e0 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1296,6 +1296,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
return this.isInWater() || this.isInRain();
}
+ @Deprecated public final boolean isInWaterOrRainOrBubble() { return isInWaterRainOrBubble(); } // Paper - OBFHELPER
public boolean isInWaterRainOrBubble() {
return this.isInWater() || this.isInRain() || this.isInBubbleColumn();
}
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index decf753d088983ef6bbf32a32a6ee8d3cca3ee69..4f58fae1b3738e7e0507a46df275a258c94fcec4 100644 index decf753d088983ef6bbf32a32a6ee8d3cca3ee69..4f58fae1b3738e7e0507a46df275a258c94fcec4 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java --- a/src/main/java/net/minecraft/world/entity/Mob.java
@ -62,14 +36,14 @@ index decf753d088983ef6bbf32a32a6ee8d3cca3ee69..4f58fae1b3738e7e0507a46df275a258
this.sensing.tick(); this.sensing.tick();
this.level.getProfiler().pop(); this.level.getProfiler().pop();
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/FloatGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/FloatGoal.java diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/FloatGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/FloatGoal.java
index 01950951ea06e43bedeeede489a112e577617829..0e86eb2595cf9fbf24f789e0e9b4f05929d3164c 100644 index 01950951ea06e43bedeeede489a112e577617829..7093c62be53fe99ed9880fc8ddaa07440fe4f715 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/FloatGoal.java --- a/src/main/java/net/minecraft/world/entity/ai/goal/FloatGoal.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/FloatGoal.java +++ b/src/main/java/net/minecraft/world/entity/ai/goal/FloatGoal.java
@@ -9,6 +9,7 @@ public class FloatGoal extends Goal { @@ -9,6 +9,7 @@ public class FloatGoal extends Goal {
public FloatGoal(Mob mob) { public FloatGoal(Mob mob) {
this.mob = mob; this.mob = mob;
+ if (mob.getCommandSenderWorld().paperConfig.nerfedMobsShouldJump) mob.goalFloat = this; // Paper + if (mob.getCommandSenderWorld().paperConfig().entities.behavior.spawnerNerfedMobsShouldJump) mob.goalFloat = this; // Paper
this.setFlags(EnumSet.of(Goal.Flag.JUMP)); this.setFlags(EnumSet.of(Goal.Flag.JUMP));
mob.getNavigation().setCanFloat(true); mob.getNavigation().setCanFloat(true);
} }

View File

@ -4,68 +4,8 @@ Date: Tue, 1 Mar 2016 13:51:54 -0600
Subject: [PATCH] Add configurable despawn distances for living entities Subject: [PATCH] Add configurable despawn distances for living entities
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index d2ac0123812224181afae8fca96058ddc8cdff1e..3afadc8d916714398974d77aa0f1093729e008ca 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -3,6 +3,9 @@ package com.destroystokyo.paper;
import java.util.List;
import java.util.stream.Collectors;
+import it.unimi.dsi.fastutil.objects.Reference2IntMap;
+import it.unimi.dsi.fastutil.objects.Reference2IntOpenHashMap;
+import net.minecraft.world.entity.MobCategory;
import org.bukkit.Bukkit;
import org.bukkit.configuration.file.YamlConfiguration;
import org.spigotmc.SpigotWorldConfig;
@@ -46,6 +49,13 @@ public class PaperWorldConfig {
public void removeOldValues() {
boolean needsSave = false;
+ if (PaperConfig.version < 24) {
+ needsSave = true;
+
+ set("despawn-ranges.soft", null);
+ set("despawn-ranges.hard", null);
+ }
+
if (needsSave) {
saveConfig();
}
@@ -137,4 +147,31 @@ public class PaperWorldConfig {
private void nerfedMobsShouldJump() {
nerfedMobsShouldJump = getBoolean("spawner-nerfed-mobs-should-jump", false);
}
+
+ public final Reference2IntMap<MobCategory> softDespawnDistances = new Reference2IntOpenHashMap<>(MobCategory.values().length);
+ public final Reference2IntMap<MobCategory> hardDespawnDistances = new Reference2IntOpenHashMap<>(MobCategory.values().length);
+ private void despawnDistances() {
+ if (PaperConfig.version < 24) {
+ int softDistance = getInt("despawn-ranges.soft", 32, false); // 32^2 = 1024, Minecraft Default
+ int hardDistance = getInt("despawn-ranges.hard", 128, false); // 128^2 = 16384, Minecraft Default
+ for (MobCategory value : MobCategory.values()) {
+ if (softDistance != 32) {
+ softDespawnDistances.put(value, softDistance);
+ }
+ if (hardDistance != 128) {
+ hardDespawnDistances.put(value, hardDistance);
+ }
+ }
+ }
+ for (MobCategory category : MobCategory.values()) {
+ int softDistance = getInt("despawn-ranges." + category.getName() + ".soft", softDespawnDistances.getOrDefault(category, category.getNoDespawnDistance()));
+ int hardDistance = getInt("despawn-ranges." + category.getName() + ".hard", hardDespawnDistances.getOrDefault(category, category.getDespawnDistance()));
+ if (softDistance > hardDistance) {
+ softDistance = hardDistance;
+ }
+ log("Mobs in " + category.getName() + " Despawn Ranges: Soft" + softDistance + " Hard: " + hardDistance);
+ softDespawnDistances.put(category, softDistance);
+ hardDespawnDistances.put(category, hardDistance);
+ }
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index 4f58fae1b3738e7e0507a46df275a258c94fcec4..88b021b7d1b71bd3fa64b54ca0fd52fef93ea9f0 100644 index 4f58fae1b3738e7e0507a46df275a258c94fcec4..854653b2481ebe3a04f671ef0af2aecf3093fc0b 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java --- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -788,14 +788,14 @@ public abstract class Mob extends LivingEntity { @@ -788,14 +788,14 @@ public abstract class Mob extends LivingEntity {
@ -73,7 +13,7 @@ index 4f58fae1b3738e7e0507a46df275a258c94fcec4..88b021b7d1b71bd3fa64b54ca0fd52fe
if (entityhuman != null) { if (entityhuman != null) {
double d0 = entityhuman.distanceToSqr((Entity) this); double d0 = entityhuman.distanceToSqr((Entity) this);
- int i = this.getType().getCategory().getDespawnDistance(); - int i = this.getType().getCategory().getDespawnDistance();
+ int i = this.level.paperConfig.hardDespawnDistances.getInt(this.getType().getCategory()); // Paper - custom despawn distances + int i = this.level.paperConfig().entities.spawning.despawnRanges.get(this.getType().getCategory()).hard(); // Paper - custom despawn distances
int j = i * i; int j = i * i;
if (d0 > (double) j && this.removeWhenFarAway(d0)) { if (d0 > (double) j && this.removeWhenFarAway(d0)) {
@ -81,7 +21,7 @@ index 4f58fae1b3738e7e0507a46df275a258c94fcec4..88b021b7d1b71bd3fa64b54ca0fd52fe
} }
- int k = this.getType().getCategory().getNoDespawnDistance(); - int k = this.getType().getCategory().getNoDespawnDistance();
+ int k = this.level.paperConfig.softDespawnDistances.getInt(this.getType().getCategory()); // Paper - custom despawn distances + int k = this.level.paperConfig().entities.spawning.despawnRanges.get(this.getType().getCategory()).soft(); // Paper - custom despawn distances
int l = k * k; int l = k * k;
if (this.noActionTime > 600 && this.random.nextInt(800) == 0 && d0 > (double) l && this.removeWhenFarAway(d0)) { if (this.noActionTime > 600 && this.random.nextInt(800) == 0 && d0 > (double) l && this.removeWhenFarAway(d0)) {

View File

@ -4,30 +4,15 @@ Date: Thu, 3 Mar 2016 03:53:43 -0600
Subject: [PATCH] Allow for toggling of spawn chunks Subject: [PATCH] Allow for toggling of spawn chunks
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 3afadc8d916714398974d77aa0f1093729e008ca..f32726275d18772904883b618be66893ca5d84fd 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -174,4 +174,10 @@ public class PaperWorldConfig {
hardDespawnDistances.put(category, hardDistance);
}
}
+
+ public boolean keepSpawnInMemory;
+ private void keepSpawnInMemory() {
+ keepSpawnInMemory = getBoolean("keep-spawn-loaded", true);
+ log("Keep spawn chunk loaded: " + keepSpawnInMemory);
+ }
}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 861ebb82ab009588809fe2c8a4f05fbdcfe6f750..efdab784bdec183425a6bc7f376f528c38a94752 100644 index edf7448e197a2563dd62e4c24b29c139becccaca..5cc0546926ca1403aa325344fc138265f923fe1e 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -249,6 +249,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -253,6 +253,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
}); });
// CraftBukkit end // CraftBukkit end
timings = new co.aikar.timings.WorldTimingsHandler(this); // Paper - code below can generate new world and access timings timings = new co.aikar.timings.WorldTimingsHandler(this); // Paper - code below can generate new world and access timings
+ this.keepSpawnInMemory = this.paperConfig.keepSpawnInMemory; // Paper + this.keepSpawnInMemory = this.paperConfig().spawn.keepSpawnLoaded; // Paper
this.entityLimiter = new org.spigotmc.TickLimiter(spigotConfig.entityMaxTickTime); this.entityLimiter = new org.spigotmc.TickLimiter(spigotConfig.entityMaxTickTime);
this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime); this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime);
} }

View File

@ -5,27 +5,8 @@ Subject: [PATCH] Drop falling block and tnt entities at the specified height
* Dec 2, 2020 Added tnt nerf for tnt minecarts - Machine_Maker * Dec 2, 2020 Added tnt nerf for tnt minecarts - Machine_Maker
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index f32726275d18772904883b618be66893ca5d84fd..b41f6074e0d88b6becb5b931fc4ee94a1f9f2f0b 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -180,4 +180,14 @@ public class PaperWorldConfig {
keepSpawnInMemory = getBoolean("keep-spawn-loaded", true);
log("Keep spawn chunk loaded: " + keepSpawnInMemory);
}
+
+ public int fallingBlockHeightNerf;
+ public int entityTNTHeightNerf;
+ private void heightNerfs() {
+ fallingBlockHeightNerf = getInt("falling-block-height-nerf", 0);
+ entityTNTHeightNerf = getInt("tnt-entity-height-nerf", 0);
+
+ if (fallingBlockHeightNerf != 0) log("Falling Block Height Limit set to Y: " + fallingBlockHeightNerf);
+ if (entityTNTHeightNerf != 0) log("TNT Entity Height Limit set to Y: " + entityTNTHeightNerf);
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
index 7e1594e8df4fd09cd1aecbc5f3784797b04a8337..26ab6d0c98560e4dfebbad3482fd308861818e30 100644 index 7e1594e8df4fd09cd1aecbc5f3784797b04a8337..bd357c3e6fcbd82f3c53ecc8dab46aa5d3708bc2 100644
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java --- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
@@ -137,6 +137,17 @@ public class FallingBlockEntity extends Entity { @@ -137,6 +137,17 @@ public class FallingBlockEntity extends Entity {
@ -34,7 +15,7 @@ index 7e1594e8df4fd09cd1aecbc5f3784797b04a8337..26ab6d0c98560e4dfebbad3482fd3088
this.move(MoverType.SELF, this.getDeltaMovement()); this.move(MoverType.SELF, this.getDeltaMovement());
+ +
+ // Paper start - Configurable EntityFallingBlock height nerf + // Paper start - Configurable EntityFallingBlock height nerf
+ if (this.level.paperConfig.fallingBlockHeightNerf != 0 && this.getY() > this.level.paperConfig.fallingBlockHeightNerf) { + if (this.level.paperConfig().fixes.fallingBlockHeightNerf != 0 && this.getY() > this.level.paperConfig().fixes.fallingBlockHeightNerf) {
+ if (this.dropItem && this.level.getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) { + if (this.dropItem && this.level.getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) {
+ this.spawnAtLocation(block); + this.spawnAtLocation(block);
+ } + }
@ -47,7 +28,7 @@ index 7e1594e8df4fd09cd1aecbc5f3784797b04a8337..26ab6d0c98560e4dfebbad3482fd3088
BlockPos blockposition = this.blockPosition(); BlockPos blockposition = this.blockPosition();
boolean flag = this.blockState.getBlock() instanceof ConcretePowderBlock; boolean flag = this.blockState.getBlock() instanceof ConcretePowderBlock;
diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
index e24b46820394c5f220d5bf7c4e763ef95ff9e9ab..bbe15c66917781a8b6950307449f0243ffc3c8c7 100644 index e24b46820394c5f220d5bf7c4e763ef95ff9e9ab..2d4a990da2402a6c24c03e8be7e518e33db99c8f 100644
--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java --- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java +++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
@@ -68,6 +68,12 @@ public class PrimedTnt extends Entity { @@ -68,6 +68,12 @@ public class PrimedTnt extends Entity {
@ -55,7 +36,7 @@ index e24b46820394c5f220d5bf7c4e763ef95ff9e9ab..bbe15c66917781a8b6950307449f0243
this.move(MoverType.SELF, this.getDeltaMovement()); this.move(MoverType.SELF, this.getDeltaMovement());
+ // Paper start - Configurable TNT entity height nerf + // Paper start - Configurable TNT entity height nerf
+ if (this.level.paperConfig.entityTNTHeightNerf != 0 && this.getY() > this.level.paperConfig.entityTNTHeightNerf) { + if (this.level.paperConfig().fixes.tntEntityHeightNerf != 0 && this.getY() > this.level.paperConfig().fixes.tntEntityHeightNerf) {
+ this.discard(); + this.discard();
+ return; + return;
+ } + }
@ -64,7 +45,7 @@ index e24b46820394c5f220d5bf7c4e763ef95ff9e9ab..bbe15c66917781a8b6950307449f0243
if (this.onGround) { if (this.onGround) {
this.setDeltaMovement(this.getDeltaMovement().multiply(0.7D, -0.5D, 0.7D)); this.setDeltaMovement(this.getDeltaMovement().multiply(0.7D, -0.5D, 0.7D));
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/MinecartTNT.java b/src/main/java/net/minecraft/world/entity/vehicle/MinecartTNT.java diff --git a/src/main/java/net/minecraft/world/entity/vehicle/MinecartTNT.java b/src/main/java/net/minecraft/world/entity/vehicle/MinecartTNT.java
index c10c28eb441e65c6285c25b5d4760c876909c724..469dbae2e04a9ded9e46a576b2e1b020801c1395 100644 index c10c28eb441e65c6285c25b5d4760c876909c724..136bd0168b573079dfad127d02ca8ba72c02fafb 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/MinecartTNT.java --- a/src/main/java/net/minecraft/world/entity/vehicle/MinecartTNT.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/MinecartTNT.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/MinecartTNT.java
@@ -46,6 +46,12 @@ public class MinecartTNT extends AbstractMinecart { @@ -46,6 +46,12 @@ public class MinecartTNT extends AbstractMinecart {
@ -72,7 +53,7 @@ index c10c28eb441e65c6285c25b5d4760c876909c724..469dbae2e04a9ded9e46a576b2e1b020
super.tick(); super.tick();
if (this.fuse > 0) { if (this.fuse > 0) {
+ // Paper start - Configurable TNT entity height nerf + // Paper start - Configurable TNT entity height nerf
+ if (this.level.paperConfig.entityTNTHeightNerf != 0 && this.getY() > this.level.paperConfig.entityTNTHeightNerf) { + if (this.level.paperConfig().fixes.tntEntityHeightNerf != 0 && this.getY() > this.level.paperConfig().fixes.tntEntityHeightNerf) {
+ this.discard(); + this.discard();
+ return; + return;
+ } + }

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/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 9be29fbb97aced80da8adb693521a8bd870870c5..bd549661ccfb29b9a4f9d69956c549ba3e888e31 100644 index 1190d62594c5b1be1c11d55e646ee0bac27307cb..c38cfd4781911db0fe191412f089c55cc4e40f2a 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1414,7 +1414,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1415,7 +1415,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@DontObfuscate @DontObfuscate
public String getServerModName() { public String getServerModName() {
@ -19,7 +19,7 @@ index 9be29fbb97aced80da8adb693521a8bd870870c5..bd549661ccfb29b9a4f9d69956c549ba
public SystemReport fillSystemReport(SystemReport details) { public SystemReport fillSystemReport(SystemReport details) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 4764f4da6dd6a0a8d197d9ddb0a641316a2d5f2d..93947c982c40be873bd1f3273ca69dbdf6820aeb 100644 index 7c82bce3d17ff466ea4bd157fd4961826e31ae1d..fe2eaed213c3f816b23fb4debb4f8c508e76fb0d 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -241,7 +241,7 @@ import org.yaml.snakeyaml.error.MarkedYAMLException; @@ -241,7 +241,7 @@ import org.yaml.snakeyaml.error.MarkedYAMLException;

View File

@ -140,12 +140,12 @@ index 0000000000000000000000000000000000000000..351159bbdb0c8045f4983f54dee34430
+ } + }
+} +}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 482be6fc06d034fe41ac3aab9201295f529c574f..0c040073b004fdbb2daa8e9d2aebdfffad405397 100644 index cf49ba1e6a8b7f62deefbbf2fc645034d5d27bef..8fc00b0ad230d9e7ae8dd73927b61116f73f7b4b 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -421,6 +421,11 @@ public final class CraftMagicNumbers implements UnsafeValues { @@ -421,6 +421,11 @@ public final class CraftMagicNumbers implements UnsafeValues {
public String getTimingsServerName() { public String getTimingsServerName() {
return com.destroystokyo.paper.PaperConfig.timingsServerName; return io.papermc.paper.configuration.GlobalConfiguration.get().timings.serverName;
} }
+ +
+ @Override + @Override

View File

@ -201,13 +201,13 @@ index 0000000000000000000000000000000000000000..aac3f66cb23d260729c2a48d8710a9de
+ } + }
+} +}
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 6a0985781a5189d80e998c3991f691c8d8debfb4..9e7fb3e2d423ba1db22819aa8b666ca886d98cf6 100644 index 0811659ffcd27c1befe1b5263c5b950bc500bd13..f9de28e8d4d6a8b2e59d881c07d8626f427611a3 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -197,6 +197,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -193,6 +193,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
return false; paperConfigurations.initializeGlobalConfiguration();
} paperConfigurations.initializeWorldDefaultsConfiguration();
com.destroystokyo.paper.PaperConfig.registerCommands(); io.papermc.paper.configuration.PaperConfigurations.registerCommands(this);
+ com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // load version history now + com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // load version history now
// Paper end // Paper end

View File

@ -21,7 +21,7 @@ index 5c3b11f738c1ea19981cc878aa6c2323497391a0..b91a61be7c4829fce0ff8da290eab580
public static Predicate<Entity> withinDistance(double x, double y, double z, double max) { public static Predicate<Entity> withinDistance(double x, double y, double z, double max) {
double d4 = max * max; double d4 = max * max;
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index 88b021b7d1b71bd3fa64b54ca0fd52fef93ea9f0..7827e40e824de85ae1f6ea6fc82455b2cea532cb 100644 index 854653b2481ebe3a04f671ef0af2aecf3093fc0b..c09f1ac470c4055897f8d6c6201bd8dc421cdbfe 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java --- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -784,7 +784,7 @@ public abstract class Mob extends LivingEntity { @@ -784,7 +784,7 @@ public abstract class Mob extends LivingEntity {
@ -117,7 +117,7 @@ index 7c5918f84d2b8f9c778258b7e7d745105effb082..cfb286020b8ee87bad7edbda4cd0b999
for(Player player : this.players()) { for(Player player : this.players()) {
if (EntitySelector.NO_SPECTATORS.test(player) && EntitySelector.LIVING_ENTITY_STILL_ALIVE.test(player)) { if (EntitySelector.NO_SPECTATORS.test(player) && EntitySelector.LIVING_ENTITY_STILL_ALIVE.test(player)) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index f43a728eba966992831d040a0ed96f5720d8d15c..ab9880eb5a7db6951cee329656c06e9e956ec2ad 100644 index fcff5e05818c81f72cb6e0f83a683c2bb3979737..d4c5e032c1c3e79c84ab99d7f90417e2b4c673df 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1958,8 +1958,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1958,8 +1958,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -12,7 +12,7 @@ Previous implementation did not calculate TPS correctly.
Switch to a realistic rolling average and factor in std deviation as an extra reporting variable 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 diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index bd549661ccfb29b9a4f9d69956c549ba3e888e31..39a079ce407081ba1ff13c23cfbeeab9c5a78e07 100644 index c38cfd4781911db0fe191412f089c55cc4e40f2a..8cc5b6bbe2d8cbeb72e88b9e08e87fbbb98a6f8a 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -267,7 +267,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -267,7 +267,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@ -32,8 +32,8 @@ index bd549661ccfb29b9a4f9d69956c549ba3e888e31..39a079ce407081ba1ff13c23cfbeeab9
+ private static final int SAMPLE_INTERVAL = 20; // Paper + private static final int SAMPLE_INTERVAL = 20; // Paper
public final double[] recentTps = new double[ 3 ]; public final double[] recentTps = new double[ 3 ];
// Spigot end // Spigot end
public static long currentTickLong = 0L; // Paper public final io.papermc.paper.configuration.PaperConfigurations paperConfigurations;
@@ -960,6 +960,57 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -961,6 +961,57 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
{ {
return ( avg * exp ) + ( tps * ( 1 - exp ) ); return ( avg * exp ) + ( tps * ( 1 - exp ) );
} }
@ -91,7 +91,7 @@ index bd549661ccfb29b9a4f9d69956c549ba3e888e31..39a079ce407081ba1ff13c23cfbeeab9
// Spigot End // Spigot End
protected void runServer() { protected void runServer() {
@@ -976,26 +1027,33 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -977,26 +1028,33 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Spigot start // Spigot start
Arrays.fill( recentTps, 20 ); Arrays.fill( recentTps, 20 );
@ -133,7 +133,7 @@ index bd549661ccfb29b9a4f9d69956c549ba3e888e31..39a079ce407081ba1ff13c23cfbeeab9
tickSection = curTime; tickSection = curTime;
} }
// Spigot end // Spigot end
@@ -1005,7 +1063,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1006,7 +1064,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.debugCommandProfiler = new MinecraftServer.TimeProfiler(Util.getNanos(), this.tickCount); this.debugCommandProfiler = new MinecraftServer.TimeProfiler(Util.getNanos(), this.tickCount);
} }
@ -144,10 +144,10 @@ index bd549661ccfb29b9a4f9d69956c549ba3e888e31..39a079ce407081ba1ff13c23cfbeeab9
this.startMetricsRecordingTick(); this.startMetricsRecordingTick();
this.profiler.push("tick"); this.profiler.push("tick");
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 6a35ff1c7d7b59b8dae8bbae2f2133f74d00e35b..24ede23d6cb432c0f842ce076ce592ef8c089a85 100644 index fe2eaed213c3f816b23fb4debb4f8c508e76fb0d..e700b38d8884f4228a8925f07c4cf1500dbdfa20 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2374,6 +2374,17 @@ public final class CraftServer implements Server { @@ -2373,6 +2373,17 @@ public final class CraftServer implements Server {
return CraftMagicNumbers.INSTANCE; return CraftMagicNumbers.INSTANCE;
} }

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Only refresh abilities if needed
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index ab9880eb5a7db6951cee329656c06e9e956ec2ad..9a2a6e9ba09f4f6347926579ad5f803de4a6033f 100644 index d4c5e032c1c3e79c84ab99d7f90417e2b4c673df..7df667b54478d5e415cf6872984db33981b8e4f9 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1627,12 +1627,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1627,12 +1627,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Entity Origin API
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 53280aeb1ec8088dfb34068e16fd2743c0cf86cb..53213d0c2d1b402f28a2da315d18c46deba509bf 100644 index e11dd9c191b25aa29d4052e2c7479749f7e54958..39737b5ac7d4a16527196600965a8b617502c027 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2105,6 +2105,15 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -2105,6 +2105,15 @@ public class ServerLevel extends Level implements WorldGenLevel {
@ -25,7 +25,7 @@ index 53280aeb1ec8088dfb34068e16fd2743c0cf86cb..53213d0c2d1b402f28a2da315d18c46d
public void onTrackingEnd(Entity entity) { public void onTrackingEnd(Entity entity) {
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 4b55e1a3b373f141f60f4ba392abeda37d2364e0..9c967df2e9cb7102ec2d6e4f02971f3342295b5a 100644 index 76dc492e9c2239a09de9ead5de50abb86a97f452..96864858f28337a6807cfa255b6b607bdbd337ce 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -303,7 +303,27 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -303,7 +303,27 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@ -56,7 +56,7 @@ index 4b55e1a3b373f141f60f4ba392abeda37d2364e0..9c967df2e9cb7102ec2d6e4f02971f33
public float getBukkitYaw() { public float getBukkitYaw() {
return this.yRot; return this.yRot;
} }
@@ -1852,6 +1872,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -1851,6 +1871,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
this.bukkitEntity.storeBukkitValues(nbt); this.bukkitEntity.storeBukkitValues(nbt);
} }
// CraftBukkit end // CraftBukkit end
@ -72,7 +72,7 @@ index 4b55e1a3b373f141f60f4ba392abeda37d2364e0..9c967df2e9cb7102ec2d6e4f02971f33
return nbt; return nbt;
} catch (Throwable throwable) { } catch (Throwable throwable) {
CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT"); CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT");
@@ -1976,6 +2005,20 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -1975,6 +2004,20 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
} }
// CraftBukkit end // CraftBukkit end
@ -94,7 +94,7 @@ index 4b55e1a3b373f141f60f4ba392abeda37d2364e0..9c967df2e9cb7102ec2d6e4f02971f33
CrashReport crashreport = CrashReport.forThrowable(throwable, "Loading entity NBT"); CrashReport crashreport = CrashReport.forThrowable(throwable, "Loading entity NBT");
CrashReportCategory crashreportsystemdetails = crashreport.addCategory("Entity being loaded"); CrashReportCategory crashreportsystemdetails = crashreport.addCategory("Entity being loaded");
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
index 26ab6d0c98560e4dfebbad3482fd308861818e30..242e02646b8584a8d2a512374ad03729661d584f 100644 index bd357c3e6fcbd82f3c53ecc8dab46aa5d3708bc2..6c4be7da19d0d61f35942558d438587853231aaa 100644
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java --- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
@@ -337,6 +337,14 @@ public class FallingBlockEntity extends Entity { @@ -337,6 +337,14 @@ public class FallingBlockEntity extends Entity {
@ -113,7 +113,7 @@ index 26ab6d0c98560e4dfebbad3482fd308861818e30..242e02646b8584a8d2a512374ad03729
public void setHurtsEntities(float fallHurtAmount, int fallHurtMax) { public void setHurtsEntities(float fallHurtAmount, int fallHurtMax) {
diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
index bbe15c66917781a8b6950307449f0243ffc3c8c7..dfcca1fac06de7a4be9be3c238a738a0599fcd24 100644 index 2d4a990da2402a6c24c03e8be7e518e33db99c8f..10f8b5ff56e4c1d8300835e045abdce719a99343 100644
--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java --- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java +++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
@@ -120,6 +120,14 @@ public class PrimedTnt extends Entity { @@ -120,6 +120,14 @@ public class PrimedTnt extends Entity {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Prevent tile entity and entity crashes
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index efdab784bdec183425a6bc7f376f528c38a94752..0a0625eabfb0574a2a0ce866690ae98b0a260378 100644 index 5cc0546926ca1403aa325344fc138265f923fe1e..b35ca9316bf719e6b45f4d33ca7deecc95321ab3 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -694,11 +694,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -698,11 +698,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
try { try {
tickConsumer.accept(entity); tickConsumer.accept(entity);
} catch (Throwable throwable) { } catch (Throwable throwable) {

View File

@ -4,32 +4,8 @@ Date: Tue, 1 Mar 2016 23:58:50 -0600
Subject: [PATCH] Configurable top of nether void damage Subject: [PATCH] Configurable top of nether void damage
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index b41f6074e0d88b6becb5b931fc4ee94a1f9f2f0b..10c08ed945f950b9c2a5e308f8caa11955cb0088 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -190,4 +190,19 @@ public class PaperWorldConfig {
if (fallingBlockHeightNerf != 0) log("Falling Block Height Limit set to Y: " + fallingBlockHeightNerf);
if (entityTNTHeightNerf != 0) log("TNT Entity Height Limit set to Y: " + entityTNTHeightNerf);
}
+
+ public int netherVoidTopDamageHeight;
+ public boolean doNetherTopVoidDamage() { return netherVoidTopDamageHeight > 0; }
+ private void netherVoidTopDamageHeight() {
+ netherVoidTopDamageHeight = getInt("nether-ceiling-void-damage-height", 0);
+ log("Top of the nether void damage height: " + netherVoidTopDamageHeight);
+
+ if (PaperConfig.version < 18) {
+ boolean legacy = getBoolean("nether-ceiling-void-damage", false);
+ if (legacy) {
+ netherVoidTopDamageHeight = 128;
+ set("nether-ceiling-void-damage-height", netherVoidTopDamageHeight);
+ }
+ }
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 9c967df2e9cb7102ec2d6e4f02971f3342295b5a..51475d726004b857e0fbaffa9df2c777c2942071 100644 index 96864858f28337a6807cfa255b6b607bdbd337ce..3da8823a931d14cff60d3b99636cbf54d890b820 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -652,7 +652,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -652,7 +652,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@ -39,8 +15,8 @@ index 9c967df2e9cb7102ec2d6e4f02971f3342295b5a..51475d726004b857e0fbaffa9df2c777
- if (this.getY() < (double) (this.level.getMinBuildHeight() - 64)) { - if (this.getY() < (double) (this.level.getMinBuildHeight() - 64)) {
+ // Paper start - Configurable nether ceiling damage + // Paper start - Configurable nether ceiling damage
+ if (this.getY() < (double) (this.level.getMinBuildHeight() - 64) || (this.level.getWorld().getEnvironment() == org.bukkit.World.Environment.NETHER + if (this.getY() < (double) (this.level.getMinBuildHeight() - 64) || (this.level.getWorld().getEnvironment() == org.bukkit.World.Environment.NETHER
+ && level.paperConfig.doNetherTopVoidDamage() + && level.paperConfig().environment.netherCeilingVoidDamageHeight > 0
+ && this.getY() >= this.level.paperConfig.netherVoidTopDamageHeight)) { + && this.getY() >= this.level.paperConfig().environment.netherCeilingVoidDamageHeight)) {
+ // Paper end + // Paper end
this.outOfWorld(); this.outOfWorld();
} }

View File

@ -4,30 +4,15 @@ Date: Wed, 16 Mar 2016 02:21:39 -0500
Subject: [PATCH] Configurable end credits Subject: [PATCH] Configurable end credits
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 10c08ed945f950b9c2a5e308f8caa11955cb0088..067234ed44cae4454acc76b9ebe83ee1394fb913 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -205,4 +205,10 @@ public class PaperWorldConfig {
}
}
}
+
+ public boolean disableEndCredits;
+ private void disableEndCredits() {
+ disableEndCredits = getBoolean("game-mechanics.disable-end-credits", false);
+ log("End credits disabled: " + disableEndCredits);
+ }
}
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 7002d5f5700570e32ebf0b63e340d87d58357162..5940c2435dba421ee8480407f14827a2c876ac94 100644 index 7002d5f5700570e32ebf0b63e340d87d58357162..66fa7e12a9a398d510a75549c3db135feb4c562c 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -989,6 +989,7 @@ public class ServerPlayer extends Player { @@ -989,6 +989,7 @@ public class ServerPlayer extends Player {
this.unRide(); this.unRide();
this.getLevel().removePlayerImmediately(this, Entity.RemovalReason.CHANGED_DIMENSION); this.getLevel().removePlayerImmediately(this, Entity.RemovalReason.CHANGED_DIMENSION);
if (!this.wonGame) { if (!this.wonGame) {
+ if (level.paperConfig.disableEndCredits) this.seenCredits = true; // Paper - Toggle to always disable end credits + if (level.paperConfig().misc.disableEndCredits) this.seenCredits = true; // Paper - Toggle to always disable end credits
this.wonGame = true; this.wonGame = true;
this.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.WIN_GAME, this.seenCredits ? 0.0F : 1.0F)); this.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.WIN_GAME, this.seenCredits ? 0.0F : 1.0F));
this.seenCredits = true; this.seenCredits = true;

View File

@ -9,26 +9,11 @@ expensive when there are hundreds or more entities in range.
This patch adds a per-tick cache that is used for storing and retrieving This patch adds a per-tick cache that is used for storing and retrieving
an entity's exposure during an explosion. an entity's exposure during an explosion.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 067234ed44cae4454acc76b9ebe83ee1394fb913..73dda3becdf29dac35f4a0ceea070d174c546c8b 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -211,4 +211,10 @@ public class PaperWorldConfig {
disableEndCredits = getBoolean("game-mechanics.disable-end-credits", false);
log("End credits disabled: " + disableEndCredits);
}
+
+ public boolean optimizeExplosions;
+ private void optimizeExplosions() {
+ optimizeExplosions = getBoolean("optimize-explosions", false);
+ log("Optimize explosions: " + optimizeExplosions);
+ }
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 032e6819da27c8616b9b3b6c09bd559e69c35100..f037503a68f2b7b7c76b6ac7243dde2bf734afbd 100644 index 8cc5b6bbe2d8cbeb72e88b9e08e87fbbb98a6f8a..21e09c039a4c3fa64f6456e5cc7d50463590f787 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1393,6 +1393,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1394,6 +1394,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.profiler.pop(); this.profiler.pop();
this.profiler.pop(); this.profiler.pop();
@ -37,7 +22,7 @@ index 032e6819da27c8616b9b3b6c09bd559e69c35100..f037503a68f2b7b7c76b6ac7243dde2b
this.profiler.popPush("connection"); this.profiler.popPush("connection");
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
index 292571fc9fa999d3b92e0fdd56d07ebfb4ae7402..95e59d7c45bb5128b9176e3c172bd51d98449050 100644 index 292571fc9fa999d3b92e0fdd56d07ebfb4ae7402..db7a025cd064c898e33037133b65eecc3702542d 100644
--- a/src/main/java/net/minecraft/world/level/Explosion.java --- a/src/main/java/net/minecraft/world/level/Explosion.java
+++ b/src/main/java/net/minecraft/world/level/Explosion.java +++ b/src/main/java/net/minecraft/world/level/Explosion.java
@@ -225,7 +225,7 @@ public class Explosion { @@ -225,7 +225,7 @@ public class Explosion {
@ -55,7 +40,7 @@ index 292571fc9fa999d3b92e0fdd56d07ebfb4ae7402..95e59d7c45bb5128b9176e3c172bd51d
} }
+ // Paper start - Optimize explosions + // Paper start - Optimize explosions
+ private float getBlockDensity(Vec3 vec3d, Entity entity) { + private float getBlockDensity(Vec3 vec3d, Entity entity) {
+ if (!this.level.paperConfig.optimizeExplosions) { + if (!this.level.paperConfig().environment.optimizeExplosions) {
+ return getSeenPercent(vec3d, entity); + return getSeenPercent(vec3d, entity);
+ } + }
+ CacheKey key = new CacheKey(this, entity.getBoundingBox()); + CacheKey key = new CacheKey(this, entity.getBoundingBox());
@ -135,10 +120,10 @@ index 292571fc9fa999d3b92e0fdd56d07ebfb4ae7402..95e59d7c45bb5128b9176e3c172bd51d
+ // Paper end + // Paper end
} }
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 0a0625eabfb0574a2a0ce866690ae98b0a260378..7d86a8744d76e2fe8b3bf4b85152ea2203817713 100644 index b35ca9316bf719e6b45f4d33ca7deecc95321ab3..849f83944467ca3c505afebf2b84806e46670fb0 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -157,6 +157,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -161,6 +161,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
private org.spigotmc.TickLimiter entityLimiter; private org.spigotmc.TickLimiter entityLimiter;
private org.spigotmc.TickLimiter tileLimiter; private org.spigotmc.TickLimiter tileLimiter;
private int tileTickPosition; private int tileTickPosition;

View File

@ -4,29 +4,15 @@ Date: Wed, 2 Mar 2016 14:48:03 -0600
Subject: [PATCH] Disable explosion knockback Subject: [PATCH] Disable explosion knockback
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 73dda3becdf29dac35f4a0ceea070d174c546c8b..1d91adcfa636455bf67c6f7ac7d51baaa6db047f 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -217,4 +217,9 @@ public class PaperWorldConfig {
optimizeExplosions = getBoolean("optimize-explosions", false);
log("Optimize explosions: " + optimizeExplosions);
}
+
+ public boolean disableExplosionKnockback;
+ private void disableExplosionKnockback(){
+ disableExplosionKnockback = getBoolean("disable-explosion-knockback", false);
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index c7017b86a3268aef0baff2ae0a56155aafc6a067..062d8c0d48798199319da5ccb422af2f1564f6f6 100644 index c7017b86a3268aef0baff2ae0a56155aafc6a067..4731869c1bd3b8abdd2a5133fd551a2a534a6b41 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1399,6 +1399,7 @@ public abstract class LivingEntity extends Entity { @@ -1399,6 +1399,7 @@ public abstract class LivingEntity extends Entity {
} }
} }
+ boolean knockbackCancelled = level.paperConfig.disableExplosionKnockback && source.isExplosion() && this instanceof net.minecraft.world.entity.player.Player; // Paper - Disable explosion knockback + boolean knockbackCancelled = level.paperConfig().environment.disableExplosionKnockback && source.isExplosion() && this instanceof net.minecraft.world.entity.player.Player; // Paper - Disable explosion knockback
if (flag1) { if (flag1) {
if (flag) { if (flag) {
this.level.broadcastEntityEvent(this, (byte) 29); this.level.broadcastEntityEvent(this, (byte) 29);
@ -47,7 +33,7 @@ index c7017b86a3268aef0baff2ae0a56155aafc6a067..062d8c0d48798199319da5ccb422af2f
if (!this.checkTotemDeathProtection(source)) { if (!this.checkTotemDeathProtection(source)) {
SoundEvent soundeffect = this.getDeathSound(); SoundEvent soundeffect = this.getDeathSound();
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
index 95e59d7c45bb5128b9176e3c172bd51d98449050..2a10a50381b6d6229b7c6e1d32f0d8f96db70bd5 100644 index db7a025cd064c898e33037133b65eecc3702542d..af9645a3ef9dab1134977b30937f15fa3fa27a95 100644
--- a/src/main/java/net/minecraft/world/level/Explosion.java --- a/src/main/java/net/minecraft/world/level/Explosion.java
+++ b/src/main/java/net/minecraft/world/level/Explosion.java +++ b/src/main/java/net/minecraft/world/level/Explosion.java
@@ -260,14 +260,14 @@ public class Explosion { @@ -260,14 +260,14 @@ public class Explosion {
@ -55,7 +41,7 @@ index 95e59d7c45bb5128b9176e3c172bd51d98449050..2a10a50381b6d6229b7c6e1d32f0d8f9
if (entity instanceof LivingEntity) { if (entity instanceof LivingEntity) {
- d14 = ProtectionEnchantment.getExplosionKnockbackAfterDampener((LivingEntity) entity, d13); - d14 = ProtectionEnchantment.getExplosionKnockbackAfterDampener((LivingEntity) entity, d13);
+ d14 = entity instanceof Player && level.paperConfig.disableExplosionKnockback ? 0 : ProtectionEnchantment.getExplosionKnockbackAfterDampener((LivingEntity) entity, d13); // Paper - Disable explosion knockback + d14 = entity instanceof Player && level.paperConfig().environment.disableExplosionKnockback ? 0 : ProtectionEnchantment.getExplosionKnockbackAfterDampener((LivingEntity) entity, d13); // Paper - Disable explosion knockback
} }
entity.setDeltaMovement(entity.getDeltaMovement().add(d8 * d14, d9 * d14, d10 * d14)); entity.setDeltaMovement(entity.getDeltaMovement().add(d8 * d14, d9 * d14, d10 * d14));
@ -63,7 +49,7 @@ index 95e59d7c45bb5128b9176e3c172bd51d98449050..2a10a50381b6d6229b7c6e1d32f0d8f9
Player entityhuman = (Player) entity; Player entityhuman = (Player) entity;
- if (!entityhuman.isSpectator() && (!entityhuman.isCreative() || !entityhuman.getAbilities().flying)) { - if (!entityhuman.isSpectator() && (!entityhuman.isCreative() || !entityhuman.getAbilities().flying)) {
+ if (!entityhuman.isSpectator() && (!entityhuman.isCreative() || !entityhuman.getAbilities().flying) && !level.paperConfig.disableExplosionKnockback) { // Paper - Disable explosion knockback + if (!entityhuman.isSpectator() && (!entityhuman.isCreative() || !entityhuman.getAbilities().flying) && !level.paperConfig().environment.disableExplosionKnockback) { // Paper - Disable explosion knockback
this.hitPlayers.put(entityhuman, new Vec3(d8 * d13, d9 * d13, d10 * d13)); this.hitPlayers.put(entityhuman, new Vec3(d8 * d13, d9 * d13, d10 * d13));
} }
} }

View File

@ -4,22 +4,8 @@ Date: Wed, 2 Mar 2016 14:52:43 -0600
Subject: [PATCH] Disable thunder Subject: [PATCH] Disable thunder
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 1d91adcfa636455bf67c6f7ac7d51baaa6db047f..a591d52ed44213d7932690136796d3e068b06987 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -222,4 +222,9 @@ public class PaperWorldConfig {
private void disableExplosionKnockback(){
disableExplosionKnockback = getBoolean("disable-explosion-knockback", false);
}
+
+ public boolean disableThunder;
+ private void disableThunder() {
+ disableThunder = getBoolean("disable-thunder", false);
+ }
}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 53213d0c2d1b402f28a2da315d18c46deba509bf..94a796143e25a0e8914158efed4ce01a440f3bcc 100644 index 39737b5ac7d4a16527196600965a8b617502c027..2a51916a3fc8bd8d6b0255051a024dbb7f6a9ad5 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -579,7 +579,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -579,7 +579,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@ -27,7 +13,7 @@ index 53213d0c2d1b402f28a2da315d18c46deba509bf..94a796143e25a0e8914158efed4ce01a
BlockPos blockposition; BlockPos blockposition;
- if (flag && this.isThundering() && this.spigotConfig.thunderChance > 0 && this.random.nextInt(this.spigotConfig.thunderChance) == 0) { // Spigot - if (flag && this.isThundering() && this.spigotConfig.thunderChance > 0 && this.random.nextInt(this.spigotConfig.thunderChance) == 0) { // Spigot
+ if (!this.paperConfig.disableThunder && flag && this.isThundering() && this.spigotConfig.thunderChance > 0 && this.random.nextInt(this.spigotConfig.thunderChance) == 0) { // Spigot // Paper - disable thunder + if (!this.paperConfig().environment.disableThunder && flag && this.isThundering() && this.spigotConfig.thunderChance > 0 && this.random.nextInt(this.spigotConfig.thunderChance) == 0) { // Spigot // Paper - disable thunder
blockposition = this.findLightningTargetAround(this.getBlockRandomPos(j, 0, k, 15)); blockposition = this.findLightningTargetAround(this.getBlockRandomPos(j, 0, k, 15));
if (this.isRainingAt(blockposition)) { if (this.isRainingAt(blockposition)) {
DifficultyInstance difficultydamagescaler = this.getCurrentDifficultyAt(blockposition); DifficultyInstance difficultydamagescaler = this.getCurrentDifficultyAt(blockposition);

View File

@ -4,22 +4,8 @@ Date: Wed, 2 Mar 2016 14:57:24 -0600
Subject: [PATCH] Disable ice and snow Subject: [PATCH] Disable ice and snow
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index a591d52ed44213d7932690136796d3e068b06987..18e7960624e4e882677145c3bedd00263a57b051 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -227,4 +227,9 @@ public class PaperWorldConfig {
private void disableThunder() {
disableThunder = getBoolean("disable-thunder", false);
}
+
+ public boolean disableIceAndSnow;
+ private void disableIceAndSnow(){
+ disableIceAndSnow = getBoolean("disable-ice-and-snow", false);
+ }
}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 94a796143e25a0e8914158efed4ce01a440f3bcc..a04e75293b1d196341bc641ee7da975bf9baec13 100644 index 2a51916a3fc8bd8d6b0255051a024dbb7f6a9ad5..0023f18e7b856f6178e516d1b692d3697ba99631 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -603,7 +603,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -603,7 +603,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@ -27,7 +13,7 @@ index 94a796143e25a0e8914158efed4ce01a440f3bcc..a04e75293b1d196341bc641ee7da975b
gameprofilerfiller.popPush("iceandsnow"); gameprofilerfiller.popPush("iceandsnow");
- if (this.random.nextInt(16) == 0) { - if (this.random.nextInt(16) == 0) {
+ if (!this.paperConfig.disableIceAndSnow && this.random.nextInt(16) == 0) { // Paper - Disable ice and snow + if (!this.paperConfig().environment.disableIceAndSnow && this.random.nextInt(16) == 0) { // Paper - Disable ice and snow
blockposition = this.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING, this.getBlockRandomPos(j, 0, k, 15)); blockposition = this.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING, this.getBlockRandomPos(j, 0, k, 15));
BlockPos blockposition1 = blockposition.below(); BlockPos blockposition1 = blockposition.below();
Biome biomebase = (Biome) this.getBiome(blockposition).value(); Biome biomebase = (Biome) this.getBiome(blockposition).value();

View File

@ -4,22 +4,8 @@ Date: Wed, 2 Mar 2016 15:03:53 -0600
Subject: [PATCH] Configurable mob spawner tick rate Subject: [PATCH] Configurable mob spawner tick rate
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 18e7960624e4e882677145c3bedd00263a57b051..fcbb0d6cd09a9c80a8725c9cf0c503fa0532f1e3 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -232,4 +232,9 @@ public class PaperWorldConfig {
private void disableIceAndSnow(){
disableIceAndSnow = getBoolean("disable-ice-and-snow", false);
}
+
+ public int mobSpawnerTickRate;
+ private void mobSpawnerTickRate() {
+ mobSpawnerTickRate = getInt("mob-spawner-tick-rate", 1);
+ }
}
diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
index c5b9b19763fd944b4f31c6d3c9b71d372f8403cf..5bc0071c5309548219cbcd902d7020ff4a5ca6b7 100644 index c5b9b19763fd944b4f31c6d3c9b71d372f8403cf..e5b56a85d76d1417dda2d14b1b03850bbb070f4c 100644
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java --- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java +++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
@@ -42,6 +42,7 @@ public abstract class BaseSpawner { @@ -42,6 +42,7 @@ public abstract class BaseSpawner {
@ -36,7 +22,7 @@ index c5b9b19763fd944b4f31c6d3c9b71d372f8403cf..5bc0071c5309548219cbcd902d7020ff
public void serverTick(ServerLevel world, BlockPos pos) { public void serverTick(ServerLevel world, BlockPos pos) {
+ // Paper start - Configurable mob spawner tick rate + // Paper start - Configurable mob spawner tick rate
+ if (spawnDelay > 0 && --tickDelay > 0) return; + if (spawnDelay > 0 && --tickDelay > 0) return;
+ tickDelay = world.paperConfig.mobSpawnerTickRate; + tickDelay = world.paperConfig().tickRates.mobSpawner;
+ if (tickDelay == -1) { return; } // If disabled + if (tickDelay == -1) { return; } // If disabled
+ // Paper end + // Paper end
if (this.isNearPlayer(world, pos)) { if (this.isNearPlayer(world, pos)) {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Implement PlayerLocaleChangeEvent
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 5940c2435dba421ee8480407f14827a2c876ac94..732622344982137b5ac051c6d510c7860fbe4e0a 100644 index 66fa7e12a9a398d510a75549c3db135feb4c562c..e839487415ad88bdea1ce3f4f84a6f9649eb9da9 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1755,7 +1755,7 @@ public class ServerPlayer extends Player { @@ -1755,7 +1755,7 @@ public class ServerPlayer extends Player {
@ -30,7 +30,7 @@ index 5940c2435dba421ee8480407f14827a2c876ac94..732622344982137b5ac051c6d510c786
this.locale = packet.language; this.locale = packet.language;
// Paper start // Paper start
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 9a2a6e9ba09f4f6347926579ad5f803de4a6033f..8fb5bcd3fcd7706fc62771b90107ed8efedd7d1c 100644 index 7df667b54478d5e415cf6872984db33981b8e4f9..c5a02c5a6ccf14d2088ee0b65fd27db926b26eac 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1958,8 +1958,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1958,8 +1958,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -7,7 +7,7 @@ I hope to look at this more in-depth soon. It appears doable.
However this should not block the update. However this should not block the update.
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 732622344982137b5ac051c6d510c7860fbe4e0a..cebd22696a672fc0f1c1fb0676ac76842244b6d3 100644 index e839487415ad88bdea1ce3f4f84a6f9649eb9da9..447d4e724b5ff129bd6670f4d7b2111acfe33719 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -2242,4 +2242,6 @@ public class ServerPlayer extends Player { @@ -2242,4 +2242,6 @@ public class ServerPlayer extends Player {
@ -60,7 +60,7 @@ index 1357bc97801f892e59fc8e89c3cc2d697894ccfb..cf9c2456004ce5fc0e38da33251f66df
// Spigot start // Spigot start
private final org.bukkit.World.Spigot spigot = new org.bukkit.World.Spigot() private final org.bukkit.World.Spigot spigot = new org.bukkit.World.Spigot()
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 8fb5bcd3fcd7706fc62771b90107ed8efedd7d1c..794eea1b7c897f384e8eafe654fb5628e43f6fda 100644 index c5a02c5a6ccf14d2088ee0b65fd27db926b26eac..5d35cd1b790197c92f2340426e5dd17827b3bfaa 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -402,6 +402,46 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -402,6 +402,46 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -4,22 +4,8 @@ Date: Wed, 2 Mar 2016 23:34:44 -0600
Subject: [PATCH] Configurable container update tick rate Subject: [PATCH] Configurable container update tick rate
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index fcbb0d6cd09a9c80a8725c9cf0c503fa0532f1e3..156059d4951fa01b10cc36d70cd439037c636e4c 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -237,4 +237,9 @@ public class PaperWorldConfig {
private void mobSpawnerTickRate() {
mobSpawnerTickRate = getInt("mob-spawner-tick-rate", 1);
}
+
+ public int containerUpdateTickRate;
+ private void containerUpdateTickRate() {
+ containerUpdateTickRate = getInt("container-update-tick-rate", 1);
+ }
}
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index cebd22696a672fc0f1c1fb0676ac76842244b6d3..a375d2d0bffc3694e76bae3f9ba13f60e629d859 100644 index 447d4e724b5ff129bd6670f4d7b2111acfe33719..73fe1f1047e39eeeb8a1444fa353f7d1a8e651b3 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -226,6 +226,7 @@ public class ServerPlayer extends Player { @@ -226,6 +226,7 @@ public class ServerPlayer extends Player {
@ -38,7 +24,7 @@ index cebd22696a672fc0f1c1fb0676ac76842244b6d3..a375d2d0bffc3694e76bae3f9ba13f60
+ // Paper start - Configurable container update tick rate + // Paper start - Configurable container update tick rate
+ if (--containerUpdateDelay <= 0) { + if (--containerUpdateDelay <= 0) {
+ this.containerMenu.broadcastChanges(); + this.containerMenu.broadcastChanges();
+ containerUpdateDelay = level.paperConfig.containerUpdateTickRate; + containerUpdateDelay = level.paperConfig().tickRates.containerUpdate;
+ } + }
+ // Paper end + // Paper end
if (!this.level.isClientSide && !this.containerMenu.stillValid(this)) { if (!this.level.isClientSide && !this.containerMenu.stillValid(this)) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Disable spigot tick limiters
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 7d86a8744d76e2fe8b3bf4b85152ea2203817713..e52d69675c823184303536db0f673762d8eca100 100644 index 849f83944467ca3c505afebf2b84806e46670fb0..17da97bfece600438f6e872e8a1a2bee1d60c804 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -660,9 +660,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -664,9 +664,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// Spigot start // Spigot start
// Iterator iterator = this.blockEntityTickers.iterator(); // Iterator iterator = this.blockEntityTickers.iterator();
int tilesThisCycle = 0; int tilesThisCycle = 0;

View File

@ -9,7 +9,7 @@ This is a duplicate API from spigot, so use our duplicate subclass and
improve setPosition to use raw improve setPosition to use raw
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 870fb4ffb01ba291d9d3aabfd722e669a477e209..4cf2264208ce681d92441cd06bf8120d586bc82a 100644 index dbd53de61057eb9eb8be651abf9abcad18423ab1..16e1d0b62e01551a54d60c81ca12708f51aceef9 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -221,7 +221,7 @@ public abstract class PlayerList { @@ -221,7 +221,7 @@ public abstract class PlayerList {

View File

@ -5,22 +5,8 @@ Subject: [PATCH] Configurable Disabling Cat Chest Detection
Offers a gameplay feature to stop cats from blocking chests Offers a gameplay feature to stop cats from blocking chests
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 156059d4951fa01b10cc36d70cd439037c636e4c..adf5a83fc1b62e55ba4524893f8704ad6cd81e97 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -242,4 +242,9 @@ public class PaperWorldConfig {
private void containerUpdateTickRate() {
containerUpdateTickRate = getInt("container-update-tick-rate", 1);
}
+
+ public boolean disableChestCatDetection;
+ private void disableChestCatDetection() {
+ disableChestCatDetection = getBoolean("game-mechanics.disable-chest-cat-detection", false);
+ }
}
diff --git a/src/main/java/net/minecraft/world/level/block/ChestBlock.java b/src/main/java/net/minecraft/world/level/block/ChestBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/ChestBlock.java b/src/main/java/net/minecraft/world/level/block/ChestBlock.java
index ccde1bef18a7ffe338d71a6feb2dd88228004c34..2f6b5142543aec14b27a996fe1a6817ac44c77b8 100644 index ccde1bef18a7ffe338d71a6feb2dd88228004c34..c6b57d45383441aa35510e759ce3cb82bc98f305 100644
--- a/src/main/java/net/minecraft/world/level/block/ChestBlock.java --- a/src/main/java/net/minecraft/world/level/block/ChestBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/ChestBlock.java +++ b/src/main/java/net/minecraft/world/level/block/ChestBlock.java
@@ -361,6 +361,11 @@ public class ChestBlock extends AbstractChestBlock<ChestBlockEntity> implements @@ -361,6 +361,11 @@ public class ChestBlock extends AbstractChestBlock<ChestBlockEntity> implements
@ -28,7 +14,7 @@ index ccde1bef18a7ffe338d71a6feb2dd88228004c34..2f6b5142543aec14b27a996fe1a6817a
private static boolean isCatSittingOnChest(LevelAccessor world, BlockPos pos) { private static boolean isCatSittingOnChest(LevelAccessor world, BlockPos pos) {
+ // Paper start - Option to disable chest cat detection + // Paper start - Option to disable chest cat detection
+ if (((Level) world).paperConfig.disableChestCatDetection) { + if (world.getMinecraftWorld().paperConfig().entities.behavior.disableChestCatDetection) {
+ return false; + return false;
+ } + }
+ // Paper end + // Paper end

View File

@ -14,7 +14,7 @@ big slowdown in execution but throwing an exception at same time to raise awaren
that it is happening so that plugin authors can fix their code to stop executing commands async. that it is happening so that plugin authors can fix their code to stop executing commands async.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index a75353e96d0e0a017e4a5dc84c04a5c594535439..984209f32015d765367fd7693fb759de571b9ad0 100644 index e65175696d4d99225e87d79cf3e59cf2f29637e1..ea9a2b48d3d84fcf1ec263c920bacd80ae26cb27 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1947,6 +1947,29 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -1947,6 +1947,29 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@ -48,7 +48,7 @@ index a75353e96d0e0a017e4a5dc84c04a5c594535439..984209f32015d765367fd7693fb759de
} else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) { } else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) {
// Do nothing, this is coming from a plugin // Do nothing, this is coming from a plugin
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index a7dcdb5cce888f8580b54f7de263110e69285311..c30ee88c7e49364a799c848ceb683084ae0febc8 100644 index e700b38d8884f4228a8925f07c4cf1500dbdfa20..71be195aa194aa1c12a7e7b8f2cffcd81a1ebbba 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -852,6 +852,28 @@ public final class CraftServer implements Server { @@ -852,6 +852,28 @@ public final class CraftServer implements Server {

View File

@ -4,22 +4,8 @@ Date: Thu, 3 Mar 2016 01:19:22 -0600
Subject: [PATCH] All chunks are slime spawn chunks toggle Subject: [PATCH] All chunks are slime spawn chunks toggle
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index adf5a83fc1b62e55ba4524893f8704ad6cd81e97..567bad50508870001c3337bf109a407b6b4cde0e 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -247,4 +247,9 @@ public class PaperWorldConfig {
private void disableChestCatDetection() {
disableChestCatDetection = getBoolean("game-mechanics.disable-chest-cat-detection", false);
}
+
+ public boolean allChunksAreSlimeChunks;
+ private void allChunksAreSlimeChunks() {
+ allChunksAreSlimeChunks = getBoolean("all-chunks-are-slime-chunks", false);
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/monster/Slime.java b/src/main/java/net/minecraft/world/entity/monster/Slime.java diff --git a/src/main/java/net/minecraft/world/entity/monster/Slime.java b/src/main/java/net/minecraft/world/entity/monster/Slime.java
index a62f88048d8243f5b98834988c049471114c4199..61304f83aff18ae20316db7e16b673a652eb73a4 100644 index a62f88048d8243f5b98834988c049471114c4199..7b95d18fb5edbd1575f6be92bfcbb3e0d7f691c8 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Slime.java --- a/src/main/java/net/minecraft/world/entity/monster/Slime.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Slime.java +++ b/src/main/java/net/minecraft/world/entity/monster/Slime.java
@@ -316,7 +316,7 @@ public class Slime extends Mob implements Enemy { @@ -316,7 +316,7 @@ public class Slime extends Mob implements Enemy {
@ -27,12 +13,12 @@ index a62f88048d8243f5b98834988c049471114c4199..61304f83aff18ae20316db7e16b673a6
ChunkPos chunkcoordintpair = new ChunkPos(pos); ChunkPos chunkcoordintpair = new ChunkPos(pos);
- boolean flag = WorldgenRandom.seedSlimeChunk(chunkcoordintpair.x, chunkcoordintpair.z, ((WorldGenLevel) world).getSeed(), world.getMinecraftWorld().spigotConfig.slimeSeed).nextInt(10) == 0; // Spigot - boolean flag = WorldgenRandom.seedSlimeChunk(chunkcoordintpair.x, chunkcoordintpair.z, ((WorldGenLevel) world).getSeed(), world.getMinecraftWorld().spigotConfig.slimeSeed).nextInt(10) == 0; // Spigot
+ boolean flag = world.getMinecraftWorld().paperConfig.allChunksAreSlimeChunks || WorldgenRandom.seedSlimeChunk(chunkcoordintpair.x, chunkcoordintpair.z, ((WorldGenLevel) world).getSeed(), world.getMinecraftWorld().spigotConfig.slimeSeed).nextInt(10) == 0; // Spigot // Paper + boolean flag = world.getMinecraftWorld().paperConfig().entities.spawning.allChunksAreSlimeChunks || WorldgenRandom.seedSlimeChunk(chunkcoordintpair.x, chunkcoordintpair.z, ((WorldGenLevel) world).getSeed(), world.getMinecraftWorld().spigotConfig.slimeSeed).nextInt(10) == 0; // Spigot // Paper
if (random.nextInt(10) == 0 && flag && pos.getY() < 40) { if (random.nextInt(10) == 0 && flag && pos.getY() < 40) {
return checkMobSpawnRules(type, world, spawnReason, pos, random); return checkMobSpawnRules(type, world, spawnReason, pos, random);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
index d748eb01ecb2b15b081ab3d98b3b3d5804a2215a..0a72475c241e0392993c3e501f891b74c7f72019 100644 index d748eb01ecb2b15b081ab3d98b3b3d5804a2215a..0d905269ab3bce4cfe68647b9b0cda8fff4aa17e 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java --- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
@@ -220,7 +220,7 @@ public class CraftChunk implements Chunk { @@ -220,7 +220,7 @@ public class CraftChunk implements Chunk {
@ -40,7 +26,7 @@ index d748eb01ecb2b15b081ab3d98b3b3d5804a2215a..0a72475c241e0392993c3e501f891b74
public boolean isSlimeChunk() { public boolean isSlimeChunk() {
// 987234911L is deterimined in EntitySlime when seeing if a slime can spawn in a chunk // 987234911L is deterimined in EntitySlime when seeing if a slime can spawn in a chunk
- return WorldgenRandom.seedSlimeChunk(this.getX(), this.getZ(), this.getWorld().getSeed(), worldServer.spigotConfig.slimeSeed).nextInt(10) == 0; - return WorldgenRandom.seedSlimeChunk(this.getX(), this.getZ(), this.getWorld().getSeed(), worldServer.spigotConfig.slimeSeed).nextInt(10) == 0;
+ return this.worldServer.paperConfig.allChunksAreSlimeChunks || WorldgenRandom.seedSlimeChunk(this.getX(), this.getZ(), this.getWorld().getSeed(), worldServer.spigotConfig.slimeSeed).nextInt(10) == 0; // Paper + return this.worldServer.paperConfig().entities.spawning.allChunksAreSlimeChunks || WorldgenRandom.seedSlimeChunk(this.getX(), this.getZ(), this.getWorld().getSeed(), worldServer.spigotConfig.slimeSeed).nextInt(10) == 0; // Paper
} }
@Override @Override

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Expose server CommandMap
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index c30ee88c7e49364a799c848ceb683084ae0febc8..5b002bb66d75f5a93492324fd77a91f851c47224 100644 index 71be195aa194aa1c12a7e7b8f2cffcd81a1ebbba..4cb1d15c7f6d7720d696608cbb8fb4572358ffc7 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1958,6 +1958,7 @@ public final class CraftServer implements Server { @@ -1957,6 +1957,7 @@ public final class CraftServer implements Server {
return this.helpMap; return this.helpMap;
} }

View File

@ -63,7 +63,7 @@ index bd808eb312ade7122973a47f4b96505829511da5..bf0f9cab7c66c089f35b851e799ba4a4
// Paper end // Paper end
buf.writeComponent(this.text); buf.writeComponent(this.text);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 794eea1b7c897f384e8eafe654fb5628e43f6fda..2c12861a76f2340fc4c8f0d4fd271ae8de35badd 100644 index 5d35cd1b790197c92f2340426e5dd17827b3bfaa..b3e12f613117dd417f48981a7c2388597118b515 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@

View File

@ -4,45 +4,27 @@ Date: Thu, 3 Mar 2016 02:46:17 -0600
Subject: [PATCH] Add configurable portal search radius Subject: [PATCH] Add configurable portal search radius
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 567bad50508870001c3337bf109a407b6b4cde0e..66dd2ebda5692157e397f7ddafd96a492e53c9e9 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -252,4 +252,13 @@ public class PaperWorldConfig {
private void allChunksAreSlimeChunks() {
allChunksAreSlimeChunks = getBoolean("all-chunks-are-slime-chunks", false);
}
+
+ public int portalSearchRadius;
+ public int portalCreateRadius;
+ public boolean portalSearchVanillaDimensionScaling;
+ private void portalSearchRadius() {
+ portalSearchRadius = getInt("portal-search-radius", 128);
+ portalCreateRadius = getInt("portal-create-radius", 16);
+ portalSearchVanillaDimensionScaling = getBoolean("portal-search-vanilla-dimension-scaling", true);
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 51475d726004b857e0fbaffa9df2c777c2942071..d6bf1d3356a8894cdeacac270d96d7ea07c79879 100644 index 3da8823a931d14cff60d3b99636cbf54d890b820..86b8747ec3aa9c92644fe313c7a73593f8bf4eae 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2940,7 +2940,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -2939,7 +2939,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
double d0 = DimensionType.getTeleportationScale(this.level.dimensionType(), destination.dimensionType()); double d0 = DimensionType.getTeleportationScale(this.level.dimensionType(), destination.dimensionType());
BlockPos blockposition = worldborder.clampToBounds(this.getX() * d0, this.getY(), this.getZ() * d0); BlockPos blockposition = worldborder.clampToBounds(this.getX() * d0, this.getY(), this.getZ() * d0);
// CraftBukkit start // CraftBukkit start
- CraftPortalEvent event = this.callPortalEvent(this, destination, blockposition, PlayerTeleportEvent.TeleportCause.NETHER_PORTAL, flag2 ? 16 : 128, 16); - CraftPortalEvent event = this.callPortalEvent(this, destination, blockposition, PlayerTeleportEvent.TeleportCause.NETHER_PORTAL, flag2 ? 16 : 128, 16);
+ // Paper start + // Paper start
+ int portalSearchRadius = destination.paperConfig.portalSearchRadius; + int portalSearchRadius = destination.paperConfig().environment.portalSearchRadius;
+ if (level.paperConfig.portalSearchVanillaDimensionScaling && flag2) { // == THE_NETHER + if (level.paperConfig().environment.portalSearchVanillaDimensionScaling && flag2) { // == THE_NETHER
+ portalSearchRadius = (int) (portalSearchRadius / destination.dimensionType().coordinateScale()); + portalSearchRadius = (int) (portalSearchRadius / destination.dimensionType().coordinateScale());
+ } + }
+ // Paper end + // Paper end
+ CraftPortalEvent event = this.callPortalEvent(this, destination, blockposition, PlayerTeleportEvent.TeleportCause.NETHER_PORTAL, portalSearchRadius, destination.paperConfig.portalCreateRadius); // Paper start - configurable portal radius + CraftPortalEvent event = this.callPortalEvent(this, destination, blockposition, PlayerTeleportEvent.TeleportCause.NETHER_PORTAL, portalSearchRadius, destination.paperConfig().environment.portalCreateRadius); // Paper start - configurable portal radius
if (event == null) { if (event == null) {
return null; return null;
} }
diff --git a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java diff --git a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java
index bb05ea288432ece497957c3503c3435655ce8997..8672545ba07205ef362442e1342f2ee5281f62cb 100644 index bb05ea288432ece497957c3503c3435655ce8997..7aa6181237eaec1df2ed2fdcd3b1137dfe89ce69 100644
--- a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java --- a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java
+++ b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java +++ b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java
@@ -43,7 +43,7 @@ public class PortalForcer { @@ -43,7 +43,7 @@ public class PortalForcer {
@ -50,7 +32,7 @@ index bb05ea288432ece497957c3503c3435655ce8997..8672545ba07205ef362442e1342f2ee5
public Optional<BlockUtil.FoundRectangle> findPortalAround(BlockPos pos, boolean destIsNether, WorldBorder worldBorder) { public Optional<BlockUtil.FoundRectangle> findPortalAround(BlockPos pos, boolean destIsNether, WorldBorder worldBorder) {
// CraftBukkit start // CraftBukkit start
- return this.findPortalAround(pos, worldBorder, destIsNether ? 16 : 128); // Search Radius - return this.findPortalAround(pos, worldBorder, destIsNether ? 16 : 128); // Search Radius
+ return this.findPortalAround(pos, worldBorder, destIsNether ? level.paperConfig.portalCreateRadius : level.paperConfig.portalSearchRadius); // Search Radius // Paper - search Radius + return this.findPortalAround(pos, worldBorder, destIsNether ? level.paperConfig().environment.portalCreateRadius : level.paperConfig().environment.portalSearchRadius); // Search Radius // Paper - search Radius
} }
public Optional<BlockUtil.FoundRectangle> findPortalAround(BlockPos blockposition, WorldBorder worldborder, int i) { public Optional<BlockUtil.FoundRectangle> findPortalAround(BlockPos blockposition, WorldBorder worldborder, int i) {

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 diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 5b002bb66d75f5a93492324fd77a91f851c47224..ff7f1347619d4df2a5c217a4b6545878ed81293c 100644 index 4cb1d15c7f6d7720d696608cbb8fb4572358ffc7..a8b963b336045c11c71dfff4e0ad0d66a9b47a92 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -274,6 +274,7 @@ public final class CraftServer implements Server { @@ -274,6 +274,7 @@ public final class CraftServer implements Server {

View File

@ -15,22 +15,8 @@ Example setup to perform the glitch: http://puu.sh/ng3PC/cf072dcbdb.png
The wanted destination was on top of the emerald block however the player ended on top of the diamond block. The wanted destination was on top of the emerald block however the player ended on top of the diamond block.
This only is the case if the player is teleporting between worlds. This only is the case if the player is teleporting between worlds.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 66dd2ebda5692157e397f7ddafd96a492e53c9e9..45b51fea6ba4381e4d245d70b5671f6e42c1f718 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -261,4 +261,9 @@ public class PaperWorldConfig {
portalCreateRadius = getInt("portal-create-radius", 16);
portalSearchVanillaDimensionScaling = getBoolean("portal-search-vanilla-dimension-scaling", true);
}
+
+ public boolean disableTeleportationSuffocationCheck;
+ private void disableTeleportationSuffocationCheck() {
+ disableTeleportationSuffocationCheck = getBoolean("disable-teleportation-suffocation-check", false);
+ }
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 2c12861a76f2340fc4c8f0d4fd271ae8de35badd..b3c02dc06fcf2c47f2f6d1cb517786cfd824f987 100644 index b3e12f613117dd417f48981a7c2388597118b515..8fafbbf8556c295fd7bc21352c640101d15d3e7c 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1031,7 +1031,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1031,7 +1031,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -38,7 +24,7 @@ index 2c12861a76f2340fc4c8f0d4fd271ae8de35badd..b3c02dc06fcf2c47f2f6d1cb517786cf
entity.connection.teleport(to); entity.connection.teleport(to);
} else { } else {
- server.getHandle().respawn(entity, toWorld, true, to, true); - server.getHandle().respawn(entity, toWorld, true, to, true);
+ server.getHandle().respawn(entity, toWorld, true, to, !toWorld.paperConfig.disableTeleportationSuffocationCheck); // Paper + server.getHandle().respawn(entity, toWorld, true, to, !toWorld.paperConfig().environment.disableTeleportationSuffocationCheck); // Paper
} }
return true; return true;
} }

View File

@ -100,7 +100,7 @@ index c6fb4c33d7ea52b88d8fc0d90748cbab7387c565..fed09b886f4fa0006d160e5f2abb00df
} }
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index e52d69675c823184303536db0f673762d8eca100..2bc5b3c76264a5a23170adbc2e04c55a5e4f2a6a 100644 index 17da97bfece600438f6e872e8a1a2bee1d60c804..447ce111786a53fca6b0f6c8803b47f9cadd7df7 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -1,5 +1,10 @@ @@ -1,5 +1,10 @@
@ -114,7 +114,7 @@ index e52d69675c823184303536db0f673762d8eca100..2bc5b3c76264a5a23170adbc2e04c55a
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.mojang.serialization.Codec; import com.mojang.serialization.Codec;
import java.io.IOException; import java.io.IOException;
@@ -696,6 +701,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -700,6 +705,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// Paper start - Prevent tile entity and entity crashes // Paper start - Prevent tile entity and entity crashes
final String msg = String.format("Entity threw exception at %s:%s,%s,%s", entity.level.getWorld().getName(), entity.getX(), entity.getY(), entity.getZ()); final String msg = String.format("Entity threw exception at %s:%s,%s,%s", entity.level.getWorld().getName(), entity.getX(), entity.getY(), entity.getZ());
MinecraftServer.LOGGER.error(msg, throwable); MinecraftServer.LOGGER.error(msg, throwable);

View File

@ -10,41 +10,27 @@ this setting.
So avoid looking up scoreboards and short circuit to the "not on a team" So avoid looking up scoreboards and short circuit to the "not on a team"
logic which is most likely to be true. logic which is most likely to be true.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 45b51fea6ba4381e4d245d70b5671f6e42c1f718..397995fe4c360d837282535b9b7aaf7f3d93f85f 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -266,4 +266,9 @@ public class PaperWorldConfig {
private void disableTeleportationSuffocationCheck() {
disableTeleportationSuffocationCheck = getBoolean("disable-teleportation-suffocation-check", false);
}
+
+ public boolean nonPlayerEntitiesOnScoreboards = false;
+ private void nonPlayerEntitiesOnScoreboards() {
+ nonPlayerEntitiesOnScoreboards = getBoolean("allow-non-player-entities-on-scoreboards", false);
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index d6bf1d3356a8894cdeacac270d96d7ea07c79879..e6917848029b1686e4e3a1a0eadac85eda92518d 100644 index 86b8747ec3aa9c92644fe313c7a73593f8bf4eae..704a5aa2881c6f826d49ad9aed6003db7c5f5843 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2578,6 +2578,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -2577,6 +2577,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@Nullable @Nullable
public Team getTeam() { public Team getTeam() {
+ if (!this.level.paperConfig.nonPlayerEntitiesOnScoreboards && !(this instanceof Player)) { return null; } // Paper + if (!this.level.paperConfig().scoreboards.allowNonPlayerEntitiesOnScoreboards && !(this instanceof Player)) { return null; } // Paper
return this.level.getScoreboard().getPlayersTeam(this.getScoreboardName()); return this.level.getScoreboard().getPlayersTeam(this.getScoreboardName());
} }
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 062d8c0d48798199319da5ccb422af2f1564f6f6..3f82c88058edb5c37fff98d760d931de20a85b5d 100644 index 4731869c1bd3b8abdd2a5133fd551a2a534a6b41..3710cf92bd29f69bb86d72a7adbb8df9bf4f8f08 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -823,6 +823,7 @@ public abstract class LivingEntity extends Entity { @@ -823,6 +823,7 @@ public abstract class LivingEntity extends Entity {
if (nbt.contains("Team", 8)) { if (nbt.contains("Team", 8)) {
String s = nbt.getString("Team"); String s = nbt.getString("Team");
PlayerTeam scoreboardteam = this.level.getScoreboard().getPlayerTeam(s); PlayerTeam scoreboardteam = this.level.getScoreboard().getPlayerTeam(s);
+ if (!level.paperConfig.nonPlayerEntitiesOnScoreboards && !(this instanceof net.minecraft.world.entity.player.Player)) { scoreboardteam = null; } // Paper + if (!level.paperConfig().scoreboards.allowNonPlayerEntitiesOnScoreboards && !(this instanceof net.minecraft.world.entity.player.Player)) { scoreboardteam = null; } // Paper
boolean flag = scoreboardteam != null && this.level.getScoreboard().addPlayerToTeam(this.getStringUUID(), scoreboardteam); boolean flag = scoreboardteam != null && this.level.getScoreboard().addPlayerToTeam(this.getStringUUID(), scoreboardteam);
if (!flag) { if (!flag) {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Complete resource pack API
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 984209f32015d765367fd7693fb759de571b9ad0..9b057950417704669fdeb80efb2417904a010074 100644 index ea9a2b48d3d84fcf1ec263c920bacd80ae26cb27..8b971fa96e55f3c2f990fb58cfb772d504d48acc 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1686,8 +1686,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -1686,8 +1686,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@ -23,7 +23,7 @@ index 984209f32015d765367fd7693fb759de571b9ad0..9b057950417704669fdeb80efb241790
@Override @Override
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index b3c02dc06fcf2c47f2f6d1cb517786cfd824f987..b737c2bfe539f9758bb8368675bec270f8365786 100644 index 8fafbbf8556c295fd7bc21352c640101d15d3e7c..6b542ea548b078ca41f347614d25bcf00d30a87f 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -144,6 +144,7 @@ import org.bukkit.plugin.Plugin; @@ -144,6 +144,7 @@ import org.bukkit.plugin.Plugin;

View File

@ -15,29 +15,15 @@ modify that. Under the previous logic, plugins were unable (cleanly) override pe
A config option has been added for those who depend on the previous behavior, but I don't expect that. A config option has been added for those who depend on the previous behavior, but I don't expect that.
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index 7bbcee19248933f67fd40f46db43363890593c73..16707c734f33f6080875e5e3ea338affe2d2fa0c 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -234,4 +234,9 @@ public class PaperConfig {
" - Length: " + timeSummary(Timings.getHistoryLength() / 20) +
" - Server Name: " + timingsServerName);
}
+
+ public static boolean loadPermsBeforePlugins = true;
+ private static void loadPermsBeforePlugins() {
+ loadPermsBeforePlugins = getBoolean("settings.load-permissions-yml-before-plugins", true);
+ }
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index ff7f1347619d4df2a5c217a4b6545878ed81293c..c4860d85eb0a1cab7786982969d58a5729bc93c9 100644 index a8b963b336045c11c71dfff4e0ad0d66a9b47a92..c5095243aad4fc39bbdc8784837b111993f8b9e3 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -451,6 +451,7 @@ public final class CraftServer implements Server { @@ -451,6 +451,7 @@ public final class CraftServer implements Server {
if (type == PluginLoadOrder.STARTUP) { if (type == PluginLoadOrder.STARTUP) {
this.helpMap.clear(); this.helpMap.clear();
this.helpMap.initializeGeneralTopics(); this.helpMap.initializeGeneralTopics();
+ if (com.destroystokyo.paper.PaperConfig.loadPermsBeforePlugins) loadCustomPermissions(); // Paper + if (io.papermc.paper.configuration.GlobalConfiguration.get().misc.loadPermissionsYmlBeforePlugins) loadCustomPermissions(); // Paper
} }
Plugin[] plugins = this.pluginManager.getPlugins(); Plugin[] plugins = this.pluginManager.getPlugins();
@ -46,7 +32,7 @@ index ff7f1347619d4df2a5c217a4b6545878ed81293c..c4860d85eb0a1cab7786982969d58a57
DefaultPermissions.registerCorePermissions(); DefaultPermissions.registerCorePermissions();
CraftDefaultPermissions.registerCorePermissions(); CraftDefaultPermissions.registerCorePermissions();
- this.loadCustomPermissions(); - this.loadCustomPermissions();
+ if (!com.destroystokyo.paper.PaperConfig.loadPermsBeforePlugins) this.loadCustomPermissions(); // Paper + if (!io.papermc.paper.configuration.GlobalConfiguration.get().misc.loadPermissionsYmlBeforePlugins) this.loadCustomPermissions(); // Paper
this.helpMap.initializeCommands(); this.helpMap.initializeCommands();
this.syncCommands(); this.syncCommands();
} }

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Custom Permissions
https://github.com/PaperMC/Paper/issues/49 https://github.com/PaperMC/Paper/issues/49
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index c4860d85eb0a1cab7786982969d58a5729bc93c9..8aef55dc446c0fd62bc0913d65085132a63bbc71 100644 index c5095243aad4fc39bbdc8784837b111993f8b9e3..0f8d35e2c37088b98e47e046e40544c4e7bb01c8 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2504,5 +2504,23 @@ public final class CraftServer implements Server { @@ -2501,5 +2501,23 @@ public final class CraftServer implements Server {
} }
return this.adventure$audiences; return this.adventure$audiences;
} }
@ -17,7 +17,7 @@ index c4860d85eb0a1cab7786982969d58a5729bc93c9..8aef55dc446c0fd62bc0913d65085132
+ @Override + @Override
+ public void reloadPermissions() { + public void reloadPermissions() {
+ pluginManager.clearPermissions(); + pluginManager.clearPermissions();
+ if (com.destroystokyo.paper.PaperConfig.loadPermsBeforePlugins) loadCustomPermissions(); + if (io.papermc.paper.configuration.GlobalConfiguration.get().misc.loadPermissionsYmlBeforePlugins) loadCustomPermissions();
+ for (Plugin plugin : pluginManager.getPlugins()) { + for (Plugin plugin : pluginManager.getPlugins()) {
+ for (Permission perm : plugin.getDescription().getPermissions()) { + for (Permission perm : plugin.getDescription().getPermissions()) {
+ try { + try {
@ -27,7 +27,7 @@ index c4860d85eb0a1cab7786982969d58a5729bc93c9..8aef55dc446c0fd62bc0913d65085132
+ } + }
+ } + }
+ } + }
+ if (!com.destroystokyo.paper.PaperConfig.loadPermsBeforePlugins) loadCustomPermissions(); + if (!io.papermc.paper.configuration.GlobalConfiguration.get().misc.loadPermissionsYmlBeforePlugins) loadCustomPermissions();
+ DefaultPermissions.registerCorePermissions(); + DefaultPermissions.registerCorePermissions();
+ CraftDefaultPermissions.registerCorePermissions(); + CraftDefaultPermissions.registerCorePermissions();
+ } + }

View File

@ -7,11 +7,11 @@ Metadata is not meant to persist reload as things break badly with non primitive
This will remove metadata on reload so it does not crash everything if a plugin uses it. This will remove metadata on reload so it does not crash everything if a plugin uses it.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 8aef55dc446c0fd62bc0913d65085132a63bbc71..f40446e07308dd9f09622dba55933bc3486f80b8 100644 index 0f8d35e2c37088b98e47e046e40544c4e7bb01c8..90a2ed1b851a948b8ebf4ad6157003db19f1916f 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -940,8 +940,16 @@ public final class CraftServer implements Server { @@ -939,8 +939,16 @@ public final class CraftServer implements Server {
world.paperConfig.init(); // Paper world.spigotConfig.init(); // Spigot
} }
+ Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper + Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper
@ -26,4 +26,4 @@ index 8aef55dc446c0fd62bc0913d65085132a63bbc71..f40446e07308dd9f09622dba55933bc3
+ // Paper end + // Paper end
this.reloadData(); this.reloadData();
org.spigotmc.SpigotConfig.registerCommands(); // Spigot org.spigotmc.SpigotConfig.registerCommands(); // Spigot
com.destroystokyo.paper.PaperConfig.registerCommands(); // Paper io.papermc.paper.configuration.PaperConfigurations.registerCommands(this.console);

View File

@ -5,32 +5,8 @@ Subject: [PATCH] Configurable Non Player Arrow Despawn Rate
Can set a much shorter despawn rate for arrows that players can not pick up. Can set a much shorter despawn rate for arrows that players can not pick up.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 397995fe4c360d837282535b9b7aaf7f3d93f85f..4c4385d3d20556a2695f69c95d6b3cff087d26d9 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -271,4 +271,19 @@ public class PaperWorldConfig {
private void nonPlayerEntitiesOnScoreboards() {
nonPlayerEntitiesOnScoreboards = getBoolean("allow-non-player-entities-on-scoreboards", false);
}
+
+ public int nonPlayerArrowDespawnRate = -1;
+ public int creativeArrowDespawnRate = -1;
+ private void nonPlayerArrowDespawnRate() {
+ nonPlayerArrowDespawnRate = getInt("non-player-arrow-despawn-rate", -1);
+ if (nonPlayerArrowDespawnRate == -1) {
+ nonPlayerArrowDespawnRate = spigotConfig.arrowDespawnRate;
+ }
+ creativeArrowDespawnRate = getInt("creative-arrow-despawn-rate", -1);
+ if (creativeArrowDespawnRate == -1) {
+ creativeArrowDespawnRate = spigotConfig.arrowDespawnRate;
+ }
+ log("Non Player Arrow Despawn Rate: " + nonPlayerArrowDespawnRate);
+ log("Creative Arrow Despawn Rate: " + creativeArrowDespawnRate);
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
index 27c31a9e926f919c7edc8fc0cdd7fba70616d60c..046082ab7deb21574d9471b78a39a4a6bb296c2f 100644 index 27c31a9e926f919c7edc8fc0cdd7fba70616d60c..7cd802be238cedf166174a61e816d9d4b29b87d2 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java --- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java +++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
@@ -311,7 +311,7 @@ public abstract class AbstractArrow extends Projectile { @@ -311,7 +311,7 @@ public abstract class AbstractArrow extends Projectile {
@ -38,7 +14,7 @@ index 27c31a9e926f919c7edc8fc0cdd7fba70616d60c..046082ab7deb21574d9471b78a39a4a6
protected void tickDespawn() { protected void tickDespawn() {
++this.life; ++this.life;
- if (this.life >= ((this instanceof ThrownTrident) ? level.spigotConfig.tridentDespawnRate : level.spigotConfig.arrowDespawnRate)) { // Spigot - if (this.life >= ((this instanceof ThrownTrident) ? level.spigotConfig.tridentDespawnRate : level.spigotConfig.arrowDespawnRate)) { // Spigot
+ if (this.life >= (pickup == Pickup.CREATIVE_ONLY ? level.paperConfig.creativeArrowDespawnRate : (pickup == Pickup.DISALLOWED ? level.paperConfig.nonPlayerArrowDespawnRate : ((this instanceof ThrownTrident) ? level.spigotConfig.tridentDespawnRate : level.spigotConfig.arrowDespawnRate)))) { // Spigot // Paper - TODO: Extract this to init? + if (this.life >= (pickup == Pickup.CREATIVE_ONLY ? level.paperConfig().entities.spawning.creativeArrowDespawnRate.value() : (pickup == Pickup.DISALLOWED ? level.paperConfig().entities.spawning.nonPlayerArrowDespawnRate.value() : ((this instanceof ThrownTrident) ? level.spigotConfig.tridentDespawnRate : level.spigotConfig.arrowDespawnRate)))) { // Spigot // Paper - TODO: Extract this to init?
this.discard(); this.discard();
} }

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Add World Util Methods
Methods that can be used for other patches to help improve logic. Methods that can be used for other patches to help improve logic.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index a04e75293b1d196341bc641ee7da975bf9baec13..64661de5763ac184eed690b15a8665b1dc1a3603 100644 index 0023f18e7b856f6178e516d1b692d3697ba99631..42489fe2054d75ce6fe7dd62e248387c85c0e4e5 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -214,7 +214,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -214,7 +214,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@ -19,10 +19,10 @@ index a04e75293b1d196341bc641ee7da975bf9baec13..64661de5763ac184eed690b15a8665b1
} }
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 2bc5b3c76264a5a23170adbc2e04c55a5e4f2a6a..7f52bf3e2b6588ce4e364906500f24e323bdb664 100644 index 447ce111786a53fca6b0f6c8803b47f9cadd7df7..19aca3026b2c5a7eb4288ef1a0ea297989d1c948 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -329,6 +329,22 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -333,6 +333,22 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
return chunk == null ? null : chunk.getFluidState(blockposition); return chunk == null ? null : chunk.getFluidState(blockposition);
} }

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Custom replacement for eaten items
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 3f82c88058edb5c37fff98d760d931de20a85b5d..0eafee2cb706a20f9eb7c5a7e4f2fc81b9f952c9 100644 index 3710cf92bd29f69bb86d72a7adbb8df9bf4f8f08..ef820cd573a3c2366698df658dd8de6981c95e73 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3586,9 +3586,10 @@ public abstract class LivingEntity extends Entity { @@ -3586,9 +3586,10 @@ public abstract class LivingEntity extends Entity {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] handle NaN health/absorb values and repair bad data
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 0eafee2cb706a20f9eb7c5a7e4f2fc81b9f952c9..80f8fe489ea403b48cd7b7218ce32d4926f98136 100644 index ef820cd573a3c2366698df658dd8de6981c95e73..e9747640adff75df331e794f08397619379ae280 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -784,7 +784,13 @@ public abstract class LivingEntity extends Entity { @@ -784,7 +784,13 @@ public abstract class LivingEntity extends Entity {
@ -44,7 +44,7 @@ index 0eafee2cb706a20f9eb7c5a7e4f2fc81b9f952c9..80f8fe489ea403b48cd7b7218ce32d49
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index b737c2bfe539f9758bb8368675bec270f8365786..8c8f0df271cb1fab92aeb342289fa116cf5b93a8 100644 index 6b542ea548b078ca41f347614d25bcf00d30a87f..213037a4c545db70ca5e66018057216cbb6532d3 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1913,6 +1913,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1913,6 +1913,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -6,7 +6,7 @@ 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. 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/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index e6917848029b1686e4e3a1a0eadac85eda92518d..3e0f58a928931fd1b3ee32f9dadf65288d8798d6 100644 index 704a5aa2881c6f826d49ad9aed6003db7c5f5843..e3fe98ef3a7537d3717824d3357cc84c632ee0ea 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -158,6 +158,74 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -158,6 +158,74 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {

View File

@ -4,25 +4,8 @@ Date: Tue, 22 Mar 2016 12:04:28 -0500
Subject: [PATCH] Configurable spawn chances for skeleton horses Subject: [PATCH] Configurable spawn chances for skeleton horses
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 4c4385d3d20556a2695f69c95d6b3cff087d26d9..fa730fd8b969e39cf063a560d9820d3655709398 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -286,4 +286,12 @@ public class PaperWorldConfig {
log("Non Player Arrow Despawn Rate: " + nonPlayerArrowDespawnRate);
log("Creative Arrow Despawn Rate: " + creativeArrowDespawnRate);
}
+
+ public double skeleHorseSpawnChance;
+ private void skeleHorseSpawnChance() {
+ skeleHorseSpawnChance = getDouble("skeleton-horse-thunder-spawn-chance", 0.01D);
+ if (skeleHorseSpawnChance < 0) {
+ skeleHorseSpawnChance = 0.01D; // Vanilla value
+ }
+ }
}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 64661de5763ac184eed690b15a8665b1dc1a3603..033a4324800d8e4f057d65a9e41ea46c9eebfc6e 100644 index 42489fe2054d75ce6fe7dd62e248387c85c0e4e5..6b85a9ee89bf2f01385aa0d3aab2e92325381021 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -583,7 +583,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -583,7 +583,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@ -30,7 +13,7 @@ index 64661de5763ac184eed690b15a8665b1dc1a3603..033a4324800d8e4f057d65a9e41ea46c
if (this.isRainingAt(blockposition)) { if (this.isRainingAt(blockposition)) {
DifficultyInstance difficultydamagescaler = this.getCurrentDifficultyAt(blockposition); DifficultyInstance difficultydamagescaler = this.getCurrentDifficultyAt(blockposition);
- boolean flag1 = this.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && this.random.nextDouble() < (double) difficultydamagescaler.getEffectiveDifficulty() * 0.01D && !this.getBlockState(blockposition.below()).is(Blocks.LIGHTNING_ROD); - boolean flag1 = this.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && this.random.nextDouble() < (double) difficultydamagescaler.getEffectiveDifficulty() * 0.01D && !this.getBlockState(blockposition.below()).is(Blocks.LIGHTNING_ROD);
+ boolean flag1 = this.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && this.random.nextDouble() < (double) difficultydamagescaler.getEffectiveDifficulty() * paperConfig.skeleHorseSpawnChance && !this.getBlockState(blockposition.below()).is(Blocks.LIGHTNING_ROD); // Paper + boolean flag1 = this.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && this.random.nextDouble() < (double) difficultydamagescaler.getEffectiveDifficulty() * this.paperConfig().entities.spawning.skeletonHorseThunderSpawnChance.or(0.01D) && !this.getBlockState(blockposition.below()).is(Blocks.LIGHTNING_ROD); // Paper
if (flag1) { if (flag1) {
SkeletonHorse entityhorseskeleton = (SkeletonHorse) EntityType.SKELETON_HORSE.create(this); SkeletonHorse entityhorseskeleton = (SkeletonHorse) EntityType.SKELETON_HORSE.create(this);

View File

@ -29,10 +29,10 @@ index 4587a3668b6be9222cdd74a38229f89f611d1af6..9f32861d791f7e4cb39d2ad01f48e191
this.x = x; this.x = x;
this.y = y; this.y = y;
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 7f52bf3e2b6588ce4e364906500f24e323bdb664..b087f8a58d18df43a04dae3f1a5a8083df10f6e0 100644 index 19aca3026b2c5a7eb4288ef1a0ea297989d1c948..7c058e32b83847625bd4136bfed9b5804e8beca7 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -272,7 +272,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -276,7 +276,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
} }
public boolean isInWorldBounds(BlockPos pos) { public boolean isInWorldBounds(BlockPos pos) {

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Only process BlockPhysicsEvent if a plugin has a listener
Saves on some object allocation and processing when no plugin listens to this Saves on some object allocation and processing when no plugin listens to this
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 1a5ccea7daca76b7c5524c92ce431cea82c8b500..9bc6343887e0078c9778bffb24cd130e3ff53423 100644 index 21e09c039a4c3fa64f6456e5cc7d50463590f787..cfbf7efb06f7ed6064930c4154c6e3e949dc0b25 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1354,6 +1354,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1355,6 +1355,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
while (iterator.hasNext()) { while (iterator.hasNext()) {
ServerLevel worldserver = (ServerLevel) iterator.next(); ServerLevel worldserver = (ServerLevel) iterator.next();
@ -18,7 +18,7 @@ index 1a5ccea7daca76b7c5524c92ce431cea82c8b500..9bc6343887e0078c9778bffb24cd130e
this.profiler.push(() -> { this.profiler.push(() -> {
return worldserver + " " + worldserver.dimension().location(); return worldserver + " " + worldserver.dimension().location();
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 033a4324800d8e4f057d65a9e41ea46c9eebfc6e..525ed4ddfbf898e7e8af5f2283fde7d5ba9a96d9 100644 index 6b85a9ee89bf2f01385aa0d3aab2e92325381021..868db73e815a59f7f917de64f3cc45d89f5b6bb5 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -213,6 +213,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -213,6 +213,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@ -30,10 +30,10 @@ index 033a4324800d8e4f057d65a9e41ea46c9eebfc6e..525ed4ddfbf898e7e8af5f2283fde7d5
@Override public LevelChunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI @Override public LevelChunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI
return this.chunkSource.getChunk(x, z, false); return this.chunkSource.getChunk(x, z, false);
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index b087f8a58d18df43a04dae3f1a5a8083df10f6e0..5732a9a41a14e5297631d78f924b2082efcfe9da 100644 index 7c058e32b83847625bd4136bfed9b5804e8beca7..46c7c63d4dced4e75079588cef2c155859e5ae36 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -484,7 +484,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -488,7 +488,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// CraftBukkit start // CraftBukkit start
iblockdata1.updateIndirectNeighbourShapes(this, blockposition, k, j - 1); // Don't call an event for the old block to limit event spam iblockdata1.updateIndirectNeighbourShapes(this, blockposition, k, j - 1); // Don't call an event for the old block to limit event spam
CraftWorld world = ((ServerLevel) this).getWorld(); CraftWorld world = ((ServerLevel) this).getWorld();

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Entity AddTo/RemoveFrom World Events
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 525ed4ddfbf898e7e8af5f2283fde7d5ba9a96d9..3e78f79c489899e00b375949b178cdea695f79b1 100644 index 868db73e815a59f7f917de64f3cc45d89f5b6bb5..1115f4e444ae36d84a6f148930a3e2287e76b55a 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2115,6 +2115,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -2115,6 +2115,7 @@ public class ServerLevel extends Level implements WorldGenLevel {

View File

@ -10,27 +10,8 @@ For people who want all chunks to be treated equally, you can chose a fixed valu
This allows to fine-tune vanilla gameplay. This allows to fine-tune vanilla gameplay.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index fa730fd8b969e39cf063a560d9820d3655709398..3e7a98073c86d94881e7c03786e3745db2c445cd 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -294,4 +294,14 @@ public class PaperWorldConfig {
skeleHorseSpawnChance = 0.01D; // Vanilla value
}
}
+
+ public int fixedInhabitedTime;
+ private void fixedInhabitedTime() {
+ if (PaperConfig.version < 16) {
+ if (!config.getBoolean("world-settings.default.use-chunk-inhabited-timer", true)) config.set("world-settings.default.fixed-chunk-inhabited-time", 0);
+ if (!config.getBoolean("world-settings." + worldName + ".use-chunk-inhabited-timer", true)) config.set("world-settings." + worldName + ".fixed-chunk-inhabited-time", 0);
+ set("use-chunk-inhabited-timer", null);
+ }
+ fixedInhabitedTime = getInt("fixed-chunk-inhabited-time", -1);
+ }
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
index a508b7c6dbf9f7acdca77c219d7dd2492cd7c6b8..605ec3ac08845178795721977b685dfbaab33156 100644 index a508b7c6dbf9f7acdca77c219d7dd2492cd7c6b8..e9fae214f60fe682087d41cfaa55a1b25e5f4331 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -281,6 +281,13 @@ public class LevelChunk extends ChunkAccess { @@ -281,6 +281,13 @@ public class LevelChunk extends ChunkAccess {
@ -40,7 +21,7 @@ index a508b7c6dbf9f7acdca77c219d7dd2492cd7c6b8..605ec3ac08845178795721977b685dfb
+ // Paper start + // Paper start
+ @Override + @Override
+ public long getInhabitedTime() { + public long getInhabitedTime() {
+ return this.level.paperConfig.fixedInhabitedTime < 0 ? super.getInhabitedTime() : this.level.paperConfig.fixedInhabitedTime; + return this.level.paperConfig().chunks.fixedChunkInhabitedTime < 0 ? super.getInhabitedTime() : this.level.paperConfig().chunks.fixedChunkInhabitedTime;
+ } + }
+ // Paper end + // Paper end
+ +

View File

@ -10,22 +10,8 @@ used RegionFile.
The implementation uses a LinkedHashMap as an LRU cache (modified from HashMap). The implementation uses a LinkedHashMap as an LRU cache (modified from HashMap).
The maximum size of the RegionFileCache is also made configurable. The maximum size of the RegionFileCache is also made configurable.
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index 16707c734f33f6080875e5e3ea338affe2d2fa0c..584d3a0f839cbcb6b3161f695c7f7d4869d04577 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -239,4 +239,9 @@ public class PaperConfig {
private static void loadPermsBeforePlugins() {
loadPermsBeforePlugins = getBoolean("settings.load-permissions-yml-before-plugins", true);
}
+
+ public static int regionFileCacheSize = 256;
+ private static void regionFileCacheSize() {
+ regionFileCacheSize = Math.max(getInt("settings.region-file-cache-size", 256), 4);
+ }
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
index eaf22cec54b512e0f57606f50627d5fe9b39bd5c..deb852aa0fb2ad55a94d3c7ee542a0cc8013be42 100644 index eaf22cec54b512e0f57606f50627d5fe9b39bd5c..5a35e5040726a981ae91f018f05b91c178a54ba0 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java --- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
@@ -36,7 +36,7 @@ public class RegionFileStorage implements AutoCloseable { @@ -36,7 +36,7 @@ public class RegionFileStorage implements AutoCloseable {
@ -33,7 +19,7 @@ index eaf22cec54b512e0f57606f50627d5fe9b39bd5c..deb852aa0fb2ad55a94d3c7ee542a0cc
return regionfile; return regionfile;
} else { } else {
- if (this.regionCache.size() >= 256) { - if (this.regionCache.size() >= 256) {
+ if (this.regionCache.size() >= com.destroystokyo.paper.PaperConfig.regionFileCacheSize) { // Paper - configurable + if (this.regionCache.size() >= io.papermc.paper.configuration.GlobalConfiguration.get().misc.regionFileCacheSize) { // Paper - configurable
((RegionFile) this.regionCache.removeLast()).close(); ((RegionFile) this.regionCache.removeLast()).close();
} }

View File

@ -20,7 +20,7 @@ index 8834ed411a7db86b4d2b88183a1315317107d719..c45b5ab6776f3ac79f856c3a6467c510
static final ServerboundInteractPacket.Action ATTACK_ACTION = new ServerboundInteractPacket.Action() { static final ServerboundInteractPacket.Action ATTACK_ACTION = new ServerboundInteractPacket.Action() {
@Override @Override
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 9b057950417704669fdeb80efb2417904a010074..1b92ee3988c1bdcbc751f32bd480b2ad2f588139 100644 index 8b971fa96e55f3c2f990fb58cfb772d504d48acc..e7d9af82a11fb5c1250c76d32f21cc720c002da2 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2410,8 +2410,37 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -2410,8 +2410,37 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser

View File

@ -4,23 +4,8 @@ Date: Sun, 3 Apr 2016 16:28:17 -0400
Subject: [PATCH] Configurable Grass Spread Tick Rate Subject: [PATCH] Configurable Grass Spread Tick Rate
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 3e7a98073c86d94881e7c03786e3745db2c445cd..8dcb136f3f77bc69d5976cc17ecdafb91b5be1bc 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -304,4 +304,10 @@ public class PaperWorldConfig {
}
fixedInhabitedTime = getInt("fixed-chunk-inhabited-time", -1);
}
+
+ public int grassUpdateRate = 1;
+ private void grassUpdateRate() {
+ grassUpdateRate = Math.max(0, getInt("grass-spread-tick-rate", grassUpdateRate));
+ log("Grass Spread Tick Rate: " + grassUpdateRate);
+ }
}
diff --git a/src/main/java/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java b/src/main/java/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java b/src/main/java/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java
index bd5a45765b53bf4f2f9aaea4769c71ffb008741d..845f086eb8cc7dd87c820065e7621c3c2a5cc04f 100644 index bd5a45765b53bf4f2f9aaea4769c71ffb008741d..61783f17b655cbb6430d22fb3a81931ab3ea130c 100644
--- a/src/main/java/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java --- a/src/main/java/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java +++ b/src/main/java/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java
@@ -2,6 +2,7 @@ package net.minecraft.world.level.block; @@ -2,6 +2,7 @@ package net.minecraft.world.level.block;
@ -35,7 +20,7 @@ index bd5a45765b53bf4f2f9aaea4769c71ffb008741d..845f086eb8cc7dd87c820065e7621c3c
@Override @Override
public void randomTick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) { public void randomTick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
+ if (this instanceof GrassBlock && world.paperConfig.grassUpdateRate != 1 && (world.paperConfig.grassUpdateRate < 1 || (MinecraftServer.currentTick + pos.hashCode()) % world.paperConfig.grassUpdateRate != 0)) { return; } // Paper + if (this instanceof GrassBlock && world.paperConfig().tickRates.grassSpread != 1 && (world.paperConfig().tickRates.grassSpread < 1 || (MinecraftServer.currentTick + pos.hashCode()) % world.paperConfig().tickRates.grassSpread != 0)) { return; } // Paper
if (!SpreadingSnowyDirtBlock.canBeGrass(state, world, pos)) { if (!SpreadingSnowyDirtBlock.canBeGrass(state, world, pos)) {
// CraftBukkit start // CraftBukkit start
if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(world, pos, Blocks.DIRT.defaultBlockState()).isCancelled()) { if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(world, pos, Blocks.DIRT.defaultBlockState()).isCancelled()) {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Fix Cancelling BlockPlaceEvent triggering physics
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 3e78f79c489899e00b375949b178cdea695f79b1..39343854ea106aaa2c1c9f490cbdae28eb2550e6 100644 index 1115f4e444ae36d84a6f148930a3e2287e76b55a..a81fbe11d7b3af9ce17db1dc5dfe2eb7e043a4a5 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1361,6 +1361,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1361,6 +1361,7 @@ public class ServerLevel extends Level implements WorldGenLevel {

View File

@ -11,22 +11,8 @@ bukkit's concept of a display name would be preferable. There was a PR
for this on CB at one point but I can't find it. We may need to do this for this on CB at one point but I can't find it. We may need to do this
ourselves at some point in the future. ourselves at some point in the future.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 8dcb136f3f77bc69d5976cc17ecdafb91b5be1bc..8381b1c9ffa5d9f28281336d5a3df4d01253dd92 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -310,4 +310,9 @@ public class PaperWorldConfig {
grassUpdateRate = Math.max(0, getInt("grass-spread-tick-rate", grassUpdateRate));
log("Grass Spread Tick Rate: " + grassUpdateRate);
}
+
+ public boolean useVanillaScoreboardColoring;
+ private void useVanillaScoreboardColoring() {
+ useVanillaScoreboardColoring = getBoolean("use-vanilla-world-scoreboard-name-coloring", false);
+ }
}
diff --git a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java diff --git a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
index 3526bc0b6ad590776124966ea907fe2467cbbf5f..65005e9818ef603724ff8f8041f617f1e602a868 100644 index 3526bc0b6ad590776124966ea907fe2467cbbf5f..b13d516d91788713768b5c336537ffe31653b074 100644
--- a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java --- a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
+++ b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java +++ b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
@@ -16,6 +16,8 @@ import net.kyori.adventure.text.event.ClickEvent; @@ -16,6 +16,8 @@ import net.kyori.adventure.text.event.ClickEvent;
@ -42,14 +28,14 @@ index 3526bc0b6ad590776124966ea907fe2467cbbf5f..65005e9818ef603724ff8f8041f617f1
} }
private static String legacyDisplayName(final CraftPlayer player) { private static String legacyDisplayName(final CraftPlayer player) {
+ if (((CraftWorld) player.getWorld()).getHandle().paperConfig.useVanillaScoreboardColoring) { + if (((org.bukkit.craftbukkit.CraftWorld) player.getWorld()).getHandle().paperConfig().scoreboards.useVanillaWorldScoreboardNameColoring) {
+ return LegacyComponentSerializer.legacySection().serialize(player.teamDisplayName()) + ChatColor.RESET; + return LegacyComponentSerializer.legacySection().serialize(player.teamDisplayName()) + ChatColor.RESET;
+ } + }
return player.getDisplayName(); return player.getDisplayName();
} }
private static Component displayName(final CraftPlayer player) { private static Component displayName(final CraftPlayer player) {
+ if (((CraftWorld) player.getWorld()).getHandle().paperConfig.useVanillaScoreboardColoring) { + if (((CraftWorld) player.getWorld()).getHandle().paperConfig().scoreboards.useVanillaWorldScoreboardNameColoring) {
+ return player.teamDisplayName(); + return player.teamDisplayName();
+ } + }
return player.displayName(); return player.displayName();

View File

@ -4,22 +4,8 @@ Date: Wed, 13 Apr 2016 02:10:49 -0400
Subject: [PATCH] Configurable Player Collision Subject: [PATCH] Configurable Player Collision
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index 584d3a0f839cbcb6b3161f695c7f7d4869d04577..ae48897bd52934d35fcb10c545ae79cc4fb57d5a 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -244,4 +244,9 @@ public class PaperConfig {
private static void regionFileCacheSize() {
regionFileCacheSize = Math.max(getInt("settings.region-file-cache-size", 256), 4);
}
+
+ public static boolean enablePlayerCollisions = true;
+ private static void enablePlayerCollisions() {
+ enablePlayerCollisions = getBoolean("settings.enable-player-collisions", true);
+ }
}
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetPlayerTeamPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundSetPlayerTeamPacket.java diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetPlayerTeamPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundSetPlayerTeamPacket.java
index 1294b38262505b0d54089e428df9b363219de1f0..c5339618c195507c1d1482e4e77e262e8db240a5 100644 index 1294b38262505b0d54089e428df9b363219de1f0..ee37ec0de1ca969144824427ae42b0c81434a1b4 100644
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetPlayerTeamPacket.java --- a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetPlayerTeamPacket.java
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundSetPlayerTeamPacket.java +++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundSetPlayerTeamPacket.java
@@ -193,7 +193,7 @@ public class ClientboundSetPlayerTeamPacket implements Packet<ClientGamePacketLi @@ -193,7 +193,7 @@ public class ClientboundSetPlayerTeamPacket implements Packet<ClientGamePacketLi
@ -27,36 +13,28 @@ index 1294b38262505b0d54089e428df9b363219de1f0..c5339618c195507c1d1482e4e77e262e
buf.writeByte(this.options); buf.writeByte(this.options);
buf.writeUtf(this.nametagVisibility); buf.writeUtf(this.nametagVisibility);
- buf.writeUtf(this.collisionRule); - buf.writeUtf(this.collisionRule);
+ buf.writeUtf(!com.destroystokyo.paper.PaperConfig.enablePlayerCollisions ? "never" : this.collisionRule); // Paper + buf.writeUtf(!io.papermc.paper.configuration.GlobalConfiguration.get().collisions.enablePlayerCollisions ? "never" : this.collisionRule); // Paper
buf.writeEnum(this.color); buf.writeEnum(this.color);
buf.writeComponent(this.playerPrefix); buf.writeComponent(this.playerPrefix);
buf.writeComponent(this.playerSuffix); buf.writeComponent(this.playerSuffix);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 68a4fa890250f6c54367cbe319dd9485c988bbb7..4a84a0cea0ccc5de699c5b1e1a6686a72b954e40 100644 index cfbf7efb06f7ed6064930c4154c6e3e949dc0b25..032ba4071f7562cd0c0bf3f2de46130692544ef0 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -150,6 +150,7 @@ import net.minecraft.world.level.storage.loot.LootTables; @@ -577,6 +577,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
import net.minecraft.world.level.storage.loot.PredicateManager;
import net.minecraft.world.phys.Vec2;
import net.minecraft.world.phys.Vec3;
+import net.minecraft.world.scores.PlayerTeam; // Paper
import org.apache.commons.lang3.Validate;
import org.slf4j.Logger;
@@ -576,6 +577,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldLoadEvent(worldserver.getWorld())); this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldLoadEvent(worldserver.getWorld()));
} }
+ // Paper start - Handle collideRule team for player collision toggle + // Paper start - Handle collideRule team for player collision toggle
+ final ServerScoreboard scoreboard = this.getScoreboard(); + final ServerScoreboard scoreboard = this.getScoreboard();
+ final java.util.Collection<String> toRemove = scoreboard.getPlayerTeams().stream().filter(team -> team.getName().startsWith("collideRule_")).map(PlayerTeam::getName).collect(java.util.stream.Collectors.toList()); + final java.util.Collection<String> toRemove = scoreboard.getPlayerTeams().stream().filter(team -> team.getName().startsWith("collideRule_")).map(net.minecraft.world.scores.PlayerTeam::getName).collect(java.util.stream.Collectors.toList());
+ for (String teamName : toRemove) { + for (String teamName : toRemove) {
+ scoreboard.removePlayerTeam(scoreboard.getPlayerTeam(teamName)); // Clean up after ourselves + scoreboard.removePlayerTeam(scoreboard.getPlayerTeam(teamName)); // Clean up after ourselves
+ } + }
+ +
+ if (!com.destroystokyo.paper.PaperConfig.enablePlayerCollisions) { + if (!io.papermc.paper.configuration.GlobalConfiguration.get().collisions.enablePlayerCollisions) {
+ this.getPlayerList().collideRuleTeamName = org.apache.commons.lang3.StringUtils.left("collideRule_" + java.util.concurrent.ThreadLocalRandom.current().nextInt(), 16); + this.getPlayerList().collideRuleTeamName = org.apache.commons.lang3.StringUtils.left("collideRule_" + java.util.concurrent.ThreadLocalRandom.current().nextInt(), 16);
+ PlayerTeam collideTeam = scoreboard.addPlayerTeam(this.getPlayerList().collideRuleTeamName); + net.minecraft.world.scores.PlayerTeam collideTeam = scoreboard.addPlayerTeam(this.getPlayerList().collideRuleTeamName);
+ collideTeam.setSeeFriendlyInvisibles(false); // Because we want to mimic them not being on a team at all + collideTeam.setSeeFriendlyInvisibles(false); // Because we want to mimic them not being on a team at all
+ } + }
+ // Paper end + // Paper end
@ -65,7 +43,7 @@ index 68a4fa890250f6c54367cbe319dd9485c988bbb7..4a84a0cea0ccc5de699c5b1e1a6686a7
this.server.getPluginManager().callEvent(new ServerLoadEvent(ServerLoadEvent.LoadType.STARTUP)); this.server.getPluginManager().callEvent(new ServerLoadEvent(ServerLoadEvent.LoadType.STARTUP));
this.connection.acceptConnections(); this.connection.acceptConnections();
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 4cf2264208ce681d92441cd06bf8120d586bc82a..e0b279d9437b30ca4a18a3036bf59664570a746f 100644 index 16e1d0b62e01551a54d60c81ca12708f51aceef9..3fe3d417b6c1ff49a412c308bfe6a43182d0986e 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -98,6 +98,7 @@ import net.minecraft.world.level.storage.PlayerDataStorage; @@ -98,6 +98,7 @@ import net.minecraft.world.level.storage.PlayerDataStorage;

View File

@ -6,7 +6,7 @@ Subject: [PATCH] EntityRegainHealthEvent isFastRegen API
Don't even get me started Don't even get me started
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 80f8fe489ea403b48cd7b7218ce32d4926f98136..7a4996d720cc093f5c4b72356f20fc316cf9c533 100644 index e9747640adff75df331e794f08397619379ae280..3a597e7ce159b78078b1d64258a6f30e51645f3b 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1250,10 +1250,16 @@ public abstract class LivingEntity extends Entity { @@ -1250,10 +1250,16 @@ public abstract class LivingEntity extends Entity {

View File

@ -4,34 +4,15 @@ Date: Thu, 21 Apr 2016 23:51:55 -0700
Subject: [PATCH] Add ability to configure frosted_ice properties Subject: [PATCH] Add ability to configure frosted_ice properties
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 8381b1c9ffa5d9f28281336d5a3df4d01253dd92..2c7cdf91288eb9a88d1d453accc87a8d77e6daac 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -315,4 +315,14 @@ public class PaperWorldConfig {
private void useVanillaScoreboardColoring() {
useVanillaScoreboardColoring = getBoolean("use-vanilla-world-scoreboard-name-coloring", false);
}
+
+ public boolean frostedIceEnabled = true;
+ public int frostedIceDelayMin = 20;
+ public int frostedIceDelayMax = 40;
+ private void frostedIce() {
+ this.frostedIceEnabled = this.getBoolean("frosted-ice.enabled", this.frostedIceEnabled);
+ this.frostedIceDelayMin = this.getInt("frosted-ice.delay.min", this.frostedIceDelayMin);
+ this.frostedIceDelayMax = this.getInt("frosted-ice.delay.max", this.frostedIceDelayMax);
+ log("Frosted Ice: " + (this.frostedIceEnabled ? "enabled" : "disabled") + " / delay: min=" + this.frostedIceDelayMin + ", max=" + this.frostedIceDelayMax);
+ }
}
diff --git a/src/main/java/net/minecraft/world/level/block/FrostedIceBlock.java b/src/main/java/net/minecraft/world/level/block/FrostedIceBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/FrostedIceBlock.java b/src/main/java/net/minecraft/world/level/block/FrostedIceBlock.java
index e1916fe8a7aa736d9266efde954bbfbda38a3a65..d2de8192cbdae37fc7baaef998254bd82485fc72 100644 index e1916fe8a7aa736d9266efde954bbfbda38a3a65..331b642c36af97f7f05bd63f96d42d1af443e5a3 100644
--- a/src/main/java/net/minecraft/world/level/block/FrostedIceBlock.java --- a/src/main/java/net/minecraft/world/level/block/FrostedIceBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/FrostedIceBlock.java +++ b/src/main/java/net/minecraft/world/level/block/FrostedIceBlock.java
@@ -32,6 +32,7 @@ public class FrostedIceBlock extends IceBlock { @@ -32,6 +32,7 @@ public class FrostedIceBlock extends IceBlock {
@Override @Override
public void tick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) { public void tick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
+ if (!world.paperConfig.frostedIceEnabled) return; // Paper - add ability to disable frosted ice + if (!world.paperConfig().environment.frostedIce.enabled) return; // Paper - add ability to disable frosted ice
if ((random.nextInt(3) == 0 || this.fewerNeigboursThan(world, pos, 4)) && world.getMaxLocalRawBrightness(pos) > 11 - state.getValue(AGE) - state.getLightBlock(world, pos) && this.slightlyMelt(state, world, pos)) { if ((random.nextInt(3) == 0 || this.fewerNeigboursThan(world, pos, 4)) && world.getMaxLocalRawBrightness(pos) > 11 - state.getValue(AGE) - state.getLightBlock(world, pos) && this.slightlyMelt(state, world, pos)) {
BlockPos.MutableBlockPos mutableBlockPos = new BlockPos.MutableBlockPos(); BlockPos.MutableBlockPos mutableBlockPos = new BlockPos.MutableBlockPos();
@ -40,13 +21,13 @@ index e1916fe8a7aa736d9266efde954bbfbda38a3a65..d2de8192cbdae37fc7baaef998254bd8
BlockState blockState = world.getBlockState(mutableBlockPos); BlockState blockState = world.getBlockState(mutableBlockPos);
if (blockState.is(this) && !this.slightlyMelt(blockState, world, mutableBlockPos)) { if (blockState.is(this) && !this.slightlyMelt(blockState, world, mutableBlockPos)) {
- world.scheduleTick(mutableBlockPos, this, Mth.nextInt(random, 20, 40)); - world.scheduleTick(mutableBlockPos, this, Mth.nextInt(random, 20, 40));
+ world.scheduleTick(mutableBlockPos, this, Mth.nextInt(random, world.paperConfig.frostedIceDelayMin, world.paperConfig.frostedIceDelayMax)); // Paper - use configurable min/max delay + world.scheduleTick(mutableBlockPos, this, Mth.nextInt(random, world.paperConfig().environment.frostedIce.delay.min, world.paperConfig().environment.frostedIce.delay.max)); // Paper - use configurable min/max delay
} }
} }
} else { } else {
- world.scheduleTick(pos, this, Mth.nextInt(random, 20, 40)); - world.scheduleTick(pos, this, Mth.nextInt(random, 20, 40));
+ world.scheduleTick(pos, this, Mth.nextInt(random, world.paperConfig.frostedIceDelayMin, world.paperConfig.frostedIceDelayMax)); // Paper - use configurable min/max delay + world.scheduleTick(pos, this, Mth.nextInt(random, world.paperConfig().environment.frostedIce.delay.min, world.paperConfig().environment.frostedIce.delay.max)); // Paper - use configurable min/max delay
} }
} }

View File

@ -6,10 +6,10 @@ Subject: [PATCH] remove null possibility for getServer singleton
to stop IDE complaining about potential NPE 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 diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 4a84a0cea0ccc5de699c5b1e1a6686a72b954e40..b62d7b2e974f9eafb8e60ddb9ed58273b0393185 100644 index 032ba4071f7562cd0c0bf3f2de46130692544ef0..681121909bdf81d5a05670f0b0150f6276d00281 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -180,6 +180,7 @@ import co.aikar.timings.MinecraftTimings; // Paper @@ -179,6 +179,7 @@ import co.aikar.timings.MinecraftTimings; // Paper
public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements CommandSource, AutoCloseable { public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements CommandSource, AutoCloseable {

View File

@ -13,7 +13,7 @@ custom renderers are in use, defaulting to the much simpler Vanilla system.
Additionally, numerous issues to player position tracking on maps has been fixed. Additionally, numerous issues to player position tracking on maps has been fixed.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 39343854ea106aaa2c1c9f490cbdae28eb2550e6..5ee25084459f4cfcc8a95001a9d480e4a235f9f0 100644 index a81fbe11d7b3af9ce17db1dc5dfe2eb7e043a4a5..535cb7102ad69c34e3035422429c9874ba434e31 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2136,6 +2136,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -2136,6 +2136,7 @@ public class ServerLevel extends Level implements WorldGenLevel {

View File

@ -10,37 +10,6 @@ can automatically replenish after a given time.
This feature is good for long term worlds so that newer players This feature is good for long term worlds so that newer players
do not suffer with "Every chest has been looted" do not suffer with "Every chest has been looted"
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 2c7cdf91288eb9a88d1d453accc87a8d77e6daac..a491af30f70f41e5f7b198ae4d40acfb6eec9b38 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -325,4 +325,26 @@ public class PaperWorldConfig {
this.frostedIceDelayMax = this.getInt("frosted-ice.delay.max", this.frostedIceDelayMax);
log("Frosted Ice: " + (this.frostedIceEnabled ? "enabled" : "disabled") + " / delay: min=" + this.frostedIceDelayMin + ", max=" + this.frostedIceDelayMax);
}
+
+ public boolean autoReplenishLootables;
+ public boolean restrictPlayerReloot;
+ public boolean changeLootTableSeedOnFill;
+ public int maxLootableRefills;
+ public int lootableRegenMin;
+ public int lootableRegenMax;
+ private void enhancedLootables() {
+ autoReplenishLootables = getBoolean("lootables.auto-replenish", false);
+ restrictPlayerReloot = getBoolean("lootables.restrict-player-reloot", true);
+ changeLootTableSeedOnFill = getBoolean("lootables.reset-seed-on-fill", true);
+ maxLootableRefills = getInt("lootables.max-refills", -1);
+ lootableRegenMin = PaperConfig.getSeconds(getString("lootables.refresh-min", "12h"));
+ lootableRegenMax = PaperConfig.getSeconds(getString("lootables.refresh-max", "2d"));
+ if (autoReplenishLootables) {
+ log("Lootables: Replenishing every " +
+ PaperConfig.timeSummary(lootableRegenMin) + " to " +
+ PaperConfig.timeSummary(lootableRegenMax) +
+ (restrictPlayerReloot ? " (restricting reloot)" : "")
+ );
+ }
+ }
}
diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperContainerEntityLootableInventory.java b/src/main/java/com/destroystokyo/paper/loottable/PaperContainerEntityLootableInventory.java diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperContainerEntityLootableInventory.java b/src/main/java/com/destroystokyo/paper/loottable/PaperContainerEntityLootableInventory.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..88e32ed64f90bfd277dac84ba4bd84f0d943f5f8 index 0000000000000000000000000000000000000000..88e32ed64f90bfd277dac84ba4bd84f0d943f5f8
@ -185,7 +154,7 @@ index 0000000000000000000000000000000000000000..2fba5bc0f982e143ad5f5bda55d768ed
+} +}
diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventory.java b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventory.java 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 new file mode 100644
index 0000000000000000000000000000000000000000..16b3527d7bc782c47e6f6c3ecd7165bd16b0ab0a index 0000000000000000000000000000000000000000..ce135d990c785b02df468391ea622aa236290f07
--- /dev/null --- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventory.java +++ b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventory.java
@@ -0,0 +1,70 @@ @@ -0,0 +1,70 @@
@ -208,7 +177,7 @@ index 0000000000000000000000000000000000000000..16b3527d7bc782c47e6f6c3ecd7165bd
+ +
+ @Override + @Override
+ default boolean isRefillEnabled() { + default boolean isRefillEnabled() {
+ return getNMSWorld().paperConfig.autoReplenishLootables; + return getNMSWorld().paperConfig().lootables.autoReplenish;
+ } + }
+ +
+ @Override + @Override
@ -261,13 +230,13 @@ index 0000000000000000000000000000000000000000..16b3527d7bc782c47e6f6c3ecd7165bd
+} +}
diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java 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 new file mode 100644
index 0000000000000000000000000000000000000000..20cfe7b9b7127ddeb97aa91d759fc17b4a548eaf index 0000000000000000000000000000000000000000..e5ea9f27a1936ed9e329e74317c91c5df89b9fbd
--- /dev/null --- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java +++ b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java
@@ -0,0 +1,179 @@ @@ -0,0 +1,179 @@
+package com.destroystokyo.paper.loottable; +package com.destroystokyo.paper.loottable;
+ +
+import com.destroystokyo.paper.PaperWorldConfig; +import io.papermc.paper.configuration.WorldConfiguration;
+import org.bukkit.entity.Player; +import org.bukkit.entity.Player;
+import org.bukkit.loot.LootTable; +import org.bukkit.loot.LootTable;
+import javax.annotation.Nullable; +import javax.annotation.Nullable;
@ -315,7 +284,7 @@ index 0000000000000000000000000000000000000000..20cfe7b9b7127ddeb97aa91d759fc17b
+ } + }
+ +
+ // ALWAYS process the first fill or if the feature is disabled + // ALWAYS process the first fill or if the feature is disabled
+ if (this.lastFill == -1 || !this.lootable.getNMSWorld().paperConfig.autoReplenishLootables) { + if (this.lastFill == -1 || !this.lootable.getNMSWorld().paperConfig().lootables.autoReplenish) {
+ return true; + return true;
+ } + }
+ +
@ -329,10 +298,10 @@ index 0000000000000000000000000000000000000000..20cfe7b9b7127ddeb97aa91d759fc17b
+ return false; + return false;
+ } + }
+ +
+ final PaperWorldConfig paperConfig = this.lootable.getNMSWorld().paperConfig; + final WorldConfiguration paperConfig = this.lootable.getNMSWorld().paperConfig();
+ +
+ // Check if max refills has been hit + // Check if max refills has been hit
+ if (paperConfig.maxLootableRefills != -1 && this.numRefills >= paperConfig.maxLootableRefills) { + if (paperConfig.lootables.maxRefills != -1 && this.numRefills >= paperConfig.lootables.maxRefills) {
+ return false; + return false;
+ } + }
+ +
@ -344,20 +313,20 @@ index 0000000000000000000000000000000000000000..20cfe7b9b7127ddeb97aa91d759fc17b
+ +
+ final Player bukkitPlayer = (Player) player.getBukkitEntity(); + final Player bukkitPlayer = (Player) player.getBukkitEntity();
+ LootableInventoryReplenishEvent event = new LootableInventoryReplenishEvent(bukkitPlayer, lootable.getAPILootableInventory()); + LootableInventoryReplenishEvent event = new LootableInventoryReplenishEvent(bukkitPlayer, lootable.getAPILootableInventory());
+ if (paperConfig.restrictPlayerReloot && hasPlayerLooted(player.getUUID())) { + if (paperConfig.lootables.restrictPlayerReloot && hasPlayerLooted(player.getUUID())) {
+ event.setCancelled(true); + event.setCancelled(true);
+ } + }
+ return event.callEvent(); + return event.callEvent();
+ } + }
+ public void processRefill(@Nullable net.minecraft.world.entity.player.Player player) { + public void processRefill(@Nullable net.minecraft.world.entity.player.Player player) {
+ this.lastFill = System.currentTimeMillis(); + this.lastFill = System.currentTimeMillis();
+ final PaperWorldConfig paperConfig = this.lootable.getNMSWorld().paperConfig; + final WorldConfiguration paperConfig = this.lootable.getNMSWorld().paperConfig();
+ if (paperConfig.autoReplenishLootables) { + if (paperConfig.lootables.autoReplenish) {
+ int min = paperConfig.lootableRegenMin; + long min = paperConfig.lootables.refreshMin.seconds();
+ int max = paperConfig.lootableRegenMax; + long max = paperConfig.lootables.refreshMax.seconds();
+ this.nextRefill = this.lastFill + (min + RANDOM.nextInt(max - min + 1)) * 1000L; + this.nextRefill = this.lastFill + (min + RANDOM.nextLong(max - min + 1)) * 1000L;
+ this.numRefills++; + this.numRefills++;
+ if (paperConfig.changeLootTableSeedOnFill) { + if (paperConfig.lootables.resetSeedOnFill) {
+ this.lootable.setSeed(0); + this.lootable.setSeed(0);
+ } + }
+ if (player != null) { // This means that numRefills can be incremented without a player being in the lootedPlayers list - Seems to be EntityMinecartChest specific + if (player != null) { // This means that numRefills can be incremented without a player being in the lootedPlayers list - Seems to be EntityMinecartChest specific
@ -516,7 +485,7 @@ index 0000000000000000000000000000000000000000..3377b86c337d0234bbb9b0349e4034a7
+ } + }
+} +}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 3e0f58a928931fd1b3ee32f9dadf65288d8798d6..cd4b9b659904e587933b83616dfdcffb2de8bea5 100644 index e3fe98ef3a7537d3717824d3357cc84c632ee0ea..3d84055afbe0392ca1abf5628b3b621b8833265a 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -226,6 +226,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -226,6 +226,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {

View File

@ -4,29 +4,15 @@ Date: Sat, 7 May 2016 23:33:08 -0400
Subject: [PATCH] Don't save empty scoreboard teams to scoreboard.dat Subject: [PATCH] Don't save empty scoreboard teams to scoreboard.dat
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index ae48897bd52934d35fcb10c545ae79cc4fb57d5a..46ec9016e17805664531a61a75fc046e041b0848 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -249,4 +249,9 @@ public class PaperConfig {
private static void enablePlayerCollisions() {
enablePlayerCollisions = getBoolean("settings.enable-player-collisions", true);
}
+
+ public static boolean saveEmptyScoreboardTeams = false;
+ private static void saveEmptyScoreboardTeams() {
+ saveEmptyScoreboardTeams = getBoolean("settings.save-empty-scoreboard-teams", false);
+ }
}
diff --git a/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java b/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java diff --git a/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java b/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java
index b837b6616a2384b253cca8ed62c9488b639f6298..0efb63d1a4cefede25712daf9cea0f5c3256980f 100644 index b837b6616a2384b253cca8ed62c9488b639f6298..2be7a697f08045b974579e6942b38571e744efac 100644
--- a/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java --- a/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java
+++ b/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java +++ b/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java
@@ -136,6 +136,7 @@ public class ScoreboardSaveData extends SavedData { @@ -136,6 +136,7 @@ public class ScoreboardSaveData extends SavedData {
ListTag listTag = new ListTag(); ListTag listTag = new ListTag();
for(PlayerTeam playerTeam : this.scoreboard.getPlayerTeams()) { for(PlayerTeam playerTeam : this.scoreboard.getPlayerTeams()) {
+ if (!com.destroystokyo.paper.PaperConfig.saveEmptyScoreboardTeams && playerTeam.getPlayers().isEmpty()) continue; // Paper + if (!io.papermc.paper.configuration.GlobalConfiguration.get().scoreboards.saveEmptyScoreboardTeams && playerTeam.getPlayers().isEmpty()) continue; // Paper
CompoundTag compoundTag = new CompoundTag(); CompoundTag compoundTag = new CompoundTag();
compoundTag.putString("Name", playerTeam.getName()); compoundTag.putString("Name", playerTeam.getName());
compoundTag.putString("DisplayName", Component.Serializer.toJson(playerTeam.getDisplayName())); compoundTag.putString("DisplayName", Component.Serializer.toJson(playerTeam.getDisplayName()));

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Async GameProfileCache saving
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index b62d7b2e974f9eafb8e60ddb9ed58273b0393185..9e5271d39e4a15a71c59a8560edd59c75ec6dd52 100644 index 681121909bdf81d5a05670f0b0150f6276d00281..a4623129ffa537db39ee2f206fa775c950e07a21 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -942,7 +942,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -942,7 +942,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@ -18,10 +18,10 @@ index b62d7b2e974f9eafb8e60ddb9ed58273b0393185..9e5271d39e4a15a71c59a8560edd59c7
// Spigot end // Spigot end
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 9e7fb3e2d423ba1db22819aa8b666ca886d98cf6..576fc01b902acaf2a217db3fb39b799f2f57ce01 100644 index f9de28e8d4d6a8b2e59d881c07d8626f427611a3..f862438462ed904c894c90ab8ce126fd0df6fea5 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -250,7 +250,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -246,7 +246,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
} }
if (this.convertOldUsers()) { if (this.convertOldUsers()) {

View File

@ -4,25 +4,6 @@ Date: Sun, 22 May 2016 20:20:55 -0500
Subject: [PATCH] Optional TNT doesn't move in water Subject: [PATCH] Optional TNT doesn't move in water
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index a491af30f70f41e5f7b198ae4d40acfb6eec9b38..45712eb3967d61541580db57e1e9f84e6f5b9762 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -347,4 +347,14 @@ public class PaperWorldConfig {
);
}
}
+
+ public boolean preventTntFromMovingInWater;
+ private void preventTntFromMovingInWater() {
+ if (PaperConfig.version < 13) {
+ boolean oldVal = getBoolean("enable-old-tnt-cannon-behaviors", false);
+ set("prevent-tnt-from-moving-in-water", oldVal);
+ }
+ preventTntFromMovingInWater = getBoolean("prevent-tnt-from-moving-in-water", false);
+ log("Prevent TNT from moving in water: " + preventTntFromMovingInWater);
+ }
}
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
index 61efa24cb1b24216ae80dcd4e68abc39a9ced1bb..232341fa41b1962d329cc17f3146e41c51d22164 100644 index 61efa24cb1b24216ae80dcd4e68abc39a9ced1bb..232341fa41b1962d329cc17f3146e41c51d22164 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java --- a/src/main/java/net/minecraft/server/level/ServerEntity.java
@ -37,7 +18,7 @@ index 61efa24cb1b24216ae80dcd4e68abc39a9ced1bb..232341fa41b1962d329cc17f3146e41c
public ServerEntity(ServerLevel worldserver, Entity entity, int i, boolean flag, Consumer<Packet<?>> consumer, Set<ServerPlayerConnection> trackedPlayers) { public ServerEntity(ServerLevel worldserver, Entity entity, int i, boolean flag, Consumer<Packet<?>> consumer, Set<ServerPlayerConnection> trackedPlayers) {
this.trackedPlayers = trackedPlayers; this.trackedPlayers = trackedPlayers;
diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
index dfcca1fac06de7a4be9be3c238a738a0599fcd24..445d9d1ec6f02f32d819d8555ceddb8e1ada7acd 100644 index 10f8b5ff56e4c1d8300835e045abdce719a99343..8101f358975b35b5a2dafbade3d14a910e408fa2 100644
--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java --- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java +++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
@@ -97,6 +97,27 @@ public class PrimedTnt extends Entity { @@ -97,6 +97,27 @@ public class PrimedTnt extends Entity {
@ -45,7 +26,7 @@ index dfcca1fac06de7a4be9be3c238a738a0599fcd24..445d9d1ec6f02f32d819d8555ceddb8e
} }
+ // Paper start - Optional prevent TNT from moving in water + // Paper start - Optional prevent TNT from moving in water
+ if (!this.isRemoved() && this.wasTouchingWater && this.level.paperConfig.preventTntFromMovingInWater) { + if (!this.isRemoved() && this.wasTouchingWater && this.level.paperConfig().fixes.preventTntFromMovingInWater) {
+ /* + /*
+ * Author: Jedediah Smith <jedediah@silencegreys.com> + * Author: Jedediah Smith <jedediah@silencegreys.com>
+ */ + */
@ -76,7 +57,7 @@ index dfcca1fac06de7a4be9be3c238a738a0599fcd24..445d9d1ec6f02f32d819d8555ceddb8e
+ // Paper start - Optional prevent TNT from moving in water + // Paper start - Optional prevent TNT from moving in water
+ @Override + @Override
+ public boolean isPushedByFluid() { + public boolean isPushedByFluid() {
+ return !level.paperConfig.preventTntFromMovingInWater && super.isPushedByFluid(); + return !level.paperConfig().fixes.preventTntFromMovingInWater && super.isPushedByFluid();
+ } + }
+ // Paper end + // Paper end
} }

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Faster redstone torch rapid clock removal
Only resize the the redstone torch list once, since resizing arrays / lists is costly Only resize the the redstone torch list once, since resizing arrays / lists is costly
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 5732a9a41a14e5297631d78f924b2082efcfe9da..4b5d9b90658efe43fcb346dd94dc1e3372809b0e 100644 index 46c7c63d4dced4e75079588cef2c155859e5ae36..2dc18abb447d1ba51d8b9c301becd7f618e5a404 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -163,6 +163,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -167,6 +167,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
private org.spigotmc.TickLimiter tileLimiter; private org.spigotmc.TickLimiter tileLimiter;
private int tileTickPosition; private int tileTickPosition;
public final Map<Explosion.CacheKey, Float> explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions public final Map<Explosion.CacheKey, Float> explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions

View File

@ -5,41 +5,15 @@ Subject: [PATCH] Add setting for proxy online mode status
TODO: Add isProxyOnlineMode check to Metrics TODO: Add isProxyOnlineMode check to Metrics
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index 46ec9016e17805664531a61a75fc046e041b0848..01b1eb60894a79bd10a035404cc796ce0d3725c8 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -23,6 +23,7 @@ import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.YamlConfiguration;
import co.aikar.timings.Timings;
import co.aikar.timings.TimingsManager;
+import org.spigotmc.SpigotConfig;
public class PaperConfig {
@@ -254,4 +255,13 @@ public class PaperConfig {
private static void saveEmptyScoreboardTeams() {
saveEmptyScoreboardTeams = getBoolean("settings.save-empty-scoreboard-teams", false);
}
+
+ public static boolean bungeeOnlineMode = true;
+ private static void bungeeOnlineMode() {
+ bungeeOnlineMode = getBoolean("settings.bungee-online-mode", true);
+ }
+
+ public static boolean isProxyOnlineMode() {
+ return Bukkit.getOnlineMode() || (SpigotConfig.bungee && bungeeOnlineMode);
+ }
}
diff --git a/src/main/java/net/minecraft/server/players/GameProfileCache.java b/src/main/java/net/minecraft/server/players/GameProfileCache.java diff --git a/src/main/java/net/minecraft/server/players/GameProfileCache.java b/src/main/java/net/minecraft/server/players/GameProfileCache.java
index 87b7a669ef111b2dc40d152fe6fe4e75ff8ccc98..6087fff889458dc09d5a3eb52e7d4b0a77bde809 100644 index 87b7a669ef111b2dc40d152fe6fe4e75ff8ccc98..40ddeaea58263820c32a4e901a2e907088eb7b6e 100644
--- a/src/main/java/net/minecraft/server/players/GameProfileCache.java --- a/src/main/java/net/minecraft/server/players/GameProfileCache.java
+++ b/src/main/java/net/minecraft/server/players/GameProfileCache.java +++ b/src/main/java/net/minecraft/server/players/GameProfileCache.java
@@ -98,6 +98,7 @@ public class GameProfileCache { @@ -98,6 +98,7 @@ public class GameProfileCache {
} }
}; };
+ if (com.destroystokyo.paper.PaperConfig.isProxyOnlineMode()) // Paper - only run in online mode - 100 COL + if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()) // Paper - only run in online mode - 100 COL
repository.findProfilesByNames(new String[]{name}, Agent.MINECRAFT, profilelookupcallback); repository.findProfilesByNames(new String[]{name}, Agent.MINECRAFT, profilelookupcallback);
GameProfile gameprofile = (GameProfile) atomicreference.get(); GameProfile gameprofile = (GameProfile) atomicreference.get();
@ -48,12 +22,12 @@ index 87b7a669ef111b2dc40d152fe6fe4e75ff8ccc98..6087fff889458dc09d5a3eb52e7d4b0a
private static boolean usesAuthentication() { private static boolean usesAuthentication() {
- return GameProfileCache.usesAuthentication; - return GameProfileCache.usesAuthentication;
+ return com.destroystokyo.paper.PaperConfig.isProxyOnlineMode(); // Paper + return io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode(); // Paper
} }
public void add(GameProfile profile) { public void add(GameProfile profile) {
diff --git a/src/main/java/net/minecraft/server/players/OldUsersConverter.java b/src/main/java/net/minecraft/server/players/OldUsersConverter.java diff --git a/src/main/java/net/minecraft/server/players/OldUsersConverter.java b/src/main/java/net/minecraft/server/players/OldUsersConverter.java
index da98f074ccd5a40c635824112c97fd174c393cb1..fd9c7e4cb637b67fbbcbee6f8e2449c4e62fc344 100644 index da98f074ccd5a40c635824112c97fd174c393cb1..6599f874d9f97e9ef4862039ecad7277bbc5fd91 100644
--- a/src/main/java/net/minecraft/server/players/OldUsersConverter.java --- a/src/main/java/net/minecraft/server/players/OldUsersConverter.java
+++ b/src/main/java/net/minecraft/server/players/OldUsersConverter.java +++ b/src/main/java/net/minecraft/server/players/OldUsersConverter.java
@@ -66,7 +66,8 @@ public class OldUsersConverter { @@ -66,7 +66,8 @@ public class OldUsersConverter {
@ -62,20 +36,20 @@ index da98f074ccd5a40c635824112c97fd174c393cb1..fd9c7e4cb637b67fbbcbee6f8e2449c4
- if (server.usesAuthentication() || org.spigotmc.SpigotConfig.bungee) { // Spigot: bungee = online mode, for now. - if (server.usesAuthentication() || org.spigotmc.SpigotConfig.bungee) { // Spigot: bungee = online mode, for now.
+ if (server.usesAuthentication() + if (server.usesAuthentication()
+ || (com.destroystokyo.paper.PaperConfig.isProxyOnlineMode())) { // Spigot: bungee = online mode, for now. // Paper - Handle via setting + || (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode())) { // Spigot: bungee = online mode, for now. // Paper - Handle via setting
server.getProfileRepository().findProfilesByNames(astring, Agent.MINECRAFT, callback); server.getProfileRepository().findProfilesByNames(astring, Agent.MINECRAFT, callback);
} else { } else {
String[] astring1 = astring; String[] astring1 = astring;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index f40446e07308dd9f09622dba55933bc3486f80b8..abada046fd469cc5c423c26571d70b5ea062eda1 100644 index 90a2ed1b851a948b8ebf4ad6157003db19f1916f..ad7efac7d32837c8de2c2a61552538398d24cf44 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1686,7 +1686,7 @@ public final class CraftServer implements Server { @@ -1685,7 +1685,7 @@ public final class CraftServer implements Server {
// Spigot Start // Spigot Start
GameProfile profile = null; GameProfile profile = null;
// Only fetch an online UUID in online mode // Only fetch an online UUID in online mode
- if ( this.getOnlineMode() || org.spigotmc.SpigotConfig.bungee ) - if ( this.getOnlineMode() || org.spigotmc.SpigotConfig.bungee )
+ if ( this.getOnlineMode() || com.destroystokyo.paper.PaperConfig.isProxyOnlineMode() ) // Paper - Handle via setting + if ( this.getOnlineMode() || io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() ) // Paper - Handle via setting
{ {
profile = this.console.getProfileCache().get(name).orElse(null); profile = this.console.getProfileCache().get(name).orElse(null);
} }

View File

@ -4,33 +4,15 @@ Date: Sun, 11 Sep 2016 14:30:57 -0500
Subject: [PATCH] Configurable packet in spam threshold Subject: [PATCH] Configurable packet in spam threshold
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index 01b1eb60894a79bd10a035404cc796ce0d3725c8..77e1a4b9b0734734bbcf03b6adc1cf0552063d1f 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -264,4 +264,13 @@ public class PaperConfig {
public static boolean isProxyOnlineMode() {
return Bukkit.getOnlineMode() || (SpigotConfig.bungee && bungeeOnlineMode);
}
+
+ public static int packetInSpamThreshold = 300;
+ private static void packetInSpamThreshold() {
+ if (version < 11) {
+ int oldValue = getInt("settings.play-in-use-item-spam-threshold", 300);
+ set("settings.incoming-packet-spam-threshold", oldValue);
+ }
+ packetInSpamThreshold = getInt("settings.incoming-packet-spam-threshold", 300);
+ }
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 1b92ee3988c1bdcbc751f32bd480b2ad2f588139..f3146f65f8e3ac465763093e7f5b53274d4d3356 100644 index e7d9af82a11fb5c1250c76d32f21cc720c002da2..e4f3b2516372cb21e7b53f1df9ee484476179035 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1534,13 +1534,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -1534,13 +1534,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
// Spigot start - limit place/interactions // Spigot start - limit place/interactions
private int limitedPackets; private int limitedPackets;
private long lastLimitedPacket = -1; private long lastLimitedPacket = -1;
+ private static final int THRESHOLD = com.destroystokyo.paper.PaperConfig.packetInSpamThreshold; // Paper - Configurable threshold + private static final int THRESHOLD = io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.incomingPacketThreshold; // Paper - Configurable threshold
private boolean checkLimit(long timestamp) { private boolean checkLimit(long timestamp) {
- if (this.lastLimitedPacket != -1 && timestamp - this.lastLimitedPacket < 30 && this.limitedPackets++ >= 4) { - if (this.lastLimitedPacket != -1 && timestamp - this.lastLimitedPacket < 30 && this.limitedPackets++ >= 4) {

View File

@ -4,24 +4,8 @@ Date: Tue, 20 Sep 2016 00:58:01 +0000
Subject: [PATCH] Configurable flying kick messages Subject: [PATCH] Configurable flying kick messages
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index 77e1a4b9b0734734bbcf03b6adc1cf0552063d1f..2440e81ef23c3b8c91ca5bdf13347f13cb66f549 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -273,4 +273,11 @@ public class PaperConfig {
}
packetInSpamThreshold = getInt("settings.incoming-packet-spam-threshold", 300);
}
+
+ public static String flyingKickPlayerMessage = "Flying is not enabled on this server";
+ public static String flyingKickVehicleMessage = "Flying is not enabled on this server";
+ private static void flyingKickMessages() {
+ flyingKickPlayerMessage = getString("messages.kick.flying-player", flyingKickPlayerMessage);
+ flyingKickVehicleMessage = getString("messages.kick.flying-vehicle", flyingKickVehicleMessage);
+ }
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index f3146f65f8e3ac465763093e7f5b53274d4d3356..71b595a293e0add1ad9f7e5c3a2694a8a16771aa 100644 index e4f3b2516372cb21e7b53f1df9ee484476179035..bfcbfc08fb329ebded5376c4a78d13e659323a64 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -326,7 +326,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -326,7 +326,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@ -29,7 +13,7 @@ index f3146f65f8e3ac465763093e7f5b53274d4d3356..71b595a293e0add1ad9f7e5c3a2694a8
if (++this.aboveGroundTickCount > 80) { if (++this.aboveGroundTickCount > 80) {
ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked for floating too long!", this.player.getName().getString()); ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked for floating too long!", this.player.getName().getString());
- this.disconnect(Component.translatable("multiplayer.disconnect.flying")); - this.disconnect(Component.translatable("multiplayer.disconnect.flying"));
+ this.disconnect(com.destroystokyo.paper.PaperConfig.flyingKickPlayerMessage); // Paper - use configurable kick message + this.disconnect(io.papermc.paper.configuration.GlobalConfiguration.get().messages.kick.flyingPlayer); // Paper - use configurable kick message
return; return;
} }
} else { } else {
@ -38,7 +22,7 @@ index f3146f65f8e3ac465763093e7f5b53274d4d3356..71b595a293e0add1ad9f7e5c3a2694a8
if (++this.aboveGroundVehicleTickCount > 80) { if (++this.aboveGroundVehicleTickCount > 80) {
ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked for floating a vehicle too long!", this.player.getName().getString()); ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked for floating a vehicle too long!", this.player.getName().getString());
- this.disconnect(Component.translatable("multiplayer.disconnect.flying")); - this.disconnect(Component.translatable("multiplayer.disconnect.flying"));
+ this.disconnect(com.destroystokyo.paper.PaperConfig.flyingKickVehicleMessage); // Paper - use configurable kick message + this.disconnect(io.papermc.paper.configuration.GlobalConfiguration.get().messages.kick.flyingVehicle); // Paper - use configurable kick message
return; return;
} }
} else { } else {

View File

@ -4,25 +4,8 @@ Date: Sat, 12 Nov 2016 23:25:22 -0600
Subject: [PATCH] Filter bad data from ArmorStand and SpawnEgg items Subject: [PATCH] Filter bad data from ArmorStand and SpawnEgg items
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 45712eb3967d61541580db57e1e9f84e6f5b9762..0b5e223594ff95b8ba7c300d4a66ca7a17e53802 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -357,4 +357,12 @@ public class PaperWorldConfig {
preventTntFromMovingInWater = getBoolean("prevent-tnt-from-moving-in-water", false);
log("Prevent TNT from moving in water: " + preventTntFromMovingInWater);
}
+
+ public boolean filterNBTFromSpawnEgg = true;
+ private void fitlerNBTFromSpawnEgg() {
+ filterNBTFromSpawnEgg = getBoolean("filter-nbt-data-from-spawn-eggs-and-related", true);
+ if (!filterNBTFromSpawnEgg) {
+ Bukkit.getLogger().warning("Spawn Egg and Armor Stand NBT filtering disabled, this is a potential security risk");
+ }
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
index 242e02646b8584a8d2a512374ad03729661d584f..08defb76e73a5f9121bf405c86a3c4c750ab1933 100644 index 6c4be7da19d0d61f35942558d438587853231aaa..18d81e8e8f387a7fb531652cb78c61a9bd5ae600 100644
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java --- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
@@ -316,6 +316,18 @@ public class FallingBlockEntity extends Entity { @@ -316,6 +316,18 @@ public class FallingBlockEntity extends Entity {
@ -31,7 +14,7 @@ index 242e02646b8584a8d2a512374ad03729661d584f..08defb76e73a5f9121bf405c86a3c4c7
this.blockState = NbtUtils.readBlockState(nbt.getCompound("BlockState")); this.blockState = NbtUtils.readBlockState(nbt.getCompound("BlockState"));
+ // Paper start - Block FallingBlocks with Command Blocks + // Paper start - Block FallingBlocks with Command Blocks
+ final Block b = this.blockState.getBlock(); + final Block b = this.blockState.getBlock();
+ if (this.level.paperConfig.filterNBTFromSpawnEgg + if (this.level.paperConfig().entities.spawning.filterNbtDataFromSpawnEggsAndRelated
+ && (b == Blocks.COMMAND_BLOCK + && (b == Blocks.COMMAND_BLOCK
+ || b == Blocks.REPEATING_COMMAND_BLOCK + || b == Blocks.REPEATING_COMMAND_BLOCK
+ || b == Blocks.CHAIN_COMMAND_BLOCK + || b == Blocks.CHAIN_COMMAND_BLOCK

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Command Aliases
Reload the aliases stored in commands.yml Reload the aliases stored in commands.yml
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index abada046fd469cc5c423c26571d70b5ea062eda1..ae1cfe01f285a773ab9d4bdb9b0dd897615f0b82 100644 index ad7efac7d32837c8de2c2a61552538398d24cf44..437d479e319becb8d9d4ec9544a9fa2aebc72160 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2530,5 +2530,24 @@ public final class CraftServer implements Server { @@ -2527,5 +2527,24 @@ public final class CraftServer implements Server {
DefaultPermissions.registerCorePermissions(); DefaultPermissions.registerCorePermissions();
CraftDefaultPermissions.registerCorePermissions(); CraftDefaultPermissions.registerCorePermissions();
} }

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Add ProjectileCollideEvent
diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
index 046082ab7deb21574d9471b78a39a4a6bb296c2f..62beefb6693d1801d9d8994c7247dca5bd646b0b 100644 index 7cd802be238cedf166174a61e816d9d4b29b87d2..7f1f4813ac007fbf79e8ba254075c015fe15e3a1 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java --- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java +++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
@@ -226,6 +226,17 @@ public abstract class AbstractArrow extends Projectile { @@ -226,6 +226,17 @@ public abstract class AbstractArrow extends Projectile {

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Optimize World.isLoaded(BlockPosition)Z
Reduce method invocations for World.isLoaded(BlockPosition)Z Reduce method invocations for World.isLoaded(BlockPosition)Z
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 4b5d9b90658efe43fcb346dd94dc1e3372809b0e..b28fc4cf5deb543e78b91547c1ab7e1ab9e6f0e4 100644 index 2dc18abb447d1ba51d8b9c301becd7f618e5a404..1686dbfc4b45c88105c71d284c024a4101795d08 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -330,6 +330,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -334,6 +334,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
return chunk == null ? null : chunk.getFluidState(blockposition); return chunk == null ? null : chunk.getFluidState(blockposition);
} }

View File

@ -8,50 +8,8 @@ Allow configuring for cartographers to return the same map location
Also allow turning off treasure maps all together as they can eat up Map ID's Also allow turning off treasure maps all together as they can eat up Map ID's
which are limited in quantity. which are limited in quantity.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 0b5e223594ff95b8ba7c300d4a66ca7a17e53802..8451982ba4fc9522f2d77f68fc63a0e12558955f 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -56,6 +56,11 @@ public class PaperWorldConfig {
set("despawn-ranges.hard", null);
}
+ if (this.config.isSet("world-settings.default.treasure-maps-return-already-discovered") || this.config.isSet("world-settings." + worldName + ".treasure-maps-return-already-discovered")) {
+ set("treasure-maps-return-already-discovered", null);
+ needsSave = true;
+ }
+
if (needsSave) {
saveConfig();
}
@@ -365,4 +370,25 @@ public class PaperWorldConfig {
Bukkit.getLogger().warning("Spawn Egg and Armor Stand NBT filtering disabled, this is a potential security risk");
}
}
+
+ public boolean enableTreasureMaps = true;
+ public boolean treasureMapsAlreadyDiscoveredVillager = false;
+ public Boolean treasureMapsAlreadyDiscoveredLootTable = null;
+ private Boolean getBooleanOrNull(String path, Boolean defaultValue) {
+ this.config.addDefault("world-settings.default." + path, defaultValue == null ? "default" : defaultValue);
+ final Object value = this.config.get("world-settings." + worldName + "." + path, this.config.get("world-settings.default." + path));
+ if (value instanceof Boolean bool) {
+ return bool;
+ }
+ return null;
+ }
+ private void treasureMapsAlreadyDiscovered() {
+ enableTreasureMaps = getBoolean("enable-treasure-maps", true);
+ if (getBoolean("treasure-maps-return-already-discovered", false, false)) {
+ treasureMapsAlreadyDiscoveredLootTable = true;
+ treasureMapsAlreadyDiscoveredVillager = true;
+ }
+ treasureMapsAlreadyDiscoveredVillager = getBoolean("treasure-maps-find-already-discovered.villager-trade", treasureMapsAlreadyDiscoveredVillager);
+ treasureMapsAlreadyDiscoveredLootTable = getBooleanOrNull("treasure-maps-find-already-discovered.loot-tables", treasureMapsAlreadyDiscoveredLootTable);
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/npc/VillagerTrades.java b/src/main/java/net/minecraft/world/entity/npc/VillagerTrades.java diff --git a/src/main/java/net/minecraft/world/entity/npc/VillagerTrades.java b/src/main/java/net/minecraft/world/entity/npc/VillagerTrades.java
index f95999daa1955dd4d919d0e668fe099901a0481c..7360a0a70ddb3dc055d3ebc62071cb5327094e8e 100644 index f95999daa1955dd4d919d0e668fe099901a0481c..770a91fcc351a2d1de4762c0fd9bae2b49c363b5 100644
--- a/src/main/java/net/minecraft/world/entity/npc/VillagerTrades.java --- a/src/main/java/net/minecraft/world/entity/npc/VillagerTrades.java
+++ b/src/main/java/net/minecraft/world/entity/npc/VillagerTrades.java +++ b/src/main/java/net/minecraft/world/entity/npc/VillagerTrades.java
@@ -386,7 +386,8 @@ public class VillagerTrades { @@ -386,7 +386,8 @@ public class VillagerTrades {
@ -59,13 +17,13 @@ index f95999daa1955dd4d919d0e668fe099901a0481c..7360a0a70ddb3dc055d3ebc62071cb53
} else { } else {
ServerLevel serverLevel = (ServerLevel)entity.level; ServerLevel serverLevel = (ServerLevel)entity.level;
- BlockPos blockPos = serverLevel.findNearestMapStructure(this.destination, entity.blockPosition(), 100, true); - BlockPos blockPos = serverLevel.findNearestMapStructure(this.destination, entity.blockPosition(), 100, true);
+ if (!serverLevel.paperConfig.enableTreasureMaps) return null; // Paper + if (!serverLevel.paperConfig().environment.treasureMaps.enabled) return null; // Paper
+ BlockPos blockPos = serverLevel.findNearestMapStructure(this.destination, entity.blockPosition(), 100, !serverLevel.paperConfig.treasureMapsAlreadyDiscoveredVillager); // Paper + BlockPos blockPos = serverLevel.findNearestMapStructure(this.destination, entity.blockPosition(), 100, !serverLevel.paperConfig().environment.treasureMaps.findAlreadyDiscoveredVillager); // Paper
if (blockPos != null) { if (blockPos != null) {
ItemStack itemStack = MapItem.create(serverLevel, blockPos.getX(), blockPos.getZ(), (byte)2, true, true); ItemStack itemStack = MapItem.create(serverLevel, blockPos.getX(), blockPos.getZ(), (byte)2, true, true);
MapItem.renderBiomePreviewMap(serverLevel, itemStack); MapItem.renderBiomePreviewMap(serverLevel, itemStack);
diff --git a/src/main/java/net/minecraft/world/level/storage/loot/functions/ExplorationMapFunction.java b/src/main/java/net/minecraft/world/level/storage/loot/functions/ExplorationMapFunction.java diff --git a/src/main/java/net/minecraft/world/level/storage/loot/functions/ExplorationMapFunction.java b/src/main/java/net/minecraft/world/level/storage/loot/functions/ExplorationMapFunction.java
index 321384730cacbdc22eedc53651e4d24f06c73b99..fa1387ce6029198109bed258c559cd008f531c08 100644 index 321384730cacbdc22eedc53651e4d24f06c73b99..b734c0f9b831c20a239b5341ff3a0b4d6a6c102c 100644
--- a/src/main/java/net/minecraft/world/level/storage/loot/functions/ExplorationMapFunction.java --- a/src/main/java/net/minecraft/world/level/storage/loot/functions/ExplorationMapFunction.java
+++ b/src/main/java/net/minecraft/world/level/storage/loot/functions/ExplorationMapFunction.java +++ b/src/main/java/net/minecraft/world/level/storage/loot/functions/ExplorationMapFunction.java
@@ -68,7 +68,16 @@ public class ExplorationMapFunction extends LootItemConditionalFunction { @@ -68,7 +68,16 @@ public class ExplorationMapFunction extends LootItemConditionalFunction {
@ -74,7 +32,7 @@ index 321384730cacbdc22eedc53651e4d24f06c73b99..fa1387ce6029198109bed258c559cd00
ServerLevel serverLevel = context.getLevel(); ServerLevel serverLevel = context.getLevel();
- BlockPos blockPos = serverLevel.findNearestMapStructure(this.destination, new BlockPos(vec3), this.searchRadius, this.skipKnownStructures); - BlockPos blockPos = serverLevel.findNearestMapStructure(this.destination, new BlockPos(vec3), this.searchRadius, this.skipKnownStructures);
+ // Paper start + // Paper start
+ if (!serverLevel.paperConfig.enableTreasureMaps) { + if (!serverLevel.paperConfig().environment.treasureMaps.enabled) {
+ /* + /*
+ * NOTE: I fear users will just get a plain map as their "treasure" + * NOTE: I fear users will just get a plain map as their "treasure"
+ * This is preferable to disrespecting the config. + * This is preferable to disrespecting the config.
@ -82,7 +40,7 @@ index 321384730cacbdc22eedc53651e4d24f06c73b99..fa1387ce6029198109bed258c559cd00
+ return stack; + return stack;
+ } + }
+ // Paper end + // Paper end
+ BlockPos blockPos = serverLevel.findNearestMapStructure(this.destination, new BlockPos(vec3), this.searchRadius, serverLevel.paperConfig.treasureMapsAlreadyDiscoveredLootTable == null ? this.skipKnownStructures : serverLevel.paperConfig.treasureMapsAlreadyDiscoveredLootTable); // Paper + BlockPos blockPos = serverLevel.findNearestMapStructure(this.destination, new BlockPos(vec3), this.searchRadius, serverLevel.paperConfig().environment.treasureMaps.findAlreadyDiscoveredLootTable.or(this.skipKnownStructures)); // Paper
if (blockPos != null) { if (blockPos != null) {
ItemStack itemStack = MapItem.create(serverLevel, blockPos.getX(), blockPos.getZ(), this.zoom, true, true); ItemStack itemStack = MapItem.create(serverLevel, blockPos.getX(), blockPos.getZ(), this.zoom, true, true);
MapItem.renderBiomePreviewMap(serverLevel, itemStack); MapItem.renderBiomePreviewMap(serverLevel, itemStack);

View File

@ -26,7 +26,7 @@ index 32ef3edebe94a2014168b7e438752a80b2687e5f..ab6c58eed6707ab7b0aa3e7549a871ad
// Paper end // Paper end
buf.writeComponent(this.text); buf.writeComponent(this.text);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 8c8f0df271cb1fab92aeb342289fa116cf5b93a8..2f193f96eb5633fe1d06ec0d76fcbfc5b0ff5c7b 100644 index 213037a4c545db70ca5e66018057216cbb6532d3..0b693866af8e0d8de275e87ca1232a03a6a35abe 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -274,6 +274,26 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -274,6 +274,26 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Properly fix item duplication bug
Credit to prplz for figuring out the real issue Credit to prplz for figuring out the real issue
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index a375d2d0bffc3694e76bae3f9ba13f60e629d859..bd6e22b849d6328b2fcc0244cc83a79d9ffb08c8 100644 index 73fe1f1047e39eeeb8a1444fa353f7d1a8e651b3..4b65dc12dc97e72b221d9fd15202a1a0622ef806 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -2199,7 +2199,7 @@ public class ServerPlayer extends Player { @@ -2199,7 +2199,7 @@ public class ServerPlayer extends Player {
@ -19,7 +19,7 @@ index a375d2d0bffc3694e76bae3f9ba13f60e629d859..bd6e22b849d6328b2fcc0244cc83a79d
@Override @Override
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 71b595a293e0add1ad9f7e5c3a2694a8a16771aa..955985193a1713a6a938c6b8879a85fd329a89ab 100644 index bfcbfc08fb329ebded5376c4a78d13e659323a64..3f1bda6c17fca41150bfaab2cd5a4e8849bd439d 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3036,7 +3036,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -3036,7 +3036,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser

View File

@ -7,7 +7,7 @@ Provides counts without the ineffeciency of using .getEntities().size()
which creates copy of the collections. which creates copy of the collections.
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index b28fc4cf5deb543e78b91547c1ab7e1ab9e6f0e4..4aea5e937e2e0e272e5aeb4e6b9ed750064f3828 100644 index 1686dbfc4b45c88105c71d284c024a4101795d08..5577a560d41a2467bd713f2fa7511c83a73c2f2d 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -112,7 +112,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -112,7 +112,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {

View File

@ -7,7 +7,7 @@ Saving players async is extremely dangerous. This will force it to main
the same way we handle async chunk loads. the same way we handle async chunk loads.
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index e0b279d9437b30ca4a18a3036bf59664570a746f..5e6e4017f1ed84dbf5060f8d789f3cd766d9e0d2 100644 index 3fe3d417b6c1ff49a412c308bfe6a43182d0986e..6c86e18cb59a4e9a906269d570d228f05c700a48 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1040,11 +1040,13 @@ public abstract class PlayerList { @@ -1040,11 +1040,13 @@ public abstract class PlayerList {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Don't allow entities to ride themselves - #572
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index cd4b9b659904e587933b83616dfdcffb2de8bea5..a93426773dff94aebea8283ebd9f21fa841e01d7 100644 index 3d84055afbe0392ca1abf5628b3b621b8833265a..25fb1785e76aa72eb59565dd51f9fc65b0509869 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2317,6 +2317,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -2316,6 +2316,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
} }
protected boolean addPassenger(Entity entity) { // CraftBukkit protected boolean addPassenger(Entity entity) { // CraftBukkit

View File

@ -129,7 +129,7 @@ index b3433ce9c722bdab81848a6c2d121ca510c48509..227aca795efc99c4f81dfb30c00d31d2
@Override @Override
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 7a4996d720cc093f5c4b72356f20fc316cf9c533..8e6c9fb5eb58c20b97141551b2514c004eb4cedb 100644 index 3a597e7ce159b78078b1d64258a6f30e51645f3b..86a624e505db71241e3acb0b9269372ea693031d 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1723,7 +1723,8 @@ public abstract class LivingEntity extends Entity { @@ -1723,7 +1723,8 @@ public abstract class LivingEntity extends Entity {
@ -230,7 +230,7 @@ index b9a0fc52460ce0c50deea25112dee20c977e99c5..d7cb3d8b37f225ee4796246aa907da10
} }
diff --git a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java diff --git a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
index 91fde59289100133a4f473bee176ff1b6805faae..d9256fe99309b7d085b2cc64c770cfcb61e3ef54 100644 index 00fe96650e4d973e97b46968297f55f4c3674629..11ac510ad4095438d4904d521bfb18aa5f743faf 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java --- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java +++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
@@ -513,7 +513,7 @@ public class FishingHook extends Projectile { @@ -513,7 +513,7 @@ public class FishingHook extends Projectile {

View File

@ -11,23 +11,8 @@ just as it does in Vanilla, but entity pushing logic will be capped.
You can set this to 0 to disable collisions. You can set this to 0 to disable collisions.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 8451982ba4fc9522f2d77f68fc63a0e12558955f..ee8ce0e5bdb0acb7d6ef3439a388e108ea1807de 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -391,4 +391,10 @@ public class PaperWorldConfig {
treasureMapsAlreadyDiscoveredVillager = getBoolean("treasure-maps-find-already-discovered.villager-trade", treasureMapsAlreadyDiscoveredVillager);
treasureMapsAlreadyDiscoveredLootTable = getBooleanOrNull("treasure-maps-find-already-discovered.loot-tables", treasureMapsAlreadyDiscoveredLootTable);
}
+
+ public int maxCollisionsPerEntity = 8;
+ private void maxEntityCollision() {
+ maxCollisionsPerEntity = getInt( "max-entity-collisions", this.spigotConfig.getInt("max-entity-collisions", this.maxCollisionsPerEntity, false) );
+ log( "Max Entity Collisions: " + maxCollisionsPerEntity );
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index a93426773dff94aebea8283ebd9f21fa841e01d7..1e9589e08149bbbbe581ecb68d9f590d16ed897a 100644 index 25fb1785e76aa72eb59565dd51f9fc65b0509869..bfc7736bfe538b615343b6f41f2a670493e2c701 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -373,6 +373,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -373,6 +373,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@ -39,7 +24,7 @@ index a93426773dff94aebea8283ebd9f21fa841e01d7..1e9589e08149bbbbe581ecb68d9f590d
private org.bukkit.util.Vector origin; private org.bukkit.util.Vector origin;
@javax.annotation.Nullable @javax.annotation.Nullable
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 8e6c9fb5eb58c20b97141551b2514c004eb4cedb..2eed84529ad9a34ae88c4f37f2b0c7943f51b0ad 100644 index 86a624e505db71241e3acb0b9269372ea693031d..7c50e9c28f9f26b42d2baa51d8fa735bb182ffa5 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3261,8 +3261,11 @@ public abstract class LivingEntity extends Entity { @@ -3261,8 +3261,11 @@ public abstract class LivingEntity extends Entity {
@ -47,8 +32,8 @@ index 8e6c9fb5eb58c20b97141551b2514c004eb4cedb..2eed84529ad9a34ae88c4f37f2b0c794
} }
- for (j = 0; j < list.size(); ++j) { - for (j = 0; j < list.size(); ++j) {
+ this.numCollisions = Math.max(0, this.numCollisions - this.level.paperConfig.maxCollisionsPerEntity); // Paper + this.numCollisions = Math.max(0, this.numCollisions - this.level.paperConfig().collisions.maxEntityCollisions); // Paper
+ for (j = 0; j < list.size() && this.numCollisions < this.level.paperConfig.maxCollisionsPerEntity; ++j) { // Paper + for (j = 0; j < list.size() && this.numCollisions < this.level.paperConfig().collisions.maxEntityCollisions; ++j) { // Paper
Entity entity = (Entity) list.get(j); Entity entity = (Entity) list.get(j);
+ entity.numCollisions++; // Paper + entity.numCollisions++; // Paper
+ this.numCollisions++; // Paper + this.numCollisions++; // Paper

View File

@ -30,10 +30,10 @@ will have plugins and worlds saving to the disk has a high potential to result
in corruption/dataloss. in corruption/dataloss.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 9e5271d39e4a15a71c59a8560edd59c75ec6dd52..b2dfce9bb43360e1c405d32f255ef16e00d31b32 100644 index a4623129ffa537db39ee2f206fa775c950e07a21..e4913a7dd431dc861fa93c099e9be97f00519a18 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -220,6 +220,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -219,6 +219,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public final Map<ResourceKey<Level>, ServerLevel> levels; public final Map<ResourceKey<Level>, ServerLevel> levels;
private PlayerList playerList; private PlayerList playerList;
private volatile boolean running; private volatile boolean running;
@ -64,7 +64,7 @@ index 9e5271d39e4a15a71c59a8560edd59c75ec6dd52..b2dfce9bb43360e1c405d32f255ef16e
if (flag) { if (flag) {
try { try {
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 5e6e4017f1ed84dbf5060f8d789f3cd766d9e0d2..b477f31ac8313e8f4c1f288fc0cf6bc2544c1f28 100644 index 6c86e18cb59a4e9a906269d570d228f05c700a48..b28bb51e5476b250d9de91f2e380dd8ed2aa7041 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1151,8 +1151,15 @@ public abstract class PlayerList { @@ -1151,8 +1151,15 @@ public abstract class PlayerList {

View File

@ -10,23 +10,8 @@ I suspect Mojang may switch to this behavior before full release.
To be converted into a Paper-API event at some point in the future? To be converted into a Paper-API event at some point in the future?
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index ee8ce0e5bdb0acb7d6ef3439a388e108ea1807de..aa8a02c9fab8938e8064a60f1faf5421aab3892c 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -397,4 +397,10 @@ public class PaperWorldConfig {
maxCollisionsPerEntity = getInt( "max-entity-collisions", this.spigotConfig.getInt("max-entity-collisions", this.maxCollisionsPerEntity, false) );
log( "Max Entity Collisions: " + maxCollisionsPerEntity );
}
+
+ public boolean parrotsHangOnBetter;
+ private void parrotsHangOnBetter() {
+ parrotsHangOnBetter = getBoolean("parrots-are-unaffected-by-player-movement", false);
+ log("Parrots are unaffected by player movement: " + parrotsHangOnBetter);
+ }
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 955985193a1713a6a938c6b8879a85fd329a89ab..b50ca694f827b60ab6ae4b91772774b6fef55734 100644 index 3f1bda6c17fca41150bfaab2cd5a4e8849bd439d..95b0c01d1eaf58ba8c93c896891dcfb1075d57da 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2258,6 +2258,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -2258,6 +2258,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@ -35,7 +20,7 @@ index 955985193a1713a6a938c6b8879a85fd329a89ab..b50ca694f827b60ab6ae4b91772774b6
this.player.setShiftKeyDown(true); this.player.setShiftKeyDown(true);
+ +
+ // Paper start - Hang on! + // Paper start - Hang on!
+ if (this.player.level.paperConfig.parrotsHangOnBetter) { + if (this.player.level.paperConfig().entities.behavior.parrotsAreUnaffectedByPlayerMovement) {
+ this.player.removeEntitiesOnShoulder(); + this.player.removeEntitiesOnShoulder();
+ } + }
+ // Paper end + // Paper end
@ -44,7 +29,7 @@ index 955985193a1713a6a938c6b8879a85fd329a89ab..b50ca694f827b60ab6ae4b91772774b6
case RELEASE_SHIFT_KEY: case RELEASE_SHIFT_KEY:
this.player.setShiftKeyDown(false); this.player.setShiftKeyDown(false);
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index fdda98cb38ec96d0189931c41257cc01966373d5..0df33131bae2b6651eff4b5b34b3714625562b69 100644 index fdda98cb38ec96d0189931c41257cc01966373d5..9aa134e56d661d033bb7229e6ab662534bf9cba9 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java --- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -587,7 +587,7 @@ public abstract class Player extends LivingEntity { @@ -587,7 +587,7 @@ public abstract class Player extends LivingEntity {
@ -52,7 +37,7 @@ index fdda98cb38ec96d0189931c41257cc01966373d5..0df33131bae2b6651eff4b5b34b37146
this.playShoulderEntityAmbientSound(this.getShoulderEntityRight()); this.playShoulderEntityAmbientSound(this.getShoulderEntityRight());
if (!this.level.isClientSide && (this.fallDistance > 0.5F || this.isInWater()) || this.abilities.flying || this.isSleeping() || this.isInPowderSnow) { if (!this.level.isClientSide && (this.fallDistance > 0.5F || this.isInWater()) || this.abilities.flying || this.isSleeping() || this.isInPowderSnow) {
- this.removeEntitiesOnShoulder(); - this.removeEntitiesOnShoulder();
+ if (!this.level.paperConfig.parrotsHangOnBetter) this.removeEntitiesOnShoulder(); // Paper - Hang on! + if (!this.level.paperConfig().entities.behavior.parrotsAreUnaffectedByPlayerMovement) this.removeEntitiesOnShoulder(); // Paper - Hang on!
} }
} }

View File

@ -5,32 +5,18 @@ Subject: [PATCH] Add configuration option to prevent player names from being
suggested suggested
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index 2440e81ef23c3b8c91ca5bdf13347f13cb66f549..2a4aacd2461401a109d749eee262813367fe4a70 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -280,4 +280,9 @@ public class PaperConfig {
flyingKickPlayerMessage = getString("messages.kick.flying-player", flyingKickPlayerMessage);
flyingKickVehicleMessage = getString("messages.kick.flying-vehicle", flyingKickVehicleMessage);
}
+
+ public static boolean suggestPlayersWhenNullTabCompletions = true;
+ private static void suggestPlayersWhenNull() {
+ suggestPlayersWhenNullTabCompletions = getBoolean("settings.suggest-player-names-when-null-tab-completions", suggestPlayersWhenNullTabCompletions);
+ }
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index ae1cfe01f285a773ab9d4bdb9b0dd897615f0b82..2d4292fa7e474d81ce974cfeda0cf56a2b5a19f2 100644 index 437d479e319becb8d9d4ec9544a9fa2aebc72160..d4f944daae8139973b615983620957cf89d96e7b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2549,5 +2549,10 @@ public final class CraftServer implements Server { @@ -2546,5 +2546,10 @@ public final class CraftServer implements Server {
commandMap.registerServerAliases(); commandMap.registerServerAliases();
return true; return true;
} }
+ +
+ @Override + @Override
+ public boolean suggestPlayerNamesWhenNullTabCompletions() { + public boolean suggestPlayerNamesWhenNullTabCompletions() {
+ return com.destroystokyo.paper.PaperConfig.suggestPlayersWhenNullTabCompletions; + return io.papermc.paper.configuration.GlobalConfiguration.get().commands.suggestPlayerNamesWhenNullTabCompletions;
+ } + }
// Paper end // Paper end
} }

View File

@ -19,7 +19,7 @@ Other changes:
configuration configuration
diff --git a/build.gradle.kts b/build.gradle.kts diff --git a/build.gradle.kts b/build.gradle.kts
index eef372c7f0a7fc057ee6d642f220ed0ecdd81ac0..0b5628ddf2332d12fc3d44bb32323a513c7240f2 100644 index 9442f5e05869aeb267f8effd01974cad5f167188..a8bc19403fc82ef03e43afe8ddf5fa78890e8dda 100644
--- a/build.gradle.kts --- a/build.gradle.kts
+++ b/build.gradle.kts +++ b/build.gradle.kts
@@ -8,7 +8,17 @@ plugins { @@ -8,7 +8,17 @@ plugins {
@ -112,10 +112,10 @@ index 0000000000000000000000000000000000000000..685deaa0e5d1ddc13e3a7c0471b1cfcf
+ +
+} +}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index b2dfce9bb43360e1c405d32f255ef16e00d31b32..64a6f488be70dafc09c8d713aa4d9edd4a70177a 100644 index e4913a7dd431dc861fa93c099e9be97f00519a18..2cdde6eaf2221bb634fd0d34db849c0a6833cfbd 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -158,7 +158,7 @@ import org.slf4j.Logger; @@ -157,7 +157,7 @@ import org.slf4j.Logger;
import com.mojang.serialization.DynamicOps; import com.mojang.serialization.DynamicOps;
import com.mojang.serialization.Lifecycle; import com.mojang.serialization.Lifecycle;
import java.util.Random; import java.util.Random;
@ -124,7 +124,7 @@ index b2dfce9bb43360e1c405d32f255ef16e00d31b32..64a6f488be70dafc09c8d713aa4d9edd
import joptsimple.OptionSet; import joptsimple.OptionSet;
import net.minecraft.server.bossevents.CustomBossEvents; import net.minecraft.server.bossevents.CustomBossEvents;
import net.minecraft.server.dedicated.DedicatedServer; import net.minecraft.server.dedicated.DedicatedServer;
@@ -269,7 +269,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -268,7 +268,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public OptionSet options; public OptionSet options;
public org.bukkit.command.ConsoleCommandSender console; public org.bukkit.command.ConsoleCommandSender console;
public org.bukkit.command.RemoteConsoleCommandSender remoteConsole; public org.bukkit.command.RemoteConsoleCommandSender remoteConsole;
@ -150,8 +150,8 @@ index b2dfce9bb43360e1c405d32f255ef16e00d31b32..64a6f488be70dafc09c8d713aa4d9edd
+ */ + */
+ // Paper end + // Paper end
Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this)); Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this));
this.paperConfigurations = services.paperConfigurations(); // Paper
} }
// CraftBukkit end
@@ -1139,7 +1143,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1139,7 +1143,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
org.spigotmc.WatchdogThread.doStop(); // Spigot org.spigotmc.WatchdogThread.doStop(); // Spigot
// CraftBukkit start - Restore terminal to original settings // CraftBukkit start - Restore terminal to original settings
@ -171,7 +171,7 @@ index b2dfce9bb43360e1c405d32f255ef16e00d31b32..64a6f488be70dafc09c8d713aa4d9edd
public KeyPair getKeyPair() { public KeyPair getKeyPair() {
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 576fc01b902acaf2a217db3fb39b799f2f57ce01..7364612dfb789659f6e28d4b2e379142bd0f5ea0 100644 index 6effe3fae35b4039fbe8dd6d6922097afed646fe..3594241f443f2ebeb21721c3fb6cc10f09e2f5ed 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -103,6 +103,9 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -103,6 +103,9 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@ -222,7 +222,7 @@ index 576fc01b902acaf2a217db3fb39b799f2f57ce01..7364612dfb789659f6e28d4b2e379142
System.setOut(IoBuilder.forLogger(logger).setLevel(Level.INFO).buildPrintStream()); System.setOut(IoBuilder.forLogger(logger).setLevel(Level.INFO).buildPrintStream());
System.setErr(IoBuilder.forLogger(logger).setLevel(Level.WARN).buildPrintStream()); System.setErr(IoBuilder.forLogger(logger).setLevel(Level.WARN).buildPrintStream());
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index b477f31ac8313e8f4c1f288fc0cf6bc2544c1f28..41924db9df7d3d9df0385d3274894ef8058cf2c6 100644 index b28bb51e5476b250d9de91f2e380dd8ed2aa7041..9cb9e0a4d1467cb5c23dfd38e83d495a3907d984 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -159,8 +159,7 @@ public abstract class PlayerList { @@ -159,8 +159,7 @@ public abstract class PlayerList {
@ -236,7 +236,7 @@ index b477f31ac8313e8f4c1f288fc0cf6bc2544c1f28..41924db9df7d3d9df0385d3274894ef8
this.bans = new UserBanList(PlayerList.USERBANLIST_FILE); this.bans = new UserBanList(PlayerList.USERBANLIST_FILE);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 2d4292fa7e474d81ce974cfeda0cf56a2b5a19f2..565d3d16828dbd55ef3445d873398922671b16c2 100644 index d4f944daae8139973b615983620957cf89d96e7b..a04f678289551208cfa42523ec6bf3d2e77e2fa4 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -44,7 +44,6 @@ import java.util.logging.Level; @@ -44,7 +44,6 @@ import java.util.logging.Level;
@ -247,7 +247,7 @@ index 2d4292fa7e474d81ce974cfeda0cf56a2b5a19f2..565d3d16828dbd55ef3445d873398922
import net.minecraft.advancements.Advancement; import net.minecraft.advancements.Advancement;
import net.minecraft.commands.CommandSourceStack; import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.Commands; import net.minecraft.commands.Commands;
@@ -1266,9 +1265,13 @@ public final class CraftServer implements Server { @@ -1265,9 +1264,13 @@ public final class CraftServer implements Server {
return this.logger; return this.logger;
} }

View File

@ -5,23 +5,8 @@ Subject: [PATCH] provide a configurable option to disable creeper lingering
effect spawns effect spawns
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index aa8a02c9fab8938e8064a60f1faf5421aab3892c..99ce64e4d01b58d887506841451e561c2796c413 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -403,4 +403,10 @@ public class PaperWorldConfig {
parrotsHangOnBetter = getBoolean("parrots-are-unaffected-by-player-movement", false);
log("Parrots are unaffected by player movement: " + parrotsHangOnBetter);
}
+
+ public boolean disableCreeperLingeringEffect;
+ private void setDisableCreeperLingeringEffect() {
+ disableCreeperLingeringEffect = getBoolean("disable-creeper-lingering-effect", false);
+ log("Creeper lingering effect: " + disableCreeperLingeringEffect);
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/monster/Creeper.java b/src/main/java/net/minecraft/world/entity/monster/Creeper.java diff --git a/src/main/java/net/minecraft/world/entity/monster/Creeper.java b/src/main/java/net/minecraft/world/entity/monster/Creeper.java
index 7a5eea3a2eaff5e08589fc240307da2beb44c307..e74bd467f6b2fe26d7798abbe089a6311c42be64 100644 index 7a5eea3a2eaff5e08589fc240307da2beb44c307..441eee3d3a639b8eccc4369de0d9e3e7d28bac27 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Creeper.java --- a/src/main/java/net/minecraft/world/entity/monster/Creeper.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Creeper.java +++ b/src/main/java/net/minecraft/world/entity/monster/Creeper.java
@@ -281,7 +281,7 @@ public class Creeper extends Monster implements PowerableMob { @@ -281,7 +281,7 @@ public class Creeper extends Monster implements PowerableMob {
@ -29,7 +14,7 @@ index 7a5eea3a2eaff5e08589fc240307da2beb44c307..e74bd467f6b2fe26d7798abbe089a631
Collection<MobEffectInstance> collection = this.getActiveEffects(); Collection<MobEffectInstance> collection = this.getActiveEffects();
- if (!collection.isEmpty()) { - if (!collection.isEmpty()) {
+ if (!collection.isEmpty() && !level.paperConfig.disableCreeperLingeringEffect) { // Paper + if (!collection.isEmpty() && !level.paperConfig().entities.behavior.disableCreeperLingeringEffect) { // Paper
AreaEffectCloud entityareaeffectcloud = new AreaEffectCloud(this.level, this.getX(), this.getY(), this.getZ()); AreaEffectCloud entityareaeffectcloud = new AreaEffectCloud(this.level, this.getX(), this.getY(), this.getZ());
entityareaeffectcloud.setOwner(this); // CraftBukkit entityareaeffectcloud.setOwner(this); // CraftBukkit

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Item#canEntityPickup
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index 7827e40e824de85ae1f6ea6fc82455b2cea532cb..932f54d8a6db9455d9fd947baad0de7850ccd563 100644 index c09f1ac470c4055897f8d6c6201bd8dc421cdbfe..049a9c4547428d7306d82ed35bcd470ae6f3efc3 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java --- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -629,6 +629,11 @@ public abstract class Mob extends LivingEntity { @@ -629,6 +629,11 @@ public abstract class Mob extends LivingEntity {

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