Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
e327f32
Refactor items
Creeperface01 Sep 10, 2020
eac549c
Commit current progress just to be able to continue at school
Creeperface01 Sep 13, 2020
e04850b
Finish base api
Creeperface01 Sep 18, 2020
d36b869
Merge branch 'bleeding' into item-refactor
Creeperface01 Sep 25, 2020
53bab3b
Rewrite more classes
Creeperface01 Sep 26, 2020
b24af7b
Add more serializers for wood types
Creeperface01 Sep 28, 2020
a4303d9
Update block hardness values
Creeperface01 Sep 30, 2020
79249e6
Update block attributes
Creeperface01 Oct 1, 2020
213fe2e
Update block attributes
Creeperface01 Oct 5, 2020
7903d9a
Update block tool tiers
Creeperface01 Oct 5, 2020
a0c0ca4
Update block attributes
Creeperface01 Oct 8, 2020
344e2bc
Initial work on API split
SupremeMortal Oct 10, 2020
a55709a
Implement all states correctly
Creeperface01 Oct 16, 2020
db66d77
Fix block states in generator configuration
Creeperface01 Oct 19, 2020
972e041
Merge remote-tracking branch 'origin/bleeding' into item-refactor
Creeperface01 Oct 19, 2020
0ff172a
Various bug fixes
Creeperface01 Oct 20, 2020
9aa3315
Add item constants
Creeperface01 Oct 21, 2020
3dcd015
Fix missing item meta serializer and id to type mappings
Creeperface01 Oct 25, 2020
fbdf4b4
Fix liquids a bit
Creeperface01 Oct 25, 2020
38a59b2
Fix creative items
Creeperface01 Oct 27, 2020
957a450
Send recipes
Creeperface01 Oct 28, 2020
64c2725
Merge remote-tracking branch 'origin/bleeding' into item-refactor
Creeperface01 Oct 28, 2020
7e7f1db
Merge remote-tracking branch 'origin/bleeding' into item-refactor
Creeperface01 Oct 29, 2020
9f7eb00
Fix incorrect instanceof checks
Creeperface01 Oct 30, 2020
0a7ea6c
Fix liquid behavior
Creeperface01 Oct 30, 2020
0136ebb
Merge remote-tracking branch 'origin/bleeding' into item-refactor
Creeperface01 Oct 30, 2020
1b175d9
Add default bounding boxes
Creeperface01 Nov 1, 2020
e587ac2
Merge remote-tracking branch 'origin/feature/api' into item-refactor
Creeperface01 Nov 6, 2020
3d708b3
Fix conflicts
Creeperface01 Nov 6, 2020
937afd2
Merge pull request #50 from CloudburstMC/item-refactor
SupremeMortal Nov 6, 2020
a5e17d9
Update protocol lib
Sleepybear Jan 3, 2021
d4fef57
Update ItemData arrays to lists
Sleepybear Jan 3, 2021
9e5dadb
Update palette dynamic generation
Sleepybear Jan 3, 2021
034ba36
remove debug
Sleepybear Jan 3, 2021
dbc65d2
Update BlockPaletteTest with new palette.
Sleepybear Jan 5, 2021
fdb7819
AIR is no longer runtime ID 0
Sleepybear Jan 6, 2021
a890e74
Refactor of BlockStorage and fix flower pot deserialisation
SupremeMortal Jan 10, 2021
21d40c7
Update block palette to 1.16.210
SupremeMortal Mar 18, 2021
082784c
Send message when level conversion is complete
SupremeMortal Mar 18, 2021
d42109a
Don't create dependency reduced pom
SupremeMortal Mar 18, 2021
1e48b9b
Server is now joinable with 1.16.210
SupremeMortal Mar 18, 2021
fb85099
Fix plugin loading
rtm516 Mar 20, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,14 +1 @@
# Auto detect text files and perform LF normalization
*.java text=auto eol=lf
*.xml text=auto eol=lf
*.json text=auto eol=lf
*.md text=auto eol=lf
*.yml text=auto eol=lf
*.ini text=auto eol=lf
*.txt text=auto eol=lf
*.bat text=auto eol=lf
*.gradle text=auto eol=lf
*.sh text=auto eol=lf
*.html text=auto eol=lf
*.properties text=auto eol=lf
*.cmd text=auto eol=lf
* text=auto eol=lf
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.cloudburstmc</groupId>
<artifactId>cloudburst-api</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>

<!-- Terminal -->
<dependency>
<groupId>net.minecrell</groupId>
Expand Down
18 changes: 9 additions & 9 deletions src/main/java/co/aikar/timings/Timings.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@

import com.nukkitx.protocol.bedrock.BedrockPacket;
import lombok.extern.log4j.Log4j2;
import org.cloudburstmc.server.Server;
import org.cloudburstmc.api.plugin.PluginContainer;
import org.cloudburstmc.server.CloudServer;
import org.cloudburstmc.server.blockentity.BlockEntity;
import org.cloudburstmc.server.command.Command;
import org.cloudburstmc.server.entity.EntityType;
import org.cloudburstmc.server.event.Event;
import org.cloudburstmc.server.plugin.PluginContainer;
import org.cloudburstmc.server.scheduler.PluginTask;
import org.cloudburstmc.server.scheduler.TaskHandler;

Expand Down Expand Up @@ -86,13 +86,13 @@ public final class Timings {
public static final Timing permissionDefaultTimer;

static {
setTimingsEnabled(Server.getInstance().getConfig().getTimings().isEnabled());
setVerboseEnabled(Server.getInstance().getConfig().getTimings().isVerbose());
setHistoryInterval(Server.getInstance().getConfig().getTimings().getHistoryInterval());
setHistoryLength(Server.getInstance().getConfig().getTimings().getHistoryLength());
setTimingsEnabled(CloudServer.getInstance().getConfig().getTimings().isEnabled());
setVerboseEnabled(CloudServer.getInstance().getConfig().getTimings().isVerbose());
setHistoryInterval(CloudServer.getInstance().getConfig().getTimings().getHistoryInterval());
setHistoryLength(CloudServer.getInstance().getConfig().getTimings().getHistoryLength());

privacy = Server.getInstance().getConfig().getTimings().isPrivacy();
ignoredConfigSections.addAll(Server.getInstance().getConfig().getTimings().getIgnore());
privacy = CloudServer.getInstance().getConfig().getTimings().isPrivacy();
ignoredConfigSections.addAll(CloudServer.getInstance().getConfig().getTimings().getIgnore());

log.debug("Timings: \n" +
"Enabled - " + isTimingsEnabled() + "\n" +
Expand Down Expand Up @@ -182,7 +182,7 @@ public static void setHistoryLength(int length) {
//For special cases of servers with special permission to bypass the max.
//This max helps keep data file sizes reasonable for processing on Aikar's Timing parser side.
//Setting this will not help you bypass the max unless Aikar has added an exception on the API side.
if (Server.getInstance().getConfig().getTimings().isBypassMax()) {
if (CloudServer.getInstance().getConfig().getTimings().isBypassMax()) {
maxLength = Integer.MAX_VALUE;
}

Expand Down
28 changes: 14 additions & 14 deletions src/main/java/co/aikar/timings/TimingsExport.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import lombok.extern.log4j.Log4j2;
import org.apache.logging.log4j.Level;
import org.cloudburstmc.server.Bootstrap;
import org.cloudburstmc.server.Server;
import org.cloudburstmc.server.CloudServer;
import org.cloudburstmc.server.command.CommandSender;
import org.cloudburstmc.server.command.ConsoleCommandSender;
import org.cloudburstmc.server.locale.TranslationContainer;
Expand Down Expand Up @@ -66,16 +66,16 @@ private TimingsExport(CommandSender sender, ObjectNode out, TimingsHistory[] his
*/
public static void reportTimings(CommandSender sender) {
ObjectNode out = Bootstrap.JSON_MAPPER.createObjectNode();
out.put("version", Server.getInstance().getVersion());
out.put("maxplayers", Server.getInstance().getMaxPlayers());
out.put("version", CloudServer.getInstance().getVersion());
out.put("maxplayers", CloudServer.getInstance().getMaxPlayers());
out.put("start", TimingsManager.timingStart / 1000);
out.put("end", System.currentTimeMillis() / 1000);
out.put("sampletime", (System.currentTimeMillis() - TimingsManager.timingStart) / 1000);

if (!Timings.isPrivacy()) {
out.put("server", Server.getInstance().getName());
out.put("motd", Server.getInstance().getMotd());
out.put("online-mode", Server.getInstance().getConfig().isXboxAuth());
out.put("server", CloudServer.getInstance().getName());
out.put("motd", CloudServer.getInstance().getMotd());
out.put("online-mode", CloudServer.getInstance().getConfig().isXboxAuth());
out.put("icon", ""); //"data:image/png;base64,"
}

Expand Down Expand Up @@ -123,7 +123,7 @@ public static void reportTimings(CommandSender sender) {
out.set("idmap", idmap);

//Information about loaded plugins
out.set("plugins", JsonUtil.mapToObject(Server.getInstance().getPluginManager().getAllPlugins(), (plugin) -> {
out.set("plugins", JsonUtil.mapToObject(CloudServer.getInstance().getPluginManager().getAllPlugins(), (plugin) -> {
ObjectNode jsonPlugin = Bootstrap.JSON_MAPPER.createObjectNode();
jsonPlugin.put("version", plugin.getDescription().getVersion());

Expand All @@ -136,7 +136,7 @@ public static void reportTimings(CommandSender sender) {
//Information on the users Config
ObjectNode config = Bootstrap.JSON_MAPPER.createObjectNode();
if (!Timings.getIgnoredConfigSections().contains("all")) {
final ObjectNode rootNode = Server.getInstance().getConfig().getCloudburstYaml().getRootNode();
final ObjectNode rootNode = CloudServer.getInstance().getConfig().getCloudburstYaml().getRootNode();
Timings.getIgnoredConfigSections().forEach(rootNode::remove);
config.set("cloudburst", rootNode);
} else {
Expand Down Expand Up @@ -193,7 +193,7 @@ public void run() {
try {
HttpURLConnection con = (HttpURLConnection) new URL("http://timings.aikar.co/post").openConnection();
con.setDoOutput(true);
con.setRequestProperty("User-Agent", "Cloudburst/" + Server.getInstance().getName() + "/" + InetAddress.getLocalHost().getHostName());
con.setRequestProperty("User-Agent", "Cloudburst/" + CloudServer.getInstance().getName() + "/" + InetAddress.getLocalHost().getHostName());
con.setRequestMethod("POST");
con.setInstanceFollowRedirects(false);

Expand All @@ -214,23 +214,23 @@ public void run() {
String location = con.getHeaderField("Location");
this.sender.sendMessage(new TranslationContainer("cloudburst.command.timings.timingsLocation", location));
if (!(this.sender instanceof ConsoleCommandSender)) {
log.info(Server.getInstance().getLanguage().translate("cloudburst.command.timings.timingsLocation", location));
log.info(CloudServer.getInstance().getLanguage().translate("cloudburst.command.timings.timingsLocation", location));
}

if (response != null && !response.isEmpty()) {
log.info(Server.getInstance().getLanguage().translate("cloudburst.command.timings.timingsResponse", response));
log.info(CloudServer.getInstance().getLanguage().translate("cloudburst.command.timings.timingsResponse", response));
}

File timingFolder = new File(Server.getInstance().getDataPath() + File.separator + "timings");
File timingFolder = new File(CloudServer.getInstance().getDataPath() + File.separator + "timings");
timingFolder.mkdirs();
String fileName = timingFolder + File.separator + new SimpleDateFormat("'timings-'yyyy-MM-dd-hh-mm'.txt'").format(new Date());

FileWriter writer = new FileWriter(fileName);
writer.write(Server.getInstance().getLanguage().translate("cloudburst.command.timings.timingsLocation", location) + "\n\n");
writer.write(CloudServer.getInstance().getLanguage().translate("cloudburst.command.timings.timingsLocation", location) + "\n\n");
writer.write(Bootstrap.JSON_MAPPER.writerWithDefaultPrettyPrinter().writeValueAsString(this.out));
writer.close();

log.info(Server.getInstance().getLanguage().translate("cloudburst.command.timings.timingsWrite", fileName));
log.info(CloudServer.getInstance().getLanguage().translate("cloudburst.command.timings.timingsWrite", fileName));
} catch (IOException exception) {
this.sender.sendMessage(TextFormat.RED + "" + new TranslationContainer("cloudburst.command.timings.reportError"));
if (response != null) {
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/co/aikar/timings/TimingsHistory.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import com.fasterxml.jackson.databind.node.ObjectNode;
import lombok.val;
import org.cloudburstmc.server.Bootstrap;
import org.cloudburstmc.server.Server;
import org.cloudburstmc.server.CloudServer;
import org.cloudburstmc.server.blockentity.BlockEntity;
import org.cloudburstmc.server.entity.Entity;
import org.cloudburstmc.server.level.Level;
Expand Down Expand Up @@ -96,7 +96,7 @@ public class TimingsHistory {
final Map<Identifier, AtomicInteger> entityCounts = new HashMap<>();
final Map<Identifier, AtomicInteger> blockEntityCounts = new HashMap<>();
// Information about all loaded entities/block entities
for (Level level : Server.getInstance().getLevels()) {
for (Level level : CloudServer.getInstance().getLevels()) {
ArrayNode jsonLevel = Bootstrap.JSON_MAPPER.createArrayNode();
for (Chunk chunk : level.getChunks()) {
entityCounts.clear();
Expand Down Expand Up @@ -214,7 +214,7 @@ private static class PingRecord {
final double avg;

PingRecord() {
final Collection<Player> onlinePlayers = Server.getInstance().getOnlinePlayers().values();
final Collection<Player> onlinePlayers = CloudServer.getInstance().getOnlinePlayers().values();
int totalPing = 0;
for (Player player : onlinePlayers) {
totalPing += player.getPing();
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/co/aikar/timings/TimingsManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/
package co.aikar.timings;

import org.cloudburstmc.server.Server;
import org.cloudburstmc.server.CloudServer;

import java.util.*;

Expand Down Expand Up @@ -64,7 +64,7 @@ static void tick() {
}
}

TimingsHistory.playerTicks += Server.getInstance().getOnlinePlayers().size();
TimingsHistory.playerTicks += CloudServer.getInstance().getOnlinePlayers().size();
TimingsHistory.timedTicks++;
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/org/cloudburstmc/server/Achievement.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ public static boolean broadcast(Player player, String achievementId) {
if (!achievements.containsKey(achievementId)) {
return false;
}
String translation = Server.getInstance().getLanguage().translate("chat.type.achievement", player.getDisplayName(), TextFormat.GREEN + achievements.get(achievementId).getMessage() + TextFormat.RESET);
String translation = CloudServer.getInstance().getLanguage().translate("chat.type.achievement", player.getDisplayName(), TextFormat.GREEN + achievements.get(achievementId).getMessage() + TextFormat.RESET);

if (Server.getInstance().getConfig().isAnnouncePlayerAchievements()) {
Server.getInstance().broadcastMessage(translation);
if (CloudServer.getInstance().getConfig().isAnnouncePlayerAchievements()) {
CloudServer.getInstance().broadcastMessage(translation);
} else {
player.sendMessage(translation);
}
Expand Down Expand Up @@ -62,10 +62,10 @@ public String getMessage() {
}

public void broadcast(Player player) {
String translation = Server.getInstance().getLanguage().translate("chat.type.achievement", player.getDisplayName(), TextFormat.GREEN + this.getMessage(), null);
String translation = CloudServer.getInstance().getLanguage().translate("chat.type.achievement", player.getDisplayName(), TextFormat.GREEN + this.getMessage(), null);

if (Server.getInstance().getConfig().isAnnouncePlayerAchievements()) {
Server.getInstance().broadcastMessage(translation);
if (CloudServer.getInstance().getConfig().isAnnouncePlayerAchievements()) {
CloudServer.getInstance().broadcastMessage(translation);
} else {
player.sendMessage(translation);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void update() {
pk.setPlayerPermission((player.isOp() && !player.isSpectator() ? PlayerPermission.OPERATOR : PlayerPermission.MEMBER));
pk.setUniqueEntityId(player.getUniqueId());

Server.broadcastPacket(player.getViewers(), pk);
CloudServer.broadcastPacket(player.getViewers(), pk);
player.sendPacket(pk);

player.resetInAirTicks();
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/cloudburstmc/server/Bootstrap.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
*/

/**
* The entry point of Cloudburst Server.
* The entry point of Cloudburst CloudServer.
*/
@Log4j2
public class Bootstrap {
Expand Down Expand Up @@ -141,7 +141,7 @@ public static void main(String[] args) {

String language = options.valueOf(languageSpec);

Server server = new Server(dataPath, pluginPath, levelPath, language);
CloudServer server = new CloudServer(dataPath, pluginPath, levelPath, language);

try {
if (TITLE) {
Expand All @@ -153,7 +153,7 @@ public static void main(String[] args) {
}

if (TITLE) {
System.out.print((char) 0x1b + "]0;Stopping Server..." + (char) 0x07);
System.out.print((char) 0x1b + "]0;Stopping CloudServer..." + (char) 0x07);
}
log.info("Stopping other threads");

Expand Down
Loading