Various Changes, Support for doMobSpawning, Overhauled CommonTickHandler #53

Merged
SenseiKiwi merged 7 commits from master into master 2013-07-26 19:38:46 +00:00
3 changed files with 18 additions and 18 deletions
Showing only changes of commit 03b727881a - Show all commits

View File

@@ -235,7 +235,7 @@ public class CommonTickHandler implements ITickHandler
if (tickCount % LIMBO_DECAY_INTERVAL == 0) if (tickCount % LIMBO_DECAY_INTERVAL == 0)
{ {
LimboDecay.ApplyRandomFastDecay(); LimboDecay.applyRandomFastDecay();
} }
if (mod_pocketDim.teleTimer > 0) if (mod_pocketDim.teleTimer > 0)

View File

@@ -31,7 +31,7 @@ public class LimboDecay {
/** /**
* Initializes the array containing the reversed sequence of block IDs that blocks cycle through during decay. * Initializes the array containing the reversed sequence of block IDs that blocks cycle through during decay.
*/ */
private static void InitializeDecaySequence() private static void initializeDecaySequence()
{ {
if (decaySequence == null) if (decaySequence == null)
{ {
@@ -51,7 +51,7 @@ public class LimboDecay {
* Checks the blocks orthogonally around a given location (presumably the location of an Unraveled Fabric block) * Checks the blocks orthogonally around a given location (presumably the location of an Unraveled Fabric block)
* and applies Limbo decay to them. This gives the impression that decay spreads outward from Unraveled Fabric. * and applies Limbo decay to them. This gives the impression that decay spreads outward from Unraveled Fabric.
*/ */
public static void ApplySpreadDecay(World world, int x, int y, int z) public static void applySpreadDecay(World world, int x, int y, int z)
{ {
if (properties == null) if (properties == null)
properties = DDProperties.instance(); properties = DDProperties.instance();
@@ -62,12 +62,12 @@ public class LimboDecay {
{ {
//Apply decay to the blocks above, below, and on all four sides. //Apply decay to the blocks above, below, and on all four sides.
//World.getBlockId() implements bounds checking, so we don't have to worry about reaching out of the world //World.getBlockId() implements bounds checking, so we don't have to worry about reaching out of the world
DecayBlock(world, x - 1, y, z); decayBlock(world, x - 1, y, z);
DecayBlock(world, x + 1, y, z); decayBlock(world, x + 1, y, z);
DecayBlock(world, x, y, z - 1); decayBlock(world, x, y, z - 1);
DecayBlock(world, x, y, z + 1); decayBlock(world, x, y, z + 1);
DecayBlock(world, x, y - 1, z); decayBlock(world, x, y - 1, z);
DecayBlock(world, x, y + 1, z); decayBlock(world, x, y + 1, z);
} }
} }
@@ -75,7 +75,7 @@ public class LimboDecay {
* Picks random blocks from each active chunk in Limbo and, if decay is applicable, converts them directly to Unraveled Fabric. * Picks random blocks from each active chunk in Limbo and, if decay is applicable, converts them directly to Unraveled Fabric.
* This decay method is designed to stop players from avoiding Limbo decay by building floating structures. * This decay method is designed to stop players from avoiding Limbo decay by building floating structures.
*/ */
public static void ApplyRandomFastDecay() public static void applyRandomFastDecay()
{ {
if (properties == null) if (properties == null)
properties = DDProperties.instance(); properties = DDProperties.instance();
@@ -102,7 +102,7 @@ public class LimboDecay {
x = chunkCoord.chunkXPos * CHUNK_SIZE + random.nextInt(CHUNK_SIZE); x = chunkCoord.chunkXPos * CHUNK_SIZE + random.nextInt(CHUNK_SIZE);
z = chunkCoord.chunkZPos * CHUNK_SIZE + random.nextInt(CHUNK_SIZE); z = chunkCoord.chunkZPos * CHUNK_SIZE + random.nextInt(CHUNK_SIZE);
y = sectionY + random.nextInt(SECTION_HEIGHT); y = sectionY + random.nextInt(SECTION_HEIGHT);
DecayBlockFast(limbo, x, y, z); decayBlockFast(limbo, x, y, z);
} }
} }
} }
@@ -111,10 +111,10 @@ public class LimboDecay {
/** /**
* Checks if a block can be decayed and, if so, changes it directly into Unraveled Fabric. * Checks if a block can be decayed and, if so, changes it directly into Unraveled Fabric.
*/ */
private static boolean DecayBlockFast(World world, int x, int y, int z) private static boolean decayBlockFast(World world, int x, int y, int z)
{ {
int blockID = world.getBlockId(x, y, z); int blockID = world.getBlockId(x, y, z);
if (CanDecayBlock(blockID)) if (canDecayBlock(blockID))
{ {
world.setBlock(x, y, z, properties.LimboBlockID); world.setBlock(x, y, z, properties.LimboBlockID);
return true; return true;
@@ -125,14 +125,14 @@ public class LimboDecay {
/** /**
* Checks if a block can be decayed and, if so, changes it to the next block ID along the decay sequence. * Checks if a block can be decayed and, if so, changes it to the next block ID along the decay sequence.
*/ */
private static boolean DecayBlock(World world, int x, int y, int z) private static boolean decayBlock(World world, int x, int y, int z)
{ {
//Make sure the decay sequence is initialized //Make sure the decay sequence is initialized
InitializeDecaySequence(); initializeDecaySequence();
int index; int index;
int blockID = world.getBlockId(x, y, z); int blockID = world.getBlockId(x, y, z);
if (CanDecayBlock(blockID)) if (canDecayBlock(blockID))
{ {
//Loop over the block IDs that decay can go through. //Loop over the block IDs that decay can go through.
//Find an index matching the current blockID, if any. //Find an index matching the current blockID, if any.
@@ -159,7 +159,7 @@ public class LimboDecay {
/** /**
* Checks if a block can decay. We will not decay air, Unraveled Fabric, Eternal Fabric, or containers. * Checks if a block can decay. We will not decay air, Unraveled Fabric, Eternal Fabric, or containers.
*/ */
private static boolean CanDecayBlock(int blockID) private static boolean canDecayBlock(int blockID)
{ {
if (blockID == 0 || blockID == properties.LimboBlockID || blockID == properties.PermaFabricBlockID) if (blockID == 0 || blockID == properties.LimboBlockID || blockID == properties.PermaFabricBlockID)
return false; return false;

View File

@@ -56,7 +56,7 @@ public class BlockLimbo extends Block
//Make sure this block is in Limbo //Make sure this block is in Limbo
if (world.provider.dimensionId == limboDimensionID) if (world.provider.dimensionId == limboDimensionID)
{ {
LimboDecay.ApplySpreadDecay(world, x, y, z); LimboDecay.applySpreadDecay(world, x, y, z);
} }
} }
} }