Commit 6f80056e authored by Richard Nicholson's avatar Richard Nicholson

Aggressive Pets Attacking Farmable Fix

Fixed a bug where pets set to aggressive would attack some mobs that don't target the player.
Higher level Equipment Pieces can now be placed into lower level Forges but will be instantly downgraded.
Rocs now spawn in Forest tagged biomes.
Updated to the latest forge 27.0.49.
parent 9e9209ab
......@@ -51,7 +51,7 @@ minecraft {
}
dependencies {
minecraft 'net.minecraftforge:forge:1.14.3-27.0.22'
minecraft 'net.minecraftforge:forge:1.14.3-27.0.49'
// Examples
// compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
......
......@@ -80,8 +80,9 @@ public class GameEventListener {
@SubscribeEvent
public void onPlayerClone(PlayerEvent.Clone event) {
ExtendedPlayer extendedPlayer = ExtendedPlayer.getForPlayer(event.getOriginal());
if(extendedPlayer != null)
extendedPlayer.backupPlayer();
if(extendedPlayer != null) {
extendedPlayer.backupPlayer();
}
}
......
......@@ -40,13 +40,13 @@ public class EquipmentSlot extends BaseSlot {
return this.type.equals(equipmentPart.slotType) && equipmentPart.levelMin <= this.containerForge.equipmentForge.getLevel();
}
else if(item instanceof ItemEquipment) {
if(this.containerForge.equipmentForge.getLevel() < 3) {
/*if(this.containerForge.equipmentForge.getLevel() < 3) {
ItemEquipment equipment = (ItemEquipment)item;
int equipmentLevel = equipment.getHighestLevel(itemStack);
if(equipmentLevel > this.containerForge.equipmentForge.getLevel()) {
return false;
}
}
}*/
return this.type.equals("piece") && !this.getHasStack();
}
return false;
......
......@@ -341,7 +341,7 @@ public abstract class BaseCreatureEntity extends CreatureEntity {
public List<ItemDrop> savedDrops = new ArrayList<>();
// Override AI:
public FindAttackTargetGoal aiTargetPlayer = new FindAttackTargetGoal(this).addTargets(EntityType.PLAYER);
public FindAttackTargetGoal aiTargetPlayer = null;
public RevengeGoal aiDefendAnimals = new RevengeGoal(this).setHelpClasses(AnimalEntity.class);
/**
......@@ -2672,8 +2672,9 @@ public abstract class BaseCreatureEntity extends CreatureEntity {
/** Returns true if this creature is hostile to the provided entity. **/
public boolean isHostileTo(Entity target) {
if(this.hostileTargets.contains(target.getType()))
return true;
if(this.hostileTargets.contains(target.getType())) {
return true;
}
for(CreatureGroup group : this.creatureInfo.getGroups()) {
if(group.shouldHunt(target) || group.shouldPackHunt(target)) {
return true;
......
package com.lycanitesmobs.core.entity.goals.actions;
import com.lycanitesmobs.LycanitesMobs;
import com.lycanitesmobs.core.entity.BaseCreatureEntity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.ai.goal.Goal;
......
package com.lycanitesmobs.core.entity.goals.actions;
import com.lycanitesmobs.LycanitesMobs;
import com.lycanitesmobs.core.entity.AgeableCreatureEntity;
import com.lycanitesmobs.core.entity.BaseCreatureEntity;
import com.lycanitesmobs.core.entity.TameableCreatureEntity;
......
package com.lycanitesmobs.core.entity.goals.targeting;
import com.lycanitesmobs.LycanitesMobs;
import com.lycanitesmobs.api.Targeting;
import com.lycanitesmobs.core.entity.BaseCreatureEntity;
import com.lycanitesmobs.core.entity.TameableCreatureEntity;
......@@ -97,9 +98,9 @@ public class DefendOwnerGoal extends TargetingGoal {
else if(target instanceof MobEntity && ((MobEntity)target).getAttackTarget() == this.getOwner()) {
return true;
}
else if(target.getRevengeTarget() == this.getOwner()) {
return true;
}
else if(target.getRevengeTarget() == this.getOwner()) {
return true;
}
return false;
}
......
package com.lycanitesmobs.core.info;
import com.lycanitesmobs.core.entity.BaseCreatureEntity;
import com.lycanitesmobs.core.entity.goals.targeting.FindAttackTargetGoal;
import net.minecraft.entity.EntityType;
import net.minecraft.nbt.CompoundNBT;
public class ExtraMobBehaviour {
......@@ -143,6 +145,9 @@ public class ExtraMobBehaviour {
this.aiAttackPlayers = nbtTagCompound.getBoolean("AIAttackPlayers");
this.host.targetSelector.removeGoal(this.host.aiTargetPlayer);
if(this.aiAttackPlayers) {
if(this.host.aiTargetPlayer == null) {
this.host.aiTargetPlayer = new FindAttackTargetGoal(this.host).addTargets(EntityType.PLAYER);
}
this.host.targetSelector.addGoal(9, this.host.aiTargetPlayer);
}
}
......
......@@ -485,7 +485,7 @@ public class Spawner {
if(entityLiving instanceof MobEntity) {
canSpawn = ForgeEventFactory.canEntitySpawn((MobEntity)entityLiving, world, (float) spawnPos.getX() + 0.5F, (float) spawnPos.getY(), (float) spawnPos.getZ() + 0.5F, null);
if (canSpawn == Event.Result.DENY && !this.ignoreForgeCanSpawnEvent && !mobSpawn.ignoreForgeCanSpawnEvent) {
LycanitesMobs.logDebug("JSONSpawner", "Spawn Check Failed! Spawning blocked by Forge Can Spawn Event, this is caused another mod.");
LycanitesMobs.logDebug("JSONSpawner", "Spawn Check Failed! Spawning blocked by Forge Can Spawn Event, this is caused by another mod.");
continue;
}
}
......
......@@ -15,7 +15,7 @@
"dimensionIds": [-1, 1],
"dimensionListType": "blacklist",
"ignoreBiome": false,
"biomes": ["plains", "savanna", "-snowy"],
"biomes": ["plains", "savanna", "forest", "-snowy"],
"spawnWeight": 16,
"dungeonWeight": 200,
"spawnAreaLimit": 2,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment