Fixed crash when activating rituals on servers.

This commit is contained in:
WayofTime 2016-01-24 06:54:46 -05:00
parent c8ded3c6dd
commit de08e5d0ac
2 changed files with 13 additions and 0 deletions
changelog.txt
src/main/java/WayofTime/bloodmagic/api/util/helper

View file

@ -1,3 +1,9 @@
------------------------------------------------------
Version 2.0.0-8
------------------------------------------------------
- Fixed crash when activating rituals while operating on servers
- Added the majority of stuff for the item routing system.
------------------------------------------------------
Version 2.0.0-7
------------------------------------------------------

View file

@ -8,7 +8,9 @@ import net.minecraft.server.MinecraftServer;
import net.minecraft.world.World;
import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.eventhandler.Event;
import net.minecraftforge.fml.relauncher.Side;
import WayofTime.bloodmagic.api.BloodMagicAPI;
import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.api.event.AddToNetworkEvent;
@ -31,6 +33,11 @@ public class NetworkHelper
*/
public static SoulNetwork getSoulNetwork(String name)
{
if (FMLCommonHandler.instance().getSide() == Side.CLIENT)
{
return new SoulNetwork(name);
}
World world = DimensionManager.getWorld(0);
SoulNetwork network = (SoulNetwork) world.getMapStorage().loadData(SoulNetwork.class, name);