mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-22 04:33:28 +01:00
more more more work
This commit is contained in:
parent
233b5b5bec
commit
86931baedf
50 changed files with 59 additions and 78 deletions
patches/server
Add-PlayerUseUnknownEntityEvent.patchAdd-World-Util-Methods.patchAdd-ability-to-configure-frosted_ice-properties.patchAdd-configurable-portal-search-radius.patchAdd-exception-reporting-event.patchAdd-handshake-event-to-allow-plugins-to-handle-clien.patchAdd-methods-for-working-with-arrows-stuck-in-living-.patchAdd-velocity-warnings.patchAll-chunks-are-slime-spawn-chunks-toggle.patchAllow-Reloading-of-Custom-Permissions.patchAsync-GameProfileCache-saving.patchBe-a-bit-more-informative-in-maxHealth-exception.patchChunk-Save-Reattempt.patchComplete-resource-pack-API.patchConfigurable-Chunk-Inhabited-Time.patchConfigurable-Grass-Spread-Tick-Rate.patchConfigurable-Non-Player-Arrow-Despawn-Rate.patchConfigurable-Player-Collision.patchConfigurable-RCON-IP-address.patchConfigurable-inter-world-teleportation-safety.patchConfigurable-spawn-chances-for-skeleton-horses.patchCustom-replacement-for-eaten-items.patchDefault-loading-permissions.yml-before-plugins.patchDisable-Scoreboards-for-non-players-by-default.patchDo-not-load-chunks-for-Pathfinding.patchDon-t-nest-if-we-don-t-need-to-when-cerealising-text.patchDon-t-save-empty-scoreboard-teams-to-scoreboard.dat.patchEntity-AddTo-RemoveFrom-World-Events.patchEntityPathfindEvent.patchEntityRegainHealthEvent-isFastRegen-API.patchExpose-server-CommandMap.patchFaster-redstone-torch-rapid-clock-removal.patchFix-Cancelling-BlockPlaceEvent-triggering-physics.patchHandle-Item-Meta-Inconsistencies.patchImprove-Maps-in-item-frames-performance-and-bug-fixe.patchImprove-Player-chat-API-handling.patchLootTable-API-Replenishable-Lootables-Feature.patchOnly-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patchOptimize-DataBits.patchOptimize-isInWorldBounds-and-getBlockState-for-inlin.patchOption-to-use-vanilla-per-world-scoreboard-coloring-.patchOptional-TNT-doesn-t-move-in-water.patchPlayer-Tab-List-and-Title-APIs.patchRemove-Metadata-on-reload.patchSanitise-RegionFileCache-and-make-configurable.patchStrip-raytracing-for-EntityLiving-hasLineOfSight.patchSystem-property-for-disabling-watchdoge.patchUse-a-Shared-Random-for-Entities.patchhandle-NaN-health-absorb-values-and-repair-bad-data.patchremove-null-possibility-for-getServer-singleton.patch
|
@ -31,7 +31,7 @@ diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListener
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 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
|
||||||
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -12,14 +12,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
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, new PositionImpl(blockposition.getX(), blockposition.getY(), blockposition.getZ()), PlayerTeleportEvent.TeleportCause.NETHER_PORTAL, flag2 ? 16 : 128, 16);
|
- CraftPortalEvent event = this.callPortalEvent(this, destination, new Vec3(blockposition.getX(), blockposition.getY(), blockposition.getZ()), PlayerTeleportEvent.TeleportCause.NETHER_PORTAL, flag2 ? 16 : 128, 16);
|
||||||
+ // Paper start
|
+ // Paper start
|
||||||
+ int portalSearchRadius = destination.paperConfig().environment.portalSearchRadius;
|
+ int portalSearchRadius = destination.paperConfig().environment.portalSearchRadius;
|
||||||
+ if (level.paperConfig().environment.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, new PositionImpl(blockposition.getX(), blockposition.getY(), blockposition.getZ()), PlayerTeleportEvent.TeleportCause.NETHER_PORTAL, portalSearchRadius, destination.paperConfig().environment.portalCreateRadius); // Paper start - configurable portal radius
|
+ CraftPortalEvent event = this.callPortalEvent(this, destination, new Vec3(blockposition.getX(), blockposition.getY(), blockposition.getZ()), PlayerTeleportEvent.TeleportCause.NETHER_PORTAL, portalSearchRadius, destination.paperConfig().environment.portalCreateRadius); // Paper start - configurable portal radius
|
||||||
if (event == null) {
|
if (event == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
|
@ -38,12 +38,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
// Spigot Start
|
// Spigot Start
|
||||||
String[] split = packet.hostName.split("\00");
|
String[] split = packet.hostName().split("\00");
|
||||||
- if (org.spigotmc.SpigotConfig.bungee) {
|
- if (org.spigotmc.SpigotConfig.bungee) {
|
||||||
+ // Don't try and handle default logic if it's been handled by the event.
|
+ // Don't try and handle default logic if it's been handled by the event.
|
||||||
+ if (!handledByEvent && proxyLogicEnabled) {
|
+ if (!handledByEvent && proxyLogicEnabled) {
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
+ // if (org.spigotmc.SpigotConfig.bungee) { // Paper - comment out, we check above!
|
+ // if (org.spigotmc.SpigotConfig.bungee) { // Paper - comment out, we check above!
|
||||||
if ( ( split.length == 3 || split.length == 4 ) && ( ServerHandshakePacketListenerImpl.HOST_PATTERN.matcher( split[1] ).matches() ) ) {
|
if ( ( split.length == 3 || split.length == 4 ) && ( ServerHandshakePacketListenerImpl.HOST_PATTERN.matcher( split[1] ).matches() ) ) {
|
||||||
packet.hostName = split[0];
|
connection.hostname = split[0];
|
||||||
connection.address = new java.net.InetSocketAddress(split[1], ((java.net.InetSocketAddress) this.connection.getRemoteAddress()).getPort());
|
connection.address = new java.net.InetSocketAddress(split[1], ((java.net.InetSocketAddress) this.connection.getRemoteAddress()).getPort());
|
|
@ -65,7 +65,7 @@ diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/org/spigotmc/WatchdogThread.java
|
--- a/src/main/java/org/spigotmc/WatchdogThread.java
|
||||||
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
|
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
|
||||||
@@ -0,0 +0,0 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
|
@@ -0,0 +0,0 @@ public class WatchdogThread extends Thread
|
||||||
log.log( Level.SEVERE, "During the run of the server, a physics stackoverflow was supressed" );
|
log.log( Level.SEVERE, "During the run of the server, a physics stackoverflow was supressed" );
|
||||||
log.log( Level.SEVERE, "near " + net.minecraft.world.level.Level.lastPhysicsProblem );
|
log.log( Level.SEVERE, "near " + net.minecraft.world.level.Level.lastPhysicsProblem );
|
||||||
}
|
}
|
||||||
|
@ -85,4 +85,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
log.log( Level.SEVERE, "------------------------------" );
|
log.log( Level.SEVERE, "------------------------------" );
|
||||||
log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Paper!):" ); // Paper
|
log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Paper!):" ); // Paper
|
||||||
io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.dumpAllChunkLoadInfo(isLongTimeout); // Paper // Paper - rewrite chunk system
|
WatchdogThread.dumpThread( ManagementFactory.getThreadMXBean().getThreadInfo( MinecraftServer.getServer().serverThread.getId(), Integer.MAX_VALUE ), log );
|
|
@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ this.getProfileCache().save(false); // Paper
|
+ this.getProfileCache().save(false); // Paper
|
||||||
}
|
}
|
||||||
// Spigot end
|
// Spigot end
|
||||||
io.papermc.paper.chunk.system.io.RegionFileIOThread.close(true); // Paper // Paper - rewrite chunk system
|
|
||||||
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
|
@ -22,15 +22,15 @@ diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileSto
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 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
|
||||||
@@ -0,0 +0,0 @@ public class RegionFileStorage implements AutoCloseable {
|
@@ -0,0 +0,0 @@ public final class RegionFileStorage implements AutoCloseable {
|
||||||
}
|
|
||||||
// Paper end - rewrite chunk system
|
protected void write(ChunkPos pos, @Nullable CompoundTag nbt) throws IOException {
|
||||||
try { // Paper
|
RegionFile regionfile = this.getRegionFile(pos, false); // CraftBukkit
|
||||||
+ int attempts = 0; Exception laste = null; while (attempts++ < 5) { try { // Paper
|
+ int attempts = 0; Exception laste = null; while (attempts++ < 5) { try { // Paper
|
||||||
|
|
||||||
if (nbt == null) {
|
if (nbt == null) {
|
||||||
regionfile.clear(pos);
|
regionfile.clear(pos);
|
||||||
@@ -0,0 +0,0 @@ public class RegionFileStorage implements AutoCloseable {
|
@@ -0,0 +0,0 @@ public final class RegionFileStorage implements AutoCloseable {
|
||||||
dataoutputstream.close();
|
dataoutputstream.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ net.minecraft.server.MinecraftServer.LOGGER.error("Failed to save chunk " + pos, laste);
|
+ net.minecraft.server.MinecraftServer.LOGGER.error("Failed to save chunk " + pos, laste);
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
} finally { // Paper start
|
}
|
||||||
regionfile.fileLock.unlock();
|
|
||||||
} // Paper end
|
public void close() throws IOException {
|
|
@ -4,24 +4,23 @@ Date: Sat, 4 Apr 2015 23:17:52 -0400
|
||||||
Subject: [PATCH] Complete resource pack API
|
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/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||||
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@@ -0,0 +0,0 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||||
ServerGamePacketListenerImpl.LOGGER.info("Disconnecting {} due to resource pack rejection", this.player.getName());
|
ServerCommonPacketListenerImpl.LOGGER.info("Disconnecting {} due to resource pack rejection", this.playerProfile().getName());
|
||||||
this.disconnect(Component.translatable("multiplayer.requiredTexturePrompt.disconnect"));
|
this.disconnect(Component.translatable("multiplayer.requiredTexturePrompt.disconnect"));
|
||||||
}
|
}
|
||||||
- this.cserver.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(this.getCraftPlayer(), PlayerResourcePackStatusEvent.Status.values()[packet.action.ordinal()])); // CraftBukkit
|
- this.cserver.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(this.getCraftPlayer(), PlayerResourcePackStatusEvent.Status.values()[packet.getAction().ordinal()])); // CraftBukkit
|
||||||
-
|
|
||||||
+ // Paper start
|
+ // Paper start
|
||||||
+ PlayerResourcePackStatusEvent.Status packStatus = PlayerResourcePackStatusEvent.Status.values()[packet.action.ordinal()];
|
+ PlayerResourcePackStatusEvent.Status packStatus = PlayerResourcePackStatusEvent.Status.values()[packet.getAction().ordinal()];
|
||||||
+ player.getBukkitEntity().setResourcePackStatus(packStatus);
|
+ player.getBukkitEntity().setResourcePackStatus(packStatus);
|
||||||
+ this.cserver.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(this.getCraftPlayer(), packStatus)); // CraftBukkit
|
+ this.cserver.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(this.getCraftPlayer(), packStatus)); // CraftBukkit
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
@ -46,8 +46,8 @@ diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/ma
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 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
|
||||||
@@ -0,0 +0,0 @@ import net.minecraft.world.level.storage.PlayerDataStorage;
|
@@ -0,0 +0,0 @@ import net.minecraft.world.phys.Vec3;
|
||||||
import net.minecraft.world.phys.Vec3;
|
import net.minecraft.world.scores.DisplaySlot;
|
||||||
import net.minecraft.world.scores.Objective;
|
import net.minecraft.world.scores.Objective;
|
||||||
import net.minecraft.world.scores.PlayerTeam;
|
import net.minecraft.world.scores.PlayerTeam;
|
||||||
+import net.minecraft.world.scores.Scoreboard; // Paper
|
+import net.minecraft.world.scores.Scoreboard; // Paper
|
|
@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
--- 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
|
||||||
@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||||
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);
|
||||||
- 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);
|
|
@ -28,30 +28,25 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
@Override
|
@Override
|
||||||
- public Path createPath(BlockPos target, int distance) {
|
- public Path createPath(BlockPos target, int distance) {
|
||||||
+ public Path createPath(BlockPos target, @javax.annotation.Nullable Entity entity, int distance) { // Paper
|
+ public Path createPath(BlockPos target, @javax.annotation.Nullable Entity entity, int distance) { // Paper
|
||||||
if (this.level.getBlockState(target).isAir()) {
|
LevelChunk levelChunk = this.level.getChunkSource().getChunkNow(SectionPos.blockToSectionCoord(target.getX()), SectionPos.blockToSectionCoord(target.getZ()));
|
||||||
BlockPos blockPos;
|
if (levelChunk == null) {
|
||||||
for(blockPos = target.below(); blockPos.getY() > this.level.getMinBuildHeight() && this.level.getBlockState(blockPos).isAir(); blockPos = blockPos.below()) {
|
return null;
|
||||||
}
|
|
||||||
|
|
||||||
if (blockPos.getY() > this.level.getMinBuildHeight()) {
|
|
||||||
- return super.createPath(blockPos.above(), distance);
|
|
||||||
+ return super.createPath(blockPos.above(), entity, distance); // Paper
|
|
||||||
}
|
|
||||||
|
|
||||||
while(blockPos.getY() < this.level.getMaxBuildHeight() && this.level.getBlockState(blockPos).isAir()) {
|
|
||||||
@@ -0,0 +0,0 @@ public class GroundPathNavigation extends PathNavigation {
|
@@ -0,0 +0,0 @@ public class GroundPathNavigation extends PathNavigation {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.level.getBlockState(target).isSolid()) {
|
if (blockPos.getY() > this.level.getMinBuildHeight()) {
|
||||||
- return super.createPath(target, distance);
|
- return super.createPath(blockPos.above(), distance);
|
||||||
+ return super.createPath(target, entity, distance); // Paper
|
+ return super.createPath(blockPos.above(), entity, distance); // Paper
|
||||||
} else {
|
}
|
||||||
BlockPos blockPos2;
|
|
||||||
for(blockPos2 = target.above(); blockPos2.getY() < this.level.getMaxBuildHeight() && this.level.getBlockState(blockPos2).isSolid(); blockPos2 = blockPos2.above()) {
|
while(blockPos.getY() < this.level.getMaxBuildHeight() && levelChunk.getBlockState(blockPos).isAir()) {
|
||||||
|
@@ -0,0 +0,0 @@ public class GroundPathNavigation extends PathNavigation {
|
||||||
|
for(blockPos2 = target.above(); blockPos2.getY() < this.level.getMaxBuildHeight() && levelChunk.getBlockState(blockPos2).isSolid(); blockPos2 = blockPos2.above()) {
|
||||||
|
}
|
||||||
|
|
||||||
|
- return super.createPath(blockPos2, distance);
|
||||||
|
+ return super.createPath(blockPos2, entity, distance); // Paper
|
||||||
}
|
}
|
||||||
|
|
||||||
- return super.createPath(blockPos2, distance);
|
|
||||||
+ return super.createPath(blockPos2, entity, distance); // Paper
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,16 +66,3 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
|
|
||||||
if (addNew) {
|
if (addNew) {
|
||||||
list.add(new RedstoneTorchBlock.Toggle(pos.immutable(), world.getGameTime()));
|
list.add(new RedstoneTorchBlock.Toggle(pos.immutable(), world.getGameTime()));
|
||||||
@@ -0,0 +0,0 @@ public class RedstoneTorchBlock extends TorchBlock {
|
|
||||||
|
|
||||||
int i = 0;
|
|
||||||
|
|
||||||
- for (int j = 0; j < list.size(); ++j) {
|
|
||||||
- RedstoneTorchBlock.Toggle blockredstonetorch_redstoneupdateinfo = (RedstoneTorchBlock.Toggle) list.get(j);
|
|
||||||
-
|
|
||||||
+ for (java.util.Iterator<RedstoneTorchBlock.Toggle> iterator = list.iterator(); iterator.hasNext();) {
|
|
||||||
+ RedstoneTorchBlock.Toggle blockredstonetorch_redstoneupdateinfo = iterator.next();
|
|
||||||
+ // Paper end
|
|
||||||
if (blockredstonetorch_redstoneupdateinfo.pos.equals(pos)) {
|
|
||||||
++i;
|
|
||||||
if (i >= 8) {
|
|
|
@ -20,7 +20,7 @@ diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListener
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 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
|
||||||
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
}
|
}
|
||||||
OutgoingChatMessage outgoing = OutgoingChatMessage.create(original);
|
OutgoingChatMessage outgoing = OutgoingChatMessage.create(original);
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
this.handleCommand(s);
|
this.handleCommand(s);
|
||||||
} 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
|
||||||
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
+++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
||||||
@@ -0,0 +0,0 @@ public class FriendlyByteBuf extends ByteBuf {
|
@@ -0,0 +0,0 @@ public class FriendlyByteBuf extends ByteBuf {
|
||||||
public FriendlyByteBuf writeComponent(final net.kyori.adventure.text.Component component) {
|
public FriendlyByteBuf writeComponent(final net.kyori.adventure.text.Component component) {
|
||||||
return this.writeUtf(PaperAdventure.asJsonString(component, this.adventure$locale), 262144);
|
return this.writeUtf(io.papermc.paper.adventure.PaperAdventure.asJsonString(component, this.adventure$locale), 262144);
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ @Deprecated
|
+ @Deprecated
|
|
@ -14,10 +14,10 @@ diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileSto
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 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
|
||||||
@@ -0,0 +0,0 @@ public class RegionFileStorage implements AutoCloseable {
|
@@ -0,0 +0,0 @@ public final class RegionFileStorage implements AutoCloseable {
|
||||||
return null;
|
if (regionfile != null) {
|
||||||
}
|
return regionfile;
|
||||||
// Paper end - cache regionfile does not exist state
|
} else {
|
||||||
- if (this.regionCache.size() >= 256) {
|
- if (this.regionCache.size() >= 256) {
|
||||||
+ if (this.regionCache.size() >= io.papermc.paper.configuration.GlobalConfiguration.get().misc.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();
|
|
@ -8,7 +8,7 @@ diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/org/spigotmc/WatchdogThread.java
|
--- a/src/main/java/org/spigotmc/WatchdogThread.java
|
||||||
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
|
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
|
||||||
@@ -0,0 +0,0 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
|
@@ -0,0 +0,0 @@ public class WatchdogThread extends Thread
|
||||||
while ( !this.stopping )
|
while ( !this.stopping )
|
||||||
{
|
{
|
||||||
//
|
//
|
|
@ -12,13 +12,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void readAdditionalSaveData(CompoundTag nbt) {
|
public void readAdditionalSaveData(CompoundTag nbt) {
|
||||||
- this.setAbsorptionAmount(nbt.getFloat("AbsorptionAmount"));
|
- this.internalSetAbsorptionAmount(nbt.getFloat("AbsorptionAmount"));
|
||||||
+ // Paper start - jvm keeps optimizing the setter
|
+ // Paper start - jvm keeps optimizing the setter
|
||||||
+ float absorptionAmount = nbt.getFloat("AbsorptionAmount");
|
+ float absorptionAmount = nbt.getFloat("AbsorptionAmount");
|
||||||
+ if (Float.isNaN(absorptionAmount)) {
|
+ if (Float.isNaN(absorptionAmount)) {
|
||||||
+ absorptionAmount = 0;
|
+ absorptionAmount = 0;
|
||||||
+ }
|
+ }
|
||||||
+ this.setAbsorptionAmount(absorptionAmount);
|
+ this.internalSetAbsorptionAmount(absorptionAmount);
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
if (nbt.contains("Attributes", 9) && this.level() != null && !this.level().isClientSide) {
|
if (nbt.contains("Attributes", 9) && this.level() != null && !this.level().isClientSide) {
|
||||||
this.getAttributes().load(nbt.getList("Attributes", 10));
|
this.getAttributes().load(nbt.getList("Attributes", 10));
|
||||||
|
@ -37,12 +37,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAbsorptionAmount(float amount) {
|
public final void setAbsorptionAmount(float absorptionAmount) {
|
||||||
- if (amount < 0.0F) {
|
- this.internalSetAbsorptionAmount(Mth.clamp(absorptionAmount, 0.0F, this.getMaxAbsorption()));
|
||||||
+ if (amount < 0.0F || Float.isNaN(amount)) { // Paper
|
+ this.internalSetAbsorptionAmount(!Float.isNaN(absorptionAmount) ? Mth.clamp(absorptionAmount, 0.0F, this.getMaxAbsorption()) : 0.0F); // Paper
|
||||||
amount = 0.0F;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
protected void internalSetAbsorptionAmount(float absorptionAmount) {
|
||||||
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -0,0 +0,0 @@ import co.aikar.timings.MinecraftTimings; // Paper
|
@@ -0,0 +0,0 @@ import co.aikar.timings.MinecraftTimings; // Paper
|
||||||
|
|
||||||
public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements CommandSource, AutoCloseable {
|
public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements ServerInfo, CommandSource, AutoCloseable {
|
||||||
|
|
||||||
+ private static MinecraftServer SERVER; // Paper
|
+ private static MinecraftServer SERVER; // Paper
|
||||||
public static final Logger LOGGER = LogUtils.getLogger();
|
public static final Logger LOGGER = LogUtils.getLogger();
|
Loading…
Add table
Reference in a new issue