Skip to content

Commit

Permalink
Release 23.12.1 (#944)
Browse files Browse the repository at this point in the history
* fix bStats tracked id

* remove scoreboard numbers, replace with team status when applicable on 1.20.3 scoreboard

* fix default blast protection from fireballs on 1.8.8 (#937)

* add deprecation notice for 1.8.8, 1.17.1, 1.19.1 and 1.20 (#939)

* fix metric tracking

* add 1.20.3 support
  • Loading branch information
andrei1058 authored Dec 7, 2023
1 parent dbd8382 commit 91e6a76
Show file tree
Hide file tree
Showing 52 changed files with 1,253 additions and 44 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/compile_snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ on:
jobs:
build:
runs-on: ubuntu-latest
environment:
name: development
url: https://repo.andrei1058.dev
# environment:
# name: development
# url: https://repo.andrei1058.dev
steps:
- uses: actions/checkout@v3
- name: Set up JDK
Expand All @@ -32,4 +32,4 @@ jobs:
mvn versions:set -DnewVersion=$UPDATE_VERSION-SNAPSHOT
mvn versions:update-child-modules
mvn clean install -s ci_settings.xml
echo "UPDATE_VERSION=$UPDATE_VERSION" >> $GITHUB_ENV
echo "UPDATE_VERSION=$UPDATE_VERSION" >> $GITHUB_ENV
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
environment:
name: production
url: https://repo.andrei1058.com
url: https://repo.andrei1058.dev
steps:
- uses: actions/checkout@v3
- name: Set up JDK
Expand Down Expand Up @@ -44,4 +44,4 @@ jobs:
with:
generate_release_notes: true
name: ${{env.UPDATE_VERSION}}
tag_name: ${{env.UPDATE_VERSION}}
tag_name: ${{env.UPDATE_VERSION}}
3 changes: 1 addition & 2 deletions .github/workflows/deploy_snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- develop

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -30,4 +29,4 @@ jobs:
mvn versions:set -DnewVersion=$UPDATE_VERSION-SNAPSHOT
mvn versions:update-child-modules
mvn clean deploy -s ci_settings.xml
echo "UPDATE_VERSION=$UPDATE_VERSION" >> $GITHUB_ENV
echo "UPDATE_VERSION=$UPDATE_VERSION" >> $GITHUB_ENV
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>23.10.1-SNAPSHOT</version>
<version>23.12.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>bedwars-api</artifactId>
Expand Down
33 changes: 22 additions & 11 deletions bedwars-plugin/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>23.10.1-SNAPSHOT</version>
<version>23.12.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>bedwars-plugin</artifactId>
Expand Down Expand Up @@ -192,6 +192,11 @@
<artifactId>versionsupport_v1_20_R2</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.andrei1058.bedwars</groupId>
<artifactId>versionsupport_v1_20_R3</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.andrei1058.bedwars</groupId>
<artifactId>versionsupport-common</artifactId>
Expand Down Expand Up @@ -247,61 +252,67 @@
<dependency>
<groupId>com.andrei1058.spigot.sidebar</groupId>
<artifactId>sidebar-base</artifactId>
<version>23.10</version>
<version>23.12.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.andrei1058.spigot.sidebar</groupId>
<artifactId>sidebar-v1_8_R3</artifactId>
<version>23.10</version>
<version>23.12</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.andrei1058.spigot.sidebar</groupId>
<artifactId>sidebar-v1_12_R1</artifactId>
<version>23.10</version>
<version>23.12</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.andrei1058.spigot.sidebar</groupId>
<artifactId>sidebar-v1_16_R1</artifactId>
<version>23.10</version>
<version>23.12</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.andrei1058.spigot.sidebar</groupId>
<artifactId>sidebar-v1_17_R1</artifactId>
<version>23.10</version>
<version>23.12</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.andrei1058.spigot.sidebar</groupId>
<artifactId>sidebar-v1_18_R2</artifactId>
<version>23.10</version>
<version>23.12</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.andrei1058.spigot.sidebar</groupId>
<artifactId>sidebar-v1_19_R2</artifactId>
<version>23.10</version>
<version>23.12</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.andrei1058.spigot.sidebar</groupId>
<artifactId>sidebar-v1_19_R3</artifactId>
<version>23.10</version>
<version>23.12</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.andrei1058.spigot.sidebar</groupId>
<artifactId>sidebar-v1_20_R1</artifactId>
<version>23.10</version>
<version>23.12</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.andrei1058.spigot.sidebar</groupId>
<artifactId>sidebar-v1_20_R2</artifactId>
<version>23.10</version>
<version>23.12</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.andrei1058.spigot.sidebar</groupId>
<artifactId>sidebar-v1_20_R3</artifactId>
<version>23.12.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<!-- End of Sidebar LIB-->
Expand Down
12 changes: 12 additions & 0 deletions bedwars-plugin/src/main/java/com/andrei1058/bedwars/BedWars.java
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,9 @@ public void onEnable() {

// TNT Spoil Feature
SpoilPlayerTNTFeature.init();

// Warn user if current server version support is deprecated
this.performDeprecationCheck();
}

/**
Expand Down Expand Up @@ -753,6 +756,15 @@ public static void setParty(Party party) {
BedWars.party = party;
}

public void performDeprecationCheck() {
Bukkit.getScheduler().runTaskAsynchronously(this, () -> {
if (Arrays.stream(nms.getClass().getAnnotations()).anyMatch(annotation -> annotation instanceof Deprecated)) {
this.getLogger().warning("Support for "+getServerVersion()+" is scheduled for removal. " +
"Please consider upgrading your server software to a newer Minecraft version.");
}
});
}

@Override
public ChunkGenerator getDefaultWorldGenerator(String worldName, String id) {
return new VoidChunkGenerator();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ public MainConfig(Plugin plugin, String name) {
yml.addDefault(ConfigPath.GENERAL_TNT_JUMP_DAMAGE_OTHERS, 10);

// tnd block blast resistance
yml.addDefault(ConfigPath.GENERAL_TNT_PROTECTION_END_STONE_BLAST, 12f);
// on 1.8.8 it has to be around 69, on 1.20 and 1.18 it works fine with 12 (tested)
yml.addDefault(ConfigPath.GENERAL_TNT_PROTECTION_END_STONE_BLAST, BedWars.nms.getVersion() == 0 ? 69f : 12f);
yml.addDefault(ConfigPath.GENERAL_TNT_PROTECTION_GLASS_BLAST, 300f);
yml.addDefault(ConfigPath.GENERAL_TNT_RAY_BLOCKED_BY_GLASS, true);

Expand Down Expand Up @@ -382,6 +383,7 @@ public MainConfig(Plugin plugin, String name) {
try {
Bukkit.spigot().getConfig().save("spigot.yml");
} catch (IOException e) {
//noinspection CallToPrintStackTrace
e.printStackTrace();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ public SidebarLine normalizeTitle(@Nullable List<String> titleArray) {
for (String line : lineArray) {
// convert old placeholders
line = line.replace("{server_ip}", "{serverIp}");
String scoreLine = null;

// generic team placeholder {team}
if (null != arena) {
Expand All @@ -148,9 +149,14 @@ public SidebarLine normalizeTitle(@Nullable List<String> titleArray) {
line = genericTeamFormat
.replace("{TeamLetter}", teamLetter)
.replace("{TeamColor}", team.getColor().chat().toString())
.replace("{TeamName}", teamName)
.replace("{TeamStatus}", "{Team" + team.getName() + "Status}");
.replace("{TeamName}", teamName);

if (line.contains("{TeamStatus}") && getAPI().getVersionSupport().getVersion() >= 10) {
line = line.replace("{TeamStatus}", "");
scoreLine = "{Team" + team.getName() + "Status}";
} else {
line = line.replace("{TeamStatus}", "{Team" + team.getName() + "Status}");
}
} else {
// skip line
continue;
Expand Down Expand Up @@ -223,12 +229,7 @@ public SidebarLine normalizeTitle(@Nullable List<String> titleArray) {
if (divided.length > 1) {
sidebarLine = normalizeTitle(Arrays.asList(divided));
} else {
sidebarLine = new SidebarLine() {
@Override
public @NotNull String getLine() {
return finalTemp;
}
};
sidebarLine = new BwSidebarLine(finalTemp, scoreLine);
}

lines.add(sidebarLine);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.andrei1058.bedwars.sidebar;

import com.andrei1058.spigot.sidebar.ScoredLine;
import com.andrei1058.spigot.sidebar.SidebarLine;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public class BwSidebarLine extends SidebarLine implements ScoredLine {

public final String content;
public final String score;

public BwSidebarLine(String content, @Nullable String score) {
this.content = content;
this.score = score == null ? "" : score;
}
@Override
public String getScore() {
return score;
}

@Override
public @NotNull String getLine() {
return content;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static boolean init(JavaPlugin plugin) {
}
Bukkit.getScheduler().runTaskTimer(plugin, new RefreshPlaceholdersTask(), 1L, placeholdersRefreshInterval);
}
MetricsManager.appendPie("sb_placeholder_refresh_interval", () -> String.valueOf(playerListRefreshInterval));
MetricsManager.appendPie("sb_placeholder_refresh_interval", () -> String.valueOf(placeholdersRefreshInterval));

int titleRefreshInterval = config.getInt(ConfigPath.SB_CONFIG_SIDEBAR_TITLE_REFRESH_INTERVAL);
if (titleRefreshInterval < 1) {
Expand Down
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>com.andrei1058.bedwars</groupId>
<artifactId>BedWars1058</artifactId>
<packaging>pom</packaging>
<version>23.10.1-SNAPSHOT</version>
<version>23.12.1-SNAPSHOT</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down Expand Up @@ -113,6 +113,7 @@
<module>versionsupport_v1_19_R3</module>
<module>versionsupport_v1_20_R1</module>
<module>versionsupport_v1_20_R2</module>
<module>versionsupport_v1_20_R3</module>
</modules>

<distributionManagement>
Expand Down
2 changes: 1 addition & 1 deletion resetadapter_aswm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<artifactId>BedWars1058</artifactId>
<groupId>com.andrei1058.bedwars</groupId>
<version>23.10.1-SNAPSHOT</version>
<version>23.12.1-SNAPSHOT</version>
</parent>

<artifactId>resetadapter-aswm</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion resetadapter_slime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<artifactId>BedWars1058</artifactId>
<groupId>com.andrei1058.bedwars</groupId>
<version>23.10.1-SNAPSHOT</version>
<version>23.12.1-SNAPSHOT</version>
</parent>

<artifactId>resetadapter-slime</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion resetadapter_slimepaper/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<artifactId>BedWars1058</artifactId>
<groupId>com.andrei1058.bedwars</groupId>
<version>23.10.1-SNAPSHOT</version>
<version>23.12.1-SNAPSHOT</version>
</parent>

<artifactId>resetadapter-slimepaper</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion versionsupport_1_12_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<artifactId>BedWars1058</artifactId>
<groupId>com.andrei1058.bedwars</groupId>
<version>23.10.1-SNAPSHOT</version>
<version>23.12.1-SNAPSHOT</version>
</parent>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion versionsupport_1_8_R3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<artifactId>BedWars1058</artifactId>
<groupId>com.andrei1058.bedwars</groupId>
<version>23.10.1-SNAPSHOT</version>
<version>23.12.1-SNAPSHOT</version>
</parent>

<artifactId>versionsupport_1_8_R3</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import java.lang.reflect.Field;

@SuppressWarnings("ALL")
@Deprecated
public class IGolem extends EntityIronGolem {

private ITeam team;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import java.lang.reflect.Field;

@SuppressWarnings("ALL")
@Deprecated
public class Silverfish extends EntitySilverfish {

private ITeam team;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@

import static com.andrei1058.bedwars.api.language.Language.getMsg;

@Deprecated(forRemoval = true)
@SuppressWarnings("unused")
public class v1_8_R3 extends VersionSupport {

Expand Down
2 changes: 1 addition & 1 deletion versionsupport_common/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>23.10.1-SNAPSHOT</version>
<version>23.12.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion versionsupport_v1_16_R3/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>23.10.1-SNAPSHOT</version>
<version>23.12.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion versionsupport_v1_17_R1/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>23.10.1-SNAPSHOT</version>
<version>23.12.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import java.util.Objects;

@SuppressWarnings("unchecked")
@Deprecated
public class IGolem extends EntityIronGolem {
private ITeam team;

Expand Down
Loading

0 comments on commit 91e6a76

Please sign in to comment.