Skip to content

Commit

Permalink
Merge pull request #627 from RePixelatedMC/master
Browse files Browse the repository at this point in the history
redid /react env info
  • Loading branch information
NextdoorPsycho authored Apr 5, 2024
2 parents d40a078 + 0a7c4b4 commit 5fc5bbe
Show file tree
Hide file tree
Showing 6 changed files with 274 additions and 28 deletions.
6 changes: 4 additions & 2 deletions React/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ registerCustomOutputTask('Psycho', 'C://Dan/MinecraftDevelopment/server/plugins'
registerCustomOutputTask('ArcaneArts', 'C://Users/arcane/Documents/development/server/plugins')
registerCustomOutputTask('Vatuu', 'D://Minecraft/Servers/1.19/plugins')
registerCustomOutputTask('Nowhere', 'E://Desktop/server/plugins')
registerCustomOutputTask('Pixel', 'C://Users//repix//Iris Dimension Engine//1.20.4 - Development/plugins')
// ========================== UNIX ==============================
registerCustomOutputTaskUnix('CyberpwnLT', '/Users/danielmills/development/server/plugins')
registerCustomOutputTaskUnix('PsychoLT', '/Users/brianfopiano/Desktop/REMOTES/RemoteMinecraft/plugins')
Expand Down Expand Up @@ -120,8 +121,9 @@ dependencies {

// Dynamically Loaded
implementation 'net.kyori:adventure-text-minimessage:4.13.1'
implementation 'net.kyori:adventure-platform-bukkit:4.3.0'
implementation 'net.kyori:adventure-api:4.13.1'
implementation 'net.kyori:adventure-platform-bukkit:4.3.2'
implementation 'net.kyori:adventure-api:4.3.2'
implementation 'com.github.oshi:oshi-core:5.8.5'
implementation 'io.timeandspace:smoothie-map:2.0.2'
implementation 'it.unimi.dsi:fastutil:8.5.8'
implementation 'com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:1.4.2'
Expand Down
5 changes: 4 additions & 1 deletion React/src/main/java/com/volmit/react/React.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import com.volmit.react.api.tweak.Tweak;
import com.volmit.react.content.PAPI.PapiExpansion;
import com.volmit.react.core.controller.*;
import com.volmit.react.model.ReactConfiguration;
import com.volmit.react.util.collection.KList;
import com.volmit.react.util.format.C;
import com.volmit.react.util.format.Form;
Expand Down Expand Up @@ -88,7 +89,9 @@ public static void error(String string) {
}

public static void verbose(String string) {
msg(C.LIGHT_PURPLE + string);
if (ReactConfiguration.get().isVerbose()) {
msg(C.LIGHT_PURPLE + string);
}
}

public static void kill(Entity e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,16 @@
import com.volmit.react.api.benchmark.CPUBenchmark;
import com.volmit.react.api.benchmark.Hastebin;
import com.volmit.react.api.benchmark.MemoryBenchmark;
import com.volmit.react.util.collection.KList;
import com.volmit.react.util.format.C;
import com.volmit.react.util.format.Form;
import com.volmit.react.util.hardware.getHardware;
import com.volmit.react.util.reflect.Platform;
import com.volmit.react.util.scheduling.J;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.checkerframework.checker.units.qual.K;
import oshi.SystemInfo;

//THIS IS A DUMMY CLASS FOR EDICT WHENEVER ITS DONE use @decree instead of @edict
public class CommandReact {
Expand Down Expand Up @@ -63,22 +67,42 @@ public static void benchmarkMemory() {
@Edict.Command("/react environment")
@Edict.Aliases("/react env")
public static void environment() {
SystemInfo systemInfo = new SystemInfo();
KList<String> disks = new KList<>(getHardware.getDisk());
KList<String> interfaces = new KList<>(getHardware.getInterfaces());
KList<String> displays = new KList<>(getHardware.getEDID());
KList<String> powersources = new KList<>(getHardware.getPowerSources());


EdictContext.sender().sendMessage(String.valueOf(C.BOLD) + C.DARK_AQUA + " -- == React Info == -- ");
EdictContext.sender().sendMessage(C.GOLD + "React Version Version: " + React.instance.getDescription().getVersion());
EdictContext.sender().sendMessage(C.GOLD + "Server Type: " + Bukkit.getVersion());
EdictContext.sender().sendMessage(C.AQUA + "- React Version Version: " + React.instance.getDescription().getVersion());
EdictContext.sender().sendMessage(C.AQUA + "- Server Type: " + Bukkit.getVersion());
EdictContext.sender().sendMessage(String.valueOf(C.BOLD) + C.DARK_AQUA + " -- == Platform Overview == -- ");
EdictContext.sender().sendMessage(C.GOLD + "Version: " + Platform.getVersion() + " - Platform: " + Platform.getName());
EdictContext.sender().sendMessage(C.GOLD + "Java Vendor: " + Platform.ENVIRONMENT.getJavaVendor() + " - Java Version: " + Platform.ENVIRONMENT.getJavaVersion());
EdictContext.sender().sendMessage(C.AQUA + "- Version: " + Platform.getVersion() + " - Platform: " + Platform.getName());
EdictContext.sender().sendMessage(C.AQUA + "- Java Vendor: " + Platform.ENVIRONMENT.getJavaVendor() + " - Java Version: " + Platform.ENVIRONMENT.getJavaVersion());
EdictContext.sender().sendMessage(String.valueOf(C.BOLD) + C.DARK_AQUA + " -- == Storage Information == -- ");
EdictContext.sender().sendMessage(C.GOLD + "Total Space: " + Form.memSize(Platform.STORAGE.getTotalSpace()));
EdictContext.sender().sendMessage(C.GOLD + "Free Space: " + Form.memSize(Platform.STORAGE.getFreeSpace()));
EdictContext.sender().sendMessage(C.GOLD + "Used Space: " + Form.memSize(Platform.STORAGE.getUsedSpace()));
for (String disk : disks) {
EdictContext.sender().sendMessage(C.AQUA + "- " + disk);
}
EdictContext.sender().sendMessage(String.valueOf(C.BOLD) + C.DARK_AQUA + " -- == Interface Information == -- ");
for (String inter : interfaces) {
EdictContext.sender().sendMessage(C.AQUA + "- " + inter);
}
EdictContext.sender().sendMessage(String.valueOf(C.BOLD) + C.DARK_AQUA + " -- == Display Information == -- ");
for (String display : displays) {
EdictContext.sender().sendMessage(C.AQUA + "- " + display);
}
EdictContext.sender().sendMessage(String.valueOf(C.BOLD) + C.DARK_AQUA + " -- == Power Information == -- ");
for (String power : powersources) {
EdictContext.sender().sendMessage(C.AQUA + "- " + power);
}
EdictContext.sender().sendMessage(String.valueOf(C.BOLD) + C.DARK_AQUA + " -- == Memory Information == -- ");
EdictContext.sender().sendMessage(C.GOLD + "Physical Memory - Total: " + Form.memSize(Platform.MEMORY.PHYSICAL.getTotalMemory()) + " Free: " + Form.memSize(Platform.MEMORY.PHYSICAL.getFreeMemory()) + " Used: " + Form.memSize(Platform.MEMORY.PHYSICAL.getUsedMemory()));
EdictContext.sender().sendMessage(C.GOLD + "Virtual Memory - Total: " + Form.memSize(Platform.MEMORY.VIRTUAL.getTotalMemory()) + " Free: " + Form.memSize(Platform.MEMORY.VIRTUAL.getFreeMemory()) + " Used: " + Form.memSize(Platform.MEMORY.VIRTUAL.getUsedMemory()));
EdictContext.sender().sendMessage(C.AQUA + "- Physical Memory - Total: " + Form.memSize(Platform.MEMORY.PHYSICAL.getTotalMemory()) + " Free: " + Form.memSize(Platform.MEMORY.PHYSICAL.getFreeMemory()) + " Used: " + Form.memSize(Platform.MEMORY.PHYSICAL.getUsedMemory()));
EdictContext.sender().sendMessage(C.AQUA + "- Virtual Memory - Total: " + Form.memSize(Platform.MEMORY.VIRTUAL.getTotalMemory()) + " Free: " + Form.memSize(Platform.MEMORY.VIRTUAL.getFreeMemory()) + " Used: " + Form.memSize(Platform.MEMORY.VIRTUAL.getUsedMemory()));
EdictContext.sender().sendMessage(String.valueOf(C.BOLD) + C.DARK_AQUA + " -- == CPU Overview == -- ");
EdictContext.sender().sendMessage(C.GOLD + "CPU Architecture: " + Platform.CPU.getArchitecture() + " Available Processors: " + Platform.CPU.getAvailableProcessors());
EdictContext.sender().sendMessage(C.GOLD + "CPU Load: " + Form.pc(Platform.CPU.getCPULoad()) + " CPU Live Process Load: " + Form.pc(Platform.CPU.getLiveProcessCPULoad()));
EdictContext.sender().sendMessage(C.AQUA + "- CPU Architecture: " + Platform.CPU.getArchitecture() + " Available Processors: " + Platform.CPU.getAvailableProcessors());
EdictContext.sender().sendMessage(C.AQUA + "- CPU Load: " + Form.pc(Platform.CPU.getCPULoad()) + " CPU Live Process Load: " + Form.pc(Platform.CPU.getLiveProcessCPULoad()));

CommandSender s = EdictContext.sender();
J.a(() -> Hastebin.enviornment(s));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,19 @@

package com.volmit.react.content.decreecommand;

import art.arcane.edict.api.context.EdictContext;
import com.volmit.react.React;
import com.volmit.react.api.benchmark.Hastebin;
import com.volmit.react.util.collection.KList;
import com.volmit.react.util.decree.DecreeExecutor;
import com.volmit.react.util.decree.DecreeOrigin;
import com.volmit.react.util.decree.annotations.Decree;
import com.volmit.react.util.format.C;
import com.volmit.react.util.format.Form;
import com.volmit.react.util.hardware.getHardware;
import com.volmit.react.util.reflect.Platform;
import org.bukkit.Bukkit;
import oshi.SystemInfo;

@Decree(
name = "environment",
Expand All @@ -43,24 +47,53 @@ public class CommandEnvironment implements DecreeExecutor {
description = "Print the environment details!"
)
public void info() {
SystemInfo systemInfo = new SystemInfo();
KList<String> disks = new KList<>(getHardware.getDisk());
KList<String> interfaces = new KList<>(getHardware.getInterfaces());
KList<String> displays = new KList<>(getHardware.getEDID());
KList<String> sensors = new KList<>(getHardware.getSensors());
KList<String> gpus = new KList<>(getHardware.getGraphicsCards());
KList<String> powersources = new KList<>(getHardware.getPowerSources());

sender().sendMessage(String.valueOf(C.BOLD) + C.DARK_AQUA + " -- == React Info == -- ");
sender().sendMessage(C.GOLD + "React Version Version: " + React.instance.getDescription().getVersion());
sender().sendMessage(C.GOLD + "Server Type: " + Bukkit.getVersion());
sender().sendMessage(C.AQUA + "React Version Version: " + React.instance.getDescription().getVersion());
sender().sendMessage(C.AQUA + "Server Type: " + Bukkit.getVersion());
sender().sendMessage(C.AQUA + "Server Uptime: " + Form.stampTime(systemInfo.getOperatingSystem().getSystemUptime()));
sender().sendMessage(String.valueOf(C.BOLD) + C.DARK_AQUA + " -- == Platform Overview == -- ");
sender().sendMessage(C.GOLD + "Version: " + Platform.getVersion() + " - Platform: " + Platform.getName());
sender().sendMessage(C.GOLD + "Java Vendor: " + Platform.ENVIRONMENT.getJavaVendor() + " - Java Version: " + Platform.ENVIRONMENT.getJavaVersion());
sender().sendMessage(String.valueOf(C.BOLD) + C.DARK_AQUA + " -- == Storage Information == -- ");
sender().sendMessage(C.GOLD + "Total Space: " + Form.memSize(Platform.STORAGE.getTotalSpace()));
sender().sendMessage(C.GOLD + "Free Space: " + Form.memSize(Platform.STORAGE.getFreeSpace()));
sender().sendMessage(C.GOLD + "Used Space: " + Form.memSize(Platform.STORAGE.getUsedSpace()));
sender().sendMessage(C.AQUA + "Version: " + Platform.getVersion() + " - Platform: " + Platform.getName());
sender().sendMessage(C.AQUA + "Java Vendor: " + Platform.ENVIRONMENT.getJavaVendor() + " - Java Version: " + Platform.ENVIRONMENT.getJavaVersion());
sender().sendMessage(String.valueOf(C.BOLD) + C.DARK_AQUA + " -- == Processor Overview == -- ");
sender().sendMessage(C.AQUA + "CPU Model: " + getHardware.getCPUModel());
sender().sendMessage(C.AQUA + "CPU Architecture: " + Platform.CPU.getArchitecture() + " Available Processors: " + Platform.CPU.getAvailableProcessors());
sender().sendMessage(C.AQUA + "CPU Load: " + Form.pc(Platform.CPU.getCPULoad()) + " CPU Live Process Load: " + Form.pc(Platform.CPU.getLiveProcessCPULoad()));
sender().sendMessage(C.DARK_GRAY + "-=" + C.BLUE +" Graphics " + C.DARK_GRAY + "=- ");
for (String gpu : gpus) {
sender().sendMessage(C.BLUE + " " + gpu);
}
sender().sendMessage(String.valueOf(C.BOLD) + C.DARK_AQUA + " -- == Memory Information == -- ");
sender().sendMessage(C.GOLD + "Physical Memory - Total: " + Form.memSize(Platform.MEMORY.PHYSICAL.getTotalMemory()) + " Free: " + Form.memSize(Platform.MEMORY.PHYSICAL.getFreeMemory()) + " Used: " + Form.memSize(Platform.MEMORY.PHYSICAL.getUsedMemory()));
sender().sendMessage(C.GOLD + "Virtual Memory - Total: " + Form.memSize(Platform.MEMORY.VIRTUAL.getTotalMemory()) + " Free: " + Form.memSize(Platform.MEMORY.VIRTUAL.getFreeMemory()) + " Used: " + Form.memSize(Platform.MEMORY.VIRTUAL.getUsedMemory()));
sender().sendMessage(String.valueOf(C.BOLD) + C.DARK_AQUA + " -- == CPU Overview == -- ");
sender().sendMessage(C.GOLD + "CPU Architecture: " + Platform.CPU.getArchitecture() + " Available Processors: " + Platform.CPU.getAvailableProcessors());
sender().sendMessage(C.GOLD + "CPU Load: " + Form.pc(Platform.CPU.getCPULoad()) + " CPU Live Process Load: " + Form.pc(Platform.CPU.getLiveProcessCPULoad()));
sender().sendMessage(C.AQUA + "Physical Memory - Total: " + Form.memSize(Platform.MEMORY.PHYSICAL.getTotalMemory()) + " Free: " + Form.memSize(Platform.MEMORY.PHYSICAL.getFreeMemory()) + " Used: " + Form.memSize(Platform.MEMORY.PHYSICAL.getUsedMemory()));
sender().sendMessage(C.AQUA + "Virtual Memory - Total: " + Form.memSize(Platform.MEMORY.VIRTUAL.getTotalMemory()) + " Free: " + Form.memSize(Platform.MEMORY.VIRTUAL.getFreeMemory()) + " Used: " + Form.memSize(Platform.MEMORY.VIRTUAL.getUsedMemory()));
sender().sendMessage(String.valueOf(C.BOLD) + C.DARK_AQUA + " -- == Storage Information == -- ");
for (String disk : disks) {
sender().sendMessage(C.AQUA + " " + disk);
}
sender().sendMessage(String.valueOf(C.BOLD) + C.DARK_AQUA + " -- == Interface Information == -- ");
for (String inter : interfaces) {
sender().sendMessage(C.AQUA + " " + inter);
}
sender().sendMessage(String.valueOf(C.BOLD) + C.DARK_AQUA + " -- == Display Information == -- ");
for (String display : displays) {
sender().sendMessage(C.AQUA + " " + display);
}
sender().sendMessage(String.valueOf(C.BOLD) + C.DARK_AQUA + " -- == Sensor Information == -- ");
for (String sensor : sensors) {
sender().sendMessage(C.AQUA + " " + sensor);
}
sender().sendMessage(String.valueOf(C.BOLD) + C.DARK_AQUA + " -- == Power Information == -- ");
for (String power : powersources) {
sender().sendMessage(C.AQUA + " " + power);
}
Hastebin.enviornment(sender());

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.volmit.react.api.monitor.configuration.MonitorConfiguration;
import com.volmit.react.api.monitor.configuration.MonitorGroup;
import com.volmit.react.content.sampler.*;
import com.volmit.react.util.data.B;
import com.volmit.react.util.io.IO;
import com.volmit.react.util.json.JSONObject;
import lombok.Data;
Expand All @@ -43,6 +44,7 @@ public class ReactConfiguration {
private ValueConfig value = new ValueConfig();
private boolean customColors = true;
private boolean verbose = false;
private boolean debug = false;
private Monitoring monitoring = new Monitoring();

public static ReactConfiguration get() {
Expand Down
Loading

0 comments on commit 5fc5bbe

Please sign in to comment.