Skip to content

Commit

Permalink
Fixed IncompatibleClassChangeError on entity kills for MC 1.21.1 and …
Browse files Browse the repository at this point in the history
…earlier
  • Loading branch information
Intelli committed Nov 5, 2024
1 parent 9958d37 commit 011865d
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.bukkit.Color;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Registry;
import org.bukkit.World;
import org.bukkit.attribute.Attributable;
import org.bukkit.attribute.Attribute;
Expand Down Expand Up @@ -64,6 +65,8 @@
import org.bukkit.inventory.meta.LeatherArmorMeta;
import org.bukkit.projectiles.ProjectileSource;

import com.google.common.collect.Lists;

import net.coreprotect.CoreProtect;
import net.coreprotect.bukkit.BukkitAdapter;
import net.coreprotect.config.Config;
Expand Down Expand Up @@ -283,8 +286,7 @@ else if (entity instanceof Player) {

if (entity instanceof Attributable) {
Attributable attributable = entity;

for (Attribute attribute : Attribute.values()) {
for (Attribute attribute : Lists.newArrayList(Registry.ATTRIBUTE)) {
AttributeInstance attributeInstance = attributable.getAttribute(attribute);
if (attributeInstance != null) {
List<Object> attributeData = new ArrayList<>();
Expand Down

0 comments on commit 011865d

Please sign in to comment.