commands4configs's People
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.