Fix cast error & update protocol lib

This commit is contained in:
Cola
2021-12-22 22:43:06 +00:00
parent 690ec97fe9
commit 0cf96b1b00
2 changed files with 3 additions and 2 deletions

View File

@@ -33,7 +33,7 @@ dependencies {
paperDevBundle("1.18-R0.1-SNAPSHOT")
compileOnly("net.civmc:civmodcore:2.0.0-SNAPSHOT:dev-all")
compileOnly("net.civmc.combattagplus:combattagplus-spigot:2.0.0-SNAPSHOT:dev")
compileOnly("com.comphenix.protocol:ProtocolLib:4.7.0")
compileOnly("com.comphenix.protocol:ProtocolLib:4.8.0-SNAPSHOT")
}
java {

View File

@@ -25,6 +25,7 @@ import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.craftbukkit.v1_18_R1.CraftWorld;
import org.bukkit.craftbukkit.v1_18_R1.entity.CraftLivingEntity;
import org.bukkit.entity.Damageable;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
@@ -91,7 +92,7 @@ public class AsyncPacketHandler extends PacketAdapter implements Listener {
return;
}
CombatUtil.attack(attacker, (net.minecraft.world.entity.LivingEntity) entityTarget);
CombatUtil.attack(attacker, ((CraftLivingEntity) entityTarget).getHandle());
}
}.runTask(Finale.getPlugin());
} else if (packetType == PacketType.Play.Client.ARM_ANIMATION) {