Giter Club home page Giter Club logo

commands4configs's People

Contributors

denisd3d avatar

Stargazers

 avatar

Watchers

 avatar

commands4configs's Issues

[Bug/Crashes] The set command can set the value of a boolean config field to a string

Brought to my attention by SuntannedDuck2.
From: https://www.curseforge.com/minecraft/mc-mods/invmove?comment=8
His crash log: https://hatebin.com/vifedfauvj

Description
When you use /config set, the value is always treated as a String.
This can result in invalid configs if the field being edited is supposed to be a boolean.

Example
Generate new singleplayer world
Run "/config forge SERVER set server.fixAdvancementLoading false"
Exit world
Try to load same world and get a crash (same as crashlog at the top):

java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
	at net.minecraft.advancements.PlayerAdvancements.load(PlayerAdvancements.java:157)
	at net.minecraft.advancements.PlayerAdvancements.<init>(PlayerAdvancements.java:65)

The line PlayerAdvancements.java:157 contains:

if (net.minecraftforge.common.ForgeConfig.SERVER.fixAdvancementLoading.get()) ...

If you go into the world file into serverconfig and look at forge-server.toml, you can see the problem:
The line that should read:

fixAdvancementLoading = false

is actually set to:

fixAdvancementLoading = "false"

If the code reading the field doesn't explicitly check the type of the value, the get function throws a ClassCastException and the game crashes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.