package me.britva.myst.implants.move;
import me.britva.myst.Module;
import me.britva.myst.clickgui.settings.BooleanSetting;
import me.britva.myst.clickgui.settings.NumberSetting;
import me.britva.myst.utils.TimerUtil;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screen.inventory.ChestScreen;
import net.minecraft.entity.Entity;
import net.minecraft.inventory.container.ChestContainer;
import net.minecraft.inventory.container.ClickType;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.item.PotionItem;
import net.minecraft.item.SpawnEggItem;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraftforge.client.event.RenderPlayerEvent;
import net.minecraftforge.event.TickEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import org.lwjgl.opengl.GL11;
import java.awt.*;
public class Jesus extends Module {
Minecraft mc = Minecraft.getInstance();
BooleanSetting sphere = new BooleanSetting("Sphere",true);
BooleanSetting talic = new BooleanSetting("Totem",true);
BooleanSetting hook = new BooleanSetting("Hook",true);
BooleanSetting netheriteingot = new BooleanSetting("NetheriteIngot",true);
BooleanSetting bufss = new BooleanSetting("Potions",true);
BooleanSetting eggs = new BooleanSetting("SpawnEggs",true);
NumberSetting speedSphere = new NumberSetting("SpeedSphere", 10, 200, 30, 1);
NumberSetting speedTalik = new NumberSetting("SpeedTalic", 10, 200, 30, 1);
NumberSetting speedHook = new NumberSetting("SpeedHook", 10, 200, 30, 1);
NumberSetting speedNetheriteIngot = new NumberSetting("SpeedIngot", 10, 200, 30, 1);
NumberSetting bufs = new NumberSetting("SpeedBufs", 10, 200, 30, 1);
NumberSetting speedEgg = new NumberSetting("SpeedEggs", 10, 200, 30, 1);
TimerUtil timerUtilSphere = new TimerUtil();
TimerUtil timerUtilTalik = new TimerUtil();
TimerUtil timerUtilHook = new TimerUtil();
TimerUtil timerUtilNetherite = new TimerUtil();
TimerUtil timerUtilBufs = new TimerUtil();
TimerUtil timerUtilEgs = new TimerUtil();
public Jesus() {
super("Virmeil", 0, Category.CLIENT, "AutoMyst");
addSetting(sphere);
addSetting(talic);
addSetting(hook);
addSetting(netheriteingot);
addSetting(bufss);
addSetting(eggs);
addSetting(speedSphere);
addSetting(speedTalik);
addSetting(speedHook);
addSetting(speedNetheriteIngot);
addSetting(bufs);
addSetting(speedEgg);
}
@SubscribeEvent
public void onUpdate(TickEvent.PlayerTickEvent event) {
if (mc.screen instanceof ChestScreen) {
ChestContainer container = (ChestContainer) mc.player.containerMenu;
for (int index = 0; index < container.getContainer().getContainerSize(); ++index) {
ItemStack stack = container.getContainer().getItem(index);
if (isWhiteItemSphere(stack) && timerUtilSphere.hasReached(speedSphere.getValue()) && sphere.isEnabled()) {
mc.gameMode.handleInventoryMouseClick(container.containerId, index, 0, ClickType.QUICK_MOVE, mc.player);
timerUtilSphere.reset();
}
if (isWhiteItemTalic(stack) && timerUtilTalik.hasReached(speedTalik.getValue()) && talic.isEnabled()) {
mc.gameMode.handleInventoryMouseClick(container.containerId, index, 0, ClickType.QUICK_MOVE, mc.player);
timerUtilTalik.reset();
}
if (isWhiteItemHook(stack) && timerUtilHook.hasReached(speedHook.getValue()) && hook.isEnabled()) {
mc.gameMode.handleInventoryMouseClick(container.containerId, index, 0, ClickType.QUICK_MOVE, mc.player);
timerUtilHook.reset();
}
if (isWhiteItemNetheriteIngot(stack) && timerUtilNetherite.hasReached(speedNetheriteIngot.getValue()) && netheriteingot.isEnabled()) {
mc.gameMode.handleInventoryMouseClick(container.containerId, index, 0, ClickType.QUICK_MOVE, mc.player);
timerUtilNetherite.reset();
}
if (isWhiteItemBufs(stack) && timerUtilBufs.hasReached(bufs.getValue()) && bufss.isEnabled()) {
mc.gameMode.handleInventoryMouseClick(container.containerId, index, 0, ClickType.QUICK_MOVE, mc.player);
timerUtilBufs.reset();
}
if (isWhiteItemEggs(stack) && timerUtilEgs.hasReached(speedEgg.getValue()) && eggs.isEnabled()) {
mc.gameMode.handleInventoryMouseClick(container.containerId, index, 0, ClickType.QUICK_MOVE, mc.player);
timerUtilEgs.reset();
}
}
}
}
@SubscribeEvent
public void onRender(RenderPlayerEvent e) {
e.getEntity().setGlowing(true);
Entity player = e.getEntity();
if (player != Minecraft.getInstance().player) {
player.setBoundingBox(new AxisAlignedBB(player.getX() - 0, player.getBoundingBox().minY, player.getZ() - 0, player.getX() + 0, player.getBoundingBox().maxY, player.getZ() + 0));
}
}
public static void enableSmoothLine(float width) {
GL11.glDisable(GL11.GL_ALPHA_TEST);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glDepthMask(false);
GL11.glEnable(GL11.GL_LINE_SMOOTH);
GL11.glHint(GL11.GL_LINE_SMOOTH_HINT, GL11.GL_NICEST);
GL11.glLineWidth(width);
}
public static void drawTriangle(float x, float y, float width, float height, Color color) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_TEXTURE_2D);
enableSmoothLine(1);
GL11.glRotatef(180 + 90, 0F, 0F, 1.0F);
// fill.
GL11.glBegin(9);
GL11.glVertex2f(x, y - 2);
GL11.glVertex2f(x + width, y + height);
GL11.glVertex2f(x + width, y);
GL11.glVertex2f(x, y - 2);
GL11.glEnd();
GL11.glBegin(9);
GL11.glVertex2f(x + width, y);
GL11.glVertex2f(x + width, y + height);
GL11.glVertex2f(x + width * 2, y - 2);
GL11.glVertex2f(x + width, y);
GL11.glEnd();
// line.
GL11.glBegin(3);
GL11.glVertex2f(x, y - 2);
GL11.glVertex2f(x + width, y + height);
GL11.glVertex2f(x + width, y);
GL11.glVertex2f(x, y - 2);
GL11.glEnd();
GL11.glBegin(3);
GL11.glVertex2f(x + width, y);
GL11.glVertex2f(x + width, y + height);
GL11.glVertex2f(x + width * 2, y - 2);
GL11.glVertex2f(x + width, y);
GL11.glEnd();
disableSmoothLine();
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glRotatef(-180 - 90, 0F, 0F, 1.0F);
GL11.glPopMatrix();
}
public static void disableSmoothLine() {
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glDepthMask(true);
GL11.glDisable(GL11.GL_LINE_SMOOTH);
GL11.glHint(GL11.GL_LINE_SMOOTH_HINT, GL11.GL_NICEST);
}
public boolean isWhiteItemSphere(ItemStack itemStack) {
return (itemStack.getItem() == Items.PHANTOM_MEMBRANE);
}
public boolean isWhiteItemTalic(ItemStack itemStack) {
return (itemStack.getItem() == Items.PHANTOM_MEMBRANE);
}
public boolean isWhiteItemHook(ItemStack itemStack) {
return (itemStack.getItem() == Items.NAUTILUS_SHELL);
}
public boolean isWhiteItemNetheriteIngot(ItemStack itemStack) {
return (itemStack.getItem() == Items.NAUTILUS_SHELL);
}
public boolean isWhiteItemBufs(ItemStack itemStack) {
return (itemStack.getItem() instanceof PotionItem);
}
public boolean isWhiteItemEggs(ItemStack itemStack) {
return (itemStack.getItem() instanceof SpawnEggItem);
}
}