Skip to content

Commit

Permalink
Merge branch '1.14' into 1.15
Browse files Browse the repository at this point in the history
  • Loading branch information
Thutmose committed Jun 3, 2020
2 parents 2eca9d2 + f75ba17 commit 3c2f7b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import net.minecraft.entity.item.ItemEntity;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.world.server.ServerWorld;
import pokecube.core.PokecubeCore;
import pokecube.core.ai.brain.MemoryModules;
import thut.api.entity.BreedableCaps;
import thut.api.entity.IBreedingMob;
Expand All @@ -42,8 +41,7 @@ private boolean isValid(final AgeableEntity entityIn, final AgeableEntity otherA
protected void update(final ServerWorld worldIn, final LivingEntity entityIn)
{
final double s = 16;
if (!TerrainManager.isAreaLoaded(entityIn.dimension, entityIn.getPosition(), PokecubeCore
.getConfig().movementPauseThreshold + s)) return;
if (!TerrainManager.isAreaLoaded(entityIn.dimension, entityIn.getPosition(), 8 + s)) return;
final List<AgeableEntity> mates = Lists.newArrayList();
final List<ItemEntity> items = Lists.newArrayList();
final List<LivingEntity> mobs = Lists.newArrayList();
Expand Down
11 changes: 5 additions & 6 deletions src/main/java/pokecube/core/ai/brain/sensors/NearBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,16 @@ protected void update(final ServerWorld worldIn, final LivingEntity entityIn)
if (BrainUtils.hasMoveUseTarget(entityIn)) return;
this.tick++;
if (this.tick % PokecubeCore.getConfig().nearBlockUpdateRate != 0) return;
if (!TerrainManager.isAreaLoaded(entityIn.dimension, entityIn.getPosition(), PokecubeCore
.getConfig().movementPauseThreshold)) return;
final IPokemob pokemob = CapabilityPokemob.getPokemobFor(entityIn);
final boolean gathering = pokemob != null && pokemob.isPlayerOwned() && pokemob.isRoutineEnabled(
AIRoutine.GATHER) && this.tameCheck(pokemob);
final int size = gathering ? 15 : 8;
if (!TerrainManager.isAreaLoaded(entityIn.dimension, entityIn.getPosition(), size + 8)) return;

final Vector3 r = Vector3.getNewVector(), rAbs = Vector3.getNewVector();
final Vector3 origin = Vector3.getNewVector();
origin.set(entityIn);
final List<NearBlock> list = Lists.newArrayList();
final IPokemob pokemob = CapabilityPokemob.getPokemobFor(entityIn);
final boolean gathering = pokemob != null && pokemob.isPlayerOwned() && pokemob.isRoutineEnabled(
AIRoutine.GATHER) && this.tameCheck(pokemob);
final int size = gathering ? 15 : 8;

final Vec3d start = entityIn.getEyePosition(1);

Expand Down

0 comments on commit 3c2f7b2

Please sign in to comment.