mirror of
https://github.com/GTNewHorizons/MagicBees.git
synced 2026-11-12 08:17:29 +00:00
Fix #19 Transmuting Effect Causes Server Crash
This commit is contained in:
1 parent
2c5e6ca041
commit
8e11456ea3
3 files changed
+17
-17
No files matched your search
@@ -59,14 +59,14 @@ public class AlleleEffectCrumbling extends AlleleEffect
|
||||
{
|
||||
World world = housing.getWorld();
|
||||
// Get random coords within territory
|
||||
int xCoord = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[0]);
|
||||
xCoord = housing.getXCoord() + world.rand.nextInt(xCoord) - xCoord / 2;
|
||||
int yCoord = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[1]);
|
||||
yCoord = housing.getYCoord() + world.rand.nextInt(yCoord) - yCoord / 2;
|
||||
int zCoord = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[0]);
|
||||
zCoord = housing.getZCoord() + world.rand.nextInt(zCoord) - zCoord / 2;
|
||||
int xRange = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[0]);
|
||||
int yRange = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[1]);
|
||||
int zRange = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[2]);
|
||||
|
||||
int xCoord = housing.getXCoord() + world.rand.nextInt(xRange) - xRange / 2;
|
||||
int yCoord = housing.getYCoord() + world.rand.nextInt(yRange) - yRange / 2;
|
||||
int zCoord = housing.getZCoord() + world.rand.nextInt(zRange) - zRange / 2;
|
||||
|
||||
boolean success = false;
|
||||
Block block = world.getBlock(xCoord, yCoord, zCoord);
|
||||
if (block != null)
|
||||
{
|
||||
|
||||
@@ -29,12 +29,13 @@ public class AlleleEffectTransmuting extends AlleleEffect
|
||||
{
|
||||
World world = housing.getWorld();
|
||||
// Get random coords within territory
|
||||
int xCoord = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[0]);
|
||||
xCoord = housing.getXCoord() + world.rand.nextInt(xCoord) - xCoord / 2;
|
||||
int yCoord = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[1]);
|
||||
yCoord = housing.getYCoord() + world.rand.nextInt(yCoord) - yCoord / 2;
|
||||
int zCoord = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[0]);
|
||||
zCoord = housing.getZCoord() + world.rand.nextInt(zCoord) - zCoord / 2;
|
||||
int xRange = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[0]);
|
||||
int yRange = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[1]);
|
||||
int zRange = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[2]);
|
||||
|
||||
int xCoord = housing.getXCoord() + world.rand.nextInt(xRange) - xRange / 2;
|
||||
int yCoord = housing.getYCoord() + world.rand.nextInt(yRange) - yRange / 2;
|
||||
int zCoord = housing.getZCoord() + world.rand.nextInt(zRange) - zRange / 2;
|
||||
|
||||
BiomeGenBase biome = world.getBiomeGenForCoords(xCoord, zCoord);
|
||||
TransmutationEffectController.instance.attemptTransmutations(world, biome,
|
||||
|
||||
@@ -25,12 +25,11 @@ public class TransmutationEffectController implements ITransmutationEffectContro
|
||||
|
||||
public void attemptTransmutations(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z)
|
||||
{
|
||||
boolean done = false;
|
||||
int i = 0;
|
||||
boolean done;
|
||||
ITransmutationEffectLogic logic;
|
||||
while (!done && i < logicObjects.size())
|
||||
for (int i = 0; i < logicObjects.size(); i++)
|
||||
{
|
||||
logic = logicObjects.get(i++);
|
||||
logic = logicObjects.get(i);
|
||||
try
|
||||
{
|
||||
done = logic.tryTransmutation(world, biome, sourceBlock, x, y, z);
|
||||
|
||||
Reference in new issue
Block a user