From 8ec653b2a7f9e74b99448dfeda5c91f77e8fa827 Mon Sep 17 00:00:00 2001 From: WayofTime Date: Mon, 15 Feb 2016 08:11:18 -0500 Subject: [PATCH] Fixed lava crystal working even if there is no LP available. Causes a desync on server worlds. --- changelog.txt | 2 ++ .../bloodmagic/api/util/helper/NetworkHelper.java | 5 +++++ .../WayofTime/bloodmagic/item/ItemLavaCrystal.java | 10 ++++++---- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/changelog.txt b/changelog.txt index dc62620d..883dbaa5 100644 --- a/changelog.txt +++ b/changelog.txt @@ -13,6 +13,8 @@ Version 2.0.0-17 - Ender Severance - Haste - Dagger now bypasses checks of armour +- Fixed issue with lava crystal working even their is no LP available. +- Added upgrade trainer ------------------------------------------------------ Version 2.0.0-16 diff --git a/src/main/java/WayofTime/bloodmagic/api/util/helper/NetworkHelper.java b/src/main/java/WayofTime/bloodmagic/api/util/helper/NetworkHelper.java index d49f0c56..b60d4b5d 100644 --- a/src/main/java/WayofTime/bloodmagic/api/util/helper/NetworkHelper.java +++ b/src/main/java/WayofTime/bloodmagic/api/util/helper/NetworkHelper.java @@ -32,6 +32,11 @@ public class NetworkHelper public static SoulNetwork getSoulNetwork(String name) { World world = DimensionManager.getWorld(0); + if (world == null || world.getMapStorage() == null) //Hack-ish way to fix the lava crystal. + { + return new SoulNetwork(name); + } + SoulNetwork network = (SoulNetwork) world.getMapStorage().loadData(SoulNetwork.class, name); if (network == null) diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemLavaCrystal.java b/src/main/java/WayofTime/bloodmagic/item/ItemLavaCrystal.java index 003f6cf3..1a048bb1 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemLavaCrystal.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemLavaCrystal.java @@ -51,10 +51,12 @@ public class ItemLavaCrystal extends ItemBindable implements IFuelHandler if (fuelItem instanceof ItemLavaCrystal) { - if (FMLCommonHandler.instance().getSide() == Side.CLIENT) - { - return 200; - } + System.out.println("Test get burn time: Side = " + FMLCommonHandler.instance().getSide()); +// +// if (FMLCommonHandler.instance().getSide() == Side.CLIENT) +// { +// return 200; +// } if (canSyphonFromNetwork(fuel, getLPUsed())) {