Added some rudimentary path blocks for the tranquility altar - textures pending.
This commit is contained in:
parent
f4d0b18521
commit
cc1e11f09f
17 changed files with 216 additions and 23 deletions
|
@ -226,7 +226,8 @@ public class Constants
|
|||
SOUL_FORGE("BlockSoulForge"),
|
||||
SPECTRAL("BlockSpectral"),
|
||||
TELEPOSER("BlockTeleposer"),
|
||||
INCENSE_ALTAR("BlockIncenseAltar");
|
||||
INCENSE_ALTAR("BlockIncenseAltar"),
|
||||
PATH("BlockPath");
|
||||
|
||||
@Getter
|
||||
private final String regName;
|
||||
|
|
|
@ -6,20 +6,20 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
|
||||
public class IncenseHelper
|
||||
{
|
||||
public static float getCurrentIncense(EntityPlayer player)
|
||||
public static double getCurrentIncense(EntityPlayer player)
|
||||
{
|
||||
NBTTagCompound data = player.getEntityData();
|
||||
if (data.hasKey(Constants.NBT.CURRENT_INCENSE))
|
||||
{
|
||||
return data.getFloat(Constants.NBT.CURRENT_INCENSE);
|
||||
return data.getDouble(Constants.NBT.CURRENT_INCENSE);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static void setCurrentIncense(EntityPlayer player, float amount)
|
||||
public static void setCurrentIncense(EntityPlayer player, double amount)
|
||||
{
|
||||
NBTTagCompound data = player.getEntityData();
|
||||
data.setFloat(Constants.NBT.CURRENT_INCENSE, amount);
|
||||
data.setDouble(Constants.NBT.CURRENT_INCENSE, amount);
|
||||
}
|
||||
}
|
|
@ -10,29 +10,29 @@ import net.minecraft.world.World;
|
|||
|
||||
public class PlayerSacrificeHelper
|
||||
{
|
||||
public static float scalingOfSacrifice = 0.001f;
|
||||
public static float scalingOfSacrifice = 1f;
|
||||
public static int soulFrayDuration = 400;
|
||||
public static Potion soulFrayId;
|
||||
|
||||
public static float getPlayerIncense(EntityPlayer player)
|
||||
public static double getPlayerIncense(EntityPlayer player)
|
||||
{
|
||||
return IncenseHelper.getCurrentIncense(player);
|
||||
}
|
||||
|
||||
public static void setPlayerIncense(EntityPlayer player, float amount)
|
||||
public static void setPlayerIncense(EntityPlayer player, double amount)
|
||||
{
|
||||
IncenseHelper.setCurrentIncense(player, amount);
|
||||
}
|
||||
|
||||
public static boolean incrementIncense(EntityPlayer player, float min, float max, float increment)
|
||||
public static boolean incrementIncense(EntityPlayer player, double min, double incenseAddition, double increment)
|
||||
{
|
||||
float amount = getPlayerIncense(player);
|
||||
if (amount < min || amount >= max)
|
||||
double amount = getPlayerIncense(player);
|
||||
if (amount < min || amount >= incenseAddition)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
amount = amount + Math.min(increment, max - amount);
|
||||
amount = amount + Math.min(increment, incenseAddition - amount);
|
||||
setPlayerIncense(player, amount);
|
||||
|
||||
// System.out.println("Amount of incense: " + amount + ", Increment: " +
|
||||
|
@ -48,7 +48,7 @@ public class PlayerSacrificeHelper
|
|||
return false;
|
||||
}
|
||||
|
||||
float amount = getPlayerIncense(player);
|
||||
double amount = getPlayerIncense(player);
|
||||
|
||||
if (amount >= 0)
|
||||
{
|
||||
|
@ -73,7 +73,7 @@ public class PlayerSacrificeHelper
|
|||
return false;
|
||||
}
|
||||
|
||||
public static float getModifier(float amount)
|
||||
public static double getModifier(double amount)
|
||||
{
|
||||
return 1 + amount * scalingOfSacrifice;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue