updated ProjectStart to adjust coordinates, music, and glass material; refined player inventory handling logic; renamed vogelfrei to PVP in Outlawed messages for clarity
This commit is contained in:
@@ -51,14 +51,14 @@ public class Outlawed extends Appliance implements DisplayName.Prefixed {
|
||||
|
||||
void askForConfirmation(Player player) {
|
||||
Component confirmationMessage = switch(this.getLawStatus(player)) {
|
||||
case DISABLED -> Component.text("Wenn du Vogelfrei aktivierst, darfst du von allen anderen vogelfreien Spielern grundlos angegriffen werden.");
|
||||
case VOLUNTARILY -> Component.text("Wenn du Vogelfrei deaktivierst, darfst du nicht mehr grundlos von anderen Spielern angegriffen werden.");
|
||||
case FORCED -> Component.text("Du darfst zurzeit deinen Vogelfreistatus nicht ändern, da dieser als Strafe auferlegt wurde!");
|
||||
case DISABLED -> Component.text("Wenn du den PVP-Modus aktivierst, darfst du von allen anderen PVP-Spielern grundlos angegriffen werden.");
|
||||
case VOLUNTARILY -> Component.text("Wenn du den PVP-Modus deaktivierst, darfst du nicht mehr grundlos von anderen Spielern angegriffen werden.");
|
||||
case FORCED -> Component.text("Du darfst zurzeit deinen PVP-Modus nicht ändern, da dieser als Strafe auferlegt wurde!");
|
||||
};
|
||||
String command = String.format("/%s confirm", OutlawedCommand.commandName);
|
||||
Component changeText = Component.text(
|
||||
String.format(
|
||||
"Zum ändern deines Vogelfrei status klicke auf diese Nachricht oder tippe '%s'",
|
||||
"Zum ändern deines PVP-Status klicke auf diese Nachricht oder tippe '%s'",
|
||||
command
|
||||
),
|
||||
NamedTextColor.GOLD
|
||||
|
||||
@@ -22,6 +22,7 @@ import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
@@ -29,14 +30,14 @@ import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import static java.util.Map.entry;
|
||||
import static org.bukkit.Sound.MUSIC_DISC_PRECIPICE;
|
||||
import static org.bukkit.Sound.MUSIC_DISC_LAVA_CHICKEN;
|
||||
|
||||
public class ProjectStart extends Appliance {
|
||||
private final int startMusicAt = 293;
|
||||
private final int startMusicAt = 130;
|
||||
private final World startWorld = Bukkit.getWorld("world");
|
||||
private final Location glassLocation = new Location(this.startWorld, 0, 64, -300);
|
||||
private final Location glassLocation = new Location(this.startWorld, -363, 126, 613);
|
||||
private final List<Location> netherFireLocations = List.of(
|
||||
new Location(this.startWorld, 14, 71, -310)
|
||||
new Location(this.startWorld, -352, 131, 627)
|
||||
);
|
||||
|
||||
private final Countdown countdown = new Countdown(
|
||||
@@ -47,7 +48,7 @@ public class ProjectStart extends Appliance {
|
||||
);
|
||||
private final BlockCycle blockCycle = new BlockCycle(
|
||||
this.glassLocation,
|
||||
Material.RED_STAINED_GLASS,
|
||||
Material.WHITE_STAINED_GLASS,
|
||||
List.of(
|
||||
Material.RED_STAINED_GLASS,
|
||||
Material.YELLOW_STAINED_GLASS,
|
||||
@@ -77,7 +78,7 @@ public class ProjectStart extends Appliance {
|
||||
counter -> counter == this.startMusicAt,
|
||||
counter -> this.glassLocation
|
||||
.getWorld()
|
||||
.playSound(this.glassLocation, MUSIC_DISC_PRECIPICE, SoundCategory.RECORDS, 500f, 1f)
|
||||
.playSound(this.glassLocation, MUSIC_DISC_LAVA_CHICKEN, SoundCategory.RECORDS, 500f, 1f)
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -128,7 +129,13 @@ public class ProjectStart extends Appliance {
|
||||
Bukkit.getOnlinePlayers().forEach(player -> {
|
||||
player.setFoodLevel(20);
|
||||
player.setHealth(20);
|
||||
player.getInventory().clear();
|
||||
if(player.getInventory().contains(Material.RECOVERY_COMPASS)) {
|
||||
player.getInventory().clear();
|
||||
player.give(new ItemStack(Material.RECOVERY_COMPASS));
|
||||
} else {
|
||||
player.getInventory().clear();
|
||||
}
|
||||
|
||||
player.setGameMode(GameMode.SURVIVAL);
|
||||
player.setExp(0);
|
||||
player.setLevel(0);
|
||||
|
||||
Reference in New Issue
Block a user