1
0
mirror of https://github.com/LOOHP/Limbo.git synced 2026-06-08 05:51:43 +00:00

1 Commits

Author SHA1 Message Date
dependabot[bot] 72fce754ae Bump org.apache.commons:commons-lang3 from 3.14.0 to 3.18.0
Bumps org.apache.commons:commons-lang3 from 3.14.0 to 3.18.0.

---
updated-dependencies:
- dependency-name: org.apache.commons:commons-lang3
  dependency-version: 3.18.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-12 01:29:53 +00:00
1193 changed files with 47673 additions and 76909 deletions
+5 -6
View File
@@ -1,9 +1,8 @@
[![Build Status](http://ci.loohpjames.com/job/Limbo/badge/icon)](http://ci.loohpjames.com/job/Limbo/)
# Limbo # Limbo
## Standalone Limbo Minecraft Server (Currently 26.1.2) [![Build Status](http://ci.loohpjames.com/job/Limbo/badge/icon)](http://ci.loohpjames.com/job/Limbo/)
## Standalone Limbo Minecraft Server (Currently 1.21.7)
https://www.spigotmc.org/resources/82468/<br> https://www.spigotmc.org/resources/82468/
https://modrinth.com/mod/limbo-server
### Starting the server ### Starting the server
Use the following command lines to start the limbo server just like any other Minecraft server Use the following command lines to start the limbo server just like any other Minecraft server
@@ -19,7 +18,7 @@ IP: mc.loohpjames.com
``` ```
![Server Banner](https://api.loohpjames.com/serverbanner.png?ip=mc.loohpjames.com&width=918&name=IP:%20mc.loohpjames.com) ![Server Banner](https://api.loohpjames.com/serverbanner.png?ip=mc.loohpjames.com&width=918&name=IP:%20mc.loohpjames.com)
*** ***
### Downloads (1.17.1-26.1.2) ### Downloads (1.17.1-1.21.7)
- [Jenkins](http://ci.loohpjames.com/job/Limbo/) - [Jenkins](http://ci.loohpjames.com/job/Limbo/)
*** ***
### Offical Plugins ### Offical Plugins
@@ -53,4 +52,4 @@ It also **supports my development**, take it as an alternative way to donate whi
**https://www.bisecthosting.com/loohp** **https://www.bisecthosting.com/loohp**
[![](https://www.bisecthosting.com/partners/custom-banners/96e11ee5-50e4-494f-854d-8c1708813abd.png)](https://www.bisecthosting.com/loohp) ![https://www.bisecthosting.com/loohp](https://www.bisecthosting.com/partners/custom-banners/fc7f7b10-8d1a-4478-a23a-8a357538a180.png)
+43 -35
View File
@@ -1,8 +1,8 @@
<!-- <!--
~ This file is part of Limbo. ~ This file is part of Limbo.
~ ~
~ Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> ~ Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
~ Copyright (C) 2026. Contributors ~ Copyright (C) 2022. Contributors
~ ~
~ Licensed under the Apache License, Version 2.0 (the "License"); ~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License. ~ you may not use this file except in compliance with the License.
@@ -24,7 +24,7 @@
<groupId>com.loohp</groupId> <groupId>com.loohp</groupId>
<artifactId>Limbo</artifactId> <artifactId>Limbo</artifactId>
<name>Limbo</name> <name>Limbo</name>
<version>2026.0.1-ALPHA</version> <version>0.7.15-ALPHA</version>
<description>Standalone Limbo Minecraft Server.</description> <description>Standalone Limbo Minecraft Server.</description>
<url>https://github.com/LOOHP/Limbo</url> <url>https://github.com/LOOHP/Limbo</url>
@@ -34,8 +34,8 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.number></project.build.number> <project.build.number></project.build.number>
<project.fullVersion>${project.version}</project.fullVersion> <project.fullVersion>${project.version}</project.fullVersion>
<maven.compiler.source>21</maven.compiler.source> <maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target> <maven.compiler.target>1.8</maven.compiler.target>
</properties> </properties>
<build> <build>
@@ -91,17 +91,17 @@
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.14.0</version> <version>3.8.0</version>
<configuration> <configuration>
<source>21</source> <source>1.8</source>
<target>21</target> <target>1.8</target>
<encoding>ISO-8859-1</encoding> <encoding>ISO-8859-1</encoding>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-javadoc-plugin</artifactId> <artifactId>maven-javadoc-plugin</artifactId>
<version>3.11.2</version> <version>3.2.0</version>
<configuration> <configuration>
<failOnError>false</failOnError> <failOnError>false</failOnError>
<encoding>ISO-8859-1</encoding> <encoding>ISO-8859-1</encoding>
@@ -124,7 +124,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId> <artifactId>maven-source-plugin</artifactId>
<version>3.3.1</version> <version>3.2.0</version>
<executions> <executions>
<execution> <execution>
<id>attach-sources</id> <id>attach-sources</id>
@@ -136,7 +136,7 @@
</executions> </executions>
</plugin> </plugin>
</plugins> </plugins>
<finalName>${project.artifactId}-${project.version}-26.1.2</finalName> <finalName>${project.artifactId}-${project.version}-1.21.7</finalName>
</build> </build>
<profiles> <profiles>
@@ -170,7 +170,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId> <artifactId>maven-source-plugin</artifactId>
<version>3.3.1</version> <version>3.2.1</version>
<configuration> <configuration>
<encoding>${project.build.sourceEncoding}</encoding> <encoding>${project.build.sourceEncoding}</encoding>
</configuration> </configuration>
@@ -187,7 +187,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId> <artifactId>maven-javadoc-plugin</artifactId>
<version>3.11.2</version> <version>3.2.0</version>
<configuration> <configuration>
<encoding>${project.build.sourceEncoding}</encoding> <encoding>${project.build.sourceEncoding}</encoding>
</configuration> </configuration>
@@ -206,15 +206,23 @@
</profiles> </profiles>
<repositories> <repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<repository>
<id>sonatype-oss-snapshots1</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
<repository>
<id>bungeecord-repo</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
<repository> <repository>
<id>maven_central</id> <id>maven_central</id>
<name>Maven Central</name> <name>Maven Central</name>
<url>https://repo.maven.apache.org/maven2/</url> <url>https://repo.maven.apache.org/maven2/</url>
</repository> </repository>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories> </repositories>
<dependencies> <dependencies>
@@ -226,19 +234,19 @@
<dependency> <dependency>
<groupId>com.github.Querz</groupId> <groupId>com.github.Querz</groupId>
<artifactId>NBT</artifactId> <artifactId>NBT</artifactId>
<version>6.1</version> <version>5.5</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.google.code.gson</groupId> <groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId> <artifactId>gson</artifactId>
<version>2.13.1</version> <version>2.10.1</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.yaml</groupId> <groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId> <artifactId>snakeyaml</artifactId>
<version>2.4</version> <version>2.3</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
@@ -250,58 +258,58 @@
<dependency> <dependency>
<groupId>net.md-5</groupId> <groupId>net.md-5</groupId>
<artifactId>bungeecord-chat</artifactId> <artifactId>bungeecord-chat</artifactId>
<version>1.21-R0.3</version> <version>1.18-R0.1-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-serializer</artifactId>
<version>1.21-R0.3</version>
<type>jar</type> <type>jar</type>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.kyori</groupId> <groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-gson</artifactId> <artifactId>adventure-text-serializer-gson</artifactId>
<version>4.26.1</version> <version>4.23.0</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.kyori</groupId> <groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-legacy</artifactId> <artifactId>adventure-text-serializer-legacy</artifactId>
<version>4.26.1</version> <version>4.23.0</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.kyori</groupId> <groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-plain</artifactId> <artifactId>adventure-text-serializer-plain</artifactId>
<version>4.26.1</version> <version>4.23.0</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.kyori</groupId> <groupId>net.kyori</groupId>
<artifactId>adventure-api</artifactId> <artifactId>adventure-api</artifactId>
<version>4.26.1</version> <version>4.23.0</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.kyori</groupId> <groupId>net.kyori</groupId>
<artifactId>adventure-nbt</artifactId> <artifactId>adventure-nbt</artifactId>
<version>4.26.1</version> <version>4.23.0</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.fusesource.jansi</groupId> <groupId>org.fusesource.jansi</groupId>
<artifactId>jansi</artifactId> <artifactId>jansi</artifactId>
<version>2.4.2</version> <version>1.18</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.jline</groupId> <groupId>org.jline</groupId>
<artifactId>jline</artifactId> <artifactId>jline</artifactId>
<version>3.30.5</version> <version>3.16.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>jline</groupId>
<artifactId>jline</artifactId>
<version>2.11</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>
+16 -13
View File
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@ package com.loohp.limbo;
import com.loohp.limbo.commands.CommandSender; import com.loohp.limbo.commands.CommandSender;
import com.loohp.limbo.consolegui.ConsoleTextOutput; import com.loohp.limbo.consolegui.ConsoleTextOutput;
import com.loohp.limbo.utils.CustomStringUtils; import com.loohp.limbo.utils.CustomStringUtils;
import jline.console.ConsoleReader;
import net.kyori.adventure.audience.MessageType; import net.kyori.adventure.audience.MessageType;
import net.kyori.adventure.bossbar.BossBar; import net.kyori.adventure.bossbar.BossBar;
import net.kyori.adventure.identity.Identity; import net.kyori.adventure.identity.Identity;
@@ -44,7 +45,6 @@ import org.jline.reader.LineReader.SuggestionType;
import org.jline.reader.LineReaderBuilder; import org.jline.reader.LineReaderBuilder;
import org.jline.reader.ParsedLine; import org.jline.reader.ParsedLine;
import org.jline.reader.UserInterruptException; import org.jline.reader.UserInterruptException;
import org.jline.terminal.Size;
import org.jline.terminal.Terminal; import org.jline.terminal.Terminal;
import org.jline.terminal.TerminalBuilder; import org.jline.terminal.TerminalBuilder;
@@ -76,6 +76,7 @@ public class Console implements CommandSender {
private final Terminal terminal; private final Terminal terminal;
private final LineReader tabReader; private final LineReader tabReader;
private final ConsoleReader reader;
private final InputStream in; private final InputStream in;
@SuppressWarnings("unused") @SuppressWarnings("unused")
@@ -85,7 +86,7 @@ public class Console implements CommandSender {
protected final PrintStream logs; protected final PrintStream logs;
public Console(InputStream in, PrintStream out, PrintStream err) throws IOException { public Console(InputStream in, PrintStream out, PrintStream err) throws IOException {
String fileName = new SimpleDateFormat("yyyy'-'MM'-'dd'_'HH'-'mm'-'ss'_'zzz'.log'").format(new Date()).replace(":", ""); String fileName = new SimpleDateFormat("yyyy'-'MM'-'dd'_'HH'-'mm'-'ss'_'zzz'.log'").format(new Date());
File dir = new File("logs"); File dir = new File("logs");
dir.mkdirs(); dir.mkdirs();
File logs = new File(dir, fileName); File logs = new File(dir, fileName);
@@ -113,7 +114,11 @@ public class Console implements CommandSender {
}) : err, this.logs)); }) : err, this.logs));
this.err = System.err; this.err = System.err;
terminal = TerminalBuilder.builder().streams(in, out).jansi(true).build(); reader = new ConsoleReader(in, out);
reader.setExpandEvents(false);
reader.setHandleUserInterrupt(false);
terminal = TerminalBuilder.builder().streams(in, out).system(true).jansi(true).build();
tabReader = LineReaderBuilder.builder().terminal(terminal).completer(new Completer() { tabReader = LineReaderBuilder.builder().terminal(terminal).completer(new Completer() {
@Override @Override
public void complete(LineReader reader, ParsedLine line, List<Candidate> candidates) { public void complete(LineReader reader, ParsedLine line, List<Candidate> candidates) {
@@ -124,13 +129,7 @@ public class Console implements CommandSender {
} }
} }
}).build(); }).build();
tabReader.unsetOpt(LineReader.Option.INSERT_TAB);
tabReader.setVariable(LineReader.SECONDARY_PROMPT_PATTERN, "");
tabReader.setAutosuggestion(SuggestionType.NONE); tabReader.setAutosuggestion(SuggestionType.NONE);
if (terminal.getWidth() <= 0 || terminal.getHeight() <= 0) {
terminal.setSize(new Size(80, 24));
}
} }
@Override @Override
@@ -243,8 +242,12 @@ public class Console implements CommandSender {
String date = new SimpleDateFormat("HH':'mm':'ss").format(new Date()); String date = new SimpleDateFormat("HH':'mm':'ss").format(new Date());
ConsoleTextOutput.appendText(ChatColor.stripColor("[" + date + " Info] " + message), true); ConsoleTextOutput.appendText(ChatColor.stripColor("[" + date + " Info] " + message), true);
logs.println(ChatColor.stripColor("[" + date + " Info] " + message)); logs.println(ChatColor.stripColor("[" + date + " Info] " + message));
terminal.writer().append("[").append(date).append(" Info] ").append(translateToConsole(message)).append("\n"); try {
terminal.writer().flush(); reader.getOutput().append("[" + date + " Info] " + translateToConsole(message) + "\n");
reader.getOutput().flush();
} catch (IOException e) {
e.printStackTrace();
}
unstashLine(); unstashLine();
} }
+4 -4
View File
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -132,8 +132,8 @@ public final class Limbo {
//=========================== //===========================
public final String SERVER_IMPLEMENTATION_VERSION = "26.1.2"; public final String SERVER_IMPLEMENTATION_VERSION = "1.21.7";
public final int SERVER_IMPLEMENTATION_PROTOCOL = 775; public final int SERVER_IMPLEMENTATION_PROTOCOL = 772;
public final String LIMBO_IMPLEMENTATION_VERSION; public final String LIMBO_IMPLEMENTATION_VERSION;
private final AtomicBoolean isRunning; private final AtomicBoolean isRunning;
+2 -3
View File
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -85,7 +85,6 @@ public class Unsafe {
public void a(Player player) { public void a(Player player) {
instance.playersByName.put(player.getName(), player); instance.playersByName.put(player.getName(), player);
instance.playersByUUID.put(player.getUniqueId(), player); instance.playersByUUID.put(player.getUniqueId(), player);
instance.getMetrics().updatePlayersCount();
} }
@Deprecated @Deprecated
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -21,12 +21,12 @@ package com.loohp.limbo.consolegui;
import com.loohp.limbo.Limbo; import com.loohp.limbo.Limbo;
import java.lang.management.ManagementFactory;
import java.text.NumberFormat; import java.text.NumberFormat;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
public class SystemInfo { public class SystemInfo {
@SuppressWarnings("InfiniteLoopStatement")
public static void printInfo() { public static void printInfo() {
if (!Limbo.noGui) { if (!Limbo.noGui) {
while (true) { while (true) {
@@ -47,11 +47,11 @@ public class SystemInfo {
try { try {
@SuppressWarnings("restriction") @SuppressWarnings("restriction")
com.sun.management.OperatingSystemMXBean operatingSystemMXBean = (com.sun.management.OperatingSystemMXBean) java.lang.management.ManagementFactory.getOperatingSystemMXBean(); com.sun.management.OperatingSystemMXBean operatingSystemMXBean = (com.sun.management.OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean();
@SuppressWarnings("restriction") @SuppressWarnings("restriction")
double processLoad = operatingSystemMXBean.getProcessCpuLoad(); double processLoad = operatingSystemMXBean.getProcessCpuLoad();
@SuppressWarnings("restriction") @SuppressWarnings("restriction")
double systemLoad = operatingSystemMXBean.getCpuLoad(); double systemLoad = operatingSystemMXBean.getSystemCpuLoad();
int processors = runtime.availableProcessors(); int processors = runtime.availableProcessors();
sb.append("Available Processors: ").append(processors).append("\n"); sb.append("Available Processors: ").append(processors).append("\n");
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2023. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2023. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,22 +1,3 @@
/*
* This file is part of Limbo.
*
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.loohp.limbo.inventory; package com.loohp.limbo.inventory;
/** /**
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,22 +1,3 @@
/*
* This file is part of Limbo.
*
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.loohp.limbo.inventory; package com.loohp.limbo.inventory;
/** /**
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,22 +1,3 @@
/*
* This file is part of Limbo.
*
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.loohp.limbo.inventory; package com.loohp.limbo.inventory;
/** /**
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,46 +0,0 @@
/*
* This file is part of Limbo.
*
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.loohp.limbo.location;
import com.loohp.limbo.world.BlockPosition;
import com.loohp.limbo.world.World;
public class GlobalPos {
private final World world;
private final BlockPosition pos;
public GlobalPos(World world, BlockPosition pos) {
this.world = world;
this.pos = pos;
}
public World getWorld() {
return world;
}
public BlockPosition getPos() {
return pos;
}
public static GlobalPos from(Location location) {
return new GlobalPos(location.getWorld(), BlockPosition.from(location));
}
}
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -39,7 +39,6 @@ import java.util.Timer;
import java.util.TimerTask; import java.util.TimerTask;
import java.util.UUID; import java.util.UUID;
import java.util.concurrent.Callable; import java.util.concurrent.Callable;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.zip.GZIPOutputStream; import java.util.zip.GZIPOutputStream;
/** /**
@@ -50,9 +49,6 @@ import java.util.zip.GZIPOutputStream;
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public class Metrics { public class Metrics {
// The name of the server software
private static final String SERVER_SOFTWARE = "Limbo";
// The version of this bStats class // The version of this bStats class
public static final int B_STATS_VERSION = 1; public static final int B_STATS_VERSION = 1;
@@ -62,15 +58,29 @@ public class Metrics {
// Should failed requests be logged? // Should failed requests be logged?
private static boolean logFailedRequests = false; private static boolean logFailedRequests = false;
// The name of the server software
private final String name;
// The uuid of the server // The uuid of the server
private final String serverUUID; private final String serverUUID;
private final String limboVersion;
// A list with all custom charts // A list with all custom charts
private final List<CustomChart> charts = new ArrayList<>(); private final List<CustomChart> charts = new ArrayList<>();
private final AtomicInteger maxPlayerCountInPeriod = new AtomicInteger(0); /**
* Class constructor.
*
* @param name The name of the server software.
* @param serverUUID The uuid of the server.
* @param logFailedRequests Whether failed requests should be logged or not.
* @param logger The logger for the failed requests.
* @throws IOException
*/
public Metrics() throws IOException { public Metrics() throws IOException {
name = "Limbo";
// Get the config file // Get the config file
File configFile = new File("plugins/bStats", "config.yml"); File configFile = new File("plugins/bStats", "config.yml");
FileConfiguration config = new FileConfiguration(configFile); FileConfiguration config = new FileConfiguration(configFile);
@@ -99,6 +109,8 @@ public class Metrics {
} }
} }
limboVersion = Limbo.getInstance().LIMBO_IMPLEMENTATION_VERSION;
// Load the data // Load the data
serverUUID = config.get("serverUuid", String.class); serverUUID = config.get("serverUuid", String.class);
logFailedRequests = config.get("logFailedRequests", Boolean.class); logFailedRequests = config.get("logFailedRequests", Boolean.class);
@@ -106,16 +118,26 @@ public class Metrics {
startSubmitting(); startSubmitting();
} }
addCustomChart(new Metrics.SingleLineChart("players", () -> maxPlayerCountInPeriod.getAndSet(0))); addCustomChart(new Metrics.SingleLineChart("players", new Callable<Integer>() {
addCustomChart(new Metrics.SimplePie("limbo_version", () -> Limbo.getInstance().LIMBO_IMPLEMENTATION_VERSION)); @Override
addCustomChart(new Metrics.SimplePie("minecraftVersion", () -> Limbo.getInstance().SERVER_IMPLEMENTATION_VERSION)); public Integer call() throws Exception {
return Limbo.getInstance().getPlayers().size();
} }
}));
/** addCustomChart(new Metrics.SimplePie("limbo_version", new Callable<String>() {
* Record the max player count for the last update period. @Override
*/ public String call() throws Exception {
public void updatePlayersCount() { return limboVersion;
maxPlayerCountInPeriod.getAndUpdate(i -> Math.max(i, Limbo.getInstance().getPlayers().size())); }
}));
addCustomChart(new Metrics.SimplePie("minecraftVersion", new Callable<String>() {
@Override
public String call() throws Exception {
return Limbo.getInstance().SERVER_IMPLEMENTATION_VERSION;
}
}));
} }
/** /**
@@ -154,7 +176,7 @@ public class Metrics {
private JSONObject getPluginData() { private JSONObject getPluginData() {
JSONObject data = new JSONObject(); JSONObject data = new JSONObject();
data.put("pluginName", SERVER_SOFTWARE); // Append the name of the server software data.put("pluginName", name); // Append the name of the server software
JSONArray customCharts = new JSONArray(); JSONArray customCharts = new JSONArray();
for (CustomChart customChart : charts) { for (CustomChart customChart : charts) {
// Add the data of the custom charts // Add the data of the custom charts
@@ -210,7 +232,7 @@ public class Metrics {
} catch (Exception e) { } catch (Exception e) {
// Something went wrong! :( // Something went wrong! :(
if (logFailedRequests) { if (logFailedRequests) {
Limbo.getInstance().getConsole().sendMessage("Could not submit stats of " + SERVER_SOFTWARE + "\n" + e); Limbo.getInstance().getConsole().sendMessage("Could not submit stats of " + name + "\n" + e);
} }
} }
} }
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -40,11 +40,9 @@ import com.loohp.limbo.file.ServerProperties;
import com.loohp.limbo.inventory.AnvilInventory; import com.loohp.limbo.inventory.AnvilInventory;
import com.loohp.limbo.inventory.Inventory; import com.loohp.limbo.inventory.Inventory;
import com.loohp.limbo.inventory.ItemStack; import com.loohp.limbo.inventory.ItemStack;
import com.loohp.limbo.location.GlobalPos;
import com.loohp.limbo.location.Location; import com.loohp.limbo.location.Location;
import com.loohp.limbo.network.protocol.packets.ClientboundFinishConfigurationPacket; import com.loohp.limbo.network.protocol.packets.ClientboundFinishConfigurationPacket;
import com.loohp.limbo.network.protocol.packets.ClientboundRegistryDataPacket; import com.loohp.limbo.network.protocol.packets.ClientboundRegistryDataPacket;
import com.loohp.limbo.network.protocol.packets.ClientboundUpdateTagsPacket;
import com.loohp.limbo.network.protocol.packets.PacketHandshakingIn; import com.loohp.limbo.network.protocol.packets.PacketHandshakingIn;
import com.loohp.limbo.network.protocol.packets.PacketIn; import com.loohp.limbo.network.protocol.packets.PacketIn;
import com.loohp.limbo.network.protocol.packets.PacketLoginInLoginStart; import com.loohp.limbo.network.protocol.packets.PacketLoginInLoginStart;
@@ -112,6 +110,7 @@ import com.loohp.limbo.utils.GameMode;
import com.loohp.limbo.utils.InventoryClickUtils; import com.loohp.limbo.utils.InventoryClickUtils;
import com.loohp.limbo.utils.MojangAPIUtils; import com.loohp.limbo.utils.MojangAPIUtils;
import com.loohp.limbo.utils.MojangAPIUtils.SkinResponse; import com.loohp.limbo.utils.MojangAPIUtils.SkinResponse;
import com.loohp.limbo.world.BlockPosition;
import com.loohp.limbo.world.BlockState; import com.loohp.limbo.world.BlockState;
import com.loohp.limbo.world.World; import com.loohp.limbo.world.World;
import net.kyori.adventure.key.Key; import net.kyori.adventure.key.Key;
@@ -150,28 +149,23 @@ import java.util.TimerTask;
import java.util.UUID; import java.util.UUID;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.stream.Collectors; import java.util.stream.Collectors;
public class ClientConnection implements Runnable { public class ClientConnection extends Thread {
private static final Key DEFAULT_HANDLER_NAMESPACE = Key.key("default"); private static final Key DEFAULT_HANDLER_NAMESPACE = Key.key("default");
private static final String BRAND_ANNOUNCE_CHANNEL = Key.key("brand").toString(); private static final String BRAND_ANNOUNCE_CHANNEL = Key.key("brand").toString();
private final Random random = new Random(); private final Random random = new Random();
private final Socket clientSocket; private final Socket clientSocket;
private final Lock packetSendLock = new ReentrantLock();
protected Channel channel; protected Channel channel;
private boolean running; private boolean running;
private volatile ClientState state; private volatile ClientState state;
private final AtomicLong lastPacketTimestamp;
private final AtomicLong lastKeepAlivePayLoad;
private final AtomicLong lastKeepAliveResponse;
private Player player; private Player player;
private TimerTask keepAliveTask; private TimerTask keepAliveTask;
private AtomicLong lastPacketTimestamp;
private AtomicLong lastKeepAlivePayLoad;
private InetAddress inetAddress; private InetAddress inetAddress;
private boolean ready; private boolean ready;
@@ -180,7 +174,6 @@ public class ClientConnection implements Runnable {
this.inetAddress = clientSocket.getInetAddress(); this.inetAddress = clientSocket.getInetAddress();
this.lastPacketTimestamp = new AtomicLong(-1); this.lastPacketTimestamp = new AtomicLong(-1);
this.lastKeepAlivePayLoad = new AtomicLong(-1); this.lastKeepAlivePayLoad = new AtomicLong(-1);
this.lastKeepAliveResponse = new AtomicLong(-1);
this.channel = null; this.channel = null;
this.running = false; this.running = false;
this.ready = false; this.ready = false;
@@ -198,10 +191,6 @@ public class ClientConnection implements Runnable {
this.lastKeepAlivePayLoad.set(payLoad); this.lastKeepAlivePayLoad.set(payLoad);
} }
public long getLastKeepAliveResponse() {
return lastKeepAliveResponse.get();
}
public long getLastPacketTimestamp() { public long getLastPacketTimestamp() {
return lastPacketTimestamp.get(); return lastPacketTimestamp.get();
} }
@@ -243,15 +232,10 @@ public class ClientConnection implements Runnable {
sendPacket(packet); sendPacket(packet);
} }
public void sendPacket(PacketOut packet) throws IOException { public synchronized void sendPacket(PacketOut packet) throws IOException {
packetSendLock.lock();
try {
if (channel.writePacket(packet)) { if (channel.writePacket(packet)) {
setLastPacketTimestamp(System.currentTimeMillis()); setLastPacketTimestamp(System.currentTimeMillis());
} }
} finally {
packetSendLock.unlock();
}
} }
public void disconnect(BaseComponent[] reason) { public void disconnect(BaseComponent[] reason) {
@@ -265,9 +249,6 @@ public class ClientConnection implements Runnable {
} catch (IOException ignored) { } catch (IOException ignored) {
} }
try { try {
ServerProperties properties = Limbo.getInstance().getServerProperties();
String str = (properties.isLogPlayerIPAddresses() ? inetAddress.getHostName() : "<ip address withheld>") + ":" + clientSocket.getPort();
Limbo.getInstance().getConsole().sendMessage("[/" + str + "] <-> Player disconnected with the reason " + PlainTextComponentSerializer.plainText().serialize(reason));
clientSocket.close(); clientSocket.close();
} catch (IOException ignored) { } catch (IOException ignored) {
} }
@@ -575,9 +556,6 @@ public class ClientConnection implements Runnable {
sendPacket(registryDataPacket); sendPacket(registryDataPacket);
} }
ClientboundUpdateTagsPacket updateTagsPacket = new ClientboundUpdateTagsPacket(RegistryCustom.getRegistries());
sendPacket(updateTagsPacket);
ClientboundFinishConfigurationPacket clientboundFinishConfigurationPacket = new ClientboundFinishConfigurationPacket(); ClientboundFinishConfigurationPacket clientboundFinishConfigurationPacket = new ClientboundFinishConfigurationPacket();
sendPacket(clientboundFinishConfigurationPacket); sendPacket(clientboundFinishConfigurationPacket);
@@ -631,7 +609,7 @@ public class ClientConnection implements Runnable {
sendPacket(declare); sendPacket(declare);
} }
PacketPlayOutSpawnPosition spawnPos = new PacketPlayOutSpawnPosition(GlobalPos.from(worldSpawn), worldSpawn.getYaw(), worldSpawn.getPitch()); PacketPlayOutSpawnPosition spawnPos = new PacketPlayOutSpawnPosition(BlockPosition.from(worldSpawn), worldSpawn.getPitch());
sendPacket(spawnPos); sendPacket(spawnPos);
PacketPlayOutPositionAndLook positionLook = new PacketPlayOutPositionAndLook(worldSpawn.getX(), worldSpawn.getY(), worldSpawn.getZ(), worldSpawn.getYaw(), worldSpawn.getPitch(), 1); PacketPlayOutPositionAndLook positionLook = new PacketPlayOutPositionAndLook(worldSpawn.getX(), worldSpawn.getY(), worldSpawn.getZ(), worldSpawn.getYaw(), worldSpawn.getPitch(), 1);
@@ -670,21 +648,22 @@ public class ClientConnection implements Runnable {
keepAliveTask = new TimerTask() { keepAliveTask = new TimerTask() {
@Override @Override
public void run() { public void run() {
if (state != ClientState.PLAY || !ready) { if (state.equals(ClientState.DISCONNECTED)) {
this.cancel(); this.cancel();
} } else if (ready && state.equals(ClientState.PLAY)) {
long now = System.currentTimeMillis(); long now = System.currentTimeMillis();
PacketPlayOutKeepAlive keepAlive = new PacketPlayOutKeepAlive(now); if (now - getLastPacketTimestamp() > 15000) {
PacketPlayOutKeepAlive keepAlivePacket = new PacketPlayOutKeepAlive(now);
try { try {
sendPacket(keepAlive); sendPacket(keepAlivePacket);
setLastKeepAlivePayLoad(now); setLastKeepAlivePayLoad(now);
} catch (IOException e) { } catch (Exception e) {
cancel(); }
}
} }
} }
}; };
new Timer().schedule(keepAliveTask, 0, 10000); new Timer().schedule(keepAliveTask, 5000, 10000);
while (clientSocket.isConnected()) { while (clientSocket.isConnected()) {
try { try {
@@ -736,12 +715,12 @@ public class ClientConnection implements Runnable {
processMoveEvent.consume(event, to); processMoveEvent.consume(event, to);
} }
} else if (packetIn instanceof PacketPlayInKeepAlive) { } else if (packetIn instanceof PacketPlayInKeepAlive) {
long lastPayload = getLastKeepAlivePayLoad();
PacketPlayInKeepAlive alive = (PacketPlayInKeepAlive) packetIn; PacketPlayInKeepAlive alive = (PacketPlayInKeepAlive) packetIn;
if (lastPayload == -1) {
if (alive.getPayload() == getLastKeepAlivePayLoad()) { Limbo.getInstance().getConsole().sendMessage("Unsolicited KeepAlive packet for player " + player.getName());
lastKeepAliveResponse.set(System.currentTimeMillis()); } else if (alive.getPayload() != lastPayload) {
} else { Limbo.getInstance().getConsole().sendMessage("Incorrect Payload received in KeepAlive packet for player " + player.getName());
disconnect(Component.text("Bad Keepalive Payload"));
break; break;
} }
} else if (packetIn instanceof PacketPlayInTabComplete) { } else if (packetIn instanceof PacketPlayInTabComplete) {
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -27,29 +27,23 @@ import java.net.ServerSocket;
import java.net.Socket; import java.net.Socket;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class ServerConnection extends Thread { public class ServerConnection extends Thread {
private final String ip; private final String ip;
private final int port; private final int port;
private final boolean silent; private final boolean silent;
private final ExecutorService executorService;
private final List<ClientConnection> clients;
private ServerSocket serverSocket; private ServerSocket serverSocket;
private List<ClientConnection> clients;
public ServerConnection(String ip, int port, boolean silent) { public ServerConnection(String ip, int port, boolean silent) {
this.clients = new ArrayList<>(); this.clients = new ArrayList<>();
this.ip = ip; this.ip = ip;
this.port = port; this.port = port;
this.silent = silent; this.silent = silent;
this.executorService = Executors.newVirtualThreadPerTaskExecutor();
start(); start();
} }
@SuppressWarnings("InfiniteLoopStatement")
@Override @Override
public void run() { public void run() {
try { try {
@@ -59,9 +53,9 @@ public class ServerConnection extends Thread {
} }
while (true) { while (true) {
Socket connection = serverSocket.accept(); Socket connection = serverSocket.accept();
ClientConnection clientTask = new ClientConnection(connection); ClientConnection sc = new ClientConnection(connection);
clients.add(clientTask); clients.add(sc);
executorService.submit(clientTask); sc.start();
} }
} catch(IOException e) { } catch(IOException e) {
e.printStackTrace(); e.printStackTrace();
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2023. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2023. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -146,7 +146,6 @@ public class ClientboundLevelChunkWithLightPacket extends PacketOut {
} }
} }
dataOut.writeShort(counter); dataOut.writeShort(counter);
dataOut.writeShort(0);
int newBits = 32 - Integer.numberOfLeadingZeros(section.getPalette().size() - 1); int newBits = 32 - Integer.numberOfLeadingZeros(section.getPalette().size() - 1);
newBits = Math.max(newBits, 4); newBits = Math.max(newBits, 4);
@@ -224,7 +223,6 @@ public class ClientboundLevelChunkWithLightPacket extends PacketOut {
} }
} }
} else { } else {
dataOut.writeShort(0);
dataOut.writeShort(0); dataOut.writeShort(0);
dataOut.writeByte(0); dataOut.writeByte(0);
DataTypeIO.writeVarInt(dataOut, 0); DataTypeIO.writeVarInt(dataOut, 0);
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2023. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2023. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,88 +0,0 @@
/*
* This file is part of Limbo.
*
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.loohp.limbo.network.protocol.packets;
import com.loohp.limbo.registry.PacketRegistry;
import com.loohp.limbo.registry.RegistryCustom;
import com.loohp.limbo.utils.DataTypeIO;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import net.kyori.adventure.key.Key;
public class ClientboundUpdateTagsPacket extends PacketOut {
private final Collection<RegistryCustom> registries;
public ClientboundUpdateTagsPacket(Collection<RegistryCustom> registries) {
this.registries = registries;
}
public Collection<RegistryCustom> getRegistries() {
return registries;
}
@Override
public byte[] serializePacket() throws IOException {
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
DataOutputStream output = new DataOutputStream(buffer);
output.writeByte(PacketRegistry.getPacketId(getClass()));
DataTypeIO.writeVarInt(output, registries.size());
for (RegistryCustom registry : registries) {
DataTypeIO.writeString(output, registry.getIdentifier().asString(), StandardCharsets.UTF_8);
DataTypeIO.writeVarInt(output, registry.getTags().size());
for (Map.Entry<Key, List<RegistryCustom.Tag>> entry : registry.getTags().entrySet()) {
DataTypeIO.writeString(output, entry.getKey().asString(), StandardCharsets.UTF_8);
List<Integer> tagIds = transformTags(registry, entry.getValue());
DataTypeIO.writeVarInt(output, tagIds.size());
for (int value : tagIds) {
DataTypeIO.writeVarInt(output, value);
}
}
}
return buffer.toByteArray();
}
private static List<Integer> transformTags(RegistryCustom registry, List<RegistryCustom.Tag> tags) {
List<Integer> tagIds = new ArrayList<>();
for (RegistryCustom.Tag value : tags) {
if (value.isReference()) {
List<RegistryCustom.Tag> referencedTags = registry.getTags().get(value.key());
if (referencedTags != null) {
tagIds.addAll(transformTags(registry, referencedTags));
}
} else {
int index = registry.indexOf(value.key());
if (index >= 0) {
tagIds.add(index);
}
}
}
return tagIds;
}
}
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
/* /*
* This file is part of Limbo. * This file is part of Limbo.
* *
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com> * Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
* Copyright (C) 2026. Contributors * Copyright (C) 2022. Contributors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

Some files were not shown because too many files have changed in this diff Show More