99package vazkii .botania .common .item .equipment .tool .elementium ;
1010
1111import net .minecraft .resources .ResourceLocation ;
12- import net .minecraft .server .level .ServerLevel ;
13- import net .minecraft .world .damagesource .DamageSource ;
1412import net .minecraft .world .entity .EquipmentSlot ;
1513import net .minecraft .world .entity .LivingEntity ;
16- import net .minecraft .world .entity .player .Player ;
1714import net .minecraft .world .item .ItemStack ;
1815import net .minecraft .world .item .enchantment .Enchantment ;
1916import net .minecraft .world .item .enchantment .Enchantments ;
20- import net .minecraft .world .level .storage .loot .LootParams ;
21- import net .minecraft .world .level .storage .loot .parameters .LootContextParamSets ;
22- import net .minecraft .world .level .storage .loot .parameters .LootContextParams ;
2317
2418import org .jetbrains .annotations .NotNull ;
2519
2620import vazkii .botania .api .BotaniaAPI ;
2721import vazkii .botania .common .annotations .SoftImplement ;
2822import vazkii .botania .common .item .equipment .tool .manasteel .ManasteelAxeItem ;
2923
30- import java .util .function .Consumer ;
31-
3224import static vazkii .botania .common .lib .ResourceLocationHelper .prefix ;
3325
3426public class ElementiumAxeItem extends ManasteelAxeItem {
@@ -38,23 +30,6 @@ public ElementiumAxeItem(Properties props) {
3830 super (BotaniaAPI .instance ().getElementiumItemTier (), 6F , -3.1F , props );
3931 }
4032
41- public static void onEntityDrops (boolean hitRecently , DamageSource source , LivingEntity target ,
42- Consumer <ItemStack > consumer ) {
43- LootParams .Builder ctx = (new LootParams .Builder ((ServerLevel ) target .level ()))
44- .withParameter (LootContextParams .THIS_ENTITY , target )
45- .withParameter (LootContextParams .ORIGIN , target .position ())
46- .withParameter (LootContextParams .DAMAGE_SOURCE , source )
47- .withOptionalParameter (LootContextParams .KILLER_ENTITY , source .getEntity ())
48- .withOptionalParameter (LootContextParams .DIRECT_KILLER_ENTITY , source .getDirectEntity ());
49-
50- if (hitRecently && target .getKillCredit () != null && target .getKillCredit () instanceof Player p ) {
51- ctx = ctx .withParameter (LootContextParams .LAST_DAMAGE_PLAYER , p ).withLuck (p .getLuck ());
52- }
53-
54- target .level ().getServer ().getLootData ().getLootTable (BEHEADING_LOOT_TABLE )
55- .getRandomItems (ctx .create (LootContextParamSets .ENTITY ), target .getLootTableSeed (), consumer );
56- }
57-
5833 @ SoftImplement ("IForgeItem" )
5934 public boolean canApplyAtEnchantingTable (ItemStack stack , Enchantment enchantment ) {
6035 if (enchantment == Enchantments .MOB_LOOTING ) {
0 commit comments