Eidolon

Eidolon

16M Downloads

incorrect casting to ServerWorldInfo crashes when provided another implementer of IServerWorldInfo (Ritual of Daylight)

Linguardium opened this issue ยท 0 comments

commented

((ServerWorldInfo) world.getWorldInfo()).setDayTime(world.getDayTime() + 100);

AllTheMods/atm6-sky#490

seems this line wants to cast the the WorldInfo to ServerWorldInfo but is being provided a DerivedWorldInfo (implementing the IServerWorldInfo interface)

seems to me since both ServerWorldInfo and DerivedWorldInfo implement the IServerWorldInfo interface, the correct thing to do would be to cast to the interface rather than the class.