Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
478f0e0
Bump version from 5.0.15 to 5.0.15-SNAPSHOT0
May 3, 2025
753c683
Fixed NPE AddGoBackButton
Tigerpanzer02 May 6, 2025
45563d1
Bump version from 5.0.15-SNAPSHOT0 to 5.0.15-SNAPSHOT1
May 6, 2025
e995bac
Fixed on Plotreset time did not update to world time
Tigerpanzer02 May 19, 2025
decd821
Fixed Player Outside Plot interaction with blocks were possible
Tigerpanzer02 May 19, 2025
c353086
Fixed Time.Changed message did not translate placeholder into languag…
Tigerpanzer02 May 19, 2025
6bd13f4
Bump version from 5.0.15-SNAPSHOT1 to 5.0.15-SNAPSHOT2
May 19, 2025
c165f33
Fixed none builder Players of GTB didn't got the builder set weather …
Tigerpanzer02 May 19, 2025
a03d222
Allow Plot selection also if ArenaState is FULL_GAME
Tigerpanzer02 May 19, 2025
f7b705b
Fixed resetPlayerWeather did not change the weather
Tigerpanzer02 May 19, 2025
ced80d4
Fixed clickable ground items due to new outside plot interaction check
Tigerpanzer02 May 19, 2025
dd38ec0
Fixed plot distribution on plot selection on a solo game could cause …
Tigerpanzer02 May 19, 2025
1038cb0
Fixed plot distribution on plot selection on a solo game could cause …
Tigerpanzer02 May 19, 2025
b7aa9bb
Added onVoteInventoryInteractEvent to block movement of items while p…
Tigerpanzer02 May 19, 2025
d29bfa6
Fixed ItemFrames and Paintings were not able to be removed by player …
Tigerpanzer02 May 19, 2025
7a2f5b1
Bump version from 5.0.15-SNAPSHOT2 to 5.0.15-SNAPSHOT3
May 19, 2025
5600114
Fixed on first time setup without restart the NPE getArenaInGameState…
Tigerpanzer02 May 19, 2025
809fc5c
Bump version from 5.0.15-SNAPSHOT3 to 5.0.15-SNAPSHOT4
May 19, 2025
c3e922b
Fixed NPE if OptionsMenu Particles are opened as none builder whileas…
Tigerpanzer02 May 19, 2025
7d1ba4b
Bump version from 5.0.15-SNAPSHOT4 to 5.0.15-SNAPSHOT5
May 19, 2025
b708073
Update MinigamesBox
Tigerpanzer02 May 22, 2025
6364830
Bump version from 5.0.15-SNAPSHOT5 to 5.0.15-SNAPSHOT6
May 22, 2025
0a0179b
Adjusted CHANGELOG.md
Tigerpanzer02 May 22, 2025
a498d53
Added a lot of new default themes at themes.yml
Tigerpanzer02 May 22, 2025
c2894dd
Merge remote-tracking branch 'origin/development' into development
Tigerpanzer02 May 22, 2025
f621390
Added possibility to add same meaning words for gtb themes by using "…
Tigerpanzer02 May 22, 2025
dff15d0
Bump version from 5.0.15-SNAPSHOT6 to 5.0.15-SNAPSHOT7
May 22, 2025
ea49d14
[ci skip] Adjusted CHANGELOG.md
Tigerpanzer02 May 22, 2025
d57137f
[ci skip] Update README.md
Tigerpanzer02 May 22, 2025
45f6850
Update README.md
Tigerpanzer02 May 22, 2025
1725f96
Bump version from 5.0.15-SNAPSHOT7 to 5.0.15-SNAPSHOT8
May 22, 2025
b309c80
Changed Heads menus from NormalInventory to Paginated Inventory to su…
Tigerpanzer02 May 22, 2025
27aa212
Bump version from 5.0.15-SNAPSHOT8 to 5.0.15-SNAPSHOT9
May 22, 2025
9df2839
[ci skip] Update README.md
Tigerpanzer02 May 25, 2025
363bb8e
Updated MinigamesBox
Tigerpanzer02 May 28, 2025
ed013d5
Bump version from 5.0.15-SNAPSHOT9 to 5.0.15-SNAPSHOT10
May 28, 2025
26af2f3
Hide guessing players from builder in gtb mode
Tigerpanzer02 May 30, 2025
66590e2
Bump version from 5.0.15-SNAPSHOT10 to 5.0.15-SNAPSHOT11
May 30, 2025
23b96d8
Fixed WaterFlow to Floor Ground
Tigerpanzer02 Jun 9, 2025
d06a068
Updated minigamesbox
Tigerpanzer02 Jun 9, 2025
a4fbb90
Merge remote-tracking branch 'origin/development' into development
Tigerpanzer02 Jun 9, 2025
b8bfe68
Bump version from 5.0.15-SNAPSHOT11 to 5.0.15-SNAPSHOT12
Jun 9, 2025
e6034a3
Added Heads from HeadDatabase
Tigerpanzer02 Jul 10, 2025
344ad07
Bump version from 5.0.15-SNAPSHOT12 to 5.0.15-SNAPSHOT13
Jul 10, 2025
23a37ff
Fixed Vehicles such as Boats could drive outside plot
Tigerpanzer02 Jul 10, 2025
317d22c
Bump version from 5.0.15-SNAPSHOT13 to 5.0.15-SNAPSHOT14
Jul 10, 2025
9d17eca
Added LanguageMigrator
Tigerpanzer02 Jul 10, 2025
88805f4
Bump version from 5.0.15-SNAPSHOT14 to 5.0.15-SNAPSHOT15
Jul 10, 2025
b1025d4
Fixed LanguageMigrator needed twice a boot. Added mainmenu.yml migrator.
Tigerpanzer02 Jul 14, 2025
84965c7
Fixed LanguageMigrator needed twice a boot. Added mainmenu.yml migrator.
Tigerpanzer02 Jul 14, 2025
0428ec3
Added /bba forceplay <arena> <theme>
Tigerpanzer02 Jul 14, 2025
fb0a296
Bump version from 5.0.15-SNAPSHOT15 to 5.0.15-SNAPSHOT16
Jul 14, 2025
f931279
Fixed wrong game state if no players in arena on ForcePlayArgument use
Tigerpanzer02 Jul 14, 2025
c5dc1be
Bump version from 5.0.15-SNAPSHOT16 to 5.0.15-SNAPSHOT17
Jul 14, 2025
5482b82
Bump version from 5.0.15-SNAPSHOT17 to 5.0.15-SNAPSHOT18
Jul 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,38 @@ deploy webhooks to print changelog successfully

That's all, matcher will stop when detects next line started with `###` match

## 5.0.15 Release (03.05.2025)
### 5.1.0 Release (10.07.2025)
* Added Heads from HeadDatabase (selected on each server start 200 per category)
* Added Heads Search function
* Added paginated Heads menu to support more than one site of heads
* Added onVoteInventoryInteractEvent to block movement of items while plot voting stage
* Added a lot of new default themes at themes.yml (+140)
* Added possibility to add same meaning words for gtb themes by using ", " in themes.yml
* Added /bba settheme <arena> <theme> for Console use
* Added /bba forceplay <arena> <theme> which moves all online players into arena and sets the theme
* Fixed Floor NPC spawns on any actions
* Fixed NPE if OptionsMenu Particles are opened as none builder whileas in gtb
* Fixed on first time setup without restart the NPE getArenaInGameState is null
* Fixed ItemFrames and Paintings were not able to be removed by player on plot
* Fixed plot distribution on plot selection on a solo game could cause to set multiple players on the same plot
* Fixed resetPlayerWeather did not change the weather
* Fixed none builder Players of GTB didn't got the builder set weather and time
* Fixed Time.Changed message did not translate placeholder into language.yml content
* Fixed on Plotreset time did not update to world time
* Fixed Player Outside Plot interaction with blocks were possible
* Fixed NPE AddGoBackButton
* Fixed Water Flow on Ground
* Fixed Vehicles such as Boats could drive outside plot
* Fixed Flower Pots couldn't be destroyed on plot
* Fixed placeholder on message Changed-Theme
* Fixed sendBuildLeftTimeMessage is not handled by MessageBuilder correctly
* Changed Allow Plot selection also if ArenaState is FULL_GAME
* Changed (for API usage) renamed BBTheme to GuessTheme
* Changed Hide guessing players from builder in gtb mode
* Changed LanguageMigrator on plugin level to update file versions
* Updated Minigamesbox to 1.4.2

### 5.0.15 Release (03.05.2025)
* Allowing by default 20 places placeholder for summary list
* Check if OPTIONS_MENU item is still in builders inventory and readd it if necessary
* Fixed IllegalArgumentException on PlotSelector, also switched to PaginatedInventory to support all Plots
Expand Down
14 changes: 10 additions & 4 deletions .github/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
![](https://images.plugily.xyz/banner/display.php?id=BuildBattle)

# Build Battle [![Maven Repository](https://maven.plugily.xyz/api/badge/latest/releases/plugily/projects/buildbattle?color=40c14a&name=Maven&prefix=v)](https://maven.plugily.xyz/#/releases/plugily/projects/buildbattle) [![JavaDoc Repository](https://maven.plugily.xyz/api/badge/latest/releases/plugily/projects/buildbattle?color=40c14a&name=JavaDoc&prefix=v)](https://maven.plugily.xyz/javadoc/releases/plugily/projects/buildbattle/latest) [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=Plugily-Projects_BuildBattle&metric=sqale_rating)](https://sonarcloud.io/summary/overall?id=Plugily-Projects_BuildBattle) [![Discord](https://img.shields.io/discord/345628548716822530.svg?color=7289DA&style=for-the-badge&logo=discord)](https://discord.plugily.xyz) [![Patreon]( https://img.shields.io/badge/Patreon-F96854?style=for-the-badge&logo=patreon&logoColor=white)](https://patreon.com/plugily)
# Build Battle / Guess The Build [![Maven Repository](https://maven.plugily.xyz/api/badge/latest/releases/plugily/projects/buildbattle?color=40c14a&name=Maven&prefix=v)](https://maven.plugily.xyz/#/releases/plugily/projects/buildbattle) [![JavaDoc Repository](https://maven.plugily.xyz/api/badge/latest/releases/plugily/projects/buildbattle?color=40c14a&name=JavaDoc&prefix=v)](https://maven.plugily.xyz/javadoc/releases/plugily/projects/buildbattle/latest) [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=Plugily-Projects_BuildBattle&metric=sqale_rating)](https://sonarcloud.io/summary/overall?id=Plugily-Projects_BuildBattle) [![Discord](https://img.shields.io/discord/345628548716822530.svg?color=7289DA&style=for-the-badge&logo=discord)](https://discord.plugily.xyz) [![Patreon]( https://img.shields.io/badge/Patreon-F96854?style=for-the-badge&logo=patreon&logoColor=white)](https://patreon.com/plugily)

BuildBattle is a Minecraft minigame designed for small and big servers. This minigame is unique and very configurable,
BuildBattle / Guess The Build is a Minecraft minigame designed for small and big servers. This minigame is unique and very configurable,
100% free and open source!

The goal is to build the best you can! You must compete with other players in this building game. Who will be the best?
There are different modes such as the classic BuildBattle and the guess mode called Guess The Build. On the classic version the goal is to build the best you can on your own as solo or as team with unlimited team sizes! You must compete with other players in this building game. Who will be the best? On the guess mode you have to build whileas the other players are guessing the correct word according to your building which grants points to the players. The player with the most points (best guesses) wins.
Have fun using it! Leave a good rating if you really like it.

## Want to contribute in this project?
Expand All @@ -31,7 +31,13 @@ Have fun using it! Leave a good rating if you really like it.

<img src="https://poeditor.com/public/images/logo/logo_head_500_transparent.png" alt="jetbrains logo" width="150"/>

Thanks to Code Whale for Open Source license for POEditor project.
Thanks to Code Whale for Open Source license for POEditor project, so we are able to have locales.

#### Minecraft Heads

[![https://minecraft-heads.com/](https://images.minecraft-heads.com/banners/minecraft-heads_leaderboard_728x90.png)](https://minecraft-heads.com/)

Thanks to Minecraft Heads to let us use the Name and Textures of the heads to provide you a better heads experience ingame.

## Contributors

Expand Down
12 changes: 10 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<groupId>plugily.projects</groupId>
<artifactId>buildbattle</artifactId>
<version>5.0.15</version>
<version>5.0.15-SNAPSHOT18</version>
<name>BuildBattle</name>

<properties>
Expand Down Expand Up @@ -62,6 +62,14 @@
</repositories>

<dependencies>
<!--
Needed for HeadDatabase Conversion of JSON to YML
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.9</version>
</dependency>
-->
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
Expand All @@ -78,7 +86,7 @@
<dependency>
<groupId>plugily.projects</groupId>
<artifactId>MiniGamesBox-Classic</artifactId>
<version>1.4.1</version>
<version>1.4.3</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/plugily/projects/buildbattle/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@
import plugily.projects.buildbattle.boot.MessageInitializer;
import plugily.projects.buildbattle.boot.PlaceholderInitializer;
import plugily.projects.buildbattle.commands.arguments.ArgumentsRegistry;
import plugily.projects.buildbattle.handlers.LanguageMigrator;
import plugily.projects.buildbattle.handlers.menu.OptionsRegistry;
import plugily.projects.buildbattle.handlers.misc.BlacklistManager;
import plugily.projects.buildbattle.handlers.misc.HeadDatabaseManager;
import plugily.projects.buildbattle.handlers.setup.SetupCategoryManager;
import plugily.projects.buildbattle.handlers.themes.ThemeManager;
import plugily.projects.minigamesbox.classic.PluginMain;
Expand All @@ -48,6 +50,7 @@
public class Main extends PluginMain {

private VoteItems voteItems;
private HeadDatabaseManager headDatabaseManager;
private ThemeManager themeManager;
private BlacklistManager blacklistManager;
private OptionsRegistry optionsRegistry;
Expand All @@ -65,6 +68,7 @@ public Main() {
@Override
public void onEnable() {
long start = System.currentTimeMillis();
new LanguageMigrator(this);
MessageInitializer messageInitializer = new MessageInitializer(this);
super.onEnable();
getDebugger().debug("[System] [Plugin] Initialization start");
Expand All @@ -81,6 +85,7 @@ public void initializePluginClasses() {
addFileName("themes");
addFileName("vote_items");
blacklistManager = new BlacklistManager(this);
headDatabaseManager = new HeadDatabaseManager(this);
themeManager = new ThemeManager(this);
BaseArena.init(this);
new ArenaEvents(this);
Expand Down Expand Up @@ -111,6 +116,10 @@ public VoteItems getVoteItems() {
return voteItems;
}

public HeadDatabaseManager getHeadDatabaseManager() {
return headDatabaseManager;
}

public ThemeManager getThemeManager() {
return themeManager;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import org.bukkit.event.HandlerList;
import plugily.projects.buildbattle.arena.GuessArena;
import plugily.projects.buildbattle.handlers.themes.BBTheme;
import plugily.projects.buildbattle.handlers.themes.GuessTheme;
import plugily.projects.minigamesbox.api.events.PlugilyEvent;


Expand All @@ -35,9 +35,9 @@
public class PlayerThemeGuessEvent extends PlugilyEvent {

private static final HandlerList HANDLERS = new HandlerList();
private final BBTheme theme;
private final GuessTheme theme;

public PlayerThemeGuessEvent(GuessArena eventArena, BBTheme theme) {
public PlayerThemeGuessEvent(GuessArena eventArena, GuessTheme theme) {
super(eventArena);
this.theme = theme;
}
Expand All @@ -51,7 +51,7 @@ public HandlerList getHandlers() {
return HANDLERS;
}

public BBTheme getTheme() {
public GuessTheme getTheme() {
return theme;
}
}
111 changes: 98 additions & 13 deletions src/main/java/plugily/projects/buildbattle/arena/ArenaEvents.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
import org.bukkit.event.EventPriority;
import org.bukkit.event.block.*;
import org.bukkit.event.entity.*;
import org.bukkit.event.hanging.HangingBreakByEntityEvent;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryCreativeEvent;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.event.player.AsyncPlayerChatEvent;
import org.bukkit.event.player.PlayerBucketEmptyEvent;
Expand All @@ -51,6 +53,7 @@
import plugily.projects.minigamesbox.classic.utils.version.events.api.PlugilyPlayerInteractEntityEvent;
import plugily.projects.minigamesbox.classic.utils.version.events.api.PlugilyPlayerInteractEvent;
import plugily.projects.minigamesbox.classic.utils.version.events.api.PlugilyPlayerPickupArrow;
import plugily.projects.minigamesbox.classic.utils.version.xseries.XEntityType;
import plugily.projects.minigamesbox.classic.utils.version.xseries.XMaterial;

/**
Expand Down Expand Up @@ -91,9 +94,27 @@ public void onBreak(BlockBreakEvent event) {
event.setCancelled(true);
}

@EventHandler
public void onOutSidePlotInteract(PlugilyPlayerInteractEvent event) {
if(event.getClickedBlock() == null) {
return;
}
BaseArena arena = plugin.getArenaRegistry().getArena(event.getPlayer());
if(arena == null) {
return;
}
if(arena.getArenaState() != IArenaState.IN_GAME) {
return;
}
Plot buildPlot = arena.getPlotManager().getPlot(event.getPlayer());
if(buildPlot != null && buildPlot.getCuboid() != null && !buildPlot.getCuboid().isInWithMarge(event.getClickedBlock().getLocation(), 2)) {
event.setCancelled(true);
}
}

@EventHandler(priority = EventPriority.HIGH)
public void onItemSpawn(ItemSpawnEvent event) {
if (!plugin.getArenaRegistry().getArenaWorlds().contains(event.getLocation().getWorld())) {
if(!plugin.getArenaRegistry().getArenaWorlds().contains(event.getLocation().getWorld())) {
return;
}

Expand Down Expand Up @@ -155,6 +176,49 @@ public void onItemFrameRotate(PlayerInteractEntityEvent event) {
}
}

@EventHandler(priority = EventPriority.HIGHEST)
public void onHangingBreakEvent(HangingBreakByEntityEvent event) {
if(event.getEntity() instanceof ItemFrame || event.getEntity() instanceof Painting) {
if(event.getRemover() instanceof Player && plugin.getArenaRegistry().isInArena((Player) event.getRemover())) {
Player player = (Player) event.getRemover();
BaseArena arena = plugin.getArenaRegistry().getArena(player);
if(arena == null) {
return;
}
if(arena.getArenaState() != IArenaState.IN_GAME) {
return;
}
Plot buildPlot = arena.getPlotManager().getPlot(player);

if(buildPlot != null && buildPlot.getCuboid() != null && buildPlot.getCuboid().isIn(event.getEntity().getLocation())) {
event.setCancelled(false);
return;
}
event.setCancelled(true);
}
}
}

@EventHandler(priority = EventPriority.HIGHEST)
public void onPaintandFlowerInteraction(PlugilyPlayerInteractEvent event) {
Player player = event.getPlayer();
BaseArena arena = plugin.getArenaRegistry().getArena(player);
if(arena == null || event.getClickedBlock() == null) {
return;
}
if(arena.getArenaState() != IArenaState.IN_GAME) {
return;
}
Plot buildPlot = arena.getPlotManager().getPlot(player);
if(event.getClickedBlock().getType() != XMaterial.PAINTING.parseMaterial() && event.getClickedBlock().getType() != XMaterial.FLOWER_POT.parseMaterial()) {
return;
}
if(buildPlot != null && buildPlot.getCuboid() != null && buildPlot.getCuboid().isIn(event.getClickedBlock().getLocation())) {
//need to cancel with highest as minigamescore is blocking it!
event.setCancelled(false);
}
}

@EventHandler
public void onNPCClick(PlugilyPlayerInteractEntityEvent event) {
if(VersionUtils.checkOffHand(event.getHand()) || event.getRightClicked().getType() != EntityType.VILLAGER) {
Expand Down Expand Up @@ -227,25 +291,28 @@ public void onEnderchestClick(PlugilyPlayerInteractEvent event) {
return;
}

if(arena.getArenaState() != IArenaState.IN_GAME || event.getClickedBlock().getType() == XMaterial.ENDER_CHEST.parseMaterial()) {
if(event.getClickedBlock().getType() == XMaterial.ENDER_CHEST.parseMaterial()) {
event.setCancelled(true);
}
}

//TODO recognise plot by location should be added, as current check will go through all plots...
//Alternative use filter!!
@EventHandler
public void onMinecartMove(VehicleMoveEvent event) {
public void onVehicleMove(VehicleMoveEvent event) {
Vehicle vehicle = event.getVehicle();
if(vehicle.getType() != EntityType.MINECART) {
return;
}
for(IPluginArena arena : plugin.getArenaRegistry().getArenas()) {
if(!(arena instanceof BaseArena)) {
continue;
}
for(Plot buildPlot : ((BaseArena) arena).getPlotManager().getPlots()) {
if(buildPlot.getCuboid() != null && !buildPlot.getCuboid().isInWithMarge(event.getTo(), -1) && buildPlot.getCuboid().isIn(event.getTo())) {
((Minecart) vehicle).setMaxSpeed(0);
if(buildPlot.getCuboid() != null && !buildPlot.getCuboid().isIn(event.getTo())) {
vehicle.setVelocity(vehicle.getVelocity().zero());
if(vehicle.getType() == XEntityType.MINECART.get()) {
((Minecart) vehicle).setMaxSpeed(0);
} else {
vehicle.remove();
}
}
}
}
Expand Down Expand Up @@ -439,7 +506,6 @@ public void onEntityDamageEntity(EntityDamageByEntityEvent event) {
}



@EventHandler(priority = EventPriority.HIGH)
public void onDamage(EntityDamageEvent event) {
if(event.getEntity().getType() != EntityType.PLAYER) {
Expand Down Expand Up @@ -511,10 +577,10 @@ public void onOtherBlockExplode(BlockExplodeEvent event) {
public void onEnderpearlThrow(ProjectileLaunchEvent event) {
if(event.getEntity().getShooter() instanceof Player) {
BaseArena arena = plugin.getArenaRegistry().getArena((Player) event.getEntity().getShooter());
if (arena == null || arena.getArenaState() != IArenaState.IN_GAME) {
if(arena == null || arena.getArenaState() != IArenaState.IN_GAME) {
return;
}
if (event.getEntity() instanceof EnderPearl) {
if(event.getEntity() instanceof EnderPearl) {
event.setCancelled(true);
}
}
Expand All @@ -534,7 +600,7 @@ public void onWaterFlowEvent(BlockFromToEvent event) {
if(!buildPlot.getCuboid().isIn(toBlock) && buildPlot.getCuboid().isIn(blockLoc)) {
event.setCancelled(true);
}
if(!buildPlot.getCuboid().isInWithMarge(toBlock, -1) && buildPlot.getCuboid().isIn(toBlock)) {
if(!buildPlot.getCuboid().isIn(toBlock)) {
event.setCancelled(true);
}
}
Expand Down Expand Up @@ -629,7 +695,7 @@ public void onGTBGuessChat(AsyncPlayerChatEvent event) {
new MessageBuilder("IN_GAME_MESSAGES_PLOT_GTB_THEME_GUESS_BUILDER").asKey().arena(gameArena).player(player).sendPlayer();
return;
}
if(gameArena.getCurrentBBTheme() == null || !gameArena.getCurrentBBTheme().getTheme().equalsIgnoreCase(event.getMessage())) {
if(gameArena.getCurrentBBTheme() == null || gameArena.getCurrentBBTheme().getThemes().stream().noneMatch(theme -> theme.equalsIgnoreCase(event.getMessage()))) {
return;
}
event.setCancelled(true);
Expand All @@ -647,4 +713,23 @@ public void onPlayerDropItem(PlayerDropItemEvent event) {
}
}

@EventHandler
public void onVoteInventoryInteractEvent(InventoryCreativeEvent event) {
if(!(event.getWhoClicked() instanceof Player)) {
return;
}
Player player = (Player) event.getWhoClicked();
BaseArena arena = plugin.getArenaRegistry().getArena(player);
if(!(arena instanceof BuildArena)) {
return;
}
if(arena.getArenaState() != IArenaState.IN_GAME) {
return;
}
if(arena.getArenaInGameState() != BaseArena.ArenaInGameState.PLOT_VOTING) {
return;
}
event.setCancelled(true);
}

}
Loading