Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 1 addition & 32 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,7 @@ deploy webhooks to print changelog successfully

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

### 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)
## 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: 4 additions & 10 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 / 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)
# 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)

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

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

## Want to contribute in this project?
Expand All @@ -31,13 +31,7 @@ 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, 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.
Thanks to Code Whale for Open Source license for POEditor project.

## Contributors

Expand Down
12 changes: 2 additions & 10 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-SNAPSHOT17</version>
<version>5.0.15</version>
<name>BuildBattle</name>

<properties>
Expand Down Expand Up @@ -62,14 +62,6 @@
</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 @@ -86,7 +78,7 @@
<dependency>
<groupId>plugily.projects</groupId>
<artifactId>MiniGamesBox-Classic</artifactId>
<version>1.4.3</version>
<version>1.4.1</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
Expand Down
9 changes: 0 additions & 9 deletions src/main/java/plugily/projects/buildbattle/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@
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 @@ -50,7 +48,6 @@
public class Main extends PluginMain {

private VoteItems voteItems;
private HeadDatabaseManager headDatabaseManager;
private ThemeManager themeManager;
private BlacklistManager blacklistManager;
private OptionsRegistry optionsRegistry;
Expand All @@ -68,7 +65,6 @@ 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 @@ -85,7 +81,6 @@ 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 @@ -116,10 +111,6 @@ 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.GuessTheme;
import plugily.projects.buildbattle.handlers.themes.BBTheme;
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 GuessTheme theme;
private final BBTheme theme;

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

public GuessTheme getTheme() {
public BBTheme getTheme() {
return theme;
}
}
111 changes: 13 additions & 98 deletions src/main/java/plugily/projects/buildbattle/arena/ArenaEvents.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@
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 @@ -53,7 +51,6 @@
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 @@ -94,27 +91,9 @@ 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 @@ -176,49 +155,6 @@ 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 @@ -291,28 +227,25 @@ public void onEnderchestClick(PlugilyPlayerInteractEvent event) {
return;
}

if(event.getClickedBlock().getType() == XMaterial.ENDER_CHEST.parseMaterial()) {
if(arena.getArenaState() != IArenaState.IN_GAME || 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 onVehicleMove(VehicleMoveEvent event) {
public void onMinecartMove(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().isIn(event.getTo())) {
if(buildPlot.getCuboid() != null && !buildPlot.getCuboid().isInWithMarge(event.getTo(), -1) && buildPlot.getCuboid().isIn(event.getTo())) {
((Minecart) vehicle).setMaxSpeed(0);
vehicle.setVelocity(vehicle.getVelocity().zero());
if(vehicle.getType() == XEntityType.MINECART.get()) {
((Minecart) vehicle).setMaxSpeed(0);
} else {
vehicle.remove();
}
}
}
}
Expand Down Expand Up @@ -506,6 +439,7 @@ public void onEntityDamageEntity(EntityDamageByEntityEvent event) {
}



@EventHandler(priority = EventPriority.HIGH)
public void onDamage(EntityDamageEvent event) {
if(event.getEntity().getType() != EntityType.PLAYER) {
Expand Down Expand Up @@ -577,10 +511,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 @@ -600,7 +534,7 @@ public void onWaterFlowEvent(BlockFromToEvent event) {
if(!buildPlot.getCuboid().isIn(toBlock) && buildPlot.getCuboid().isIn(blockLoc)) {
event.setCancelled(true);
}
if(!buildPlot.getCuboid().isIn(toBlock)) {
if(!buildPlot.getCuboid().isInWithMarge(toBlock, -1) && buildPlot.getCuboid().isIn(toBlock)) {
event.setCancelled(true);
}
}
Expand Down Expand Up @@ -695,7 +629,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().getThemes().stream().noneMatch(theme -> theme.equalsIgnoreCase(event.getMessage()))) {
if(gameArena.getCurrentBBTheme() == null || !gameArena.getCurrentBBTheme().getTheme().equalsIgnoreCase(event.getMessage())) {
return;
}
event.setCancelled(true);
Expand All @@ -713,23 +647,4 @@ 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
Loading