cookie compatible(should work)

This commit is contained in:
NK 2023-03-08 12:23:36 +00:00
parent de7e52db74
commit 85685e2eb8

View file

@ -4,6 +4,7 @@ import com.google.gson.JsonObject;
import com.google.gson.JsonParser; import com.google.gson.JsonParser;
import me.night0721.lilase.Lilase; import me.night0721.lilase.Lilase;
import me.night0721.lilase.events.SniperFlipperEvents; import me.night0721.lilase.events.SniperFlipperEvents;
import me.night0721.lilase.player.EffectState;
import me.night0721.lilase.player.Rotation; import me.night0721.lilase.player.Rotation;
import me.night0721.lilase.utils.*; import me.night0721.lilase.utils.*;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
@ -11,7 +12,10 @@ import net.minecraft.entity.item.EntityArmorStand;
import net.minecraft.util.StringUtils; import net.minecraft.util.StringUtils;
import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.HttpsURLConnection;
import java.io.*; import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.URL; import java.net.URL;
@ -30,7 +34,7 @@ public class Flipper {
itemprice = price; itemprice = price;
} }
public int getItemPrice() { public int getItemPrice() {
if (object == null) { if (object == null) {
try { try {
object = getItemData(); object = getItemData();
@ -51,8 +55,11 @@ public class Flipper {
Utils.sendMessage("Flipper is running, stopping, will resume when flipper is done"); Utils.sendMessage("Flipper is running, stopping, will resume when flipper is done");
if (Lilase.sniper.getOpen()) Lilase.sniper.toggleAuction(); if (Lilase.sniper.getOpen()) Lilase.sniper.toggleAuction();
UngrabUtils.ungrabMouse(); UngrabUtils.ungrabMouse();
Utils.sendServerMessage("/hub"); Utils.checkFooter();
state = FlipperState.WALKING_TO_FIRST_POINT; if (Utils.cookie != EffectState.ON) {
Utils.sendServerMessage("/hub");
state = FlipperState.WALKING_TO_FIRST_POINT;
} else state = FlipperState.BUYING;
} }
public void switchStates() { public void switchStates() {
@ -75,7 +82,7 @@ public class Flipper {
if (Lilase.mc.currentScreen != null) { if (Lilase.mc.currentScreen != null) {
Lilase.mc.thePlayer.closeScreen(); Lilase.mc.thePlayer.closeScreen();
} else if (AngleUtils.smallestAngleDifference(AngleUtils.get360RotationYaw(), 88f) > 1.2) { } else if (AngleUtils.smallestAngleDifference(AngleUtils.get360RotationYaw(), 88f) > 1.2) {
System.out.println("[Flipper] Rotating to Auction Master"); System.out.println("[Flipper] Rotating to Auction Master");
rotation.easeTo(88f, Lilase.mc.thePlayer.rotationPitch, 500); rotation.easeTo(88f, Lilase.mc.thePlayer.rotationPitch, 500);
} else if (distanceToAuctionMaster() < 0.7f) { } else if (distanceToAuctionMaster() < 0.7f) {
Utils.debugLog("[Flipper] At Auction Master, opening shop"); Utils.debugLog("[Flipper] At Auction Master, opening shop");
@ -89,7 +96,7 @@ public class Flipper {
} }
break; break;
case BUYING: case BUYING:
if (Lilase.mc.currentScreen == null && buyWait.passed()) { if (Utils.cookie != EffectState.ON && Lilase.mc.currentScreen == null && buyWait.passed()) {
final Entity auctionMaster = getAuctionMaster(); final Entity auctionMaster = getAuctionMaster();
if (auctionMaster == null) { if (auctionMaster == null) {
Utils.debugLog("[Flipper] Cannot find shop NPC, retrying"); Utils.debugLog("[Flipper] Cannot find shop NPC, retrying");