fix bed not spamming + fixed anti afk 3.0.3
Some checks failed
build-ci / build (push) Has been cancelled
Some checks failed
build-ci / build (push) Has been cancelled
This commit is contained in:
parent
8c2003931d
commit
d2ecce10db
5 changed files with 21 additions and 24 deletions
|
@ -1,6 +1,6 @@
|
||||||
mod_name = Lilase
|
mod_name = Lilase
|
||||||
mod_id = lilase
|
mod_id = lilase
|
||||||
mod_version = 3.0.2
|
mod_version = 3.0.3
|
||||||
|
|
||||||
essential.defaults.loom=0
|
essential.defaults.loom=0
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ import static me.night0721.lilase.features.flipper.Flipper.webhook;
|
||||||
public class Lilase {
|
public class Lilase {
|
||||||
public static final String MOD_NAME = "Lilase";
|
public static final String MOD_NAME = "Lilase";
|
||||||
public static final String MODID = "Lilase";
|
public static final String MODID = "Lilase";
|
||||||
public static final String VERSION = "3.0.2";
|
public static final String VERSION = "3.0.3";
|
||||||
public static final Minecraft mc = Minecraft.getMinecraft();
|
public static final Minecraft mc = Minecraft.getMinecraft();
|
||||||
// public static PageFlipper pageFlipper;
|
// public static PageFlipper pageFlipper;
|
||||||
public static Claimer claimer;
|
public static Claimer claimer;
|
||||||
|
@ -53,7 +53,7 @@ public class Lilase {
|
||||||
private int tickAmount;
|
private int tickAmount;
|
||||||
private final Clock clock = new Clock();
|
private final Clock clock = new Clock();
|
||||||
public static RemoteControl remoteControl;
|
public static RemoteControl remoteControl;
|
||||||
public static CapeDatabase capeDatabase = new CapeDatabase();
|
public static final CapeDatabase capeDatabase = new CapeDatabase();
|
||||||
|
|
||||||
@Mod.EventHandler
|
@Mod.EventHandler
|
||||||
public void init(FMLInitializationEvent event) {
|
public void init(FMLInitializationEvent event) {
|
||||||
|
|
|
@ -71,20 +71,7 @@ public class SniperFlipperEvents {
|
||||||
}
|
}
|
||||||
|
|
||||||
private int latestWindowId = -1;
|
private int latestWindowId = -1;
|
||||||
private final Thread spam = new Thread(() -> {
|
private Thread spam;
|
||||||
int tries = 0;
|
|
||||||
try {
|
|
||||||
while (tries < 50) {
|
|
||||||
if (InventoryUtils.inventoryNameStartsWith("BIN Auction View")) {
|
|
||||||
clickWindow(latestWindowId, 31);
|
|
||||||
clickWindow(latestWindowId + 1, 11);
|
|
||||||
tries++;
|
|
||||||
Thread.sleep(BED_SPAM_DELAY);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (Exception ignored) {
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onPacketReceive(PacketReceivedEvent event) {
|
public void onPacketReceive(PacketReceivedEvent event) {
|
||||||
|
@ -102,11 +89,21 @@ public class SniperFlipperEvents {
|
||||||
ItemStack itemStack = packetSetSlot.func_149174_e();
|
ItemStack itemStack = packetSetSlot.func_149174_e();
|
||||||
Utils.debugLog("Slot 31: " + itemStack.getItem().getRegistryName());
|
Utils.debugLog("Slot 31: " + itemStack.getItem().getRegistryName());
|
||||||
if (itemStack.getItem() == Items.bed) {
|
if (itemStack.getItem() == Items.bed) {
|
||||||
boolean threadStatus = !spam.isAlive();
|
spam = new Thread(() -> {
|
||||||
if (spam.isAlive()) spam.interrupt();
|
int tries = 0;
|
||||||
if (!threadStatus) {
|
try {
|
||||||
spam.start();
|
while (tries < 50) {
|
||||||
}
|
if (InventoryUtils.inventoryNameStartsWith("BIN Auction View")) {
|
||||||
|
clickWindow(latestWindowId, 31);
|
||||||
|
clickWindow(latestWindowId + 1, 11);
|
||||||
|
tries++;
|
||||||
|
Thread.sleep(BED_SPAM_DELAY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception ignored) {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
spam.start();
|
||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
try {
|
try {
|
||||||
Thread.sleep(4000);
|
Thread.sleep(4000);
|
||||||
|
|
|
@ -43,8 +43,6 @@ public class Cofl {
|
||||||
try {
|
try {
|
||||||
if (!isOpen() || !str.startsWith("Received:")) return;
|
if (!isOpen() || !str.startsWith("Received:")) return;
|
||||||
if (pattern.matcher(str).find()) {
|
if (pattern.matcher(str).find()) {
|
||||||
// Random random = new Random();
|
|
||||||
// Lilase.mc.thePlayer.inventory.currentItem = random.nextInt(9);
|
|
||||||
String[] split = str.split("Received: ");
|
String[] split = str.split("Received: ");
|
||||||
JsonObject received = new JsonParser().parse(split[1]).getAsJsonObject();
|
JsonObject received = new JsonParser().parse(split[1]).getAsJsonObject();
|
||||||
if (!received.get("type").getAsString().equals("flip")) return;
|
if (!received.get("type").getAsString().equals("flip")) return;
|
||||||
|
|
|
@ -229,6 +229,8 @@ public class Flipper {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String price = SHORTEN_NUMBERS ? Utils.convertToShort(this.target) : String.valueOf(this.target);
|
String price = SHORTEN_NUMBERS ? Utils.convertToShort(this.target) : String.valueOf(this.target);
|
||||||
|
Utils.debugLog("Long Price: " + this.target);
|
||||||
|
Utils.debugLog("Shorten Price: " + Utils.convertToShort(this.target));
|
||||||
tileSign.signText[0] = new ChatComponentText(price);
|
tileSign.signText[0] = new ChatComponentText(price);
|
||||||
sendPacketWithoutEvent(new C12PacketUpdateSign(tileSign.getPos(), tileSign.signText));
|
sendPacketWithoutEvent(new C12PacketUpdateSign(tileSign.getPos(), tileSign.signText));
|
||||||
state = FlipperState.TIME;
|
state = FlipperState.TIME;
|
||||||
|
|
Loading…
Reference in a new issue