mirror of
https://github.com/GTNewHorizons/BloodMagic.git
synced 2026-11-18 19:29:34 +00:00
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:
1 parent
789b3c2afb
commit
63c7d16edc
1 file changed
+18
-9
@@ -55,11 +55,15 @@ public class RitualEffectGrowth extends RitualEffect
|
||||
{
|
||||
for (int j = -hydrationRange; j <= hydrationRange; j++)
|
||||
{
|
||||
if (this.canDrainReagent(ritualStone, ReagentRegistry.aquasalusReagent, aquasalusDrain, false))
|
||||
for (int k = -hydrationRange; k <= hydrationRange; k++)
|
||||
{
|
||||
if (SpellHelper.hydrateSoil(world, x + i, y + 1, z + j))
|
||||
|
||||
if (this.canDrainReagent(ritualStone, ReagentRegistry.aquasalusReagent, aquasalusDrain, false))
|
||||
{
|
||||
this.canDrainReagent(ritualStone, ReagentRegistry.aquasalusReagent, aquasalusDrain, true);
|
||||
if (SpellHelper.hydrateSoil(world, x + i, y + k, z + j))
|
||||
{
|
||||
this.canDrainReagent(ritualStone, ReagentRegistry.aquasalusReagent, aquasalusDrain, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -73,14 +77,19 @@ public class RitualEffectGrowth extends RitualEffect
|
||||
{
|
||||
for (int j = -range; j <= range; j++)
|
||||
{
|
||||
Block block = world.getBlock(x + i, y + 2, z + j);
|
||||
|
||||
if (block instanceof IPlantable || block instanceof IGrowable)
|
||||
|
||||
for (int k = -range; k <= range; k++)
|
||||
{
|
||||
|
||||
Block block = world.getBlock(x + i, y + k, z + j);
|
||||
|
||||
if (block instanceof IPlantable || block instanceof IGrowable)
|
||||
{
|
||||
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);
|
||||
flag++;
|
||||
{
|
||||
SpellHelper.sendIndexedParticleToAllAround(world, x, y, z, 20, world.provider.dimensionId, 3, x, y, z);
|
||||
block.updateTick(world, x + i, y + k, z + j, world.rand);
|
||||
flag++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user