mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-16 01:55:15 +00:00
You can no longer summon a Guardian of Gaia if there's already one nearby.
This commit is contained in:
1 parent
39bf519f57
commit
682bd491f1
1 file changed
+10
@@ -202,6 +202,10 @@ public class EntityDoppleganger extends EntityLiving implements IBotaniaBoss {
|
||||
return false;
|
||||
}
|
||||
|
||||
int guardians = getGaiaGuardiansAround(world, pos);
|
||||
if(guardians > 0)
|
||||
return false;
|
||||
|
||||
if(world.isRemote)
|
||||
return true;
|
||||
|
||||
@@ -503,6 +507,12 @@ public class EntityDoppleganger extends EntityLiving implements IBotaniaBoss {
|
||||
return worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(source.getX() + 0.5 - range, source.getY() + 0.5 - range, source.getZ() + 0.5 - range, source.getX() + 0.5 + range, source.getY() + 0.5 + range, source.getZ() + 0.5 + range));
|
||||
}
|
||||
|
||||
private static int getGaiaGuardiansAround(World worldObj, BlockPos source) {
|
||||
float range = 15F;
|
||||
List l = worldObj.getEntitiesWithinAABB(EntityDoppleganger.class, new AxisAlignedBB(source.getX() + 0.5 - range, source.getY() + 0.5 - range, source.getZ() + 0.5 - range, source.getX() + 0.5 + range, source.getY() + 0.5 + range, source.getZ() + 0.5 + range));
|
||||
return l.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLivingUpdate() {
|
||||
super.onLivingUpdate();
|
||||
|
||||
Reference in new issue
Block a user