Dropt

Dropt

3M Downloads

XP still drops when set to zero using xpReplaceStrategy REPLACE

codetaylor opened this issue ยท 1 comments

commented

Here is the json: https://gist.github.com/codetaylor/be73ad0bdcb278dd8e152e1d4512d072

Here is the debug log: https://gist.github.com/codetaylor/4bb6fd84befc07abe5de37a6b0366b4a

When using the json above, I expect zero XP to drop.

commented

So the problem was the RandomFortuneInt was being initialized with a min and max of 1. Even when the default values of the object are set to zero, gson creates a new instance, with the min / max initialized to 1 then sets the fixed field to zero. When the get method is called, the fixed field is then ignored (not > 0) and the min / max of 1 is used instead, resulting in an unexpected value of 1.