q q e pa fala
This commit is contained in:
parent
b92f2c2871
commit
820d418eac
|
@ -27,7 +27,7 @@ public class NoneDeathEffect implements DeathEffect {
|
|||
|
||||
@Override
|
||||
public Material getIcon() {
|
||||
return Material.REDSTONE;
|
||||
return Material.SKULL_ITEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
package land.battle.practice.listeners;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
import com.solexgames.core.listener.custom.PlayerFreezeEvent;
|
||||
import com.solexgames.core.menu.impl.player.PlayerInfoMenu;
|
||||
import com.solexgames.core.util.Color;
|
||||
import com.solexgames.core.util.clickable.Clickable;
|
||||
import io.netty.util.internal.ConcurrentSet;
|
||||
import land.battle.practice.Practice;
|
||||
import land.battle.practice.arena.type.StandaloneArena;
|
||||
import land.battle.practice.event.match.MatchEndEvent;
|
||||
|
@ -24,7 +26,11 @@ import net.md_5.bungee.api.chat.ClickEvent;
|
|||
import net.md_5.bungee.api.chat.HoverEvent;
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.ArmorStand;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
|
@ -43,6 +49,7 @@ public class MatchListener implements Listener {
|
|||
private final Practice plugin = Practice.getInstance();
|
||||
private int counter = 0;
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void onFreeze(PlayerFreezeEvent event) {
|
||||
final Player player = event.getPlayer();
|
||||
|
@ -95,6 +102,22 @@ public class MatchListener implements Listener {
|
|||
}
|
||||
}
|
||||
|
||||
public boolean isBreakable(Player player, Block block) {
|
||||
final Match match = this.plugin.getMatchManager().getMatch(player.getUniqueId());
|
||||
final Set<Location> placedBlocksLocations = new ConcurrentSet<>();
|
||||
|
||||
if (placedBlocksLocations.contains(block.getLocation())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Material material = block.getType();
|
||||
if (material == Material.ENDER_STONE) {
|
||||
return match.getKit().getFlag().equals(Flag.BEDWARS);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onEntitySpawn(EntitySpawnEvent event) {
|
||||
if (event.getEntityType().equals(EntityType.ARMOR_STAND)) {
|
||||
|
|
|
@ -33,13 +33,14 @@ public class WorldListener implements Listener {
|
|||
public void onBlockBreak(BlockBreakEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
PlayerData playerData = this.plugin.getPlayerManager().getPlayerData(player.getUniqueId());
|
||||
|
||||
MatchListener matchListener = new MatchListener(); // Example initialization
|
||||
if (playerData == null) {
|
||||
this.plugin.getLogger().warning(player.getName() + "'s player data is null");
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (playerData.getPlayerState() == PlayerState.FIGHTING) {
|
||||
Match match = this.plugin.getMatchManager().getMatch(player.getUniqueId());
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import com.solexgames.core.util.clickable.Clickable;
|
|||
import land.battle.practice.Practice;
|
||||
import land.battle.practice.arena.Arena;
|
||||
import land.battle.practice.arena.type.StandaloneArena;
|
||||
import land.battle.practice.flags.Flag;
|
||||
import land.battle.practice.kit.Kit;
|
||||
import land.battle.practice.match.snapshot.InventorySnapshot;
|
||||
import land.battle.practice.match.team.impl.MatchTeam;
|
||||
|
@ -17,7 +18,9 @@ import net.md_5.bungee.api.chat.BaseComponent;
|
|||
import org.apache.commons.lang.time.DurationFormatUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -50,6 +53,9 @@ public class Match {
|
|||
|
||||
private final List<MatchTeam> teams;
|
||||
|
||||
private final Set<Location> placedBlocksLocations = new ConcurrentSet<>();
|
||||
|
||||
|
||||
private final QueueType type;
|
||||
private final Arena arena;
|
||||
private final Kit kit;
|
||||
|
|
|
@ -106,6 +106,7 @@ public class PlayerData {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public Player getBukkitPlayer() {
|
||||
return Bukkit.getPlayer(this.uniqueId);
|
||||
}
|
||||
|
|
|
@ -31,8 +31,8 @@ public class VoteManager {
|
|||
public void sendVoteMessage(Player player, Arena arena) {
|
||||
|
||||
ChatComponentBuilder builder = new ChatComponentBuilder("");
|
||||
builder.append(CC.AQUA + "Give us some feedback on " + CC.YELLOW + arena.getName() + " by clicking" );
|
||||
builder.append(CC.AQUA + "one of the stars: ");
|
||||
builder.append(CC.AQUA + "Give us some feedback on " + CC.YELLOW + arena.getName() + CC.AQUA + " by clicking" );
|
||||
builder.append(CC.AQUA + " one of the stars: ");
|
||||
|
||||
Arrays.stream(Vote.values()).forEach(rating -> builder.append(rating.getDisplayName() + " ")
|
||||
.event(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/rate " + rating.name()))
|
||||
|
|
Loading…
Reference in New Issue