Merge branch 'master' into master-big-events
This commit is contained in:
@@ -19,7 +19,7 @@ public class BloodmoonSetting extends BoolSetting implements CategorizedSetting
|
||||
|
||||
@Override
|
||||
public SettingCategory category() {
|
||||
return SettingCategory.Misc; // TODO: mehr als 8 bug fixen
|
||||
return SettingCategory.Gameplay;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -51,14 +51,15 @@ 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." +
|
||||
" Du kannst den PVP-Modus erst wieder nach " + this.timeoutInMs / 1000 / 60 / 60 + " Stunden deaktivieren!");
|
||||
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 die˝ser 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
|
||||
|
||||
@@ -2,6 +2,7 @@ package eu.mhsl.craftattack.spawn.craftattack.appliances.metaGameplay.event;
|
||||
|
||||
import eu.mhsl.craftattack.spawn.core.Main;
|
||||
import eu.mhsl.craftattack.spawn.core.api.client.ReqResp;
|
||||
import eu.mhsl.craftattack.spawn.core.util.server.Floodgate;
|
||||
import eu.mhsl.craftattack.spawn.craftattack.api.repositories.EventRepository;
|
||||
import eu.mhsl.craftattack.spawn.core.api.server.HttpServer;
|
||||
import eu.mhsl.craftattack.spawn.core.appliance.Appliance;
|
||||
@@ -26,6 +27,7 @@ import org.bukkit.entity.Villager;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.geysermc.cumulus.form.SimpleForm;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.*;
|
||||
@@ -106,6 +108,10 @@ public class Event extends Appliance {
|
||||
}
|
||||
|
||||
public void joinEvent(Player p) {
|
||||
this.joinEvent(p, false);
|
||||
}
|
||||
|
||||
public void joinEvent(Player p, boolean ignoreBedrock) {
|
||||
if(!this.isOpen) {
|
||||
p.sendMessage(Component.text("Zurzeit ist kein Event geöffnet.", NamedTextColor.RED));
|
||||
return;
|
||||
@@ -121,6 +127,23 @@ public class Event extends Appliance {
|
||||
return;
|
||||
}
|
||||
|
||||
if(!ignoreBedrock && Floodgate.isBedrock(p)) {
|
||||
Floodgate.getBedrockPlayer(p).sendForm(
|
||||
SimpleForm.builder()
|
||||
.title("Achtung!")
|
||||
.content("Je nach deiner Minecraft-Bedrock-Version kann dein Minecraft in den Events abstürzen. " +
|
||||
"Ggf. ist also für dich ein Mitspielen auf der Bedrock-Edition nicht möglich.")
|
||||
.button("Ok, lass es uns versuchen")
|
||||
.button("Abbrechen")
|
||||
.validResultHandler(simpleFormResponse -> {
|
||||
if(simpleFormResponse.clickedButtonId() != 0) return;
|
||||
this.joinEvent(p, true);
|
||||
})
|
||||
.build()
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
Main.instance().getLogger().info("Verbinde mit eventserver: " + p.getName());
|
||||
p.sendMessage(Component.text("Authentifiziere...", NamedTextColor.GREEN));
|
||||
|
||||
|
||||
@@ -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