This commit is contained in:
Luca 2021-11-24 18:20:05 +01:00
parent 2b08e12f67
commit f210b41f2e
4 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,4 @@
package rip.tilly.bedwars.customitems;
public class e {
}

View File

@ -0,0 +1,8 @@
package rip.tilly.bedwars.customitems.popuptower;
import org.bukkit.block.Block;
public class PlaceTower {
public PlaceTower(Block block, String xyz, )
}

View File

@ -1,15 +1,19 @@
package rip.tilly.bedwars.listeners;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.*;
import org.bukkit.event.entity.CreatureSpawnEvent;
import org.bukkit.event.entity.FoodLevelChangeEvent;
import org.bukkit.event.hanging.HangingBreakEvent;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.event.player.PlayerToggleFlightEvent;
import org.bukkit.event.weather.WeatherChangeEvent;
import rip.tilly.bedwars.BedWars;
import rip.tilly.bedwars.playerdata.PlayerData;
import rip.tilly.bedwars.playerdata.PlayerState;
public class RandomListeners implements Listener {
@ -82,4 +86,18 @@ public class RandomListeners implements Listener {
event.setCancelled(true);
}
}
@EventHandler
public void onInventoryClick(InventoryClickEvent event) {
Player player = (Player) event.getWhoClicked();
PlayerData playerData = this.plugin.getPlayerDataManager().getPlayerData(player.getUniqueId());
if (playerData.getPlayerState() != PlayerState.PLAYING) {
event.setCancelled(true);
return;
}
if (event.getSlotType() == InventoryType.SlotType.ARMOR) {
event.setCancelled(true);
}
}
}

View File

@ -158,6 +158,13 @@ public class WorldListener implements Listener {
return;
}
Block chest = event.getBlockPlaced();
if (chest.getType() == Material.CHEST) {
Location location = event.getBlockPlaced().getLocation();
event.setCancelled(true);
return;
}
game.addPlacedBlock(block);
}