SteamWar/FightSystem
Archiviert
13
1

Removing all crafting possibilitys

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2020-05-22 17:02:25 +02:00
Ursprung 0868a4eca9
Commit 7dc7fa1f41
3 geänderte Dateien mit 34 neuen und 20 gelöschten Zeilen

Datei anzeigen

@ -64,7 +64,7 @@ public class FightSystem extends JavaPlugin {
new TestListener();
new NormalJoinListener();
if(Core.getVersion() > 8)
new ArrowPickupListener();
new ExtendedInventoryListener();
new WinconditionAllDead();
new WinconditionCaptainDead();

Datei anzeigen

@ -1,19 +0,0 @@
package de.steamwar.fightsystem.listener;
import de.steamwar.fightsystem.states.FightState;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerPickupArrowEvent;
import java.util.EnumSet;
public class ArrowPickupListener extends BasicListener {
public ArrowPickupListener() {
super(EnumSet.allOf(FightState.class));
}
@EventHandler
public void onArrowPickup(PlayerPickupArrowEvent e){
e.setCancelled(true);
}
}

Datei anzeigen

@ -0,0 +1,33 @@
package de.steamwar.fightsystem.listener;
import de.steamwar.fightsystem.states.FightState;
import org.bukkit.Material;
import org.bukkit.event.EventHandler;
import org.bukkit.event.inventory.CraftItemEvent;
import org.bukkit.event.inventory.FurnaceSmeltEvent;
import org.bukkit.event.player.PlayerPickupArrowEvent;
import org.bukkit.inventory.ItemStack;
import java.util.EnumSet;
public class ExtendedInventoryListener extends BasicListener {
public ExtendedInventoryListener() {
super(EnumSet.allOf(FightState.class));
}
@EventHandler
public void onArrowPickup(PlayerPickupArrowEvent e){
e.setCancelled(true);
}
@EventHandler
public void onCrafting(CraftItemEvent e){
e.setCancelled(true);
}
@EventHandler
public void onFurnace(FurnaceSmeltEvent e){
e.setResult(new ItemStack(Material.AIR));
}
}