Anti-comments sweep!

This commit is contained in:
Tombenpotter 2014-10-13 22:33:20 +02:00
parent e6a10f3f06
commit dea1f87078
454 changed files with 23594 additions and 26739 deletions

View file

@ -1,7 +1,6 @@
package WayofTime.alchemicalWizardry.api.soulNetwork;
import java.util.UUID;
import com.mojang.authlib.GameProfile;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@ -11,38 +10,36 @@ import net.minecraft.server.MinecraftServer;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
import com.mojang.authlib.GameProfile;
import java.util.UUID;
public class SoulNetworkHandler
public class SoulNetworkHandler
{
public static UUID getUUIDFromPlayer(EntityPlayer player)
{
return player.getPersistentID();
}
public static EntityPlayer getPlayerFromUUID(UUID uuid)
{
MinecraftServer server = MinecraftServer.getServer();
GameProfile gameProfile;
gameProfile = server.func_152358_ax().func_152652_a(uuid);
// LogHelper.info("player is " + gameProfile.getName() + " : " + gameProfile.getId());
return null;
}
public static int syphonFromNetwork(ItemStack ist, int damageToBeDone)
{
if (ist.getTagCompound() != null && !(ist.getTagCompound().getString("ownerName").equals("")))
public static UUID getUUIDFromPlayer(EntityPlayer player)
{
return player.getPersistentID();
}
public static EntityPlayer getPlayerFromUUID(UUID uuid)
{
MinecraftServer server = MinecraftServer.getServer();
GameProfile gameProfile;
gameProfile = server.func_152358_ax().func_152652_a(uuid);
return null;
}
public static int syphonFromNetwork(ItemStack ist, int damageToBeDone)
{
if (ist.getTagCompound() != null && !(ist.getTagCompound().getString("ownerName").equals("")))
{
String ownerName = ist.getTagCompound().getString("ownerName");
return syphonFromNetwork(ownerName, damageToBeDone);
}
return 0;
}
public static int syphonFromNetwork(String ownerName, int damageToBeDone)
{
return 0;
}
public static int syphonFromNetwork(String ownerName, int damageToBeDone)
{
if (MinecraftServer.getServer() == null)
{
return 0;
@ -63,34 +60,34 @@ public class SoulNetworkHandler
data.markDirty();
return damageToBeDone;
}
return 0;
}
/**
* 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.
*
* @param ist Owned itemStack
* @param player Player using the item
* @param damageToBeDone
* @return True if server-sided, false if client-sided
*/
public static boolean syphonAndDamageFromNetwork(ItemStack ist, EntityPlayer player, int damageToBeDone)
}
/**
* 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.
*
* @param ist Owned itemStack
* @param player Player using the item
* @param damageToBeDone
* @return True if server-sided, false if client-sided
*/
public static boolean syphonAndDamageFromNetwork(ItemStack ist, EntityPlayer player, int damageToBeDone)
{
if(player.worldObj.isRemote)
{
return false;
}
int amount = SoulNetworkHandler.syphonFromNetwork(ist, damageToBeDone);
hurtPlayer(player, damageToBeDone-amount);
if (player.worldObj.isRemote)
{
return false;
}
int amount = SoulNetworkHandler.syphonFromNetwork(ist, damageToBeDone);
hurtPlayer(player, damageToBeDone - amount);
return true;
}
public static boolean canSyphonFromOnlyNetwork(ItemStack ist, int damageToBeDone)
public static boolean canSyphonFromOnlyNetwork(ItemStack ist, int damageToBeDone)
{
if (ist.getTagCompound() != null && !(ist.getTagCompound().getString("ownerName").equals("")))
{
@ -101,8 +98,8 @@ public class SoulNetworkHandler
return false;
}
public static boolean canSyphonFromOnlyNetwork(String ownerName, int damageToBeDone)
public static boolean canSyphonFromOnlyNetwork(String ownerName, int damageToBeDone)
{
if (MinecraftServer.getServer() == null)
{
@ -120,10 +117,10 @@ public class SoulNetworkHandler
return data.currentEssence >= damageToBeDone;
}
public static int getCurrentEssence(String ownerName)
{
if (MinecraftServer.getServer() == null)
public static int getCurrentEssence(String ownerName)
{
if (MinecraftServer.getServer() == null)
{
return 0;
}
@ -136,13 +133,13 @@ public class SoulNetworkHandler
data = new LifeEssenceNetwork(ownerName);
world.setItemData(ownerName, data);
}
return data.currentEssence;
}
public static void setCurrentEssence(String ownerName, int essence)
{
if (MinecraftServer.getServer() == null)
}
public static void setCurrentEssence(String ownerName, int essence)
{
if (MinecraftServer.getServer() == null)
{
return;
}
@ -155,22 +152,22 @@ public class SoulNetworkHandler
data = new LifeEssenceNetwork(ownerName);
world.setItemData(ownerName, data);
}
data.currentEssence = essence;
data.markDirty();
}
/**
* A method to add to an owner's network up to a maximum value.
*
* @param ownerName
* @param addedEssence
* @param maximum
* @return amount added to the network
*/
public static int addCurrentEssenceToMaximum(String ownerName, int addedEssence, int maximum)
{
if (MinecraftServer.getServer() == null)
}
/**
* A method to add to an owner's network up to a maximum value.
*
* @param ownerName
* @param addedEssence
* @param maximum
* @return amount added to the network
*/
public static int addCurrentEssenceToMaximum(String ownerName, int addedEssence, int maximum)
{
if (MinecraftServer.getServer() == null)
{
return 0;
}
@ -183,21 +180,21 @@ public class SoulNetworkHandler
data = new LifeEssenceNetwork(ownerName);
world.setItemData(ownerName, data);
}
int currEss = data.currentEssence;
if(currEss>=maximum)
if (currEss >= maximum)
{
return 0;
return 0;
}
int newEss = Math.min(maximum, currEss+addedEssence);
int newEss = Math.min(maximum, currEss + addedEssence);
data.currentEssence = newEss;
return newEss-currEss;
}
public static void hurtPlayer(EntityPlayer user, int energySyphoned)
return newEss - currEss;
}
public static void hurtPlayer(EntityPlayer user, int energySyphoned)
{
if (energySyphoned < 100 && energySyphoned > 0)
{
@ -227,8 +224,8 @@ public class SoulNetworkHandler
}
}
}
public static void checkAndSetItemOwner(ItemStack item, EntityPlayer player)
public static void checkAndSetItemOwner(ItemStack item, EntityPlayer player)
{
if (item.stackTagCompound == null)
{
@ -253,34 +250,34 @@ public class SoulNetworkHandler
item.stackTagCompound.setString("ownerName", ownerName);
}
}
public static String getUsername(EntityPlayer player)
{
return player.getDisplayName();
}
{
return player.getDisplayName();
}
public static EntityPlayer getPlayerForUsername(String str)
{
if(MinecraftServer.getServer() == null)
{
return null;
}
return MinecraftServer.getServer().getConfigurationManager().func_152612_a(str);
}
{
if (MinecraftServer.getServer() == null)
{
return null;
}
return MinecraftServer.getServer().getConfigurationManager().func_152612_a(str);
}
public static void causeNauseaToPlayer(ItemStack stack)
{
if (stack.getTagCompound() != null && !(stack.getTagCompound().getString("ownerName").equals("")))
if (stack.getTagCompound() != null && !(stack.getTagCompound().getString("ownerName").equals("")))
{
String ownerName = stack.getTagCompound().getString("ownerName");
SoulNetworkHandler.causeNauseaToPlayer(ownerName);
}
}
public static void causeNauseaToPlayer(String ownerName)
{
EntityPlayer entityOwner = SoulNetworkHandler.getPlayerForUsername(ownerName);
EntityPlayer entityOwner = SoulNetworkHandler.getPlayerForUsername(ownerName);
if (entityOwner == null)
{