1
0
Fork 0

Game Jam Release

This commit is contained in:
Andus 2024-08-15 10:50:37 +02:00
parent a5c9aea14f
commit cdc73cc230
4 changed files with 25 additions and 11 deletions

1
.idea/.name generated Normal file
View file

@ -0,0 +1 @@
SpectrumSurvival

View file

@ -1,2 +1,2 @@
rootProject.name = "MinestomGameJam"
rootProject.name = "SpectrumSurvival"

View file

@ -13,6 +13,7 @@ import net.kyori.adventure.text.format.NamedTextColor;
import net.minestom.server.MinecraftServer;
import net.minestom.server.adventure.audience.Audiences;
import net.minestom.server.command.CommandManager;
import net.minestom.server.extras.bungee.BungeeCordProxy;
import net.minestom.server.timer.TaskSchedule;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -46,6 +47,7 @@ public class Server {
MinecraftServer.getBlockManager().registerHandler("minecraft:spruce_wall_sign", SignHandler::new);
// Server Start
BungeeCordProxy.enable();
server.start(Settings.getIP(), Settings.getPort());
logger.info("Server Started at " + Settings.getIP() + ":" + Settings.getPort() + " (MC: " + MinecraftServer.VERSION_NAME + ")");
}
@ -74,16 +76,22 @@ public class Server {
public static NamedTextColor randomMadeByColor() {
Random random = new Random();
int num = random.nextInt(4);
if (num == 0) {
return NamedTextColor.BLUE;
} else if (num == 1) {
return NamedTextColor.GRAY;
} else if (num == 2) {
return NamedTextColor.GOLD;
} else if (num == 3) {
return NamedTextColor.GREEN;
} else {
return NamedTextColor.BLUE;
switch (num) {
case 0 -> {
return NamedTextColor.BLUE;
}
case 1 -> {
return NamedTextColor.GRAY;
}
case 2 -> {
return NamedTextColor.GOLD;
}
case 3 -> {
return NamedTextColor.GREEN;
}
default -> {
return NamedTextColor.RED;
}
}
}
}

View file

@ -39,5 +39,10 @@ public class AboutCommand extends Command {
}
}
}), ArgumentType.String("arg1"));
addSyntax(((sender, context) -> {
if (sender instanceof Player player) {
player.sendMessage(Component.text("Use §e/about us §ror §e/about game", NamedTextColor.GRAY));
}
}));
}
}