Reimplemented Limbo Decay

Reimplemented Limbo Decay in two forms. Firstly, Unraveled Fabric
accepts random ticks now and has a 50% chance of searching the 6 blocks
against its faces for blocks to decay. The average time for this decay
to occur is about 2 minutes and 17 seconds. The decay progresses a
little slowly because of having to go through stages. We might want to
consider decaying straight into Unraveled Fabric, or at least having
fewer stages. This approach is better than randomly decaying isolated
blocks because it looks like decay is spreading from the Unraveled
Fabric.

Secondly, every tick, we pick a random block from each active section in
Limbo and turn it into Unraveled Fabric immediately. Note that a section
is a 16x16x16 block cube inside a chunk. This is "fast decay", and it's
meant to stop players from avoiding Limbo decay by building floating
structures. It's not immediately obvious if you place a single block,
but if you build a 5x5 block platform, the average time for some block
to get converted drops to about 8 seconds, and it spreads from there.

Most of the logic for this is in a new class: LimboDecay. It's worth
studying whether this new implementation affects Minecraft's
performance. I'm not completely sure whether that would be an issue. The
frequency of either decay type can be decreased to improve performance.
This commit is contained in:
SenseiKiwi
2013-07-25 17:25:43 -04:00
parent 9da6304dc9
commit d923e98942
4 changed files with 200 additions and 7 deletions

View File

@@ -23,6 +23,7 @@ public class CommonTickHandler implements ITickHandler
private static final Random rand = new Random();
public static final int MAX_MONOLITH_SPAWNING_CHANCE = 100;
private static final String label = "Dimensional Doors: Common Tick";
private static final int MAX_MONOLITH_SPAWN_Y = 245;
private static final int CHUNK_SIZE = 16;
private static final int RIFT_REGENERATION_INTERVAL = 100; //Regenerate random rifts every 100 ticks
@@ -78,7 +79,7 @@ public class CommonTickHandler implements ITickHandler
@Override
public String getLabel()
{
return null;
return label; //Used for profiling!
}
private void placeMonolithsInPockets(int worldID, int chunkX, int chunkZ)
@@ -212,13 +213,14 @@ public class CommonTickHandler implements ITickHandler
private void onServerTick()
{
tickCount++; //There is no need to reset the counter. Let it overflow.
tickCount++; //There is no need to reset the counter. Let it overflow. Really.
if (tickCount % RIFT_REGENERATION_INTERVAL == 0)
{
regenerateRifts();
}
LimboDecay.ApplyRandomFastDecay();
if (mod_pocketDim.teleTimer > 0)
{
@@ -230,7 +232,7 @@ public class CommonTickHandler implements ITickHandler
{
try
{
//Replace rifts that have been replaced (not permanently removed) by players
//Regenerate rifts that have been replaced (not permanently removed) by players
int i = 0;