Added Demon Pylon (currently no model) which pulls demon will from surrounding chunks into its chunk.

This commit is contained in:
WayofTime 2016-02-23 13:40:08 -05:00
parent 7104138e2b
commit 743af85a61
9 changed files with 306 additions and 170 deletions

View file

@ -105,11 +105,35 @@ public class WorldDemonWillHandler
return fill;
}
public static double fillWill(World world, BlockPos pos, EnumDemonWillType type, double amount, boolean doFill)
{
WillChunk willChunk = getWillChunk(world, pos);
DemonWillHolder currentWill = willChunk.getCurrentWill();
if (!doFill)
{
return amount;
}
currentWill.addWill(type, amount);
markChunkAsDirty(willChunk, world.provider.getDimensionId());
return amount;
}
public static WillChunk getWillChunk(World world, BlockPos pos)
{
return getWillChunk(world.provider.getDimensionId(), pos.getX() >> 4, pos.getZ() >> 4);
}
public static double getCurrentWill(World world, BlockPos pos, EnumDemonWillType type)
{
WillChunk willChunk = getWillChunk(world, pos);
DemonWillHolder currentWill = willChunk.getCurrentWill();
return currentWill.getWill(type);
}
private static void markChunkAsDirty(WillChunk chunk, int dim)
{
if (chunk.isModified())