Fixed Blood Light particles being purple. Added ability for the Divination Sigil to look at information of the incense altar
This commit is contained in:
parent
690cf6c4f3
commit
820418558e
|
@ -58,11 +58,7 @@ public class BlockBloodLight extends Block
|
||||||
if (world.getBlockState(pos).getBlock() == this)
|
if (world.getBlockState(pos).getBlock() == this)
|
||||||
{
|
{
|
||||||
Random random = new Random();
|
Random random = new Random();
|
||||||
float f = 1.0F;
|
effectRenderer.spawnEffectParticle(EnumParticleTypes.REDSTONE.getParticleID(), pos.getX() + 0.5D + random.nextGaussian() / 8, pos.getY() + 0.5D, pos.getZ() + 0.5D + random.nextGaussian() / 8, 0, 0, 0);
|
||||||
float f1 = f * 0.6F + 0.4F;
|
|
||||||
float f2 = f * f * 0.7F - 0.5F;
|
|
||||||
float f3 = f * f * 0.6F - 0.7F;
|
|
||||||
effectRenderer.spawnEffectParticle(EnumParticleTypes.REDSTONE.getParticleID(), pos.getX() + 0.5D + random.nextGaussian() / 8, pos.getY() + 0.5D, pos.getZ() + 0.5D + random.nextGaussian() / 8, f1, f2, f3);
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -73,11 +69,7 @@ public class BlockBloodLight extends Block
|
||||||
{
|
{
|
||||||
if (rand.nextInt(3) != 0)
|
if (rand.nextInt(3) != 0)
|
||||||
{
|
{
|
||||||
float f = 1.0F;
|
worldIn.spawnParticle(EnumParticleTypes.REDSTONE, pos.getX() + 0.5D + rand.nextGaussian() / 8, pos.getY() + 0.5D, pos.getZ() + 0.5D + rand.nextGaussian() / 8, 0, 0, 0, 0);
|
||||||
float f1 = f * 0.6F + 0.4F;
|
|
||||||
float f2 = f * f * 0.7F - 0.5F;
|
|
||||||
float f3 = f * f * 0.6F - 0.7F;
|
|
||||||
worldIn.spawnParticle(EnumParticleTypes.REDSTONE, pos.getX() + 0.5D + rand.nextGaussian() / 8, pos.getY() + 0.5D, pos.getZ() + 0.5D + rand.nextGaussian() / 8, f1, f2, f3, 0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ public class IncenseAltarHandler
|
||||||
//Incense bonus maximum applied for the tier of blocks.
|
//Incense bonus maximum applied for the tier of blocks.
|
||||||
public static double[] incenseBonuses = new double[] { 0.2, 0.6, 1.2, 2, 3, 4.5 };
|
public static double[] incenseBonuses = new double[] { 0.2, 0.6, 1.2, 2, 3, 4.5 };
|
||||||
public static double[] tranquilityRequired = new double[] { 0, 6, 14.14, 28, 44.09, 83.14 };
|
public static double[] tranquilityRequired = new double[] { 0, 6, 14.14, 28, 44.09, 83.14 };
|
||||||
public static int[] roadsRequired = new int[] { 0, 1, 3, 5, 7, 9, 11 }; //TODO: Change for when the roads are fully implemented
|
public static int[] roadsRequired = new int[] { 0, 1, 4, 6, 8, 10, 12 }; //TODO: Change for when the roads are fully implemented
|
||||||
|
|
||||||
public static void registerIncenseComponent(int altarLevel, IncenseAltarComponent component)
|
public static void registerIncenseComponent(int altarLevel, IncenseAltarComponent component)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,16 +1,17 @@
|
||||||
package WayofTime.bloodmagic.item.sigil;
|
package WayofTime.bloodmagic.item.sigil;
|
||||||
|
|
||||||
import WayofTime.bloodmagic.api.Constants;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.ChatComponentText;
|
import net.minecraft.util.ChatComponentText;
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import WayofTime.bloodmagic.api.Constants;
|
||||||
import WayofTime.bloodmagic.api.altar.IBloodAltar;
|
import WayofTime.bloodmagic.api.altar.IBloodAltar;
|
||||||
import WayofTime.bloodmagic.api.iface.IAltarReader;
|
import WayofTime.bloodmagic.api.iface.IAltarReader;
|
||||||
import WayofTime.bloodmagic.api.util.helper.BindableHelper;
|
import WayofTime.bloodmagic.api.util.helper.BindableHelper;
|
||||||
import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
|
import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
|
||||||
|
import WayofTime.bloodmagic.tile.TileIncenseAltar;
|
||||||
import WayofTime.bloodmagic.util.ChatUtil;
|
import WayofTime.bloodmagic.util.ChatUtil;
|
||||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||||
|
|
||||||
|
@ -40,7 +41,6 @@ public class ItemSigilDivination extends ItemSigilBase implements IAltarReader
|
||||||
{
|
{
|
||||||
if (position.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
if (position.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||||
{
|
{
|
||||||
|
|
||||||
TileEntity tile = world.getTileEntity(position.getBlockPos());
|
TileEntity tile = world.getTileEntity(position.getBlockPos());
|
||||||
|
|
||||||
if (tile != null && tile instanceof IBloodAltar)
|
if (tile != null && tile instanceof IBloodAltar)
|
||||||
|
@ -52,6 +52,11 @@ public class ItemSigilDivination extends ItemSigilBase implements IAltarReader
|
||||||
altar.checkTier();
|
altar.checkTier();
|
||||||
ChatUtil.sendNoSpam(player, TextHelper.localize(tooltipBase + "currentAltarTier", tier), TextHelper.localize(tooltipBase + "currentEssence", currentEssence), TextHelper.localize(tooltipBase + "currentAltarCapacity", capacity));
|
ChatUtil.sendNoSpam(player, TextHelper.localize(tooltipBase + "currentAltarTier", tier), TextHelper.localize(tooltipBase + "currentEssence", currentEssence), TextHelper.localize(tooltipBase + "currentAltarCapacity", capacity));
|
||||||
|
|
||||||
|
} else if (tile != null && tile instanceof TileIncenseAltar)
|
||||||
|
{
|
||||||
|
TileIncenseAltar altar = (TileIncenseAltar) tile;
|
||||||
|
double tranquility = altar.tranquility;
|
||||||
|
ChatUtil.sendNoSpam(player, TextHelper.localize(tooltipBase + "currentTranquility", ((int) (100 * tranquility)) / 100d), TextHelper.localize(tooltipBase + "currentBonus", (int) (100 * altar.incenseAddition)));
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
ChatUtil.sendNoSpam(player, TextHelper.localize(tooltipBase + "currentEssence", currentEssence));
|
ChatUtil.sendNoSpam(player, TextHelper.localize(tooltipBase + "currentEssence", currentEssence));
|
||||||
|
|
|
@ -8,6 +8,7 @@ import java.util.Map.Entry;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.AxisAlignedBB;
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.BlockPos;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
|
@ -27,6 +28,7 @@ public class TileIncenseAltar extends TileInventory implements ITickable
|
||||||
public Map<EnumTranquilityType, Double> tranquilityMap = new HashMap<EnumTranquilityType, Double>();
|
public Map<EnumTranquilityType, Double> tranquilityMap = new HashMap<EnumTranquilityType, Double>();
|
||||||
|
|
||||||
public double incenseAddition = 0; //Self-sacrifice is multiplied by 1 plus this value.
|
public double incenseAddition = 0; //Self-sacrifice is multiplied by 1 plus this value.
|
||||||
|
public double tranquility = 0;
|
||||||
public int roadDistance = 0; //Number of road blocks laid down
|
public int roadDistance = 0; //Number of road blocks laid down
|
||||||
|
|
||||||
public TileIncenseAltar()
|
public TileIncenseAltar()
|
||||||
|
@ -55,6 +57,22 @@ public class TileIncenseAltar extends TileInventory implements ITickable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readFromNBT(NBTTagCompound tag)
|
||||||
|
{
|
||||||
|
super.readFromNBT(tag);
|
||||||
|
tranquility = tag.getDouble("tranquility");
|
||||||
|
incenseAddition = tag.getDouble("incenseAddition");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToNBT(NBTTagCompound tag)
|
||||||
|
{
|
||||||
|
super.writeToNBT(tag);
|
||||||
|
tag.setDouble("tranquility", tranquility);
|
||||||
|
tag.setDouble("incenseAddition", incenseAddition);
|
||||||
|
}
|
||||||
|
|
||||||
public void recheckConstruction()
|
public void recheckConstruction()
|
||||||
{
|
{
|
||||||
//TODO: Check the physical construction of the incense altar to determine the maximum length.
|
//TODO: Check the physical construction of the incense altar to determine the maximum length.
|
||||||
|
@ -151,10 +169,8 @@ public class TileIncenseAltar extends TileInventory implements ITickable
|
||||||
appliedTranquility += Math.sqrt(entry.getValue());
|
appliedTranquility += Math.sqrt(entry.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
// System.out.println("Tranquility: " + appliedTranquility);
|
|
||||||
|
|
||||||
double bonus = IncenseAltarHandler.getIncenseBonusFromComponents(worldObj, pos, appliedTranquility, roadDistance);
|
double bonus = IncenseAltarHandler.getIncenseBonusFromComponents(worldObj, pos, appliedTranquility, roadDistance);
|
||||||
// System.out.println("Incense bonus: " + bonus);
|
|
||||||
incenseAddition = bonus;
|
incenseAddition = bonus;
|
||||||
|
this.tranquility = appliedTranquility;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -197,6 +197,8 @@ tooltip.BloodMagic.sigil.divination.desc=&oPeer into the soul
|
||||||
tooltip.BloodMagic.sigil.divination.currentAltarTier=Current Tier: %d
|
tooltip.BloodMagic.sigil.divination.currentAltarTier=Current Tier: %d
|
||||||
tooltip.BloodMagic.sigil.divination.currentEssence=Current Essence: %d LP
|
tooltip.BloodMagic.sigil.divination.currentEssence=Current Essence: %d LP
|
||||||
tooltip.BloodMagic.sigil.divination.currentAltarCapacity=Current Capacity: %d LP
|
tooltip.BloodMagic.sigil.divination.currentAltarCapacity=Current Capacity: %d LP
|
||||||
|
tooltip.BloodMagic.sigil.divination.currentTranquility=Current Tranquility: %d
|
||||||
|
tooltip.BloodMagic.sigil.divination.currentBonus=Current Bonus: +%d%%
|
||||||
tooltip.BloodMagic.sigil.water.desc=&oInfinite water, anyone?
|
tooltip.BloodMagic.sigil.water.desc=&oInfinite water, anyone?
|
||||||
tooltip.BloodMagic.sigil.lava.desc=&oHOT! DO NOT EAT
|
tooltip.BloodMagic.sigil.lava.desc=&oHOT! DO NOT EAT
|
||||||
tooltip.BloodMagic.sigil.void.desc=&oBetter than a Swiffer®!
|
tooltip.BloodMagic.sigil.void.desc=&oBetter than a Swiffer®!
|
||||||
|
|
Loading…
Reference in a new issue