mirror of
https://github.com/Plugily-Projects/BuildBattle.git
synced 2026-11-04 08:32:10 -05:00
Compare commits
No files matched your search
+137
-1
@@ -1,3 +1,6 @@
|
||||
### 5.1.7 Release (10.10.2026)
|
||||
* Changed Minigamesbox to 1.4.11
|
||||
|
||||
## Build Battle Changelog
|
||||
|
||||
Changelog is followed by special scheme which is required in order to allow automatic discord
|
||||
@@ -10,6 +13,139 @@ deploy webhooks to print changelog successfully
|
||||
|
||||
That's all, matcher will stop when detects next line started with `###` match
|
||||
|
||||
### 5.1.4 Release (14.05.2026)
|
||||
* Updated to MinigamesBox 1.4.6
|
||||
|
||||
### 5.1.3 Release
|
||||
* Fixed startup issue on 1.21.9+ because of Heads not loading
|
||||
|
||||
### 5.1.2 Release
|
||||
* Fixed InventoryView not interface on getGui @VoteMenu
|
||||
* Fixed Method 'org.bukkit.block.banner.PatternType[] org.bukkit.block.banner.PatternType.values()' must be Methodref constant
|
||||
* Fixed InventoryView not interface onItemMove
|
||||
* Fixed vehicle moving outside of arena plots and other worlds
|
||||
|
||||
### 5.1.1 Release
|
||||
* Fixed liquid flow outside plots and different worlds
|
||||
* Fixed forceplay console command without theme
|
||||
|
||||
### 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
|
||||
* Added filter to maxplayers/random join team / solo so that only the correct arenas are selected
|
||||
* Updated Minigamesbox to 1.4.1
|
||||
|
||||
### 5.0.14 Release (13.03.2025)
|
||||
* Changed plot distribution on team mode tries to create only full plots now
|
||||
* Fixed plot distribution in same cases lets spectators into the plot as member
|
||||
* Fixed game ending due to not enough players counted spectators
|
||||
* Updated to minigamesbox 1.4.0
|
||||
|
||||
### 5.0.13 Release (18.02.2025)
|
||||
* Fixed Progress must be between 0 and 1
|
||||
|
||||
### 5.0.12 Release (17.02.2025)
|
||||
* Fixed ItemSpawn on Plotarea also for dropped items by not player related drops
|
||||
* Fixed gtb plot reset
|
||||
* Fixed gtb Arena CleanUp which results in first round issues at selection of theme etc.
|
||||
* Fixed gtb options menu is not showing up for every builder
|
||||
* Fixed block destroy drops
|
||||
* Fixed a bug on gtb where players were getting points for guess even when they wrote the theme on chat when it was already shown by the plugin
|
||||
* Fixed spectator counts on gtb guess
|
||||
* Fixed bba settheme command
|
||||
* Fixed PlayerHeads on 1.20+
|
||||
* Fixed clearing of dropped items on 1.21+
|
||||
* Fixed Biomes on 1.21
|
||||
* Fixed Banner Building on 1.20+
|
||||
* Fixed Creature Spawning outside plots in same world
|
||||
* Fixed players are collidable on normal mode
|
||||
* Changed stained glass pane naming to ???
|
||||
* Updated to minigamesbox 1.3.16
|
||||
|
||||
|
||||
### 5.0.9 Release (09.07.2024)
|
||||
* Updated to minigamesbox 1.3.11
|
||||
* Fixed ChunkManager.sendMapChunk
|
||||
* Fixed error in time change menu
|
||||
* Fixed issue with %player% placeholder (should be lowercase)
|
||||
* Fixed problem in place rewards
|
||||
* Fixed small error if non-player threw projectile.
|
||||
* Added Cancel of BlockExplodeEvent to prevent blocks such as Respawn Anchor explode and damage the arena
|
||||
* Added Disabled enderpearl throwing while in arena because it allows to teleport to other players plots or outside the arena map, even during voting stage.
|
||||
|
||||
### 5.0.8 Release (25.06.2024)
|
||||
* Updated to minigamesbox 1.3.9
|
||||
|
||||
### 5.0.7 Release (18.06.2024)
|
||||
* API update
|
||||
|
||||
### 5.0.6 Release (24.04.2024)
|
||||
* Updated to minigamesbox 1.3.8
|
||||
|
||||
### 5.0.5 Release (15.01.2024)
|
||||
* Updated to minigamesbox 1.3.7
|
||||
|
||||
### 5.0.4 Release (13.01.2024)
|
||||
* Updated to minigamesbox 1.3.6
|
||||
|
||||
### 5.0.3 Release (03.01.2024)
|
||||
* Added new command /bba locale <locale> to set your locale
|
||||
* Fixed GameProfile API 1.20 change
|
||||
* Fixed none kits related plugins issues
|
||||
|
||||
### 5.0.2 Release (31.12.2023)
|
||||
* Fixed gtb round reset on player leave
|
||||
* Fixed gtb "could not pass event AsyncPlayerChatEvent" if spectators ingame
|
||||
* Fixed bouncing and mouse pointer reset on themevoting
|
||||
* Added 1.20.3 & 1.20.4 support
|
||||
* Updated to minigamesbox 1.3.4
|
||||
|
||||
### 5.0.1 Release (21.08.2023)
|
||||
* Fixed rewards enabling
|
||||
* Fixed bossbar disabling
|
||||
* Fixed locale registration if service unavailable
|
||||
|
||||
### 5.0.0 Release (09.08.2023)
|
||||
* Added up to 1.20 compatibility
|
||||
* Changed arena solo and team to classic, with different team sizes
|
||||
* Changed supported languages [https://translate.plugily.xyz]
|
||||
* Changed plugin base is based on MinigamesCore [https://github.com/Plugily-Projects/MiniGamesBox]
|
||||
* Changed native java building to java17, java 8 downloadable on our discord [https://discord.plugily.xyz]
|
||||
* Fixed gtb mode issues
|
||||
* Fixed all known bugs
|
||||
|
||||
### 4.5.3 Release (04.08.2021 - xx.xx.2021)
|
||||
|
||||
* Fixed when players didn't got rewards after plot reset
|
||||
@@ -595,4 +731,4 @@ it will have BEDROCK value if absent
|
||||
|
||||
### 3.0.0 Release (14.05.2018 - 01.06.2018)
|
||||
|
||||
* Add everything here
|
||||
* Add everything here
|
||||
+10
-4
@@ -1,11 +1,11 @@
|
||||

|
||||
|
||||
# Build Battle [](https://maven.plugily.xyz/#/releases/plugily/projects/buildbattle) [](https://maven.plugily.xyz/javadoc/releases/plugily/projects/buildbattle/latest) [](https://sonarcloud.io/summary/overall?id=Plugily-Projects_BuildBattle) [](https://discord.plugily.xyz) [](https://patreon.com/plugily)
|
||||
# Build Battle / Guess The Build [](https://maven.plugily.xyz/#/releases/plugily/projects/buildbattle) [](https://maven.plugily.xyz/javadoc/releases/plugily/projects/buildbattle/latest) [](https://sonarcloud.io/summary/overall?id=Plugily-Projects_BuildBattle) [](https://discord.plugily.xyz) [](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?
|
||||
@@ -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/)
|
||||
|
||||
Thanks to Minecraft Heads to let us use the Name and Textures of the heads to provide you a better heads experience ingame.
|
||||
|
||||
## Contributors
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
/*
|
||||
*
|
||||
* BuildBattle - Ultimate building competition minigame
|
||||
@@ -21,7 +22,7 @@
|
||||
plugins {
|
||||
id("signing")
|
||||
`maven-publish`
|
||||
id("com.github.johnrengelman.shadow") version "8.1.1"
|
||||
id ("com.gradleup.shadow") version "9.0.0-beta5"
|
||||
java
|
||||
}
|
||||
|
||||
@@ -30,7 +31,10 @@ repositories {
|
||||
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
|
||||
maven("https://oss.sonatype.org/content/repositories/snapshots")
|
||||
maven("https://oss.sonatype.org/content/repositories/central")
|
||||
maven(uri("https://papermc.io/repo/repository/maven-public/"))
|
||||
maven {
|
||||
name = "papermc"
|
||||
url = uri("https://repo.papermc.io/repository/maven-public/")
|
||||
}
|
||||
maven(uri("https://maven.plugily.xyz/releases"))
|
||||
maven(uri("https://maven.plugily.xyz/snapshots"))
|
||||
maven(uri("https://repo.citizensnpcs.co/"))
|
||||
@@ -38,14 +42,14 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("plugily.projects:MiniGamesBox-Classic:1.3.2") { isTransitive = false }
|
||||
compileOnly("org.spigotmc:spigot-api:1.19.3-R0.1-SNAPSHOT")
|
||||
implementation("plugily.projects:MiniGamesBox-Classic:1.3.17") { isTransitive = false }
|
||||
compileOnly("io.papermc.paper:paper-api:1.21.4-R0.1-SNAPSHOT")
|
||||
compileOnly("net.citizensnpcs:citizensapi:2.0.31-SNAPSHOT")
|
||||
compileOnly("org.jetbrains:annotations:24.0.1")
|
||||
}
|
||||
|
||||
group = "plugily.projects"
|
||||
version = "5.0.0"
|
||||
version = "5.0.13-SNAPSHOT4"
|
||||
description = "BuildBattle"
|
||||
|
||||
java {
|
||||
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,206 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~
|
||||
~ BuildBattle - Ultimate building competition minigame
|
||||
~ Copyright (C) 2021 Plugily Projects - maintained by Tigerpanzer_02, 2Wild4You and contributors
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
~
|
||||
-->
|
||||
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>plugily.projects</groupId>
|
||||
<artifactId>buildbattle</artifactId>
|
||||
<version>5.0.14-SNAPSHOT1</version>
|
||||
<name>BuildBattle</name>
|
||||
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>papermc</id>
|
||||
<url>https://repo.papermc.io/repository/maven-public/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>plugilyprojects</id>
|
||||
<url>https://maven.plugily.xyz/releases</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>plugilyprojects-snapshots</id>
|
||||
<url>https://maven.plugily.xyz/snapshots</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>jitpack</id>
|
||||
<url>https://jitpack.io</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>spigot-repo</id>
|
||||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>citizens-repo</id>
|
||||
<url>https://repo.citizensnpcs.co/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.papermc.paper</groupId>
|
||||
<artifactId>paper-api</artifactId>
|
||||
<version>1.21.4-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.jetbrains/annotations -->
|
||||
<dependency>
|
||||
<groupId>org.jetbrains</groupId>
|
||||
<artifactId>annotations</artifactId>
|
||||
<version>23.0.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>plugily.projects</groupId>
|
||||
<artifactId>MiniGamesBox-Classic</artifactId>
|
||||
<version>1.4.0</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.citizensnpcs</groupId>
|
||||
<artifactId>citizensapi</artifactId>
|
||||
<version>2.0.26-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>ch.ethz.globis.phtree</groupId>
|
||||
<artifactId>phtree</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.14.0</version>
|
||||
<configuration>
|
||||
<source>${java.version}</source>
|
||||
<target>${java.version}</target>
|
||||
<encoding>UTF-8</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-site-plugin</artifactId>
|
||||
<version>3.21.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<version>3.1.4</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-project-info-reports-plugin</artifactId>
|
||||
<version>3.9.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.11.2</version>
|
||||
<configuration>
|
||||
<windowtitle>BuildBattle API docs for v${project.version}</windowtitle>
|
||||
<description>Minecraft building minigame.
|
||||
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.
|
||||
</description>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.4.2</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.6.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<minimizeJar>true</minimizeJar>
|
||||
<relocations>
|
||||
<relocation>
|
||||
<pattern>com.zaxxer.hikari</pattern>
|
||||
<shadedPattern>plugily.projects.buildbattle.database.hikari</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>plugily.projects.minigamesbox</pattern>
|
||||
<shadedPattern>plugily.projects.buildbattle.minigamesbox</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<!-- External beta versions discord deployer plugin -->
|
||||
<plugin>
|
||||
<groupId>plugily.projects</groupId>
|
||||
<artifactId>betty-maven-plugin</artifactId>
|
||||
<version>1.0.2</version>
|
||||
<configuration>
|
||||
<changelogFile>${project.basedir}/CHANGELOG.md</changelogFile>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!-- External beta versions discord deployer plugin -->
|
||||
</plugins>
|
||||
<extensions>
|
||||
<extension>
|
||||
<groupId>org.apache.maven.wagon</groupId>
|
||||
<artifactId>wagon-ssh</artifactId>
|
||||
<version>3.5.3</version>
|
||||
</extension>
|
||||
</extensions>
|
||||
</build>
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>Release</id>
|
||||
<url>https://maven.plugily.xyz/releases</url>
|
||||
</repository>
|
||||
<snapshotRepository>
|
||||
<id>Snapshot</id>
|
||||
<url>https://maven.plugily.xyz/snapshots</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>
|
||||
</project>
|
||||
File renamed without changes.
@@ -9,12 +9,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Latest Commit
|
||||
uses: actions/checkout@v3
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
uses: actions/checkout@v6.0.3
|
||||
- name: Bump Version
|
||||
id: bump
|
||||
uses: Plugily-Projects/version-bump-action@v8
|
||||
uses: Plugily-Projects/version-bump-action@v10
|
||||
with:
|
||||
github-token: ${{ secrets.github_token }}
|
||||
auto-version-bump: true
|
||||
@@ -25,19 +23,32 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Latest Commit
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6.0.3
|
||||
with:
|
||||
ref: 'development'
|
||||
- name: Set up JDK
|
||||
uses: actions/setup-java@v3
|
||||
uses: actions/setup-java@v5.2.0
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '17'
|
||||
java-version: '21'
|
||||
java-package: jdk
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
- name: Publish with Gradle
|
||||
run: ./gradlew publishMavenPublicationToSnapshotsRepository
|
||||
env:
|
||||
MAVEN_USERNAME: ${{ secrets.SNAPSHOTSUSERNAME }}
|
||||
MAVEN_PASSWORD: ${{ secrets.SNAPSHOTSPASSWORD }}
|
||||
- name: Set up Maven
|
||||
uses: stCarolas/setup-maven@v5.1
|
||||
with:
|
||||
maven-version: 3.8.2
|
||||
- name: Cache
|
||||
uses: actions/cache@v5.0.5
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: maven-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: maven-
|
||||
- name: Publish with Maven
|
||||
uses: s4u/maven-settings-action@v4.0.0
|
||||
with:
|
||||
servers: |
|
||||
[{
|
||||
"id": "Snapshot",
|
||||
"username": "${{ secrets.SNAPSHOTSUSERNAME }}",
|
||||
"password": "${{ secrets.SNAPSHOTSPASSWORD }}"
|
||||
}]
|
||||
- run: mvn clean verify compile package site:site javadoc:javadoc javadoc:jar deploy -DaltDeploymentRepository=Snapshot::https://maven.plugily.xyz/snapshots -f pom.xml
|
||||
@@ -11,12 +11,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Latest Commit
|
||||
uses: actions/checkout@v3
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
uses: actions/checkout@v6.0.3
|
||||
- name: Bump Version
|
||||
id: bump
|
||||
uses: Plugily-Projects/version-bump-action@v8
|
||||
uses: Plugily-Projects/version-bump-action@v10
|
||||
with:
|
||||
github-token: ${{ secrets.github_token }}
|
||||
auto-version-bump: false
|
||||
@@ -28,19 +26,32 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Latest Commit
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6.0.3
|
||||
with:
|
||||
ref: 'master'
|
||||
- name: Set up JDK
|
||||
uses: actions/setup-java@v3
|
||||
uses: actions/setup-java@v5.2.0
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '17'
|
||||
java-version: '21'
|
||||
java-package: jdk
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
- name: Publish with Gradle
|
||||
run: ./gradlew publishMavenPublicationToReleasesRepository
|
||||
env:
|
||||
MAVEN_USERNAME: ${{ secrets.RELEASESUSERNAME }}
|
||||
MAVEN_PASSWORD: ${{ secrets.RELEASESPASSWORD }}
|
||||
- name: Set up Maven
|
||||
uses: stCarolas/setup-maven@v5.1
|
||||
with:
|
||||
maven-version: 3.8.2
|
||||
- name: Cache
|
||||
uses: actions/cache@v5.0.5
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: maven-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: maven-
|
||||
- name: Publish with Maven
|
||||
uses: s4u/maven-settings-action@v4.0.0
|
||||
with:
|
||||
servers: |
|
||||
[{
|
||||
"id": "Release",
|
||||
"username": "${{ secrets.RELEASESUSERNAME }}",
|
||||
"password": "${{ secrets.RELEASESPASSWORD }}"
|
||||
}]
|
||||
- run: mvn clean verify compile package site:site javadoc:javadoc javadoc:jar deploy -DaltDeploymentRepository=Release::https://maven.plugily.xyz/releases -f pom.xml
|
||||
+634
@@ -0,0 +1,634 @@
|
||||
# License
|
||||
|
||||
BuildBattle - Ultimate building competition minigame.
|
||||
Copyright (C) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with this program below. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of this
|
||||
License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
+2
-21
@@ -1,26 +1,7 @@
|
||||
#
|
||||
#
|
||||
# BuildBattle - Ultimate building competition minigame
|
||||
# Copyright (C) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
#
|
||||
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -0,0 +1,214 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~
|
||||
~ BuildBattle - Ultimate building competition minigame
|
||||
~ Copyright (C) 2021 Plugily Projects - maintained by Tigerpanzer_02, 2Wild4You and contributors
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
~
|
||||
-->
|
||||
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>plugily.projects</groupId>
|
||||
<artifactId>buildbattle</artifactId>
|
||||
<version>5.1.8</version>
|
||||
<name>BuildBattle</name>
|
||||
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>papermc</id>
|
||||
<url>https://repo.papermc.io/repository/maven-public/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>plugilyprojects</id>
|
||||
<url>https://maven.plugily.xyz/releases</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>plugilyprojects-snapshots</id>
|
||||
<url>https://maven.plugily.xyz/snapshots</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>jitpack</id>
|
||||
<url>https://jitpack.io</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>spigot-repo</id>
|
||||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>citizens-repo</id>
|
||||
<url>https://repo.citizensnpcs.co/</url>
|
||||
</repository>
|
||||
</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>
|
||||
<version>1.21.4-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.jetbrains/annotations -->
|
||||
<dependency>
|
||||
<groupId>org.jetbrains</groupId>
|
||||
<artifactId>annotations</artifactId>
|
||||
<version>23.0.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>plugily.projects</groupId>
|
||||
<artifactId>MiniGamesBox-Classic</artifactId>
|
||||
<version>1.4.11</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.citizensnpcs</groupId>
|
||||
<artifactId>citizensapi</artifactId>
|
||||
<version>2.0.26-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>ch.ethz.globis.phtree</groupId>
|
||||
<artifactId>phtree</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.14.0</version>
|
||||
<configuration>
|
||||
<source>${java.version}</source>
|
||||
<target>${java.version}</target>
|
||||
<encoding>UTF-8</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-site-plugin</artifactId>
|
||||
<version>3.21.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<version>3.1.4</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-project-info-reports-plugin</artifactId>
|
||||
<version>3.9.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.11.2</version>
|
||||
<configuration>
|
||||
<windowtitle>BuildBattle API docs for v${project.version}</windowtitle>
|
||||
<description>Minecraft building minigame.
|
||||
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.
|
||||
</description>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.4.2</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.6.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<minimizeJar>true</minimizeJar>
|
||||
<relocations>
|
||||
<relocation>
|
||||
<pattern>com.zaxxer.hikari</pattern>
|
||||
<shadedPattern>plugily.projects.buildbattle.database.hikari</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>plugily.projects.minigamesbox</pattern>
|
||||
<shadedPattern>plugily.projects.buildbattle.minigamesbox</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<!-- External beta versions discord deployer plugin -->
|
||||
<plugin>
|
||||
<groupId>plugily.projects</groupId>
|
||||
<artifactId>betty-maven-plugin</artifactId>
|
||||
<version>1.0.2</version>
|
||||
<configuration>
|
||||
<changelogFile>${project.basedir}/CHANGELOG.md</changelogFile>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!-- External beta versions discord deployer plugin -->
|
||||
</plugins>
|
||||
<extensions>
|
||||
<extension>
|
||||
<groupId>org.apache.maven.wagon</groupId>
|
||||
<artifactId>wagon-ssh</artifactId>
|
||||
<version>3.5.3</version>
|
||||
</extension>
|
||||
</extensions>
|
||||
</build>
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>Release</id>
|
||||
<url>https://maven.plugily.xyz/releases</url>
|
||||
</repository>
|
||||
<snapshotRepository>
|
||||
<id>Snapshot</id>
|
||||
<url>https://maven.plugily.xyz/snapshots</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>
|
||||
</project>
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
<groupId>plugily.projects</groupId>
|
||||
<artifactId>buildbattle</artifactId>
|
||||
<version>5.0.0</version>
|
||||
<version>5.0.13-SNAPSHOT4</version>
|
||||
<name>BuildBattle</name>
|
||||
|
||||
<properties>
|
||||
@@ -37,7 +37,7 @@
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>papermc</id>
|
||||
<url>https://papermc.io/repo/repository/maven-public/</url>
|
||||
<url>https://repo.papermc.io/repository/maven-public/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>plugilyprojects</id>
|
||||
@@ -69,7 +69,7 @@
|
||||
<dependency>
|
||||
<groupId>io.papermc.paper</groupId>
|
||||
<artifactId>paper-api</artifactId>
|
||||
<version>1.19.1-R0.1-SNAPSHOT</version>
|
||||
<version>1.21.4-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.jetbrains/annotations -->
|
||||
@@ -82,7 +82,7 @@
|
||||
<dependency>
|
||||
<groupId>plugily.projects</groupId>
|
||||
<artifactId>MiniGamesBox-Classic</artifactId>
|
||||
<version>1.2.0-SNAPSHOT51</version>
|
||||
<version>1.3.17-SNAPSHOT10</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
@@ -108,41 +108,51 @@
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-site-plugin</artifactId>
|
||||
<version>3.12.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.10.1</version>
|
||||
<goals>
|
||||
<goal>compile</goal>
|
||||
</goals>
|
||||
<version>3.14.0</version>
|
||||
<configuration>
|
||||
<source>${java.version}</source>
|
||||
<target>${java.version}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-site-plugin</artifactId>
|
||||
<version>3.21.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<version>3.1.4</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-project-info-reports-plugin</artifactId>
|
||||
<version>3.9.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.4.0</version>
|
||||
<version>3.11.2</version>
|
||||
<configuration>
|
||||
<destDir>minecraft/buildbattle</destDir>
|
||||
<isOffline>false</isOffline>
|
||||
<windowtitle>Murder Mystery API docs for v${project.version}</windowtitle>
|
||||
<description>Minecraft survival minigame.
|
||||
Be the murderer, innocent or the detective! Don't be killed during the game to win! API
|
||||
documentation for hooking Murder Mystery with your plugin.
|
||||
</description>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.2.2</version>
|
||||
<version>3.4.2</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.3.0</version>
|
||||
<version>3.6.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
@@ -159,10 +169,6 @@
|
||||
<pattern>plugily.projects.minigamesbox</pattern>
|
||||
<shadedPattern>plugily.projects.buildbattle.minigamesbox</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>plugily.projects.commonsbox</pattern>
|
||||
<shadedPattern>plugily.projects.buildbattle.commonsbox</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||
</configuration>
|
||||
@@ -185,14 +191,18 @@
|
||||
<extension>
|
||||
<groupId>org.apache.maven.wagon</groupId>
|
||||
<artifactId>wagon-ssh</artifactId>
|
||||
<version>3.5.2</version>
|
||||
<version>3.5.3</version>
|
||||
</extension>
|
||||
</extensions>
|
||||
</build>
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>plugily-projects</id>
|
||||
<id>Release</id>
|
||||
<url>https://maven.plugily.xyz/releases</url>
|
||||
</repository>
|
||||
<snapshotRepository>
|
||||
<id>Snapshot</id>
|
||||
<url>https://maven.plugily.xyz/snapshots</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>
|
||||
</project>
|
||||
</project>
|
||||
@@ -20,8 +20,6 @@
|
||||
|
||||
package plugily.projects.buildbattle;
|
||||
|
||||
import org.bukkit.plugin.PluginDescriptionFile;
|
||||
import org.bukkit.plugin.java.JavaPluginLoader;
|
||||
import org.jetbrains.annotations.TestOnly;
|
||||
import plugily.projects.buildbattle.arena.ArenaEvents;
|
||||
import plugily.projects.buildbattle.arena.ArenaManager;
|
||||
@@ -34,8 +32,10 @@ import plugily.projects.buildbattle.boot.AdditionalValueInitializer;
|
||||
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;
|
||||
@@ -43,8 +43,6 @@ import plugily.projects.minigamesbox.classic.handlers.setup.SetupInventory;
|
||||
import plugily.projects.minigamesbox.classic.handlers.setup.categories.PluginSetupCategoryManager;
|
||||
import plugily.projects.minigamesbox.classic.utils.services.metrics.Metrics;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* Created by Tom on 17/08/2015.
|
||||
* Updated by Tigerpanzer_02 on 03.12.2021
|
||||
@@ -52,6 +50,7 @@ import java.io.File;
|
||||
public class Main extends PluginMain {
|
||||
|
||||
private VoteItems voteItems;
|
||||
private HeadDatabaseManager headDatabaseManager;
|
||||
private ThemeManager themeManager;
|
||||
private BlacklistManager blacklistManager;
|
||||
private OptionsRegistry optionsRegistry;
|
||||
@@ -66,14 +65,10 @@ public class Main extends PluginMain {
|
||||
super();
|
||||
}
|
||||
|
||||
@TestOnly
|
||||
protected Main(JavaPluginLoader loader, PluginDescriptionFile description, File dataFolder, File file) {
|
||||
super(loader, description, dataFolder, file);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
long start = System.currentTimeMillis();
|
||||
new LanguageMigrator(this);
|
||||
MessageInitializer messageInitializer = new MessageInitializer(this);
|
||||
super.onEnable();
|
||||
getDebugger().debug("[System] [Plugin] Initialization start");
|
||||
@@ -90,6 +85,7 @@ public class Main extends PluginMain {
|
||||
addFileName("themes");
|
||||
addFileName("vote_items");
|
||||
blacklistManager = new BlacklistManager(this);
|
||||
headDatabaseManager = new HeadDatabaseManager(this);
|
||||
themeManager = new ThemeManager(this);
|
||||
BaseArena.init(this);
|
||||
new ArenaEvents(this);
|
||||
@@ -120,6 +116,10 @@ public class Main extends PluginMain {
|
||||
return voteItems;
|
||||
}
|
||||
|
||||
public HeadDatabaseManager getHeadDatabaseManager() {
|
||||
return headDatabaseManager;
|
||||
}
|
||||
|
||||
public ThemeManager getThemeManager() {
|
||||
return themeManager;
|
||||
}
|
||||
|
||||
+5
-5
@@ -22,8 +22,8 @@ package plugily.projects.buildbattle.api.event.guess;
|
||||
|
||||
import org.bukkit.event.HandlerList;
|
||||
import plugily.projects.buildbattle.arena.GuessArena;
|
||||
import plugily.projects.buildbattle.handlers.themes.BBTheme;
|
||||
import plugily.projects.minigamesbox.classic.api.event.PlugilyEvent;
|
||||
import plugily.projects.buildbattle.handlers.themes.GuessTheme;
|
||||
import plugily.projects.minigamesbox.api.events.PlugilyEvent;
|
||||
|
||||
|
||||
/**
|
||||
@@ -35,9 +35,9 @@ import plugily.projects.minigamesbox.classic.api.event.PlugilyEvent;
|
||||
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;
|
||||
}
|
||||
@@ -51,7 +51,7 @@ public class PlayerThemeGuessEvent extends PlugilyEvent {
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
public BBTheme getTheme() {
|
||||
public GuessTheme getTheme() {
|
||||
return theme;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -25,7 +25,7 @@ import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import plugily.projects.buildbattle.arena.BaseArena;
|
||||
import plugily.projects.buildbattle.arena.managers.plots.Plot;
|
||||
import plugily.projects.minigamesbox.classic.api.event.PlugilyEvent;
|
||||
import plugily.projects.minigamesbox.api.events.PlugilyEvent;
|
||||
|
||||
public class PlotPlayerChooseEvent extends PlugilyEvent implements Cancellable {
|
||||
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ package plugily.projects.buildbattle.api.event.plot;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import plugily.projects.buildbattle.arena.BaseArena;
|
||||
import plugily.projects.buildbattle.arena.managers.plots.Plot;
|
||||
import plugily.projects.minigamesbox.classic.api.event.PlugilyEvent;
|
||||
import plugily.projects.minigamesbox.api.events.PlugilyEvent;
|
||||
|
||||
/**
|
||||
* @author Plajer
|
||||
|
||||
@@ -23,7 +23,7 @@ package plugily.projects.buildbattle.api.event.plot;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import plugily.projects.buildbattle.arena.BaseArena;
|
||||
import plugily.projects.buildbattle.arena.managers.plots.Plot;
|
||||
import plugily.projects.minigamesbox.classic.api.event.PlugilyEvent;
|
||||
import plugily.projects.minigamesbox.api.events.PlugilyEvent;
|
||||
|
||||
/**
|
||||
* @author Plajer
|
||||
|
||||
@@ -31,8 +31,9 @@ import org.bukkit.event.EventHandler;
|
||||
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.InventoryCloseEvent;
|
||||
import org.bukkit.event.inventory.InventoryCreativeEvent;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
import org.bukkit.event.player.PlayerBucketEmptyEvent;
|
||||
@@ -43,8 +44,8 @@ import org.bukkit.event.world.StructureGrowEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import plugily.projects.buildbattle.Main;
|
||||
import plugily.projects.buildbattle.arena.managers.plots.Plot;
|
||||
import plugily.projects.minigamesbox.classic.arena.ArenaState;
|
||||
import plugily.projects.minigamesbox.classic.arena.PluginArena;
|
||||
import plugily.projects.minigamesbox.api.arena.IArenaState;
|
||||
import plugily.projects.minigamesbox.api.arena.IPluginArena;
|
||||
import plugily.projects.minigamesbox.classic.arena.PluginArenaEvents;
|
||||
import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder;
|
||||
import plugily.projects.minigamesbox.classic.utils.version.ServerVersion;
|
||||
@@ -52,7 +53,9 @@ import plugily.projects.minigamesbox.classic.utils.version.VersionUtils;
|
||||
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;
|
||||
import plugily.projects.minigamesbox.classic.utils.version.xseries.inventory.XInventoryView;
|
||||
|
||||
/**
|
||||
* @author Plajer
|
||||
@@ -74,7 +77,7 @@ public class ArenaEvents extends PluginArenaEvents {
|
||||
if(arena == null) {
|
||||
return;
|
||||
}
|
||||
if(arena.getArenaState() != ArenaState.IN_GAME || (arena instanceof BuildArena && arena.getArenaInGameState() == BaseArena.ArenaInGameState.PLOT_VOTING)
|
||||
if(arena.getArenaState() != IArenaState.IN_GAME || (arena instanceof BuildArena && arena.getArenaInGameState() == BaseArena.ArenaInGameState.PLOT_VOTING)
|
||||
|| plugin.getBlacklistManager().getItemList().contains(event.getBlock().getType())) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
@@ -84,18 +87,60 @@ public class ArenaEvents extends PluginArenaEvents {
|
||||
|
||||
if(buildPlot != null && buildPlot.getCuboid() != null && buildPlot.getCuboid().isIn(event.getBlock().getLocation())) {
|
||||
plugin.getUserManager().getUser(event.getPlayer()).adjustStatistic("BLOCKS_BROKEN", 1);
|
||||
if(event.isDropItems()) {
|
||||
event.getBlock().getDrops().clear();
|
||||
}
|
||||
return;
|
||||
}
|
||||
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())) {
|
||||
return;
|
||||
}
|
||||
|
||||
plugin.getArenaRegistry().getArenas().forEach(arena -> {
|
||||
if(!(arena instanceof BaseArena)) {
|
||||
return;
|
||||
}
|
||||
if(((BaseArena) arena).getArenaInGameState() != BaseArena.ArenaInGameState.BUILD_TIME || plugin.getBlacklistManager().getItemList().contains(event.getEntity().getItemStack().getType())) {
|
||||
return;
|
||||
}
|
||||
for(Plot buildPlot : ((BaseArena) arena).getPlotManager().getPlots()) {
|
||||
if(buildPlot.getCuboid() != null && buildPlot.getCuboid().isInWithMarge(event.getLocation(), 1)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void onPlace(BlockPlaceEvent event) {
|
||||
BaseArena arena = plugin.getArenaRegistry().getArena(event.getPlayer());
|
||||
if(arena == null) {
|
||||
return;
|
||||
}
|
||||
if(arena.getArenaState() != ArenaState.IN_GAME || plugin.getBlacklistManager().getItemList().contains(event.getBlock().getType())
|
||||
if(arena.getArenaState() != IArenaState.IN_GAME || plugin.getBlacklistManager().getItemList().contains(event.getBlock().getType())
|
||||
|| (arena instanceof BuildArena && arena.getArenaInGameState() == BaseArena.ArenaInGameState.PLOT_VOTING)) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
@@ -119,7 +164,7 @@ public class ArenaEvents extends PluginArenaEvents {
|
||||
if(event.getRightClicked().getType() == EntityType.ITEM_FRAME && ((ItemFrame) event.getRightClicked()).getItem().getType() != Material.AIR) {
|
||||
Location entityLocation = event.getRightClicked().getLocation();
|
||||
|
||||
for(PluginArena arena : plugin.getArenaRegistry().getArenas()) {
|
||||
for(IPluginArena arena : plugin.getArenaRegistry().getArenas()) {
|
||||
if(!(arena instanceof BaseArena)) {
|
||||
continue;
|
||||
}
|
||||
@@ -132,6 +177,49 @@ public class ArenaEvents extends PluginArenaEvents {
|
||||
}
|
||||
}
|
||||
|
||||
@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) {
|
||||
@@ -146,7 +234,7 @@ public class ArenaEvents extends PluginArenaEvents {
|
||||
|
||||
BaseArena arena = plugin.getArenaRegistry().getArena(event.getPlayer());
|
||||
|
||||
if(arena == null || arena.getArenaState() != ArenaState.IN_GAME) {
|
||||
if(arena == null || arena.getArenaState() != IArenaState.IN_GAME) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -189,7 +277,7 @@ public class ArenaEvents extends PluginArenaEvents {
|
||||
if(playerPlot != null) {
|
||||
|
||||
// Prevent "Legacy material support initialisation"
|
||||
playerPlot.changeFloor(material, ServerVersion.Version.isCurrentEqualOrLower(ServerVersion.Version.v1_12_R1) ? hand.getData().getData() : 0);
|
||||
playerPlot.changeFloor(material, ServerVersion.Version.isCurrentEqualOrLower(ServerVersion.Version.v1_12) ? hand.getData().getData() : 0);
|
||||
new MessageBuilder("MENU_OPTION_CONTENT_FLOOR_CHANGED").asKey().player(event.getPlayer()).sendPlayer();
|
||||
}
|
||||
}
|
||||
@@ -204,25 +292,27 @@ public class ArenaEvents extends PluginArenaEvents {
|
||||
return;
|
||||
}
|
||||
|
||||
if(arena.getArenaState() != ArenaState.IN_GAME || event.getClickedBlock().getType() == XMaterial.ENDER_CHEST.parseMaterial()) {
|
||||
if(event.getClickedBlock().getType() == XMaterial.ENDER_CHEST.parseMaterial()) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onMinecartMove(VehicleMoveEvent event) {
|
||||
public void onVehicleMove(VehicleMoveEvent event) {
|
||||
Vehicle vehicle = event.getVehicle();
|
||||
if(vehicle.getType() != EntityType.MINECART) {
|
||||
return;
|
||||
}
|
||||
for(PluginArena arena : plugin.getArenaRegistry().getArenas()) {
|
||||
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.getFrom()) && !buildPlot.getCuboid().isInWithMarge(event.getTo(), 1)) {
|
||||
vehicle.setVelocity(vehicle.getVelocity().zero());
|
||||
if(vehicle.getType() == XEntityType.MINECART.get()) {
|
||||
((Minecart) vehicle).setMaxSpeed(0);
|
||||
} else {
|
||||
vehicle.remove();
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -232,13 +322,14 @@ public class ArenaEvents extends PluginArenaEvents {
|
||||
public void onIgniteEvent(BlockIgniteEvent event) {
|
||||
Location blockLocation = event.getBlock().getLocation();
|
||||
|
||||
for(PluginArena arena : plugin.getArenaRegistry().getArenas()) {
|
||||
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(blockLocation, 5)) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -248,7 +339,7 @@ public class ArenaEvents extends PluginArenaEvents {
|
||||
public void onPistonRetractEvent(BlockPistonRetractEvent event) {
|
||||
Location blockLocation = event.getBlock().getLocation();
|
||||
|
||||
for(PluginArena arena : plugin.getArenaRegistry().getArenas()) {
|
||||
for(IPluginArena arena : plugin.getArenaRegistry().getArenas()) {
|
||||
if(!(arena instanceof BaseArena)) {
|
||||
continue;
|
||||
}
|
||||
@@ -256,6 +347,7 @@ public class ArenaEvents extends PluginArenaEvents {
|
||||
for(Block block : event.getBlocks()) {
|
||||
if(buildPlot.getCuboid() != null && !buildPlot.getCuboid().isInWithMarge(block.getLocation(), -1) && buildPlot.getCuboid().isIn(blockLocation)) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -266,7 +358,7 @@ public class ArenaEvents extends PluginArenaEvents {
|
||||
public void onLeavesDecay(LeavesDecayEvent event) {
|
||||
Location blockLocation = event.getBlock().getLocation();
|
||||
|
||||
for(PluginArena arena : plugin.getArenaRegistry().getArenas()) {
|
||||
for(IPluginArena arena : plugin.getArenaRegistry().getArenas()) {
|
||||
if(!(arena instanceof BaseArena)) {
|
||||
continue;
|
||||
}
|
||||
@@ -301,7 +393,7 @@ public class ArenaEvents extends PluginArenaEvents {
|
||||
int maxMobPerPlot = plugin.getConfig().getInt("Mob.Max-Amount", 20);
|
||||
Location entityLoc = event.getEntity().getLocation();
|
||||
|
||||
for(PluginArena arena : plugin.getArenaRegistry().getArenas()) {
|
||||
for(IPluginArena arena : plugin.getArenaRegistry().getArenas()) {
|
||||
if(!(arena instanceof BaseArena)) {
|
||||
continue;
|
||||
}
|
||||
@@ -317,13 +409,13 @@ public class ArenaEvents extends PluginArenaEvents {
|
||||
continue;
|
||||
}
|
||||
|
||||
if(event.getEntity().getType() == EntityType.WITHER || !plugin.getConfigPreferences().getOption("MOB_SPAWN")) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
for(Plot plot : baseArena.getPlotManager().getPlots()) {
|
||||
if(plot.getCuboid() != null && plot.getCuboid().isInWithMarge(entityLoc, 1)) {
|
||||
if(!plugin.getConfigPreferences().getOption("MOB_SPAWN")) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if(plot.getEntities() >= maxMobPerPlot) {
|
||||
plot.getMembers().forEach(player -> new MessageBuilder("IN_GAME_MESSAGES_PLOT_LIMIT_ENTITIES").asKey().arena(arena).player(player).sendPlayer());
|
||||
event.setCancelled(true);
|
||||
@@ -340,7 +432,7 @@ public class ArenaEvents extends PluginArenaEvents {
|
||||
plot.addEntity();
|
||||
event.setCancelled(false);
|
||||
|
||||
if(ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_9_R1)) {
|
||||
if(ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_9)) {
|
||||
event.getEntity().setAI(false);
|
||||
}
|
||||
}
|
||||
@@ -353,7 +445,7 @@ public class ArenaEvents extends PluginArenaEvents {
|
||||
if(event.getSource().getType() != Material.FIRE)
|
||||
return;
|
||||
|
||||
for(PluginArena arena : plugin.getArenaRegistry().getArenas()) {
|
||||
for(IPluginArena arena : plugin.getArenaRegistry().getArenas()) {
|
||||
if(!(arena instanceof BaseArena)) {
|
||||
continue;
|
||||
}
|
||||
@@ -373,7 +465,7 @@ public class ArenaEvents extends PluginArenaEvents {
|
||||
public void onDispense(BlockDispenseEvent event) {
|
||||
Location blockLoc = event.getBlock().getLocation();
|
||||
|
||||
for(PluginArena arena : plugin.getArenaRegistry().getArenas()) {
|
||||
for(IPluginArena arena : plugin.getArenaRegistry().getArenas()) {
|
||||
if(!(arena instanceof BaseArena)) {
|
||||
continue;
|
||||
}
|
||||
@@ -409,22 +501,20 @@ public class ArenaEvents extends PluginArenaEvents {
|
||||
return;
|
||||
}
|
||||
BaseArena arena = plugin.getArenaRegistry().getArena((Player) event.getEntity());
|
||||
if(arena == null || arena.getArenaState() != ArenaState.IN_GAME) {
|
||||
return;
|
||||
}
|
||||
if(event.getEntity().getType() != EntityType.PLAYER) {
|
||||
if(arena == null || arena.getArenaState() != IArenaState.IN_GAME) {
|
||||
return;
|
||||
}
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void onDamage(EntityDamageEvent event) {
|
||||
if(event.getEntity().getType() != EntityType.PLAYER) {
|
||||
return;
|
||||
}
|
||||
BaseArena arena = plugin.getArenaRegistry().getArena((Player) event.getEntity());
|
||||
if(arena == null || arena.getArenaState() != ArenaState.IN_GAME) {
|
||||
if(arena == null || arena.getArenaState() != IArenaState.IN_GAME) {
|
||||
return;
|
||||
}
|
||||
event.setCancelled(true);
|
||||
@@ -455,7 +545,7 @@ public class ArenaEvents extends PluginArenaEvents {
|
||||
public void onTNTExplode(EntityExplodeEvent event) {
|
||||
Location entityLocation = event.getEntity().getLocation();
|
||||
|
||||
for(PluginArena arena : plugin.getArenaRegistry().getArenas()) {
|
||||
for(IPluginArena arena : plugin.getArenaRegistry().getArenas()) {
|
||||
if(!(arena instanceof BaseArena)) {
|
||||
continue;
|
||||
}
|
||||
@@ -469,15 +559,48 @@ public class ArenaEvents extends PluginArenaEvents {
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onWaterFlowEvent(BlockFromToEvent event) {
|
||||
Location toBlock = event.getToBlock().getLocation();
|
||||
Location blockLoc = event.getBlock().getLocation();
|
||||
public void onOtherBlockExplode(BlockExplodeEvent event) {
|
||||
Location blockLocation = event.getBlock().getLocation();
|
||||
|
||||
for(PluginArena arena : plugin.getArenaRegistry().getArenas()) {
|
||||
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(blockLocation, 5)) {
|
||||
event.blockList().clear();
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
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) {
|
||||
return;
|
||||
}
|
||||
if(event.getEntity() instanceof EnderPearl) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onWaterFlowEvent(BlockFromToEvent event) {
|
||||
Location toBlock = event.getToBlock().getLocation();
|
||||
Location blockLoc = event.getBlock().getLocation();
|
||||
|
||||
for(IPluginArena arena : plugin.getArenaRegistry().getArenas()) {
|
||||
if(!(arena instanceof BaseArena)) {
|
||||
continue;
|
||||
}
|
||||
for(Plot buildPlot : ((BaseArena) arena).getPlotManager().getPlots()) {
|
||||
if(buildPlot.getTeleportLocation().getWorld() != toBlock.getWorld()) {
|
||||
continue;
|
||||
}
|
||||
if(buildPlot.getCuboid() != null) {
|
||||
if(!buildPlot.getCuboid().isIn(toBlock) && buildPlot.getCuboid().isIn(blockLoc)) {
|
||||
event.setCancelled(true);
|
||||
@@ -507,7 +630,7 @@ public class ArenaEvents extends PluginArenaEvents {
|
||||
@EventHandler
|
||||
public void onPistonExtendEvent(BlockPistonExtendEvent event) {
|
||||
Location blockLoc = event.getBlock().getLocation();
|
||||
for(PluginArena arena : plugin.getArenaRegistry().getArenas()) {
|
||||
for(IPluginArena arena : plugin.getArenaRegistry().getArenas()) {
|
||||
if(!(arena instanceof BaseArena)) {
|
||||
continue;
|
||||
}
|
||||
@@ -532,15 +655,6 @@ public class ArenaEvents extends PluginArenaEvents {
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onInventoryClose(InventoryCloseEvent event) {
|
||||
Player player = (Player) event.getPlayer();
|
||||
BaseArena baseArena = plugin.getArenaRegistry().getArena(player);
|
||||
if(baseArena != null && baseArena.getArenaInGameState() == BaseArena.ArenaInGameState.BUILD_TIME) {
|
||||
baseArena.addMenuItem(player);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onItemMove(InventoryClickEvent event) {
|
||||
HumanEntity humanEntity = event.getWhoClicked();
|
||||
@@ -548,10 +662,10 @@ public class ArenaEvents extends PluginArenaEvents {
|
||||
if(humanEntity instanceof Player) {
|
||||
BaseArena baseArena = plugin.getArenaRegistry().getArena((Player) humanEntity);
|
||||
|
||||
if(baseArena != null && baseArena.getArenaState() != ArenaState.IN_GAME) {
|
||||
if(baseArena != null && baseArena.getArenaState() != IArenaState.IN_GAME) {
|
||||
if(event.getClickedInventory() == humanEntity.getInventory()) {
|
||||
if(event.getView().getType() == InventoryType.CRAFTING
|
||||
|| event.getView().getType() == InventoryType.PLAYER) {
|
||||
if(XInventoryView.of(event.getView()).getType() == InventoryType.CRAFTING
|
||||
|| XInventoryView.of(event.getView()).getType() == InventoryType.PLAYER) {
|
||||
event.setResult(Event.Result.DENY);
|
||||
}
|
||||
}
|
||||
@@ -566,7 +680,13 @@ public class ArenaEvents extends PluginArenaEvents {
|
||||
if(!(arena instanceof GuessArena)) {
|
||||
return;
|
||||
}
|
||||
if(arena.getArenaState() != ArenaState.IN_GAME) {
|
||||
if(arena.getArenaState() != IArenaState.IN_GAME) {
|
||||
return;
|
||||
}
|
||||
if(arena.getArenaInGameState() != BaseArena.ArenaInGameState.BUILD_TIME) {
|
||||
return;
|
||||
}
|
||||
if(arena.getSpectators().contains(player)) {
|
||||
return;
|
||||
}
|
||||
GuessArena gameArena = (GuessArena) arena;
|
||||
@@ -580,7 +700,7 @@ public class ArenaEvents extends PluginArenaEvents {
|
||||
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);
|
||||
@@ -598,4 +718,23 @@ public class ArenaEvents extends PluginArenaEvents {
|
||||
}
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -24,7 +24,9 @@ import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import plugily.projects.buildbattle.Main;
|
||||
import plugily.projects.buildbattle.arena.managers.plots.Plot;
|
||||
import plugily.projects.minigamesbox.classic.arena.ArenaState;
|
||||
import plugily.projects.minigamesbox.api.arena.IArenaState;
|
||||
import plugily.projects.minigamesbox.api.arena.IPluginArena;
|
||||
import plugily.projects.minigamesbox.api.user.IUser;
|
||||
import plugily.projects.minigamesbox.classic.arena.PluginArena;
|
||||
import plugily.projects.minigamesbox.classic.arena.PluginArenaManager;
|
||||
import plugily.projects.minigamesbox.classic.user.User;
|
||||
@@ -45,7 +47,7 @@ public class ArenaManager extends PluginArenaManager {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void additionalPartyJoin(Player player, PluginArena arena, Player partyLeader) {
|
||||
public void additionalPartyJoin(Player player, IPluginArena arena, Player partyLeader) {
|
||||
BaseArena pluginArena = plugin.getArenaRegistry().getArena(arena.getId());
|
||||
if(pluginArena == null) {
|
||||
return;
|
||||
@@ -54,7 +56,7 @@ public class ArenaManager extends PluginArenaManager {
|
||||
List<Plot> plots = pluginArena.getPlotManager().getPlots();
|
||||
Plot partyPlot = plots.get(plots.size() == 1 ? 0 : plugin.getRandom().nextInt(plots.size()));
|
||||
|
||||
if(arena.getPlayers().contains(partyLeader)) {
|
||||
if(arena.getPlayersLeft().contains(partyLeader)) {
|
||||
Plot partyLeaderPlot = pluginArena.getPlotManager().getPlot(partyLeader);
|
||||
if(partyLeaderPlot != null) {
|
||||
partyPlot = partyLeaderPlot;
|
||||
@@ -67,13 +69,13 @@ public class ArenaManager extends PluginArenaManager {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void leaveAttempt(@NotNull Player player, @NotNull PluginArena arena) {
|
||||
public void leaveAttempt(@NotNull Player player, @NotNull IPluginArena arena) {
|
||||
BaseArena pluginArena = plugin.getArenaRegistry().getArena(arena.getId());
|
||||
if(pluginArena == null) {
|
||||
return;
|
||||
}
|
||||
super.leaveAttempt(player, arena);
|
||||
User user = plugin.getUserManager().getUser(player);
|
||||
IUser user = plugin.getUserManager().getUser(player);
|
||||
user.setStatistic("LOCAL_POINTS", 0);
|
||||
user.setStatistic("LOCAL_POINTS_GTB", 0);
|
||||
Plot plot = pluginArena.getPlotManager().getPlot(player);
|
||||
@@ -91,9 +93,9 @@ public class ArenaManager extends PluginArenaManager {
|
||||
((GuessArena) arena).getWhoGuessed().remove(player);
|
||||
if(guessArena.getCurrentBuilders().contains(player)) {
|
||||
if(plot.getMembers().isEmpty()) {
|
||||
if(arena.getArenaState() == ArenaState.IN_GAME) {
|
||||
if(arena.getArenaState() == IArenaState.IN_GAME) {
|
||||
//ToDo message force skipped
|
||||
pluginArena.setTimer(plugin.getConfig().getInt("Time-Manager." + pluginArena.getArenaType().getPrefix() + ".Round-Delay"));
|
||||
pluginArena.setTimer(plugin.getConfig().getInt("Time-Manager." + pluginArena.getArenaType().getPrefix() + ".Round-Delay"), true);
|
||||
pluginArena.setArenaInGameState(BaseArena.ArenaInGameState.PLOT_VOTING);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import plugily.projects.buildbattle.Main;
|
||||
import plugily.projects.buildbattle.arena.managers.plots.Plot;
|
||||
import plugily.projects.minigamesbox.api.arena.IPluginArena;
|
||||
import plugily.projects.minigamesbox.classic.arena.PluginArena;
|
||||
import plugily.projects.minigamesbox.classic.arena.PluginArenaRegistry;
|
||||
import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder;
|
||||
@@ -118,7 +119,7 @@ public class ArenaRegistry extends PluginArenaRegistry {
|
||||
World minWorld = minPoint.getWorld();
|
||||
|
||||
if(minWorld != null) {
|
||||
Biome biome = ServerVersion.Version.isCurrentHigher(ServerVersion.Version.v1_15_R1) ?
|
||||
Biome biome = ServerVersion.Version.isCurrentHigher(ServerVersion.Version.v1_15) ?
|
||||
minWorld.getBiome(minPoint.getBlockX(), minPoint.getBlockY(), minPoint.getBlockZ())
|
||||
: minWorld.getBiome(minPoint.getBlockX(), minPoint.getBlockZ());
|
||||
|
||||
@@ -156,7 +157,7 @@ public class ArenaRegistry extends PluginArenaRegistry {
|
||||
|
||||
@Override
|
||||
public @Nullable BaseArena getArena(Player player) {
|
||||
PluginArena pluginArena = super.getArena(player);
|
||||
IPluginArena pluginArena = super.getArena(player);
|
||||
if(pluginArena instanceof BaseArena) {
|
||||
return (BaseArena) pluginArena;
|
||||
}
|
||||
@@ -165,7 +166,7 @@ public class ArenaRegistry extends PluginArenaRegistry {
|
||||
|
||||
@Override
|
||||
public @Nullable BaseArena getArena(String id) {
|
||||
PluginArena pluginArena = super.getArena(id);
|
||||
IPluginArena pluginArena = super.getArena(id);
|
||||
if(pluginArena instanceof BaseArena) {
|
||||
return (BaseArena) pluginArena;
|
||||
}
|
||||
@@ -174,7 +175,7 @@ public class ArenaRegistry extends PluginArenaRegistry {
|
||||
|
||||
public @NotNull List<BaseArena> getPluginArenas() {
|
||||
List<BaseArena> baseArenas = new ArrayList<>(super.getArenas().size());
|
||||
for(PluginArena pluginArena : super.getArenas()) {
|
||||
for(IPluginArena pluginArena : super.getArenas()) {
|
||||
if(pluginArena instanceof BaseArena) {
|
||||
baseArenas.add((BaseArena) pluginArena);
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder;
|
||||
import plugily.projects.minigamesbox.classic.handlers.language.TitleBuilder;
|
||||
import plugily.projects.minigamesbox.classic.handlers.reward.RewardType;
|
||||
import plugily.projects.minigamesbox.classic.handlers.reward.RewardsFactory;
|
||||
import plugily.projects.minigamesbox.classic.utils.actionbar.ActionBar;
|
||||
import plugily.projects.minigamesbox.classic.utils.items.HandlerItem;
|
||||
import plugily.projects.minigamesbox.classic.utils.version.VersionUtils;
|
||||
|
||||
@@ -53,11 +54,11 @@ public class BaseArena extends PluginArena {
|
||||
private final List<Player> spectators = new ArrayList<>();
|
||||
private MapRestorerManager mapRestorerManager;
|
||||
private final PlotManager plotManager;
|
||||
private String theme = "Theme";
|
||||
private String theme = null;
|
||||
protected ParticleRefreshScheduler particleRefreshScheduler;
|
||||
private ArenaType arenaType;
|
||||
|
||||
private ArenaInGameState arenaInGameState;
|
||||
private ArenaInGameState arenaInGameState = ArenaInGameState.NONE;
|
||||
|
||||
private Map<Player, Plot> plotList = new HashMap<>();
|
||||
|
||||
@@ -153,17 +154,17 @@ public class BaseArena extends PluginArena {
|
||||
return theme;
|
||||
}
|
||||
|
||||
public void setTheme(String theme) {
|
||||
this.theme = theme == null ? "Theme" : theme;
|
||||
public void setTheme(String arenaTheme) {
|
||||
this.theme = arenaTheme;
|
||||
}
|
||||
|
||||
public void sendBuildLeftTimeMessage() {
|
||||
new TitleBuilder("IN_GAME_MESSAGES_PLOT_TIME_LEFT_TITLE").asKey().arena(this).sendArena();
|
||||
String message = new MessageBuilder("IN_GAME_MESSAGES_PLOT_TIME_LEFT_CHAT").asKey().arena(this).build();
|
||||
for(Player p : getPlayers()) {
|
||||
VersionUtils.sendActionBar(p, message);
|
||||
p.sendMessage(message);
|
||||
}
|
||||
MessageBuilder message = new MessageBuilder("IN_GAME_MESSAGES_PLOT_TIME_LEFT_CHAT").asKey().arena(this);
|
||||
message.sendArena();
|
||||
getPlayers().forEach(player ->
|
||||
getPlugin().getActionBarManager().addActionBar(player, new ActionBar(message,
|
||||
ActionBar.ActionBarType.DISPLAY)));
|
||||
}
|
||||
|
||||
public final void checkPlayerOutSidePlot() {
|
||||
@@ -179,7 +180,8 @@ public class BaseArena extends PluginArena {
|
||||
|
||||
if(this instanceof BuildArena) {
|
||||
buildPlot = getPlotFromPlayer(player);
|
||||
} else if(this instanceof GuessArena && (buildPlot = getPlotFromPlayer(player)) != null) {
|
||||
} else if(this instanceof GuessArena) {
|
||||
buildPlot = ((GuessArena) this).getBuildPlot();
|
||||
player.setPlayerWeather(buildPlot.getWeatherType());
|
||||
player.setPlayerTime(Plot.Time.format(buildPlot.getTime(), player.getWorld().getTime()), false);
|
||||
}
|
||||
@@ -217,33 +219,6 @@ public class BaseArena extends PluginArena {
|
||||
}
|
||||
}
|
||||
|
||||
HandlerItem optionsMenuItem;
|
||||
|
||||
private HandlerItem getMenuItem() {
|
||||
if(optionsMenuItem == null) {
|
||||
HandlerItem optionsMenu = new HandlerItem(getPlugin().getOptionsRegistry().getMenuItem());
|
||||
optionsMenu.setLeftClick(true);
|
||||
optionsMenu.setRightClick(true);
|
||||
optionsMenu.addInteractHandler(event -> {
|
||||
event.setCancelled(true);
|
||||
getPlugin().getOptionsRegistry().getOptionsGui().open(event.getPlayer());
|
||||
});
|
||||
optionsMenu.addInventoryClickHandler(event -> {
|
||||
getPlugin().getOptionsRegistry().getOptionsGui().open(event.getWhoClicked());
|
||||
});
|
||||
optionsMenuItem = optionsMenu.build();
|
||||
}
|
||||
return optionsMenuItem;
|
||||
}
|
||||
|
||||
public void addMenuItem(Player player) {
|
||||
if(player.getInventory().contains(getMenuItem().getItemStack())) {
|
||||
return;
|
||||
}
|
||||
player.getInventory().setItem(8, getMenuItem().getItemStack());
|
||||
}
|
||||
|
||||
|
||||
public PlotManager getPlotManager() {
|
||||
return plotManager;
|
||||
}
|
||||
|
||||
@@ -27,9 +27,10 @@ import plugily.projects.buildbattle.arena.states.build.InGameState;
|
||||
import plugily.projects.buildbattle.arena.states.build.StartingState;
|
||||
import plugily.projects.buildbattle.handlers.themes.vote.VoteMenu;
|
||||
import plugily.projects.buildbattle.handlers.themes.vote.VotePoll;
|
||||
import plugily.projects.minigamesbox.classic.arena.ArenaState;
|
||||
import plugily.projects.minigamesbox.api.arena.IArenaState;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author Tigerpanzer_02
|
||||
@@ -44,8 +45,8 @@ public class BuildArena extends BaseArena {
|
||||
public BuildArena(String id) {
|
||||
super(id);
|
||||
setArenaType(ArenaType.SOLO);
|
||||
addGameStateHandler(ArenaState.IN_GAME, new InGameState());
|
||||
addGameStateHandler(ArenaState.STARTING, new StartingState());
|
||||
addGameStateHandler(IArenaState.IN_GAME, new InGameState());
|
||||
addGameStateHandler(IArenaState.STARTING, new StartingState());
|
||||
getPlugin().getDebugger().debug("Init Arena {0} with ArenaType {1}", getId(), getArenaType());
|
||||
}
|
||||
|
||||
@@ -89,7 +90,7 @@ public class BuildArena extends BaseArena {
|
||||
|
||||
@Override
|
||||
public void distributePlots() {
|
||||
int neededPlots = getPlayers().size() / getArenaOption("PLOT_MEMBER_SIZE");
|
||||
int neededPlots = getPlayersLeft().size() / getArenaOption("PLOT_MEMBER_SIZE");
|
||||
if(getPlotManager().getPlots().size() < neededPlots) {
|
||||
getPlugin().getMessageUtils().errorOccurred();
|
||||
getPlugin().getDebugger().sendConsoleMsg("&c[Build Battle] [PLOT WARNING] Not enough plots in arena " + getId() + "! Lacks " + (neededPlots - getPlotManager().getPlots().size()) + " plots");
|
||||
@@ -104,30 +105,36 @@ public class BuildArena extends BaseArena {
|
||||
if(players.isEmpty()) {
|
||||
break;
|
||||
}
|
||||
|
||||
if(!plot.getMembers().isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
if(!getPlugin().getUserManager().getUser(players.get(0)).isSpectator()) {
|
||||
plot.addMember(players.remove(0), this, true);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TEAM:
|
||||
for(Player player : getPlayers()) {
|
||||
// get base with min players
|
||||
Plot minPlayers = getPlotManager().getPlots().stream().min(Comparator.comparing(Plot::getMembersSize)).get();
|
||||
// add player to min base if he got no base
|
||||
Plot playerPlot = getPlotManager().getPlot(player);
|
||||
if(playerPlot == null) {
|
||||
minPlayers.addMember(player, this, true);
|
||||
}
|
||||
// fallback
|
||||
if(playerPlot == null) {
|
||||
getPlotManager().getPlots().get(0).addMember(player, this, true);
|
||||
int plotMemberSize = getArenaOption("PLOT_MEMBER_SIZE");
|
||||
int neededDividedPlots = getPlayersLeft().size() / plotMemberSize;
|
||||
int currentDividedPlots = (int) getPlotManager().getPlots().stream().filter(plot -> plot.getMembersSize() > 0).count();
|
||||
|
||||
|
||||
if(neededDividedPlots > currentDividedPlots) {
|
||||
List<Plot> fullPlots = getPlotManager().getPlots().stream().filter(plot -> plot.getMembersSize() == plotMemberSize).collect(Collectors.toList());
|
||||
List<Player> playersToMove = getPlayersLeft().stream().filter(player -> fullPlots.stream().noneMatch(plot -> plot.getMembers().contains(player))).collect(Collectors.toList());
|
||||
if(!playersToMove.isEmpty()) {
|
||||
for(int i = 0; i < playersToMove.size(); i++) {
|
||||
Player move = playersToMove.get(i);
|
||||
List<Plot> emptyPlots = getPlotManager().getPlots().stream().filter(plot -> plot.getMembersSize() < plotMemberSize).collect(Collectors.toList());
|
||||
Plot maxEmptyPlot = emptyPlots.stream().max(Comparator.comparing(Plot::getMembersSize)).get();
|
||||
maxEmptyPlot.addMember(move, this, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
//check if not only one plot got players
|
||||
Plot maxPlayers = getPlotManager().getPlots().stream().max(Comparator.comparing(Plot::getMembersSize)).get();
|
||||
Plot minPlayers = getPlotManager().getPlots().stream().min(Comparator.comparing(Plot::getMembersSize)).get();
|
||||
if(maxPlayers.getMembersSize() == getPlayers().size()) {
|
||||
if(maxPlayers.getMembersSize() == getPlayersLeft().size()) {
|
||||
for(int i = 0; i < maxPlayers.getMembersSize() / 2; i++) {
|
||||
Player move = maxPlayers.getMembers().get(i);
|
||||
minPlayers.addMember(move, this, true);
|
||||
@@ -149,14 +156,14 @@ public class BuildArena extends BaseArena {
|
||||
|
||||
@Override
|
||||
public boolean enoughPlayersToContinue() {
|
||||
int size = getPlayers().size();
|
||||
int size = getPlayersLeft().size();
|
||||
int memberSize = getArenaOption("PLOT_MEMBER_SIZE");
|
||||
|
||||
if(size > memberSize) {
|
||||
return true;
|
||||
}
|
||||
if(size == memberSize) {
|
||||
return !new HashSet<>(getPlotManager().getPlot(getPlayersLeft().get(0)).getMembers()).containsAll(getPlayers());
|
||||
return !new HashSet<>(getPlotManager().getPlot(getPlayersLeft().get(0)).getMembers()).containsAll(getPlayersLeft());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -28,8 +28,8 @@ import plugily.projects.buildbattle.api.event.guess.PlayerThemeGuessEvent;
|
||||
import plugily.projects.buildbattle.arena.managers.plots.Plot;
|
||||
import plugily.projects.buildbattle.arena.states.guess.InGameState;
|
||||
import plugily.projects.buildbattle.arena.states.guess.StartingState;
|
||||
import plugily.projects.buildbattle.handlers.themes.BBTheme;
|
||||
import plugily.projects.minigamesbox.classic.arena.ArenaState;
|
||||
import plugily.projects.buildbattle.handlers.themes.GuessTheme;
|
||||
import plugily.projects.minigamesbox.api.arena.IArenaState;
|
||||
import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder;
|
||||
import plugily.projects.minigamesbox.classic.utils.version.VersionUtils;
|
||||
|
||||
@@ -46,7 +46,7 @@ public class GuessArena extends BaseArena {
|
||||
|
||||
private final List<Player> whoGuessed = new ArrayList<>();
|
||||
private int round = 1;
|
||||
private BBTheme currentTheme = null;
|
||||
private GuessTheme currentTheme = null;
|
||||
|
||||
private Plot buildPlot = null;
|
||||
private List<Integer> removedCharsAt = new ArrayList<>();
|
||||
@@ -60,25 +60,24 @@ public class GuessArena extends BaseArena {
|
||||
public GuessArena(String id) {
|
||||
super(id);
|
||||
setArenaType(ArenaType.GUESS_THE_BUILD);
|
||||
addGameStateHandler(ArenaState.IN_GAME, new InGameState());
|
||||
addGameStateHandler(ArenaState.STARTING, new StartingState());
|
||||
addGameStateHandler(IArenaState.IN_GAME, new InGameState());
|
||||
addGameStateHandler(IArenaState.STARTING, new StartingState());
|
||||
getPlugin().getDebugger().debug("Init Arena {0} with ArenaType {1}", getId(), getArenaType());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cleanUpArena() {
|
||||
currentTheme = null;
|
||||
resetBuildPlot();
|
||||
round = 1;
|
||||
whoGuessed.clear();
|
||||
removedCharsAt.clear();
|
||||
playedPlots.clear();
|
||||
playedThemes.clear();
|
||||
super.cleanUpArena();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void distributePlots() {
|
||||
int neededPlots = getPlayers().size() / plotMemberSize;
|
||||
public void distributePlots() {
|
||||
int neededPlots = getPlayersLeft().size() / plotMemberSize;
|
||||
if(getPlotManager().getPlots().size() < neededPlots) {
|
||||
getPlugin().getMessageUtils().errorOccurred();
|
||||
getPlugin().getDebugger().sendConsoleMsg("&c[Build Battle] [PLOT WARNING] Not enough plots in arena " + getId() + "! Lacks " + (neededPlots - getPlotManager().getPlots().size()) + " plots");
|
||||
@@ -91,6 +90,9 @@ public class GuessArena extends BaseArena {
|
||||
if(players.isEmpty()) {
|
||||
break;
|
||||
}
|
||||
if(!plot.getMembers().isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
if(!getPlugin().getUserManager().getUser(players.get(0)).isSpectator()) {
|
||||
plot.addMember(players.remove(0), this, true);
|
||||
}
|
||||
@@ -109,13 +111,13 @@ public class GuessArena extends BaseArena {
|
||||
|
||||
@Override
|
||||
public boolean enoughPlayersToContinue() {
|
||||
int size = getPlayers().size();
|
||||
int size = getPlayersLeft().size();
|
||||
|
||||
if(size > plotMemberSize) {
|
||||
return true;
|
||||
}
|
||||
if(size == plotMemberSize) {
|
||||
return !new HashSet<>(getPlotManager().getPlot(getPlayersLeft().get(0)).getMembers()).containsAll(getPlayers());
|
||||
return !new HashSet<>(getPlotManager().getPlot(getPlayersLeft().get(0)).getMembers()).containsAll(getPlayersLeft());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -138,10 +140,10 @@ public class GuessArena extends BaseArena {
|
||||
if(buildPlot != null) {
|
||||
buildPlot.resetPlot();
|
||||
}
|
||||
getRemovedCharsAt().clear();
|
||||
removedCharsAt.clear();
|
||||
setBuildPlot(null);
|
||||
setCurrentTheme(null);
|
||||
getWhoGuessed().clear();
|
||||
whoGuessed.clear();
|
||||
round += 1;
|
||||
getPlayers().forEach(player -> getPlugin().getActionBarManager().clearActionBarsFromPlayer(player));
|
||||
}
|
||||
@@ -183,7 +185,7 @@ public class GuessArena extends BaseArena {
|
||||
}
|
||||
|
||||
//-1 because builder can´t guess
|
||||
if(whoGuessed.size() >= getPlayers().size() - 1) {
|
||||
if(whoGuessed.size() >= getPlayersLeft().size() - 1) {
|
||||
setTimer(getPlugin().getConfig().getInt("Time-Manager." + getArenaType().getPrefix() + ".Round-Delay"));
|
||||
setArenaInGameState(ArenaInGameState.PLOT_VOTING);
|
||||
|
||||
@@ -205,7 +207,7 @@ public class GuessArena extends BaseArena {
|
||||
Bukkit.getScheduler().runTask(getPlugin(), () -> Bukkit.getPluginManager().callEvent(new PlayerThemeGuessEvent(this, currentTheme)));
|
||||
}
|
||||
|
||||
public BBTheme getCurrentBBTheme() {
|
||||
public GuessTheme getCurrentBBTheme() {
|
||||
return currentTheme;
|
||||
}
|
||||
|
||||
@@ -237,11 +239,11 @@ public class GuessArena extends BaseArena {
|
||||
return round;
|
||||
}
|
||||
|
||||
public void setCurrentTheme(BBTheme currentTheme) {
|
||||
public void setCurrentTheme(GuessTheme currentTheme) {
|
||||
if(currentTheme == null) {
|
||||
getPlugin().getDebugger().debug("Arena {0} set Theme null", getId());
|
||||
} else {
|
||||
getPlugin().getDebugger().debug("Arena {0} set Theme to {1} ({2})", getId(), currentTheme.getTheme(), currentTheme.getDifficulty());
|
||||
getPlugin().getDebugger().debug("Arena {0} set Theme to {1} ({2})", getId(), currentTheme.getThemesAsString(), currentTheme.getDifficulty());
|
||||
}
|
||||
this.currentTheme = currentTheme;
|
||||
}
|
||||
|
||||
@@ -23,14 +23,12 @@ package plugily.projects.buildbattle.arena.managers;
|
||||
import org.bukkit.entity.Player;
|
||||
import plugily.projects.buildbattle.arena.BaseArena;
|
||||
import plugily.projects.buildbattle.arena.GuessArena;
|
||||
import plugily.projects.minigamesbox.classic.arena.ArenaState;
|
||||
import plugily.projects.minigamesbox.api.arena.IArenaState;
|
||||
import plugily.projects.minigamesbox.classic.arena.PluginArena;
|
||||
import plugily.projects.minigamesbox.classic.arena.managers.PluginScoreboardManager;
|
||||
import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder;
|
||||
import plugily.projects.minigamesbox.classic.user.User;
|
||||
import plugily.projects.minigamesbox.classic.utils.scoreboard.common.EntryBuilder;
|
||||
import plugily.projects.minigamesbox.classic.utils.scoreboard.type.Entry;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -47,39 +45,33 @@ public class ScoreboardManager extends PluginScoreboardManager {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Entry> formatScoreboard(User user) {
|
||||
EntryBuilder builder = new EntryBuilder();
|
||||
public List<String> getScoreboardLines(Player player) {
|
||||
List<String> lines;
|
||||
PluginArena userArena = user.getArena();
|
||||
|
||||
if(userArena.getArenaState() == ArenaState.FULL_GAME) {
|
||||
lines = userArena.getPlugin().getLanguageManager().getLanguageList("Scoreboard.Content.Starting");
|
||||
} else if(userArena.getArenaState() == ArenaState.IN_GAME) {
|
||||
if(userArena instanceof GuessArena) {
|
||||
lines = userArena.getPlugin().getLanguageManager().getLanguageList("Scoreboard.Content." + userArena.getArenaState().getFormattedName() + ".Guess-The-Build" + (((GuessArena) userArena).getArenaInGameState() == BaseArena.ArenaInGameState.PLOT_VOTING ? "-Waiting" : ""));
|
||||
} else {
|
||||
if(userArena.getArenaOption("PLOT_MEMBER_SIZE") <= 1) {
|
||||
lines = userArena.getPlugin().getLanguageManager().getLanguageList("Scoreboard.Content." + userArena.getArenaState().getFormattedName() + ".Classic");
|
||||
switch(arena.getArenaState()) {
|
||||
case IN_GAME: {
|
||||
if(arena instanceof GuessArena) {
|
||||
lines = arena.getPlugin().getLanguageManager().getLanguageList("Scoreboard.Content." + arena.getArenaState().getFormattedName() + ".Guess-The-Build" + (((GuessArena) arena).getArenaInGameState() == BaseArena.ArenaInGameState.PLOT_VOTING ? "-Waiting" : ""));
|
||||
} else {
|
||||
lines = userArena.getPlugin().getLanguageManager().getLanguageList("Scoreboard.Content." + userArena.getArenaState().getFormattedName() + ".Teams");
|
||||
if(arena.getArenaOption("PLOT_MEMBER_SIZE") <= 1) {
|
||||
lines = arena.getPlugin().getLanguageManager().getLanguageList("Scoreboard.Content." + arena.getArenaState().getFormattedName() + ".Classic");
|
||||
} else {
|
||||
lines = arena.getPlugin().getLanguageManager().getLanguageList("Scoreboard.Content." + arena.getArenaState().getFormattedName() + ".Teams");
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else if(userArena.getArenaState() == ArenaState.ENDING) {
|
||||
if(userArena instanceof GuessArena) {
|
||||
lines = userArena.getPlugin().getLanguageManager().getLanguageList("Scoreboard.Content." + userArena.getArenaState().getFormattedName() + ".Guess-The-Build");
|
||||
} else {
|
||||
lines = userArena.getPlugin().getLanguageManager().getLanguageList("Scoreboard.Content." + userArena.getArenaState().getFormattedName() + ".Classic");
|
||||
case ENDING: {
|
||||
if(arena instanceof GuessArena) {
|
||||
lines = arena.getPlugin().getLanguageManager().getLanguageList("Scoreboard.Content." + arena.getArenaState().getFormattedName() + ".Guess-The-Build");
|
||||
} else {
|
||||
lines = arena.getPlugin().getLanguageManager().getLanguageList("Scoreboard.Content." + arena.getArenaState().getFormattedName() + ".Classic");
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
lines = super.getScoreboardLines(player);
|
||||
}
|
||||
} else {
|
||||
lines = userArena.getPlugin().getLanguageManager().getLanguageList("Scoreboard.Content." + userArena.getArenaState().getFormattedName());
|
||||
}
|
||||
|
||||
Player player = user.getPlayer();
|
||||
|
||||
for(String line : lines) {
|
||||
builder.next(new MessageBuilder(line).player(player).arena(arena).build());
|
||||
}
|
||||
return builder.build();
|
||||
return lines;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -187,10 +187,11 @@ public class Plot {
|
||||
particles.clear();
|
||||
|
||||
for(Player p : members) {
|
||||
p.resetPlayerWeather();
|
||||
setWeatherType(p.getPlayerWeather());
|
||||
p.setPlayerWeather(WeatherType.CLEAR);
|
||||
p.resetPlayerTime();
|
||||
}
|
||||
setTime(Time.WORLD_TIME);
|
||||
setWeatherType(WeatherType.CLEAR);
|
||||
|
||||
World centerWorld = cuboid.getCenter().getWorld();
|
||||
|
||||
@@ -220,7 +221,7 @@ public class Plot {
|
||||
}
|
||||
|
||||
for(Chunk chunk : cuboid.chunkList()) {
|
||||
if(ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_15_R1)) {
|
||||
if(ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_15)) {
|
||||
chunk.getWorld().refreshChunk(chunk.getX(), chunk.getZ());
|
||||
continue;
|
||||
}
|
||||
@@ -235,7 +236,7 @@ public class Plot {
|
||||
changeFloor(defaultFloor.parseMaterial());
|
||||
|
||||
if(centerWorld != null) {
|
||||
if(ServerVersion.Version.isCurrentHigher(ServerVersion.Version.v1_15_R1)) {
|
||||
if(ServerVersion.Version.isCurrentHigher(ServerVersion.Version.v1_15)) {
|
||||
Location min = cuboid.getMinPoint();
|
||||
Location max = cuboid.getMaxPoint();
|
||||
|
||||
@@ -307,7 +308,7 @@ public class Plot {
|
||||
Block block = maxWorld.getBlockAt(x, y, z);
|
||||
block.setType(material);
|
||||
|
||||
if(ServerVersion.Version.isCurrentEqualOrLower(ServerVersion.Version.v1_12_R1)) {
|
||||
if(ServerVersion.Version.isCurrentEqualOrLower(ServerVersion.Version.v1_12)) {
|
||||
try {
|
||||
Block.class.getMethod("setData", byte.class).invoke(block, data);
|
||||
} catch(Exception e) {
|
||||
|
||||
@@ -26,9 +26,7 @@ import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import plugily.projects.buildbattle.api.event.plot.PlotPlayerReceiveEvent;
|
||||
import plugily.projects.buildbattle.arena.BaseArena;
|
||||
import plugily.projects.minigamesbox.classic.arena.ArenaState;
|
||||
import plugily.projects.minigamesbox.classic.utils.dimensional.Cuboid;
|
||||
import plugily.projects.minigamesbox.classic.utils.version.ServerVersion;
|
||||
import plugily.projects.minigamesbox.classic.utils.version.VersionUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -100,53 +98,30 @@ public class PlotManager {
|
||||
continue;
|
||||
}
|
||||
|
||||
if(ServerVersion.Version.isCurrentEqualOrLower(ServerVersion.Version.v1_13_R2)) { // Async catch in old versions
|
||||
// Should do this in async thread to do not cause dead for the main thread
|
||||
CompletableFuture.supplyAsync(() -> {
|
||||
Location loc = tploc;
|
||||
int m = 0;
|
||||
while(loc.getBlock().getType() != Material.AIR) {
|
||||
if(m >= 500) {
|
||||
break;// Thread never ends on flat map?
|
||||
if(arena.getArenaInGameState() != BaseArena.ArenaInGameState.THEME_VOTING) {
|
||||
break; // Thread never ends on flat map?
|
||||
}
|
||||
|
||||
if(arena.getArenaState() == ArenaState.IN_GAME && arena.getTimer() > 30) {
|
||||
break;
|
||||
}
|
||||
|
||||
loc = loc.add(0, 1, 0);
|
||||
//teleporting 1 x and z block away from center cause Y is above plot limit
|
||||
if(loc.getY() >= cuboid.getMaxPoint().getY()) {
|
||||
loc = cuboid.getCenter().clone().add(1, 0, 1);
|
||||
}
|
||||
|
||||
m++; // Preventing server froze on flat map
|
||||
}
|
||||
|
||||
return loc;
|
||||
}).thenAccept(loc -> {
|
||||
for(Player player : buildPlot.getMembers()) {
|
||||
VersionUtils.teleport(player, cuboid.getCenter());
|
||||
VersionUtils.teleport(player, loc);
|
||||
//Fix respawning bug while theme voting
|
||||
Bukkit.getScheduler().runTaskLater(arena.getPlugin(), () -> {
|
||||
player.setAllowFlight(true);
|
||||
player.setFlying(true);
|
||||
}, 2);
|
||||
}
|
||||
} else {
|
||||
// Should do this in async thread to do not cause dead for the main thread
|
||||
CompletableFuture.supplyAsync(() -> {
|
||||
Location loc = tploc;
|
||||
while(loc.getBlock().getType() != Material.AIR) {
|
||||
if(arena.getArenaState() == ArenaState.IN_GAME && arena.getTimer() > 30) {
|
||||
break; // Thread never ends on flat map?
|
||||
}
|
||||
|
||||
loc = loc.add(0, 1, 0);
|
||||
//teleporting 1 x and z block away from center cause Y is above plot limit
|
||||
if(loc.getY() >= cuboid.getMaxPoint().getY()) {
|
||||
loc = cuboid.getCenter().clone().add(1, 0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
return loc;
|
||||
}).thenAccept(loc -> {
|
||||
for(Player player : buildPlot.getMembers()) {
|
||||
VersionUtils.teleport(player, cuboid.getCenter());
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
Bukkit.getPluginManager().callEvent(new PlotPlayerReceiveEvent(arena, buildPlot));
|
||||
}
|
||||
|
||||
+17
-3
@@ -35,6 +35,8 @@ import plugily.projects.minigamesbox.classic.utils.version.VersionUtils;
|
||||
import plugily.projects.minigamesbox.classic.utils.version.xseries.XMaterial;
|
||||
import plugily.projects.minigamesbox.inventory.common.item.SimpleClickableItem;
|
||||
import plugily.projects.minigamesbox.inventory.normal.NormalFastInv;
|
||||
import plugily.projects.minigamesbox.inventory.utils.fastinv.InventoryScheme;
|
||||
import plugily.projects.minigamesbox.inventory.utils.fastinv.PaginatedFastInv;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -79,10 +81,22 @@ public final class PlotMenuHandler {
|
||||
}
|
||||
|
||||
public void createMenu(Player player, BaseArena arena) {
|
||||
NormalFastInv gui = new NormalFastInv(plugin.getBukkitHelper().serializeInt(arena.getPlotManager().getPlots().size()), new MessageBuilder("IN_GAME_MESSAGES_PLOT_SELECTOR_MENU_NAME").asKey().build());
|
||||
PaginatedFastInv gui = new PaginatedFastInv(27, new MessageBuilder("IN_GAME_MESSAGES_PLOT_SELECTOR_MENU_NAME").asKey().build());
|
||||
new InventoryScheme()
|
||||
.mask(" 1111111 ")
|
||||
.mask(" 1111111 ")
|
||||
.bindPagination('1').apply(gui);
|
||||
|
||||
|
||||
int plots = 0;
|
||||
int arenaPlotMemberSize = arena.getArenaOption("PLOT_MEMBER_SIZE");
|
||||
|
||||
gui.previousPageItem(20, p -> new ItemBuilder(XMaterial.ARROW.parseItem()).name("<- " + p + "/" + gui.lastPage()).build());
|
||||
gui.nextPageItem(24, p -> new ItemBuilder(XMaterial.ARROW.parseItem()).name(p + "/" + gui.lastPage() + " ->").build());
|
||||
|
||||
gui.setItem(22, new ItemBuilder(XMaterial.BARRIER.parseItem()).name("X").build(),
|
||||
e -> e.getWhoClicked().closeInventory());
|
||||
|
||||
for(Plot plot : arena.getPlotManager().getPlots()) {
|
||||
ItemStack itemStack = getItemStack(plot, arenaPlotMemberSize, player);
|
||||
int plotMemberSize = plot.getMembersSize();
|
||||
@@ -127,7 +141,7 @@ public final class PlotMenuHandler {
|
||||
});
|
||||
|
||||
int finalPlots = plots;
|
||||
gui.addItem(new SimpleClickableItem(itemStack, event -> {
|
||||
gui.addContent(itemStack, event -> {
|
||||
event.setCancelled(true);
|
||||
|
||||
if(!(event.isLeftClick() || event.isRightClick())) {
|
||||
@@ -143,7 +157,7 @@ public final class PlotMenuHandler {
|
||||
|
||||
new MessageBuilder("IN_GAME_MESSAGES_PLOT_SELECTOR_PLOT_CHOOSE").asKey().player(player).integer(finalPlots).sendPlayer();
|
||||
event.getWhoClicked().closeInventory();
|
||||
}));
|
||||
});
|
||||
|
||||
plots++;
|
||||
}
|
||||
|
||||
@@ -27,11 +27,11 @@ import plugily.projects.buildbattle.arena.BaseArena;
|
||||
import plugily.projects.buildbattle.arena.BuildArena;
|
||||
import plugily.projects.buildbattle.arena.managers.plots.Plot;
|
||||
import plugily.projects.buildbattle.arena.vote.VoteItems;
|
||||
import plugily.projects.minigamesbox.api.user.IUser;
|
||||
import plugily.projects.minigamesbox.classic.arena.PluginArena;
|
||||
import plugily.projects.minigamesbox.classic.arena.states.PluginInGameState;
|
||||
import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder;
|
||||
import plugily.projects.minigamesbox.classic.handlers.language.TitleBuilder;
|
||||
import plugily.projects.minigamesbox.classic.user.User;
|
||||
import plugily.projects.minigamesbox.classic.utils.version.VersionUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -52,22 +52,24 @@ public class InGameState extends PluginInGameState {
|
||||
}
|
||||
switch(pluginArena.getArenaInGameState()) {
|
||||
case THEME_VOTING:
|
||||
if(arena.getTimer() <= 0) {
|
||||
if(arena.getTimer() <= 0 || pluginArena.getTheme() != null) {
|
||||
// may consider start to build message...
|
||||
pluginArena.setArenaInGameState(BaseArena.ArenaInGameState.BUILD_TIME);
|
||||
|
||||
setArenaTimer(getPlugin().getConfig().getInt("Time-Manager." + pluginArena.getArenaType().getPrefix() + ".In-Game"));
|
||||
|
||||
if(pluginArena.getVotePoll() != null && pluginArena.getTheme().equals("Theme")) {
|
||||
if(pluginArena.getVotePoll() != null && pluginArena.getTheme() == null) {
|
||||
pluginArena.setTheme(pluginArena.getVotePoll().getVotedTheme());
|
||||
new MessageBuilder("IN_GAME_MESSAGES_PLOT_GTB_THEME_NAME").asKey().arena(pluginArena).sendArena();
|
||||
}
|
||||
|
||||
for(Player player : pluginArena.getPlayers()) {
|
||||
for(Player player : pluginArena.getPlayersLeft()) {
|
||||
player.closeInventory();
|
||||
pluginArena.addMenuItem(player);
|
||||
player.setGameMode(GameMode.CREATIVE);
|
||||
VersionUtils.setCollidable(player, false);
|
||||
}
|
||||
// second time after voting as sometimes world switch causing no teleportation!
|
||||
pluginArena.getPlotManager().teleportToPlots();
|
||||
} else {
|
||||
handleThemeVoting(pluginArena);
|
||||
}
|
||||
@@ -75,11 +77,10 @@ public class InGameState extends PluginInGameState {
|
||||
break;
|
||||
case BUILD_TIME:
|
||||
handleBuildTime(pluginArena);
|
||||
handleOptionsMenu(pluginArena);
|
||||
if(arena.getTimer() <= 0) {
|
||||
for(Player player : pluginArena.getPlayersLeft()) {
|
||||
User user = getPlugin().getUserManager().getUser(player);
|
||||
|
||||
if(user.isSpectator()) continue;
|
||||
IUser user = getPlugin().getUserManager().getUser(player);
|
||||
|
||||
Plot playerPlot = pluginArena.getPlotFromPlayer(player);
|
||||
if(!pluginArena.getQueue().contains(playerPlot)) {
|
||||
@@ -103,8 +104,8 @@ public class InGameState extends PluginInGameState {
|
||||
adjustStatistics(pluginArena);
|
||||
|
||||
pluginArena.teleportToWinnerPlot();
|
||||
pluginArena.executeEndRewards();
|
||||
getPlugin().getArenaManager().stopGame(false, arena);
|
||||
pluginArena.executeEndRewards();
|
||||
} else {
|
||||
voteForNextPlot(pluginArena);
|
||||
}
|
||||
@@ -139,7 +140,7 @@ public class InGameState extends PluginInGameState {
|
||||
new TitleBuilder("IN_GAME_MESSAGES_PLOT_VOTING_PLOT_OWNER_TITLE").asKey().arena(pluginArena).player(player).value(formattedMembers).sendArena();
|
||||
}
|
||||
|
||||
User user = getPlugin().getUserManager().getUser(player);
|
||||
IUser user = getPlugin().getUserManager().getUser(player);
|
||||
int points = user.getStatistic("LOCAL_POINTS");
|
||||
|
||||
//no vote made, in this case make it a good vote
|
||||
@@ -161,7 +162,7 @@ public class InGameState extends PluginInGameState {
|
||||
private void adjustStatistics(BuildArena pluginArena) {
|
||||
for(Plot plot : pluginArena.getPlotManager().getTopPlotsOrder()) {
|
||||
plot.getMembers().forEach(player -> {
|
||||
User user = getPlugin().getUserManager().getUser(player);
|
||||
IUser user = getPlugin().getUserManager().getUser(player);
|
||||
if(plot.getPoints() > user.getStatistic("POINTS_HIGHEST")) {
|
||||
user.setStatistic("POINTS_HIGHEST", plot.getPoints());
|
||||
}
|
||||
@@ -180,7 +181,7 @@ public class InGameState extends PluginInGameState {
|
||||
}
|
||||
|
||||
private void handleThemeVoting(BuildArena pluginArena) {
|
||||
for(Player player : pluginArena.getPlayers()) {
|
||||
for(Player player : pluginArena.getPlayersLeft()) {
|
||||
pluginArena.getVoteMenu().updateInventory(player);
|
||||
}
|
||||
}
|
||||
@@ -196,6 +197,15 @@ public class InGameState extends PluginInGameState {
|
||||
pluginArena.checkPlayerOutSidePlot();
|
||||
}
|
||||
|
||||
private void handleOptionsMenu(BuildArena pluginArena) {
|
||||
if(pluginArena.getTimer() % 10 != 0) {
|
||||
return;
|
||||
}
|
||||
for(Player player : pluginArena.getPlayersLeft()) {
|
||||
pluginArena.getPlugin().getSpecialItemManager().getSpecialItem("OPTIONS_MENU").setItem(player);
|
||||
}
|
||||
}
|
||||
|
||||
private void handlePlotVoting(BuildArena pluginArena) {
|
||||
|
||||
}
|
||||
@@ -207,7 +217,7 @@ public class InGameState extends PluginInGameState {
|
||||
if(votingPlot.getPoints() == 0) {
|
||||
List<Plot> plotsVoted = new ArrayList<>();
|
||||
for(Player player : pluginArena.getPlayersLeft()) {
|
||||
User user = getPlugin().getUserManager().getUser(player);
|
||||
IUser user = getPlugin().getUserManager().getUser(player);
|
||||
Plot plot = pluginArena.getPlotFromPlayer(player);
|
||||
if(!votingPlot.getMembers().contains(player)) {
|
||||
if(!plotsVoted.contains(plot)) {
|
||||
@@ -249,7 +259,7 @@ public class InGameState extends PluginInGameState {
|
||||
|
||||
while(plot == null && !pluginArena.getQueue().isEmpty()) {
|
||||
// should not happen anymore... to be removed
|
||||
System.out.print("A PLAYER HAS NO PLOT!");
|
||||
getPlugin().getDebugger().debug("A PLAYER HAS NO PLOT!");
|
||||
plot = pluginArena.getQueue().poll();
|
||||
}
|
||||
|
||||
@@ -268,7 +278,7 @@ public class InGameState extends PluginInGameState {
|
||||
String formattedMembers = plot.getFormattedMembers();
|
||||
boolean hidePlotOwner = getPlugin().getConfigPreferences().getOption("PLOT_HIDE_OWNER");
|
||||
|
||||
for(Player player : pluginArena.getPlayers()) {
|
||||
for(Player player : pluginArena.getPlayersLeft()) {
|
||||
VersionUtils.teleport(player, teleportLoc);
|
||||
player.setPlayerWeather(plot.getWeatherType());
|
||||
player.setPlayerTime(Plot.Time.format(plot.getTime(), player.getWorld().getTime()), false);
|
||||
|
||||
@@ -28,20 +28,24 @@ import org.bukkit.entity.Player;
|
||||
import plugily.projects.buildbattle.arena.BaseArena;
|
||||
import plugily.projects.buildbattle.arena.GuessArena;
|
||||
import plugily.projects.buildbattle.arena.managers.plots.Plot;
|
||||
import plugily.projects.buildbattle.handlers.themes.BBTheme;
|
||||
import plugily.projects.buildbattle.handlers.themes.GuessTheme;
|
||||
import plugily.projects.buildbattle.handlers.themes.ThemeManager;
|
||||
import plugily.projects.minigamesbox.api.user.IUser;
|
||||
import plugily.projects.minigamesbox.classic.arena.PluginArena;
|
||||
import plugily.projects.minigamesbox.classic.arena.PluginArenaUtils;
|
||||
import plugily.projects.minigamesbox.classic.arena.states.PluginInGameState;
|
||||
import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder;
|
||||
import plugily.projects.minigamesbox.classic.handlers.language.TitleBuilder;
|
||||
import plugily.projects.minigamesbox.classic.user.User;
|
||||
import plugily.projects.minigamesbox.classic.utils.actionbar.ActionBar;
|
||||
import plugily.projects.minigamesbox.classic.utils.helper.ItemBuilder;
|
||||
import plugily.projects.minigamesbox.classic.utils.version.VersionUtils;
|
||||
import plugily.projects.minigamesbox.inventory.common.item.SimpleClickableItem;
|
||||
import plugily.projects.minigamesbox.inventory.normal.NormalFastInv;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
|
||||
/**
|
||||
* @author Tigerpanzer_02
|
||||
@@ -71,8 +75,11 @@ public class InGameState extends PluginInGameState {
|
||||
new MessageBuilder("IN_GAME_MESSAGES_PLOT_GTB_ROUND").asKey().integer(pluginArena.getRound()).arena(pluginArena).sendArena();
|
||||
new TitleBuilder("IN_GAME_MESSAGES_PLOT_GTB_THEME_GUESS_TITLE").asKey().arena(pluginArena).sendArena();
|
||||
|
||||
Bukkit.getScheduler().runTaskLater(getPlugin(), () -> pluginArena.getCurrentBuilders().forEach(player -> player.setGameMode(GameMode.CREATIVE)), 40);
|
||||
pluginArena.getCurrentBuilders().forEach(pluginArena::addMenuItem);
|
||||
Bukkit.getScheduler().runTaskLater(getPlugin(), () -> pluginArena.getCurrentBuilders().forEach(player -> {
|
||||
player.setGameMode(GameMode.CREATIVE);
|
||||
pluginArena.getPlayersLeft().forEach(ingamePlayer -> VersionUtils.hidePlayer(getPlugin(), player, ingamePlayer));
|
||||
pluginArena.getPlugin().getSpecialItemManager().getSpecialItem("OPTIONS_MENU").setItem(player);
|
||||
} ), 40);
|
||||
|
||||
setArenaTimer(getPlugin().getConfig().getInt("Time-Manager." + pluginArena.getArenaType().getPrefix() + ".In-Game"));
|
||||
pluginArena.setArenaInGameState(BaseArena.ArenaInGameState.BUILD_TIME);
|
||||
@@ -86,22 +93,26 @@ public class InGameState extends PluginInGameState {
|
||||
|
||||
if(timer <= 90) {
|
||||
if(timer == 90) {
|
||||
new MessageBuilder("IN_GAME_MESSAGES_PLOT_GTB_THEME_CHARS").asKey().arena(pluginArena).integer(pluginArena.getCurrentBBTheme().getTheme().length()).sendArena();
|
||||
new MessageBuilder("IN_GAME_MESSAGES_PLOT_GTB_THEME_CHARS").asKey().arena(pluginArena).integer(pluginArena.getCurrentBBTheme().getDefaultTheme().length()).sendArena();
|
||||
}
|
||||
sendThemeHints(arena, pluginArena);
|
||||
}
|
||||
if(timer <= 0) {
|
||||
//not all guessed
|
||||
new MessageBuilder("IN_GAME_MESSAGES_PLOT_GTB_THEME_WAS").asKey().value(pluginArena.getCurrentBBTheme().getTheme()).arena(pluginArena).sendArena();
|
||||
new TitleBuilder("IN_GAME_MESSAGES_PLOT_GTB_THEME_TITLE").asKey().value(pluginArena.getCurrentBBTheme().getTheme()).arena(pluginArena).sendArena();
|
||||
new MessageBuilder("IN_GAME_MESSAGES_PLOT_GTB_THEME_WAS").asKey().value(pluginArena.getCurrentBBTheme().getThemesAsString()).arena(pluginArena).sendArena();
|
||||
new TitleBuilder("IN_GAME_MESSAGES_PLOT_GTB_THEME_TITLE").asKey().value(pluginArena.getCurrentBBTheme().getThemesAsString()).arena(pluginArena).sendArena();
|
||||
|
||||
setArenaTimer(getPlugin().getConfig().getInt("Time-Manager." + pluginArena.getArenaType().getPrefix() + ".Round-Delay"));
|
||||
pluginArena.setArenaInGameState(BaseArena.ArenaInGameState.PLOT_VOTING);
|
||||
}
|
||||
//}
|
||||
handleBuildTime(pluginArena);
|
||||
handleOptionsMenu(pluginArena);
|
||||
break;
|
||||
case PLOT_VOTING:
|
||||
for(Player player : pluginArena.getPlayersLeft()) {
|
||||
PluginArenaUtils.showPlayer(player, arena);
|
||||
}
|
||||
if(pluginArena.getRound() + 1 > pluginArena.getPlotList().size() * pluginArena.getArenaOption("GTB_ROUNDS_PER_PLOT")) {
|
||||
pluginArena.calculateWinnerPlot();
|
||||
adjustStatistics(pluginArena);
|
||||
@@ -109,9 +120,7 @@ public class InGameState extends PluginInGameState {
|
||||
pluginArena.teleportToWinnerPlot(); //todo save built plot from winner
|
||||
pluginArena.executeEndRewards();
|
||||
getPlugin().getArenaManager().stopGame(false, arena);
|
||||
}
|
||||
//round delay
|
||||
if(arena.getTimer() <= 0) {
|
||||
} else if (arena.getTimer() <= 0) {
|
||||
pluginArena.resetBuildPlot();
|
||||
setArenaTimer(getPlugin().getConfig().getInt("Time-Manager." + pluginArena.getArenaType().getPrefix() + ".Voting.Theme"));
|
||||
pluginArena.setArenaInGameState(BaseArena.ArenaInGameState.THEME_VOTING);
|
||||
@@ -132,10 +141,10 @@ public class InGameState extends PluginInGameState {
|
||||
continue;
|
||||
}
|
||||
if(pluginArena.getWhoGuessed().contains(player)) {
|
||||
getPlugin().getActionBarManager().addActionBar(player, new ActionBar(new MessageBuilder(pluginArena.getCurrentBBTheme().getTheme()), ActionBar.ActionBarType.DISPLAY));
|
||||
getPlugin().getActionBarManager().addActionBar(player, new ActionBar(new MessageBuilder(pluginArena.getCurrentBBTheme().getDefaultTheme()), ActionBar.ActionBarType.DISPLAY));
|
||||
continue;
|
||||
}
|
||||
int themeLength = pluginArena.getCurrentBBTheme().getTheme().length();
|
||||
int themeLength = pluginArena.getCurrentBBTheme().getDefaultTheme().length();
|
||||
List<Integer> charsAt = new ArrayList<>(themeLength);
|
||||
|
||||
for(int i = 0; i < themeLength; i++) {
|
||||
@@ -155,7 +164,7 @@ public class InGameState extends PluginInGameState {
|
||||
|
||||
StringBuilder actionbar = new StringBuilder();
|
||||
for(int i = 0; i < themeLength; i++) {
|
||||
char charAt = pluginArena.getCurrentBBTheme().getTheme().charAt(i);
|
||||
char charAt = pluginArena.getCurrentBBTheme().getDefaultTheme().charAt(i);
|
||||
|
||||
if(Character.isWhitespace(charAt)) {
|
||||
actionbar.append(" ");
|
||||
@@ -175,13 +184,13 @@ public class InGameState extends PluginInGameState {
|
||||
if(pluginArena.isCurrentThemeSet()) {
|
||||
return;
|
||||
}
|
||||
BBTheme.Difficulty difficulty = BBTheme.Difficulty.EASY;
|
||||
GuessTheme.Difficulty difficulty = GuessTheme.Difficulty.EASY;
|
||||
switch(pluginArena.getPlugin().getRandom().nextInt(2 + 1)) {
|
||||
case 1:
|
||||
difficulty = BBTheme.Difficulty.MEDIUM;
|
||||
difficulty = GuessTheme.Difficulty.MEDIUM;
|
||||
break;
|
||||
case 2:
|
||||
difficulty = BBTheme.Difficulty.HARD;
|
||||
difficulty = GuessTheme.Difficulty.HARD;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -189,8 +198,17 @@ public class InGameState extends PluginInGameState {
|
||||
setChosenTheme(pluginArena, getThemeByDifficulty(pluginArena, difficulty));
|
||||
}
|
||||
|
||||
private void setChosenTheme(GuessArena pluginArena, BBTheme bbTheme) {
|
||||
setTheme(pluginArena, bbTheme);
|
||||
private void handleOptionsMenu(GuessArena pluginArena) {
|
||||
if(pluginArena.getTimer() % 10 != 0) {
|
||||
return;
|
||||
}
|
||||
for(Player player : pluginArena.getCurrentBuilders()) {
|
||||
pluginArena.getPlugin().getSpecialItemManager().getSpecialItem("OPTIONS_MENU").setItem(player);
|
||||
}
|
||||
}
|
||||
|
||||
private void setChosenTheme(GuessArena pluginArena, GuessTheme guessTheme) {
|
||||
setTheme(pluginArena, guessTheme);
|
||||
pluginArena.getCurrentBuilders().forEach(HumanEntity::closeInventory);
|
||||
pluginArena.getCurrentBuilders().forEach(player ->
|
||||
getPlugin().getActionBarManager().addActionBar(player, new ActionBar(new MessageBuilder("IN_GAME_MESSAGES_PLOT_GTB_THEME_NAME").asKey().player(player).arena(pluginArena),
|
||||
@@ -214,20 +232,20 @@ public class InGameState extends PluginInGameState {
|
||||
});
|
||||
|
||||
|
||||
BBTheme easy = getThemeByDifficulty(pluginArena, BBTheme.Difficulty.EASY);
|
||||
gui.setItem(11, new SimpleClickableItem(new ItemBuilder(Material.PAPER).name(getThemeItemName(pluginArena).value(easy.getTheme()).build())
|
||||
GuessTheme easy = getThemeByDifficulty(pluginArena, GuessTheme.Difficulty.EASY);
|
||||
gui.setItem(11, new SimpleClickableItem(new ItemBuilder(Material.PAPER).name(getThemeItemName(pluginArena).value(easy.getThemesAsString()).build())
|
||||
.lore(getThemeItemLore(pluginArena).value(new MessageBuilder("MENU_THEME_GTB_DIFFICULTIES_EASY").asKey().build()).integer(easy.getDifficulty().getPointsReward()).build().split(";")).build(), event -> {
|
||||
setChosenTheme(pluginArena, easy);
|
||||
}));
|
||||
|
||||
BBTheme medium = getThemeByDifficulty(pluginArena, BBTheme.Difficulty.MEDIUM);
|
||||
gui.setItem(13, new SimpleClickableItem(new ItemBuilder(Material.PAPER).name(getThemeItemName(pluginArena).value(medium.getTheme()).build())
|
||||
GuessTheme medium = getThemeByDifficulty(pluginArena, GuessTheme.Difficulty.MEDIUM);
|
||||
gui.setItem(13, new SimpleClickableItem(new ItemBuilder(Material.PAPER).name(getThemeItemName(pluginArena).value(medium.getThemesAsString()).build())
|
||||
.lore(getThemeItemLore(pluginArena).value(new MessageBuilder("MENU_THEME_GTB_DIFFICULTIES_MEDIUM").asKey().build()).integer(medium.getDifficulty().getPointsReward()).build().split(";")).build(), event -> {
|
||||
setChosenTheme(pluginArena, medium);
|
||||
}));
|
||||
|
||||
BBTheme hard = getThemeByDifficulty(pluginArena, BBTheme.Difficulty.HARD);
|
||||
gui.setItem(15, new SimpleClickableItem(new ItemBuilder(Material.PAPER).name(getThemeItemName(pluginArena).value(hard.getTheme()).build())
|
||||
GuessTheme hard = getThemeByDifficulty(pluginArena, GuessTheme.Difficulty.HARD);
|
||||
gui.setItem(15, new SimpleClickableItem(new ItemBuilder(Material.PAPER).name(getThemeItemName(pluginArena).value(hard.getThemesAsString()).build())
|
||||
.lore(getThemeItemLore(pluginArena).value(new MessageBuilder("MENU_THEME_GTB_DIFFICULTIES_HARD").asKey().build()).integer(hard.getDifficulty().getPointsReward()).build().split(";")).build(), event -> {
|
||||
setChosenTheme(pluginArena, hard);
|
||||
}));
|
||||
@@ -245,27 +263,31 @@ public class InGameState extends PluginInGameState {
|
||||
}
|
||||
|
||||
|
||||
private BBTheme getThemeByDifficulty(GuessArena pluginArena, BBTheme.Difficulty difficulty) {
|
||||
private GuessTheme getThemeByDifficulty(GuessArena pluginArena, GuessTheme.Difficulty difficulty) {
|
||||
List<String> themes = pluginArena.getPlugin().getThemeManager().getThemes(ThemeManager.GameThemes.getByDifficulty(difficulty));
|
||||
List<String> themesFilter = new ArrayList<>(themes);
|
||||
themesFilter.removeAll(pluginArena.getPlayedThemes());
|
||||
if(themesFilter.isEmpty()) {
|
||||
themesFilter = themes;
|
||||
}
|
||||
String themeName = themesFilter.get(getPlugin().getRandom().nextInt(themesFilter.size()));
|
||||
BBTheme theme = new BBTheme(themeName, difficulty);
|
||||
pluginArena.getPlayedThemes().add(themeName);
|
||||
String unmatchedThemes = themesFilter.get(getPlugin().getRandom().nextInt(themesFilter.size()));
|
||||
ArrayList<String> themeNames = new ArrayList<>(Arrays.asList(unmatchedThemes.split("\\s*,\\s*")));
|
||||
if(themeNames.isEmpty()) {
|
||||
pluginArena.getPlugin().getDebugger().debug(Level.WARNING, "&cThemes.yml broken. Th following line was found "+unmatchedThemes+ " ! Please remove empty lines!");
|
||||
}
|
||||
GuessTheme theme = new GuessTheme(themeNames, difficulty);
|
||||
pluginArena.getPlayedThemes().add(unmatchedThemes);
|
||||
return theme;
|
||||
}
|
||||
|
||||
private void setTheme(GuessArena pluginArena, BBTheme theme) {
|
||||
private void setTheme(GuessArena pluginArena, GuessTheme theme) {
|
||||
pluginArena.setCurrentTheme(theme);
|
||||
}
|
||||
|
||||
private void adjustStatistics(GuessArena pluginArena) {
|
||||
for(Plot plot : pluginArena.getPlotManager().getTopPlotsOrder()) {
|
||||
plot.getMembers().forEach(player -> {
|
||||
User user = getPlugin().getUserManager().getUser(player);
|
||||
IUser user = getPlugin().getUserManager().getUser(player);
|
||||
/*
|
||||
//ToDo GTB stats
|
||||
if(plot.getPoints() > user.getStatistic("POINTS_HIGHEST")) {
|
||||
|
||||
@@ -28,9 +28,9 @@ import plugily.projects.buildbattle.arena.BaseArena;
|
||||
import plugily.projects.buildbattle.arena.BuildArena;
|
||||
import plugily.projects.buildbattle.arena.GuessArena;
|
||||
import plugily.projects.buildbattle.arena.managers.plots.Plot;
|
||||
import plugily.projects.minigamesbox.classic.arena.ArenaState;
|
||||
import plugily.projects.minigamesbox.api.arena.IArenaState;
|
||||
import plugily.projects.minigamesbox.api.user.IUser;
|
||||
import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder;
|
||||
import plugily.projects.minigamesbox.classic.user.User;
|
||||
import plugily.projects.minigamesbox.classic.utils.misc.complement.ComplementAccessor;
|
||||
import plugily.projects.minigamesbox.classic.utils.version.VersionUtils;
|
||||
import plugily.projects.minigamesbox.classic.utils.version.events.api.PlugilyPlayerInteractEvent;
|
||||
@@ -60,7 +60,7 @@ public class VoteEvents implements Listener {
|
||||
}
|
||||
|
||||
BaseArena arena = plugin.getArenaRegistry().getArena(event.getPlayer());
|
||||
if(arena == null || arena.getArenaState() != ArenaState.IN_GAME || arena instanceof GuessArena) {
|
||||
if(arena == null || arena.getArenaState() != IArenaState.IN_GAME || arena instanceof GuessArena) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ public class VoteEvents implements Listener {
|
||||
Plot plot = solo.getVotingPlot();
|
||||
|
||||
if(plugin.getVoteItems().getReportItem().equals(event.getItem())) {
|
||||
User user = plugin.getUserManager().getUser(event.getPlayer());
|
||||
IUser user = plugin.getUserManager().getUser(event.getPlayer());
|
||||
|
||||
user.adjustStatistic("REPORTS_TRIGGERED", 1);
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
package plugily.projects.buildbattle.boot;
|
||||
|
||||
import plugily.projects.buildbattle.Main;
|
||||
import plugily.projects.minigamesbox.api.preferences.IConfigPreferences;
|
||||
import plugily.projects.minigamesbox.classic.api.StatisticType;
|
||||
import plugily.projects.minigamesbox.classic.api.StatsStorage;
|
||||
import plugily.projects.minigamesbox.classic.arena.options.ArenaOption;
|
||||
@@ -31,7 +32,6 @@ import plugily.projects.minigamesbox.classic.handlers.permissions.PermissionsMan
|
||||
import plugily.projects.minigamesbox.classic.handlers.reward.RewardType;
|
||||
import plugily.projects.minigamesbox.classic.handlers.reward.RewardsFactory;
|
||||
import plugily.projects.minigamesbox.classic.preferences.ConfigOption;
|
||||
import plugily.projects.minigamesbox.classic.preferences.ConfigPreferences;
|
||||
|
||||
/**
|
||||
* @author Tigerpanzer_02
|
||||
@@ -53,13 +53,14 @@ public class AdditionalValueInitializer {
|
||||
}
|
||||
|
||||
private void registerConfigOptions() {
|
||||
ConfigPreferences configPreferences = plugin.getConfigPreferences();
|
||||
IConfigPreferences configPreferences = plugin.getConfigPreferences();
|
||||
|
||||
configPreferences.registerOption("MOB_SPAWN", new ConfigOption("Mob.Spawn", false));
|
||||
configPreferences.registerOption("HEAD_MENU_CUSTOM", new ConfigOption("Head-Menu.Custom", false));
|
||||
configPreferences.registerOption("REPORT_COMMANDS", new ConfigOption("Report.Commands", false));
|
||||
configPreferences.registerOption("PLOT_HIDE_OWNER", new ConfigOption("Plot.Hide-Owner", false));
|
||||
configPreferences.registerOption("PLOT_MOVE_OUTSIDE", new ConfigOption("Plot.Move-Outside", false));
|
||||
configPreferences.registerOption("SUPER_VOTES", new ConfigOption("Super-Votes", true));
|
||||
}
|
||||
|
||||
private void registerStatistics() {
|
||||
@@ -92,7 +93,7 @@ public class AdditionalValueInitializer {
|
||||
rewardsFactory.registerRewardType("VOTE", new RewardType("voted"));
|
||||
rewardsFactory.registerRewardType("VOTE_ALL", new RewardType("voted-all"));
|
||||
rewardsFactory.registerRewardType("REPORT", new RewardType("report"));
|
||||
rewardsFactory.registerRewardType("PLACE", new RewardType("place"));
|
||||
rewardsFactory.registerRewardType("PLACE", new RewardType("place", RewardType.ExecutorType.NUMBER, false));
|
||||
}
|
||||
|
||||
private void registerSpecialItems() {
|
||||
|
||||
@@ -111,6 +111,7 @@ public class MessageInitializer {
|
||||
messageManager.registerMessage("MENU_OPTION_CONTENT_HEADS_INVENTORY", new Message("Menu.Option.Content.Heads.Inventory", ""));
|
||||
messageManager.registerMessage("MENU_OPTION_CONTENT_HEADS_ITEM_NAME", new Message("Menu.Option.Content.Heads.Item.Name", ""));
|
||||
messageManager.registerMessage("MENU_OPTION_CONTENT_HEADS_ITEM_LORE", new Message("Menu.Option.Content.Heads.Item.Lore", ""));
|
||||
messageManager.registerMessage("MENU_OPTION_CONTENT_HEADS_DATABASE_LORE", new Message("Menu.Option.Content.Heads.Database.Lore", "Get Head %value%"));
|
||||
messageManager.registerMessage("MENU_OPTION_CONTENT_FLOOR_ITEM_NAME", new Message("Menu.Option.Content.Floor.Item.Name", ""));
|
||||
messageManager.registerMessage("MENU_OPTION_CONTENT_FLOOR_ITEM_LORE", new Message("Menu.Option.Content.Floor.Item.Lore", ""));
|
||||
messageManager.registerMessage("MENU_OPTION_CONTENT_FLOOR_CHANGED", new Message("Menu.Option.Content.Floor.Changed", ""));
|
||||
|
||||
@@ -28,9 +28,9 @@ import plugily.projects.buildbattle.arena.BaseArena;
|
||||
import plugily.projects.buildbattle.arena.BuildArena;
|
||||
import plugily.projects.buildbattle.arena.GuessArena;
|
||||
import plugily.projects.buildbattle.arena.managers.plots.Plot;
|
||||
import plugily.projects.buildbattle.handlers.themes.BBTheme;
|
||||
import plugily.projects.minigamesbox.classic.arena.ArenaState;
|
||||
import plugily.projects.minigamesbox.classic.arena.PluginArena;
|
||||
import plugily.projects.buildbattle.handlers.themes.GuessTheme;
|
||||
import plugily.projects.minigamesbox.api.arena.IArenaState;
|
||||
import plugily.projects.minigamesbox.api.arena.IPluginArena;
|
||||
import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder;
|
||||
import plugily.projects.minigamesbox.classic.handlers.placeholder.Placeholder;
|
||||
import plugily.projects.minigamesbox.classic.handlers.placeholder.PlaceholderManager;
|
||||
@@ -58,30 +58,30 @@ public class PlaceholderInitializer {
|
||||
|
||||
placeholderManager.registerPlaceholder(new Placeholder("theme", Placeholder.PlaceholderType.ARENA, Placeholder.PlaceholderExecutor.ALL) {
|
||||
@Override
|
||||
public String getValue(Player player, PluginArena arena) {
|
||||
public String getValue(Player player, IPluginArena arena) {
|
||||
return getTheme(player, arena);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getValue(PluginArena arena) {
|
||||
public String getValue(IPluginArena arena) {
|
||||
return getTheme(arena);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private String getTheme(PluginArena arena) {
|
||||
private String getTheme(IPluginArena arena) {
|
||||
BaseArena pluginArena = arenaRegistry.getArena(arena.getId());
|
||||
if(pluginArena == null) {
|
||||
return null;
|
||||
}
|
||||
String theme = pluginArena.getTheme();
|
||||
if(theme.equalsIgnoreCase("theme")) {
|
||||
if(theme == null) {
|
||||
theme = new MessageBuilder("SCOREBOARD_THEME_UNKNOWN").asKey().build();
|
||||
}
|
||||
return theme;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private String getTheme(Player player, PluginArena arena) {
|
||||
private String getTheme(Player player, IPluginArena arena) {
|
||||
String theme = getTheme(arena);
|
||||
BaseArena pluginArena = arenaRegistry.getArena(arena.getId());
|
||||
if(pluginArena == null) {
|
||||
@@ -92,8 +92,8 @@ public class PlaceholderInitializer {
|
||||
}
|
||||
if(theme.equalsIgnoreCase(new MessageBuilder("SCOREBOARD_THEME_UNKNOWN").asKey().build())) {
|
||||
if(((GuessArena) pluginArena).getCurrentBuilders().contains(player) || ((GuessArena) pluginArena).getWhoGuessed().contains(player)) {
|
||||
BBTheme guessTheme = ((GuessArena) pluginArena).getCurrentBBTheme();
|
||||
theme = guessTheme == null ? new MessageBuilder("SCOREBOARD_THEME_UNKNOWN").asKey().build() : guessTheme.getTheme();
|
||||
GuessTheme guessTheme = ((GuessArena) pluginArena).getCurrentBBTheme();
|
||||
theme = guessTheme == null ? new MessageBuilder("SCOREBOARD_THEME_UNKNOWN").asKey().build() : guessTheme.getDefaultTheme();
|
||||
}
|
||||
}
|
||||
return theme;
|
||||
@@ -102,20 +102,20 @@ public class PlaceholderInitializer {
|
||||
|
||||
placeholderManager.registerPlaceholder(new Placeholder("difficulty", Placeholder.PlaceholderType.ARENA, Placeholder.PlaceholderExecutor.ALL) {
|
||||
@Override
|
||||
public String getValue(Player player, PluginArena arena) {
|
||||
public String getValue(Player player, IPluginArena arena) {
|
||||
return getTheme(arena);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getValue(PluginArena arena) {
|
||||
public String getValue(IPluginArena arena) {
|
||||
return getTheme(arena);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private String getTheme(PluginArena arena) {
|
||||
private String getTheme(IPluginArena arena) {
|
||||
BaseArena pluginArena = arenaRegistry.getArena(arena.getId());
|
||||
if(pluginArena instanceof GuessArena) {
|
||||
BBTheme theme = ((GuessArena) pluginArena).getCurrentBBTheme();
|
||||
GuessTheme theme = ((GuessArena) pluginArena).getCurrentBBTheme();
|
||||
if(theme == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -127,20 +127,20 @@ public class PlaceholderInitializer {
|
||||
|
||||
placeholderManager.registerPlaceholder(new Placeholder("difficulty_points_reward", Placeholder.PlaceholderType.ARENA, Placeholder.PlaceholderExecutor.ALL) {
|
||||
@Override
|
||||
public String getValue(Player player, PluginArena arena) {
|
||||
public String getValue(Player player, IPluginArena arena) {
|
||||
return getTheme(arena);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getValue(PluginArena arena) {
|
||||
public String getValue(IPluginArena arena) {
|
||||
return getTheme(arena);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private String getTheme(PluginArena arena) {
|
||||
private String getTheme(IPluginArena arena) {
|
||||
BaseArena pluginArena = arenaRegistry.getArena(arena.getId());
|
||||
if(pluginArena instanceof GuessArena) {
|
||||
BBTheme theme = ((GuessArena) pluginArena).getCurrentBBTheme();
|
||||
GuessTheme theme = ((GuessArena) pluginArena).getCurrentBBTheme();
|
||||
if(theme == null) {
|
||||
return "0";
|
||||
}
|
||||
@@ -152,17 +152,17 @@ public class PlaceholderInitializer {
|
||||
|
||||
placeholderManager.registerPlaceholder(new Placeholder("builder", Placeholder.PlaceholderType.ARENA, Placeholder.PlaceholderExecutor.ALL) {
|
||||
@Override
|
||||
public String getValue(Player player, PluginArena arena) {
|
||||
public String getValue(Player player, IPluginArena arena) {
|
||||
return getBuilder(arena);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getValue(PluginArena arena) {
|
||||
public String getValue(IPluginArena arena) {
|
||||
return getBuilder(arena);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private String getBuilder(PluginArena arena) {
|
||||
private String getBuilder(IPluginArena arena) {
|
||||
BaseArena pluginArena = arenaRegistry.getArena(arena.getId());
|
||||
if(!(pluginArena instanceof GuessArena)) {
|
||||
return null;
|
||||
@@ -176,17 +176,17 @@ public class PlaceholderInitializer {
|
||||
|
||||
placeholderManager.registerPlaceholder(new Placeholder("type", Placeholder.PlaceholderType.ARENA, Placeholder.PlaceholderExecutor.ALL) {
|
||||
@Override
|
||||
public String getValue(Player player, PluginArena arena) {
|
||||
public String getValue(Player player, IPluginArena arena) {
|
||||
return getType(arena);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getValue(PluginArena arena) {
|
||||
public String getValue(IPluginArena arena) {
|
||||
return getType(arena);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private String getType(PluginArena arena) {
|
||||
private String getType(IPluginArena arena) {
|
||||
BaseArena pluginArena = arenaRegistry.getArena(arena.getId());
|
||||
if(pluginArena == null) {
|
||||
return null;
|
||||
@@ -196,17 +196,17 @@ public class PlaceholderInitializer {
|
||||
});
|
||||
placeholderManager.registerPlaceholder(new Placeholder("type_pretty", Placeholder.PlaceholderType.ARENA, Placeholder.PlaceholderExecutor.ALL) {
|
||||
@Override
|
||||
public String getValue(Player player, PluginArena arena) {
|
||||
public String getValue(Player player, IPluginArena arena) {
|
||||
return getType(arena);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getValue(PluginArena arena) {
|
||||
public String getValue(IPluginArena arena) {
|
||||
return getType(arena);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private String getType(PluginArena arena) {
|
||||
private String getType(IPluginArena arena) {
|
||||
BaseArena pluginArena = arenaRegistry.getArena(arena.getId());
|
||||
if(pluginArena == null) {
|
||||
return null;
|
||||
@@ -218,22 +218,22 @@ public class PlaceholderInitializer {
|
||||
final int number = i;
|
||||
placeholderManager.registerPlaceholder(new Placeholder("place_member_" + number, Placeholder.PlaceholderType.ARENA, Placeholder.PlaceholderExecutor.ALL) {
|
||||
@Override
|
||||
public String getValue(Player player, PluginArena arena) {
|
||||
public String getValue(Player player, IPluginArena arena) {
|
||||
return getPlace(arena);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getValue(PluginArena arena) {
|
||||
public String getValue(IPluginArena arena) {
|
||||
return getPlace(arena);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private String getPlace(PluginArena arena) {
|
||||
private String getPlace(IPluginArena arena) {
|
||||
BaseArena pluginArena = arenaRegistry.getArena(arena.getId());
|
||||
if(pluginArena == null) {
|
||||
return null;
|
||||
}
|
||||
if(pluginArena.getArenaInGameState() != BaseArena.ArenaInGameState.PLOT_VOTING && pluginArena.getArenaState() != ArenaState.ENDING) {
|
||||
if(pluginArena.getArenaInGameState() != BaseArena.ArenaInGameState.PLOT_VOTING && pluginArena.getArenaState() != IArenaState.ENDING) {
|
||||
return "???";
|
||||
}
|
||||
List<Plot> plotRanking = pluginArena.getPlotManager().getTopPlotsOrder();
|
||||
@@ -249,22 +249,22 @@ public class PlaceholderInitializer {
|
||||
|
||||
placeholderManager.registerPlaceholder(new Placeholder("place_points_" + number, Placeholder.PlaceholderType.ARENA, Placeholder.PlaceholderExecutor.ALL) {
|
||||
@Override
|
||||
public String getValue(Player player, PluginArena arena) {
|
||||
public String getValue(Player player, IPluginArena arena) {
|
||||
return getPlace(arena);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getValue(PluginArena arena) {
|
||||
public String getValue(IPluginArena arena) {
|
||||
return getPlace(arena);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private String getPlace(PluginArena arena) {
|
||||
private String getPlace(IPluginArena arena) {
|
||||
BaseArena pluginArena = arenaRegistry.getArena(arena.getId());
|
||||
if(pluginArena == null) {
|
||||
return null;
|
||||
}
|
||||
if(pluginArena.getArenaInGameState() != BaseArena.ArenaInGameState.PLOT_VOTING && pluginArena.getArenaState() != ArenaState.ENDING) {
|
||||
if(pluginArena.getArenaInGameState() != BaseArena.ArenaInGameState.PLOT_VOTING && pluginArena.getArenaState() != IArenaState.ENDING) {
|
||||
return "???";
|
||||
}
|
||||
List<Plot> plotRanking = pluginArena.getPlotManager().getTopPlotsOrder();
|
||||
@@ -277,17 +277,17 @@ public class PlaceholderInitializer {
|
||||
}
|
||||
placeholderManager.registerPlaceholder(new Placeholder("ingame_state", Placeholder.PlaceholderType.ARENA, Placeholder.PlaceholderExecutor.ALL) {
|
||||
@Override
|
||||
public String getValue(Player player, PluginArena arena) {
|
||||
public String getValue(Player player, IPluginArena arena) {
|
||||
return getState(arena);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getValue(PluginArena arena) {
|
||||
public String getValue(IPluginArena arena) {
|
||||
return getState(arena);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private String getState(PluginArena arena) {
|
||||
private String getState(IPluginArena arena) {
|
||||
BaseArena pluginArena = arenaRegistry.getArena(arena.getId());
|
||||
if(pluginArena == null) {
|
||||
return null;
|
||||
@@ -301,17 +301,17 @@ public class PlaceholderInitializer {
|
||||
|
||||
placeholderManager.registerPlaceholder(new Placeholder("ingame_state_pretty", Placeholder.PlaceholderType.ARENA, Placeholder.PlaceholderExecutor.ALL) {
|
||||
@Override
|
||||
public String getValue(Player player, PluginArena arena) {
|
||||
public String getValue(Player player, IPluginArena arena) {
|
||||
return getState(arena);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getValue(PluginArena arena) {
|
||||
public String getValue(IPluginArena arena) {
|
||||
return getState(arena);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private String getState(PluginArena arena) {
|
||||
private String getState(IPluginArena arena) {
|
||||
BaseArena pluginArena = arenaRegistry.getArena(arena.getId());
|
||||
if(pluginArena == null) {
|
||||
return null;
|
||||
@@ -326,12 +326,12 @@ public class PlaceholderInitializer {
|
||||
|
||||
placeholderManager.registerPlaceholder(new Placeholder("teammates", Placeholder.PlaceholderType.ARENA, Placeholder.PlaceholderExecutor.ALL) {
|
||||
@Override
|
||||
public String getValue(Player player, PluginArena arena) {
|
||||
public String getValue(Player player, IPluginArena arena) {
|
||||
return getMembers(player, arena);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private String getMembers(Player player, PluginArena arena) {
|
||||
private String getMembers(Player player, IPluginArena arena) {
|
||||
BaseArena pluginArena = arenaRegistry.getArena(arena.getId());
|
||||
if(pluginArena == null) {
|
||||
return null;
|
||||
@@ -355,12 +355,12 @@ public class PlaceholderInitializer {
|
||||
|
||||
placeholderManager.registerPlaceholder(new Placeholder("summary_player", Placeholder.PlaceholderType.ARENA, Placeholder.PlaceholderExecutor.ALL) {
|
||||
@Override
|
||||
public String getValue(Player player, PluginArena arena) {
|
||||
public String getValue(Player player, IPluginArena arena) {
|
||||
return getSummary(arena, player);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private String getSummary(PluginArena arena, Player player) {
|
||||
private String getSummary(IPluginArena arena, Player player) {
|
||||
BaseArena pluginArena = arenaRegistry.getArena(arena.getId());
|
||||
if(pluginArena == null) {
|
||||
return null;
|
||||
@@ -375,17 +375,17 @@ public class PlaceholderInitializer {
|
||||
|
||||
placeholderManager.registerPlaceholder(new Placeholder("summary_place_own", Placeholder.PlaceholderType.ARENA, Placeholder.PlaceholderExecutor.ALL) {
|
||||
@Override
|
||||
public String getValue(Player player, PluginArena arena) {
|
||||
public String getValue(Player player, IPluginArena arena) {
|
||||
return getSummary(arena, player);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private String getSummary(PluginArena arena, Player player) {
|
||||
private String getSummary(IPluginArena arena, Player player) {
|
||||
BaseArena pluginArena = arenaRegistry.getArena(arena.getId());
|
||||
if(pluginArena == null) {
|
||||
return null;
|
||||
}
|
||||
if(pluginArena.getArenaInGameState() != BaseArena.ArenaInGameState.PLOT_VOTING && pluginArena.getArenaState() != ArenaState.ENDING) {
|
||||
if(pluginArena.getArenaInGameState() != BaseArena.ArenaInGameState.PLOT_VOTING && pluginArena.getArenaState() != IArenaState.ENDING) {
|
||||
return null;
|
||||
}
|
||||
List<Plot> plotRanking = pluginArena.getPlotManager().getTopPlotsOrder();
|
||||
@@ -404,17 +404,17 @@ public class PlaceholderInitializer {
|
||||
|
||||
placeholderManager.registerPlaceholder(new Placeholder("summary", Placeholder.PlaceholderType.ARENA, Placeholder.PlaceholderExecutor.ALL) {
|
||||
@Override
|
||||
public String getValue(Player player, PluginArena arena) {
|
||||
public String getValue(Player player, IPluginArena arena) {
|
||||
return getSummary(arena);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getValue(PluginArena arena) {
|
||||
public String getValue(IPluginArena arena) {
|
||||
return getSummary(arena);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private String getSummary(PluginArena arena) {
|
||||
private String getSummary(IPluginArena arena) {
|
||||
BaseArena pluginArena = arenaRegistry.getArena(arena.getId());
|
||||
if(pluginArena == null) {
|
||||
return null;
|
||||
@@ -428,27 +428,27 @@ public class PlaceholderInitializer {
|
||||
});
|
||||
placeholderManager.registerPlaceholder(new Placeholder("summary_place_list", Placeholder.PlaceholderType.ARENA, Placeholder.PlaceholderExecutor.ALL) {
|
||||
@Override
|
||||
public String getValue(Player player, PluginArena arena) {
|
||||
public String getValue(Player player, IPluginArena arena) {
|
||||
return getSummary(arena);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getValue(PluginArena arena) {
|
||||
public String getValue(IPluginArena arena) {
|
||||
return getSummary(arena);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private String getSummary(PluginArena arena) {
|
||||
private String getSummary(IPluginArena arena) {
|
||||
BaseArena pluginArena = arenaRegistry.getArena(arena.getId());
|
||||
if(pluginArena == null) {
|
||||
return null;
|
||||
}
|
||||
if(pluginArena.getArenaInGameState() != BaseArena.ArenaInGameState.PLOT_VOTING && pluginArena.getArenaState() != ArenaState.ENDING) {
|
||||
if(pluginArena.getArenaInGameState() != BaseArena.ArenaInGameState.PLOT_VOTING && pluginArena.getArenaState() != IArenaState.ENDING) {
|
||||
return null;
|
||||
}
|
||||
int places = pluginArena.getPlotManager().getTopPlotsOrder().size();
|
||||
if(places > 16) {
|
||||
places = 16;
|
||||
if(places > 20) {
|
||||
places = 20;
|
||||
}
|
||||
StringBuilder placeSummary = new StringBuilder();
|
||||
for(int i = 1; i <= places; i++) {
|
||||
@@ -460,17 +460,17 @@ public class PlaceholderInitializer {
|
||||
});
|
||||
placeholderManager.registerPlaceholder(new Placeholder("gtb_rounds", Placeholder.PlaceholderType.ARENA, Placeholder.PlaceholderExecutor.ALL) {
|
||||
@Override
|
||||
public String getValue(Player player, PluginArena arena) {
|
||||
public String getValue(Player player, IPluginArena arena) {
|
||||
return getSummary(arena);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getValue(PluginArena arena) {
|
||||
public String getValue(IPluginArena arena) {
|
||||
return getSummary(arena);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private String getSummary(PluginArena arena) {
|
||||
private String getSummary(IPluginArena arena) {
|
||||
BaseArena pluginArena = arenaRegistry.getArena(arena.getId());
|
||||
if(pluginArena == null) {
|
||||
return null;
|
||||
|
||||
+13
-4
@@ -20,17 +20,21 @@
|
||||
|
||||
package plugily.projects.buildbattle.commands.arguments;
|
||||
|
||||
import org.checkerframework.checker.units.qual.Force;
|
||||
import plugily.projects.buildbattle.Main;
|
||||
import plugily.projects.buildbattle.arena.BaseArena;
|
||||
import plugily.projects.buildbattle.arena.BuildArena;
|
||||
import plugily.projects.buildbattle.arena.GuessArena;
|
||||
import plugily.projects.buildbattle.commands.arguments.admin.ThemeArgument;
|
||||
import plugily.projects.buildbattle.commands.arguments.admin.arena.AddNpcArgument;
|
||||
import plugily.projects.buildbattle.commands.arguments.admin.arena.ForcePlayArgument;
|
||||
import plugily.projects.buildbattle.commands.arguments.admin.arena.SetThemeArgument;
|
||||
import plugily.projects.buildbattle.commands.arguments.admin.plot.AddPlotArgument;
|
||||
import plugily.projects.buildbattle.commands.arguments.admin.plot.RemovePlotArgument;
|
||||
import plugily.projects.buildbattle.commands.arguments.admin.plot.SelectPlotArgument;
|
||||
import plugily.projects.buildbattle.commands.arguments.game.GuessArgument;
|
||||
import plugily.projects.minigamesbox.classic.arena.PluginArena;
|
||||
import plugily.projects.buildbattle.commands.arguments.game.MenuArgument;
|
||||
import plugily.projects.minigamesbox.api.arena.IPluginArena;
|
||||
import plugily.projects.minigamesbox.classic.commands.arguments.PluginArgumentsRegistry;
|
||||
|
||||
import java.util.List;
|
||||
@@ -46,25 +50,30 @@ public class ArgumentsRegistry extends PluginArgumentsRegistry {
|
||||
public ArgumentsRegistry(Main plugin) {
|
||||
super(plugin);
|
||||
new AddNpcArgument(this);
|
||||
new ForcePlayArgument(this);
|
||||
new SetThemeArgument(this);
|
||||
new AddPlotArgument(this);
|
||||
new RemovePlotArgument(this);
|
||||
new SelectPlotArgument(this);
|
||||
new MenuArgument(this);
|
||||
new GuessArgument(this);
|
||||
new ThemeArgument(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PluginArena> getSpecificFilteredArenas(List<PluginArena> arenas, String filter) {
|
||||
public List<IPluginArena> getSpecificFilteredArenas(List<IPluginArena> arenas, String filter) {
|
||||
switch(filter.toLowerCase(Locale.ENGLISH)) {
|
||||
case "gtb":
|
||||
case "guessthebuild":
|
||||
case "guess_the_build":
|
||||
return arenas.stream().filter(GuessArena.class::isInstance).collect(Collectors.toList());
|
||||
case "team":
|
||||
return arenas.stream().filter(BuildArena.class::isInstance).filter(arena -> ((BuildArena) arena).getArenaType().equals(BaseArena.ArenaType.TEAM)).collect(Collectors.toList());
|
||||
case "classic":
|
||||
case "solo":
|
||||
case "team":
|
||||
default:
|
||||
return arenas.stream().filter(BuildArena.class::isInstance).filter(arena -> ((BuildArena) arena).getArenaType().equals(BaseArena.ArenaType.SOLO)).collect(Collectors.toList());
|
||||
case "build":
|
||||
default:
|
||||
return arenas.stream().filter(BuildArena.class::isInstance).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
||||
+104
@@ -0,0 +1,104 @@
|
||||
/*
|
||||
*
|
||||
* BuildBattle - Ultimate building competition minigame
|
||||
* Copyright (C) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package plugily.projects.buildbattle.commands.arguments.admin.arena;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import plugily.projects.buildbattle.arena.BaseArena;
|
||||
import plugily.projects.buildbattle.arena.BuildArena;
|
||||
import plugily.projects.buildbattle.commands.arguments.ArgumentsRegistry;
|
||||
import plugily.projects.minigamesbox.api.arena.IArenaState;
|
||||
import plugily.projects.minigamesbox.classic.commands.arguments.data.CommandArgument;
|
||||
import plugily.projects.minigamesbox.classic.commands.arguments.data.LabelData;
|
||||
import plugily.projects.minigamesbox.classic.commands.arguments.data.LabeledCommandArgument;
|
||||
import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder;
|
||||
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* @author Plajer
|
||||
* <p>
|
||||
* Created at 11.01.2019
|
||||
*/
|
||||
public class ForcePlayArgument {
|
||||
|
||||
public ForcePlayArgument(ArgumentsRegistry registry) {
|
||||
registry.mapArgument("buildbattleadmin", new LabeledCommandArgument("forceplay", "buildbattle.admin.forceplay", CommandArgument.ExecutorType.BOTH,
|
||||
new LabelData("/bba forceplay <arena> <theme>", "/bba forceplay <arena> <theme>",
|
||||
"&7Start a arena by command \n&6Permission: &7buildbattle.admin.forceplay\n&cNOT FOR PRODUCTION!")) {
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(args.length == 1) {
|
||||
new MessageBuilder("&cPlease type arena theme!").prefix().send(sender);
|
||||
return;
|
||||
}
|
||||
BaseArena arena;
|
||||
int themeArgStart = 1;
|
||||
if(!(sender instanceof Player)) {
|
||||
arena = (BaseArena) registry.getPlugin().getArenaRegistry().getArena(args[1]);
|
||||
if(args.length == 2 && arena != null) {
|
||||
BaseArena finalArena = arena;
|
||||
Bukkit.getOnlinePlayers().forEach(player -> {
|
||||
registry.getPlugin().getArenaManager().joinAttempt(player, finalArena);
|
||||
});
|
||||
arena.setForceStart(true);
|
||||
return;
|
||||
}
|
||||
themeArgStart = 2;
|
||||
} else {
|
||||
arena = (BaseArena) registry.getPlugin().getArenaRegistry().getArena((Player) sender);
|
||||
if(arena == null) {
|
||||
arena = (BaseArena) registry.getPlugin().getArenaRegistry().getArena(args[1]);
|
||||
}
|
||||
}
|
||||
if(arena == null) {
|
||||
new MessageBuilder("COMMANDS_NOT_PLAYING").asKey().send(sender);
|
||||
return;
|
||||
}
|
||||
if(!(arena instanceof BuildArena)) {
|
||||
new MessageBuilder("&cCan't set theme on this arena type!").prefix().send(sender);
|
||||
return;
|
||||
}
|
||||
StringJoiner themeName = new StringJoiner(" ");
|
||||
|
||||
for(int i = themeArgStart; i < args.length; i++)
|
||||
themeName.add(args[i]);
|
||||
if(arena.getArenaInGameState() == BaseArena.ArenaInGameState.BUILD_TIME || arena.getArenaState() == IArenaState.WAITING_FOR_PLAYERS || arena.getArenaState() == IArenaState.STARTING || arena.getArenaState() == IArenaState.FULL_GAME || arena.getArenaInGameState() == BaseArena.ArenaInGameState.THEME_VOTING) {
|
||||
if(arena.getPlugin().getThemeManager().isThemeBlacklisted(themeName.toString())) {
|
||||
new MessageBuilder("COMMANDS_THEME_BLACKLISTED").asKey().prefix().send(sender);
|
||||
return;
|
||||
}
|
||||
BaseArena finalArena1 = arena;
|
||||
Bukkit.getOnlinePlayers().forEach(player -> {
|
||||
registry.getPlugin().getArenaManager().joinAttempt(player, finalArena1);
|
||||
});
|
||||
arena.setForceStart(true);
|
||||
arena.setTheme(themeName.toString());
|
||||
new MessageBuilder("IN_GAME_MESSAGES_ADMIN_CHANGED_THEME").asKey().prefix().value(themeName.toString()).arena(arena).sendArena();
|
||||
} else {
|
||||
new MessageBuilder("&cWrong state to force theme!").prefix().send(sender);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
+31
-13
@@ -25,11 +25,15 @@ import org.bukkit.entity.Player;
|
||||
import plugily.projects.buildbattle.arena.BaseArena;
|
||||
import plugily.projects.buildbattle.arena.BuildArena;
|
||||
import plugily.projects.buildbattle.commands.arguments.ArgumentsRegistry;
|
||||
import plugily.projects.minigamesbox.api.arena.IArenaState;
|
||||
import plugily.projects.minigamesbox.classic.commands.arguments.data.CommandArgument;
|
||||
import plugily.projects.minigamesbox.classic.commands.arguments.data.LabelData;
|
||||
import plugily.projects.minigamesbox.classic.commands.arguments.data.LabeledCommandArgument;
|
||||
import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder;
|
||||
|
||||
import java.io.Console;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* @author Plajer
|
||||
* <p>
|
||||
@@ -38,12 +42,29 @@ import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder;
|
||||
public class SetThemeArgument {
|
||||
|
||||
public SetThemeArgument(ArgumentsRegistry registry) {
|
||||
registry.mapArgument("buildbattleadmin", new LabeledCommandArgument("settheme", "buildbattle.admin.settheme", CommandArgument.ExecutorType.PLAYER,
|
||||
new LabelData("/bba settheme &6<theme>", "/bba settheme",
|
||||
registry.mapArgument("buildbattleadmin", new LabeledCommandArgument("settheme", "buildbattle.admin.settheme", CommandArgument.ExecutorType.BOTH,
|
||||
new LabelData("/bba settheme &6<theme>", "/bba settheme <theme> || Console /bba settheme <arena> <theme>",
|
||||
"&7Set new arena theme\n&6Permission: &7buildbattle.admin.settheme\n&6You can set arena theme only when it started\n&6and only for 20 seconds after start!")) {
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
BaseArena arena = (BaseArena) registry.getPlugin().getArenaRegistry().getArena((Player) sender);
|
||||
if(args.length == 1) {
|
||||
//todo translatable
|
||||
new MessageBuilder("&cPlease type arena theme!").prefix().send(sender);
|
||||
return;
|
||||
}
|
||||
BaseArena arena;
|
||||
int themeArgStart = 1;
|
||||
if(!(sender instanceof Player)) {
|
||||
if(args.length == 2) {
|
||||
//todo translatable
|
||||
new MessageBuilder("&cPlease type arena name!").prefix().send(sender);
|
||||
return;
|
||||
}
|
||||
arena = (BaseArena) registry.getPlugin().getArenaRegistry().getArena(args[1]);
|
||||
themeArgStart = 2;
|
||||
} else {
|
||||
arena = (BaseArena) registry.getPlugin().getArenaRegistry().getArena((Player) sender);
|
||||
}
|
||||
if(arena == null) {
|
||||
new MessageBuilder("COMMANDS_NOT_PLAYING").asKey().send(sender);
|
||||
return;
|
||||
@@ -53,20 +74,17 @@ public class SetThemeArgument {
|
||||
new MessageBuilder("&cCan't set theme on this arena type!").prefix().send(sender);
|
||||
return;
|
||||
}
|
||||
if(args.length == 1) {
|
||||
//todo translatable
|
||||
new MessageBuilder("&cPlease type arena theme!").prefix().send(sender);
|
||||
return;
|
||||
}
|
||||
if(arena.getArenaInGameState() == BaseArena.ArenaInGameState.THEME_VOTING) {
|
||||
String themeName = args[1];
|
||||
StringJoiner themeName = new StringJoiner(" ");
|
||||
|
||||
if(arena.getPlugin().getThemeManager().isThemeBlacklisted(themeName)) {
|
||||
for(int i = themeArgStart; i < args.length; i++)
|
||||
themeName.add(args[i]);
|
||||
if(arena.getArenaInGameState() == BaseArena.ArenaInGameState.BUILD_TIME || arena.getArenaState() == IArenaState.STARTING) {
|
||||
if(arena.getPlugin().getThemeManager().isThemeBlacklisted(themeName.toString())) {
|
||||
new MessageBuilder("COMMANDS_THEME_BLACKLISTED").asKey().prefix().send(sender);
|
||||
return;
|
||||
}
|
||||
arena.setTheme(themeName);
|
||||
new MessageBuilder("IN_GAME_MESSAGES_ADMIN_CHANGED_THEME").asKey().prefix().value(themeName).arena(arena).sendArena();
|
||||
arena.setTheme(themeName.toString());
|
||||
new MessageBuilder("IN_GAME_MESSAGES_ADMIN_CHANGED_THEME").asKey().prefix().value(themeName.toString()).arena(arena).sendArena();
|
||||
} else {
|
||||
new MessageBuilder("&cWrong state to force theme!").prefix().send(sender);
|
||||
}
|
||||
|
||||
+2
-2
@@ -24,7 +24,7 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import plugily.projects.buildbattle.arena.BaseArena;
|
||||
import plugily.projects.buildbattle.commands.arguments.ArgumentsRegistry;
|
||||
import plugily.projects.minigamesbox.classic.arena.ArenaState;
|
||||
import plugily.projects.minigamesbox.api.arena.IArenaState;
|
||||
import plugily.projects.minigamesbox.classic.commands.arguments.data.CommandArgument;
|
||||
|
||||
/**
|
||||
@@ -41,7 +41,7 @@ public class SelectPlotArgument {
|
||||
Player player = (Player) sender;
|
||||
BaseArena arena = (BaseArena) registry.getPlugin().getArenaRegistry().getArena(player);
|
||||
|
||||
if(arena != null && (arena.getArenaState() == ArenaState.WAITING_FOR_PLAYERS || arena.getArenaState() == ArenaState.STARTING))
|
||||
if(arena != null && (arena.getArenaState() == IArenaState.WAITING_FOR_PLAYERS || arena.getArenaState() == IArenaState.STARTING || arena.getArenaState() == IArenaState.FULL_GAME))
|
||||
arena.getPlugin().getPlotMenuHandler().createMenu(player, arena);
|
||||
}
|
||||
});
|
||||
|
||||
+8
-3
@@ -25,7 +25,7 @@ import org.bukkit.entity.Player;
|
||||
import plugily.projects.buildbattle.arena.BaseArena;
|
||||
import plugily.projects.buildbattle.arena.GuessArena;
|
||||
import plugily.projects.buildbattle.commands.arguments.ArgumentsRegistry;
|
||||
import plugily.projects.minigamesbox.classic.arena.ArenaState;
|
||||
import plugily.projects.minigamesbox.api.arena.IArenaState;
|
||||
import plugily.projects.minigamesbox.classic.commands.arguments.data.CommandArgument;
|
||||
import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder;
|
||||
|
||||
@@ -50,13 +50,18 @@ public class GuessArgument {
|
||||
Player player = (Player) sender;
|
||||
BaseArena arena = (BaseArena) registry.getPlugin().getArenaRegistry().getArena(player);
|
||||
|
||||
if(!(arena instanceof GuessArena) || arena.getArenaState() != ArenaState.IN_GAME) {
|
||||
if(!(arena instanceof GuessArena) || arena.getArenaState() != IArenaState.IN_GAME) {
|
||||
new MessageBuilder("COMMANDS_NOT_PLAYING").asKey().player(player).sendPlayer();
|
||||
return;
|
||||
}
|
||||
|
||||
GuessArena gameArena = (GuessArena) arena;
|
||||
|
||||
if(gameArena.getArenaInGameState() != BaseArena.ArenaInGameState.BUILD_TIME) {
|
||||
new MessageBuilder("COMMANDS_NOT_PLAYING").asKey().player(player).sendPlayer();
|
||||
return;
|
||||
}
|
||||
|
||||
if(gameArena.getWhoGuessed().contains(player)) {
|
||||
new MessageBuilder("IN_GAME_MESSAGES_PLOT_GTB_THEME_GUESS_CANT_TALK").asKey().arena(gameArena).player(player).sendPlayer();
|
||||
return;
|
||||
@@ -67,7 +72,7 @@ public class GuessArgument {
|
||||
return;
|
||||
}
|
||||
|
||||
if(gameArena.getCurrentBBTheme() == null || !gameArena.getCurrentBBTheme().getTheme().equalsIgnoreCase(Arrays.toString(args).split(" ", 2)[1].replace(",", "").replace("]", ""))) {
|
||||
if(gameArena.getCurrentBBTheme() == null || gameArena.getCurrentBBTheme().getThemes().stream().noneMatch(theme -> theme.equalsIgnoreCase(Arrays.toString(args).split(" ", 2)[1].replace(",", "").replace("]", "")))) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
*
|
||||
* BuildBattle - Ultimate building competition minigame
|
||||
* Copyright (C) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package plugily.projects.buildbattle.commands.arguments.game;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import plugily.projects.buildbattle.arena.BaseArena;
|
||||
import plugily.projects.buildbattle.commands.arguments.ArgumentsRegistry;
|
||||
import plugily.projects.minigamesbox.api.arena.IArenaState;
|
||||
import plugily.projects.minigamesbox.classic.commands.arguments.data.CommandArgument;
|
||||
|
||||
/**
|
||||
* @author Tigerpanzer_02
|
||||
* <p>
|
||||
* Created at 27.12.2020
|
||||
*/
|
||||
public class MenuArgument {
|
||||
|
||||
public MenuArgument(ArgumentsRegistry registry) {
|
||||
registry.mapArgument("buildbattle", new CommandArgument("menu", "", CommandArgument.ExecutorType.PLAYER) {
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
Player player = (Player) sender;
|
||||
BaseArena arena = (BaseArena) registry.getPlugin().getArenaRegistry().getArena(player);
|
||||
|
||||
if(arena != null && (arena.getArenaState() == IArenaState.IN_GAME))
|
||||
arena.getPlugin().getOptionsRegistry().getOptionsGui().open(player);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,271 @@
|
||||
/*
|
||||
* MiniGamesBox - Library box with massive content that could be seen as minigames core.
|
||||
* Copyright (C) 2023 Plugily Projects - maintained by Tigerpanzer_02 and contributors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
package plugily.projects.buildbattle.handlers;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import plugily.projects.buildbattle.Main;
|
||||
import plugily.projects.minigamesbox.classic.utils.configuration.ConfigUtils;
|
||||
import plugily.projects.minigamesbox.classic.utils.migrator.MigratorUtils;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/*
|
||||
NOTE FOR CONTRIBUTORS - Please do not touch this class if you don't know how it works! You can break migrator modifying these values!
|
||||
*/
|
||||
|
||||
/**
|
||||
* @author Tigerpanzer_02
|
||||
* <p>
|
||||
* Created at 07.2025
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public class LanguageMigrator {
|
||||
|
||||
public enum PluginFileVersion {
|
||||
/*ARENA_SELECTOR(0),*/ BUNGEE(1), CONFIG(1), LANGUAGE(2),
|
||||
/*LEADERBOARDS(0),*/ MYSQL(1), PERMISSIONS(1), POWERUPS(1),
|
||||
/*SIGNS(0),*/ SPECIAL_ITEMS(1), SPECTATOR(1)/*, STATS(0)*/,
|
||||
MAIN_MENU(1);
|
||||
|
||||
private final int version;
|
||||
|
||||
PluginFileVersion(int version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public int getVersion() {
|
||||
return version;
|
||||
}
|
||||
}
|
||||
|
||||
private final Main plugin;
|
||||
|
||||
public LanguageMigrator(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
updatePluginFiles();
|
||||
}
|
||||
|
||||
private void updatePluginFiles() {
|
||||
for(PluginFileVersion pluginFileVersion : PluginFileVersion.values()) {
|
||||
String fileName = pluginFileVersion.name().toLowerCase();
|
||||
if(fileName.equalsIgnoreCase(PluginFileVersion.MAIN_MENU.name())) {
|
||||
fileName = "heads/mainmenu";
|
||||
}
|
||||
int newVersion = pluginFileVersion.getVersion();
|
||||
File file = new File(plugin.getDataFolder() + "/" + fileName + ".yml");
|
||||
FileConfiguration configuration = ConfigUtils.getConfig(plugin, fileName, false);
|
||||
if(configuration == null) {
|
||||
continue;
|
||||
}
|
||||
int oldVersion = configuration.getInt("Do-Not-Edit.File-Version", 0);
|
||||
if(oldVersion == newVersion) {
|
||||
continue;
|
||||
}
|
||||
Bukkit.getLogger().info("[System notify] The " + fileName + " file is outdated! Updating...");
|
||||
for(int i = oldVersion; i < newVersion; i++) {
|
||||
executeUpdate(file, pluginFileVersion, i);
|
||||
}
|
||||
|
||||
updatePluginFileVersion(file, configuration, oldVersion, newVersion);
|
||||
Bukkit.getLogger().info("[System notify] " + fileName + " updated, no comments were removed :)");
|
||||
Bukkit.getLogger().info("[System notify] You're using latest " + fileName + " file now! Nice!");
|
||||
}
|
||||
}
|
||||
|
||||
private void executeUpdate(File file, PluginFileVersion pluginFileVersion, int version) {
|
||||
switch(pluginFileVersion) {
|
||||
case LANGUAGE:
|
||||
switch(version) {
|
||||
case 1:
|
||||
MigratorUtils.insertAfterLine(file, " Heads:", " Database:\n" +
|
||||
" Lore: \"Get Head %value%\"");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
case MAIN_MENU:
|
||||
switch(version) {
|
||||
case 0:
|
||||
MigratorUtils.addNewLines(file, "# Use HeadDatabase in addition to the configured ones\n" +
|
||||
"# You can remove categories from the catalog which shouldn't be loaded!\n" +
|
||||
"# Catalog:\n" +
|
||||
"# - alphabet\n" +
|
||||
"# - animals\n" +
|
||||
"# - blocks\n" +
|
||||
"# - decoration\n" +
|
||||
"# - food-drinks\n" +
|
||||
"# - humanoid\n" +
|
||||
"# - humans\n" +
|
||||
"# - miscellaneous\n" +
|
||||
"# - monsters\n" +
|
||||
"# - plants\n" +
|
||||
"database-alphabet:\n" +
|
||||
" displayname: '&6%value% heads'\n" +
|
||||
" texture: \"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzI1MDhlMmNhNjUwMGJjZTMwNTM5YzM4ODg0MmE1NjcyYjdiYzI5YTY4NzZkZDZhNTAyNTY3MmUyNTJkMjVkYSJ9fX0=\"\n" +
|
||||
" lore:\n" +
|
||||
" - \"Click to open\"\n" +
|
||||
" - \"%value% menu\"\n" +
|
||||
" enabled: true\n" +
|
||||
" database: true\n" +
|
||||
" config: alphabet\n" +
|
||||
" permission: buildbattle.heads\n" +
|
||||
" menuname: \"%value% blocks\"\n" +
|
||||
"database-animals:\n" +
|
||||
" displayname: '&6%value% heads'\n" +
|
||||
" texture: \"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTQyYjllYzM0OTYwNjRiMDg1ZjdkMzBjZTkwYTBjOGY3NjM2YzhlZjUzMDNiMjBjMjVjYTEwYTk5N2JkNzQzMyJ9fX0=\"\n" +
|
||||
" lore:\n" +
|
||||
" - \"Click to open\"\n" +
|
||||
" - \"%value% menu\"\n" +
|
||||
" enabled: true\n" +
|
||||
" database: true\n" +
|
||||
" config: animals\n" +
|
||||
" permission: buildbattle.heads\n" +
|
||||
" menuname: \"%value% blocks\"\n" +
|
||||
"database-blocks:\n" +
|
||||
" displayname: '&6%value% heads'\n" +
|
||||
" texture: \"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzViNDQ4ZmQ5NWM4NzRjOTVmZTc0ODQ0NDFhNDM5NGQ2NDZiNzJiYzgyYTUyNzQ4M2ZkYzcwY2E3OTg2ZmNhNSJ9fX0=\"\n" +
|
||||
" lore:\n" +
|
||||
" - \"Click to open\"\n" +
|
||||
" - \"%value% menu\"\n" +
|
||||
" enabled: true\n" +
|
||||
" database: true\n" +
|
||||
" config: blocks\n" +
|
||||
" permission: buildbattle.heads\n" +
|
||||
" menuname: \"%value% blocks\"\n" +
|
||||
"database-decoration:\n" +
|
||||
" displayname: '&6%value% heads'\n" +
|
||||
" texture: \"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMjNhZjk0YTUwZmFmNTBhZTAyMzZjNzExZWMxMzZiMjgwOGFjODJiYjE3MWQ0MmIzOGQxNjc2MGQyMjBmMjU4MiJ9fX0=\"\n" +
|
||||
" lore:\n" +
|
||||
" - \"Click to open\"\n" +
|
||||
" - \"%value% menu\"\n" +
|
||||
" enabled: true\n" +
|
||||
" database: true\n" +
|
||||
" config: decoration\n" +
|
||||
" permission: buildbattle.heads\n" +
|
||||
" menuname: \"%value% blocks\"\n" +
|
||||
"database-food-drinks:\n" +
|
||||
" displayname: '&6%value% heads'\n" +
|
||||
" texture: \"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZDUxMzdmYzBjZDUxMjAyNjcyMzgyYmZhZTAxZmViM2UxZTJiNzMxMDdlOThkMmM2YzhmNzE5ZjFkYTUzMGU2OCJ9fX0=\"\n" +
|
||||
" lore:\n" +
|
||||
" - \"Click to open\"\n" +
|
||||
" - \"%value% menu\"\n" +
|
||||
" enabled: true\n" +
|
||||
" database: true\n" +
|
||||
" config: food-drinks\n" +
|
||||
" permission: buildbattle.heads\n" +
|
||||
" menuname: \"%value% blocks\"\n" +
|
||||
"database-humanoid:\n" +
|
||||
" displayname: '&6%value% heads'\n" +
|
||||
" texture: \"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTc5Yzc3ZjEyYzg2NzM5OGE0MTgxMDgxZmI1YmY3MGM1ZmYzMjcxNWM2ODk3NTBjNmU3MTdkMDY5ZTgxMzFhOSJ9fX0=\"\n" +
|
||||
" lore:\n" +
|
||||
" - \"Click to open\"\n" +
|
||||
" - \"%value% menu\"\n" +
|
||||
" enabled: true\n" +
|
||||
" database: true\n" +
|
||||
" config: humanoid\n" +
|
||||
" permission: buildbattle.heads\n" +
|
||||
" menuname: \"%value% blocks\"\n" +
|
||||
"database-humans:\n" +
|
||||
" displayname: '&6%value% heads'\n" +
|
||||
" texture: \"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNDQ5MmRmZTNjZThjYjYxYjkwODYwZWZmOTM4Y2I4M2UxOWMxNmU5Y2IyZDliZjJhZDc4OTZjOTBmNWIyZTFmMCJ9fX0=\"\n" +
|
||||
" lore:\n" +
|
||||
" - \"Click to open\"\n" +
|
||||
" - \"%value% menu\"\n" +
|
||||
" enabled: true\n" +
|
||||
" database: true\n" +
|
||||
" config: humans\n" +
|
||||
" permission: buildbattle.heads\n" +
|
||||
" menuname: \"%value% blocks\"\n" +
|
||||
"database-miscellaneous:\n" +
|
||||
" displayname: '&6%value% heads'\n" +
|
||||
" texture: \"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNDQ3OTE3MTkzZTlmYjdjYjk2OGZiYTAzYTJlMjg0YTA0NjEyMWIyZGMwMTU0MWNhY2RiYTUzYTRmOWJiZjcwOCJ9fX0=\"\n" +
|
||||
" lore:\n" +
|
||||
" - \"Click to open\"\n" +
|
||||
" - \"%value% menu\"\n" +
|
||||
" enabled: true\n" +
|
||||
" database: true\n" +
|
||||
" config: miscellaneous\n" +
|
||||
" permission: buildbattle.heads\n" +
|
||||
" menuname: \"%value% blocks\"\n" +
|
||||
"database-monsters:\n" +
|
||||
" displayname: '&6%value% heads'\n" +
|
||||
" texture: \"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZTgyYjQxZjY3YjMzNzE0NWM1ZWI4M2I5ZTAwMTU1NzQ4MDE2MGE1NWU5MWVmODYzZWIwYmYwNTU3Mzg0MmNlMSJ9fX0=\"\n" +
|
||||
" lore:\n" +
|
||||
" - \"Click to open\"\n" +
|
||||
" - \"%value% menu\"\n" +
|
||||
" enabled: true\n" +
|
||||
" database: true\n" +
|
||||
" config: monsters\n" +
|
||||
" permission: buildbattle.heads\n" +
|
||||
" menuname: \"%value% blocks\"\n" +
|
||||
"database-plants:\n" +
|
||||
" displayname: '&6%value% heads'\n" +
|
||||
" texture: \"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNDA4MzY2YjgxMWM0MzU5YWVhNjY4NjMwMGNmZDQ1MGQ5ZWFhNDYxNGMzYWYwOGExN2YxNTEzZjVkMmY0OGM0YSJ9fX0=\"\n" +
|
||||
" lore:\n" +
|
||||
" - \"Click to open\"\n" +
|
||||
" - \"%value% menu\"\n" +
|
||||
" enabled: true\n" +
|
||||
" database: true\n" +
|
||||
" config: plants\n" +
|
||||
" permission: buildbattle.heads\n" +
|
||||
" menuname: \"%value% blocks\"\n" +
|
||||
"database-search:\n" +
|
||||
" displayname: '&6%value% heads'\n" +
|
||||
" texture: \"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNjViOTVkYTEyODE2NDJkYWE1ZDAyMmFkYmQzZTdjYjY5ZGMwOTQyYzgxY2Q2M2JlOWMzODU3ZDIyMmUxYzhkOSJ9fX0=\"\n" +
|
||||
" lore:\n" +
|
||||
" - \"Click to open\"\n" +
|
||||
" - \"%value% menu\"\n" +
|
||||
" enabled: true\n" +
|
||||
" database: true\n" +
|
||||
" config: search\n" +
|
||||
" permission: buildbattle.heads\n" +
|
||||
" menuname: \"%value% blocks\"");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void updatePluginFileVersion(File file, FileConfiguration fileConfiguration, int oldVersion, int newVersion) {
|
||||
int coreVersion = fileConfiguration.getInt("Do-Not-Edit.Core-Version", 0);
|
||||
updateFileVersion(file, coreVersion, coreVersion, newVersion, oldVersion);
|
||||
}
|
||||
|
||||
private void updateFileVersion(File file, int coreVersion, int oldCoreVersion, int fileVersion, int oldFileVersion) {
|
||||
MigratorUtils.removeLineFromFile(file, "# Don't edit it. But who's stopping you? It's your server!");
|
||||
MigratorUtils.removeLineFromFile(file, "# Really, don't edit ;p");
|
||||
MigratorUtils.removeLineFromFile(file, "# You edited it, huh? Next time hurt yourself!");
|
||||
MigratorUtils.removeLineFromFile(file, "Do-Not-Edit:");
|
||||
MigratorUtils.removeLineFromFile(file, " File-Version: " + oldFileVersion + "");
|
||||
MigratorUtils.removeLineFromFile(file, " Core-Version: " + oldCoreVersion + "");
|
||||
MigratorUtils.addNewLines(file, "# Don't edit it. But who's stopping you? It's your server!\r\n" +
|
||||
"# Really, don't edit ;p\r\n" +
|
||||
"# You edited it, huh? Next time hurt yourself!\r\n" +
|
||||
"Do-Not-Edit:\r\n" +
|
||||
" File-Version: " + fileVersion + "\r\n" +
|
||||
" Core-Version: " + coreVersion + "\r\n");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -39,6 +39,7 @@ import plugily.projects.minigamesbox.classic.utils.version.xseries.XMaterial;
|
||||
import plugily.projects.minigamesbox.inventory.common.item.ItemMap;
|
||||
import plugily.projects.minigamesbox.inventory.common.item.SimpleClickableItem;
|
||||
import plugily.projects.minigamesbox.inventory.normal.NormalFastInv;
|
||||
import plugily.projects.minigamesbox.inventory.utils.fastinv.PaginatedFastInv;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
@@ -50,147 +51,156 @@ import java.util.Set;
|
||||
*/
|
||||
public class OptionsRegistry {
|
||||
|
||||
private ParticleRegistry particleRegistry;
|
||||
private BiomesRegistry biomesRegistry;
|
||||
private PlayerHeadsRegistry playerHeadsRegistry;
|
||||
private final Set<MenuOption> registeredOptions = new HashSet<>();
|
||||
private int inventorySize = 5 * 9;
|
||||
private final ItemStack menuItem;
|
||||
private final Main plugin;
|
||||
private ParticleRegistry particleRegistry;
|
||||
private BiomesRegistry biomesRegistry;
|
||||
private PlayerHeadsRegistry playerHeadsRegistry;
|
||||
private final Set<MenuOption> registeredOptions = new HashSet<>();
|
||||
private int inventorySize = 5 * 9;
|
||||
private final ItemStack menuItem;
|
||||
private final Main plugin;
|
||||
|
||||
private NormalFastInv optionsGui;
|
||||
private NormalFastInv optionsGui;
|
||||
|
||||
public OptionsRegistry(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
this.menuItem = plugin.getSpecialItemManager().getSpecialItemStack("OPTIONS_MENU");
|
||||
public OptionsRegistry(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
this.menuItem = plugin.getSpecialItemManager().getSpecialItemStack("OPTIONS_MENU");
|
||||
}
|
||||
|
||||
public void registerOptions() {
|
||||
biomesRegistry = new BiomesRegistry(this);
|
||||
new BiomeChangeOption(this);
|
||||
|
||||
new FloorChangeOption(this);
|
||||
|
||||
//register particles
|
||||
particleRegistry = new ParticleRegistry(this);
|
||||
new ParticlesOption(this);
|
||||
|
||||
//register player heads
|
||||
playerHeadsRegistry = new PlayerHeadsRegistry(this);
|
||||
new PlayerHeadsOption(this);
|
||||
|
||||
new PlotResetOption(this);
|
||||
new TimeChangeOption(this);
|
||||
new WeatherChangeOption(this);
|
||||
new BannerCreatorOption(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers new menu option available in options menu in game.
|
||||
*
|
||||
* @param option option to register
|
||||
* @throws IllegalArgumentException if option slot is same as one of already registered ones
|
||||
* or ID of option is same as one of registered one
|
||||
*/
|
||||
public void registerOption(MenuOption option) {
|
||||
for(MenuOption opt : registeredOptions) {
|
||||
if(opt.getSlot() == option.getSlot()) {
|
||||
throw new IllegalArgumentException("Cannot register new option on existing option slot!");
|
||||
}
|
||||
if(opt.getID().equals(option.getID())) {
|
||||
throw new IllegalArgumentException("Cannot register new option with equal identifier!");
|
||||
}
|
||||
}
|
||||
registeredOptions.add(option);
|
||||
}
|
||||
|
||||
public void registerOptions() {
|
||||
biomesRegistry = new BiomesRegistry(this);
|
||||
new BiomeChangeOption(this);
|
||||
|
||||
new FloorChangeOption(this);
|
||||
|
||||
//register particles
|
||||
particleRegistry = new ParticleRegistry(this);
|
||||
new ParticlesOption(this);
|
||||
|
||||
//register player heads
|
||||
playerHeadsRegistry = new PlayerHeadsRegistry(this);
|
||||
new PlayerHeadsOption(this);
|
||||
|
||||
new PlotResetOption(this);
|
||||
new TimeChangeOption(this);
|
||||
new WeatherChangeOption(this);
|
||||
new BannerCreatorOption(this);
|
||||
/**
|
||||
* Unregisters menu option that available in options menu
|
||||
*
|
||||
* @param option option to unregister
|
||||
* @throws IllegalArgumentException if option doesn't exist
|
||||
*/
|
||||
public void unregisterOption(MenuOption option) {
|
||||
if(!registeredOptions.remove(option)) {
|
||||
throw new IllegalArgumentException("Cannot remove non existing option!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers new menu option available in options menu in game.
|
||||
*
|
||||
* @param option option to register
|
||||
* @throws IllegalArgumentException if option slot is same as one of already registered ones
|
||||
* or ID of option is same as one of registered one
|
||||
*/
|
||||
public void registerOption(MenuOption option) {
|
||||
for (MenuOption opt : registeredOptions) {
|
||||
if (opt.getSlot() == option.getSlot()) {
|
||||
throw new IllegalArgumentException("Cannot register new option on existing option slot!");
|
||||
}
|
||||
if (opt.getID().equals(option.getID())) {
|
||||
throw new IllegalArgumentException("Cannot register new option with equal identifier!");
|
||||
}
|
||||
}
|
||||
registeredOptions.add(option);
|
||||
/**
|
||||
* Defines new size of options inventory
|
||||
*
|
||||
* @param size size to set
|
||||
*/
|
||||
public void defineInventorySize(int size) {
|
||||
inventorySize = size;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates inventory with all of registered menu options
|
||||
*
|
||||
* @return options inventory
|
||||
*/
|
||||
public NormalFastInv getOptionsGui() {
|
||||
if(optionsGui != null)
|
||||
return optionsGui;
|
||||
NormalFastInv gui = new NormalFastInv(inventorySize, new MessageBuilder("MENU_OPTION_INVENTORY").asKey().build());
|
||||
gui.addClickHandler(clickEvent -> {
|
||||
if(clickEvent.getClickedInventory() != gui.getInventory()) {
|
||||
clickEvent.setCancelled(false);
|
||||
}
|
||||
});
|
||||
for(MenuOption option : registeredOptions) {
|
||||
gui.setItem(option.getSlot(), new SimpleClickableItem(option.getItemStack(), option::onClick));
|
||||
}
|
||||
return optionsGui = gui;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregisters menu option that available in options menu
|
||||
*
|
||||
* @param option option to unregister
|
||||
* @throws IllegalArgumentException if option doesn't exist
|
||||
*/
|
||||
public void unregisterOption(MenuOption option) {
|
||||
if (!registeredOptions.remove(option)) {
|
||||
throw new IllegalArgumentException("Cannot remove non existing option!");
|
||||
}
|
||||
public Set<MenuOption> getRegisteredOptions() {
|
||||
return registeredOptions;
|
||||
}
|
||||
|
||||
public ItemStack getMenuItem() {
|
||||
return menuItem;
|
||||
}
|
||||
|
||||
public BiomesRegistry getBiomesRegistry() {
|
||||
return biomesRegistry;
|
||||
}
|
||||
|
||||
public PlayerHeadsRegistry getPlayerHeadsRegistry() {
|
||||
return playerHeadsRegistry;
|
||||
}
|
||||
|
||||
public ParticleRegistry getParticleRegistry() {
|
||||
return particleRegistry;
|
||||
}
|
||||
|
||||
public Main getPlugin() {
|
||||
return plugin;
|
||||
}
|
||||
|
||||
private ItemBuilder backButton;
|
||||
|
||||
private SimpleClickableItem getBackItem() {
|
||||
if(backButton == null) {
|
||||
backButton = new ItemBuilder(XMaterial.STONE_BUTTON.parseItem())
|
||||
.name(new MessageBuilder("MENU_BUTTONS_BACK_ITEM_NAME").asKey().build())
|
||||
.lore(new MessageBuilder("MENU_BUTTONS_BACK_ITEM_LORE").asKey().build());
|
||||
}
|
||||
return new SimpleClickableItem(backButton.build(), event -> {
|
||||
event.setCancelled(true);
|
||||
event.getWhoClicked().closeInventory();
|
||||
getOptionsGui().open(event.getWhoClicked());
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines new size of options inventory
|
||||
*
|
||||
* @param size size to set
|
||||
*/
|
||||
public void defineInventorySize(int size) {
|
||||
inventorySize = size;
|
||||
}
|
||||
public void addGoBackItem(ItemMap page, int slot) {
|
||||
page.setItem(slot, getBackItem());
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates inventory with all of registered menu options
|
||||
*
|
||||
* @return options inventory
|
||||
*/
|
||||
public NormalFastInv getOptionsGui() {
|
||||
if (optionsGui != null)
|
||||
return optionsGui;
|
||||
NormalFastInv gui = new NormalFastInv(inventorySize, new MessageBuilder("MENU_OPTION_INVENTORY").asKey().build());
|
||||
gui.addClickHandler(clickEvent -> {
|
||||
if (clickEvent.getClickedInventory() != gui.getInventory()) {
|
||||
clickEvent.setCancelled(false);
|
||||
}
|
||||
});
|
||||
for (MenuOption option : registeredOptions) {
|
||||
gui.setItem(option.getSlot(), new SimpleClickableItem(option.getItemStack(), option::onClick));
|
||||
}
|
||||
return optionsGui = gui;
|
||||
}
|
||||
|
||||
public Set<MenuOption> getRegisteredOptions() {
|
||||
return registeredOptions;
|
||||
}
|
||||
|
||||
public ItemStack getMenuItem() {
|
||||
return menuItem;
|
||||
}
|
||||
|
||||
public BiomesRegistry getBiomesRegistry() {
|
||||
return biomesRegistry;
|
||||
}
|
||||
|
||||
public PlayerHeadsRegistry getPlayerHeadsRegistry() {
|
||||
return playerHeadsRegistry;
|
||||
}
|
||||
|
||||
public ParticleRegistry getParticleRegistry() {
|
||||
return particleRegistry;
|
||||
}
|
||||
|
||||
public Main getPlugin() {
|
||||
return plugin;
|
||||
}
|
||||
|
||||
private ItemBuilder backButton;
|
||||
|
||||
private SimpleClickableItem getBackItem() {
|
||||
if (backButton == null) {
|
||||
backButton = new ItemBuilder(XMaterial.STONE_BUTTON.parseItem())
|
||||
.name(new MessageBuilder("MENU_BUTTONS_BACK_ITEM_NAME").asKey().build())
|
||||
.lore(new MessageBuilder("MENU_BUTTONS_BACK_ITEM_LORE").asKey().build());
|
||||
}
|
||||
return new SimpleClickableItem(backButton.build(), event -> {
|
||||
event.setCancelled(true);
|
||||
event.getWhoClicked().closeInventory();
|
||||
getOptionsGui().open(event.getWhoClicked());
|
||||
});
|
||||
}
|
||||
|
||||
public void addGoBackItem(ItemMap page, int slot) {
|
||||
page.setItem(slot, getBackItem());
|
||||
}
|
||||
|
||||
public void addGoBackItem(NormalFastInv gui, int slot) {
|
||||
gui.setItem(slot, getBackItem());
|
||||
}
|
||||
public void addGoBackItem(NormalFastInv gui, int slot) {
|
||||
gui.setItem(slot, getBackItem());
|
||||
}
|
||||
|
||||
public void addGoBackItem(PaginatedFastInv gui, int slot) {
|
||||
gui.setItem(slot, new ItemBuilder(XMaterial.STONE_BUTTON.parseItem())
|
||||
.name(new MessageBuilder("MENU_BUTTONS_BACK_ITEM_NAME").asKey().build())
|
||||
.lore(new MessageBuilder("MENU_BUTTONS_BACK_ITEM_LORE").asKey().build()).build(), event -> {
|
||||
event.setCancelled(true);
|
||||
event.getWhoClicked().closeInventory();
|
||||
getOptionsGui().open(event.getWhoClicked());
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
+5
-2
@@ -33,6 +33,8 @@ import plugily.projects.buildbattle.handlers.menu.MenuOption;
|
||||
import plugily.projects.buildbattle.handlers.menu.OptionsRegistry;
|
||||
import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder;
|
||||
import plugily.projects.minigamesbox.classic.utils.helper.ItemBuilder;
|
||||
import plugily.projects.minigamesbox.classic.utils.version.ServerVersion;
|
||||
import plugily.projects.minigamesbox.classic.utils.version.xseries.XEntityType;
|
||||
import plugily.projects.minigamesbox.classic.utils.version.xseries.XMaterial;
|
||||
|
||||
/**
|
||||
@@ -88,8 +90,9 @@ public class FloorChangeOption {
|
||||
event.getCurrentItem().setType(Material.AIR);
|
||||
player.closeInventory();
|
||||
|
||||
player.getNearbyEntities(5, 5, 5).stream().filter(entity -> entity.getType() == EntityType.DROPPED_ITEM)
|
||||
.forEach(Entity::remove);
|
||||
player.getNearbyEntities(5, 5, 5).stream().filter(entity -> entity.getType() == XEntityType.ITEM.get())
|
||||
.forEach(Entity::remove);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
+3
-2
@@ -67,8 +67,9 @@ public class TimeChangeOption {
|
||||
return;
|
||||
}
|
||||
|
||||
gui.addItem(new ItemBuilder(XMaterial.CLOCK.parseItem()).name(new MessageBuilder("MENU_OPTION_CONTENT_TIME_TYPE_WORLD").asKey().build()).lore(plot.getTime().name()).build());
|
||||
//gui.addItem(new ItemBuilder(XMaterial.CLOCK.parseItem()).name(new MessageBuilder("MENU_OPTION_CONTENT_TIME_TYPE_WORLD").asKey().build()).lore(plot.getTime().name()).build());
|
||||
|
||||
addClockItem(gui, plot, "MENU_OPTION_CONTENT_TIME_TYPE_WORLD");
|
||||
addClockItem(gui, plot, "MENU_OPTION_CONTENT_TIME_TYPE_DAY");
|
||||
addClockItem(gui, plot, "MENU_OPTION_CONTENT_TIME_TYPE_NOON");
|
||||
addClockItem(gui, plot, "MENU_OPTION_CONTENT_TIME_TYPE_SUNSET");
|
||||
@@ -86,7 +87,7 @@ public class TimeChangeOption {
|
||||
|
||||
for(Player p : plot.getMembers()) {
|
||||
p.setPlayerTime(Plot.Time.format(time, p.getWorld().getTime()), false);
|
||||
new MessageBuilder("MENU_OPTION_CONTENT_TIME_CHANGED").asKey().player(p).value(time.name()).sendPlayer();
|
||||
new MessageBuilder("MENU_OPTION_CONTENT_TIME_CHANGED").asKey().player(p).value(new MessageBuilder(messageKey).asKey().build()).sendPlayer();
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
+10
-2
@@ -21,10 +21,12 @@
|
||||
package plugily.projects.buildbattle.handlers.menu.registry.banner;
|
||||
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.block.banner.Pattern;
|
||||
import org.bukkit.block.banner.PatternType;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.BannerMeta;
|
||||
import org.bukkit.inventory.meta.BlockStateMeta;
|
||||
import plugily.projects.minigamesbox.classic.utils.version.ServerVersion;
|
||||
import plugily.projects.minigamesbox.classic.utils.version.xseries.XMaterial;
|
||||
|
||||
@@ -66,8 +68,14 @@ public class Banner {
|
||||
ItemStack item = XMaterial.WHITE_BANNER.parseItem();
|
||||
BannerMeta meta = (BannerMeta) item.getItemMeta();
|
||||
|
||||
if(ServerVersion.Version.isCurrentEqualOrLower(ServerVersion.Version.v1_12_R1)) {
|
||||
meta.setBaseColor(color);
|
||||
if(ServerVersion.Version.isCurrentEqualOrLower(ServerVersion.Version.v1_12)) {
|
||||
BlockStateMeta bsm = (BlockStateMeta) meta;
|
||||
BlockState state = ((BlockStateMeta) meta).getBlockState();
|
||||
if (state instanceof org.bukkit.block.Banner) {
|
||||
((org.bukkit.block.Banner) state).setBaseColor(color);
|
||||
state.update(true);
|
||||
}
|
||||
bsm.setBlockState(state);
|
||||
}
|
||||
|
||||
for(BannerPattern pattern : patterns) {
|
||||
|
||||
+14
-5
@@ -21,17 +21,20 @@
|
||||
package plugily.projects.buildbattle.handlers.menu.registry.banner;
|
||||
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.block.banner.Pattern;
|
||||
import org.bukkit.block.banner.PatternType;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.BannerMeta;
|
||||
import org.bukkit.inventory.meta.BlockStateMeta;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import plugily.projects.buildbattle.Main;
|
||||
import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder;
|
||||
import plugily.projects.minigamesbox.classic.utils.helper.ItemBuilder;
|
||||
import plugily.projects.minigamesbox.classic.utils.version.ServerVersion;
|
||||
import plugily.projects.minigamesbox.classic.utils.version.xseries.XMaterial;
|
||||
import plugily.projects.minigamesbox.classic.utils.version.xseries.XPatternType;
|
||||
import plugily.projects.minigamesbox.inventory.common.item.SimpleClickableItem;
|
||||
import plugily.projects.minigamesbox.inventory.normal.NormalFastInv;
|
||||
|
||||
@@ -69,11 +72,17 @@ public class BannerMenu {
|
||||
for(DyeColor color : DyeColor.values()) {
|
||||
ItemStack item;
|
||||
|
||||
if(ServerVersion.Version.isCurrentEqualOrLower(ServerVersion.Version.v1_12_R1)) {
|
||||
if(ServerVersion.Version.isCurrentEqualOrLower(ServerVersion.Version.v1_12)) {
|
||||
item = XMaterial.WHITE_BANNER.parseItem();
|
||||
BannerMeta meta = (BannerMeta) item.getItemMeta();
|
||||
|
||||
meta.setBaseColor(color);
|
||||
BlockStateMeta bsm = (BlockStateMeta) meta;
|
||||
BlockState state = ((BlockStateMeta) meta).getBlockState();
|
||||
if (state instanceof org.bukkit.block.Banner) {
|
||||
((org.bukkit.block.Banner) state).setBaseColor(color);
|
||||
state.update(true);
|
||||
}
|
||||
bsm.setBlockState(state);
|
||||
item.setItemMeta(meta);
|
||||
} else {
|
||||
item = XMaterial.matchXMaterial(color.toString() + "_BANNER").orElse(XMaterial.WHITE_BANNER).parseItem();
|
||||
@@ -96,17 +105,17 @@ public class BannerMenu {
|
||||
private void prepareLayerStageGui() {
|
||||
NormalFastInv gui = new NormalFastInv(54, new MessageBuilder("MENU_OPTION_CONTENT_BANNER_INVENTORY_LAYER").asKey().build());
|
||||
|
||||
for(PatternType pattern : PatternType.values()) {
|
||||
for(XPatternType pattern : XPatternType.getValues()) {
|
||||
ItemStack item = banner.buildBanner();
|
||||
BannerMeta meta = (BannerMeta) item.getItemMeta();
|
||||
DyeColor color = banner.getColor() == DyeColor.BLACK ? DyeColor.WHITE : DyeColor.BLACK;
|
||||
|
||||
meta.addPattern(new Pattern(color, pattern));
|
||||
meta.addPattern(new Pattern(color, pattern.get()));
|
||||
item.setItemMeta(meta);
|
||||
|
||||
gui.addItem(new SimpleClickableItem(item, event -> {
|
||||
event.setCancelled(true);
|
||||
banner.addPattern(new BannerPattern(color, pattern));
|
||||
banner.addPattern(new BannerPattern(color, pattern.get()));
|
||||
new BannerMenu(player, banner).openInventory(PatternStage.LAYER_COLOR);
|
||||
}));
|
||||
}
|
||||
|
||||
+1
-1
@@ -88,7 +88,7 @@ public class BiomeChangeOption {
|
||||
}
|
||||
|
||||
for(Chunk chunk : plot.getCuboid().chunkList()) {
|
||||
if(ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_15_R1)) {
|
||||
if(ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_15)) {
|
||||
chunk.getWorld().refreshChunk(chunk.getX(), chunk.getZ());
|
||||
continue;
|
||||
}
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ public class BiomesRegistry {
|
||||
.getString(biome + ".material-name", "bedrock").toUpperCase()).orElse(XMaterial.BEDROCK).parseItem())
|
||||
.name(new MessageBuilder(config.getString(biome + ".displayname")).build())
|
||||
.lore(lore)
|
||||
.build(), config.getString(biome + ".permission"), XBiome.matchXBiome(biome).orElse(XBiome.BADLANDS));
|
||||
.build(), config.getString(biome + ".permission"), XBiome.of(biome).orElse(XBiome.BADLANDS));
|
||||
biomes.add(biomeItem);
|
||||
i++;
|
||||
}
|
||||
|
||||
+2
-1
@@ -25,6 +25,7 @@ import org.bukkit.Location;
|
||||
import org.bukkit.scheduler.BukkitTask;
|
||||
import plugily.projects.buildbattle.arena.BaseArena;
|
||||
import plugily.projects.buildbattle.arena.managers.plots.Plot;
|
||||
import plugily.projects.minigamesbox.api.arena.IPluginArena;
|
||||
import plugily.projects.minigamesbox.classic.PluginMain;
|
||||
import plugily.projects.minigamesbox.classic.arena.PluginArena;
|
||||
import plugily.projects.minigamesbox.classic.utils.version.VersionUtils;
|
||||
@@ -55,7 +56,7 @@ public class ParticleRefreshScheduler {
|
||||
final int particleAmount = amountParticle;
|
||||
|
||||
task = Bukkit.getScheduler().runTaskTimer(plugin, () -> {
|
||||
for(PluginArena arena : plugin.getArenaRegistry().getArenas()) {
|
||||
for(IPluginArena arena : plugin.getArenaRegistry().getArenas()) {
|
||||
if(arena instanceof BaseArena && !arena.getPlayers().isEmpty()) {
|
||||
for(Plot buildPlot : ((BaseArena) arena).getPlotManager().getPlots()) {
|
||||
if(!buildPlot.getMembers().isEmpty()) {
|
||||
|
||||
+31
-46
@@ -35,9 +35,8 @@ import plugily.projects.minigamesbox.classic.utils.configuration.ConfigUtils;
|
||||
import plugily.projects.minigamesbox.classic.utils.helper.ItemBuilder;
|
||||
import plugily.projects.minigamesbox.classic.utils.version.VersionUtils;
|
||||
import plugily.projects.minigamesbox.classic.utils.version.xseries.XMaterial;
|
||||
import plugily.projects.minigamesbox.inventory.common.item.ItemMap;
|
||||
import plugily.projects.minigamesbox.inventory.common.item.SimpleClickableItem;
|
||||
import plugily.projects.minigamesbox.inventory.paged.PagedFastInv;
|
||||
import plugily.projects.minigamesbox.inventory.utils.fastinv.InventoryScheme;
|
||||
import plugily.projects.minigamesbox.inventory.utils.fastinv.PaginatedFastInv;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@@ -49,7 +48,7 @@ import java.util.*;
|
||||
*/
|
||||
public class ParticleRegistry {
|
||||
|
||||
private PagedFastInv particles;
|
||||
private PaginatedFastInv particles;
|
||||
private final List<String> blackListedParticles = Arrays.asList("BLOCK_CRACK", "ITEM_CRACK", "ITEM_TAKE", "BLOCK_DUST", "MOB_APPEARANCE", "FOOTSTEP", "REDSTONE");
|
||||
private final Set<ParticleItem> registeredParticles = new HashSet<>();
|
||||
private final Main plugin;
|
||||
@@ -114,46 +113,23 @@ public class ParticleRegistry {
|
||||
}
|
||||
|
||||
private void registerInventory() {
|
||||
int i = 0;
|
||||
Set<ParticleItem> particleItemsPage1 = new HashSet<>(registeredParticles.size());
|
||||
Set<ParticleItem> particleItemsPage2 = new HashSet<>();
|
||||
PaginatedFastInv gui = new PaginatedFastInv(54, new MessageBuilder("MENU_OPTION_CONTENT_PARTICLE_INVENTORY").asKey().build());
|
||||
|
||||
for(ParticleItem item : registeredParticles) {
|
||||
(i >= 45 ? particleItemsPage2 : particleItemsPage1).add(item);
|
||||
i++;
|
||||
}
|
||||
new InventoryScheme()
|
||||
.mask(" 1111111 ")
|
||||
.mask(" 1111111 ")
|
||||
.mask(" 1111111 ")
|
||||
.mask(" 1111111 ")
|
||||
.bindPagination('1').apply(gui);
|
||||
|
||||
PagedFastInv gui = new PagedFastInv(54, new MessageBuilder("MENU_OPTION_CONTENT_PARTICLE_INVENTORY").asKey().build());
|
||||
|
||||
gui.setForceRefresh(true);
|
||||
gui.previousPageItem(45, p -> new ItemBuilder(XMaterial.ARROW.parseItem()).name("<- " + p + "/" + gui.lastPage()).build());
|
||||
gui.nextPageItem(53, p -> new ItemBuilder(XMaterial.ARROW.parseItem()).name(p + "/" + gui.lastPage() + " ->").build());
|
||||
|
||||
ItemMap page1 = gui.createNewPage();
|
||||
ItemMap page2 = gui.createNewPage();
|
||||
gui.setItem(52, new ItemBuilder(XMaterial.BARRIER.parseItem()).name("X").build(),
|
||||
e -> e.getWhoClicked().closeInventory());
|
||||
|
||||
page2.setItem(45, new SimpleClickableItem(new ItemBuilder(new ItemStack(XMaterial.ARROW.parseMaterial())).name("<-").build(), event -> {
|
||||
gui.setCurrentPage(0);
|
||||
gui.refresh();
|
||||
}));
|
||||
page1.setItem(53, new SimpleClickableItem(new ItemBuilder(new ItemStack(XMaterial.ARROW.parseMaterial())).name("->").build(), event -> {
|
||||
gui.setCurrentPage(1);
|
||||
gui.refresh();
|
||||
}));
|
||||
|
||||
addParticles(page1, particleItemsPage1);
|
||||
addParticles(page2, particleItemsPage2);
|
||||
|
||||
addRemoveItem(page1);
|
||||
addRemoveItem(page2);
|
||||
setParticles(gui);
|
||||
|
||||
plugin.getOptionsRegistry().addGoBackItem(page1, 46);
|
||||
plugin.getOptionsRegistry().addGoBackItem(page2, 46);
|
||||
|
||||
gui.refresh();
|
||||
}
|
||||
|
||||
private void addRemoveItem(ItemMap itemMap) {
|
||||
itemMap.setItem(49, new SimpleClickableItem(new ItemBuilder(new ItemStack(Material.REDSTONE_BLOCK))
|
||||
gui.setItem(49, new ItemBuilder(new ItemStack(Material.REDSTONE_BLOCK))
|
||||
.name(new MessageBuilder("MENU_OPTION_CONTENT_PARTICLE_ITEM_REMOVE_NAME").asKey().build())
|
||||
.lore(Collections.singletonList(new MessageBuilder("MENU_OPTION_CONTENT_PARTICLE_ITEM_REMOVE_LORE").asKey().build()))
|
||||
.build(), event -> {
|
||||
@@ -170,12 +146,18 @@ public class ParticleRegistry {
|
||||
event.setCancelled(false);
|
||||
player.closeInventory();
|
||||
ParticleRemoveMenu.openMenu(player, arena.getPlotManager().getPlot(player));
|
||||
}));
|
||||
});
|
||||
|
||||
plugin.getOptionsRegistry().addGoBackItem(gui, 46);
|
||||
|
||||
addParticles(gui);
|
||||
|
||||
setParticles(gui);
|
||||
}
|
||||
|
||||
private void addParticles(ItemMap itemMap, Set<ParticleItem> particleItems) {
|
||||
for(ParticleItem item : particleItems) {
|
||||
itemMap.addItem(new SimpleClickableItem(item.getItemStack(), event -> {
|
||||
private void addParticles(PaginatedFastInv gui) {
|
||||
for(ParticleItem item : registeredParticles) {
|
||||
gui.addContent(item.getItemStack(), event -> {
|
||||
HumanEntity humanEntity = event.getWhoClicked();
|
||||
|
||||
if(!(humanEntity instanceof Player))
|
||||
@@ -191,6 +173,9 @@ public class ParticleRegistry {
|
||||
return;
|
||||
}
|
||||
Plot plot = arena.getPlotManager().getPlot(player);
|
||||
if(plot == null) {
|
||||
return;
|
||||
}
|
||||
if(plot.getParticles().size() >= plugin.getConfig().getInt("Particle.Max-Amount", 25)) {
|
||||
new MessageBuilder("IN_GAME_MESSAGES_PLOT_LIMIT_PARTICLES").asKey().player(player).sendPlayer();
|
||||
return;
|
||||
@@ -198,15 +183,15 @@ public class ParticleRegistry {
|
||||
plot.getParticles().put(player.getLocation(), item.getEffect());
|
||||
plugin.getUserManager().getUser(player).adjustStatistic("PARTICLES_USED", 1);
|
||||
new MessageBuilder("MENU_OPTION_CONTENT_PARTICLE_ADDED").asKey().player(player).sendPlayer();
|
||||
}));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public PagedFastInv getParticles() {
|
||||
public PaginatedFastInv getParticles() {
|
||||
return particles;
|
||||
}
|
||||
|
||||
public void setParticles(PagedFastInv particles) {
|
||||
public void setParticles(PaginatedFastInv particles) {
|
||||
this.particles = particles;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ public class ParticlesOption {
|
||||
}
|
||||
|
||||
humanEntity.closeInventory();
|
||||
registry.getPlugin().getOptionsRegistry().getParticleRegistry().getParticles().open(humanEntity);
|
||||
registry.getPlugin().getOptionsRegistry().getParticleRegistry().getParticles().open(((Player) humanEntity));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
+13
-4
@@ -21,7 +21,7 @@
|
||||
package plugily.projects.buildbattle.handlers.menu.registry.playerheads;
|
||||
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import plugily.projects.minigamesbox.inventory.normal.NormalFastInv;
|
||||
import plugily.projects.minigamesbox.inventory.utils.fastinv.PaginatedFastInv;
|
||||
|
||||
/**
|
||||
* @author Plajer
|
||||
@@ -35,7 +35,8 @@ public class HeadsCategory {
|
||||
private final String categoryID;
|
||||
private ItemStack itemStack;
|
||||
private String permission;
|
||||
private NormalFastInv gui;
|
||||
private PaginatedFastInv gui;
|
||||
private boolean search = false;
|
||||
|
||||
public HeadsCategory(String categoryID) {
|
||||
this.categoryID = categoryID;
|
||||
@@ -61,11 +62,19 @@ public class HeadsCategory {
|
||||
this.permission = permission;
|
||||
}
|
||||
|
||||
public NormalFastInv getGui() {
|
||||
public PaginatedFastInv getGui() {
|
||||
return gui;
|
||||
}
|
||||
|
||||
public void setGui(NormalFastInv inventoryView) {
|
||||
public void setGui(PaginatedFastInv inventoryView) {
|
||||
this.gui = inventoryView;
|
||||
}
|
||||
|
||||
public void setSearch(boolean search) {
|
||||
this.search = search;
|
||||
}
|
||||
|
||||
public boolean isSearch() {
|
||||
return search;
|
||||
}
|
||||
}
|
||||
+103
-32
@@ -20,16 +20,30 @@
|
||||
|
||||
package plugily.projects.buildbattle.handlers.menu.registry.playerheads;
|
||||
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.conversations.Prompt;
|
||||
import org.bukkit.conversations.StringPrompt;
|
||||
import org.bukkit.entity.HumanEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import plugily.projects.buildbattle.handlers.menu.MenuOption;
|
||||
import plugily.projects.buildbattle.handlers.menu.OptionsRegistry;
|
||||
import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder;
|
||||
import plugily.projects.minigamesbox.classic.utils.conversation.SimpleConversationBuilder;
|
||||
import plugily.projects.minigamesbox.classic.utils.helper.ItemBuilder;
|
||||
import plugily.projects.minigamesbox.classic.utils.helper.ItemUtils;
|
||||
import plugily.projects.minigamesbox.classic.utils.version.xseries.XMaterial;
|
||||
import plugily.projects.minigamesbox.inventory.common.item.SimpleClickableItem;
|
||||
import plugily.projects.minigamesbox.inventory.normal.NormalFastInv;
|
||||
import plugily.projects.minigamesbox.inventory.utils.fastinv.InventoryScheme;
|
||||
import plugily.projects.minigamesbox.inventory.utils.fastinv.PaginatedFastInv;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author Plajer
|
||||
@@ -38,41 +52,98 @@ import plugily.projects.minigamesbox.inventory.normal.NormalFastInv;
|
||||
*/
|
||||
public class PlayerHeadsOption {
|
||||
|
||||
public PlayerHeadsOption(OptionsRegistry registry) {
|
||||
registry.registerOption(new MenuOption(10, "PLAYER_HEADS", new ItemBuilder(ItemUtils.PLAYER_HEAD_ITEM.clone())
|
||||
.name(new MessageBuilder("MENU_OPTION_CONTENT_HEADS_ITEM_NAME").asKey().build())
|
||||
.lore(new MessageBuilder("MENU_OPTION_CONTENT_HEADS_ITEM_LORE").asKey().build())
|
||||
.build(), new MessageBuilder("MENU_OPTION_CONTENT_HEADS_INVENTORY").asKey().build()) {
|
||||
public PlayerHeadsOption(OptionsRegistry registry) {
|
||||
registry.registerOption(new MenuOption(10, "PLAYER_HEADS", new ItemBuilder(XMaterial.PLAYER_HEAD.parseItem())
|
||||
.name(new MessageBuilder("MENU_OPTION_CONTENT_HEADS_ITEM_NAME").asKey().build())
|
||||
.lore(new MessageBuilder("MENU_OPTION_CONTENT_HEADS_ITEM_LORE").asKey().build())
|
||||
.build(), new MessageBuilder("MENU_OPTION_CONTENT_HEADS_INVENTORY").asKey().build()) {
|
||||
|
||||
@Override
|
||||
public void onClick(InventoryClickEvent event) {
|
||||
HumanEntity humanEntity = event.getWhoClicked();
|
||||
humanEntity.closeInventory();
|
||||
if (!(humanEntity instanceof Player)) {
|
||||
return;
|
||||
}
|
||||
Player player = (Player) humanEntity;
|
||||
if (registry.getPlugin().getConfigPreferences().getOption("HEAD_MENU_CUSTOM")) {
|
||||
player.performCommand(registry.getPlugin().getConfig().getString("Head-Menu.Command", "heads"));
|
||||
return;
|
||||
}
|
||||
NormalFastInv gui = new NormalFastInv(registry.getPlugin().getBukkitHelper().serializeInt(registry.getPlayerHeadsRegistry().getCategories().size() + 1), new MessageBuilder("MENU_OPTION_CONTENT_HEADS_INVENTORY").asKey().build());
|
||||
@Override
|
||||
public void onClick(InventoryClickEvent event) {
|
||||
HumanEntity humanEntity = event.getWhoClicked();
|
||||
humanEntity.closeInventory();
|
||||
if(!(humanEntity instanceof Player)) {
|
||||
return;
|
||||
}
|
||||
Player player = (Player) humanEntity;
|
||||
if(registry.getPlugin().getConfigPreferences().getOption("HEAD_MENU_CUSTOM")) {
|
||||
player.performCommand(registry.getPlugin().getConfig().getString("Head-Menu.Command", "heads"));
|
||||
return;
|
||||
}
|
||||
NormalFastInv gui = new NormalFastInv(registry.getPlugin().getBukkitHelper().serializeInt(registry.getPlayerHeadsRegistry().getCategories().size() + 1), new MessageBuilder("MENU_OPTION_CONTENT_HEADS_INVENTORY").asKey().build());
|
||||
|
||||
for (HeadsCategory headsCategory : registry.getPlayerHeadsRegistry().getCategories().keySet()) {
|
||||
gui.addItem(new SimpleClickableItem(headsCategory.getItemStack(), clickEvent -> {
|
||||
player.closeInventory();
|
||||
if (!player.hasPermission(headsCategory.getPermission())) {
|
||||
new MessageBuilder("IN_GAME_MESSAGES_PLOT_PERMISSION_HEAD").asKey().player(player).sendPlayer();
|
||||
return;
|
||||
}
|
||||
headsCategory.getGui().open(player);
|
||||
}));
|
||||
}
|
||||
for(HeadsCategory headsCategory : registry.getPlayerHeadsRegistry().getCategories().keySet()) {
|
||||
if(headsCategory.isSearch()) {
|
||||
gui.setItem(gui.getInventory().getSize() - 2, headsCategory.getItemStack(), clickEvent -> {
|
||||
player.closeInventory();
|
||||
if(!player.hasPermission(headsCategory.getPermission())) {
|
||||
new MessageBuilder("IN_GAME_MESSAGES_PLOT_PERMISSION_HEAD").asKey().player(player).sendPlayer();
|
||||
return;
|
||||
}
|
||||
createChatEvent(event, player, registry);
|
||||
});
|
||||
continue;
|
||||
}
|
||||
|
||||
registry.getPlugin().getOptionsRegistry().addGoBackItem(gui, gui.getInventory().getSize() - 1);
|
||||
gui.open(humanEntity);
|
||||
gui.addItem(headsCategory.getItemStack(), clickEvent -> {
|
||||
player.closeInventory();
|
||||
if(!player.hasPermission(headsCategory.getPermission())) {
|
||||
new MessageBuilder("IN_GAME_MESSAGES_PLOT_PERMISSION_HEAD").asKey().player(player).sendPlayer();
|
||||
return;
|
||||
}
|
||||
headsCategory.getGui().open(player);
|
||||
});
|
||||
}
|
||||
|
||||
registry.getPlugin().getOptionsRegistry().addGoBackItem(gui, gui.getInventory().getSize() - 1);
|
||||
gui.open(player);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static void createChatEvent(InventoryClickEvent event, Player player, OptionsRegistry registry) {
|
||||
new SimpleConversationBuilder(registry.getPlugin()).withPrompt(new StringPrompt() {
|
||||
@Override
|
||||
public @NotNull String getPromptText(ConversationContext context) {
|
||||
return new MessageBuilder("&ePlease type in chat the name of the head!").prefix().build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Prompt acceptInput(ConversationContext context, String input) {
|
||||
String name = new MessageBuilder(input, false).build();
|
||||
context.getForWhom().sendRawMessage(new MessageBuilder("&e✔ Completed | Got " + name).prefix().build());
|
||||
|
||||
PaginatedFastInv resultGui = new PaginatedFastInv(54, new MessageBuilder("Searching %value%").value(name).build());
|
||||
new InventoryScheme()
|
||||
.mask("111111111")
|
||||
.mask("111111111")
|
||||
.mask("111111111")
|
||||
.mask("111111111")
|
||||
.mask("111111111")
|
||||
.bindPagination('1').apply(resultGui);
|
||||
|
||||
|
||||
resultGui.previousPageItem(45, p -> new ItemBuilder(XMaterial.ARROW.parseItem()).name("&7<- &6" + p + "&7/&6" + resultGui.lastPage()).colorizeItem().build());
|
||||
resultGui.addPageChangeHandler(openedPage -> {
|
||||
resultGui.setItem(49, new ItemBuilder(XMaterial.BARRIER.parseItem()).name("&7X &6" + openedPage + " &7X").colorizeItem().build(), e -> e.getWhoClicked().closeInventory());
|
||||
});
|
||||
}
|
||||
resultGui.nextPageItem(53, p -> new ItemBuilder(XMaterial.ARROW.parseItem()).name("&6 " + p + "&7/&6" + resultGui.lastPage() + " &7->").colorizeItem().build());
|
||||
|
||||
registry.getPlugin().getOptionsRegistry().addGoBackItem(resultGui, 46);
|
||||
|
||||
List<ItemStack> filteredHeads = registry.getPlayerHeadsRegistry().getHeadsDatabase().values().stream()
|
||||
.flatMap(innerMap -> innerMap.entrySet().stream())
|
||||
.filter(entry -> entry.getKey().toLowerCase().contains(input.toLowerCase()))
|
||||
.map(Map.Entry::getValue)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
for(ItemStack playerHead : filteredHeads) {
|
||||
resultGui.addContent(playerHead, clickEvent -> clickEvent.getWhoClicked().getInventory().addItem(playerHead.clone()));
|
||||
}
|
||||
resultGui.open(player);
|
||||
return Prompt.END_OF_CONVERSATION;
|
||||
}
|
||||
}).buildFor((Player) event.getWhoClicked());
|
||||
}
|
||||
|
||||
}
|
||||
+126
-17
@@ -20,23 +20,30 @@
|
||||
|
||||
package plugily.projects.buildbattle.handlers.menu.registry.playerheads;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import plugily.projects.buildbattle.Main;
|
||||
import plugily.projects.buildbattle.arena.BaseArena;
|
||||
import plugily.projects.buildbattle.handlers.menu.OptionsRegistry;
|
||||
import plugily.projects.buildbattle.handlers.misc.HeadDatabaseManager;
|
||||
import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder;
|
||||
import plugily.projects.minigamesbox.classic.utils.configuration.ConfigUtils;
|
||||
import plugily.projects.minigamesbox.classic.utils.helper.ItemBuilder;
|
||||
import plugily.projects.minigamesbox.classic.utils.helper.ItemUtils;
|
||||
import plugily.projects.minigamesbox.classic.utils.misc.complement.ComplementAccessor;
|
||||
import plugily.projects.minigamesbox.inventory.common.item.SimpleClickableItem;
|
||||
import plugily.projects.minigamesbox.inventory.normal.NormalFastInv;
|
||||
import plugily.projects.minigamesbox.classic.utils.version.VersionUtils;
|
||||
import plugily.projects.minigamesbox.classic.utils.version.xseries.XEnchantment;
|
||||
import plugily.projects.minigamesbox.classic.utils.version.xseries.XMaterial;
|
||||
import plugily.projects.minigamesbox.inventory.utils.fastinv.InventoryScheme;
|
||||
import plugily.projects.minigamesbox.inventory.utils.fastinv.PaginatedFastInv;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -47,7 +54,7 @@ import java.util.stream.Collectors;
|
||||
public class PlayerHeadsRegistry {
|
||||
|
||||
private final Main plugin;
|
||||
private final Map<HeadsCategory, NormalFastInv> categories = new HashMap<>();
|
||||
private final Map<HeadsCategory, PaginatedFastInv> categories = new HashMap<>();
|
||||
|
||||
public PlayerHeadsRegistry(OptionsRegistry registry) {
|
||||
this.plugin = registry.getPlugin();
|
||||
@@ -60,6 +67,30 @@ public class PlayerHeadsRegistry {
|
||||
if(!config.getBoolean(str + ".enabled", true)) {
|
||||
continue;
|
||||
}
|
||||
if(str.equalsIgnoreCase("Do-Not-Edit")) {
|
||||
continue;
|
||||
}
|
||||
if(config.getBoolean(str + ".database", false)) {
|
||||
String categoryName = config.getString(str + ".config", "fail");
|
||||
if(categoryName.equalsIgnoreCase("search")) {
|
||||
HeadsCategory category = new HeadsCategory(str);
|
||||
category.setItemStack(new ItemBuilder(ItemUtils.getSkull(config.getString(str + ".texture")))
|
||||
.name(new MessageBuilder(config.getString(str + ".displayname")).value(categoryName.toUpperCase()).build())
|
||||
.lore(config.getStringList(str + ".lore").stream()
|
||||
.map(lore -> new MessageBuilder(lore).value(categoryName.toUpperCase()).build()).collect(Collectors.toList()))
|
||||
.glowEffect().build());
|
||||
category.setPermission(config.getString(str + ".permission"));
|
||||
category.setSearch(true);
|
||||
categories.put(category, null);
|
||||
} else {
|
||||
CompletableFuture.supplyAsync(() -> plugin.getHeadDatabaseManager().getDatabase(categoryName)).thenAccept(download -> {
|
||||
if(download != HeadDatabaseManager.DownloadStatus.FAIL) {
|
||||
useDatabaseHeads(config, str);
|
||||
}
|
||||
});
|
||||
}
|
||||
continue;
|
||||
}
|
||||
HeadsCategory category = new HeadsCategory(str);
|
||||
|
||||
category.setItemStack(new ItemBuilder(ItemUtils.getSkull(config.getString(str + ".texture")))
|
||||
@@ -86,20 +117,98 @@ public class PlayerHeadsRegistry {
|
||||
stack.setItemMeta(im);
|
||||
playerHeads.add(stack);
|
||||
}
|
||||
NormalFastInv gui = new NormalFastInv(plugin.getBukkitHelper().serializeInt(playerHeads.size() + 1), new MessageBuilder(config.getString(str + ".menuname")).build());
|
||||
|
||||
for(ItemStack playerHead : playerHeads) {
|
||||
gui.addItem(new SimpleClickableItem(playerHead, clickEvent -> clickEvent.getWhoClicked().getInventory().addItem(playerHead.clone())));
|
||||
}
|
||||
|
||||
plugin.getOptionsRegistry().addGoBackItem(gui, gui.getInventory().getSize() - 1);
|
||||
category.setGui(gui);
|
||||
categories.put(category, gui);
|
||||
createPaginatedInventory(str, config, playerHeads, category);
|
||||
}
|
||||
}
|
||||
|
||||
public Map<HeadsCategory, NormalFastInv> getCategories() {
|
||||
private void createPaginatedInventory(String str, FileConfiguration config, Collection<ItemStack> playerHeads, HeadsCategory category) {
|
||||
PaginatedFastInv gui = new PaginatedFastInv(54, new MessageBuilder(config.getString(str + ".menuname")).value(config.getString(str + ".config")).build());
|
||||
new InventoryScheme()
|
||||
.mask("111111111")
|
||||
.mask("111111111")
|
||||
.mask("111111111")
|
||||
.mask("111111111")
|
||||
.mask("111111111")
|
||||
.bindPagination('1').apply(gui);
|
||||
|
||||
|
||||
gui.previousPageItem(45, p -> new ItemBuilder(XMaterial.ARROW.parseItem()).name("&7<- &6" + p + "&7/&6" + gui.lastPage()).colorizeItem().build());
|
||||
gui.addPageChangeHandler(openedPage -> {
|
||||
gui.setItem(49, new ItemBuilder(XMaterial.BARRIER.parseItem()).name("&7X &6" + openedPage + " &7X").colorizeItem().build(), e -> e.getWhoClicked().closeInventory());
|
||||
});
|
||||
gui.nextPageItem(53, p -> new ItemBuilder(XMaterial.ARROW.parseItem()).name("&6 " + p + "&7/&6" + gui.lastPage() + " &7->").colorizeItem().build());
|
||||
|
||||
plugin.getOptionsRegistry().addGoBackItem(gui, 46);
|
||||
|
||||
if(playerHeads.size() > 200) {
|
||||
List<ItemStack> heads = new ArrayList<>(playerHeads);
|
||||
Collections.shuffle(heads);
|
||||
int start = plugin.getRandom().nextInt(heads.size() - 225);
|
||||
playerHeads = heads.subList(start, start + 225);
|
||||
}
|
||||
|
||||
for(ItemStack playerHead : playerHeads) {
|
||||
gui.addContent(playerHead, clickEvent -> clickEvent.getWhoClicked().getInventory().addItem(playerHead.clone()));
|
||||
}
|
||||
|
||||
plugin.getOptionsRegistry().addGoBackItem(gui, gui.getInventory().getSize() - 1);
|
||||
category.setGui(gui);
|
||||
categories.put(category, gui);
|
||||
}
|
||||
|
||||
public void useDatabaseHeads(FileConfiguration config, String str) {
|
||||
HeadsCategory category = new HeadsCategory(str);
|
||||
String categoryName = config.getString(str + ".config", "fail");
|
||||
|
||||
category.setItemStack(new ItemBuilder(ItemUtils.getSkull(config.getString(str + ".texture")))
|
||||
.name(new MessageBuilder(config.getString(str + ".displayname")).value(categoryName.toUpperCase()).build())
|
||||
.lore(config.getStringList(str + ".lore").stream()
|
||||
.map(lore -> new MessageBuilder(lore).value(categoryName.toUpperCase()).build()).collect(Collectors.toList()))
|
||||
.build());
|
||||
category.setPermission(config.getString(str + ".permission"));
|
||||
|
||||
|
||||
CompletableFuture.supplyAsync(() -> loadHeadsFromYML(categoryName)).thenAccept(playerHeads -> createPaginatedInventory(str, config, playerHeads.values(), category));
|
||||
}
|
||||
|
||||
private final Map<String, Map<String, ItemStack>> headsDatabase = new HashMap<>();
|
||||
|
||||
public Map<String, ItemStack> loadHeadsFromYML(String name) {
|
||||
// Should do this in async thread to do not cause dead for the main thread
|
||||
long start = System.currentTimeMillis();
|
||||
FileConfiguration categoryConfig = ConfigUtils.getConfig(plugin, "heads/database/" + name);
|
||||
Map<String, String> heads = new HashMap<>();
|
||||
for(String path : categoryConfig.getKeys(false)) {
|
||||
heads.put(path, categoryConfig.getString(path));
|
||||
}
|
||||
plugin.getDebugger().debug("[System] [Plugin] Head file loading " + name + " finished took ms" + (System.currentTimeMillis() - start));
|
||||
|
||||
long secondStart = System.currentTimeMillis();
|
||||
Map<String, ItemStack> playerHeads = new HashMap<>();
|
||||
for(Map.Entry<String, String> entry : heads.entrySet()) {
|
||||
if(entry.getKey().toLowerCase().contains("(dup)")) {
|
||||
continue;
|
||||
}
|
||||
ItemStack stack = ItemUtils.getSkull(entry.getValue());
|
||||
ItemMeta im = stack.getItemMeta();
|
||||
|
||||
ComplementAccessor.getComplement().setDisplayName(im, new MessageBuilder(entry.getKey()).build());
|
||||
ComplementAccessor.getComplement().setLore(im, Collections.singletonList(new MessageBuilder("MENU_OPTION_CONTENT_HEADS_DATABASE_LORE").asKey().value(entry.getKey()).build()));
|
||||
stack.setItemMeta(im);
|
||||
playerHeads.put(entry.getKey(), stack);
|
||||
}
|
||||
headsDatabase.put(name, playerHeads);
|
||||
plugin.getDebugger().debug("[System] [Plugin] Head textures loading " + name + " finished took ms" + (System.currentTimeMillis() - secondStart));
|
||||
return playerHeads;
|
||||
}
|
||||
|
||||
|
||||
public Map<HeadsCategory, PaginatedFastInv> getCategories() {
|
||||
return categories;
|
||||
}
|
||||
|
||||
public Map<String, Map<String, ItemStack>> getHeadsDatabase() {
|
||||
return headsDatabase;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -37,26 +37,20 @@ public class ChunkManager {
|
||||
|
||||
private static Class<?> packetPlayOutMapChunk, chunkClass;
|
||||
private static Constructor<?> mapChunkConstructor;
|
||||
private static Method chunkHandleMethod;
|
||||
|
||||
static {
|
||||
if(ServerVersion.Version.isCurrentLower(ServerVersion.Version.v1_18_R1)) {
|
||||
if (ServerVersion.Version.isCurrentLower(ServerVersion.Version.v1_18)) {
|
||||
packetPlayOutMapChunk = PacketUtils.classByName("net.minecraft.network.protocol.game", "PacketPlayOutMapChunk");
|
||||
chunkClass = PacketUtils.classByName("net.minecraft.world.level.chunk", "Chunk");
|
||||
|
||||
try {
|
||||
chunkHandleMethod = Chunk.class.getMethod("getHandle");
|
||||
} catch(NoSuchMethodException exc) {
|
||||
}
|
||||
|
||||
if(ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_17_R1)) {
|
||||
if (ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_17)) {
|
||||
try {
|
||||
mapChunkConstructor = packetPlayOutMapChunk.getConstructor(PacketUtils.classByName("net.minecraft.world.level.chunk", "LevelChunk"));
|
||||
} catch(NoSuchMethodException e) {
|
||||
} catch (NoSuchMethodException e) {
|
||||
try {
|
||||
mapChunkConstructor = packetPlayOutMapChunk.getConstructor(chunkClass);
|
||||
} catch(NoSuchMethodException ex) {
|
||||
ex.printStackTrace();
|
||||
} catch (NoSuchMethodException ex) {
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -64,38 +58,39 @@ public class ChunkManager {
|
||||
}
|
||||
|
||||
public static void sendMapChunk(Player player, Chunk chunk) {
|
||||
if(ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_18_R1)) {
|
||||
if (ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_18)) {
|
||||
return; // Should just use World#refreshChunk instead
|
||||
}
|
||||
|
||||
try {
|
||||
if(ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_17_R1)) {
|
||||
Method chunkHandleMethod = chunk.getClass().getMethod("getHandle");
|
||||
if (ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_17)) {
|
||||
PacketUtils.sendPacket(player, mapChunkConstructor.newInstance(chunkHandleMethod.invoke(chunk)));
|
||||
return;
|
||||
}
|
||||
|
||||
if(ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_16_R1)) {
|
||||
if(mapChunkConstructor == null)
|
||||
if (ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_16)) {
|
||||
if (mapChunkConstructor == null)
|
||||
mapChunkConstructor = packetPlayOutMapChunk.getConstructor(chunkClass, int.class, boolean.class);
|
||||
|
||||
PacketUtils.sendPacket(player, mapChunkConstructor.newInstance(chunkHandleMethod.invoke(chunk), 65535, false));
|
||||
return;
|
||||
}
|
||||
|
||||
if(ServerVersion.Version.isCurrentEqualOrLower(ServerVersion.Version.v1_10_R2)) {
|
||||
if(mapChunkConstructor == null)
|
||||
if (ServerVersion.Version.isCurrentEqualOrLower(ServerVersion.Version.v1_10)) {
|
||||
if (mapChunkConstructor == null)
|
||||
mapChunkConstructor = packetPlayOutMapChunk.getConstructor(chunkClass, boolean.class, int.class);
|
||||
|
||||
PacketUtils.sendPacket(player, mapChunkConstructor.newInstance(chunkHandleMethod.invoke(chunk), true, 65535));
|
||||
return;
|
||||
}
|
||||
|
||||
if(mapChunkConstructor == null)
|
||||
if (mapChunkConstructor == null)
|
||||
mapChunkConstructor = packetPlayOutMapChunk.getConstructor(chunkClass, int.class);
|
||||
|
||||
PacketUtils.sendPacket(player, mapChunkConstructor.newInstance(chunkHandleMethod.invoke(chunk), 65535));
|
||||
} catch(ReflectiveOperationException exception) {
|
||||
exception.printStackTrace();
|
||||
} catch (ReflectiveOperationException exception) {
|
||||
throw new RuntimeException(exception);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,194 @@
|
||||
package plugily.projects.buildbattle.handlers.misc;
|
||||
|
||||
import plugily.projects.buildbattle.Main;
|
||||
import plugily.projects.minigamesbox.classic.utils.configuration.ConfigUtils;
|
||||
|
||||
import javax.net.ssl.HttpsURLConnection;
|
||||
import java.io.*;
|
||||
import java.net.URL;
|
||||
import java.nio.file.Files;
|
||||
import java.util.*;
|
||||
import java.util.logging.Level;
|
||||
|
||||
/**
|
||||
* @author Tigerpanzer_02
|
||||
* <p>
|
||||
* Created at 09.07.2025
|
||||
*/
|
||||
public class HeadDatabaseManager {
|
||||
|
||||
private final Main plugin;
|
||||
private final ArrayList<String> headCatalog = new ArrayList<>(Arrays.asList("alphabet", "animals", "blocks", "decoration", "food-drinks", "humanoid", "humans", "miscellaneous", "monsters", "plants"));
|
||||
|
||||
public HeadDatabaseManager(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
try(Scanner scanner = new Scanner(requestHeadFetch(null), "UTF-8").useDelimiter("\\A")) {
|
||||
String data = scanner.hasNext() ? scanner.next() : "";
|
||||
File file = new File(plugin.getDataFolder().getPath() + "/heads/database/head_data.yml");
|
||||
if(!file.exists()) {
|
||||
new File(plugin.getDataFolder().getPath() + "/heads/").mkdir();
|
||||
new File(plugin.getDataFolder().getPath() + "/heads/database/").mkdir();
|
||||
if(!file.createNewFile()) {
|
||||
plugin.getDebugger().debug(Level.WARNING, "Couldn't create heads folder! We must disable heads support.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
Files.write(file.toPath(), data.getBytes());
|
||||
plugin.getDebugger().debug(Level.WARNING, "Fetched latest heads file from repository.");
|
||||
} catch(IOException ignored) {
|
||||
//ignore exceptions
|
||||
plugin.getDebugger().debug(Level.WARNING, "Couldn't access heads fetcher service or there is other problem! You should notify author!");
|
||||
}
|
||||
}
|
||||
|
||||
public DownloadStatus getDatabase(String databaseName) {
|
||||
if(!headCatalog.contains(databaseName)) {
|
||||
return DownloadStatus.FAIL;
|
||||
}
|
||||
return download(plugin, databaseName);
|
||||
}
|
||||
|
||||
public ArrayList<String> getHeadCatalog() {
|
||||
return headCatalog;
|
||||
}
|
||||
|
||||
private DownloadStatus download(Main plugin, String name) {
|
||||
DownloadStatus status = demandHeadDownload(name);
|
||||
if(status == DownloadStatus.FAIL) {
|
||||
plugin.getDebugger().debug(Level.WARNING, "&cHeads service couldn't download latest heads for plugin! Reduced heads will be used instead!");
|
||||
} else if(status == DownloadStatus.SUCCESS) {
|
||||
plugin.getDebugger().debug(Level.WARNING, "&aDownloaded heads " + name + " properly!");
|
||||
} else if(status == DownloadStatus.LATEST) {
|
||||
plugin.getDebugger().debug(Level.WARNING, "&aHeads " + name + " is latest! Awesome!");
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
private InputStream requestHeadFetch(String head) {
|
||||
try {
|
||||
URL url = new URL("https://api.plugily.xyz/onlineservices/v1/fetch.php");
|
||||
HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
|
||||
conn.setRequestMethod("POST");
|
||||
conn.setRequestProperty("User-Agent", "PlugilyProjectsOnlineServices/1.0");
|
||||
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
|
||||
conn.setRequestProperty("Accept-Charset", "UTF-8");
|
||||
conn.setDoOutput(true);
|
||||
|
||||
OutputStream os = conn.getOutputStream();
|
||||
if(head == null) {
|
||||
os.write(("pass=onlineservice").getBytes("UTF-8"));
|
||||
} else {
|
||||
os.write(("pass=onlineservice&head=" + head).getBytes("UTF-8"));
|
||||
}
|
||||
os.flush();
|
||||
os.close();
|
||||
return conn.getInputStream();
|
||||
} catch(IOException e) {
|
||||
plugin.getDebugger().debug(Level.SEVERE, "Could not fetch heads from plugily.xyz api! Cause: {0} ({1})", new Object[]{e.getCause(), e.getMessage()});
|
||||
return new InputStream() {
|
||||
@Override
|
||||
public int read() {
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private DownloadStatus demandHeadDownload(String head) {
|
||||
File headFile = new File(plugin.getDataFolder() + "/heads/database/" + head + ".yml");
|
||||
if(!headFile.exists() || !isExact(head, headFile)) {
|
||||
return writeFile(head);
|
||||
}
|
||||
return DownloadStatus.LATEST;
|
||||
}
|
||||
|
||||
private boolean isExact(String head, File file) {
|
||||
try(Scanner scanner = new Scanner(requestHeadFetch(head), "UTF-8").useDelimiter("\\A");
|
||||
Scanner localScanner = new Scanner(file, "UTF-8").useDelimiter("\\A")) {
|
||||
String onlineData = scanner.hasNext() ? scanner.next() : "";
|
||||
String localData = localScanner.hasNext() ? localScanner.next() : "";
|
||||
|
||||
return onlineData.equals(localData);
|
||||
} catch(IOException ignored) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private DownloadStatus writeFile(String head) {
|
||||
try(Scanner scanner = new Scanner(requestHeadFetch(head), "UTF-8").useDelimiter("\\A")) {
|
||||
String data = scanner.hasNext() ? scanner.next() : "";
|
||||
try(OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(plugin.getDataFolder().getPath() + "/heads/database/" + head + ".yml"), "UTF-8")) {
|
||||
writer.write(data);
|
||||
}
|
||||
return DownloadStatus.SUCCESS;
|
||||
} catch(IOException ignored) {
|
||||
plugin.getDebugger().debug(Level.WARNING, "Demanded head " + head + " cannot be downloaded! You should notify author!");
|
||||
return DownloadStatus.FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
[ARCHIVE] Convert Heads with Json to YML Code
|
||||
private void loadFileFromJSONde(String input) {
|
||||
long start = System.currentTimeMillis();
|
||||
JsonElement element = getJsonElement("https://raw.githubusercontent.com/Plugily-Projects/online-services/refs/heads/master/buildbattle/headdatabase/raw/" + input + ".yml");
|
||||
or
|
||||
JsonElement element = getJsonElement("https://minecraft-heads.com/scripts/api.php?cat=decoration");
|
||||
if(element == null) {
|
||||
return;
|
||||
}
|
||||
JsonArray outputJson = element.getAsJsonArray();
|
||||
AtomicInteger i = new AtomicInteger();
|
||||
i.set(0);
|
||||
outputJson.forEach(categoryElement -> {
|
||||
JsonObject category = categoryElement.getAsJsonObject();
|
||||
if(category.get("name") == null) {
|
||||
return;
|
||||
}
|
||||
if(category.get("value") == null) {
|
||||
return;
|
||||
}
|
||||
String name = category.get("name").getAsString();
|
||||
String value = category.get("value").getAsString();
|
||||
if(heads.get(name) != null) {
|
||||
heads.put(name + " (dup) " + i.get(), value);
|
||||
i.getAndIncrement();
|
||||
} else
|
||||
heads.put(name, value);
|
||||
});
|
||||
System.out.println(heads);
|
||||
FileConfiguration categoryConfig = ConfigUtils.getConfig(plugin, "heads/menus/hd/" + input);
|
||||
for(Map.Entry<String, String> entry : heads.entrySet()) {
|
||||
// System.out.println("Trying to save -> " + entry.getKey() + " "+ entry.getValue());
|
||||
categoryConfig.set(entry.getKey().replace(".", " "), entry.getValue());
|
||||
}
|
||||
ConfigUtils.saveConfig(plugin, categoryConfig, "heads/menus/hd/" + input);
|
||||
System.out.println("[System] [Plugin] Head finished took ms" + (System.currentTimeMillis() - start));
|
||||
heads.clear();
|
||||
}
|
||||
|
||||
private final String USER_AGENT = "Plugily Projects Converter v1";
|
||||
|
||||
public JsonElement getJsonElement(String fullURL) {
|
||||
try {
|
||||
URL url = new URL(fullURL);
|
||||
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
|
||||
connection.addRequestProperty("User-Agent", USER_AGENT);
|
||||
InputStream inputStream = connection.getInputStream();
|
||||
InputStreamReader reader = new InputStreamReader(inputStream);
|
||||
return new JsonParser().parse(reader);
|
||||
} catch(IOException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
public enum DownloadStatus {
|
||||
SUCCESS, FAIL, LATEST
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -23,6 +23,7 @@ package plugily.projects.buildbattle.handlers.setup;
|
||||
import org.bukkit.entity.Player;
|
||||
import plugily.projects.buildbattle.arena.BaseArena;
|
||||
import plugily.projects.buildbattle.arena.GuessArena;
|
||||
import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder;
|
||||
import plugily.projects.minigamesbox.classic.handlers.setup.categories.PluginSpecificCategory;
|
||||
import plugily.projects.minigamesbox.classic.handlers.setup.items.category.CountItem;
|
||||
import plugily.projects.minigamesbox.classic.handlers.setup.items.category.MultiLocationItem;
|
||||
@@ -52,8 +53,20 @@ public class SpecificCategory extends PluginSpecificCategory {
|
||||
getItemList().add(gamePlot);
|
||||
|
||||
MultiLocationItem floorNPC = new MultiLocationItem(getSetupInventory(), new ItemBuilder(XMaterial.VILLAGER_SPAWN_EGG.parseMaterial()), "Floor Changer NPC", "Add floor changer NPC to your plot.\nRequires Citizens plugin! Runs addnpc command", "floornpc", 0, event -> {
|
||||
((Player) event.getWhoClicked()).performCommand("bba addnpc");
|
||||
switch (event.getClick()) {
|
||||
case LEFT:
|
||||
((Player) event.getWhoClicked()).performCommand("bba addnpc");
|
||||
}
|
||||
}, interactEvent -> {
|
||||
switch (interactEvent.getAction()) {
|
||||
case PHYSICAL:
|
||||
case LEFT_CLICK_AIR:
|
||||
interactEvent.getPlayer().performCommand("bba addnpc");
|
||||
(new MessageBuilder("&cPlease keep in mind to use blocks instead of player location for precise coordinates!")).prefix().send(interactEvent.getPlayer());
|
||||
break;
|
||||
case LEFT_CLICK_BLOCK:
|
||||
interactEvent.getPlayer().performCommand("bba addnpc");
|
||||
}
|
||||
});
|
||||
gui.setItem((getInventoryLine() * 9) + 2, floorNPC);
|
||||
getItemList().add(floorNPC);
|
||||
|
||||
+16
-6
@@ -20,18 +20,28 @@
|
||||
|
||||
package plugily.projects.buildbattle.handlers.themes;
|
||||
|
||||
public class BBTheme {
|
||||
import java.util.ArrayList;
|
||||
|
||||
private final String theme;
|
||||
public class GuessTheme {
|
||||
|
||||
private final ArrayList<String> themes;
|
||||
private final Difficulty difficulty;
|
||||
|
||||
public BBTheme(String theme, Difficulty difficulty) {
|
||||
this.theme = theme == null ? "" : theme;
|
||||
public GuessTheme(ArrayList<String> themes, Difficulty difficulty) {
|
||||
this.themes = themes;
|
||||
this.difficulty = difficulty;
|
||||
}
|
||||
|
||||
public String getTheme() {
|
||||
return theme;
|
||||
public ArrayList<String> getThemes() {
|
||||
return themes;
|
||||
}
|
||||
|
||||
public String getThemesAsString() {
|
||||
return String.join(", ", themes);
|
||||
}
|
||||
|
||||
public String getDefaultTheme() {
|
||||
return themes.get(0);
|
||||
}
|
||||
|
||||
public Difficulty getDifficulty() {
|
||||
@@ -160,7 +160,7 @@ public class ThemeManager {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static GameThemes getByDifficulty(BBTheme.Difficulty difficulty) {
|
||||
public static GameThemes getByDifficulty(GuessTheme.Difficulty difficulty) {
|
||||
switch(difficulty) {
|
||||
case EASY:
|
||||
return GUESS_THE_BUILD_EASY;
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
package plugily.projects.buildbattle.handlers.themes.vote;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.HumanEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
@@ -33,21 +32,19 @@ import plugily.projects.buildbattle.Main;
|
||||
import plugily.projects.buildbattle.arena.BaseArena;
|
||||
import plugily.projects.buildbattle.arena.BuildArena;
|
||||
import plugily.projects.buildbattle.handlers.themes.ThemeManager;
|
||||
import plugily.projects.minigamesbox.classic.arena.ArenaState;
|
||||
import plugily.projects.minigamesbox.api.arena.IArenaState;
|
||||
import plugily.projects.minigamesbox.api.user.IUser;
|
||||
import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder;
|
||||
import plugily.projects.minigamesbox.classic.user.User;
|
||||
import plugily.projects.minigamesbox.classic.utils.helper.ItemBuilder;
|
||||
import plugily.projects.minigamesbox.classic.utils.version.xseries.XEnchantment;
|
||||
import plugily.projects.minigamesbox.classic.utils.version.xseries.XItemFlag;
|
||||
import plugily.projects.minigamesbox.classic.utils.version.xseries.XMaterial;
|
||||
import plugily.projects.minigamesbox.classic.utils.version.xseries.inventory.XInventoryView;
|
||||
import plugily.projects.minigamesbox.inventory.common.item.ClickableItem;
|
||||
import plugily.projects.minigamesbox.inventory.common.item.SimpleClickableItem;
|
||||
import plugily.projects.minigamesbox.inventory.normal.NormalFastInv;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/**
|
||||
@@ -102,12 +99,12 @@ public class VoteMenu {
|
||||
NormalFastInv gui = new NormalFastInv(9 * themeSelection.size(), new MessageBuilder("MENU_THEME_INVENTORY").asKey().build());
|
||||
|
||||
gui.addCloseHandler(event -> {
|
||||
if(arena.getArenaState() == ArenaState.IN_GAME && arena.getArenaInGameState() == BaseArena.ArenaInGameState.THEME_VOTING) {
|
||||
if(arena.getArenaState() == IArenaState.IN_GAME && arena.getArenaInGameState() == BaseArena.ArenaInGameState.THEME_VOTING) {
|
||||
plugin.getServer().getScheduler().runTask(plugin, () -> {
|
||||
HumanEntity humanEntity = event.getPlayer();
|
||||
Inventory inventory = event.getInventory();
|
||||
|
||||
if(humanEntity.getOpenInventory().getTopInventory() != inventory) {
|
||||
if(XInventoryView.of(humanEntity.getOpenInventory()).getTopInventory() != inventory) {
|
||||
humanEntity.openInventory(inventory);
|
||||
}
|
||||
});
|
||||
@@ -130,25 +127,30 @@ public class VoteMenu {
|
||||
|
||||
setGlassPanes(gui, multiplied, percent);
|
||||
|
||||
gui.setItem(multiplied + 8, new SimpleClickableItem(new ItemBuilder(new ItemStack(Material.PAPER))
|
||||
.name(new MessageBuilder("MENU_THEME_VOTE_SUPER_ITEM_NAME").asKey().arena(arena).value(theme).build())
|
||||
.lore(new MessageBuilder("MENU_THEME_VOTE_SUPER_ITEM_LORE").asKey().player(guiPlayer).arena(arena).value(theme).build().split(";"))
|
||||
.build(), event -> {
|
||||
HumanEntity humanEntity = event.getWhoClicked();
|
||||
if (plugin.getConfigPreferences().getOption("SUPER_VOTES")) {
|
||||
gui.setItem(multiplied + 8, new SimpleClickableItem(new ItemBuilder(new ItemStack(Material.PAPER))
|
||||
.name(new MessageBuilder("MENU_THEME_VOTE_SUPER_ITEM_NAME").asKey().arena(arena).value(theme).build())
|
||||
.lore(new MessageBuilder("MENU_THEME_VOTE_SUPER_ITEM_LORE").asKey().player(guiPlayer).arena(arena).value(theme).build().split(";"))
|
||||
.build(), event -> {
|
||||
HumanEntity humanEntity = event.getWhoClicked();
|
||||
|
||||
if(!(humanEntity instanceof Player))
|
||||
return;
|
||||
if(!(humanEntity instanceof Player))
|
||||
return;
|
||||
|
||||
Player player = (Player) humanEntity;
|
||||
User user = plugin.getUserManager().getUser(player);
|
||||
Player player = (Player) humanEntity;
|
||||
IUser user = plugin.getUserManager().getUser(player);
|
||||
|
||||
if(user.getStatistic("SUPER_VOTES") > 0) {
|
||||
user.adjustStatistic("SUPER_VOTES", -1);
|
||||
new MessageBuilder("MENU_THEME_VOTE_SUPER_USED").asKey().arena(arena).player(player).value(theme).sendArena();
|
||||
arena.setTheme(theme);
|
||||
arena.setTimer(0, true);
|
||||
}
|
||||
}));
|
||||
if(user.getStatistic("SUPER_VOTES") > 0) {
|
||||
user.adjustStatistic("SUPER_VOTES", -1);
|
||||
new MessageBuilder("MENU_THEME_VOTE_SUPER_USED").asKey().arena(arena).player(player).value(theme).sendArena();
|
||||
arena.setTheme(theme);
|
||||
arena.setTimer(0, true);
|
||||
}
|
||||
}));
|
||||
}
|
||||
else {
|
||||
gui.setItem(multiplied + 8, ClickableItem.of(new ItemBuilder(XMaterial.IRON_BARS.parseItem()).name("&7<-").colorizeItem().build()));
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
@@ -183,7 +185,7 @@ public class VoteMenu {
|
||||
ItemBuilder itemBuilder = new ItemBuilder(clickableSignItem.getItem()).removeLore();
|
||||
itemBuilder.lore(new MessageBuilder("MENU_THEME_ITEM_LORE").asKey().arena(arena).value(theme).integer((int) percent).build().split(";"));
|
||||
if(theme.equals(playerVote)) {
|
||||
itemBuilder.enchantment(Enchantment.DAMAGE_ALL, 1).flags(ItemFlag.HIDE_ENCHANTS);
|
||||
itemBuilder.enchantment(XEnchantment.UNBREAKING.get(), 1).flags(XItemFlag.HIDE_ENCHANTS.get());
|
||||
} else {
|
||||
itemBuilder.removeEnchants().removeFlags();
|
||||
}
|
||||
@@ -215,10 +217,10 @@ public class VoteMenu {
|
||||
int slot = multiplied + 2 + j;
|
||||
|
||||
if(vote > percent) {
|
||||
gui.setItem(slot, ClickableItem.of(new ItemBuilder(XMaterial.RED_STAINED_GLASS_PANE.parseItem()).name("").build()));
|
||||
gui.setItem(slot, ClickableItem.of(new ItemBuilder(XMaterial.RED_STAINED_GLASS_PANE.parseItem()).name("???").build()));
|
||||
continue;
|
||||
}
|
||||
gui.setItem(slot, ClickableItem.of(new ItemBuilder(XMaterial.LIME_STAINED_GLASS_PANE.parseItem()).name("").build()));
|
||||
gui.setItem(slot, ClickableItem.of(new ItemBuilder(XMaterial.LIME_STAINED_GLASS_PANE.parseItem()).name("???").build()));
|
||||
vote += 16.7;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
# Available localizations:
|
||||
# default - English language. Uses 'language.yml'.
|
||||
# See https://github.com/Plugily-Projects/locale_storage/tree/master/plugins/minecraft/buildbattle
|
||||
# Help us translate the project -> https://translate.plugily.xyz
|
||||
# Use filename of the language e.g. de_DE.yml -> locale: de_DE
|
||||
locale: default
|
||||
|
||||
@@ -49,14 +50,10 @@ Commands:
|
||||
Executes: "buildbattle leave"
|
||||
Enabled: true
|
||||
'3':
|
||||
Short: "kit"
|
||||
Executes: "buildbattle selectkit"
|
||||
Enabled: false
|
||||
'4':
|
||||
Short: "stats"
|
||||
Executes: "buildbattle stats"
|
||||
Enabled: false
|
||||
'5':
|
||||
'4':
|
||||
Short: "top"
|
||||
Executes: "buildbattle top"
|
||||
Enabled: true
|
||||
@@ -71,6 +68,18 @@ Block:
|
||||
Leave: false
|
||||
# Cancels Item Movement into player crafting, enchantment tables, anvils ...
|
||||
Item-Move: true
|
||||
ArmorStand:
|
||||
# Should we block armor stand destroy with double click?
|
||||
Destroy: true
|
||||
# Should we block armor stand interaction?
|
||||
Interact: true
|
||||
# Should these only be blocked while ingame and arena state is in_game? (e.g. Lobby and Ending is blocked)
|
||||
# Setting it to false means on all stages of the game the event will be cancelled.
|
||||
# Setting it to true means only while IN_GAME the event will be cancelled.
|
||||
Check: true
|
||||
# Should all interactions with interactive materials such as doors / buttons / fences / redstone be blocked during ingame
|
||||
# Full list see https://github.com/CryptoMorin/XSeries/blob/e84000a2bead7367d893cf8661f8d5432116adaa/core/src/main/java/com/cryptomorin/xseries/XTag.java#L2793
|
||||
Interact: false
|
||||
|
||||
|
||||
# Enable this option when you're using MySQL, otherwise it won't work.
|
||||
@@ -82,18 +91,24 @@ Database: false
|
||||
|
||||
# Should we enable in game rewards? See rewards.yml for more...
|
||||
# You should also check out our script engine tutorial for rewards! https://tutorial.plugily.xyz
|
||||
Rewards: true
|
||||
Rewards: false
|
||||
|
||||
|
||||
# Enable in game (eg. '[KIT][LEVEL] Tigerpanzer_02: hey') special formatting?
|
||||
# Formatting is configurable in old_language.yml
|
||||
# You can use PlaceholderAPI placeholders in chat format!
|
||||
Plugin-Chat-Format: true
|
||||
# Enable the super votes in the theme vote menu
|
||||
Super-Votes: true
|
||||
|
||||
|
||||
# Should we enable a separate arena chat for players inside a arena
|
||||
# Useful on multi arena servers that don't want the same chat for all players on the server
|
||||
Separate-Arena-Chat: true
|
||||
Chat:
|
||||
# Enable in game (eg. '[KIT][LEVEL] Tigerpanzer_02: hey') special formatting?
|
||||
# Formatting is configurable in language.yml
|
||||
# You can use PlaceholderAPI placeholders in chat format!
|
||||
Format: true
|
||||
Separate:
|
||||
# Should we enable a separate arena chat for players inside a arena
|
||||
# Useful on multi arena servers that don't want the same chat for all players on the server
|
||||
Arena: true
|
||||
# Should spectators only write with other spectators
|
||||
Spectators: true
|
||||
|
||||
|
||||
# Should we fire some cool fireworks at locations of every player at special events such as the game end?
|
||||
@@ -138,7 +153,8 @@ Damage:
|
||||
Drowning: false
|
||||
# Should players get fire damage?
|
||||
Fire: false
|
||||
|
||||
# Should players lose food ingame & get damage?
|
||||
Hunger: false
|
||||
|
||||
Cycle:
|
||||
# Should we make permanent clear weather on all worlds where our arenas are?
|
||||
@@ -188,8 +204,8 @@ Time-Manager:
|
||||
|
||||
|
||||
Mob:
|
||||
# Should mob spawning on arenas be enabled?
|
||||
Spawn: false
|
||||
# Should mob spawning on arenas be enabled? (Contains Armour Stands)
|
||||
Spawn: true
|
||||
# The list of restricted entities that can't be spawned in game
|
||||
Restricted:
|
||||
- wither
|
||||
@@ -235,7 +251,7 @@ Items:
|
||||
# Enable another Head menu instead of our
|
||||
Head-Menu:
|
||||
Custom: false
|
||||
# The command that should be executed on the player
|
||||
# The command that should be executed on the player if Head-Menu.Custom = true
|
||||
Command: heads
|
||||
|
||||
|
||||
@@ -271,4 +287,4 @@ Update-Notifier:
|
||||
# You edited it, huh? Next time hurt yourself!
|
||||
Do-Not-Edit:
|
||||
File-Version: 1
|
||||
Core-Version: 1
|
||||
Core-Version: 6
|
||||
@@ -1,13 +1,13 @@
|
||||
animals:
|
||||
displayname: '&6Animal heads'
|
||||
simple-animals:
|
||||
displayname: '&6Simple Animal heads'
|
||||
texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNjIxNjY4ZWY3Y2I3OWRkOWMyMmNlM2QxZjNmNGNiNmUyNTU5ODkzYjZkZjRhNDY5NTE0ZTY2N2MxNmFhNCJ9fX0="
|
||||
lore:
|
||||
- "Click to open"
|
||||
- "animal heads menu"
|
||||
- "simple animal heads menu"
|
||||
enabled: true
|
||||
config: animalheads
|
||||
permission: buildbattle.heads
|
||||
menuname: "Animal heads"
|
||||
menuname: "Simple Animal heads"
|
||||
miniblocks:
|
||||
displayname: '&6Mini block heads'
|
||||
texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzI4YTE4MTU2ODlkNzE5NGNmN2RiMDYxYjU5ZjYzMTA2MjY0YjUxMzg3OTc2YTdmYjc0YWI3OWI1NjQxIn19fQ=="
|
||||
@@ -28,3 +28,138 @@ info:
|
||||
config: info
|
||||
permission: buildbattle.heads
|
||||
menuname: "Info blocks"
|
||||
|
||||
# Use HeadDatabase in addition to the configured ones
|
||||
# You can remove categories from the catalog which shouldn't be loaded!
|
||||
# Catalog:
|
||||
# - alphabet
|
||||
# - animals
|
||||
# - blocks
|
||||
# - decoration
|
||||
# - food-drinks
|
||||
# - humanoid
|
||||
# - humans
|
||||
# - miscellaneous
|
||||
# - monsters
|
||||
# - plants
|
||||
database-alphabet:
|
||||
displayname: '&6%value% heads'
|
||||
texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzI1MDhlMmNhNjUwMGJjZTMwNTM5YzM4ODg0MmE1NjcyYjdiYzI5YTY4NzZkZDZhNTAyNTY3MmUyNTJkMjVkYSJ9fX0="
|
||||
lore:
|
||||
- "Click to open"
|
||||
- "%value% menu"
|
||||
enabled: true
|
||||
database: true
|
||||
config: alphabet
|
||||
permission: buildbattle.heads
|
||||
menuname: "%value% blocks"
|
||||
database-animals:
|
||||
displayname: '&6%value% heads'
|
||||
texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTQyYjllYzM0OTYwNjRiMDg1ZjdkMzBjZTkwYTBjOGY3NjM2YzhlZjUzMDNiMjBjMjVjYTEwYTk5N2JkNzQzMyJ9fX0="
|
||||
lore:
|
||||
- "Click to open"
|
||||
- "%value% menu"
|
||||
enabled: true
|
||||
database: true
|
||||
config: animals
|
||||
permission: buildbattle.heads
|
||||
menuname: "%value% blocks"
|
||||
database-blocks:
|
||||
displayname: '&6%value% heads'
|
||||
texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzViNDQ4ZmQ5NWM4NzRjOTVmZTc0ODQ0NDFhNDM5NGQ2NDZiNzJiYzgyYTUyNzQ4M2ZkYzcwY2E3OTg2ZmNhNSJ9fX0="
|
||||
lore:
|
||||
- "Click to open"
|
||||
- "%value% menu"
|
||||
enabled: true
|
||||
database: true
|
||||
config: blocks
|
||||
permission: buildbattle.heads
|
||||
menuname: "%value% blocks"
|
||||
database-decoration:
|
||||
displayname: '&6%value% heads'
|
||||
texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMjNhZjk0YTUwZmFmNTBhZTAyMzZjNzExZWMxMzZiMjgwOGFjODJiYjE3MWQ0MmIzOGQxNjc2MGQyMjBmMjU4MiJ9fX0="
|
||||
lore:
|
||||
- "Click to open"
|
||||
- "%value% menu"
|
||||
enabled: true
|
||||
database: true
|
||||
config: decoration
|
||||
permission: buildbattle.heads
|
||||
menuname: "%value% blocks"
|
||||
database-food-drinks:
|
||||
displayname: '&6%value% heads'
|
||||
texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZDUxMzdmYzBjZDUxMjAyNjcyMzgyYmZhZTAxZmViM2UxZTJiNzMxMDdlOThkMmM2YzhmNzE5ZjFkYTUzMGU2OCJ9fX0="
|
||||
lore:
|
||||
- "Click to open"
|
||||
- "%value% menu"
|
||||
enabled: true
|
||||
database: true
|
||||
config: food-drinks
|
||||
permission: buildbattle.heads
|
||||
menuname: "%value% blocks"
|
||||
database-humanoid:
|
||||
displayname: '&6%value% heads'
|
||||
texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTc5Yzc3ZjEyYzg2NzM5OGE0MTgxMDgxZmI1YmY3MGM1ZmYzMjcxNWM2ODk3NTBjNmU3MTdkMDY5ZTgxMzFhOSJ9fX0="
|
||||
lore:
|
||||
- "Click to open"
|
||||
- "%value% menu"
|
||||
enabled: true
|
||||
database: true
|
||||
config: humanoid
|
||||
permission: buildbattle.heads
|
||||
menuname: "%value% blocks"
|
||||
database-humans:
|
||||
displayname: '&6%value% heads'
|
||||
texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNDQ5MmRmZTNjZThjYjYxYjkwODYwZWZmOTM4Y2I4M2UxOWMxNmU5Y2IyZDliZjJhZDc4OTZjOTBmNWIyZTFmMCJ9fX0="
|
||||
lore:
|
||||
- "Click to open"
|
||||
- "%value% menu"
|
||||
enabled: true
|
||||
database: true
|
||||
config: humans
|
||||
permission: buildbattle.heads
|
||||
menuname: "%value% blocks"
|
||||
database-miscellaneous:
|
||||
displayname: '&6%value% heads'
|
||||
texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNDQ3OTE3MTkzZTlmYjdjYjk2OGZiYTAzYTJlMjg0YTA0NjEyMWIyZGMwMTU0MWNhY2RiYTUzYTRmOWJiZjcwOCJ9fX0="
|
||||
lore:
|
||||
- "Click to open"
|
||||
- "%value% menu"
|
||||
enabled: true
|
||||
database: true
|
||||
config: miscellaneous
|
||||
permission: buildbattle.heads
|
||||
menuname: "%value% blocks"
|
||||
database-monsters:
|
||||
displayname: '&6%value% heads'
|
||||
texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZTgyYjQxZjY3YjMzNzE0NWM1ZWI4M2I5ZTAwMTU1NzQ4MDE2MGE1NWU5MWVmODYzZWIwYmYwNTU3Mzg0MmNlMSJ9fX0="
|
||||
lore:
|
||||
- "Click to open"
|
||||
- "%value% menu"
|
||||
enabled: true
|
||||
database: true
|
||||
config: monsters
|
||||
permission: buildbattle.heads
|
||||
menuname: "%value% blocks"
|
||||
database-plants:
|
||||
displayname: '&6%value% heads'
|
||||
texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNDA4MzY2YjgxMWM0MzU5YWVhNjY4NjMwMGNmZDQ1MGQ5ZWFhNDYxNGMzYWYwOGExN2YxNTEzZjVkMmY0OGM0YSJ9fX0="
|
||||
lore:
|
||||
- "Click to open"
|
||||
- "%value% menu"
|
||||
enabled: true
|
||||
database: true
|
||||
config: plants
|
||||
permission: buildbattle.heads
|
||||
menuname: "%value% blocks"
|
||||
database-search:
|
||||
displayname: '&6%value% heads'
|
||||
texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNjViOTVkYTEyODE2NDJkYWE1ZDAyMmFkYmQzZTdjYjY5ZGMwOTQyYzgxY2Q2M2JlOWMzODU3ZDIyMmUxYzhkOSJ9fX0="
|
||||
lore:
|
||||
- "Click to search"
|
||||
- "for a head (english only!)"
|
||||
enabled: true
|
||||
database: true
|
||||
config: search
|
||||
permission: buildbattle.heads
|
||||
menuname: "%value% blocks"
|
||||
@@ -231,7 +231,7 @@ In-Game:
|
||||
# Join cancelled via external plugin that uses the API of our plugin.
|
||||
Cancelled-Via-API: "%color_chat_issue%%plugin_prefix% You can't join this game!"
|
||||
As-Party-Member: "%color_chat_issue%%plugin_prefix% You joined %arena_name% because the party leader joined it!"
|
||||
Arena-Not-Configured: "%color_chat_issue%%plugin_prefix% BaseArena is not configured yet! Contact staff!"
|
||||
Arena-Not-Configured: "%color_chat_issue%%plugin_prefix% BaseArena is not configured yet! Contact your server's staff!"
|
||||
Title: "20,30,20;%arena_name%;%arena_players_size%/%arena_max_players%"
|
||||
Death:
|
||||
Tag: "&8Dead"
|
||||
@@ -293,7 +293,7 @@ In-Game:
|
||||
Own: "&aYou became #%number%"
|
||||
Admin:
|
||||
Set-Starting-In-To-0: "%plugin_prefix% An admin set waiting time to 0. The game starts now!"
|
||||
Changed-Theme: "%plugin_prefix% Admin has changed theme to %THEME%"
|
||||
Changed-Theme: "%plugin_prefix% Admin has changed theme to %value%"
|
||||
Plot:
|
||||
Nobody: "%color_chat_issue%Nobody"
|
||||
Time-Left:
|
||||
@@ -377,6 +377,8 @@ Menu:
|
||||
Item:
|
||||
Name: "&bGet player heads"
|
||||
Lore: "Click to get heads"
|
||||
Database:
|
||||
Lore: "Get Head %value%"
|
||||
Floor:
|
||||
Item:
|
||||
Name: "&bChange floor material"
|
||||
@@ -393,7 +395,7 @@ Menu:
|
||||
Noon: "Noon (6000 ticks)"
|
||||
Sunset: "Sunset (12000 ticks)"
|
||||
Night: "Night (13000 ticks)"
|
||||
MidNight: "MidNight (18000 ticks)"
|
||||
MidNight: "Midnight (18000 ticks)"
|
||||
Sunrise: "Sunrise (23000 ticks)"
|
||||
Changed: "%plugin_prefix% Time has been changed to %value%"
|
||||
Biome:
|
||||
@@ -571,5 +573,5 @@ Leaderboard:
|
||||
# Really, don't edit ;p
|
||||
# You edited it, huh? Next time hurt yourself!
|
||||
Do-Not-Edit:
|
||||
File-Version: 1
|
||||
Core-Version: 1
|
||||
File-Version: 2
|
||||
Core-Version: 2
|
||||
@@ -228,7 +228,7 @@ In-Game:
|
||||
# Join cancelled via external plugin that uses the API of our plugin.
|
||||
Cancelled-Via-API: "%color_chat_issue%%plugin_prefix% You can't join this game!"
|
||||
As-Party-Member: "%color_chat_issue%%plugin_prefix% You joined %arena_name% because the party leader joined it!"
|
||||
Arena-Not-Configured: "%color_chat_issue%%plugin_prefix% BaseArena is not configured yet! Contact staff!"
|
||||
Arena-Not-Configured: "%color_chat_issue%%plugin_prefix% BaseArena is not configured yet! Contact your server's staff!"
|
||||
Title: "20,30,20;%arena_name%;%arena_players_size%/%arena_max_players%"
|
||||
Death:
|
||||
Tag: "&8Dead"
|
||||
@@ -290,7 +290,7 @@ In-Game:
|
||||
Own: "&aYou became #%number%"
|
||||
Admin:
|
||||
Set-Starting-In-To-0: "%plugin_prefix% An admin set waiting time to 0. The game starts now!"
|
||||
Changed-Theme: "%plugin_prefix% Admin has changed theme to %THEME%"
|
||||
Changed-Theme: "%plugin_prefix% Admin has changed theme to %value%"
|
||||
Plot:
|
||||
Nobody: "%color_chat_issue%Nobody"
|
||||
Time-Left:
|
||||
@@ -374,6 +374,8 @@ Menu:
|
||||
Item:
|
||||
Name: "&bGet player heads"
|
||||
Lore: "Click to get heads"
|
||||
Database:
|
||||
Lore: "Get Head %value%"
|
||||
Floor:
|
||||
Item:
|
||||
Name: "&bChange floor material"
|
||||
@@ -390,7 +392,7 @@ Menu:
|
||||
Noon: "Noon (6000 ticks)"
|
||||
Sunset: "Sunset (12000 ticks)"
|
||||
Night: "Night (13000 ticks)"
|
||||
MidNight: "MidNight (18000 ticks)"
|
||||
MidNight: "Midnight (18000 ticks)"
|
||||
Sunrise: "Sunrise (23000 ticks)"
|
||||
Changed: "%plugin_prefix% Time has been changed to %value%"
|
||||
Biome:
|
||||
@@ -568,5 +570,5 @@ Leaderboard:
|
||||
# Really, don't edit ;p
|
||||
# You edited it, huh? Next time hurt yourself!
|
||||
Do-Not-Edit:
|
||||
File-Version: 1
|
||||
Core-Version: 1
|
||||
File-Version: 2
|
||||
Core-Version: 2
|
||||
@@ -1,4 +1,4 @@
|
||||
name: ${description}
|
||||
name: BuildBattle
|
||||
main: plugily.projects.buildbattle.Main
|
||||
authors: [ PlugilyProjects, Tigerpanzer_02, Tigerpanzer, Plajer, TomTheDeveloper ]
|
||||
version: ${version}
|
||||
@@ -8,11 +8,11 @@ api-version: 1.13
|
||||
commands:
|
||||
buildbattle:
|
||||
description: BuildBattle Commands
|
||||
usage: "\u00A76Correct usage: /bb [option]"
|
||||
usage: "§6Correct usage: /bb [option]"
|
||||
aliases: [ bb, buildb ]
|
||||
buildbattleadmin:
|
||||
description: BuildBattle Admin Commands
|
||||
usage: "\u00A76Correct usage: /bba [option]"
|
||||
usage: "§6Correct usage: /bba [option]"
|
||||
aliases: [ bba, buildbadmin ]
|
||||
|
||||
permissions:
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# BuildBattle rewards configuration
|
||||
#
|
||||
# Placeholders list:
|
||||
# %PLAYER% - Current player name
|
||||
# %player% - Current player name
|
||||
# %MAPNAME% - Name of map
|
||||
# %ARENA-ID% - BaseArena Identifier
|
||||
# %PLACE% - Player Place (Working on category place)
|
||||
@@ -17,11 +17,11 @@
|
||||
# - chance(1):p:say I was very lucky! # Player has 1% chance to say "I was very lucky!"
|
||||
# - p:chance(99):spawn # Player has 99% chance to teleport to spawn
|
||||
# ^ YOU CAN EVEN SWAP CHANCE WITH PLAYER!
|
||||
# - chance(50):eco give %PLAYER% 10 # Console has 10% chance to give player 10$
|
||||
# - chance(50):eco give %player% 10 # Console has 10% chance to give player 10$
|
||||
#
|
||||
# You can unlock full potential of rewards using our script engine! (since 4.0.0)
|
||||
# Just add example reward:
|
||||
# - script:player.sendMessage("oh, hi %PLAYER%"); # It will send "oh, hi <player name>" to player! 100% plain java!
|
||||
# - script:player.sendMessage("oh, hi %player%"); # It will send "oh, hi <player name>" to player! 100% plain java!
|
||||
# - script:server.broadcastMessage("hello everyone"); # Broadcasts "hello everyone" to whole server
|
||||
# - script:player.getInventory().addItem(new org.bukkit.inventory.ItemStack(org.bukkit.Material.DIRT));
|
||||
# ^ Gives player dirt item (you must always use direct package names for not provided objects)
|
||||
@@ -50,40 +50,40 @@ rewards:
|
||||
# Commands performed when all themes are guessed in GTB
|
||||
# Delete everything if you don't want to use this section
|
||||
guess:
|
||||
- eco give %PLAYER% 2
|
||||
- eco give %player% 2
|
||||
guess-all:
|
||||
- eco give %PLAYER% 2
|
||||
- eco give %player% 2
|
||||
# Commands executed when someone vote
|
||||
vote:
|
||||
- eco give %PLAYER% 2
|
||||
- chance(10):eco give %PLAYER% 8
|
||||
- eco give %player% 2
|
||||
- chance(10):eco give %player% 8
|
||||
# Commands executed when all voted for a plot
|
||||
vote-all:
|
||||
- eco give %PLAYER% 2
|
||||
- chance(10):eco give %PLAYER% 8
|
||||
- eco give %player% 2
|
||||
- chance(10):eco give %player% 8
|
||||
# Commands executed when someone report a building
|
||||
report:
|
||||
- eco give %PLAYER% 2
|
||||
- eco give %player% 2
|
||||
- script:player.sendMessage("You reported the building");
|
||||
# Commands executed on place X
|
||||
place:
|
||||
1:
|
||||
- eco give %PLAYER% 10
|
||||
- eco give %player% 10
|
||||
2:
|
||||
- eco give %PLAYER% 9
|
||||
- eco give %player% 9
|
||||
3:
|
||||
- eco give %PLAYER% 8
|
||||
- eco give %player% 8
|
||||
4:
|
||||
- eco give %PLAYER% 7
|
||||
- eco give %player% 7
|
||||
5:
|
||||
- eco give %PLAYER% 6
|
||||
- eco give %player% 6
|
||||
6:
|
||||
- eco give %PLAYER% 5
|
||||
- eco give %player% 5
|
||||
7:
|
||||
- eco give %PLAYER% 4
|
||||
- eco give %player% 4
|
||||
8:
|
||||
- eco give %PLAYER% 3
|
||||
- eco give %player% 3
|
||||
9:
|
||||
- eco give %PLAYER% 2
|
||||
- eco give %player% 2
|
||||
10:
|
||||
- eco give %PLAYER% 1
|
||||
- eco give %player% 1
|
||||
@@ -121,7 +121,7 @@ Back-To-Hub:
|
||||
Options-Menu:
|
||||
permission: ""
|
||||
execute:
|
||||
- ""
|
||||
- "p:bb menu"
|
||||
displayname: "&a&lOptions menu &7(Right Click)"
|
||||
lore:
|
||||
- "&7Right-click to open options menu"
|
||||
|
||||
@@ -9,31 +9,150 @@ Themes:
|
||||
- Emoji
|
||||
- House
|
||||
- Flower
|
||||
- Tree
|
||||
- Car
|
||||
- Book
|
||||
- Ocean
|
||||
- Mountain
|
||||
- Forest
|
||||
- Desert
|
||||
- Volcano
|
||||
- Island
|
||||
- Cave
|
||||
- Waterfall
|
||||
- River
|
||||
- Lake
|
||||
- Glacier
|
||||
- Jungle
|
||||
- Pizza
|
||||
- Burger
|
||||
- Cake
|
||||
- Ice Cream
|
||||
- Fruit
|
||||
- Vegetable
|
||||
- Candy
|
||||
- Sushi
|
||||
- Bread
|
||||
- Coffee
|
||||
- Dragon
|
||||
- Wizard Tower
|
||||
- Fairy Tale
|
||||
- Spaceship
|
||||
- Robot
|
||||
- Alien
|
||||
- Monster
|
||||
- Superhero
|
||||
- Pirate Ship
|
||||
- Ancient Ruin
|
||||
- Music
|
||||
- Dreams
|
||||
- Emotions
|
||||
- Future
|
||||
- Past
|
||||
- Chaos
|
||||
- Order
|
||||
- Light
|
||||
- Darkness
|
||||
- Time
|
||||
- Shoe
|
||||
- Chair
|
||||
- Lamp
|
||||
- Clock
|
||||
- Camera
|
||||
- Phone
|
||||
- Television
|
||||
- Pencil
|
||||
- Key
|
||||
- Umbrella
|
||||
# Team mode themes.
|
||||
Teams:
|
||||
- Well
|
||||
- Car
|
||||
- Rainbow
|
||||
- Arcade Machine
|
||||
- Bridge
|
||||
- Road
|
||||
- Train Tracks
|
||||
- Chain
|
||||
- Puzzle
|
||||
- Web
|
||||
- Rainbow
|
||||
- Secret Passage
|
||||
- Parallel Worlds
|
||||
- Lost and Found
|
||||
- A New Discovery
|
||||
- The Great Escape
|
||||
- Time Travel
|
||||
- A Legendary Battle
|
||||
# Guess the build themes.
|
||||
# Use the following layout to support multiple answers
|
||||
# Main theme, second possibility, x possibility
|
||||
# E.g. You want Castle as main Theme but also allow fortress and mansion as different possibility it would look like
|
||||
# - Castle, Fortress, Mansion
|
||||
Guess-The-Build:
|
||||
Easy:
|
||||
- Apple
|
||||
- Sun
|
||||
- Bread
|
||||
- Book
|
||||
- Dollar
|
||||
- Dollar, Money, Bill
|
||||
- Cloud
|
||||
- Tree
|
||||
- House, Home, Abode
|
||||
- Car, Automobile, Vehicle
|
||||
- Ball, Sphere
|
||||
- Chair, Seat
|
||||
- Lamp, Light
|
||||
- River, Stream
|
||||
- Mountain, Peak, Summit
|
||||
- Flower, Bloom
|
||||
- Boat, Ship
|
||||
- Hat, Cap
|
||||
- Shoe, Footwear
|
||||
- Door, Gateway
|
||||
- Window, Pane
|
||||
Medium:
|
||||
- School Bus
|
||||
- Horse
|
||||
- Horse, Steed, Pony
|
||||
- Fountain
|
||||
- Sumo
|
||||
- Bicycle
|
||||
- Bicycle, Bike
|
||||
- Lighthouse
|
||||
- Pyramid
|
||||
- Robot, Android, Golem
|
||||
- Spaceship, Rocket
|
||||
- Guitar, Instrument
|
||||
- Volcano, Mount Vesuvius
|
||||
- Castle, Fortress, Mansion
|
||||
- Bridge, Overpass, Viaduct
|
||||
- Windmill, Mill
|
||||
- Octopus, Cephalopod
|
||||
- Hot Air Balloon, Airship
|
||||
- Train, Locomotive
|
||||
- Carousel, Merry-go-round
|
||||
- Chess Piece, Knight, Rook
|
||||
- Telescope, Spyglass
|
||||
Hard:
|
||||
- Soccer
|
||||
- Birthday Cake
|
||||
- Soccer, Football
|
||||
- Birthday Cake, Celebration Cake
|
||||
- Typewriter
|
||||
- Solar System
|
||||
- Solar System, Galaxy, Cosmos
|
||||
- Eiffel Tower, Landmark
|
||||
- Dragon, Wyrm, Beast
|
||||
- Submarine, U-boat
|
||||
- Grandfather Clock, Timepiece
|
||||
- Rollercoaster, Amusement Ride
|
||||
- DNA, Helix
|
||||
- Globe, World Map, Earth
|
||||
- Opera House, Concert Hall
|
||||
- Satellite, Orbiter
|
||||
- Microscope, Magnifying Glass
|
||||
- Labyrinth, Maze
|
||||
- Golden Gate Bridge, Suspension Bridge
|
||||
- The Sphinx, Monument
|
||||
- Chandelier, Candelabra
|
||||
- Pirate Ship, Galleon, Brig
|
||||
- Globe Theater, Amphitheater
|
||||
|
||||
|
||||
# Special holiday themes
|
||||
@@ -45,27 +164,55 @@ Holiday:
|
||||
- Void
|
||||
- Minecraft
|
||||
- Mojang
|
||||
- Prank
|
||||
- Illusion
|
||||
- Trick
|
||||
- Joke
|
||||
- Upside Down
|
||||
Valentine:
|
||||
- Heart
|
||||
- Love
|
||||
- Cupid
|
||||
- Chocolate Box
|
||||
- Roses
|
||||
- Romance
|
||||
- Teddy Bear
|
||||
- Arrow
|
||||
- Poem
|
||||
- Sweet
|
||||
Halloween:
|
||||
- Pumpkin
|
||||
- Skeleton
|
||||
- Jack'o'Lantern
|
||||
- Candies
|
||||
- Ghost
|
||||
- Witch
|
||||
- Bat
|
||||
- Spiderweb
|
||||
- Vampire
|
||||
- Zombie
|
||||
Christmas:
|
||||
- Santa
|
||||
- Presents
|
||||
- Snowman
|
||||
- Stocking
|
||||
- Reindeer
|
||||
- Sleigh
|
||||
- Elf
|
||||
- Ornament
|
||||
- Gingerbread
|
||||
- Chimney
|
||||
NewYear:
|
||||
- Rocket
|
||||
- Firework
|
||||
- Party
|
||||
- Firecracker
|
||||
- Champagne
|
||||
- Clock
|
||||
- Countdown
|
||||
- Confetti
|
||||
- Ball Drop
|
||||
- Resolutions
|
||||
|
||||
# Theme names that are blacklisted.
|
||||
Blacklisted:
|
||||
@@ -76,5 +223,5 @@ Blacklisted:
|
||||
# Really, don't edit ;p
|
||||
# You edited it, huh? Next time hurt yourself!
|
||||
Do-Not-Edit:
|
||||
File-Version: 1
|
||||
File-Version: 2
|
||||
Core-Version: 1
|
||||
Reference in new issue
Block a user