From 7ec843ba17bdc86049c363eb9127cfe5401d7af8 Mon Sep 17 00:00:00 2001 From: Flo56958 Date: Fri, 6 Oct 2023 01:08:57 +0200 Subject: [PATCH] Directing: Fix XP-Orb spawning with 0 xp --- .../java/de/flo56958/minetinker/modifiers/types/Directing.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/de/flo56958/minetinker/modifiers/types/Directing.java b/src/main/java/de/flo56958/minetinker/modifiers/types/Directing.java index 57478259..8f62a5c0 100644 --- a/src/main/java/de/flo56958/minetinker/modifiers/types/Directing.java +++ b/src/main/java/de/flo56958/minetinker/modifiers/types/Directing.java @@ -120,6 +120,7 @@ public void effect(MTBlockBreakEvent event) { if (this.workOnXP && modManager.getModLevel(tool, this) >= this.minimumLevelForXP) { //Spawn Experience Orb as adding it directly to the player would prevent Mending from working + if (event.getEvent().getExpToDrop() <= 0) return; ExperienceOrb orb = (ExperienceOrb) player.getWorld().spawnEntity(player.getLocation(), EntityType.EXPERIENCE_ORB); orb.setExperience(event.getEvent().getExpToDrop()); event.getEvent().setExpToDrop(0); @@ -222,6 +223,7 @@ public void effect(MTEntityDeathEvent event) { if (this.workOnXP && modManager.getModLevel(tool, this) >= this.minimumLevelForXP) { //Spawn Experience Orb as adding it directly to the player would prevent Mending from working + if (event.getEvent().getDroppedExp() <= 0) return; ExperienceOrb orb = (ExperienceOrb) player.getWorld().spawnEntity(player.getLocation(), EntityType.EXPERIENCE_ORB); orb.setExperience(event.getEvent().getDroppedExp()); event.getEvent().setDroppedExp(0);