Updated to 2020.2 and got "possible lossy conversion from double to int" that weren't there before.

Upvotes: 1
Issue description

Yesterday I updated Mcreator to a version of 2020.2 that kept pooping up when I started to program because it had a few bugfixes, but since then a few errors have been appearing in some procedures. I'm using 1.14.4. 

 

Executing Gradle task: build 
Build info: MCreator 2020.2.14217, 1.14.4, 64-bit, 3973 MB, Windows 10, JVM 1.8.0_232, JAVA_HOME: C:\Program Files\Pylo\MCreator\jdk 
> Configure project : 
New Dep: net.minecraftforge:forge:1.14.4-28.2.3_mapped_snapshot_20190719-1.14.3 
> Task :compileJava 
C:\Users\James\MCreatorWorkspaces\drstonemod\src\main\java\net\mcreator\petrifiedmod\procedures\AshCollectionProcedure.java:120: error: incompatible types: possible lossy conversion from double to int 
                        _setstack.setCount(((NumberOfItems) + 1)); 
                                           ^ 
C:\Users\James\MCreatorWorkspaces\drstonemod\src\main\java\net\mcreator\petrifiedmod\procedures\GetWoodAshProcedure.java:125: error: incompatible types: possible lossy conversion from double to int 
                     _setstack.setCount(((Items) + 1)); 
                                        ^ 
C:\Users\James\MCreatorWorkspaces\drstonemod\src\main\java\net\mcreator\petrifiedmod\procedures\ObtainWoodAshProcedure.java:101: error: incompatible types: possible lossy conversion from double to int 
                     _setstack.setCount(((Items) + 1)); 
                                        ^ 
C:\Users\James\MCreatorWorkspaces\drstonemod\src\main\java\net\mcreator\petrifiedmod\procedures\ObtainWoodAshProcedure.java:127: error: incompatible types: possible lossy conversion from double to int 
                  _setstack.setCount(((Items) + 1)); 
                                     ^ 
C:\Users\James\MCreatorWorkspaces\drstonemod\src\main\java\net\mcreator\petrifiedmod\procedures\PotAshBoilingProcedure.java:97: error: incompatible types: possible lossy conversion from double to int 
                        _setstack.setCount(((NumberOfItems) + 1)); 
                                           ^ 
C:\Users\James\MCreatorWorkspaces\drstonemod\src\main\java\net\mcreator\petrifiedmod\procedures\PotAshBoilingProcedure.java:142: error: incompatible types: possible lossy conversion from double to int 
                        _setstack.setCount(((NumberOfItems) + 1)); 
                                           ^ 
C:\Users\James\MCreatorWorkspaces\drstonemod\src\main\java\net\mcreator\petrifiedmod\procedures\PotAshBoilingProcedure.java:203: error: incompatible types: possible lossy conversion from double to int 
                        _setstack.setCount(((NumberOfItems) + 1)); 
                                           ^ 
C:\Users\James\MCreatorWorkspaces\drstonemod\src\main\java\net\mcreator\petrifiedmod\procedures\PotAshBoilingProcedure.java:211: error: incompatible types: possible lossy conversion from double to int 
                        _setstack.setCount(((NumberOfItems) + 1)); 
                                           ^ 
C:\Users\James\MCreatorWorkspaces\drstonemod\src\main\java\net\mcreator\petrifiedmod\procedures\PotBlockBoilingProcedure.java:117: error: incompatible types: possible lossy conversion from double to int 
                        _setstack.setCount(((Item_Output1) + 1)); 
                                           ^ 
C:\Users\James\MCreatorWorkspaces\drstonemod\src\main\java\net\mcreator\petrifiedmod\procedures\PotBlockBoilingProcedure.java:157: error: incompatible types: possible lossy conversion from double to int 
                        _setstack.setCount(((Item_Output1) + 1)); 
                                           ^ 
C:\Users\James\MCreatorWorkspaces\drstonemod\src\main\java\net\mcreator\petrifiedmod\procedures\PotBlockBoilingProcedure.java:202: error: incompatible types: possible lossy conversion from double to int 
                        _setstack.setCount(((Item_Output1) + 1)); 
                                           ^ 
C:\Users\James\MCreatorWorkspaces\drstonemod\src\main\java\net\mcreator\petrifiedmod\procedures\PotBlockBoilingProcedure.java:210: error: incompatible types: possible lossy conversion from double to int 
                        _setstack.setCount(((Item_Output2) + 1)); 
                                           ^ 
C:\Users\James\MCreatorWorkspaces\drstonemod\src\main\java\net\mcreator\petrifiedmod\procedures\PotBlockBoilingProcedure.java:255: error: incompatible types: possible lossy conversion from double to int 
                        _setstack.setCount(((Item_Output1) + 1)); 
                                           ^ 
C:\Users\James\MCreatorWorkspaces\drstonemod\src\main\java\net\mcreator\petrifiedmod\procedures\PotBlockBoilingProcedure.java:263: error: incompatible types: possible lossy conversion from double to int 
                        _setstack.setCount(((Item_Output2) + 1)); 
                                           ^ 
C:\Users\James\MCreatorWorkspaces\drstonemod\src\main\java\net\mcreator\petrifiedmod\procedures\PotBlockBoilingProcedure.java:303: error: incompatible types: possible lossy conversion from double to int 
                        _setstack.setCount(((Item_Output1) + 1)); 
                                           ^ 
C:\Users\James\MCreatorWorkspaces\drstonemod\src\main\java\net\mcreator\petrifiedmod\procedures\PotBlockBoilingProcedure.java:342: error: incompatible types: possible lossy conversion from double to int 
                        _setstack.setCount(((Item_Output1) + 1)); 
                                           ^ 
C:\Users\James\MCreatorWorkspaces\drstonemod\src\main\java\net\mcreator\petrifiedmod\procedures\PotBlockBoilingProcedure.java:381: error: incompatible types: possible lossy conversion from double to int 
                        _setstack.setCount(((Item_Output1) + 1)); 
                                           ^ 
C:\Users\James\MCreatorWorkspaces\drstonemod\src\main\java\net\mcreator\petrifiedmod\procedures\PotBlockBoilingProcedure.java:389: error: incompatible types: possible lossy conversion from double to int 
                        _setstack.setCount(((Item_Output2) + 1)); 
                                           ^ 
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output 
18 errors 
> Task :compileJava FAILED 
FAILURE: Build failed with an exception. 
* What went wrong: 
Execution failed for task ':compileJava'. 
> Compilation failed; see the compiler error output for details. 
* Try: 
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. 
* Get more help at https://help.gradle.org 
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0. 
Use '--warning-mode all' to show the individual deprecation warnings. 
See https://docs.gradle.org/4.9/userguide/command_line_interface.html#sec:command_line_warnings 
BUILD FAILED in 1m 39s 
1 actionable task: 1 executed 
BUILD FAILED 
Task completed in 114230 milliseconds

 

Issue comments

I can confirm this bug. We will fix it in 2020.3

For workaround, you can get "round" procedure block from Math category, and wrap your number parameters for amount with this block set to "round down" for all procedures that set items in any inventory or slots.



Donate to MCreator

By donating to developers you can speed up development, as with more resources, we can dedicate more time to MCreator. It is a free project made by developers working on it in their free time.