fixed arena transfer with empty inventory slots and blocked advancements in the arena

This commit is contained in:
MineTec committed 2026-10-15 22:42:03 +02:00
1 parent 8b616ba2a2
commit 65c48eae45
4 files changed
+24 -3

No files matched your search

@@ -373,6 +373,7 @@ public class Arena extends Appliance {
new FightListener(),
new WorldProtectionListener(),
new ModeMenuListener(),
new NoProgressListener(),
new PlayerInteractAtEntityEventListener(villager, event -> this.sendToCraftAttack(event.getPlayer())),
new DismissInventoryOpenFromHolder(villager)
);
@@ -39,6 +39,7 @@ final class ArenaWorlds {
world.setGameRule(GameRules.SPAWN_WARDENS, false);
world.setGameRule(GameRules.RAIDS, false);
world.setGameRule(GameRules.SHOW_DEATH_MESSAGES, false);
world.setGameRule(GameRules.SHOW_ADVANCEMENT_MESSAGES, false);
world.setStorm(false);
world.setThundering(false);
world.setTime(6000);
@@ -0,0 +1,21 @@
package eu.mhsl.craftattack.spawn.arena.appliances.arena;
import com.destroystokyo.paper.event.player.PlayerAdvancementCriterionGrantEvent;
import eu.mhsl.craftattack.spawn.core.appliance.ApplianceListener;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerRecipeDiscoverEvent;
/**
* Nothing done in the arena counts as progress: no advancements, no recipe unlocks.
*/
class NoProgressListener extends ApplianceListener<Arena> {
@EventHandler
public void onCriterion(PlayerAdvancementCriterionGrantEvent event) {
event.setCancelled(true);
}
@EventHandler
public void onRecipe(PlayerRecipeDiscoverEvent event) {
event.setCancelled(true);
}
}