Fix client always reporting 0 LP
This commit is contained in:
parent
de08e5d0ac
commit
ad296a8e0e
|
@ -33,11 +33,6 @@ public class NetworkHelper
|
||||||
*/
|
*/
|
||||||
public static SoulNetwork getSoulNetwork(String name)
|
public static SoulNetwork getSoulNetwork(String name)
|
||||||
{
|
{
|
||||||
if (FMLCommonHandler.instance().getSide() == Side.CLIENT)
|
|
||||||
{
|
|
||||||
return new SoulNetwork(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
World world = DimensionManager.getWorld(0);
|
World world = DimensionManager.getWorld(0);
|
||||||
SoulNetwork network = (SoulNetwork) world.getMapStorage().loadData(SoulNetwork.class, name);
|
SoulNetwork network = (SoulNetwork) world.getMapStorage().loadData(SoulNetwork.class, name);
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ public class TileImperfectRitualStone extends TileEntity implements IImperfectRi
|
||||||
@Override
|
@Override
|
||||||
public boolean performRitual(World world, BlockPos pos, ImperfectRitual imperfectRitual, EntityPlayer player)
|
public boolean performRitual(World world, BlockPos pos, ImperfectRitual imperfectRitual, EntityPlayer player)
|
||||||
{
|
{
|
||||||
if (!PlayerHelper.isFakePlayer(player) && imperfectRitual != null && ImperfectRitualRegistry.ritualEnabled(imperfectRitual))
|
if (!world.isRemote && !PlayerHelper.isFakePlayer(player) && imperfectRitual != null && ImperfectRitualRegistry.ritualEnabled(imperfectRitual))
|
||||||
{
|
{
|
||||||
NetworkHelper.getSoulNetwork(player).syphonAndDamage(player, imperfectRitual.getActivationCost());
|
NetworkHelper.getSoulNetwork(player).syphonAndDamage(player, imperfectRitual.getActivationCost());
|
||||||
if (imperfectRitual.onActivate(this, player))
|
if (imperfectRitual.onActivate(this, player))
|
||||||
|
|
|
@ -108,6 +108,8 @@ public class TileMasterRitualStone extends TileEntity implements IMasterRitualSt
|
||||||
{
|
{
|
||||||
int crystalLevel = ((ItemActivationCrystal) activationCrystal.getItem()).getCrystalLevel(activationCrystal);
|
int crystalLevel = ((ItemActivationCrystal) activationCrystal.getItem()).getCrystalLevel(activationCrystal);
|
||||||
if (RitualHelper.canCrystalActivate(ritual, crystalLevel))
|
if (RitualHelper.canCrystalActivate(ritual, crystalLevel))
|
||||||
|
{
|
||||||
|
if (!getWorld().isRemote)
|
||||||
{
|
{
|
||||||
SoulNetwork network = NetworkHelper.getSoulNetwork(crystalOwner);
|
SoulNetwork network = NetworkHelper.getSoulNetwork(crystalOwner);
|
||||||
|
|
||||||
|
@ -145,6 +147,9 @@ public class TileMasterRitualStone extends TileEntity implements IMasterRitualSt
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
|
@ -157,7 +162,7 @@ public class TileMasterRitualStone extends TileEntity implements IMasterRitualSt
|
||||||
@Override
|
@Override
|
||||||
public void performRitual(World world, BlockPos pos)
|
public void performRitual(World world, BlockPos pos)
|
||||||
{
|
{
|
||||||
if (getCurrentRitual() != null && RitualRegistry.ritualEnabled(getCurrentRitual()) && RitualHelper.checkValidRitual(getWorld(), getPos(), RitualRegistry.getIdForRitual(currentRitual), getDirection()))
|
if (!world.isRemote && getCurrentRitual() != null && RitualRegistry.ritualEnabled(getCurrentRitual()) && RitualHelper.checkValidRitual(getWorld(), getPos(), RitualRegistry.getIdForRitual(currentRitual), getDirection()))
|
||||||
{
|
{
|
||||||
RitualEvent.RitualRunEvent event = new RitualEvent.RitualRunEvent(this, getOwner(), getCurrentRitual());
|
RitualEvent.RitualRunEvent event = new RitualEvent.RitualRunEvent(this, getOwner(), getCurrentRitual());
|
||||||
|
|
||||||
|
@ -171,7 +176,7 @@ public class TileMasterRitualStone extends TileEntity implements IMasterRitualSt
|
||||||
@Override
|
@Override
|
||||||
public void stopRitual(Ritual.BreakType breakType)
|
public void stopRitual(Ritual.BreakType breakType)
|
||||||
{
|
{
|
||||||
if (getCurrentRitual() != null)
|
if (!getWorld().isRemote && getCurrentRitual() != null)
|
||||||
{
|
{
|
||||||
RitualEvent.RitualStopEvent event = new RitualEvent.RitualStopEvent(this, getOwner(), getCurrentRitual(), breakType);
|
RitualEvent.RitualStopEvent event = new RitualEvent.RitualStopEvent(this, getOwner(), getCurrentRitual(), breakType);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue