Skip to content

Commit d021381

Browse files
Tigerpanzer02version-bump[github-action]
andauthored
#minor 1.21.6-7 ready & Heads Update & GTB Themes Same Meaning Words and more to enjoy! (#107)
* Bump version from 5.0.15 to 5.0.15-SNAPSHOT0 * Fixed NPE AddGoBackButton * Bump version from 5.0.15-SNAPSHOT0 to 5.0.15-SNAPSHOT1 * Fixed on Plotreset time did not update to world time * Fixed Player Outside Plot interaction with blocks were possible * Fixed Time.Changed message did not translate placeholder into language.yml content. * Bump version from 5.0.15-SNAPSHOT1 to 5.0.15-SNAPSHOT2 * Fixed none builder Players of GTB didn't got the builder set weather and time * Allow Plot selection also if ArenaState is FULL_GAME * Fixed resetPlayerWeather did not change the weather * Fixed clickable ground items due to new outside plot interaction check * Fixed plot distribution on plot selection on a solo game could cause to set multiple players on the same plot * Fixed plot distribution on plot selection on a solo game could cause to set multiple players on the same plot * Added onVoteInventoryInteractEvent to block movement of items while plot voting stage. * Fixed ItemFrames and Paintings were not able to be removed by player on plot. * Bump version from 5.0.15-SNAPSHOT2 to 5.0.15-SNAPSHOT3 * Fixed on first time setup without restart the NPE getArenaInGameState is null * Bump version from 5.0.15-SNAPSHOT3 to 5.0.15-SNAPSHOT4 * Fixed NPE if OptionsMenu Particles are opened as none builder whileas in gtb * Bump version from 5.0.15-SNAPSHOT4 to 5.0.15-SNAPSHOT5 * Update MinigamesBox * Bump version from 5.0.15-SNAPSHOT5 to 5.0.15-SNAPSHOT6 * Adjusted CHANGELOG.md * Added a lot of new default themes at themes.yml * Added possibility to add same meaning words for gtb themes by using ", " in themes.yml Changed (for API usage) renamed BBTheme to GuessTheme * Bump version from 5.0.15-SNAPSHOT6 to 5.0.15-SNAPSHOT7 * [ci skip] Adjusted CHANGELOG.md * [ci skip] Update README.md * Update README.md * Bump version from 5.0.15-SNAPSHOT7 to 5.0.15-SNAPSHOT8 * Changed Heads menus from NormalInventory to Paginated Inventory to support more heads * Bump version from 5.0.15-SNAPSHOT8 to 5.0.15-SNAPSHOT9 * [ci skip] Update README.md * Updated MinigamesBox * Bump version from 5.0.15-SNAPSHOT9 to 5.0.15-SNAPSHOT10 * Hide guessing players from builder in gtb mode * Bump version from 5.0.15-SNAPSHOT10 to 5.0.15-SNAPSHOT11 * Fixed WaterFlow to Floor Ground * Updated minigamesbox * Bump version from 5.0.15-SNAPSHOT11 to 5.0.15-SNAPSHOT12 * Added Heads from HeadDatabase Added /bba settheme <arena> <theme> for Console use Fixed Floor NPC spawns on any actions * Bump version from 5.0.15-SNAPSHOT12 to 5.0.15-SNAPSHOT13 * Fixed Vehicles such as Boats could drive outside plot Fixed Flower Pots couldn't be destroyed on plot * Bump version from 5.0.15-SNAPSHOT13 to 5.0.15-SNAPSHOT14 * Added LanguageMigrator * Bump version from 5.0.15-SNAPSHOT14 to 5.0.15-SNAPSHOT15 * Fixed LanguageMigrator needed twice a boot. Added mainmenu.yml migrator. * Fixed LanguageMigrator needed twice a boot. Added mainmenu.yml migrator. * Added /bba forceplay <arena> <theme> * Bump version from 5.0.15-SNAPSHOT15 to 5.0.15-SNAPSHOT16 * Fixed wrong game state if no players in arena on ForcePlayArgument use * Bump version from 5.0.15-SNAPSHOT16 to 5.0.15-SNAPSHOT17 * Bump version from 5.0.15-SNAPSHOT17 to 5.0.15-SNAPSHOT18 --------- Co-authored-by: version-bump[github-action] <41898282+version-bump[github-action]@users.noreply.github.com>
1 parent 2dc3e6a commit d021381

36 files changed

+1409
-162
lines changed

.github/CHANGELOG.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,38 @@ deploy webhooks to print changelog successfully
1010

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

13-
## 5.0.15 Release (03.05.2025)
13+
### 5.1.0 Release (10.07.2025)
14+
* Added Heads from HeadDatabase (selected on each server start 200 per category)
15+
* Added Heads Search function
16+
* Added paginated Heads menu to support more than one site of heads
17+
* Added onVoteInventoryInteractEvent to block movement of items while plot voting stage
18+
* Added a lot of new default themes at themes.yml (+140)
19+
* Added possibility to add same meaning words for gtb themes by using ", " in themes.yml
20+
* Added /bba settheme <arena> <theme> for Console use
21+
* Added /bba forceplay <arena> <theme> which moves all online players into arena and sets the theme
22+
* Fixed Floor NPC spawns on any actions
23+
* Fixed NPE if OptionsMenu Particles are opened as none builder whileas in gtb
24+
* Fixed on first time setup without restart the NPE getArenaInGameState is null
25+
* Fixed ItemFrames and Paintings were not able to be removed by player on plot
26+
* Fixed plot distribution on plot selection on a solo game could cause to set multiple players on the same plot
27+
* Fixed resetPlayerWeather did not change the weather
28+
* Fixed none builder Players of GTB didn't got the builder set weather and time
29+
* Fixed Time.Changed message did not translate placeholder into language.yml content
30+
* Fixed on Plotreset time did not update to world time
31+
* Fixed Player Outside Plot interaction with blocks were possible
32+
* Fixed NPE AddGoBackButton
33+
* Fixed Water Flow on Ground
34+
* Fixed Vehicles such as Boats could drive outside plot
35+
* Fixed Flower Pots couldn't be destroyed on plot
36+
* Fixed placeholder on message Changed-Theme
37+
* Fixed sendBuildLeftTimeMessage is not handled by MessageBuilder correctly
38+
* Changed Allow Plot selection also if ArenaState is FULL_GAME
39+
* Changed (for API usage) renamed BBTheme to GuessTheme
40+
* Changed Hide guessing players from builder in gtb mode
41+
* Changed LanguageMigrator on plugin level to update file versions
42+
* Updated Minigamesbox to 1.4.2
43+
44+
### 5.0.15 Release (03.05.2025)
1445
* Allowing by default 20 places placeholder for summary list
1546
* Check if OPTIONS_MENU item is still in builders inventory and readd it if necessary
1647
* Fixed IllegalArgumentException on PlotSelector, also switched to PaginatedInventory to support all Plots

.github/README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
![](https://images.plugily.xyz/banner/display.php?id=BuildBattle)
22

3-
# 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)
3+
# 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)
44

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

8-
The goal is to build the best you can! You must compete with other players in this building game. Who will be the best?
8+
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.
99
Have fun using it! Leave a good rating if you really like it.
1010

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

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

34-
Thanks to Code Whale for Open Source license for POEditor project.
34+
Thanks to Code Whale for Open Source license for POEditor project, so we are able to have locales.
35+
36+
#### Minecraft Heads
37+
38+
[![https://minecraft-heads.com/](https://images.minecraft-heads.com/banners/minecraft-heads_leaderboard_728x90.png)](https://minecraft-heads.com/)
39+
40+
Thanks to Minecraft Heads to let us use the Name and Textures of the heads to provide you a better heads experience ingame.
3541

3642
## Contributors
3743

pom.xml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
<groupId>plugily.projects</groupId>
2828
<artifactId>buildbattle</artifactId>
29-
<version>5.0.15</version>
29+
<version>5.0.15-SNAPSHOT18</version>
3030
<name>BuildBattle</name>
3131

3232
<properties>
@@ -62,6 +62,14 @@
6262
</repositories>
6363

6464
<dependencies>
65+
<!--
66+
Needed for HeadDatabase Conversion of JSON to YML
67+
<dependency>
68+
<groupId>com.google.code.gson</groupId>
69+
<artifactId>gson</artifactId>
70+
<version>2.8.9</version>
71+
</dependency>
72+
-->
6573
<dependency>
6674
<groupId>io.papermc.paper</groupId>
6775
<artifactId>paper-api</artifactId>
@@ -78,7 +86,7 @@
7886
<dependency>
7987
<groupId>plugily.projects</groupId>
8088
<artifactId>MiniGamesBox-Classic</artifactId>
81-
<version>1.4.1</version>
89+
<version>1.4.3</version>
8290
<scope>compile</scope>
8391
<optional>true</optional>
8492
</dependency>

src/main/java/plugily/projects/buildbattle/Main.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@
3232
import plugily.projects.buildbattle.boot.MessageInitializer;
3333
import plugily.projects.buildbattle.boot.PlaceholderInitializer;
3434
import plugily.projects.buildbattle.commands.arguments.ArgumentsRegistry;
35+
import plugily.projects.buildbattle.handlers.LanguageMigrator;
3536
import plugily.projects.buildbattle.handlers.menu.OptionsRegistry;
3637
import plugily.projects.buildbattle.handlers.misc.BlacklistManager;
38+
import plugily.projects.buildbattle.handlers.misc.HeadDatabaseManager;
3739
import plugily.projects.buildbattle.handlers.setup.SetupCategoryManager;
3840
import plugily.projects.buildbattle.handlers.themes.ThemeManager;
3941
import plugily.projects.minigamesbox.classic.PluginMain;
@@ -48,6 +50,7 @@
4850
public class Main extends PluginMain {
4951

5052
private VoteItems voteItems;
53+
private HeadDatabaseManager headDatabaseManager;
5154
private ThemeManager themeManager;
5255
private BlacklistManager blacklistManager;
5356
private OptionsRegistry optionsRegistry;
@@ -65,6 +68,7 @@ public Main() {
6568
@Override
6669
public void onEnable() {
6770
long start = System.currentTimeMillis();
71+
new LanguageMigrator(this);
6872
MessageInitializer messageInitializer = new MessageInitializer(this);
6973
super.onEnable();
7074
getDebugger().debug("[System] [Plugin] Initialization start");
@@ -81,6 +85,7 @@ public void initializePluginClasses() {
8185
addFileName("themes");
8286
addFileName("vote_items");
8387
blacklistManager = new BlacklistManager(this);
88+
headDatabaseManager = new HeadDatabaseManager(this);
8489
themeManager = new ThemeManager(this);
8590
BaseArena.init(this);
8691
new ArenaEvents(this);
@@ -111,6 +116,10 @@ public VoteItems getVoteItems() {
111116
return voteItems;
112117
}
113118

119+
public HeadDatabaseManager getHeadDatabaseManager() {
120+
return headDatabaseManager;
121+
}
122+
114123
public ThemeManager getThemeManager() {
115124
return themeManager;
116125
}

src/main/java/plugily/projects/buildbattle/api/event/guess/PlayerThemeGuessEvent.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
import org.bukkit.event.HandlerList;
2424
import plugily.projects.buildbattle.arena.GuessArena;
25-
import plugily.projects.buildbattle.handlers.themes.BBTheme;
25+
import plugily.projects.buildbattle.handlers.themes.GuessTheme;
2626
import plugily.projects.minigamesbox.api.events.PlugilyEvent;
2727

2828

@@ -35,9 +35,9 @@
3535
public class PlayerThemeGuessEvent extends PlugilyEvent {
3636

3737
private static final HandlerList HANDLERS = new HandlerList();
38-
private final BBTheme theme;
38+
private final GuessTheme theme;
3939

40-
public PlayerThemeGuessEvent(GuessArena eventArena, BBTheme theme) {
40+
public PlayerThemeGuessEvent(GuessArena eventArena, GuessTheme theme) {
4141
super(eventArena);
4242
this.theme = theme;
4343
}
@@ -51,7 +51,7 @@ public HandlerList getHandlers() {
5151
return HANDLERS;
5252
}
5353

54-
public BBTheme getTheme() {
54+
public GuessTheme getTheme() {
5555
return theme;
5656
}
5757
}

src/main/java/plugily/projects/buildbattle/arena/ArenaEvents.java

Lines changed: 98 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@
3131
import org.bukkit.event.EventPriority;
3232
import org.bukkit.event.block.*;
3333
import org.bukkit.event.entity.*;
34+
import org.bukkit.event.hanging.HangingBreakByEntityEvent;
3435
import org.bukkit.event.inventory.InventoryClickEvent;
36+
import org.bukkit.event.inventory.InventoryCreativeEvent;
3537
import org.bukkit.event.inventory.InventoryType;
3638
import org.bukkit.event.player.AsyncPlayerChatEvent;
3739
import org.bukkit.event.player.PlayerBucketEmptyEvent;
@@ -51,6 +53,7 @@
5153
import plugily.projects.minigamesbox.classic.utils.version.events.api.PlugilyPlayerInteractEntityEvent;
5254
import plugily.projects.minigamesbox.classic.utils.version.events.api.PlugilyPlayerInteractEvent;
5355
import plugily.projects.minigamesbox.classic.utils.version.events.api.PlugilyPlayerPickupArrow;
56+
import plugily.projects.minigamesbox.classic.utils.version.xseries.XEntityType;
5457
import plugily.projects.minigamesbox.classic.utils.version.xseries.XMaterial;
5558

5659
/**
@@ -91,9 +94,27 @@ public void onBreak(BlockBreakEvent event) {
9194
event.setCancelled(true);
9295
}
9396

97+
@EventHandler
98+
public void onOutSidePlotInteract(PlugilyPlayerInteractEvent event) {
99+
if(event.getClickedBlock() == null) {
100+
return;
101+
}
102+
BaseArena arena = plugin.getArenaRegistry().getArena(event.getPlayer());
103+
if(arena == null) {
104+
return;
105+
}
106+
if(arena.getArenaState() != IArenaState.IN_GAME) {
107+
return;
108+
}
109+
Plot buildPlot = arena.getPlotManager().getPlot(event.getPlayer());
110+
if(buildPlot != null && buildPlot.getCuboid() != null && !buildPlot.getCuboid().isInWithMarge(event.getClickedBlock().getLocation(), 2)) {
111+
event.setCancelled(true);
112+
}
113+
}
114+
94115
@EventHandler(priority = EventPriority.HIGH)
95116
public void onItemSpawn(ItemSpawnEvent event) {
96-
if (!plugin.getArenaRegistry().getArenaWorlds().contains(event.getLocation().getWorld())) {
117+
if(!plugin.getArenaRegistry().getArenaWorlds().contains(event.getLocation().getWorld())) {
97118
return;
98119
}
99120

@@ -155,6 +176,49 @@ public void onItemFrameRotate(PlayerInteractEntityEvent event) {
155176
}
156177
}
157178

179+
@EventHandler(priority = EventPriority.HIGHEST)
180+
public void onHangingBreakEvent(HangingBreakByEntityEvent event) {
181+
if(event.getEntity() instanceof ItemFrame || event.getEntity() instanceof Painting) {
182+
if(event.getRemover() instanceof Player && plugin.getArenaRegistry().isInArena((Player) event.getRemover())) {
183+
Player player = (Player) event.getRemover();
184+
BaseArena arena = plugin.getArenaRegistry().getArena(player);
185+
if(arena == null) {
186+
return;
187+
}
188+
if(arena.getArenaState() != IArenaState.IN_GAME) {
189+
return;
190+
}
191+
Plot buildPlot = arena.getPlotManager().getPlot(player);
192+
193+
if(buildPlot != null && buildPlot.getCuboid() != null && buildPlot.getCuboid().isIn(event.getEntity().getLocation())) {
194+
event.setCancelled(false);
195+
return;
196+
}
197+
event.setCancelled(true);
198+
}
199+
}
200+
}
201+
202+
@EventHandler(priority = EventPriority.HIGHEST)
203+
public void onPaintandFlowerInteraction(PlugilyPlayerInteractEvent event) {
204+
Player player = event.getPlayer();
205+
BaseArena arena = plugin.getArenaRegistry().getArena(player);
206+
if(arena == null || event.getClickedBlock() == null) {
207+
return;
208+
}
209+
if(arena.getArenaState() != IArenaState.IN_GAME) {
210+
return;
211+
}
212+
Plot buildPlot = arena.getPlotManager().getPlot(player);
213+
if(event.getClickedBlock().getType() != XMaterial.PAINTING.parseMaterial() && event.getClickedBlock().getType() != XMaterial.FLOWER_POT.parseMaterial()) {
214+
return;
215+
}
216+
if(buildPlot != null && buildPlot.getCuboid() != null && buildPlot.getCuboid().isIn(event.getClickedBlock().getLocation())) {
217+
//need to cancel with highest as minigamescore is blocking it!
218+
event.setCancelled(false);
219+
}
220+
}
221+
158222
@EventHandler
159223
public void onNPCClick(PlugilyPlayerInteractEntityEvent event) {
160224
if(VersionUtils.checkOffHand(event.getHand()) || event.getRightClicked().getType() != EntityType.VILLAGER) {
@@ -227,25 +291,28 @@ public void onEnderchestClick(PlugilyPlayerInteractEvent event) {
227291
return;
228292
}
229293

230-
if(arena.getArenaState() != IArenaState.IN_GAME || event.getClickedBlock().getType() == XMaterial.ENDER_CHEST.parseMaterial()) {
294+
if(event.getClickedBlock().getType() == XMaterial.ENDER_CHEST.parseMaterial()) {
231295
event.setCancelled(true);
232296
}
233297
}
234298

299+
//TODO recognise plot by location should be added, as current check will go through all plots...
300+
//Alternative use filter!!
235301
@EventHandler
236-
public void onMinecartMove(VehicleMoveEvent event) {
302+
public void onVehicleMove(VehicleMoveEvent event) {
237303
Vehicle vehicle = event.getVehicle();
238-
if(vehicle.getType() != EntityType.MINECART) {
239-
return;
240-
}
241304
for(IPluginArena arena : plugin.getArenaRegistry().getArenas()) {
242305
if(!(arena instanceof BaseArena)) {
243306
continue;
244307
}
245308
for(Plot buildPlot : ((BaseArena) arena).getPlotManager().getPlots()) {
246-
if(buildPlot.getCuboid() != null && !buildPlot.getCuboid().isInWithMarge(event.getTo(), -1) && buildPlot.getCuboid().isIn(event.getTo())) {
247-
((Minecart) vehicle).setMaxSpeed(0);
309+
if(buildPlot.getCuboid() != null && !buildPlot.getCuboid().isIn(event.getTo())) {
248310
vehicle.setVelocity(vehicle.getVelocity().zero());
311+
if(vehicle.getType() == XEntityType.MINECART.get()) {
312+
((Minecart) vehicle).setMaxSpeed(0);
313+
} else {
314+
vehicle.remove();
315+
}
249316
}
250317
}
251318
}
@@ -439,7 +506,6 @@ public void onEntityDamageEntity(EntityDamageByEntityEvent event) {
439506
}
440507

441508

442-
443509
@EventHandler(priority = EventPriority.HIGH)
444510
public void onDamage(EntityDamageEvent event) {
445511
if(event.getEntity().getType() != EntityType.PLAYER) {
@@ -511,10 +577,10 @@ public void onOtherBlockExplode(BlockExplodeEvent event) {
511577
public void onEnderpearlThrow(ProjectileLaunchEvent event) {
512578
if(event.getEntity().getShooter() instanceof Player) {
513579
BaseArena arena = plugin.getArenaRegistry().getArena((Player) event.getEntity().getShooter());
514-
if (arena == null || arena.getArenaState() != IArenaState.IN_GAME) {
580+
if(arena == null || arena.getArenaState() != IArenaState.IN_GAME) {
515581
return;
516582
}
517-
if (event.getEntity() instanceof EnderPearl) {
583+
if(event.getEntity() instanceof EnderPearl) {
518584
event.setCancelled(true);
519585
}
520586
}
@@ -534,7 +600,7 @@ public void onWaterFlowEvent(BlockFromToEvent event) {
534600
if(!buildPlot.getCuboid().isIn(toBlock) && buildPlot.getCuboid().isIn(blockLoc)) {
535601
event.setCancelled(true);
536602
}
537-
if(!buildPlot.getCuboid().isInWithMarge(toBlock, -1) && buildPlot.getCuboid().isIn(toBlock)) {
603+
if(!buildPlot.getCuboid().isIn(toBlock)) {
538604
event.setCancelled(true);
539605
}
540606
}
@@ -629,7 +695,7 @@ public void onGTBGuessChat(AsyncPlayerChatEvent event) {
629695
new MessageBuilder("IN_GAME_MESSAGES_PLOT_GTB_THEME_GUESS_BUILDER").asKey().arena(gameArena).player(player).sendPlayer();
630696
return;
631697
}
632-
if(gameArena.getCurrentBBTheme() == null || !gameArena.getCurrentBBTheme().getTheme().equalsIgnoreCase(event.getMessage())) {
698+
if(gameArena.getCurrentBBTheme() == null || gameArena.getCurrentBBTheme().getThemes().stream().noneMatch(theme -> theme.equalsIgnoreCase(event.getMessage()))) {
633699
return;
634700
}
635701
event.setCancelled(true);
@@ -647,4 +713,23 @@ public void onPlayerDropItem(PlayerDropItemEvent event) {
647713
}
648714
}
649715

716+
@EventHandler
717+
public void onVoteInventoryInteractEvent(InventoryCreativeEvent event) {
718+
if(!(event.getWhoClicked() instanceof Player)) {
719+
return;
720+
}
721+
Player player = (Player) event.getWhoClicked();
722+
BaseArena arena = plugin.getArenaRegistry().getArena(player);
723+
if(!(arena instanceof BuildArena)) {
724+
return;
725+
}
726+
if(arena.getArenaState() != IArenaState.IN_GAME) {
727+
return;
728+
}
729+
if(arena.getArenaInGameState() != BaseArena.ArenaInGameState.PLOT_VOTING) {
730+
return;
731+
}
732+
event.setCancelled(true);
733+
}
734+
650735
}

0 commit comments

Comments
 (0)