76ee105811
HashMapPalette uses an instance of CrudeIncrementalIntIdentityHashBiMap internally. A Palette has a preset maximum size = 1 << bits. CrudeIncrementalIntIdentityHashBiMap has an initial size but is automatically resized. The CrudeIncrementalIntIdentityHashBiMap is created with the maximum size in the constructor of HashMapPalette, with the aim that it doesn't need to be resized anymore. However, there are two things that I think Mojang hasn't considered here: 1) The CrudeIncrementalIntIdentityHashBiMap is resized, when its initial size is reached and not the next time, when a further object is added. 2) HashMapPalette adds objects (unnecessarily) before checking if the initial size of CrudeIncrementalIntIdentityHashBiMap is reached. This means to actually avoid resize operations in CrudeIncrementalIntIdentityHashBiMap, one has to add 2 to the initial size or add 1 and check the size before adding objects. This commit implements the second approach. Note that this isn't only an optimization but also makes async reads of Palettes fail-safe. An async read while the CrudeIncrementalIntIdentityHashBiMap is resized is fatal and can even lead to corrupted data. This is also something that Anti-Xray is currently relying on. |
||
---|---|---|
.github | ||
build-data | ||
gradle/wrapper | ||
licenses | ||
Paper-MojangAPI | ||
patches | ||
scripts | ||
test-plugin | ||
work | ||
.editorconfig | ||
.gitattributes | ||
.gitignore | ||
.gitmodules | ||
build.gradle.kts | ||
CONTRIBUTING.md | ||
gradle.properties | ||
gradlew | ||
gradlew.bat | ||
LICENSE.md | ||
README.md | ||
settings.gradle.kts | ||
todo.txt |
Paper
High performance Spigot fork that aims to fix gameplay and mechanics inconsistencies.
Support and Project Discussion:
How To (Server Admins)
Paperclip is a jar file that you can download and run just like a normal jar file.
Download Paper from our downloads page.
Run the Paperclip jar directly from your server. Just like old times
- Documentation on using Paper: paper.readthedocs.io
- For a sneak peek on upcoming features, see here
How To (Plugin Developers)
- See our API patches here
- See upcoming, pending, and recently added API here
- Paper API javadocs here: papermc.io/javadocs
- Maven Repo (for paper-api):
<repository>
<id>papermc</id>
<url>https://papermc.io/repo/repository/maven-public/</url>
</repository>
- Artifact Information:
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.18-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
Or alternatively, with Gradle:
- Repository:
repositories {
maven {
url = uri("https://papermc.io/repo/repository/maven-public/")
}
}
dependencies {
compileOnly("io.papermc.paper:paper-api:1.18-R0.1-SNAPSHOT")
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}
How To (Compiling Jar From Source)
To compile Paper, you need JDK 17 and an internet connection.
Clone this repo, run ./gradlew applyPatches
, then ./gradlew createReobfBundlerJar
from your terminal. You can find the compiled jar in the project root's build/libs
directory.
To get a full list of tasks, run ./gradlew tasks
.
How To (Pull Request)
See Contributing
Support Us
First of all, thank you for considering helping out, we really appreciate that!
PaperMC has various recurring expenses, mostly related to infrastructure. Paper uses Open Collective via the Open Source Collective fiscal host to manage expenses. Open Collective allows us to be extremely transparent, so you can always see how your donations are used. You can read more about finanically supporting PaperMC on our website.
You can find our collective here, or you can donate via GitHub Sponsors here, which will also go towards the collective.
Special Thanks To:
YourKit, makers of the outstanding java profiler, support open source projects of all kinds with their full featured Java and .NET application profilers. We thank them for granting Paper an OSS license so that we can make our software the best it can be.
JetBrains, creators of the IntelliJ IDEA, supports Paper with one of their Open Source Licenses. IntelliJ IDEA is the recommended IDE for working with Paper, and most of the Paper team uses it.