Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Agzam4 authored Mar 28, 2023
1 parent 730dfa8 commit 19ea519
Show file tree
Hide file tree
Showing 9 changed files with 856 additions and 370 deletions.
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "Agzam's plugin v1.8.1",
"name": "Agzam's plugin v1.8.3",
"author": "Agzam4",
"main": "example.ExamplePlugin",
"description": "New command, events, core protection from thorium reactors and more",
Expand Down
33 changes: 29 additions & 4 deletions src/example/DataCollecter.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package example;

import java.io.File;
import java.io.Writer;
import java.nio.file.Paths;
import java.util.ArrayList;
Expand All @@ -8,7 +9,12 @@

import arc.Core;
import arc.Files;
import arc.Files.FileType;
import arc.files.Fi;
import arc.func.Intc2;
import arc.math.geom.Geometry;
import arc.math.geom.Vec2;
import arc.struct.Seq;
import arc.util.Log;
import arc.util.serialization.Json;
import arc.util.serialization.JsonWriter;
Expand All @@ -21,10 +27,12 @@
import mindustry.gen.Player;
import mindustry.io.JsonIO;
import mindustry.net.Administration.Config;
import mindustry.net.Administration.PlayerInfo;

public class DataCollecter {

public static final String FILENAME = "agzam_s_plugin_statistics.json";
public static final String FILENAME_ADMINS = "agzam_s_plugin_admins.json";

private transient long sleepTime = 5 * 60_000 / 60 / 5; // FIXME: 5 minutes

Expand Down Expand Up @@ -119,9 +127,26 @@ public void save() {

json.append('}');

Fi fi = new Fi(getPathToFile());
Fi fi = new Fi(getPathToFile(FILENAME));
fi.writeString(json.toString());
// Files.writeString(json);//(Vars.saveDirectory, json);


StringBuilder adminsList = new StringBuilder("Admins list (IP/ID/NAME):");

if(Vars.netServer != null) {
Seq<PlayerInfo> admins = Vars.netServer.admins.getAdmins();
if(admins != null) {
if(admins.size == 0){
}else{
for (int i = 0; i < admins.size; i++) {
PlayerInfo info = admins.get(i);
adminsList.append("\n" + info.lastIP + " " + info.id + " " + info.plainLastName());
}
}
}
}
Fi fia = new Fi(getPathToFile(FILENAME_ADMINS));
fia.writeString(adminsList.toString());
}

private void createJsonValue(StringBuilder json, String name, String[][] values) {
Expand Down Expand Up @@ -171,8 +196,8 @@ private void createJsonValue(StringBuilder json, String name, int value) {
json.append(",\n");
}

public static String getPathToFile() {
return Vars.saveDirectory + "/" + FILENAME;
public static String getPathToFile(String name) {
return Vars.saveDirectory + "/" + name;
}

public long getSleepTime() {
Expand Down
50 changes: 50 additions & 0 deletions src/example/Emoji.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package example;

import static example.Emoji.emojiCryofluid;
import static example.Emoji.emojiOil;
import static example.Emoji.emojiSlag;
import static example.Emoji.emojiWater;

public class Emoji {

public static final char emojiCopper = '\uf838';
public static final char emojiLead = '\uf837';
public static final char emojiMetaglass = '\uf836';
public static final char emojiGraphite = '\uf835';
public static final char emojiSand = '\uf834';
public static final char emojiCoal = '\uf833';
public static final char emojiTitanium = '\uf832';
public static final char emojiThorium = '\uf831';
public static final char emojiScrap = '\uf830';
public static final char emojiSilicon = '\uf82f';
public static final char emojiPlastanium = '\uf82e';
public static final char emojiPhaseFabric = '\uf82d';
public static final char emojiSurgeAlloy = '\uf82c';
public static final char emojiSporePod = '\uf82b';
public static final char emojiBlastCompound = '\uf82a';
public static final char emojiPyratite = '\uf829';

public static final char emojiWater = '\uf828';
public static final char emojiSlag = '\uf827';
public static final char emojiOil = '\uf826';
public static final char emojiCryofluid = '\uf825';

public static final char emojiAlert = '\u26a0';

public static final char[] oreBlocksEmoji = new char[] {
emojiCopper,
emojiLead,
emojiScrap,
emojiSand,
emojiCoal,
emojiTitanium,
emojiThorium
};

public static final char[] liquidsEmoji = new char[] {
emojiWater,
emojiOil,
emojiSlag,
emojiCryofluid
};
}
Loading

0 comments on commit 19ea519

Please sign in to comment.