diff --git a/src/main/java/cloudburst/rejects/commands/AntiAntiXrayCommand.java b/src/main/java/cloudburst/rejects/commands/AntiAntiXrayCommand.java index f03802e..bedab78 100644 --- a/src/main/java/cloudburst/rejects/commands/AntiAntiXrayCommand.java +++ b/src/main/java/cloudburst/rejects/commands/AntiAntiXrayCommand.java @@ -4,7 +4,6 @@ import cloudburst.rejects.aax.AntiAntiXray; import cloudburst.rejects.aax.Etc.Config; import com.mojang.brigadier.builder.LiteralArgumentBuilder; import minegame159.meteorclient.systems.commands.Command; -import minegame159.meteorclient.utils.player.ChatUtils; import net.minecraft.command.CommandSource; import static com.mojang.brigadier.Command.SINGLE_SUCCESS; @@ -18,7 +17,7 @@ public class AntiAntiXrayCommand extends Command { public void build(LiteralArgumentBuilder builder) { builder.executes(ctx -> { AntiAntiXray.scanForFake(Config.rad, Config.delay); - ChatUtils.prefixInfo("AAX", "Refreshing blocks"); + info("Refreshing blocks"); return SINGLE_SUCCESS; }); } diff --git a/src/main/java/cloudburst/rejects/commands/BookDupeCommand.java b/src/main/java/cloudburst/rejects/commands/BookDupeCommand.java index 8567dcd..5835edc 100644 --- a/src/main/java/cloudburst/rejects/commands/BookDupeCommand.java +++ b/src/main/java/cloudburst/rejects/commands/BookDupeCommand.java @@ -3,7 +3,6 @@ package cloudburst.rejects.commands; import com.mojang.brigadier.builder.LiteralArgumentBuilder; import com.mojang.brigadier.exceptions.SimpleCommandExceptionType; import minegame159.meteorclient.systems.commands.Command; -import minegame159.meteorclient.utils.player.ChatUtils; import minegame159.meteorclient.utils.player.InvUtils; import net.minecraft.command.CommandSource; import net.minecraft.item.ItemStack; @@ -49,7 +48,7 @@ public class BookDupeCommand extends Command { @Override public void build(LiteralArgumentBuilder builder) { builder.executes(context -> { - if (InvUtils.getHand(Items.WRITABLE_BOOK) != Hand.MAIN_HAND) ChatUtils.prefixError("BOOK DUPE", "No book found, you must be holding a writable book!"); + if (InvUtils.getHand(Items.WRITABLE_BOOK) != Hand.MAIN_HAND) error("No book found, you must be holding a writable book!"); else mc.player.networkHandler.sendPacket(new BookUpdateC2SPacket(DUPE_BOOK, true, mc.player.inventory.selectedSlot)); return SINGLE_SUCCESS; diff --git a/src/main/java/cloudburst/rejects/commands/GiveCommand.java b/src/main/java/cloudburst/rejects/commands/GiveCommand.java index ac45817..f0c7383 100644 --- a/src/main/java/cloudburst/rejects/commands/GiveCommand.java +++ b/src/main/java/cloudburst/rejects/commands/GiveCommand.java @@ -4,15 +4,12 @@ import com.mojang.brigadier.arguments.StringArgumentType; import com.mojang.brigadier.builder.LiteralArgumentBuilder; import net.minecraft.command.CommandSource; -import net.minecraft.command.argument.ItemStackArgument; -import net.minecraft.command.argument.ItemStackArgumentType; import net.minecraft.item.*; import net.minecraft.nbt.*; import net.minecraft.network.packet.c2s.play.CreativeInventoryActionC2SPacket; import cloudburst.rejects.arguments.EnumStringArgumentType; import minegame159.meteorclient.systems.commands.Command; -import minegame159.meteorclient.utils.player.ChatUtils; import minegame159.meteorclient.utils.player.SlotUtils; import net.minecraft.text.LiteralText; import net.minecraft.text.Text; @@ -71,7 +68,7 @@ public class GiveCommand extends Command { builder.then(literal("holo").then(argument("message", StringArgumentType.greedyString()).executes(ctx -> { if (!mc.player.abilities.creativeMode) { - ChatUtils.error("Not In Creative Mode!"); + error("Not In Creative Mode!"); return SINGLE_SUCCESS; } String message = ctx.getArgument("message", String.class); @@ -96,7 +93,7 @@ public class GiveCommand extends Command { builder.then(literal("firework").executes(ctx -> { if (!mc.player.abilities.creativeMode) { - ChatUtils.error("Not In Creative Mode!"); + error("Not In Creative Mode!"); return SINGLE_SUCCESS; } ItemStack firework = new ItemStack(Items.FIREWORK_ROCKET); @@ -128,7 +125,7 @@ public class GiveCommand extends Command { builder.then(literal("head").then(argument("owner",StringArgumentType.greedyString()).executes(ctx -> { if (!mc.player.abilities.creativeMode) { - ChatUtils.error("Not In Creative Mode!"); + error("Not In Creative Mode!"); return SINGLE_SUCCESS; } String playerName = ctx.getArgument("owner",String.class); @@ -143,7 +140,7 @@ public class GiveCommand extends Command { builder.then(literal("preset").then(argument("name", new EnumStringArgumentType(PRESETS)) .then(argument("container", new EnumStringArgumentType(CONTAINERS)).executes(context -> { if (!mc.player.abilities.creativeMode) { - ChatUtils.error("Not In Creative Mode!"); + error("Not In Creative Mode!"); return SINGLE_SUCCESS; } String name = context.getArgument("name", String.class); @@ -160,6 +157,6 @@ public class GiveCommand extends Command { mc.player.networkHandler.sendPacket(new CreativeInventoryActionC2SPacket(SlotUtils.indexToId(i), item)); return; } - ChatUtils.error("No space in inventory."); + error("No space in inventory."); } } diff --git a/src/main/java/cloudburst/rejects/commands/SaveSkinCommand.java b/src/main/java/cloudburst/rejects/commands/SaveSkinCommand.java index 221c2b4..fd5ae9d 100644 --- a/src/main/java/cloudburst/rejects/commands/SaveSkinCommand.java +++ b/src/main/java/cloudburst/rejects/commands/SaveSkinCommand.java @@ -5,9 +5,7 @@ import com.mojang.brigadier.builder.LiteralArgumentBuilder; import minegame159.meteorclient.systems.commands.Command; import minegame159.meteorclient.systems.commands.arguments.PlayerArgumentType; import minegame159.meteorclient.utils.network.HttpUtils; -import minegame159.meteorclient.utils.player.ChatUtils; import net.minecraft.command.CommandSource; -import net.minecraft.command.argument.GameProfileArgumentType; import net.minecraft.entity.player.PlayerEntity; import org.apache.commons.codec.binary.Base64; import org.lwjgl.BufferUtils; diff --git a/src/main/java/cloudburst/rejects/modules/AntiVanish.java b/src/main/java/cloudburst/rejects/modules/AntiVanish.java index 0e9ea4f..d1dfa0d 100644 --- a/src/main/java/cloudburst/rejects/modules/AntiVanish.java +++ b/src/main/java/cloudburst/rejects/modules/AntiVanish.java @@ -12,7 +12,6 @@ import minegame159.meteorclient.events.world.TickEvent; import minegame159.meteorclient.systems.modules.Categories; import minegame159.meteorclient.systems.modules.Module; import minegame159.meteorclient.utils.entity.EntityUtils; -import minegame159.meteorclient.utils.player.ChatUtils; import net.minecraft.client.MinecraftClient; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.network.packet.s2c.play.PlayerListS2CPacket; @@ -63,7 +62,7 @@ public class AntiVanish extends Module { try { String name = getPlayerNameFromUUID(lookup); if (name != null) { - ChatUtils.moduleWarning(this, name + " has gone into vanish."); + warning(name + " has gone into vanish."); } } catch (Exception ignore) {} lastTick = time; diff --git a/src/main/java/cloudburst/rejects/modules/Auto32K.java b/src/main/java/cloudburst/rejects/modules/Auto32K.java index ec150c4..bac07c7 100644 --- a/src/main/java/cloudburst/rejects/modules/Auto32K.java +++ b/src/main/java/cloudburst/rejects/modules/Auto32K.java @@ -15,6 +15,8 @@ import minegame159.meteorclient.systems.modules.Categories; import minegame159.meteorclient.systems.modules.Module; import minegame159.meteorclient.utils.Utils; import minegame159.meteorclient.utils.player.*; +import minegame159.meteorclient.utils.world.BlockUtils; + import net.minecraft.block.Block; import net.minecraft.block.Blocks; import net.minecraft.client.gui.screen.ingame.Generic3x3ContainerScreen; @@ -113,16 +115,14 @@ public class Auto32K extends Module { if(sortedIterator.hasNext()) bestBlock = sortedIterator.next(); if (bestBlock != null) { - mc.player.inventory.selectedSlot = hopperSlot; - while (!PlayerUtils.placeBlock(bestBlock, Hand.MAIN_HAND)) { + while (!BlockUtils.place(bestBlock, Hand.MAIN_HAND,hopperSlot,true,100,false)) { if(sortedIterator.hasNext()) { bestBlock = sortedIterator.next().up(); }else break; } mc.player.setSneaking(true); - mc.player.inventory.selectedSlot = shulkerSlot; - if (!PlayerUtils.placeBlock(bestBlock.up(), Hand.MAIN_HAND)) { - ChatUtils.moduleError(this,"Failed to place."); + if (!BlockUtils.place(bestBlock.up(), Hand.MAIN_HAND, shulkerSlot,true,100,false)) { + error("Failed to place."); this.toggle(); return; } @@ -139,10 +139,9 @@ public class Auto32K extends Module { return; if (phase == 0) { bestBlock = findValidBlocksDispenser(); - mc.player.inventory.selectedSlot = hopperSlot; if(bestBlock == null) return; - if (!PlayerUtils.placeBlock(bestBlock.add(x, 0, z), Hand.MAIN_HAND)) { - ChatUtils.moduleError(this,"Failed to place."); + if (!BlockUtils.place(bestBlock.add(x, 0, z), Hand.MAIN_HAND, hopperSlot, true, 100, false)) { + error("Failed to place."); this.toggle(); return; } diff --git a/src/main/java/cloudburst/rejects/modules/AutoExtinguish.java b/src/main/java/cloudburst/rejects/modules/AutoExtinguish.java index fcf0d87..0b1814a 100644 --- a/src/main/java/cloudburst/rejects/modules/AutoExtinguish.java +++ b/src/main/java/cloudburst/rejects/modules/AutoExtinguish.java @@ -7,10 +7,7 @@ import minegame159.meteorclient.settings.BoolSetting; import minegame159.meteorclient.settings.IntSetting; import minegame159.meteorclient.settings.Setting; import minegame159.meteorclient.settings.SettingGroup; -import minegame159.meteorclient.systems.modules.Categories; import minegame159.meteorclient.systems.modules.Module; -import minegame159.meteorclient.utils.player.ChatUtils; -import minegame159.meteorclient.utils.player.InvUtils; import minegame159.meteorclient.utils.player.PlayerUtils; import minegame159.meteorclient.utils.player.RotationUtils; import minegame159.meteorclient.utils.world.BlockIterator; @@ -98,13 +95,13 @@ public class AutoExtinguish extends Module { private void onTick(TickEvent.Pre event) { if (mc.world.getDimension().isRespawnAnchorWorking()) { if (doesWaterBucketWork) { - ChatUtils.warning("Water Buckets don't work in this dimension!"); + warning("Water Buckets don't work in this dimension!"); doesWaterBucketWork = false; } } else { if (!doesWaterBucketWork) { - ChatUtils.warning("Enabled Water Buckets!"); + warning("Enabled Water Buckets!"); doesWaterBucketWork = true; } } diff --git a/src/main/java/cloudburst/rejects/modules/AutoPot.java b/src/main/java/cloudburst/rejects/modules/AutoPot.java index 6763fb5..d8ece66 100644 --- a/src/main/java/cloudburst/rejects/modules/AutoPot.java +++ b/src/main/java/cloudburst/rejects/modules/AutoPot.java @@ -14,7 +14,6 @@ import minegame159.meteorclient.systems.modules.combat.CrystalAura; import minegame159.meteorclient.systems.modules.combat.KillAura; import minegame159.meteorclient.settings.*; import minegame159.meteorclient.utils.Utils; -import minegame159.meteorclient.utils.player.ChatUtils; import minegame159.meteorclient.utils.player.Rotations; import net.minecraft.entity.effect.StatusEffect; import net.minecraft.entity.effect.StatusEffectInstance; @@ -116,7 +115,7 @@ public class AutoPot extends Module { if (isNotPotion(mc.player.inventory.getStack(slot))) { slot = HealingpotionSlot(); if (slot == -1) { - ChatUtils.moduleInfo(this, "Ran out of Pots while drinking"); + info("Ran out of Pots while drinking"); stopDrinking(); return; } @@ -124,7 +123,7 @@ public class AutoPot extends Module { } drink(); if (ShouldNotDrinkHealth()) { - ChatUtils.moduleInfo(this, "Health Full"); + info("Health Full"); stopDrinking(); return; } @@ -134,14 +133,14 @@ public class AutoPot extends Module { if (isNotSplashPotion(mc.player.inventory.getStack(slot))) { slot = HealingSplashpotionSlot(); if (slot == -1) { - ChatUtils.moduleInfo(this, "Ran out of Pots while splashing"); + info("Ran out of Pots while splashing"); stopSplashing(); return; } else changeSlot(slot); } splash(); if (ShouldNotDrinkHealth()) { - ChatUtils.moduleInfo(this, "Health Full"); + info("Health Full"); stopSplashing(); return; } @@ -169,7 +168,7 @@ public class AutoPot extends Module { slot = StrengthpotionSlot(); if (slot == -1) { stopDrinking(); - ChatUtils.moduleInfo(this, "Out of Pots"); + info("Out of Pots"); return; } else changeSlot(slot); } @@ -183,7 +182,7 @@ public class AutoPot extends Module { if (isNotSplashPotion(mc.player.inventory.getStack(slot))) { slot = StrengthSplashpotionSlot(); if (slot == -1) { - ChatUtils.moduleInfo(this, "Ran out of Pots while splashing"); + info("Ran out of Pots while splashing"); stopSplashing(); return; } else changeSlot(slot); diff --git a/src/main/java/cloudburst/rejects/modules/Lavacast.java b/src/main/java/cloudburst/rejects/modules/Lavacast.java index 6a52833..3ea18b1 100644 --- a/src/main/java/cloudburst/rejects/modules/Lavacast.java +++ b/src/main/java/cloudburst/rejects/modules/Lavacast.java @@ -4,15 +4,12 @@ import cloudburst.rejects.MeteorRejectsAddon; import meteordevelopment.orbit.EventHandler; import minegame159.meteorclient.events.render.RenderEvent; import minegame159.meteorclient.events.world.TickEvent; -import minegame159.meteorclient.systems.modules.Categories; import minegame159.meteorclient.systems.modules.Module; import minegame159.meteorclient.rendering.Renderer; import minegame159.meteorclient.rendering.ShapeMode; -import minegame159.meteorclient.settings.EnumSetting; import minegame159.meteorclient.settings.IntSetting; import minegame159.meteorclient.settings.Setting; import minegame159.meteorclient.settings.SettingGroup; -import minegame159.meteorclient.utils.player.ChatUtils; import minegame159.meteorclient.utils.player.InvUtils; import minegame159.meteorclient.utils.player.Rotations; import minegame159.meteorclient.utils.render.color.SettingColor; @@ -116,11 +113,11 @@ public class Lavacast extends Module { getDistance(new Vec3i(0,0,1)); getDistance(new Vec3i(1,0,-1)); if (dist<1) { - ChatUtils.moduleError(this,"Couldn't locate bottom."); + error("Couldn't locate bottom."); toggle(); return; } - ChatUtils.moduleInfo(this,"Distance: (highlight)%d(default).", dist); + info("Distance: (highlight)%d(default).", dist); } @EventHandler @@ -204,7 +201,7 @@ public class Lavacast extends Module { private void placeLava() { int slot = InvUtils.findItemInHotbar(Items.LAVA_BUCKET); if (slot == -1) { - ChatUtils.moduleError(this,"No lava bucket found."); + error("No lava bucket found."); toggle(); return; } @@ -217,7 +214,7 @@ public class Lavacast extends Module { private void placeWater() { int slot = InvUtils.findItemInHotbar(Items.WATER_BUCKET); if (slot == -1) { - ChatUtils.moduleError(this,"No water bucket found."); + error("No water bucket found."); toggle(); return; } @@ -230,7 +227,7 @@ public class Lavacast extends Module { private void pickupLiquid() { int slot = InvUtils.findItemInHotbar(Items.BUCKET); if (slot == -1) { - ChatUtils.moduleError(this,"No bucket found."); + error("No bucket found."); toggle(); return; } diff --git a/src/main/java/cloudburst/rejects/modules/SoundLocator.java b/src/main/java/cloudburst/rejects/modules/SoundLocator.java index 88c327a..9e314f2 100644 --- a/src/main/java/cloudburst/rejects/modules/SoundLocator.java +++ b/src/main/java/cloudburst/rejects/modules/SoundLocator.java @@ -9,6 +9,7 @@ import minegame159.meteorclient.settings.SoundEventListSetting; import minegame159.meteorclient.systems.modules.Categories; import minegame159.meteorclient.systems.modules.Module; import minegame159.meteorclient.utils.player.ChatUtils; + import net.minecraft.client.sound.SoundInstance; import net.minecraft.client.sound.WeightedSoundSet; import net.minecraft.sound.SoundEvent; @@ -51,6 +52,6 @@ public class SoundLocator extends Module { Vec3d pos = new Vec3d(sound.getX(), sound.getY(), sound.getZ()); text.append(ChatUtils.formatCoords(pos)); text.append(String.format("%s.", Formatting.RESET)); - ChatUtils.moduleInfo(this,text); + info(text); } } diff --git a/src/main/java/cloudburst/rejects/screens/InteractionScreen.java b/src/main/java/cloudburst/rejects/screens/InteractionScreen.java index 905a9a2..bc99e61 100644 --- a/src/main/java/cloudburst/rejects/screens/InteractionScreen.java +++ b/src/main/java/cloudburst/rejects/screens/InteractionScreen.java @@ -6,8 +6,8 @@ import java.util.HashMap; import java.util.function.Consumer; import cloudburst.rejects.modules.InteractionMenu; -import minegame159.meteorclient.systems.commands.commands.PeekCommand; import minegame159.meteorclient.systems.modules.Modules; +import minegame159.meteorclient.utils.render.PeekScreen; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.screen.ChatScreen; @@ -18,12 +18,10 @@ import net.minecraft.entity.mob.EndermanEntity; import net.minecraft.entity.passive.*; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.vehicle.StorageMinecartEntity; -import net.minecraft.inventory.SimpleInventory; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.network.packet.c2s.play.PlayerInputC2SPacket; import net.minecraft.network.packet.c2s.play.PlayerInteractEntityC2SPacket; -import net.minecraft.screen.ShulkerBoxScreenHandler; import org.lwjgl.glfw.GLFW; import com.mojang.blaze3d.platform.GlStateManager; @@ -81,7 +79,9 @@ public class InteractionScreen extends Screen { else { functions.put("Open Inventory", (Entity e) -> { closeScreen(); - client.openScreen(new PeekCommand.PeekShulkerBoxScreen(new ShulkerBoxScreenHandler(0, client.player.inventory, getSimpleInventory(e)), client.player.inventory, entity.getName())); + ItemStack container = new ItemStack(Items.CHEST); + container.setCustomName(e.getName()); + client.openScreen(new PeekScreen(container, getInventory(e))); }); } @@ -132,7 +132,7 @@ public class InteractionScreen extends Screen { functions.put("Cancel", (Entity e) -> {closeScreen();}); } - private SimpleInventory getSimpleInventory(Entity e) { + private ItemStack[] getInventory(Entity e) { ItemStack[] stack = new ItemStack[27]; final int[] index = {0}; if (e instanceof EndermanEntity) { @@ -161,7 +161,7 @@ public class InteractionScreen extends Screen { } }); for (int i = index[0]; i < 27; i++) stack[i] = Items.AIR.getDefaultStack(); - return new SimpleInventory(stack); + return stack; } public void init() {