Various Fixes #127

Merged
SenseiKiwi merged 9 commits from master into master 2014-01-19 06:07:38 +00:00
Showing only changes of commit a1a5c0908a - Show all commits

View File

@@ -36,6 +36,8 @@ public class TileEntityRift extends TileEntity
private static final int MAX_ANCESTOR_LINKS = 3; private static final int MAX_ANCESTOR_LINKS = 3;
private static final int ENDERMAN_SPAWNING_CHANCE = 1; private static final int ENDERMAN_SPAWNING_CHANCE = 1;
private static final int MAX_ENDERMAN_SPAWNING_CHANCE = 32; private static final int MAX_ENDERMAN_SPAWNING_CHANCE = 32;
private static final int RIFT_SPREAD_CHANCE = 1;
private static final int MAX_RIFT_SPREAD_CHANCE = 256;
private static Random random = new Random(); private static Random random = new Random();
@@ -299,20 +301,13 @@ public class TileEntityRift extends TileEntity
public void grow(DDProperties properties) public void grow(DDProperties properties)
{ {
if (worldObj.isRemote || hasGrownRifts || !properties.RiftSpreadEnabled || random.nextInt(5) == 0) if (worldObj.isRemote || hasGrownRifts || !properties.RiftSpreadEnabled
|| random.nextInt(MAX_RIFT_SPREAD_CHANCE) < RIFT_SPREAD_CHANCE)
{ {
return; return;
} }
NewDimData dimension = PocketManager.getDimensionData(worldObj); NewDimData dimension = PocketManager.getDimensionData(worldObj);
if(random.nextInt(dimension.findRiftsInRange(this.worldObj, 5, xCoord, yCoord, zCoord).size()+1)<2)
{
if(random.nextInt(7)!=0)
{
return;
}
}
DimLink link = dimension.getLink(xCoord, yCoord, zCoord); DimLink link = dimension.getLink(xCoord, yCoord, zCoord);
if (countAncestorLinks(link) > MAX_ANCESTOR_LINKS) if (countAncestorLinks(link) > MAX_ANCESTOR_LINKS)
@@ -320,8 +315,11 @@ public class TileEntityRift extends TileEntity
return; return;
} }
//FIXME: This condition would prevent people from creating rooms of densely packed rifts... ~SenseiKiwi // The probability of rifts trying to spread increases if more rifts are nearby
if (updateNearestRift()) // Players should see rifts spread faster within clusters than at the edges of clusters
// Also, single rifts CANNOT spread.
int nearRifts = dimension.findRiftsInRange(this.worldObj, 5, xCoord, yCoord, zCoord).size();
if (nearRifts == 0 || random.nextInt(nearRifts) == 0)
{ {
return; return;
} }
@@ -343,7 +341,7 @@ public class TileEntityRift extends TileEntity
{ {
dimension.createChildLink(x, y, z, link); dimension.createChildLink(x, y, z, link);
hasGrownRifts = true; hasGrownRifts = true;
return; break;
} }
else else
{ {