Fixed Transdimensional Trapdoor and More #87
@@ -24,8 +24,9 @@ public class LimboDecay implements IRegularTickReceiver {
|
|||||||
//Provides a reversed list of the block IDs that blocks cycle through during decay.
|
//Provides a reversed list of the block IDs that blocks cycle through during decay.
|
||||||
private final int[] decaySequence;
|
private final int[] decaySequence;
|
||||||
|
|
||||||
private Random random;
|
private final Random random;
|
||||||
private DDProperties properties = null;
|
private final DDProperties properties;
|
||||||
|
private final int[] blocksImmuneToDecay;
|
||||||
|
|
||||||
public LimboDecay(IRegularTickSender tickSender, DDProperties properties)
|
public LimboDecay(IRegularTickSender tickSender, DDProperties properties)
|
||||||
{
|
{
|
||||||
@@ -36,6 +37,16 @@ public class LimboDecay implements IRegularTickReceiver {
|
|||||||
Block.stone.blockID
|
Block.stone.blockID
|
||||||
};
|
};
|
||||||
|
|
||||||
|
blocksImmuneToDecay = new int[] {
|
||||||
|
properties.LimboBlockID,
|
||||||
|
properties.PermaFabricBlockID,
|
||||||
|
properties.TransientDoorID,
|
||||||
|
properties.DimensionalDoorID,
|
||||||
|
properties.WarpDoorID,
|
||||||
|
properties.RiftBlockID,
|
||||||
|
properties.UnstableDoorID
|
||||||
|
};
|
||||||
|
|
||||||
this.properties = properties;
|
this.properties = properties;
|
||||||
this.random = new Random();
|
this.random = new Random();
|
||||||
tickSender.registerForTicking(this, LIMBO_DECAY_INTERVAL, false);
|
tickSender.registerForTicking(this, LIMBO_DECAY_INTERVAL, false);
|
||||||
@@ -151,12 +162,22 @@ public class LimboDecay implements IRegularTickReceiver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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, certain DD blocks, or containers.
|
||||||
*/
|
*/
|
||||||
private boolean canDecayBlock(int blockID)
|
private boolean canDecayBlock(int blockID)
|
||||||
{
|
{
|
||||||
if (blockID == 0 || blockID == properties.LimboBlockID || blockID == properties.PermaFabricBlockID)
|
if (blockID == 0)
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int k = 0; k < blocksImmuneToDecay.length; k++)
|
||||||
|
{
|
||||||
|
if (blockID == blocksImmuneToDecay[k])
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Block block = Block.blocksList[blockID];
|
Block block = Block.blocksList[blockID];
|
||||||
return (block == null || !(block instanceof BlockContainer));
|
return (block == null || !(block instanceof BlockContainer));
|
||||||
|
|||||||
Reference in New Issue
Block a user