mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-31 11:49:53 +02:00
add some more patches back
This commit is contained in:
parent
870dafe358
commit
b4ae928db9
317 changed files with 16 additions and 48 deletions
patches/server
0650-Allow-skipping-writing-of-comments-to-server.propert.patch0651-Add-PlayerSetSpawnEvent.patch0652-Make-hoppers-respect-inventory-max-stack-size.patch0653-Optimize-entity-tracker-passenger-checks.patch0654-Config-option-for-Piglins-guarding-chests.patch0655-Added-EntityDamageItemEvent.patch0656-Optimize-indirect-passenger-iteration.patch0657-Configurable-item-frame-map-cursor-update-interval.patch0658-Make-EntityUnleashEvent-cancellable.patch0659-Clear-bucket-NBT-after-dispense.patch0660-Change-EnderEye-target-without-changing-other-things.patch0661-Add-BlockBreakBlockEvent.patch0662-Option-to-prevent-NBT-copy-in-smithing-recipes.patch0663-More-CommandBlock-API.patch0664-Add-missing-team-sidebar-display-slots.patch0665-Add-back-EntityPortalExitEvent.patch0666-Add-methods-to-find-targets-for-lightning-strikes.patch0667-Get-entity-default-attributes.patch0668-Left-handed-API.patch0669-Add-more-advancement-API.patch0670-Add-ItemFactory-getSpawnEgg-API.patch0671-Add-critical-damage-API.patch0672-Fix-issues-with-mob-conversion.patch0673-Add-isCollidable-methods-to-various-places.patch0674-Goat-ram-API.patch0675-Add-API-for-resetting-a-single-score.patch0676-Add-Raw-Byte-Entity-Serialization.patch0677-Vanilla-command-permission-fixes.patch0678-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch0679-Fix-GameProfileCache-concurrency.patch0680-Improve-and-expand-AsyncCatcher.patch0681-Add-paper-mobcaps-and-paper-playermobcaps.patch0682-Sanitize-ResourceLocation-error-logging.patch0683-Allow-controlled-flushing-for-network-manager.patch0684-Optimise-general-POI-access.patch0685-Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch0686-Optimise-chunk-tick-iteration.patch0687-Execute-chunk-tasks-mid-tick.patch0688-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch0689-Custom-table-implementation-for-blockstate-state-loo.patch0690-Detail-more-information-in-watchdog-dumps.patch0691-Manually-inline-methods-in-BlockPosition.patch0692-Distance-manager-tick-timings.patch0693-Name-craft-scheduler-threads-according-to-the-plugin.patch0694-Make-sure-inlined-getChunkAt-has-inlined-logic-for-l.patch0695-Add-packet-limiter-config.patch0696-Don-t-read-neighbour-chunk-data-off-disk-when-conver.patch0697-Consolidate-flush-calls-for-entity-tracker-packets.patch0698-Don-t-lookup-fluid-state-when-raytracing.patch0699-Time-scoreboard-search.patch0700-Send-full-pos-packets-for-hard-colliding-entities.patch0701-Do-not-run-raytrace-logic-for-AIR.patch0702-Oprimise-map-impl-for-tracked-players.patch0703-Optimise-BlockSoil-nearby-water-lookup.patch0704-Optimise-random-block-ticking.patch0705-Optimise-non-flush-packet-sending.patch0706-Optimise-nearby-player-lookups.patch0707-Remove-streams-for-villager-AI.patch0708-Use-Velocity-compression-and-cipher-natives.patch0709-Reduce-worldgen-thread-worker-count-for-low-core-cou.patch0710-Fix-Bukkit-NamespacedKey-shenanigans.patch0711-Fix-merchant-inventory-not-closing-on-entity-removal.patch0712-Check-requirement-before-suggesting-root-nodes.patch0713-Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch0714-Fix-setPatternColor-on-tropical-fish-bucket-meta.patch0715-Ensure-valid-vehicle-status.patch0716-Prevent-softlocked-end-exit-portal-generation.patch0717-Fix-CocaoDecorator-causing-a-crash-when-trying-to-ge.patch0718-Don-t-log-debug-logging-being-disabled.patch0719-fix-various-menus-with-empty-level-accesses.patch0720-Preserve-overstacked-loot.patch0721-Update-head-rotation-in-missing-places.patch0722-prevent-unintended-light-block-manipulation.patch0723-Fix-CraftCriteria-defaults-map.patch0724-Fix-upstreams-block-state-factories.patch0725-Add-config-option-for-logging-player-ip-addresses.patch0726-Configurable-feature-seeds.patch0727-VanillaCommandWrapper-didnt-account-for-entity-sende.patch0728-Add-root-admin-user-detection.patch0729-Always-allow-item-changing-in-Fireball.patch0730-don-t-attempt-to-teleport-dead-entities.patch0731-Prevent-excessive-velocity-through-repeated-crits.patch0732-Remove-client-side-code-using-deprecated-for-removal.patch0733-Fix-removing-recipes-from-RecipeIterator.patch0734-Prevent-sending-oversized-item-data-in-equipment-and.patch0735-Hide-unnecessary-itemmeta-from-clients.patch0736-Fix-Spigot-growth-modifiers.patch0737-Prevent-ContainerOpenersCounter-openCount-from-going.patch0738-Add-PlayerItemFrameChangeEvent.patch0739-Add-player-health-update-API.patch0740-Optimize-HashMapPalette.patch0741-Allow-delegation-to-vanilla-chunk-gen.patch0742-Highly-optimise-single-and-multi-AABB-VoxelShapes-an.patch0743-Optimise-collision-checking-in-player-move-packet-ha.patch0744-Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch0745-Add-more-Campfire-API.patch0746-Only-write-chunk-data-to-disk-if-it-serializes-witho.patch0747-Fix-tripwire-state-inconsistency.patch0748-Forward-CraftEntity-in-teleport-command.patch0749-Improve-scoreboard-entries.patch
|
@ -8,10 +8,10 @@ Makes less git noise, as it won't update the date every single time
|
|||
Use -DPaper.skipServerPropertiesComments=true flag to disable writing it
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/Settings.java b/src/main/java/net/minecraft/server/dedicated/Settings.java
|
||||
index 26fc8127024d7b81ffe5c1c81b8ef8a68e35cbb6..bafd0f3492a0b8778d28610785129c5eba7fe4a2 100644
|
||||
index 9dde5b89e6de9d470b0c0b08e3aa6c471cd075fe..f6e423a76d4c9cf639f1d44af80d33cf3072f6b5 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/Settings.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/Settings.java
|
||||
@@ -23,6 +23,7 @@ public abstract class Settings<T extends Settings<T>> {
|
||||
@@ -29,6 +29,7 @@ public abstract class Settings<T extends Settings<T>> {
|
||||
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
public final Properties properties;
|
||||
|
@ -19,11 +19,13 @@ index 26fc8127024d7b81ffe5c1c81b8ef8a68e35cbb6..bafd0f3492a0b8778d28610785129c5e
|
|||
// CraftBukkit start
|
||||
private OptionSet options = null;
|
||||
|
||||
@@ -80,9 +81,47 @@ public abstract class Settings<T extends Settings<T>> {
|
||||
@@ -118,7 +119,46 @@ public abstract class Settings<T extends Settings<T>> {
|
||||
return;
|
||||
}
|
||||
// CraftBukkit end
|
||||
OutputStream outputstream = Files.newOutputStream(path);
|
||||
- BufferedWriter bufferedwriter = Files.newBufferedWriter(path, StandardCharsets.UTF_8);
|
||||
+ // Paper start - disable writing comments to properties file
|
||||
+ java.io.OutputStream outputstream = Files.newOutputStream(path);
|
||||
+ java.io.BufferedOutputStream bufferedOutputStream = !skipComments ? new java.io.BufferedOutputStream(outputstream) : new java.io.BufferedOutputStream(outputstream) {
|
||||
+ private boolean isRightAfterNewline = true; // If last written char was newline
|
||||
+ private boolean isComment = false; // Are we writing comment currently?
|
||||
|
@ -39,32 +41,29 @@ index 26fc8127024d7b81ffe5c1c81b8ef8a68e35cbb6..bafd0f3492a0b8778d28610785129c5e
|
|||
+ for (int index = off; index < off + len; ++index ) {
|
||||
+ byte c = bbuf[index];
|
||||
+ boolean isNewline = (c == '\n' || c == '\r');
|
||||
+ if (isNewline && isComment) {
|
||||
+ if (isNewline && this.isComment) {
|
||||
+ // Comment has ended
|
||||
+ isComment = false;
|
||||
+ this.isComment = false;
|
||||
+ latest_offset = index+1;
|
||||
+ }
|
||||
+ if (c == '#' && isRightAfterNewline) {
|
||||
+ isComment = true;
|
||||
+ if (c == '#' && this.isRightAfterNewline) {
|
||||
+ this.isComment = true;
|
||||
+ if (index != latest_offset) {
|
||||
+ // We got some non-comment data earlier
|
||||
+ super.write(bbuf, latest_offset, index-latest_offset);
|
||||
+ }
|
||||
+ }
|
||||
+ isRightAfterNewline = isNewline; // Store for next iteration
|
||||
+ this.isRightAfterNewline = isNewline; // Store for next iteration
|
||||
+
|
||||
+ }
|
||||
+ if (latest_offset < off+len && !isComment) {
|
||||
+ if (latest_offset < off+len && !this.isComment) {
|
||||
+ // We have some unwritten data, that isn't part of a comment
|
||||
+ super.write(bbuf, latest_offset, (off + len) - latest_offset);
|
||||
+ }
|
||||
+ }
|
||||
+ };
|
||||
+ BufferedWriter bufferedwriter = new BufferedWriter(new java.io.OutputStreamWriter(bufferedOutputStream, java.nio.charset.StandardCharsets.UTF_8.newEncoder()));
|
||||
+ // Paper end
|
||||
|
||||
try {
|
||||
- this.properties.store(outputstream, "Minecraft server properties");
|
||||
+ this.properties.store(bufferedOutputStream, "Minecraft server properties"); // Paper - use bufferedOutputStream
|
||||
} catch (Throwable throwable) {
|
||||
if (outputstream != null) {
|
||||
try {
|
||||
this.properties.store(bufferedwriter, "Minecraft server properties");
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue