remove useless code + enhancement + remove some config
This commit is contained in:
parent
07291c0da9
commit
3d1d37fb0f
7 changed files with 9 additions and 71 deletions
23
.github/README.md
vendored
23
.github/README.md
vendored
|
@ -55,26 +55,9 @@ For how to use, see **[here](https://github.com/night0721/lilase#how-to-use)**
|
|||
# Example Config:
|
||||
```json
|
||||
{
|
||||
"SendMessageToWebhook": true,
|
||||
"ReconnectDelay": 20,
|
||||
"BedSpamDelay": 100,
|
||||
"OnlySniper": false,
|
||||
"BedSpam": true,
|
||||
"SniperMode": 2,
|
||||
"GUI": true,
|
||||
"Debug": true,
|
||||
"RelistTimeout": 1500,
|
||||
"AuctionLength": 2,
|
||||
"AutoClaim": true,
|
||||
"AutoRelist": true,
|
||||
"RelistCheckTimeout": 1.0,
|
||||
"Webhook": "https://discord.com/api/webhooks/21345234635679111/aufsdaiusdhfqwhtq798rgdfsgASD_GAdfguasfdigsdfgsdfgsdfg",
|
||||
"CustomScoreboard": true,
|
||||
"GUI_COLOR": -16764590,
|
||||
"AuctionHouseDelay": 8,
|
||||
"RemoteControl": true,
|
||||
"BotToken": "faserfqwuerfiaozdcgjnfh0243819qtewasdulkq43twsfdg",
|
||||
"ShortenNumbers": true,
|
||||
"LogChannel": ""
|
||||
"BotToken": "OTE1NDk3NDQ1OTMwODY2MjA=.QREQw3.ASDU238qw9adsfdWEfsgsdfg",
|
||||
"LogChannel": "91549744593086620",
|
||||
"Webhook": "https://discord.com/api/webhooks/81963527359311890/MIIDBjCCAe4CCQDqzJZzANBgkqhkiG9w0BAQsFADBFMQswCQYDVQQGEwJjbjELMAkGA1"
|
||||
}
|
||||
```
|
||||
|
|
|
@ -12,23 +12,7 @@ public class AHConfig extends Config {
|
|||
public AHConfig() {
|
||||
super(new Mod("Lilase", ModType.SKYBLOCK, "/assets/lilase.png", 84, 84), "lilase.json");
|
||||
initialize();
|
||||
addListener("SEND_MESSAGE", () -> Lilase.configHandler.setBoolean("SendMessageToWebhook", SEND_MESSAGE));
|
||||
addListener("WEBHOOK", () -> Lilase.configHandler.setString("Webhook", WEBHOOK));
|
||||
addListener("RECONNECT_DELAY", () -> Lilase.configHandler.setInt("ReconnectDelay", RECONNECT_DELAY));
|
||||
addListener("BED_SPAM", () -> Lilase.configHandler.setBoolean("BedSpam", BED_SPAM));
|
||||
addListener("BED_SPAM_DELAY", () -> Lilase.configHandler.setInt("BedSpamDelay", BED_SPAM_DELAY));
|
||||
addListener("ONLY_SNIPER", () -> Lilase.configHandler.setBoolean("OnlySniper", ONLY_SNIPER));
|
||||
addListener("GUI", () -> Lilase.configHandler.setBoolean("GUI", GUI));
|
||||
addListener("GUI_COLOR", () -> Lilase.configHandler.setInt("GUI_COLOR", GUI_COLOR.getRGB()));
|
||||
addListener("RELIST_TIMEOUT", () -> Lilase.configHandler.setInt("RelistTimeout", RELIST_TIMEOUT));
|
||||
addListener("DEBUG", () -> Lilase.configHandler.setBoolean("Debug", DEBUG));
|
||||
addListener("AUCTION_LENGTH", () -> Lilase.configHandler.setInt("AuctionLength", AUCTION_LENGTH));
|
||||
addListener("AUTO_RELIST", () -> Lilase.configHandler.setBoolean("AutoRelist", AUTO_RELIST));
|
||||
addListener("AUTO_CLAIM", () -> Lilase.configHandler.setBoolean("AutoClaim", AUTO_CLAIM));
|
||||
addListener("RELIST_CHECK_TIMEOUT", () -> Lilase.configHandler.setFloat("RelistCheckTimeout", RELIST_CHECK_TIMEOUT));
|
||||
addListener("CUSTOM_SCOREBOARD", () -> Lilase.configHandler.setBoolean("CustomScoreboard", CUSTOM_SCOREBOARD));
|
||||
addListener("SHORTEN_NUMBERS", () -> Lilase.configHandler.setBoolean("ShortenNumbers", SHORTEN_NUMBERS));
|
||||
addListener("REMOTE_CONTROL", () -> Lilase.configHandler.setBoolean("RemoteControl", REMOTE_CONTROL));
|
||||
addListener("WEBHOOK", () -> Lilase.configHandler.setString("Webhook", WEBHOOK));addListener("REMOTE_CONTROL", () -> Lilase.configHandler.setBoolean("RemoteControl", REMOTE_CONTROL));
|
||||
addListener("BOT_TOKEN", () -> Lilase.configHandler.setString("BotToken", BOT_TOKEN));
|
||||
addListener("LOG_CHANNEL", () -> Lilase.configHandler.setString("LogChannel", LOG_CHANNEL));
|
||||
addDependency("WEBHOOK", "SEND_MESSAGE");
|
||||
|
|
|
@ -17,23 +17,7 @@ public class ConfigHandler {
|
|||
}
|
||||
|
||||
public void reloadConfig() {
|
||||
// TODO: Fix
|
||||
if (hasNoKey("SendMessageToWebhook")) setBoolean("SendMessageToWebhook", true);
|
||||
if (hasNoKey("Webhook")) setString("Webhook", "");
|
||||
if (hasNoKey("ReconnectDelay")) setInt("ReconnectDelay", 20);
|
||||
if (hasNoKey("SniperMode")) setBoolean("SniperMode", true);
|
||||
if (hasNoKey("BedSpam")) setBoolean("BedSpam", true);
|
||||
if (hasNoKey("BedSpamDelay")) setInt("BedSpamDelay", 100);
|
||||
if (hasNoKey("OnlySniper")) setBoolean("OnlySniper", false);
|
||||
if (hasNoKey("GUI")) setBoolean("GUI", true);
|
||||
if (hasNoKey("GUI_COLOR")) setInt("GUI_COLOR", 0x003153);
|
||||
if (hasNoKey("Debug")) setBoolean("Debug", false);
|
||||
if (hasNoKey("RelistTimeout")) setInt("RelistTimeout", 1500);
|
||||
if (hasNoKey("AuctionLength")) setInt("AuctionLength", 2);
|
||||
if (hasNoKey("AutoRelist")) setBoolean("AutoRelist", true);
|
||||
if (hasNoKey("AutoClaim")) setBoolean("AutoClaim", true);
|
||||
if (hasNoKey("CustomScoreboard")) setBoolean("CustomScoreboard", true);
|
||||
if (hasNoKey("ShortenNumbers")) setBoolean("ShortenNumbers", true);
|
||||
if (hasNoKey("RemoteControl")) setBoolean("RemoteControl", false);
|
||||
if (hasNoKey("BotToken")) setString("BotToken", "");
|
||||
if (hasNoKey("LogChannel")) setString("LogChannel", "");
|
||||
|
|
|
@ -50,9 +50,8 @@ public class Queue {
|
|||
this.clearTaskRunning = true;
|
||||
new Thread(() -> {
|
||||
try {
|
||||
Thread.sleep(3000);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
Thread.sleep(1500);
|
||||
} catch (InterruptedException ignored) {
|
||||
}
|
||||
this.queue.clear();
|
||||
this.setRunning(false);
|
||||
|
|
|
@ -12,7 +12,8 @@ public class QueueItem {
|
|||
final int price;
|
||||
public @Getter
|
||||
final int target;
|
||||
public @Getter String uid;
|
||||
public @Getter
|
||||
final String uid;
|
||||
public Flipper flipper;
|
||||
|
||||
public QueueItem(String command, String name, int price, int target, String uid) {
|
||||
|
|
|
@ -2,30 +2,17 @@ package me.night0721.lilase.utils;
|
|||
|
||||
public class Clock {
|
||||
private long endTime;
|
||||
private boolean scheduled;
|
||||
|
||||
public void schedule(long milliseconds) {
|
||||
this.endTime = System.currentTimeMillis() + milliseconds;
|
||||
scheduled = true;
|
||||
}
|
||||
|
||||
public long getRemainingTime() {
|
||||
return endTime - System.currentTimeMillis();
|
||||
}
|
||||
|
||||
public long getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public boolean passed() {
|
||||
return System.currentTimeMillis() >= endTime;
|
||||
}
|
||||
|
||||
public boolean isScheduled() {
|
||||
return scheduled;
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
scheduled = false;
|
||||
}
|
||||
}
|
|
@ -60,7 +60,7 @@ public class InventoryUtils {
|
|||
return null;
|
||||
}
|
||||
|
||||
public static int getSlotForItemm(String id) {
|
||||
public static int getSlotForItem(String id) {
|
||||
for (final Slot slot : Lilase.mc.thePlayer.inventoryContainer.inventorySlots) {
|
||||
if (slot.getHasStack()) {
|
||||
final ItemStack is = slot.getStack();
|
||||
|
|
Loading…
Reference in a new issue