Add lobby/game worlds, void generator, dbd reload, and fix plugin loading
- Add VoidWorldGenerator for empty void worlds - Add LobbyManager with auto-creation of lobby world (stone platform 7x7, built once) and game world - Add /dbd reload command to reload all configs at runtime - Add plugin.yml for proper command registration, remove paper-plugin.yml - Fix mdbdBootstrap/mdbdLoader public constructors (Paper requirement) - Fix command registration (getCommand null on Paper plugin system)
This commit is contained in:
parent
76e0c1e167
commit
34e0aebd5d
27 changed files with 767 additions and 85 deletions
|
|
@ -1,12 +1,16 @@
|
|||
package dev.loki.objective;
|
||||
|
||||
import dev.loki.data.GeneratorDataManager;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class Generator {
|
||||
private final int id;
|
||||
private final Location location;
|
||||
private final double zoneRadius;
|
||||
private double progress;
|
||||
private boolean isCompleted;
|
||||
private boolean isBlocked;
|
||||
|
|
@ -15,8 +19,13 @@ public class Generator {
|
|||
private boolean wasKicked;
|
||||
|
||||
public Generator(int id, Location location) {
|
||||
this(id, location, GeneratorDataManager.getZoneRadius());
|
||||
}
|
||||
|
||||
public Generator(int id, Location location, double zoneRadius) {
|
||||
this.id = id;
|
||||
this.location = location;
|
||||
this.zoneRadius = zoneRadius;
|
||||
this.progress = 0.0;
|
||||
this.isCompleted = false;
|
||||
this.isBlocked = false;
|
||||
|
|
@ -33,6 +42,20 @@ public class Generator {
|
|||
return location;
|
||||
}
|
||||
|
||||
public double getZoneRadius() {
|
||||
return zoneRadius;
|
||||
}
|
||||
|
||||
public boolean isPlayerInZone(Player player) {
|
||||
if (!player.getWorld().equals(location.getWorld())) return false;
|
||||
return player.getLocation().distance(location) <= zoneRadius;
|
||||
}
|
||||
|
||||
public boolean isLocationInZone(Location loc) {
|
||||
if (!loc.getWorld().equals(location.getWorld())) return false;
|
||||
return loc.distance(location) <= zoneRadius;
|
||||
}
|
||||
|
||||
public double getProgress() {
|
||||
return progress;
|
||||
}
|
||||
|
|
@ -107,6 +130,7 @@ public class Generator {
|
|||
return !isCompleted && !isBlocked;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public Block getBlock() {
|
||||
return location.getBlock();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue