Updated RitualEffectGrowth to support non-standard farms
Updated RitualEffectGrowth's y range from a static value to scaling with the range. This is to add support for mods such as agricraft, in which crops aren't always only on top of soil.
This commit is contained in:
parent
789b3c2afb
commit
63c7d16edc
1 changed files with 18 additions and 9 deletions
|
@ -55,9 +55,12 @@ public class RitualEffectGrowth extends RitualEffect
|
||||||
{
|
{
|
||||||
for (int j = -hydrationRange; j <= hydrationRange; j++)
|
for (int j = -hydrationRange; j <= hydrationRange; j++)
|
||||||
{
|
{
|
||||||
|
for (int k = -hydrationRange; k <= hydrationRange; k++)
|
||||||
|
{
|
||||||
|
|
||||||
if (this.canDrainReagent(ritualStone, ReagentRegistry.aquasalusReagent, aquasalusDrain, false))
|
if (this.canDrainReagent(ritualStone, ReagentRegistry.aquasalusReagent, aquasalusDrain, false))
|
||||||
{
|
{
|
||||||
if (SpellHelper.hydrateSoil(world, x + i, y + 1, z + j))
|
if (SpellHelper.hydrateSoil(world, x + i, y + k, z + j))
|
||||||
{
|
{
|
||||||
this.canDrainReagent(ritualStone, ReagentRegistry.aquasalusReagent, aquasalusDrain, true);
|
this.canDrainReagent(ritualStone, ReagentRegistry.aquasalusReagent, aquasalusDrain, true);
|
||||||
}
|
}
|
||||||
|
@ -65,6 +68,7 @@ public class RitualEffectGrowth extends RitualEffect
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int flag = 0;
|
int flag = 0;
|
||||||
|
|
||||||
|
@ -73,18 +77,23 @@ public class RitualEffectGrowth extends RitualEffect
|
||||||
{
|
{
|
||||||
for (int j = -range; j <= range; j++)
|
for (int j = -range; j <= range; j++)
|
||||||
{
|
{
|
||||||
Block block = world.getBlock(x + i, y + 2, z + j);
|
|
||||||
|
for (int k = -range; k <= range; k++)
|
||||||
|
{
|
||||||
|
|
||||||
|
Block block = world.getBlock(x + i, y + k, z + j);
|
||||||
|
|
||||||
if (block instanceof IPlantable || block instanceof IGrowable)
|
if (block instanceof IPlantable || block instanceof IGrowable)
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
SpellHelper.sendIndexedParticleToAllAround(world, x, y, z, 20, world.provider.dimensionId, 3, x, y, z);
|
SpellHelper.sendIndexedParticleToAllAround(world, x, y, z, 20, world.provider.dimensionId, 3, x, y, z);
|
||||||
block.updateTick(world, x + i, y + 2, z + j, world.rand);
|
block.updateTick(world, x + i, y + k, z + j, world.rand);
|
||||||
flag++;
|
flag++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (flag > 0)
|
if (flag > 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue