Cleanup the SoulNetwork a bit.
Should work now?
This commit is contained in:
parent
352c6b9e5f
commit
e0b073b8b7
|
@ -13,7 +13,7 @@ public class NBTHolder {
|
||||||
public static final String NBT_COORDX = "xCoord";
|
public static final String NBT_COORDX = "xCoord";
|
||||||
public static final String NBT_COORDY = "yCoord";
|
public static final String NBT_COORDY = "yCoord";
|
||||||
public static final String NBT_COORDZ = "zCoord";
|
public static final String NBT_COORDZ = "zCoord";
|
||||||
public static final String NBT_MAXORB = "maxOrb";
|
public static final String NBT_ORBTIER = "orbTier";
|
||||||
public static final String NBT_CURRENTESSENCE = "currentEssence";
|
public static final String NBT_CURRENTESSENCE = "currentEssence";
|
||||||
public static final String NBT_CURRENTRITUAL = "currentRitual";
|
public static final String NBT_CURRENTRITUAL = "currentRitual";
|
||||||
public static final String NBT_RUNNING = "isRunning";
|
public static final String NBT_RUNNING = "isRunning";
|
||||||
|
|
|
@ -7,7 +7,7 @@ import net.minecraftforge.fml.common.eventhandler.Event;
|
||||||
|
|
||||||
public class SoulNetworkEvent extends Event {
|
public class SoulNetworkEvent extends Event {
|
||||||
|
|
||||||
public String ownerName;
|
public final String ownerName;
|
||||||
public int syphon;
|
public int syphon;
|
||||||
|
|
||||||
public SoulNetworkEvent(String ownerName, int syphon) {
|
public SoulNetworkEvent(String ownerName, int syphon) {
|
||||||
|
|
|
@ -2,12 +2,19 @@ package WayofTime.bloodmagic.api.network;
|
||||||
|
|
||||||
import WayofTime.bloodmagic.api.BloodMagicAPI;
|
import WayofTime.bloodmagic.api.BloodMagicAPI;
|
||||||
import WayofTime.bloodmagic.api.NBTHolder;
|
import WayofTime.bloodmagic.api.NBTHolder;
|
||||||
|
import WayofTime.bloodmagic.api.event.AddToNetworkEvent;
|
||||||
import WayofTime.bloodmagic.api.event.SoulNetworkEvent;
|
import WayofTime.bloodmagic.api.event.SoulNetworkEvent;
|
||||||
import WayofTime.bloodmagic.api.util.helper.PlayerHelper;
|
import WayofTime.bloodmagic.api.util.helper.PlayerHelper;
|
||||||
|
import com.google.common.base.Strings;
|
||||||
|
import com.sun.istack.internal.Nullable;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.potion.Potion;
|
||||||
|
import net.minecraft.potion.PotionEffect;
|
||||||
|
import net.minecraft.server.MinecraftServer;
|
||||||
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.WorldSavedData;
|
import net.minecraft.world.WorldSavedData;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||||
|
@ -17,33 +24,61 @@ import net.minecraftforge.fml.common.eventhandler.Event;
|
||||||
public class SoulNetwork extends WorldSavedData {
|
public class SoulNetwork extends WorldSavedData {
|
||||||
|
|
||||||
private int currentEssence;
|
private int currentEssence;
|
||||||
private int maxOrb;
|
private int orbTier;
|
||||||
|
@Nullable
|
||||||
private final EntityPlayer player;
|
private final EntityPlayer player;
|
||||||
|
|
||||||
public SoulNetwork(String name) {
|
public SoulNetwork(String name) {
|
||||||
super(name);
|
super(name);
|
||||||
|
|
||||||
currentEssence = 0;
|
currentEssence = 0;
|
||||||
maxOrb = 0;
|
orbTier = 0;
|
||||||
player = PlayerHelper.getPlayerFromUsername(name);
|
player = PlayerHelper.getPlayerFromUsername(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||||
currentEssence = nbttagcompound.getInteger(NBTHolder.NBT_CURRENTESSENCE);
|
currentEssence = nbttagcompound.getInteger(NBTHolder.NBT_CURRENTESSENCE);
|
||||||
maxOrb = nbttagcompound.getInteger(NBTHolder.NBT_MAXORB);
|
orbTier = nbttagcompound.getInteger(NBTHolder.NBT_ORBTIER);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||||
nbttagcompound.setInteger(NBTHolder.NBT_CURRENTESSENCE, currentEssence);
|
nbttagcompound.setInteger(NBTHolder.NBT_CURRENTESSENCE, currentEssence);
|
||||||
nbttagcompound.setInteger(NBTHolder.NBT_MAXORB, maxOrb);
|
nbttagcompound.setInteger(NBTHolder.NBT_ORBTIER, orbTier);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int addLifeEssence(int toAdd, int maximum) {
|
||||||
|
AddToNetworkEvent event = new AddToNetworkEvent(mapName, toAdd, maximum);
|
||||||
|
|
||||||
|
if(MinecraftForge.EVENT_BUS.post(event))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (MinecraftServer.getServer() == null)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
World world = MinecraftServer.getServer().worldServers[0];
|
||||||
|
SoulNetwork data = (SoulNetwork) world.loadItemData(SoulNetwork.class, event.ownerNetwork);
|
||||||
|
|
||||||
|
if (data == null) {
|
||||||
|
data = new SoulNetwork(event.ownerNetwork);
|
||||||
|
world.setItemData(event.ownerNetwork, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
int currEss = data.getCurrentEssence();
|
||||||
|
|
||||||
|
if (currEss >= event.maximum)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
int newEss = Math.min(event.maximum, currEss + event.addedAmount);
|
||||||
|
if(event.getResult() != Event.Result.DENY)
|
||||||
|
data.setCurrentEssence(newEss);
|
||||||
|
|
||||||
|
return newEss - currEss;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to syphon LP from the network.
|
* Used to syphon LP from the network
|
||||||
*
|
|
||||||
* @return - .
|
|
||||||
*/
|
*/
|
||||||
public int syphon(int syphon) {
|
public int syphon(int syphon) {
|
||||||
if (getCurrentEssence() >= syphon) {
|
if (getCurrentEssence() >= syphon) {
|
||||||
|
@ -55,44 +90,54 @@ public class SoulNetwork extends WorldSavedData {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If the player exists on the server, syphon the given amount of LP from the player's LP network and
|
||||||
|
* damage for any remaining LP required.
|
||||||
|
*
|
||||||
|
* Always returns false on the client side.
|
||||||
|
*
|
||||||
|
* @return - Whether the action should be performed.
|
||||||
|
*/
|
||||||
public boolean syphonAndDamage(int toSyphon) {
|
public boolean syphonAndDamage(int toSyphon) {
|
||||||
// SoulNetworkEvent.PlayerDrainNetworkEvent event = new SoulNetworkEvent.PlayerDrainNetworkEvent(getPlayer(), mapName, syphon);
|
if (getPlayer().worldObj.isRemote)
|
||||||
//
|
|
||||||
// if (MinecraftForge.EVENT_BUS.post(event))
|
|
||||||
// return false;
|
|
||||||
//
|
|
||||||
// syphon(syphon);
|
|
||||||
// int drain = Math.max(0, getCurrentEssence() - syphon);
|
|
||||||
//
|
|
||||||
// if (drain == 0 || event.shouldDamage)
|
|
||||||
// hurtPlayer(event.syphon);
|
|
||||||
//
|
|
||||||
// return event.getResult() != Event.Result.DENY;
|
|
||||||
|
|
||||||
if (player.worldObj.isRemote)
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
int drain = syphon(toSyphon);
|
if (!Strings.isNullOrEmpty(mapName)) {
|
||||||
hurtPlayer(toSyphon - drain);
|
SoulNetworkEvent.ItemDrainNetworkEvent event = new SoulNetworkEvent.ItemDrainNetworkEvent(player, mapName, getPlayer().getHeldItem(), toSyphon);
|
||||||
|
|
||||||
|
if(MinecraftForge.EVENT_BUS.post(event))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
int drainAmount = syphon(event.syphon);
|
||||||
|
|
||||||
|
if(drainAmount == 0 || event.shouldDamage)
|
||||||
|
hurtPlayer(event.syphon);
|
||||||
|
|
||||||
|
return event.getResult() != Event.Result.DENY;
|
||||||
|
}
|
||||||
|
|
||||||
|
int amount = syphon(toSyphon);
|
||||||
|
hurtPlayer(toSyphon - amount);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void hurtPlayer(int syphon) {
|
public void hurtPlayer(int syphon) {
|
||||||
|
getPlayer().addPotionEffect(new PotionEffect(Potion.confusion.getId(), 20));
|
||||||
if (syphon < 100 && syphon > 0) {
|
if (syphon < 100 && syphon > 0) {
|
||||||
if (!player.capabilities.isCreativeMode) {
|
if (!getPlayer().capabilities.isCreativeMode) {
|
||||||
player.setHealth((player.getHealth() - 1));
|
getPlayer().setHealth((getPlayer().getHealth() - 1));
|
||||||
|
|
||||||
if (player.getHealth() <= 0.0005f)
|
if (getPlayer().getHealth() <= 0.0005f)
|
||||||
player.onDeath(BloodMagicAPI.getDamageSource());
|
getPlayer().onDeath(BloodMagicAPI.getDamageSource());
|
||||||
}
|
}
|
||||||
} else if (syphon >= 100) {
|
} else if (syphon >= 100) {
|
||||||
if (!player.capabilities.isCreativeMode) {
|
if (!getPlayer().capabilities.isCreativeMode) {
|
||||||
for (int i = 0; i < ((syphon + 99) / 100); i++) {
|
for (int i = 0; i < ((syphon + 99) / 100); i++) {
|
||||||
player.setHealth((player.getHealth() - 1));
|
getPlayer().setHealth((getPlayer().getHealth() - 1));
|
||||||
|
|
||||||
if (player.getHealth() <= 0.0005f) {
|
if (getPlayer().getHealth() <= 0.0005f) {
|
||||||
player.onDeath(BloodMagicAPI.getDamageSource());
|
getPlayer().onDeath(BloodMagicAPI.getDamageSource());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,8 +28,47 @@ public class NetworkHelper {
|
||||||
return network;
|
return network;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static int getCurrentMaxOrb(SoulNetwork soulNetwork) {
|
||||||
|
return soulNetwork.getOrbTier();
|
||||||
|
}
|
||||||
|
|
||||||
// Syphon
|
// Syphon
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handles null-checking the player for you.
|
||||||
|
*
|
||||||
|
* @return - Whether the action should be performed.
|
||||||
|
*/
|
||||||
|
public static boolean syphonAndDamage(SoulNetwork soulNetwork, int toSyphon) {
|
||||||
|
if (soulNetwork.getPlayer() == null) {
|
||||||
|
soulNetwork.syphon(toSyphon);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return soulNetwork.syphonAndDamage(toSyphon);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean syphonFromContainer(ItemStack stack, SoulNetwork soulNetwork, int toSyphon) {
|
||||||
|
stack = NBTHolder.checkNBT(stack);
|
||||||
|
String ownerName = stack.getTagCompound().getString(NBTHolder.NBT_OWNER);
|
||||||
|
|
||||||
|
if (Strings.isNullOrEmpty(ownerName))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
SoulNetworkEvent.ItemDrainInContainerEvent event = new SoulNetworkEvent.ItemDrainInContainerEvent(stack, ownerName, toSyphon);
|
||||||
|
|
||||||
|
return !(MinecraftForge.EVENT_BUS.post(event) || event.getResult() == Event.Result.DENY) && soulNetwork.syphon(event.syphon) >= toSyphon;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set
|
||||||
|
|
||||||
|
public static void setMaxOrbToMax(SoulNetwork soulNetwork, int maxOrb) {
|
||||||
|
soulNetwork.setOrbTier(Math.max(maxOrb, soulNetwork.getOrbTier()));
|
||||||
|
soulNetwork.markDirty();
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO - Remove everything below. It is deprecated and should not be used.
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Master method used to syphon from the player's network, and will damage them accordingly if they do not have enough LP.
|
* Master method used to syphon from the player's network, and will damage them accordingly if they do not have enough LP.
|
||||||
* Does not drain on the client side.
|
* Does not drain on the client side.
|
||||||
|
@ -39,6 +78,7 @@ public class NetworkHelper {
|
||||||
* @param syphon
|
* @param syphon
|
||||||
* @return True if the action should be executed and false if it should not. Always returns false if client-sided.
|
* @return True if the action should be executed and false if it should not. Always returns false if client-sided.
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public static boolean syphonAndDamageFromNetwork(ItemStack stack, EntityPlayer player, int syphon) {
|
public static boolean syphonAndDamageFromNetwork(ItemStack stack, EntityPlayer player, int syphon) {
|
||||||
if (player.worldObj.isRemote)
|
if (player.worldObj.isRemote)
|
||||||
return false;
|
return false;
|
||||||
|
@ -68,6 +108,7 @@ public class NetworkHelper {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
public static boolean syphonFromNetworkWhileInContainer(ItemStack stack, int syphon) {
|
public static boolean syphonFromNetworkWhileInContainer(ItemStack stack, int syphon) {
|
||||||
stack = NBTHolder.checkNBT(stack);
|
stack = NBTHolder.checkNBT(stack);
|
||||||
String ownerName = stack.getTagCompound().getString(NBTHolder.NBT_OWNER);
|
String ownerName = stack.getTagCompound().getString(NBTHolder.NBT_OWNER);
|
||||||
|
@ -83,6 +124,7 @@ public class NetworkHelper {
|
||||||
return syphonFromNetwork(event.ownerName, event.syphon) >= syphon;
|
return syphonFromNetwork(event.ownerName, event.syphon) >= syphon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
public static int syphonFromNetwork(ItemStack stack, int syphon) {
|
public static int syphonFromNetwork(ItemStack stack, int syphon) {
|
||||||
stack = NBTHolder.checkNBT(stack);
|
stack = NBTHolder.checkNBT(stack);
|
||||||
String ownerName = stack.getTagCompound().getString(NBTHolder.NBT_OWNER);
|
String ownerName = stack.getTagCompound().getString(NBTHolder.NBT_OWNER);
|
||||||
|
@ -92,6 +134,7 @@ public class NetworkHelper {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
public static int syphonFromNetwork(String ownerName, int syphon) {
|
public static int syphonFromNetwork(String ownerName, int syphon) {
|
||||||
if (MinecraftServer.getServer() == null)
|
if (MinecraftServer.getServer() == null)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -120,6 +163,7 @@ public class NetworkHelper {
|
||||||
*
|
*
|
||||||
* @return amount added to the network
|
* @return amount added to the network
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public static int addCurrentEssenceToMaximum(String ownerName, int addedEssence, int maximum) {
|
public static int addCurrentEssenceToMaximum(String ownerName, int addedEssence, int maximum) {
|
||||||
AddToNetworkEvent event = new AddToNetworkEvent(ownerName, addedEssence, maximum);
|
AddToNetworkEvent event = new AddToNetworkEvent(ownerName, addedEssence, maximum);
|
||||||
|
|
||||||
|
@ -151,6 +195,7 @@ public class NetworkHelper {
|
||||||
|
|
||||||
// Get
|
// Get
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
public static int getCurrentEssence(String ownerName) {
|
public static int getCurrentEssence(String ownerName) {
|
||||||
if (MinecraftServer.getServer() == null)
|
if (MinecraftServer.getServer() == null)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -168,6 +213,7 @@ public class NetworkHelper {
|
||||||
|
|
||||||
// Do damage
|
// Do damage
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
public static void hurtPlayer(EntityPlayer user, int energySyphoned) {
|
public static void hurtPlayer(EntityPlayer user, int energySyphoned) {
|
||||||
if (energySyphoned < 100 && energySyphoned > 0) {
|
if (energySyphoned < 100 && energySyphoned > 0) {
|
||||||
if (!user.capabilities.isCreativeMode) {
|
if (!user.capabilities.isCreativeMode) {
|
||||||
|
@ -190,41 +236,11 @@ public class NetworkHelper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
public static void hurtPlayer(EntityPlayer user, float damage) {
|
public static void hurtPlayer(EntityPlayer user, float damage) {
|
||||||
if (!user.capabilities.isCreativeMode) {
|
if (!user.capabilities.isCreativeMode) {
|
||||||
user.attackEntityFrom(BloodMagicAPI.getDamageSource(), 0F);
|
user.attackEntityFrom(BloodMagicAPI.getDamageSource(), 0F);
|
||||||
user.setHealth((user.getHealth() - damage));
|
user.setHealth((user.getHealth() - damage));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setMaxOrbToMax(String ownerName, int maxOrb) {
|
|
||||||
if (MinecraftServer.getServer() == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
World world = MinecraftServer.getServer().worldServers[0];
|
|
||||||
SoulNetwork network = (SoulNetwork) world.loadItemData(SoulNetwork.class, ownerName);
|
|
||||||
|
|
||||||
if (network == null) {
|
|
||||||
network = new SoulNetwork(ownerName);
|
|
||||||
world.setItemData(ownerName, network);
|
|
||||||
}
|
|
||||||
|
|
||||||
network.setMaxOrb(Math.max(maxOrb, network.getMaxOrb()));
|
|
||||||
network.markDirty();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int getCurrentMaxOrb(String ownerName) {
|
|
||||||
if (MinecraftServer.getServer() == null)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
World world = MinecraftServer.getServer().worldServers[0];
|
|
||||||
SoulNetwork network = (SoulNetwork) world.loadItemData(SoulNetwork.class, ownerName);
|
|
||||||
|
|
||||||
if (network == null) {
|
|
||||||
network = new SoulNetwork(ownerName);
|
|
||||||
world.setItemData(ownerName, network);
|
|
||||||
}
|
|
||||||
|
|
||||||
return network.getMaxOrb();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ public class ItemBindable extends Item implements IBindable {
|
||||||
|
|
||||||
public static boolean syphonBatteries(ItemStack stack, EntityPlayer player, int damageToBeDone) {
|
public static boolean syphonBatteries(ItemStack stack, EntityPlayer player, int damageToBeDone) {
|
||||||
if (!player.worldObj.isRemote) {
|
if (!player.worldObj.isRemote) {
|
||||||
return NetworkHelper.getSoulNetwork(BindableHelper.getOwnerName(stack), player.worldObj).syphonAndDamage(damageToBeDone);
|
return NetworkHelper.syphonAndDamage(NetworkHelper.getSoulNetwork(BindableHelper.getOwnerName(stack), player.worldObj), damageToBeDone);
|
||||||
} else {
|
} else {
|
||||||
double posX = player.posX;
|
double posX = player.posX;
|
||||||
double posY = player.posY;
|
double posY = player.posY;
|
||||||
|
|
|
@ -63,9 +63,9 @@ public class ItemBloodOrb extends ItemBindable implements IBloodOrb, IBindable {
|
||||||
return stack;
|
return stack;
|
||||||
|
|
||||||
if(stack.getTagCompound().getString(NBTHolder.NBT_OWNER).equals(PlayerHelper.getUsernameFromPlayer(player)))
|
if(stack.getTagCompound().getString(NBTHolder.NBT_OWNER).equals(PlayerHelper.getUsernameFromPlayer(player)))
|
||||||
NetworkHelper.setMaxOrbToMax(stack.getTagCompound().getString(NBTHolder.NBT_OWNER), getOrbLevel(stack.getItemDamage()));
|
NetworkHelper.setMaxOrbToMax(NetworkHelper.getSoulNetwork(stack.getTagCompound().getString(NBTHolder.NBT_OWNER), world), getOrbLevel(stack.getItemDamage()));
|
||||||
|
|
||||||
NetworkHelper.addCurrentEssenceToMaximum(stack.getTagCompound().getString(NBTHolder.NBT_OWNER), 200, getMaxEssence(stack.getItemDamage()));
|
NetworkHelper.getSoulNetwork(stack.getTagCompound().getString(NBTHolder.NBT_OWNER), world).addLifeEssence(200, getMaxEssence(stack.getItemDamage()));
|
||||||
hurtPlayer(player, 200);
|
hurtPlayer(player, 200);
|
||||||
return stack;
|
return stack;
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,9 +24,9 @@ public class ItemSigilDivination extends ItemSigilBase implements ISigil, IAltar
|
||||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||||
super.onItemRightClick(stack, world, player);
|
super.onItemRightClick(stack, world, player);
|
||||||
|
|
||||||
if (!world.isRemote && syphonBatteries(stack, player, getEnergyUsed())) {
|
if (!world.isRemote) {
|
||||||
MovingObjectPosition position = getMovingObjectPositionFromPlayer(world, player, false);
|
MovingObjectPosition position = getMovingObjectPositionFromPlayer(world, player, false);
|
||||||
int currentEssence = NetworkHelper.getCurrentEssence(BindableHelper.getOwnerName(stack));
|
int currentEssence = NetworkHelper.getSoulNetwork(BindableHelper.getOwnerName(stack), world).getCurrentEssence();
|
||||||
|
|
||||||
if (position == null) {
|
if (position == null) {
|
||||||
ChatUtil.sendNoSpam(player, new ChatComponentText(TextHelper.localize(tooltipBase + "currentEssence", currentEssence)));
|
ChatUtil.sendNoSpam(player, new ChatComponentText(TextHelper.localize(tooltipBase + "currentEssence", currentEssence)));
|
||||||
|
|
Loading…
Reference in a new issue