Skip to content

Commit 5c47adc

Browse files
committed
start moving vanilla default specs to normal config specs
1 parent 0c25d09 commit 5c47adc

File tree

3 files changed

+66
-22
lines changed

3 files changed

+66
-22
lines changed

Diff for: config-specs/paper/paper-world-defaults.yml

+18
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ chunks:
108108
ticks-per.autosave in bukkit.yml for this world. A value of -1 will use
109109
the global ticks-per.autosave in bukkit.yml
110110
delay-chunk-unloads-by:
111+
vanilla: 0s
111112
default: 10s
112113
description: >-
113114
Delays chunk unloads by the specified time. Formatted as a duration with a
@@ -132,6 +133,7 @@ chunks:
132133
The timer is increased when chunks are kept loaded because of player
133134
activity
134135
max-auto-save-chunks-per-tick:
136+
vanilla: "200"
135137
default: "24"
136138
description: >-
137139
The maximum number of chunks the auto-save system will save in a single
@@ -148,6 +150,7 @@ chunks:
148150
This may have a performance impact
149151
collisions:
150152
allow-player-cramming-damage:
153+
vanilla: "true"
151154
default: "false"
152155
description: >-
153156
Allows players to take damage from cramming when colliding with more
@@ -165,6 +168,7 @@ collisions:
165168
also be counted towards the entity cramming limit so that they can take
166169
suffocation damage
167170
max-entity-collisions:
171+
vanilla: "2147483647"
168172
default: "8"
169173
description: >-
170174
Instructs the server to stop processing collisions after this value is
@@ -251,6 +255,7 @@ entities:
251255
default: "false"
252256
description: "Removes AI from pigmen spawned via nether portals "
253257
only-merge-items-horizontally:
258+
vanilla: "true"
254259
default: "false"
255260
description: >-
256261
Prevents merging items that are not on the same y level, preventing potential
@@ -261,9 +266,11 @@ entities:
261266
Makes parrots "sticky" so they do not fall off a player's shoulder when
262267
they move. Use crouch to shake them off
263268
phantoms-do-not-spawn-on-creative-players:
269+
vanilla: "false"
264270
default: "true"
265271
description: "Disables spawning of phantoms on players in creative mode "
266272
phantoms-only-attack-insomniacs:
273+
vanilla: "false"
267274
default: "true"
268275
description: "Prevents phantoms from attacking players who have slept "
269276
piglins-guard-chests:
@@ -363,6 +370,7 @@ entities:
363370
H**; the item id will appear at the bottom of the tooltip that
364371
appears when you hover over an item
365372
count-all-mobs-for-spawning:
373+
vanilla: "true"
366374
default: "false"
367375
description: >-
368376
Determines whether spawner mobs and other misc mobs are counted towards
@@ -406,6 +414,7 @@ entities:
406414
spawn egg
407415
duplicate-uuid:
408416
mode:
417+
vanilla: "<leave empty>"
409418
default: saferegen
410419
description: >-
411420
Specifies the method the server uses to resolve entities with
@@ -425,13 +434,15 @@ entities:
425434
If multiple entities with duplicate UUIDs are within this many blocks,
426435
saferegen will delete all but 1 of them
427436
filter-bad-tile-entity-nbt-from-falling-blocks:
437+
vanilla: "false"
428438
default: "true"
429439
description: >-
430440
Instructs the server to remove certain NBT data from falling blocks.
431441
**Note**: Some adventure maps may require this to be turned off to
432442
function correctly, but we do not recommend turning it off on a public
433443
server
434444
filtered-entity-tag-nbt-paths:
445+
vanilla: "empty array ([])"
435446
default: "[Pos, Motion, SleepingX, SleepingY, SleepingZ]"
436447
description: >-
437448
A list of NBT tags that will be removed from the EntityTag tag on items
@@ -461,6 +472,7 @@ entities:
461472
despawned. The default value instructs the server to use the same
462473
default arrow despawn rate from spigot.yml that is used for all arrows
463474
per-player-mob-spawns:
475+
vanilla: "false"
464476
default: "true"
465477
description: >-
466478
Determines whether the mob limit (in bukkit.yml) is counted per player
@@ -751,6 +763,7 @@ fishing-time-range:
751763
description: The minimum number of RNG ticks needed to catch a fish
752764
fixes:
753765
disable-unloaded-chunk-enderpearl-exploit:
766+
vanilla: "false"
754767
default: "true"
755768
description: Prevent enderpearls from storing the thrower when in an unloaded chunk
756769
falling-block-height-nerf:
@@ -785,6 +798,7 @@ fixes:
785798
value of disabled will disable this feature
786799
hopper:
787800
cooldown-when-full:
801+
vanilla: "false"
788802
default: "true"
789803
description: >-
790804
Instructs the server to apply a short cooldown when the hopper is full,
@@ -842,6 +856,7 @@ lootables:
842856
unit e.g. 10h or 25m. Supports d, h, m, and s.
843857
maps:
844858
item-frame-cursor-limit:
859+
vanilla: "2147483647"
845860
default: "128"
846861
description: >-
847862
The number of cursors (markers) allowed per map. A large number of cursors
@@ -944,6 +959,7 @@ scoreboards:
944959
never on a team. Disabling this may slightly decrease the amount of time
945960
the server spends calculating entity collisions
946961
use-vanilla-world-scoreboard-name-coloring:
962+
vanilla: "true"
947963
default: "false"
948964
description: >-
949965
Instructs the server to use the Vanilla scoreboard for player nickname
@@ -993,11 +1009,13 @@ tick-rates:
9931009
for the names. Might change between updates!
9941010
unsupported-settings:
9951011
disable-world-ticking-when-empty:
1012+
vanilla: "true"
9961013
default: "false"
9971014
description: >-
9981015
Stops the ticking of the world when there are no players or force loaded chunks present in
9991016
the world.
10001017
fix-invulnerable-end-crystal-exploit:
1018+
vanilla: "false"
10011019
default: "true"
10021020
description: >-
10031021
If set to false, the creation of invulnerable end crystals will be

Diff for: docs/paper/admin/how-to/get-to-vanilla.mdx

+7-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description: This page lists all changes that result in a different experience t
77

88
import React from 'react';
99
import ConfigDocBlock from '@site/src/components/config/ConfigDocBlock';
10-
import VanillaWorldDefaults from '!!raw-loader!@site/config-specs/paper/vanilla/paper-world-defaults.yml'
10+
import VanillaWorldDefaults from '!!raw-loader!@site/config-specs/paper/paper-world-defaults.yml'
1111
import VanillaGlobalDefaults from '!!raw-loader!@site/config-specs/paper/vanilla/paper-global.yml'
1212
import SpigotChanges from '!!raw-loader!@site/config-specs/paper/vanilla/spigot.yml'
1313

@@ -31,13 +31,16 @@ Unfortunately, it currently is not possible to get a 100% Vanilla experience in
3131
:::
3232

3333
## paper-world-defaults.yml
34-
<ConfigDocBlock data={VanillaWorldDefaults}/>
34+
35+
<ConfigDocBlock data={VanillaWorldDefaults} vanilla={true}/>
3536

3637
## paper-global.yml
37-
<ConfigDocBlock data={VanillaGlobalDefaults}/>
38+
39+
[//]: # (<ConfigDocBlock data={VanillaGlobalDefaults}/>)
3840

3941
## spigot.yml
40-
<ConfigDocBlock data={SpigotChanges}/>
42+
43+
[//]: # (<ConfigDocBlock data={SpigotChanges}/>)
4144

4245
## Further considerations
4346

Diff for: src/components/config/ConfigDocBlock.tsx

+41-18
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,11 @@ const YamlNodeWithDescription = ({
130130
separator,
131131
showAllDescriptions,
132132
defaultValue,
133+
vanilla,
133134
}) => {
134135
const ignoreInitialRenderRef = useRef(false);
135136
const [showDescription, setShowDescription] = useState(showAllDescriptions);
136-
137-
node.default = node.default || defaultValue;
137+
node.default = vanilla ? node.vanilla : (node.default || defaultValue);
138138
node.description = node.description || "N/A";
139139

140140
const checkForHash = () => {
@@ -219,6 +219,7 @@ const YamlTreeNode = ({
219219
showAllDescriptions,
220220
defaultValue,
221221
warning,
222+
vanilla,
222223
}): ReactNode => {
223224
if (name === "inline-docs-warning") return null;
224225

@@ -274,7 +275,8 @@ const YamlTreeNode = ({
274275
false,
275276
separator,
276277
showAllDescriptions,
277-
defaultValue
278+
defaultValue,
279+
vanilla
278280
)}
279281
</div>
280282
);
@@ -286,28 +288,47 @@ const renderYamlData = (
286288
root = false,
287289
separator: string,
288290
showAllDescriptions: boolean,
289-
defaultValue: string
291+
defaultValue: string,
292+
vanilla = false
290293
): ReactNode => {
291294
const renderedNodes: JSX.Element[] = [];
292-
293295
for (const [key, value] of Object.entries(data)) {
294296
if (typeof value === "object" && value !== null) {
295297
if (
296298
("default" in value && typeof value.default !== "object") ||
297299
("description" in value && typeof value.description !== "object")
298300
) {
299-
renderedNodes.push(
300-
<YamlNodeWithDescription
301-
key={key}
302-
name={key}
303-
parentKey={parentKey}
304-
node={value}
305-
root={root}
306-
separator={separator}
307-
showAllDescriptions={showAllDescriptions}
308-
defaultValue={defaultValue}
309-
/>
310-
);
301+
if (vanilla) {
302+
if (("vanilla" in value && typeof value.vanilla !== "object")) {
303+
renderedNodes.push(
304+
<YamlNodeWithDescription
305+
key={key}
306+
name={key}
307+
parentKey={parentKey}
308+
node={value}
309+
root={root}
310+
separator={separator}
311+
showAllDescriptions={showAllDescriptions}
312+
defaultValue={defaultValue}
313+
vanilla={vanilla}
314+
/>
315+
);
316+
}
317+
} else {
318+
renderedNodes.push(
319+
<YamlNodeWithDescription
320+
key={key}
321+
name={key}
322+
parentKey={parentKey}
323+
node={value}
324+
root={root}
325+
separator={separator}
326+
showAllDescriptions={showAllDescriptions}
327+
defaultValue={defaultValue}
328+
vanilla={vanilla}
329+
/>
330+
);
331+
}
311332
} else {
312333
renderedNodes.push(
313334
<YamlTreeNode
@@ -320,6 +341,7 @@ const renderYamlData = (
320341
showAllDescriptions={showAllDescriptions}
321342
defaultValue={defaultValue}
322343
warning={"inline-docs-warning" in value ? value["inline-docs-warning"] : null}
344+
vanilla={vanilla}
323345
/>
324346
);
325347
}
@@ -334,6 +356,7 @@ export default function Config({
334356
separator = ": ",
335357
showDescriptions = false,
336358
defaultValue = "N/A",
359+
vanilla = false,
337360
}): ReactNode {
338361
const [showAllDescriptions, setShowAllExpanded] = useState(showDescriptions);
339362
let ymlData = yaml.load(data);
@@ -346,7 +369,7 @@ export default function Config({
346369
>
347370
{showAllDescriptions ? "Collapse All" : "Expand All"}
348371
</button>
349-
{renderYamlData(ymlData, "", true, separator, showAllDescriptions, defaultValue)}
372+
{renderYamlData(ymlData, "", true, separator, showAllDescriptions, defaultValue, vanilla)}
350373
</pre>
351374
</div>
352375
);

0 commit comments

Comments
 (0)