Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
78 changes: 78 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# CyberCore Rework Highlights

Welcome to the major rework of CyberCore! This update modernizes and streamlines the core, focusing on maintainability, modularity, and better dependency management.

## 🚩 Critical Points & Major Package Changes

- **Main Package Renamed:**
All sources have moved from `net.zerotoil.dev.cybercore` to `com.bitaspire.cybercore`. All class paths, imports, and usage should update accordingly.

- **Group/Artifact Metadata:**
- Maven groupId is now `com.bitaspire`.
- Project version reset from `1.3.31` to `1.0`.
- Java compatibility moved to 21 in properties, but source/target remains 1.8.

- **Build & Dependency Overhaul:**
- BeansLib replaced by **Takion-shaded** as the main utility library.
- **Metrics** is now managed as a dependency instead of a bundled, precompiled class.
- **Config Updater** functionality is now in a separate dependency, not within CyberCore.
- JetBrains Annotations, Lombok, Commons Lang, and Spigot dependencies updated and streamlined.
- New Maven repository: `https://croabeast.github.io/repo/`.

## 🔥 Deleted, Replaced, or Moved Classes

### **Removed/Externalized**
- **Metrics class:**
The enormous `net.zerotoil.dev.cybercore.addons.Metrics` is **completely removed**. Metrics are now handled by a managed dependency.
- **ConfigUpdater and related config updater classes:**
No longer maintained in this repo—these are handled by an external library.
- **PlayerUtils:**
Removed. Placeholder management is now covered by `TakionLib`'s `PlaceholderManager`.
- **TimeUtils:**
Removed. All time utilities are provided by `TakionLib`'s time package.

### **Refactored and Renamed**
- **CyberCore:**
- Moved: `net.zerotoil.dev.cybercore.CyberCore` → `com.bitaspire.cybercore.CyberCore`
- Modernized: Now uses new internal structure, simplified boot, and load logic.
- **CoreSettings:**
- Moved: `net.zerotoil.dev.cybercore.CoreSettings` → `com.bitaspire.cybercore.CoreSettings`
- Refactored for TakionLib compatibility.
- **Lag:**
- Moved: `net.zerotoil.dev.cybercore.objects.Lag` → `com.bitaspire.cybercore.Lag`
- Refactored for simpler TPS tracking and reflection via TakionLib.
- **TextSettings → TextLibrary:**
- Replaced: `net.zerotoil.dev.cybercore.TextSettings` → `com.bitaspire.cybercore.TextLibrary`
- Now extends TakionLib for language and logger features.
- **FileManager/YAMLFile:**
- Replaced: `net.zerotoil.dev.cybercore.files.FileManager` and `YAMLFile` with `com.bitaspire.cybercore.file.FileManager` and `FileManagerImpl`, built around TakionLib and its ConfigurableFile.
- **GeneralUtils → RandomUtils:**
- Only random value generators retained, now in `com.bitaspire.cybercore.util.RandomUtils`.

### **Deleted**
- `net.zerotoil.dev.cybercore.files.configupdater.*`
- `net.zerotoil.dev.cybercore.utilities.PlayerUtils`
- `net.zerotoil.dev.cybercore.utilities.TimeUtils`
- `net.zerotoil.dev.cybercore.utilities.GeneralUtils`
- `net.zerotoil.dev.cybercore.files.YAMLFile` (all file operations are now via TakionLib)

## 🧩 Dependency Strategy

- **TakionLib** is the new backbone for all file, reflection, logger, time, and placeholder utilities.
- **Metrics** and **ConfigUpdater** are now **external dependencies**, no longer requiring you to maintain or update their code in CyberCore itself.

## 🚀 Why This Rocks

- **Lighter, faster, easier to maintain:** No more duplicated utility code; everything not unique to CyberCore is a proper dependency.
- **Modernized API:** Cleaner, more modular classes make integration and extension much easier for plugin developers.
- **Future-proof:** With TakionLib, you get regular updates and improvements for all core utilities.
- **Cleaner boot & logging:** Startup banners and logs use TakionLib’s logging layer, with better color/config support.

---

## ⚡ Migration Tips

- Adjust all imports to the new `com.bitaspire.cybercore` base package.
- Replace direct usage of removed utilities with their TakionLib counterparts.
- Any custom config update logic should now be implemented via the external config updater dependency.
- Metrics integration should use the new dependency approach as documented in TakionLib.
114 changes: 83 additions & 31 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,55 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>net.zerotoil.dev</groupId>
<groupId>com.bitaspire</groupId>
<artifactId>CyberCore</artifactId>
<version>1.3.31</version>
<version>1.0</version>
<packaging>jar</packaging>

<name>CyberCore</name>

<description>Main core for CyberPlugins</description>

<properties>
<java.version>8</java.version>
<java.version>21</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<url>dev.zerotoil.net</url>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.13.0</version>
<configuration>
<source>8</source>
<target>8</target>
<source>1.8</source>
<target>1.8</target>
<compilerArgs>
<arg>-Xlint:-options</arg>
</compilerArgs>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.1</version>
<executions>
<execution>
<id>attach-sources</id>
<phase>prepare-package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<version>3.5.3</version>
<executions>
<execution>
<phase>package</phase>
Expand All @@ -44,18 +64,44 @@
</configuration>
</execution>
</executions>

<configuration>
<relocations>
<relocation>
<pattern>me.croabeast</pattern>
<shadedPattern>com.bitaspire</shadedPattern>
</relocation>
</relocations>

<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.*</exclude>
<exclude>META-INF/**</exclude>
</excludes>
</filter>
</filters>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.5.0</version>
<configuration>
<additionalOptions>-Xdoclint:none</additionalOptions>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>

<resources>
<resource>
<directory>src/main/resources</directory>
Expand All @@ -77,48 +123,54 @@
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>

<!-- JitPack (Github) -->
<!-- JitPack (GitHub) -->
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
<id>croabeast-repo</id>
<url>https://croabeast.github.io/repo/</url>
</repository>
</repositories>

<dependencies>
<!-- SpigotMC API -->
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.20.2-R0.1-SNAPSHOT</version>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>26.0.2</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.12.0</version>
<scope>compile</scope>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.38</version>
<scope>provided</scope>
</dependency>

<!-- SpigotMC API -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.26</version>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.16.5-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

<!-- BeansLib -->
<dependency>
<groupId>io.github.croabeast</groupId>
<artifactId>BeansLib</artifactId>
<version>1.4-SNAPSHOT-108</version>
<groupId>me.croabeast</groupId>
<artifactId>Takion-shaded</artifactId>
<version>1.2</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- JetBrains Annotations -->
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>24.0.1</version>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.18.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
116 changes: 116 additions & 0 deletions src/main/java/com/bitaspire/cybercore/CoreSettings.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
package com.bitaspire.cybercore;

import lombok.Setter;
import me.croabeast.common.util.ServerInfoUtils;
import me.croabeast.takion.logger.TakionLogger;
import org.apache.commons.lang.SystemUtils;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;

public class CoreSettings {

private final CyberCore core;
@Setter
private char bootColor = '8';

private String[] bootLogo = new String[]{
"&8╭━━━╮&7╱╱╱&8╭╮&7╱╱╱╱╱╱&8╭━━━╮",
"&8┃╭━╮┃&7╱╱╱&8┃┃&7╱╱╱╱╱╱&8┃╭━╮┃",
"&8┃┃&7╱&8╰╋╮&7╱&8╭┫╰━┳━━┳━┫┃&7╱&8╰╋━━┳━┳━━╮",
"&8┃┃&7╱&8╭┫┃&7╱&8┃┃╭╮┃┃━┫╭┫┃&7╱&8╭┫╭╮┃╭┫┃━┫",
"&8┃╰━╯┃╰━╯┃╰╯┃┃━┫┃┃╰━╯┃╰╯┃┃┃┃━┫",
"&8╰━━━┻━╮╭┻━━┻━━┻╯╰━━━┻━━┻╯╰━━╯",
"&7╱╱╱╱&8╭━╯┃ &7Author: &fKihsomray",
"&7╱╱╱╱&8╰━━╯ &7Version: &7"
};

private String[] legacyBootLogo = new String[]{
"&8_________ _________ __________",
"&8\\_ ___ \\ \\_ ___ \\ \\______ \\",
"&8/ \\ \\/ / \\ \\/ | _/",
"&8\\ \\____\\ \\____ | | \\",
"&8 \\______ / \\______ / |____|_ /",
"&8 \\/ \\/ \\/"
};

CoreSettings(CyberCore core) {
this.core = core;
}

@NotNull
public String getBootColor() {
return "§" + bootColor;
}

public void setBootLogo(@NotNull String... array) {
this.bootLogo = array;
}

public void setLegacyBootLogo(@NotNull String... array) {
this.legacyBootLogo = array;
}

private boolean useLegacy() {
return SystemUtils.OS_NAME.contains("Windows") && ServerInfoUtils.SERVER_VERSION < 12;
}

private String[] getBaseLogo() {
return useLegacy() ? legacyBootLogo : bootLogo;
}

@ApiStatus.ScheduledForRemoval(inVersion = "2.0")
@Deprecated
public String[] getArrayLogo(boolean applyColor) {
return getLogo(applyColor);
}

@ApiStatus.ScheduledForRemoval(inVersion = "2.0")
@Deprecated
public String getStringLogo(boolean applyColor) {
return getLogoAsString(applyColor);
}

@NotNull
public String[] getLogo(boolean applyColor) {
final String[] logo = getBaseLogo();
if (!applyColor) return logo;

for (int i = 0; i < logo.length; i++)
logo[i] = core.getLibrary().colorize(logo[i]);

return logo;
}

@NotNull
public String getLogoAsString(boolean applyColor) {
StringBuilder builder = new StringBuilder();

for (final String s : getLogo(applyColor))
builder.append(s).append("\n");

if (builder.length() > 2)
builder = new StringBuilder(builder.substring(2));

return builder.toString();
}

@NotNull
public String getBootBar() {
StringBuilder builder = new StringBuilder();

for (int i = 0; i < 48; i++) {
if (i == 0 && !useLegacy()) builder.append(getBootColor());
builder.append(useLegacy() ? "-" : "―");
}

return builder.toString();
}

public void sendBootHeader() {
TakionLogger logger = core.getLibrary().getServerLogger();

logger.log(getBootBar());
logger.log(getLogo(true));
logger.log(getBootBar(), "&7");
}
}
Loading