Fix bound blade not dropping blood shards if you kill in one hit (#141)

This commit is contained in:
koolkrafter5 authored and GitHub committed 2026-07-14 20:06:43 +02:00
1 parent acfbc0f8ff
commit 6f45c3efae
4 files changed
+30 -47

No files matched your search

@@ -4,12 +4,9 @@ import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
@@ -88,17 +85,6 @@ public class EnergySword extends ItemSword implements IBindable {
return !isActive;
}
@Override
public boolean hitEntity(ItemStack item, EntityLivingBase target, EntityLivingBase attacker) {
if (attacker instanceof EntityPlayer player && (!IBindable.checkAndSetItemOwner(item, player)
|| !EnergyItems.syphonBatteries(item, player, this.drainCost()))) {
return false;
}
target.addPotionEffect(new PotionEffect(Potion.weakness.id, 60, 2));
return true;
}
@Override
public ItemStack onItemRightClick(ItemStack item, World world, EntityPlayer player) {
super.onItemRightClick(item, world, player);