Skip to content

Commit

Permalink
November 2023 release (#901)
Browse files Browse the repository at this point in the history
* Fix sidebar title animation not working #660

* Fixed wins placeholder not in lobby sidebar #658

* Fixed NPE when clicking outside of shop inventory #664

* Fixed command error when lobby location is not set

* Added unformatted player name to kill message and bed destroy

* Added Netherite armor to 1.16+ (#657)

* Added missing items in v1_12_R1

* Fixed level just showing numer (#661)

* expose sidebar on API

* a few updates (#632)

* Italian Language Update

* Fix Moneys reward team-support on Solo & update variables names

* add sidebar init event

* fix team identifier length (#682)

* Bug fixes and placeholder adjustments (#685)

read pr details

* fix no tab formatting for first player (#692)

* fix losing permanent items on rejoin (#385)

* fix scoreboard getting send twice (#690)

* fix void tp on newer servers

* fix swords disappearing (#686)

* fix invisibility potion compatibility with 1.8.8

* fix lobby tablist (#701)

* Add translation for Simplified Chinese (#628)

Co-authored-by: hugeBlack <wwkq03@outlook.com>
Co-authored-by: YukiEnd233 <85435560+YukiEnd233@users.noreply.github.com>

* Remove hand from hideArmor

* fix placeholders

* Fix elapsed time always null (#574)

* fix header and footer

* clean up

* should fix #699

* Remove Deprecation Warning for Version and Update getServerVersion Methods (#623)

* Remove Version Deprecation Warning

* update methods that use getServerVersion()

* Update Sidebar API link in README.md for new sidebar

* More ReadME changes

* Back to Java 11 and some clean up

* Mark PrePartyListener for removal

* Massive Clean up

* Improve TeamEliminatedEvent JavaDoc

* Updates

* fix #712
fix #681

* Add user texture to player head (#333)

* Add gamesPlayed placeholder

* Fixed placeholder typos

* remove unnecessary teams

* fix placeholder

completely fix #724

* fix player name invisible on 1.8

* removed replace gens with air (#529)

* add check if respawning (#732)

* Add catch for teleport exceptions

* Add global placeholders

* Add global placeholders to header and footer (#730)

* Add invis removed message

* fix papi support

* keep old placeholder at least for a few updates

* Bug fixes (#740)

* fix no tab formatting for first player (#692)

* fix losing permanent items on rejoin (#385)

* fix scoreboard getting send twice (#690)

* fix void tp on newer servers

* fix swords disappearing (#686)

* fix invisibility potion compatibility with 1.8.8

* fix lobby tablist (#701)

* Remove hand from hideArmor

* fix placeholders

* Fix elapsed time always null (#574)

* fix header and footer

* clean up

* should fix #699

* fix #712
fix #681

* Add user texture to player head (#333)

* Add gamesPlayed placeholder

* Fixed placeholder typos

* remove unnecessary teams

* fix placeholder

completely fix #724

* fix player name invisible on 1.8

* removed replace gens with air (#529)

* add check if respawning (#732)

* Add catch for teleport exceptions

* Add global placeholders

* Add global placeholders to header and footer (#730)

* Add invis removed message

* fix papi support

* keep old placeholder at least for a few updates

---------

Co-authored-by: Andrei Dascălu <andrew.dascalu@gmail.com>
Co-authored-by: andrei1058 <andrei7dascalu@gmail.com>

* clean up

* Internal Party Additions (Promote, list/info commands) (#715)

* getOwner and promote methods to Party interface

* Add /party promote command and English Lang

* Add /party info/list commands

* break;

* add Romanian Lang

* add Italian Lang

* add Other Lang

* clean up

* clean up

* clean up

* add missing messages

* do not break addons

---------

Co-authored-by: Andrei Dascălu <andrew.dascalu@gmail.com>

* Update Russian.java (#696)

update translations
Co-authored-by: Andrei Dascălu <andrew.dascalu@gmail.com>

* add missing return

* Fix #760 (#792)

* Added placeholders {team} and {teamColor} to display the player team and its corresponding colors on the teleporter (#796)

* Added placeholders for {team} and {teamColor} to display the player team and their corresponding colors on the teleporter

* Fixed an error in calculating the player teleporter gui size

* limit size to 54

---------

Co-authored-by: Andrei Dascălu <andrew.dascalu@gmail.com>

* Reduce some race conditions with IArena#getStatus (#775)

* Added support for 1.19_R3 (#761)

Co-authored-by: ItzCodex <tom183.private@gmail.com>

* Fix dropping and picking up items if main lobby is set on shared mode (#805)

* tag event handler

* fix drop/ pick up if main lobby is set on SHARED server type

* readme update (#811)

* Fixed bug where Dream Defender and Bed Bug were spawning at player's location instead of where they clicked. (#813)

Co-authored-by: PmzHeroV69 <pmzherov69@gmail.com>

* Add 1.20 support (#814)

* add 1.20 support

* mention jetbrains

* add new sidebar version that supports 1.20

* fix missing dependency on 1.17+ (#817)

* world restore adapters update (#820)

* world restore adapters update

* update workflow

* update workflow

* update workflow

* update workflow

* add missing dependency

* Glass protection barrier rework (#469)

* Add VersionSupport#calculateExplosionBlocks

* Add isGlass & isProtectedByGlass to VersionSupport

* isProtectedByGlass performs ray tracing to ensure there is no glass
  inbetween

* Change VersionSupport#calculateExplosionBlocks implementation

* Implement v1_8_R3#calculateExplosionBlocks

* Copied from net.minecraft.server.v1_8_R3.Explosion#a() (The NMS implementation of
  https://minecraft.fandom.com/wiki/Explosion#Model_of_block_destruction)

* Implement v1_9_R2#calculateExplosionBlocks

* Implement v1_10_R1#calculateExplosionBlocks

* Implement v1_11_R1#calculateExplosionBlocks

* Implement v1_12_R1#calculateExplosionBlocks

* Implement v1_13_R2#calculateExplosionBlocks

* Fix wrong behavior from locY in calculateExplosionBlocks

* Implement v1_14_R1#calculateExplosionBlocks

* Fix tnt breaking blocks under water @ 1.13

* Fix locY @ 1.12

* Fix blocks under water getting exploded

* Fix comments

* Implement v1_15_R1#calculateExplosionBlocks

* Implement v1_16_*#calculateExplosionBlocks

* Add exceptions for not implemented versions of calculateExplosionBlocks

* Change radius of explosion to float instead of int

* Reimplement explosive-related events to use NMS/better detection

* Add Config explosion-settings.explosion-size
* if size is set to auto OR any negative value it will cache the actual
  size of that entity, if it could not cache it (not found) then the
  default implementation is used (removing and protecting blocks)

* Fix location hashing rounding instead of flooring coords

* Add function caching to the default callback of calculateExplosionBlocks

* Add comment describing whatever this is

* Fix ExplosionPrimeEvent not being check correctly

* Fix distances being calculated wrong in VersionSupport#isProtectedByGlass

* Add BlockRay for better ray tracing

* Reimplement VersionSupport#isProtected and its events

* Fix typo

* Remove debug junk

* Add cache cleaning for BreakPlace

* test if block is placed in special cases

* Fix air being counted as a block

* Increase caching lifetime & change keys to Entity

* always manage explosions even if blockList is empty

* Fix imports

* Fix inaccurate calculation of the delta vector in BlockRay

* Add the 3 missing components to BlockRay

* wip

* wip

* implement explosion function

* improvements and clean up

* clean up

* clean up

* clean up

* fix typo

---------

Co-authored-by: Andrei Dascălu <andrew.dascalu@gmail.com>

* Fix default tower item (#831)

Fixed bug where wrong tower item was added as invalid material in shop.yml

* version string update

* change heal pool work (#832)

* change heal pool work

Since the upgrade price is likely to be different for each arena group, if the upgrade has a heal-pool in the name, it is changed to work

* Fix magic miner upgrade (#830)

* Fix magic miner upgrade

Fixed bug where magic miner upgrade was showing wrong material name in version 1.13 and above.

* Fix heal pool not working (#829)

Fixed bug preventing heal pool from working with wrong config path

* Fix sword upgrade (#828)

Fixed bug where upgrade-swords purchases in the upgrade shop didn't apply to axes

* fix missed implementation

* Fix Parties getParty with player UUID (#860)

* fix not loading (#875)

* Sidebar and Tab improvements, session stats remake (#845)

tab rework, sidebar imrovements, new top system and session statistics

* add 1.20 r2 support (#896)

* add 1.20 r2 support

* version string update

* Fix PAF Null issue (#853)

* Fix PAF Null issue

* Update Github actions

* Build 1.20 module against 1.20.1

* fix disablearena command (#839)

Changed this arena to not be disabled if a game is in progress

The reason for the change is that many errors occur when disableArena and enableArena. I will upload the file

* correct silverfish name (#840)

correct silverfish name

* Fix block protection (#841)

* Fix block protection

Fixed bug where shop protection and upgrades protection and generators protection did not work

* fix

fix

* SpoilPlayerTNTFeature code improvements (#892)

SpoilPlayerTNTFeature code improvements

---------

Co-authored-by: Tom Keuper <tomkeuper@live.nl>
Co-authored-by: Yuri <84080587+Xxyuri2005xX@users.noreply.github.com>
Co-authored-by: skbeh <60107333+skbeh@users.noreply.github.com>
Co-authored-by: hugeBlack <wwkq03@outlook.com>
Co-authored-by: YukiEnd233 <85435560+YukiEnd233@users.noreply.github.com>
Co-authored-by: J.T. McQuigg <J.T.McQuigg12@gmail.com>
Co-authored-by: Matveev_ <122512138+UnMatveev@users.noreply.github.com>
Co-authored-by: grass <68882326+Lsy-291@users.noreply.github.com>
Co-authored-by: Tom <72739475+Tom18314@users.noreply.github.com>
Co-authored-by: ItzCodex <tom183.private@gmail.com>
Co-authored-by: PmzHeroV69 <91284999+PmzHeroV69@users.noreply.github.com>
Co-authored-by: PmzHeroV69 <pmzherov69@gmail.com>
Co-authored-by: IIHERO4 <46909116+IIHERO4@users.noreply.github.com>
Co-authored-by: Yenil <85287520+ImYenil@users.noreply.github.com>
Co-authored-by: AlessioDP <alessiodptv@gmail.com>
  • Loading branch information
16 people authored Nov 10, 2023
1 parent c4bff13 commit 22f1a36
Show file tree
Hide file tree
Showing 139 changed files with 14,971 additions and 1,899 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/compile_snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ jobs:
name: development
url: https://repo.andrei1058.dev
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17.0.5
uses: actions/setup-java@v2
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '17.0.5'
java-version: '19.0.2+7'
distribution: 'adopt'
- name: Deploy snapshot with Maven
env:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
name: production
url: https://repo.andrei1058.com
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17.0.5
uses: actions/setup-java@v2
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '17.0.5'
java-version: '19.0.2+7'
distribution: 'adopt'
- name: Deploy with Maven
env:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/deploy_snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
name: development
url: https://repo.andrei1058.dev
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17.0.5
uses: actions/setup-java@v2
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '17.0.5'
java-version: '19.0.2+7'
distribution: 'adopt'
- name: Deploy snapshot with Maven
env:
Expand Down
15 changes: 15 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,18 @@ core team. |
| `under-review` | Pull requests being reviewed by maintainers. |
| `requires-changes` | Pull requests which need to be updated based on review comments and then reviewed again. |
| `needs-testing` | Pull requests which need manual testing. |

# How to add support for a new Minecraft version

First give a look at the project structure above on this page, clone the versionsupport of
the latest supported version and then make sure to rename the package and class, plus update
the pom file with the new version name.

At this point make sure to map the following aspects on the new NMS:
- Pathfinders for goals and targets in `DespawnableProvider`
- `PlayerConnection` used to send packets in `v1_nn_Rx` class
- Glass and other modified blocks in `v1_nn_Rx#registerTntWhitelist`
- NBTTags in `v1_nn_Rx` for Item, Entity and ItemStacks
- eventually other functions that were not mapped yet by spigot

For your update to go live, [SidebarLib](https://github.com/andrei1058/SidebarLib) needs to be updated to your new version as well.
42 changes: 27 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
[![Logo](./.github/assets/logo_open_source.png)](#)
![Logo](./.github/assets/logo_open_source.png)

[![Discord](https://discordapp.com/api/guilds/201345265821679617/widget.png?style=shield)](https://discord.gg/XdJfN2X) [![bStats](https://img.shields.io/bstats/servers/1885)](#)

As from November 1st 2021 BedWars1058 by Andrei Dascălu becomes open source under GNU GPL 3.0 license. If you are a developer I would really appreciate if you'd come with pull requests instead of making hundreds of forks. Let's make updates available for everyone!

[![Discord](https://discordapp.com/api/guilds/201345265821679617/widget.png?style=shield)](https://discord.gg/XdJfN2X)

[![Crowdin](https://support.crowdin.com/assets/badges/localization-at-white-rounded-bordered@1x.svg)](https://crowdin.com/project/bedwars1058)

# Description
BedWars is a mini-game where you have to defend your bed and destroy the others.
Once your bed is destroyed, you cannot respawn.
Expand All @@ -12,16 +15,20 @@ Once your bed is destroyed, you cannot respawn.
This software runs on [Spigot](https://www.spigotmc.org/) and NMS.
Spigot forks without compiled NMS code are not supported.
Officially supported servers are [spigot](https://www.spigotmc.org/) and [paper](https://papermc.io/).
It is required to use Java 11 or newer.
It is required to use **Java 11** or newer.

The internal world restore system is based on zipping and unzipping maps which can become
heavy if you are still making use of HDD in 2021, and you do not have a decent CPU, for a better
and faster restore system install [SlimeWorldManager](https://www.spigotmc.org/resources/slimeworldmanager.69974/) or [AdvancedWorldManager](https://www.spigotmc.org/resources/advanced-slimeworldmanager.87209/).
BedWars1058 will hook into it and do everything for you.
heavy if you are still making use of HDDs and you do not have a decent CPU, for a better
and faster restore system we recommend using one of the following solutions:
- [SlimeWorldManager](https://www.spigotmc.org/resources/slimeworldmanager.69974/) plug-in (v2.2.1 **only**)
- [AdvancedWorldManager](https://www.spigotmc.org/resources/advanced-slimeworldmanager.87209/) plug-in (v2.8.0 **only**)
- [AdvancedSlimePaper](https://github.com/InfernalSuite/AdvancedSlimePaper) server jar (**1.20 or newer**)

BedWars1058 will hook into it and do everything for you, no additional configuration is needed.

# Pre-made setups and community addons
# Pre-made setups and community add-ons

You can find a list of pre-made setups and community addons [on the wiki](https://wiki.andrei1058.dev/docs/BedWars1058/addons)
You can find a list of pre-made server setups and a lot of community add-ons [on BedWars1058 Wiki](https://wiki.andrei1058.dev/docs/BedWars1058/addons).

# Main features

Expand Down Expand Up @@ -115,20 +122,25 @@ If you get disconnected, or if you leave a game (configurable) you can re-join i
###### Season events:
- Halloween special. It is enabled automatically based on your machine timezone and will provide cool effects.

# Community servers
Chosen by hundreds of servers all around the world.
[![Fear Games Logo](.github/assets/servers/fear_games.png)](https://feargames.it/)
[![Gamster Logo](.github/assets/servers/gamster.png)](https://www.gamster.org/)
- mc.feargames.it
- mc.gamster.org
# Contributing
Any help is appreciated, just give a quick look at [CONTRIBUTING.md](https://github.com/andrei1058/BedWars1058/blob/master/CONTRIBUTING.md) first!

If you are not a programmer you can help answering people in the [Issues](https://github.com/andrei1058/BedWars1058/issues) section or even [translate the plugin in your languae on Crowdin](https://crowdin.com/project/bedwars1058).

### Translation progress
[Translation Chart](https://badges.awesome-crowdin.com/translation-12780139-594479.png)

# 3rd party libraries
- [bStats](https://bstats.org/getting-started/include-metrics)
- [Sidebar API](https://github.com/andrei1058/SiderbarLib)
- [SidebarLib](https://github.com/andrei1058/SiderbarLib)
- [Commons IO](https://mvnrepository.com/artifact/commons-io/commons-io)
- [HikariCP](https://mvnrepository.com/artifact/com.zaxxer/HikariCP)
- [SLF4J](http://www.slf4j.org/)

# Contact
[![Discord Server](https://discordapp.com/api/guilds/201345265821679617/widget.png?style=banner3)](https://discord.gg/XdJfN2X)

# Special Thanks To
[<img src="https://user-images.githubusercontent.com/21148213/121807008-8ffc6700-cc52-11eb-96a7-2f6f260f8fda.png" alt="" width="150">](https://www.jetbrains.com)

Jetbrains supports BedWars1058 with their [Open Source Licenses](https://www.jetbrains.com/opensource/).
2 changes: 1 addition & 1 deletion bedwars-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>BedWars1058</artifactId>
<groupId>com.andrei1058.bedwars</groupId>
<version>22.9-SNAPSHOT</version>
<version>23.10.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>bedwars-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
package com.andrei1058.bedwars.api.arena;

import com.andrei1058.bedwars.api.arena.generator.IGenerator;
import com.andrei1058.bedwars.api.arena.stats.GameStatsHolder;
import com.andrei1058.bedwars.api.arena.team.ITeam;
import com.andrei1058.bedwars.api.arena.team.ITeamAssigner;
import com.andrei1058.bedwars.api.configuration.ConfigManager;
Expand All @@ -34,14 +35,13 @@
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
import org.jetbrains.annotations.Nullable;

import java.time.Instant;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;

@SuppressWarnings("unused")
public interface IArena {

/**
Expand Down Expand Up @@ -264,13 +264,22 @@ public interface IArena {
* @param p Target player
* @param finalKills True if you want to get the Final Kills. False for regular kills.
*/
@Deprecated
int getPlayerKills(Player p, boolean finalKills);

/**
* Session stats.
* @return stats container for this game.
*/
@Nullable
GameStatsHolder getStatsHolder();

/**
* Get the player beds destroyed count
*
* @param p Target player
*/
@Deprecated
int getPlayerBedsDestroyed(Player p);

/**
Expand Down Expand Up @@ -318,11 +327,13 @@ default boolean isRespawning(Player p) {
/**
* Add a kill point to the game stats.
*/
@Deprecated
void addPlayerKill(Player p, boolean finalKill, Player victim);

/**
* Add a destroyed bed point to the player temp stats.
*/
@Deprecated
void addPlayerBedDestroyed(Player p);


Expand All @@ -343,6 +354,7 @@ default boolean isRespawning(Player p) {
/**
* Add a kill to the player temp stats.
*/
@Deprecated
void addPlayerDeath(Player p);

/**
Expand Down Expand Up @@ -392,6 +404,7 @@ default boolean isRespawning(Player p) {
/**
* Get player deaths.
*/
@Deprecated
int getPlayerDeaths(Player p, boolean finalDeaths);

/**
Expand Down Expand Up @@ -494,4 +507,33 @@ default boolean isRespawning(Player p) {
void setTeamAssigner(ITeamAssigner teamAssigner);

List<Player> getLeavingPlayers();


/**
* Check if breaking map is allowed, otherwise only placed blocks are allowed.
* Some blocks like have a special protections, like blocks under shopkeepers, bed, ecc.
*/
@SuppressWarnings("BooleanMethodIsAlwaysInverted")
boolean isAllowMapBreak();

/**
* Toggle map block break rule.
*/
void setAllowMapBreak(boolean allowMapBreak);

/**
* Check if there is a player bed at given location.
*/
boolean isTeamBed(Location location);

/**
* Get owner team of a bed based on location.
*/
@Nullable ITeam getBedsTeam(Location location);

/**
* Provides the winner team.
* This is populated on restarting phase.
*/
@Nullable ITeam getWinner();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.andrei1058.bedwars.api.arena.stats;

import org.jetbrains.annotations.NotNull;

@SuppressWarnings("SpellCheckingInspection")
public enum DefaultStatistics {

KILLS("kills", true),
KILLS_FINAL("finalKills", true),
DEATHS("deaths", true),
DEATHS_FINAL("finalDeaths", true),
BEDS_DESTROYED("bedsDestroyed", true);

private final String id;
private final boolean incrementable;
DefaultStatistics(String id, boolean incrementable) {
this.id = id;
this.incrementable = incrementable;
}

@Override
public @NotNull String toString() {
return id;
}

public boolean isIncrementable() {
return incrementable;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.andrei1058.bedwars.api.arena.stats;

import com.andrei1058.bedwars.api.language.Language;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/**
* Game statistic.
* @param <T> statistic type. We usually work with integers.
*/
public interface GameStatistic<T> extends Comparable<GameStatistic<T>> {

/**
* Current value.
*/
T getValue();

/**
* Value displayed in tops etc.
* @param language - message receiver.
*/
String getDisplayValue(@Nullable Language language);

/**
* Comparison for tops.
* @param o the object to be compared.
*/
int compareTo(@NotNull GameStatistic<T> o);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.andrei1058.bedwars.api.arena.stats;

import com.andrei1058.bedwars.api.language.Language;
import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.Nullable;

public interface GameStatisticProvider<T extends GameStatistic<?>> {

/**
* Unique statistic identifier.
*/
String getIdentifier();

/**
* Plugin provider.
* @return statistic owner.
*/
Plugin getOwner();

/**
* Default value used when initializing game stats.
*/
T getDefault();

/**
* Display value for undetermined values.
* @param language desired translation.
*/
String getVoidReplacement(@Nullable Language language);
}
Loading

0 comments on commit 22f1a36

Please sign in to comment.