elucent / eidolon

Spooky Minecraft mod.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

Linguardium opened this issue · comments

((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.