Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
87d3871
Whitespaces removed
parar020100 Mar 8, 2026
2dd6089
Added toggle for campfire types
parar020100 Mar 8, 2026
9492af8
Gitignore added
parar020100 Mar 8, 2026
125cb8a
Version tweak
parar020100 Mar 8, 2026
9c8f427
small fix
parar020100 Mar 8, 2026
85e9d72
Removed checks for extinguish or remove
parar020100 Mar 8, 2026
41d657f
Min_distance parameter split
parar020100 Mar 8, 2026
28bfd59
Different radius for soul campfires
parar020100 Mar 9, 2026
2bfcf6d
Forbid overrides
parar020100 Mar 9, 2026
44835f7
Better compile
parar020100 Mar 9, 2026
8baca6a
Fix: allow disabling override
parar020100 Mar 9, 2026
a158676
Remove all nearby checkpoints during override
parar020100 Mar 9, 2026
d9c1c1b
Per-dimention toggle
parar020100 Mar 9, 2026
e0a6759
Validate checkpoints: track campfire states made without player
parar020100 Mar 9, 2026
74fa93e
Version tweak
parar020100 Mar 9, 2026
a6ed4c5
Better list output
parar020100 Mar 13, 2026
f8feed3
Validate all checkpoints more often & notifications
parar020100 Mar 13, 2026
677afda
Empty hand or sneak required
parar020100 Mar 13, 2026
a158e3f
Setting disables the delete command
parar020100 Mar 13, 2026
c32e003
Started work on respawn anchors
parar020100 Mar 13, 2026
ee35e15
Config for respawn anchors
parar020100 Mar 13, 2026
25c66e3
"anchor" type of checkpoint class
parar020100 Mar 13, 2026
167cd7f
Anchors in list
parar020100 Mar 13, 2026
ae2087c
Anchor status in lisst
parar020100 Mar 13, 2026
c1322a7
Anchor top priority
parar020100 Mar 13, 2026
ad6097a
Compilation fix
parar020100 Mar 13, 2026
ac4bc57
Radius check fix for anchors
parar020100 Mar 13, 2026
904d41d
Anchors functionality
parar020100 Mar 13, 2026
23a3b66
Play sounds
parar020100 Mar 13, 2026
6ba6db3
Code alignment and default overworld / end behavior
parar020100 Mar 13, 2026
abd15a4
Proper sounds
parar020100 Mar 13, 2026
c651327
Fixes
parar020100 Mar 13, 2026
5829f24
findAnchorCheckpoint
parar020100 Mar 13, 2026
204986f
Proper respawn location selection with anchors
parar020100 Mar 13, 2026
821ada0
Small fix
parar020100 Mar 13, 2026
9e55b89
Better removeAnchorCheckpoints function
parar020100 Mar 13, 2026
0239c94
Bed resets spawn anchors
parar020100 Mar 13, 2026
daa0efc
Ignore unlit anchors
parar020100 Mar 13, 2026
aef2059
Anchors destroyed message
parar020100 Mar 13, 2026
64e5909
Better messages
parar020100 Mar 13, 2026
7918da9
Comment fix
parar020100 Mar 14, 2026
dae5956
No override anchors
parar020100 Mar 14, 2026
788751f
Fixed anchors always within radius
parar020100 Mar 14, 2026
47f2df1
Some NULL fixes
parar020100 Mar 14, 2026
5a4e4df
Fixed and improved selection of respawn place
parar020100 Mar 14, 2026
47a0a1b
Respawn sound
parar020100 Mar 14, 2026
0cbaef5
Fixed respawn anchors old behaviour with glowstone in nether
parar020100 Mar 14, 2026
692c8c1
Fixed block placing with anchor
parar020100 Mar 14, 2026
ae3ad36
Version tweak
parar020100 Mar 14, 2026
7706c7f
Config fix
parar020100 Mar 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/.idea/
/.vscode/
*.iml
*.ipr
*.iws

/target/
/logs/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties

*.tmp
*.bak
*.swp
*~.nib
*.orig

.DS_Store
Thumbs.db

/settings/
*.prefs

!target/*.jar
target/*.jar.*

/.mvn/
mvnw
mvnw.cmd

/server/
/run/
/plugins/
/world*/
/logs/
*.log

.build_number
20 changes: 20 additions & 0 deletions compile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#! /bin/bash

#CURRENT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
#NEW_VERSION=$(echo $CURRENT_VERSION | perl -pe 's/(parar-test)(\d+)/$1.($2+1)/ge')
#mvn versions:set -DnewVersion=$NEW_VERSION

NUMBER_FILE=".build_number"

if [ -f "$NUMBER_FILE" ]; then
test_number=$(cat $NUMBER_FILE)
else
test_number=1
fi

mvn package -Dbuild_name="-test$test_number"


if [ $? -eq 0 ]; then
echo $((test_number + 1)) > $NUMBER_FILE
fi
22 changes: 9 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<groupId>com.campfirecheckpoints</groupId>
<artifactId>CampfireCheckpoints</artifactId>
<version>1.1.0</version>
<version>1.2.0</version>
<packaging>jar</packaging>

<name>CampfireCheckpoints</name>
Expand All @@ -17,6 +17,7 @@
<properties>
<java.version>21</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<build_name></build_name> <!-- Empty by default -->
</properties>

<repositories>
Expand Down Expand Up @@ -49,6 +50,13 @@

<build>
<plugins>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<finalName>${project.artifactId}-${project.version}${build_name}</finalName>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
Expand All @@ -61,18 +69,6 @@
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,34 +36,44 @@ public CheckpointCommand(@NotNull CampfireCheckpoints plugin) {
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command,
@NotNull String label, @NotNull String[] args) {

if (!(sender instanceof Player player)) {
sender.sendMessage("This command can only be used by players.");
return true;
}

ConfigManager configManager = plugin.getConfigManager();

if (args.length == 0) {
showHelp(player);
showHelp(player, configManager);
return true;
}

String subCommand = args[0].toLowerCase();

switch (subCommand) {
case "list" -> handleList(player);
case "delete" -> handleDelete(player, args);
case "delete" -> {
if (configManager.isDeleteCommandAllowed()) {
handleDelete(player, args);
} else {
MessageUtil.send(player, "&cThe delete command is disabled by the server configuration.");
}
}
case "reload" -> handleReload(player);
case "info" -> handleInfo(player);
default -> showHelp(player);
default -> showHelp(player, configManager);
}

return true;
}

private void showHelp(@NotNull Player player) {
private void showHelp(@NotNull Player player, ConfigManager configManager) {
MessageUtil.send(player, "&6&l=== Campfire Checkpoints ===");
MessageUtil.send(player, "&e/cc list &7- List your checkpoints");
MessageUtil.send(player, "&e/cc delete <index> &7- Delete a checkpoint");
if (configManager.isDeleteCommandAllowed()) {
MessageUtil.send(player, "&e/cc delete <index> &7- Delete a checkpoint");
}
MessageUtil.send(player, "&e/cc info &7- Show plugin info");
if (player.hasPermission("campfirecheckpoints.reload")) {
MessageUtil.send(player, "&e/cc reload &7- Reload configuration");
Expand All @@ -81,6 +91,8 @@ private void handleList(@NotNull Player player) {
CheckpointManager manager = plugin.getCheckpointManager();
List<Checkpoint> checkpoints = manager.getPlayerCheckpoints(player.getUniqueId());

manager.validateAllCheckpoints(player.getUniqueId());

if (checkpoints.isEmpty()) {
MessageUtil.send(player, "&eYou have no checkpoints set.");
MessageUtil.send(player, "&7Right-click a lit campfire to set one!");
Expand All @@ -92,24 +104,34 @@ private void handleList(@NotNull Player player) {
String limitDisplay = max > 0 ? " &7(" + checkpoints.size() + "/" + max + ")" : "";

MessageUtil.send(player, "&6&l=== Your Checkpoints ===" + limitDisplay);

for (int i = 0; i < checkpoints.size(); i++) {
Checkpoint cp = checkpoints.get(i);
Location loc = cp.getBlockLocation();
String status = cp.isLit() ? "&a✓ Lit" : "&c✗ Extinguished";

String status = cp.isLit() ? "&a✓ Lit" : "&c✗ Put out";
String coords = loc != null ?
String.format("&f%d, %d, %d", loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()) :
"&cUnknown";
String world = cp.getWorldName();
String world = cp.getWorldName().replace("world_", "");
String date = dateFormat.format(new Date(cp.getCreatedAt()));

MessageUtil.send(player, "&e[" + i + "] " + status + " &7| " + coords +
String type = "";
if (cp.isSoul()) {
type += " &9(soul)";
} else if (cp.isAnchor()) {
type += " &d(anchor)";
status = cp.isLit() ? "&a✓ Charged" : "&c✗ Disabled";
}

MessageUtil.send(player, "&e[" + i + "] " + status + type + " &7| " + coords +
" &7(" + world + ")");
MessageUtil.send(player, " &7Created: " + date);
}

MessageUtil.send(player, "&7Use &e/cc delete <index> &7to remove a checkpoint.");
if (plugin.getConfigManager().isDeleteCommandAllowed()) {
MessageUtil.send(player, "&7Use &e/cc delete <index> &7to remove a checkpoint.");
}
}

private void handleDelete(@NotNull Player player, @NotNull String[] args) {
Expand Down Expand Up @@ -171,7 +193,7 @@ private void handleReload(@NotNull Player player) {
private void handleInfo(@NotNull Player player) {
CheckpointManager manager = plugin.getCheckpointManager();
ConfigManager configManager = plugin.getConfigManager();

int playerCount = manager.getPlayerCheckpoints(player.getUniqueId()).size();
int totalCount = manager.getTotalCheckpointCount();
int max = configManager.getMaxCheckpointsPerPlayer();
Expand All @@ -182,7 +204,25 @@ private void handleInfo(@NotNull Player player) {
MessageUtil.send(player, "&eYour Checkpoints: &f" + playerCount +
(max > 0 ? " / " + max : ""));
MessageUtil.send(player, "&eTotal Checkpoints: &f" + totalCount);
MessageUtil.send(player, "&eRadius: &f" + configManager.getRadius() + " blocks");

MessageUtil.send(player, "&eRegular campfires enabled (overworld): &f" + configManager.isDimentionEnabledOverworld());
MessageUtil.send(player, "&eRegular campfires enabled (nether): &f" + configManager.isDimentionEnabledNether());
MessageUtil.send(player, "&eRegular campfires enabled (the end): &f" + configManager.isDimentionEnabledEnd());

MessageUtil.send(player, "&eSoul campfires enabled (overworld): &f" + configManager.isDimentionEnabledOverworldSoul());
MessageUtil.send(player, "&eSoul campfires enabled (nether): &f" + configManager.isDimentionEnabledNetherSoul());
MessageUtil.send(player, "&eSoul campfires enabled (the end): &f" + configManager.isDimentionEnabledEndSoul());

MessageUtil.send(player, "&eRespawn anchors enabled (overworld): &f" + configManager.isDimentionEnabledOverworldAnchor());
MessageUtil.send(player, "&eRespawn anchors enabled (nether): &f" + configManager.isDimentionEnabledNetherAnchor());
MessageUtil.send(player, "&eRespawn anchors enabled (the end): &f" + configManager.isDimentionEnabledEndAnchor());

MessageUtil.send(player, "&eRadius (regular campfires): &f" + configManager.getRadius() + " blocks");
MessageUtil.send(player, "&eRadius (soul campfires): &f" + configManager.getSoulRadius() + " blocks");

MessageUtil.send(player, "&eMin. distance between checkpoints: &f" + configManager.getMinDistance() + " blocks");
MessageUtil.send(player, "&eMin. distance between checkpoints (soul): &f" + configManager.getSoulMinDistance() + " blocks");

MessageUtil.send(player, "&eExtinguish on Respawn: &f" + configManager.isExtinguishOnRespawn());
MessageUtil.send(player, "&eConfirmation Timeout: &f" +
configManager.getOverrideConfirmationTimeout() + "s");
Expand All @@ -199,8 +239,13 @@ private void handleInfo(@NotNull Player player) {
return null;
}

ConfigManager configManager = plugin.getConfigManager();

if (args.length == 1) {
List<String> completions = new ArrayList<>(Arrays.asList("list", "delete", "info"));
List<String> completions = new ArrayList<>(List.of("list", "info"));
if (configManager.isDeleteCommandAllowed()) {
completions.add("delete");
}
if (player.hasPermission("campfirecheckpoints.reload")) {
completions.add("reload");
}
Expand All @@ -209,10 +254,10 @@ private void handleInfo(@NotNull Player player) {
.collect(Collectors.toList());
}

if (args.length == 2 && args[0].equalsIgnoreCase("delete")) {
if (args.length == 2 && args[0].equalsIgnoreCase("delete") && configManager.isDeleteCommandAllowed()) {
int checkpointCount = plugin.getCheckpointManager()
.getPlayerCheckpoints(player.getUniqueId()).size();

return IntStream.range(0, checkpointCount)
.mapToObj(String::valueOf)
.filter(s -> s.startsWith(args[1]))
Expand Down
Loading