[2021.2 EAP 26215] Possible Lossy Conversion from double to int

Started by TechTastic on

Topic category: Feature requests and ideas for MCreator

Active 3 years ago
Joined Jun 2021
Points:
595

User statistics:

  • Modifications: 0
  • Forum topics: 7
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 95
[2021.2 EAP 26215] Possible Lossy Conversion from double to int

Was about to make a post about making it possible to differentiate between int number variables and double number variables until I realized this error has happened before so I am here to notify you all that this snapshot has the error again

 

I fixed it by manually changing the variable in the code to an int

 

Yes its used in functions related to inventories and inventory slots

Active 3 years ago
Joined Jul 2019
Points:
653

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 6
In almost all scenarios, a…
Sat, 08/07/2021 - 02:48

In almost all scenarios, a float will be more precise than an int, but it might be worth changing to doubles by default as they can definitely contain all 32-bit integers