fix flipper started when cancel auction
This commit is contained in:
parent
0eb36bd25c
commit
10ed356da9
1 changed files with 29 additions and 34 deletions
|
@ -207,10 +207,30 @@ public class SniperFlipperEvents {
|
|||
|
||||
@SubscribeEvent
|
||||
public void onPacketReceive(PacketReceivedEvent event) {
|
||||
if (AHConfig.BED_SPAM && (Lilase.pageFlipper.getOpen() || Lilase.cofl.getOpen())) {
|
||||
if (event.packet instanceof S2DPacketOpenWindow && ((S2DPacketOpenWindow) event.packet).getGuiId().equals("minecraft:chest")) {
|
||||
S2DPacketOpenWindow packetOpenWindow = (S2DPacketOpenWindow) event.packet;
|
||||
if (packetOpenWindow.getWindowTitle().getUnformattedText().equals("BIN Auction View"))
|
||||
latestWindowId = packetOpenWindow.getWindowId();
|
||||
}
|
||||
if (event.packet instanceof S2FPacketSetSlot) {
|
||||
S2FPacketSetSlot packetSetSlot = (S2FPacketSetSlot) event.packet;
|
||||
ItemStack stack = packetSetSlot.func_149174_e();
|
||||
if (stack != null && packetSetSlot.func_149175_c() == 0) {
|
||||
if (packetSetSlot.func_149173_d() == 31 && stack != null && packetSetSlot.func_149175_c() == latestWindowId) {
|
||||
ItemStack itemStack = packetSetSlot.func_149174_e();
|
||||
Utils.debugLog("Slot 31: " + itemStack.getItem().getRegistryName());
|
||||
if (itemStack.getItem() == Items.bed && clock.passed()) {
|
||||
clickWindow(latestWindowId, 31);
|
||||
clickWindow(latestWindowId + 1, 11);
|
||||
clock.schedule(AHConfig.BED_SPAM_DELAY);
|
||||
} else if (itemStack.getItem() == Items.gold_nugget || Item.getItemFromBlock(Blocks.gold_block) == itemStack.getItem()) {
|
||||
clickWindow(latestWindowId, 31);
|
||||
clickWindow(latestWindowId + 1, 11);
|
||||
} else {
|
||||
Utils.debugLog("Auction was bought by someone else, closing window");
|
||||
Lilase.mc.thePlayer.closeScreen();
|
||||
}
|
||||
} else if (stack != null && packetSetSlot.func_149175_c() == 0) {
|
||||
try {
|
||||
String uuid = stack.getTagCompound().getCompoundTag("ExtraAttributes").getString("uuid");
|
||||
String uid = uuid.split("-")[4];
|
||||
|
@ -237,31 +257,6 @@ public class SniperFlipperEvents {
|
|||
}
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if (AHConfig.BED_SPAM && (Lilase.pageFlipper.getOpen() || Lilase.cofl.getOpen())) {
|
||||
if (event.packet instanceof S2DPacketOpenWindow && ((S2DPacketOpenWindow) event.packet).getGuiId().equals("minecraft:chest")) {
|
||||
S2DPacketOpenWindow packetOpenWindow = (S2DPacketOpenWindow) event.packet;
|
||||
if (packetOpenWindow.getWindowTitle().getUnformattedText().equals("BIN Auction View"))
|
||||
latestWindowId = packetOpenWindow.getWindowId();
|
||||
}
|
||||
if (event.packet instanceof S2FPacketSetSlot) {
|
||||
S2FPacketSetSlot packetSetSlot = (S2FPacketSetSlot) event.packet;
|
||||
if (packetSetSlot.func_149173_d() == 31 && packetSetSlot.func_149174_e() != null && packetSetSlot.func_149175_c() == latestWindowId) {
|
||||
ItemStack itemStack = packetSetSlot.func_149174_e();
|
||||
Utils.debugLog("Slot 31: " + itemStack.getItem().getRegistryName());
|
||||
if (itemStack.getItem() == Items.bed && clock.passed()) {
|
||||
clickWindow(latestWindowId, 31);
|
||||
clickWindow(latestWindowId + 1, 11);
|
||||
clock.schedule(AHConfig.BED_SPAM_DELAY);
|
||||
} else if (itemStack.getItem() == Items.gold_nugget || Item.getItemFromBlock(Blocks.gold_block) == itemStack.getItem()) {
|
||||
clickWindow(latestWindowId, 31);
|
||||
clickWindow(latestWindowId + 1, 11);
|
||||
} else {
|
||||
Utils.debugLog("Auction was bought by someone else, closing window");
|
||||
Lilase.mc.thePlayer.closeScreen();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue