ExperienceOrbs API for Reason/Source/Triggering player
Adds lots of information about why this orb exists. Replaces isFromBottle() with logic that persists entity reloads too.
This commit is contained in:
@@ -65,7 +65,7 @@
|
||||
@Override
|
||||
public boolean mayPlace(ItemStack stack) {
|
||||
return stack.isDamageableItem() || EnchantmentHelper.hasAnyEnchantments(stack);
|
||||
@@ -68,7 +95,7 @@
|
||||
@@ -68,10 +95,10 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -73,7 +73,11 @@
|
||||
+ public void onTake(net.minecraft.world.entity.player.Player player, ItemStack stack) {
|
||||
context.execute((world, blockposition) -> {
|
||||
if (world instanceof ServerLevel) {
|
||||
ExperienceOrb.award((ServerLevel) world, Vec3.atCenterOf(blockposition), this.getExperienceAmount(world));
|
||||
- ExperienceOrb.award((ServerLevel) world, Vec3.atCenterOf(blockposition), this.getExperienceAmount(world));
|
||||
+ ExperienceOrb.award((ServerLevel) world, Vec3.atCenterOf(blockposition), this.getExperienceAmount(world), org.bukkit.entity.ExperienceOrb.SpawnReason.GRINDSTONE, player); // Paper
|
||||
}
|
||||
|
||||
world.levelEvent(1042, blockposition, 0);
|
||||
@@ -113,6 +140,7 @@
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user