mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-24 17:39:30 +00:00
修复缺少玩家参数问题
This commit is contained in:
@@ -55,7 +55,6 @@ public class BukkitVanillaLootManager extends AbstractVanillaLootManager impleme
|
||||
HandlerList.unregisterAll(this);
|
||||
}
|
||||
|
||||
@SuppressWarnings("UnstableApiUsage")
|
||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
|
||||
public void onEntityDeath(EntityDeathEvent event) {
|
||||
Entity entity = event.getEntity();
|
||||
|
||||
@@ -121,8 +121,10 @@ public final class BlockStateGenerator {
|
||||
if (!item.isEmpty()) {
|
||||
lootBuilder.withParameter(DirectContextParameters.ITEM_IN_HAND, item);
|
||||
}
|
||||
|
||||
BukkitServerPlayer player = optionalPlayer != null ? BukkitCraftEngine.instance().adapt(FastNMS.INSTANCE.method$ServerPlayer$getBukkitEntity(optionalPlayer)) : null;
|
||||
if (player != null) {
|
||||
lootBuilder.withParameter(DirectContextParameters.PLAYER, player);
|
||||
}
|
||||
Float radius = (Float) FastNMS.INSTANCE.method$LootParams$Builder$getOptionalParameter(builder, MLootContextParams.EXPLOSION_RADIUS);
|
||||
if (radius != null) {
|
||||
lootBuilder.withParameter(DirectContextParameters.EXPLOSION_RADIUS, radius);
|
||||
|
||||
Reference in New Issue
Block a user