halted Changelog Screen refactor

This commit is contained in:
2025-12-02 20:39:39 +01:00
parent 59611ac1d1
commit 95dd560779
5 changed files with 45 additions and 10 deletions

View File

@@ -6,7 +6,7 @@
<groupId>de.steev.bm</groupId> <groupId>de.steev.bm</groupId>
<artifactId>BetterMinecraft</artifactId> <artifactId>BetterMinecraft</artifactId>
<version>stable</version> <version>1.2.2</version>
<properties> <properties>
<maven.compiler.source>17</maven.compiler.source> <maven.compiler.source>17</maven.compiler.source>
@@ -25,7 +25,7 @@
<dependency> <dependency>
<groupId>org.spigotmc</groupId> <groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId> <artifactId>spigot-api</artifactId>
<version>1.20.1-R0.1-SNAPSHOT</version> <version>1.21.1-R0.1-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@@ -63,10 +63,9 @@ public class BetterMinecraft extends JavaPlugin implements Listener {
UUID uuid = p.getUniqueId(); UUID uuid = p.getUniqueId();
try { try {
// prevent this allways resetting the job count
if (this.playerData.readBooleanFromConfig(uuid + "." + Version + ".read")) { if (this.playerData.readBooleanFromConfig(uuid + "." + Version + ".read")) {
p.sendMessage("================= Better Minecraft " + Version + " ================="); p.sendMessage("================= Better Minecraft " + Version + " =================");
p.sendMessage("Command: /back eingefügt"); p.sendMessage("Amboss Kostengrenze entfernt");
p.sendMessage("====================================================="); p.sendMessage("=====================================================");
this.playerData.writeStringToConfig(uuid + ".name", p.getName()); this.playerData.writeStringToConfig(uuid + ".name", p.getName());

View File

@@ -3,6 +3,11 @@ package de.steev.bm.utils;
import de.steev.bm.Manager.GameManager; import de.steev.bm.Manager.GameManager;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
enum ChangelogType {
SystemChangeLog,
CustomChangelog
}
public class Changelog { public class Changelog {
private GameManager plugin; private GameManager plugin;
@@ -15,15 +20,18 @@ public class Changelog {
* @param player the receiving player * @param player the receiving player
*/ */
public void SendChangelog(Player player) { public void SendChangelog(Player player) {
player.sendMessage(createChangelog()); //player.sendMessage(createChangelog());
} }
/** /**
* handles checking the playerdata if a player already saw the changelog * handles checking the playerdata if a player already saw the changelog
* @param player the player to lookup * @param player the player to lookup
* @return boolean which tells whether or not a player has seen the changelog * @return boolean which tells whether a player has seen the changelog or not
*/ */
private boolean hasPlayerSeenChangelog(Player player) { private boolean hasPlayerSeenChangelog(ChangelogType changelogType, Player player) {
// TODO: read from header what version the changelog is for
// TODO: read from playerdata.yml if the player has seen the changelog for that type
// TODO: return found result
return false; return false;
} }
@@ -31,7 +39,22 @@ public class Changelog {
* reads the set changlog file * reads the set changlog file
* @return the resulting changelog as string * @return the resulting changelog as string
*/ */
private String createChangelog() { private String createChangelog(ChangelogType changelogType) {
// TODO: FETCH from
/*switch (changelogType) {
case SystemChangeLog:
// TODO: get changelog url from config
// TODO: fetch version changelog from git
// TODO: proccess changelog
break;
case CustomChangelog:
// TODO: fetch changes from changes.txt found in plugin folder or from configured destination
// TODO: proccess changelog
break;
}*/
return ""; return "";
} }
} }

View File

@@ -0,0 +1,13 @@
# changelog
system_changelog: true
system_changelog_location: https://git.slpnetwork.de/Steev/betterminecraft/src/branch/main/changelog.txt
custom_changelog: true
custom_changelog_location: custom_changelog.txt
# features
changelog: true # if this is toggled the whole changelog system is enabled or disabled
improved_bed: true # toggles whether the night should be skipped when half the server players sleep
custom_drops: false # toggles if custom drops should be enabled
custom_recipes: false # toggles if custom recipes should be enabled
replanting: true # toggles the right click replant feature
back_command: true # toggles the back to death point feature

View File

@@ -1,7 +1,7 @@
name: BetterMinecraft name: BetterMinecraft
main: de.steev.bm.BetterMinecraft main: de.steev.bm.BetterMinecraft
version: 1.0 version: 1.2.2
api-version: 1.17 api-version: 1.21
commands: commands:
back: back:
description: "teleports players back to their deathpoint" description: "teleports players back to their deathpoint"