Prior to this change, if a player was ever set to have a negative view
distance, an attempt to set them back to the default would fail, leading
to them appearing to be stuck in that state.
Now we just interpret that negative value as a "reset" to default.
Thankfully I randomly think about code and randomly wondered if I used <= or < here, and caught this!
This would of missed some chunks for the structure at the highest X/Z
Improves performance by keying every chunk thats part of a structure to a hashmap
instead of only the first one.
This allows us to avoid iterating the entire structures value set to see
if a block position is inside of a structure.
This should have pretty decent performance improvement to any standard world
that has been around for a whilewith lots of structures due to ineffeciencies
in how MC stores structures (even unloaded chunks has structured data loaded)
In some environments, the 2.20.1 version of the maven surefire plugin
can cause builds to fail due to changes in surefire in how it detects
that the forked JVM used for testing is still alive or not.
Entity AI tasks are initialized earlier in recent versions
of MC, this means that the fromMobSpawner has not been set
at the point where AI tasks are initilazed and so the goalFloat
will never be populated.
To rectify this, we can rely on the entity tick checking if
the mob is from a spawner each tick, and just initialize the
field should the paper option be enabled. This saves us from
having to modify the call chain in order to pass the fact that
it was created by a mobSpawner earlier.
HashSet sometimes uses compareTo() instead of equals() and this breaks the comparison of net.minecraft.server.NextTickListEntry (the only place where HashTreeSet is used).
In this cases duplicate entries could be added to the HashSet of HashTreeSet, because NextTickListEntry.compareTo() does not return 0, even if NextTickListEntry.equals() returns true.
ObjectOpenHashSet never uses compareTo(), so the inconsistencies of NextTickListEntry cause no problems.
Fixes https://github.com/PaperMC/Paper/issues/588
Port of 303a775fc3
Will display a list of all entities in a world, as well as which chunks
they are in. Hopefully, this will make tracking down chunks with lots of
entities easier.
Only real change from the forge version is that instead of dimension
IDs, we accept world names in the form of a string.
/paper entity list - Lists all entities in the player's current world
/paper entity list minecraft:zombie - Lists all zombies in the player's
current world
/paper entity list * world_nether - Lists all entities in the nether
/paper entity list minecraft:ghast world_nether - Lists all ghasts in
the nether
This commit removes two patches from spigot:
please review the patch messages for more information, however;
"Allow Disabling of Random Lighting Updates" potentially leaves chunk light maps in an invalid state, with
how often the server looks at these anyways, this patch really serves a questionable nature, the work is
going to be done, only it's being delayed and allowing the light map to be left in a potentially outdated
state.
"Fix some chunks not being sent to the client" sends chunks before their lighting has been calculated, this
means that the client will recieve chunks before they lighting has been calculated which can cause rendering
artifacts. The original issue around this patch appears to have already been fixed years ago.
In 1.12.2, Mojang moved the processing of PacketPlayInKeepAlive off the main
thread, while entirely correct for the server, this causes issues with
plugins which are expecting the PlayerQuitEvent on the main thread.
In order to counteract some bad behavior, we will post handling of the
disconnection to the main thread, but leave the actual processing of the packet
on the main thread.
http://openjdk.java.net/jeps/223
Java decided to change their versioning scheme and in doing so modified the
java.version system property to return $major[.$minor][.$secuity][-ea], as
opposed to 1.$major.0_$identifier we can handle pre-9 by checking if the "major"
is equal to "1", otherwise, 9+
of course, it really wouldn't be all that simple if they didn't add a quirk, now would it.
valid strings for the major may potentially include values such as -ea to deannotate a pre release
Some plugins bypass the plugin logger and add the plugin prefix
manually to the log message. Since they use other logger names
(e.g. qualified class names) these would now also appear in the
log. Disable the logger prefix for these plugins so the messages
show up correctly.
SLF4J is a commonly used abstraction for various logging frameworks
such as java.util.logging (JUL) or Log4j. Currently, plugins are
required to do all their logging using the provided JUL logger.
This is annoying for plugins that target multiple platforms or when
using libraries that log messages using SLF4J.
Expose SLF4J as optional logging API for plugins, so they can use
it without having to shade it in the plugin and going through
several layers of logging abstraction.
Log4j2 provides an optimized implementation of PrintStream that
redirects its output to a logger. Use it instead of a custom
implementation for minor performance improvements and some fixes.
With the old implementation, each call to System.print()
results in a separate line, even though it should not result in
a line break. Log4j's implementation handles it correctly.
Refactored 0229-Fix-this-stupid-bullshit in order to prevent merge conflicts
when spigot decides to update the timer and to provide some form of hint in the
console/log on startup.
FixesPaperMC/Paper#883 same issue as MinecraftForge/MinecraftForge#4386
A more detailed anaylsis of what is probably going on, courtesy of
@bs2609 and the MCForge Issue Tracker is:
When a chunk is unloaded, the entities and tile entities it contains are
marked for removal. The actual removal (from the world) occurs later,
when the world ticks its entities.
Conversely, when a chunk is loaded, it generally adds its entities to
the world promptly, without queuing.
Here's the normal sequence of events:
Chunk unloaded
Old entities removed
Chunk loaded
New entities added
However, what can happen:
Chunk unloaded
Chunk loaded
New entities added
Old entities removed
This occurs when an unloaded chunk is reloaded before its corresponding
entities have been removed.
Fixes falling dragon eggs in lazy chunks fall to the block below the last empty block and replacing that block with them.
See also https://bugs.mojang.com/browse/MC-94186
Spigot is manipulating the Travel Agents canCreatePortal, but forgot to reset it on cancel
This causes nether portals to not be generated if the event is ever cancelled
Gets the Display name as seen in the Client.
Currently the server only supports the English language. To override this,
You must replace the language file embedded in the server jar.
This will take a Bukkit ItemStack and run it through any conversions a server process would perform on it,
to ensure it meets latest minecraft expectations.
Not all horses with Saddles have armor. This lets us break up the horses with saddles
and access their saddle state separately from an interface shared with Armor.
In Java 8u141 (1.8.0_141-b15) and newer, the
com.sun.management.HotSpotDiagnostic::dumpHeap API has changed and now
requires all heap dumps to end with the .hprof file extension.
Before this change, servers running 8u141 would be unable to perform a
heap dump.
For more information, please see the official release notes of Java 8
Update 141, linked below.
http://www.oracle.com/technetwork/java/javase/8u141-relnotes-3720385.html
To dump the server heap, run the following command:
`/paper heap`
This is added with the intent that it is useful for administrators and
developers to more easily identify and resolve memory leaks. Both by examining
these dumps themselves and by more easily allowing them to send them to
knowledgable parties.
This is a nearly line-for-line port of the same Sponge feature. So all
credit for the idea and implementation belongs to the that team.
Specifically the following commits:
be08be04b05e10a1b795
763827668e
Was done incorrectly and is now causing level desyncs to client.
Always send current level to the client, and instead make setWindowProperty set the level.
Messages written to System.out are automatically redirected to the
root logger by CraftBukkit. However, before the messages reach the
logger, they are encoded and later decoded again using the standard
system encoding.
On some systems (e.g. FreeBSD), the standard system encoding is
US-ASCII by default, which doesn't support the section sign (§) that
is used for the color codes. Consequently, they will never reach
the formatter that translates them into ANSI escape codes.
There is no reason to write these messages to System.out - it just
adds additional overhead and the encoding problems. We can just log
the messages directly with the root logger.
Adds a Pre Lookup Event and a Post Lookup Event so that plugins may prefill in profile data, and cache the responses from
profiles that had to be looked up.
There is usually no reason to stop reading from the console, so
preventing console input after EOT can be extremely confusing.
To prevent this, we can simply ignore the exception thrown by
JLine and continue reading normally.
It was originally added in Bukkit/CraftBukkit@6aafe7c5a1 as a
workaround for BUKKIT-4956 to fix console output on Windows.
I believe the original issue was related to LOG4J2-965 and fixed
in apache/logging-log4j2@d04659c. Minecraft 1.12 finally updated
the Log4J version so this issue is no longer present.
Console output is still working fine on Windows after removing this.
Rewrite console improvements (console colors, tab completion,
persistent input line, ...) using JLine 3.x and TerminalConsoleAppender.
New features:
- Support console colors for Vanilla commands
- Add console colors for warnings and errors
- Server can now be turned off safely using CTRL + C. JLine catches
the signal and the implementation shuts down the server cleanly.
- Support console colors and persistent input line when running in
IntelliJ IDEA
Other changes:
- Update JLine to 3.3.1 (from 2.12.1)
- Server starts 1-2 seconds faster thanks to optimizations in Log4j
configuration
When enabled, Parrots will not fly off of a player's shoulder everytime
they change Y level, touch water, sneeze, etc.
Instead, a player must toggle shift to "shake" the parrots off.