Fix Bows in Chest #2
@ -97,4 +97,8 @@ public class MWTeam {
|
||||
public String getColoredName() {
|
||||
return color.toString() + teamName;
|
||||
}
|
||||
|
||||
public static ItemStack getBow() {
|
||||
|
||||
return bow;
|
||||
}
|
||||
}
|
||||
|
@ -11,14 +11,17 @@ import com.sk89q.worldedit.session.ClipboardHolder;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import de.steamwar.misslewars.Config;
|
||||
import de.steamwar.misslewars.FightState;
|
||||
import de.steamwar.misslewars.MWTeam;
|
||||
import de.steamwar.misslewars.MissileWars;
|
||||
import de.steamwar.misslewars.items.SpecialItem;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Snowball;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.entity.ProjectileLaunchEvent;
|
||||
import org.bukkit.event.inventory.InventoryCloseEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
@ -78,4 +81,12 @@ public class ItemListener extends BasicListener {
|
||||
}, Config.ShieldFlyTime);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = true)
|
||||
public void onInventoryClose(InventoryCloseEvent event) {
|
||||
if(event.getInventory().contains(MWTeam.getBow())) {
|
||||
event.getInventory().setItem(event.getInventory().first(MWTeam.getBow()), new ItemStack(Material.AIR));
|
||||
event.getPlayer().getInventory().addItem(MWTeam.getBow());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren
Soweit ich das sehe, wird diese Funktion nicht mehr verwendet, ansonsten ist alles top.