Jakllp / MyPet

This is not the main project - Please visit https://github.com/MyPetORG/MyPet
https://www.spigotmc.org/resources/mypet.12725/
GNU Lesser General Public License v3.0
14 stars 8 forks source link

Bug: Attack-System not working properly? #39

Closed Jakllp closed 3 years ago

Jakllp commented 3 years ago

I believe that the attack-system isn't like it used to be.

Dev pls fix (had to do that at some point)

It might also be working as intended - need to find out

Jakllp commented 3 years ago

Confirmed - Only Combat SkillTree actually engages in combat and then the enemy throws:

java.lang.NullPointerException: Cannot invoke "net.minecraft.world.entity.ai.attributes.AttributeProvider.a(java.util.function.Consumer, net.minecraft.world.entity.ai.attributes.AttributeBase)" because "this.d" is null
    at net.minecraft.world.entity.ai.attributes.AttributeMapBase.lambda$getInstance$1(AttributeMapBase.java:50) ~[patched_1.17.1.jar:git-Paper-231]
    at java.util.HashMap.computeIfAbsent(HashMap.java:1224) ~[?:?]
    at net.minecraft.world.entity.ai.attributes.AttributeMapBase.a(AttributeMapBase.java:49) ~[patched_1.17.1.jar:git-Paper-231]
    at org.bukkit.craftbukkit.v1_17_R1.attribute.CraftAttributeMap.getAttribute(CraftAttributeMap.java:36) ~[patched_1.17.1.jar:git-Paper-231]
    at org.bukkit.craftbukkit.v1_17_R1.entity.CraftLivingEntity.getAttribute(CraftLivingEntity.java:722) ~[patched_1.17.1.jar:git-Paper-231]
    at org.bukkit.craftbukkit.v1_17_R1.event.CraftEventFactory.populateFields(CraftEventFactory.java:911) ~[patched_1.17.1.jar:git-Paper-231]
    at org.bukkit.craftbukkit.v1_17_R1.event.CraftEventFactory.callEntityDeathEvent(CraftEventFactory.java:856) ~[patched_1.17.1.jar:git-Paper-231]
    at org.bukkit.craftbukkit.v1_17_R1.event.CraftEventFactory.callEntityDeathEvent(CraftEventFactory.java:850) ~[patched_1.17.1.jar:git-Paper-231]
    at de.Keyle.MyPet.compat.v1_17_R1.entity.EntityMyPet.d(EntityMyPet.java:1419) ~[MyPet-3.12-dev10.jar:?]
    at net.minecraft.world.entity.EntityLiving.damageEntity(EntityLiving.java:1460) ~[patched_1.17.1.jar:git-Paper-231]
    at net.minecraft.world.entity.EntityInsentient.attackEntity(EntityInsentient.java:1560) ~[patched_1.17.1.jar:git-Paper-231]
    at net.minecraft.world.entity.monster.EntityZombie.attackEntity(EntityZombie.java:361) ~[patched_1.17.1.jar:git-Paper-231]
    at net.minecraft.world.entity.ai.goal.PathfinderGoalMeleeAttack.a(PathfinderGoalMeleeAttack.java:142) ~[patched_1.17.1.jar:git-Paper-231]
    at net.minecraft.world.entity.ai.goal.PathfinderGoalMeleeAttack.e(PathfinderGoalMeleeAttack.java:134) ~[patched_1.17.1.jar:git-Paper-231]
    at net.minecraft.world.entity.ai.goal.PathfinderGoalZombieAttack.e(PathfinderGoalZombieAttack.java:28) ~[patched_1.17.1.jar:git-Paper-231]
    at net.minecraft.world.entity.ai.goal.PathfinderGoalWrapped.e(PathfinderGoalWrapped.java:53) ~[patched_1.17.1.jar:git-Paper-231]
    at net.minecraft.world.entity.ai.goal.PathfinderGoalSelector.doTick(PathfinderGoalSelector.java:151) ~[patched_1.17.1.jar:git-Paper-231]
    at net.minecraft.world.entity.EntityInsentient.doTick(EntityInsentient.java:839) ~[patched_1.17.1.jar:git-Paper-231]
    at net.minecraft.world.entity.EntityLiving.movementTick(EntityLiving.java:3155) ~[patched_1.17.1.jar:git-Paper-231]
    at net.minecraft.world.entity.EntityInsentient.movementTick(EntityInsentient.java:625) ~[patched_1.17.1.jar:git-Paper-231]
    at net.minecraft.world.entity.monster.EntityMonster.movementTick(EntityMonster.java:43) ~[patched_1.17.1.jar:git-Paper-231]
    at net.minecraft.world.entity.monster.EntityZombie.movementTick(EntityZombie.java:266) ~[patched_1.17.1.jar:git-Paper-231]
    at net.minecraft.world.entity.EntityLiving.tick(EntityLiving.java:2881) ~[patched_1.17.1.jar:git-Paper-231]
    at net.minecraft.world.entity.EntityInsentient.tick(EntityInsentient.java:393) ~[patched_1.17.1.jar:git-Paper-231]
    at net.minecraft.world.entity.monster.EntityZombie.tick(EntityZombie.java:236) ~[patched_1.17.1.jar:git-Paper-231]
    at net.minecraft.server.level.WorldServer.entityJoinedWorld(WorldServer.java:904) ~[patched_1.17.1.jar:git-Paper-231]
    at net.minecraft.world.level.World.a(World.java:869) ~[patched_1.17.1.jar:git-Paper-231]
    at net.minecraft.server.level.WorldServer.lambda$tick$5(WorldServer.java:600) ~[patched_1.17.1.jar:git-Paper-231]
    at net.minecraft.world.level.entity.EntityTickList.a(EntityTickList.java:54) ~[patched_1.17.1.jar:git-Paper-231]
    at net.minecraft.server.level.WorldServer.doTick(WorldServer.java:581) ~[patched_1.17.1.jar:git-Paper-231]
    at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1568) ~[patched_1.17.1.jar:git-Paper-231]
    at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:479) ~[patched_1.17.1.jar:git-Paper-231]
    at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1421) ~[patched_1.17.1.jar:git-Paper-231]
    at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1203) ~[patched_1.17.1.jar:git-Paper-231]
    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:318) ~[patched_1.17.1.jar:git-Paper-231]
    at java.lang.Thread.run(Thread.java:831) [?:?]
Jakllp commented 3 years ago

Fixed that error locally - still no ranged attacks (Farm and Ride attack systems are broken - PvP and Combat work as they are only Melee)

Jakllp commented 3 years ago

Fixed in https://github.com/Jakllp/MyPet/commit/a6c890da7403fa4c499376b9e07db05a391f60e8