diff --git a/Changelog.txt b/Changelog.txt index 7bd3ebc48..ebeff8659 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -29,6 +29,7 @@ Version 1.5.01-dev + Added magical mod config file import command, for Cauldron 1.7+. Check wiki for usage + Added particle effects and sounds to "Call of the Wild" (Taming) + Added summon length to "Call of the Wild". Summons will now commit suicide after their lifespan expires + + Added feature which makes tamed wolves attack a target shot by the owner = Fixed bug where pistons would mess with the block tracking = Fixed bug where the Updater was running on the main thread. = Fixed bug when players would use /ptp without being in a party diff --git a/src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java b/src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java index 0d245a482..6016ac2fa 100644 --- a/src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java +++ b/src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java @@ -228,6 +228,25 @@ public class TamingManager extends SkillManager { } } + public void attackTarget(LivingEntity target) { + double range = 5; + Player player = getPlayer(); + + for (Entity entity : player.getNearbyEntities(range, range, range)) { + if (entity.getType() != EntityType.WOLF) { + continue; + } + + Wolf wolf = (Wolf) entity; + + if (!wolf.isTamed() || (wolf.getOwner() != player) || wolf.isSitting()) { + continue; + } + + wolf.setTarget(target); + } + } + /** * Handle the Call of the Wild ability. * diff --git a/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java b/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java index 19278aa29..cba0ef139 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java @@ -283,6 +283,12 @@ public final class CombatUtils { if (!Misc.isNPCEntity(player) && SkillType.ARCHERY.getPermissions(player)) { processArcheryCombat(target, player, event, arrow); } + + if (target.getType() != EntityType.CREEPER && !Misc.isNPCEntity(player) && SkillType.TAMING.getPermissions(player)) { + McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player); + TamingManager tamingManager = mcMMOPlayer.getTamingManager(); + tamingManager.attackTarget(target); + } } }