mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-22 10:57:43 +01:00
Add an option to fix MC-3304 (projectile looting)
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
--- a/net/minecraft/world/level/storage/loot/functions/EnchantedCountIncreaseFunction.java
|
||||
+++ b/net/minecraft/world/level/storage/loot/functions/EnchantedCountIncreaseFunction.java
|
||||
@@ -66,6 +_,11 @@
|
||||
Entity entity = context.getOptionalParameter(LootContextParams.ATTACKING_ENTITY);
|
||||
if (entity instanceof LivingEntity livingEntity) {
|
||||
int enchantmentLevel = EnchantmentHelper.getEnchantmentLevel(this.enchantment, livingEntity);
|
||||
+ // Purpur start - Add an option to fix MC-3304 projectile looting
|
||||
+ if (org.purpurmc.purpur.PurpurConfig.fixProjectileLootingTransfer && context.getOptionalParameter(LootContextParams.DIRECT_ATTACKING_ENTITY) instanceof net.minecraft.world.entity.projectile.AbstractArrow arrow) {
|
||||
+ enchantmentLevel = arrow.actualEnchantments.getLevel(this.enchantment);
|
||||
+ }
|
||||
+ // Purpur end - Add an option to fix MC-3304 projectile looting
|
||||
if (enchantmentLevel == 0) {
|
||||
return stack;
|
||||
}
|
||||
Reference in New Issue
Block a user