Skip to content

Commit

Permalink
start moving vanilla default specs to normal config specs
Browse files Browse the repository at this point in the history
  • Loading branch information
Leguan16 committed Aug 13, 2024
1 parent 0c25d09 commit 5c47adc
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 22 deletions.
18 changes: 18 additions & 0 deletions config-specs/paper/paper-world-defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ chunks:
ticks-per.autosave in bukkit.yml for this world. A value of -1 will use
the global ticks-per.autosave in bukkit.yml
delay-chunk-unloads-by:
vanilla: 0s
default: 10s
description: >-
Delays chunk unloads by the specified time. Formatted as a duration with a
Expand All @@ -132,6 +133,7 @@ chunks:
The timer is increased when chunks are kept loaded because of player
activity
max-auto-save-chunks-per-tick:
vanilla: "200"
default: "24"
description: >-
The maximum number of chunks the auto-save system will save in a single
Expand All @@ -148,6 +150,7 @@ chunks:
This may have a performance impact
collisions:
allow-player-cramming-damage:
vanilla: "true"
default: "false"
description: >-
Allows players to take damage from cramming when colliding with more
Expand All @@ -165,6 +168,7 @@ collisions:
also be counted towards the entity cramming limit so that they can take
suffocation damage
max-entity-collisions:
vanilla: "2147483647"
default: "8"
description: >-
Instructs the server to stop processing collisions after this value is
Expand Down Expand Up @@ -251,6 +255,7 @@ entities:
default: "false"
description: "Removes AI from pigmen spawned via nether portals "
only-merge-items-horizontally:
vanilla: "true"
default: "false"
description: >-
Prevents merging items that are not on the same y level, preventing potential
Expand All @@ -261,9 +266,11 @@ entities:
Makes parrots "sticky" so they do not fall off a player's shoulder when
they move. Use crouch to shake them off
phantoms-do-not-spawn-on-creative-players:
vanilla: "false"
default: "true"
description: "Disables spawning of phantoms on players in creative mode "
phantoms-only-attack-insomniacs:
vanilla: "false"
default: "true"
description: "Prevents phantoms from attacking players who have slept "
piglins-guard-chests:
Expand Down Expand Up @@ -363,6 +370,7 @@ entities:
H**; the item id will appear at the bottom of the tooltip that
appears when you hover over an item
count-all-mobs-for-spawning:
vanilla: "true"
default: "false"
description: >-
Determines whether spawner mobs and other misc mobs are counted towards
Expand Down Expand Up @@ -406,6 +414,7 @@ entities:
spawn egg
duplicate-uuid:
mode:
vanilla: "<leave empty>"
default: saferegen
description: >-
Specifies the method the server uses to resolve entities with
Expand All @@ -425,13 +434,15 @@ entities:
If multiple entities with duplicate UUIDs are within this many blocks,
saferegen will delete all but 1 of them
filter-bad-tile-entity-nbt-from-falling-blocks:
vanilla: "false"
default: "true"
description: >-
Instructs the server to remove certain NBT data from falling blocks.
**Note**: Some adventure maps may require this to be turned off to
function correctly, but we do not recommend turning it off on a public
server
filtered-entity-tag-nbt-paths:
vanilla: "empty array ([])"
default: "[Pos, Motion, SleepingX, SleepingY, SleepingZ]"
description: >-
A list of NBT tags that will be removed from the EntityTag tag on items
Expand Down Expand Up @@ -461,6 +472,7 @@ entities:
despawned. The default value instructs the server to use the same
default arrow despawn rate from spigot.yml that is used for all arrows
per-player-mob-spawns:
vanilla: "false"
default: "true"
description: >-
Determines whether the mob limit (in bukkit.yml) is counted per player
Expand Down Expand Up @@ -751,6 +763,7 @@ fishing-time-range:
description: The minimum number of RNG ticks needed to catch a fish
fixes:
disable-unloaded-chunk-enderpearl-exploit:
vanilla: "false"
default: "true"
description: Prevent enderpearls from storing the thrower when in an unloaded chunk
falling-block-height-nerf:
Expand Down Expand Up @@ -785,6 +798,7 @@ fixes:
value of disabled will disable this feature
hopper:
cooldown-when-full:
vanilla: "false"
default: "true"
description: >-
Instructs the server to apply a short cooldown when the hopper is full,
Expand Down Expand Up @@ -842,6 +856,7 @@ lootables:
unit e.g. 10h or 25m. Supports d, h, m, and s.
maps:
item-frame-cursor-limit:
vanilla: "2147483647"
default: "128"
description: >-
The number of cursors (markers) allowed per map. A large number of cursors
Expand Down Expand Up @@ -944,6 +959,7 @@ scoreboards:
never on a team. Disabling this may slightly decrease the amount of time
the server spends calculating entity collisions
use-vanilla-world-scoreboard-name-coloring:
vanilla: "true"
default: "false"
description: >-
Instructs the server to use the Vanilla scoreboard for player nickname
Expand Down Expand Up @@ -993,11 +1009,13 @@ tick-rates:
for the names. Might change between updates!
unsupported-settings:
disable-world-ticking-when-empty:
vanilla: "true"
default: "false"
description: >-
Stops the ticking of the world when there are no players or force loaded chunks present in
the world.
fix-invulnerable-end-crystal-exploit:
vanilla: "false"
default: "true"
description: >-
If set to false, the creation of invulnerable end crystals will be
Expand Down
11 changes: 7 additions & 4 deletions docs/paper/admin/how-to/get-to-vanilla.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: This page lists all changes that result in a different experience t

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

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

## paper-world-defaults.yml
<ConfigDocBlock data={VanillaWorldDefaults}/>

<ConfigDocBlock data={VanillaWorldDefaults} vanilla={true}/>

## paper-global.yml
<ConfigDocBlock data={VanillaGlobalDefaults}/>

[//]: # (<ConfigDocBlock data={VanillaGlobalDefaults}/>)

## spigot.yml
<ConfigDocBlock data={SpigotChanges}/>

[//]: # (<ConfigDocBlock data={SpigotChanges}/>)

## Further considerations

Expand Down
59 changes: 41 additions & 18 deletions src/components/config/ConfigDocBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,11 @@ const YamlNodeWithDescription = ({
separator,
showAllDescriptions,
defaultValue,
vanilla,
}) => {
const ignoreInitialRenderRef = useRef(false);
const [showDescription, setShowDescription] = useState(showAllDescriptions);

node.default = node.default || defaultValue;
node.default = vanilla ? node.vanilla : (node.default || defaultValue);
node.description = node.description || "N/A";

const checkForHash = () => {
Expand Down Expand Up @@ -219,6 +219,7 @@ const YamlTreeNode = ({
showAllDescriptions,
defaultValue,
warning,
vanilla,
}): ReactNode => {
if (name === "inline-docs-warning") return null;

Expand Down Expand Up @@ -274,7 +275,8 @@ const YamlTreeNode = ({
false,
separator,
showAllDescriptions,
defaultValue
defaultValue,
vanilla
)}
</div>
);
Expand All @@ -286,28 +288,47 @@ const renderYamlData = (
root = false,
separator: string,
showAllDescriptions: boolean,
defaultValue: string
defaultValue: string,
vanilla = false
): ReactNode => {
const renderedNodes: JSX.Element[] = [];

for (const [key, value] of Object.entries(data)) {
if (typeof value === "object" && value !== null) {
if (
("default" in value && typeof value.default !== "object") ||
("description" in value && typeof value.description !== "object")
) {
renderedNodes.push(
<YamlNodeWithDescription
key={key}
name={key}
parentKey={parentKey}
node={value}
root={root}
separator={separator}
showAllDescriptions={showAllDescriptions}
defaultValue={defaultValue}
/>
);
if (vanilla) {
if (("vanilla" in value && typeof value.vanilla !== "object")) {
renderedNodes.push(
<YamlNodeWithDescription
key={key}
name={key}
parentKey={parentKey}
node={value}
root={root}
separator={separator}
showAllDescriptions={showAllDescriptions}
defaultValue={defaultValue}
vanilla={vanilla}
/>
);
}
} else {
renderedNodes.push(
<YamlNodeWithDescription
key={key}
name={key}
parentKey={parentKey}
node={value}
root={root}
separator={separator}
showAllDescriptions={showAllDescriptions}
defaultValue={defaultValue}
vanilla={vanilla}
/>
);
}
} else {
renderedNodes.push(
<YamlTreeNode
Expand All @@ -320,6 +341,7 @@ const renderYamlData = (
showAllDescriptions={showAllDescriptions}
defaultValue={defaultValue}
warning={"inline-docs-warning" in value ? value["inline-docs-warning"] : null}
vanilla={vanilla}
/>
);
}
Expand All @@ -334,6 +356,7 @@ export default function Config({
separator = ": ",
showDescriptions = false,
defaultValue = "N/A",
vanilla = false,
}): ReactNode {
const [showAllDescriptions, setShowAllExpanded] = useState(showDescriptions);
let ymlData = yaml.load(data);
Expand All @@ -346,7 +369,7 @@ export default function Config({
>
{showAllDescriptions ? "Collapse All" : "Expand All"}
</button>
{renderYamlData(ymlData, "", true, separator, showAllDescriptions, defaultValue)}
{renderYamlData(ymlData, "", true, separator, showAllDescriptions, defaultValue, vanilla)}
</pre>
</div>
);
Expand Down

0 comments on commit 5c47adc

Please sign in to comment.