├── .gitattributes ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── src └── main │ ├── resources │ ├── win32-x86 │ │ └── discord-rpc.dll │ ├── darwin │ │ └── libdiscord-rpc.dylib │ ├── win32-x86-64 │ │ └── discord-rpc.dll │ ├── assets │ │ └── pastclient │ │ │ ├── pastcape.png │ │ │ ├── pastlogo.png │ │ │ └── pastbanner.png │ ├── linux-x86-64 │ │ └── libdiscord-rpc.so │ ├── mixins.past.json │ ├── mcmod.info │ └── past_at.cfg │ └── java │ └── me │ └── olliem5 │ └── past │ ├── api │ ├── friend │ │ ├── Friend.java │ │ └── FriendsManager.java │ ├── util │ │ ├── colour │ │ │ ├── RainbowUtil.java │ │ │ └── GUIColourUtil.java │ │ ├── player │ │ │ └── DurabilityUtil.java │ │ ├── client │ │ │ ├── CooldownUtil.java │ │ │ ├── DiscordUtil.java │ │ │ └── MessageUtil.java │ │ └── render │ │ │ ├── text │ │ │ ├── StringUtil.java │ │ │ ├── FontUtil.java │ │ │ └── RenderText.java │ │ │ ├── RenderUtil.java │ │ │ └── RubikUtil.java │ ├── module │ │ ├── ModuleInfo.java │ │ ├── Category.java │ │ ├── Module.java │ │ └── ModuleManager.java │ ├── event │ │ ├── Event.java │ │ └── ForgeEvents.java │ ├── command │ │ ├── Command.java │ │ └── CommandManager.java │ ├── cape │ │ └── CapesManager.java │ ├── mixin │ │ └── MixinLoader.java │ └── setting │ │ ├── SettingsManager.java │ │ └── Setting.java │ ├── impl │ ├── modules │ │ ├── core │ │ │ ├── Capes.java │ │ │ ├── Render.java │ │ │ ├── OldClickGUI.java │ │ │ ├── Font.java │ │ │ ├── HUDEditor.java │ │ │ └── ClickGUI.java │ │ ├── misc │ │ │ ├── DiscordRPC.java │ │ │ ├── FakePlayer.java │ │ │ ├── MCF.java │ │ │ └── EntityAlert.java │ │ ├── exploit │ │ │ ├── XCarry.java │ │ │ ├── PortalGodMode.java │ │ │ ├── Timer.java │ │ │ ├── PacketMine.java │ │ │ ├── Blink.java │ │ │ └── BowBoost.java │ │ ├── movement │ │ │ ├── NoSlow.java │ │ │ ├── Flight.java │ │ │ ├── Velocity.java │ │ │ ├── Step.java │ │ │ └── Sprint.java │ │ ├── player │ │ │ ├── NoRotate.java │ │ │ ├── AutoLog.java │ │ │ ├── Burrow.java │ │ │ ├── WeaknessAlert.java │ │ │ └── FastUse.java │ │ ├── render │ │ │ ├── HandProgress.java │ │ │ ├── ViewModel.java │ │ │ ├── CrystalCustomize.java │ │ │ ├── Fullbright.java │ │ │ ├── Time.java │ │ │ ├── SkyColour.java │ │ │ ├── ESP.java │ │ │ ├── NoRender.java │ │ │ └── BlockHighlight.java │ │ ├── combat │ │ │ ├── ChorusSave.java │ │ │ ├── FootEXP.java │ │ │ ├── AutoTotem.java │ │ │ ├── KillAura.java │ │ │ ├── AutoTrap.java │ │ │ └── Criticals.java │ │ └── chat │ │ │ ├── ChatSuffix.java │ │ │ └── AutoInsult.java │ ├── gui │ │ ├── editor │ │ │ ├── component │ │ │ │ ├── components │ │ │ │ │ ├── Watermark.java │ │ │ │ │ └── Inventory.java │ │ │ │ ├── HudComponentManager.java │ │ │ │ └── HudComponent.java │ │ │ └── screen │ │ │ │ ├── Element.java │ │ │ │ ├── element │ │ │ │ └── HudBooleanComponent.java │ │ │ │ └── HudEditor.java │ │ └── click │ │ │ ├── Component.java │ │ │ ├── clickone │ │ │ ├── components │ │ │ │ ├── ModeComponent.java │ │ │ │ ├── BooleanComponent.java │ │ │ │ ├── KeybindComponent.java │ │ │ │ ├── IntegerComponent.java │ │ │ │ └── DoubleComponent.java │ │ │ ├── ClickGUIOne.java │ │ │ └── Panel.java │ │ │ └── clicktwo │ │ │ ├── ClickGUITwo.java │ │ │ └── components │ │ │ ├── ModeComponent.java │ │ │ └── BooleanComponent.java │ ├── events │ │ ├── PacketEvent.java │ │ └── PlayerDamageBlockEvent.java │ ├── mixins │ │ ├── MixinGuiBossOverlay.java │ │ ├── MixinEntityRenderer.java │ │ ├── MixinGuiMainMenu.java │ │ ├── MixinBlockSoulSand.java │ │ ├── MixinPlayerControllerMP.java │ │ ├── MixinAbstractClientPlayer.java │ │ ├── MixinNetworkManager.java │ │ └── MixinLayerBipedArmor.java │ └── commands │ │ ├── ToggleCommand.java │ │ └── BindCommand.java │ └── Past.java ├── gradle.properties ├── .gitignore ├── README.md ├── LICENSE └── gradlew.bat /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olliem5/past/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /src/main/resources/win32-x86/discord-rpc.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olliem5/past/HEAD/src/main/resources/win32-x86/discord-rpc.dll -------------------------------------------------------------------------------- /src/main/resources/darwin/libdiscord-rpc.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olliem5/past/HEAD/src/main/resources/darwin/libdiscord-rpc.dylib -------------------------------------------------------------------------------- /src/main/resources/win32-x86-64/discord-rpc.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olliem5/past/HEAD/src/main/resources/win32-x86-64/discord-rpc.dll -------------------------------------------------------------------------------- /src/main/resources/assets/pastclient/pastcape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olliem5/past/HEAD/src/main/resources/assets/pastclient/pastcape.png -------------------------------------------------------------------------------- /src/main/resources/assets/pastclient/pastlogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olliem5/past/HEAD/src/main/resources/assets/pastclient/pastlogo.png -------------------------------------------------------------------------------- /src/main/resources/linux-x86-64/libdiscord-rpc.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olliem5/past/HEAD/src/main/resources/linux-x86-64/libdiscord-rpc.so -------------------------------------------------------------------------------- /src/main/resources/assets/pastclient/pastbanner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olliem5/past/HEAD/src/main/resources/assets/pastclient/pastbanner.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/api/friend/Friend.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.api.friend; 2 | 3 | public class Friend { 4 | public String name; 5 | 6 | public Friend(String name) { 7 | this.name = name; 8 | } 9 | 10 | public String getName() { 11 | return name; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/api/util/colour/RainbowUtil.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.api.util.colour; 2 | 3 | import java.awt.*; 4 | 5 | public class RainbowUtil { 6 | public static Color getMultiColour() { 7 | return Color.getHSBColor((float) (System.currentTimeMillis() % 7500L) / 7500f, 0.8f, 0.8f); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Sets default memory used for gradle commands. Can be overridden by user or command line properties. 2 | # This is required to provide enough memory for the Minecraft decompilation process. 3 | org.gradle.jvmargs=-Xmx3G 4 | modGroup=me.olliem5 5 | modVersion=1.6 6 | modBaseName=past 7 | forgeVersion=1.12.2-14.23.5.2768 8 | mcpVersion=snapshot_20180814 9 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/core/Capes.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.core; 2 | 3 | import me.olliem5.past.api.module.Category; 4 | import me.olliem5.past.api.module.Module; 5 | import me.olliem5.past.api.module.ModuleInfo; 6 | 7 | @ModuleInfo(name = "Capes", description = "Controls the usage of client capes", category = Category.CORE) 8 | public class Capes extends Module { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/api/module/ModuleInfo.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.api.module; 2 | 3 | import org.lwjgl.input.Keyboard; 4 | 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | 8 | @Retention(RetentionPolicy.RUNTIME) 9 | public @interface ModuleInfo { 10 | String name(); 11 | String description() default ""; 12 | Category category(); 13 | int key() default Keyboard.KEY_NONE; 14 | } 15 | -------------------------------------------------------------------------------- /src/main/resources/mixins.past.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "compatibilityLevel": "JAVA_8", 4 | "package": "me.olliem5.past.impl.mixins", 5 | "refmap": "mixins.past.refmap.json", 6 | "mixins": [ 7 | "MixinGuiMainMenu", 8 | "MixinNetworkManager", 9 | "MixinBlockSoulSand", 10 | "MixinGuiBossOverlay", 11 | "MixinEntityRenderer", 12 | "MixinLayerBipedArmor", 13 | "MixinPlayerControllerMP", 14 | "MixinAbstractClientPlayer", 15 | "MixinModelEnderCrystal" 16 | ] 17 | } -------------------------------------------------------------------------------- /src/main/resources/mcmod.info: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "modid": "past", 4 | "name": "Past Utility Mod", 5 | "description": "A utility mod for Minecraft 1.12.2, geared towards Anarchy Servers.", 6 | "version": "1.6", 7 | "mcversion": "1.12.2", 8 | "url": "https://github.com/olliem5/past", 9 | "updateUrl": "", 10 | "authorList": ["olliem5"], 11 | "credits": "See GitHub for a full list of credits.", 12 | "logoFile": "assets/pastclient/pastbanner.png", 13 | "screenshots": [], 14 | "dependencies": [] 15 | } 16 | ] 17 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/api/module/Category.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.api.module; 2 | 3 | public enum Category { 4 | COMBAT("Combat"), 5 | MOVEMENT("Movement"), 6 | PLAYER("Player"), 7 | RENDER("Render"), 8 | EXPLOIT("Exploit"), 9 | MISC("Misc"), 10 | CHAT("Chat"), 11 | CORE("Core"); 12 | 13 | private String categoryName; 14 | 15 | Category(String categoryName) { 16 | this.categoryName = categoryName; 17 | } 18 | 19 | public String getCategoryName() { 20 | return this.categoryName; 21 | } 22 | } -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/api/util/player/DurabilityUtil.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.api.util.player; 2 | 3 | import net.minecraft.item.ItemStack; 4 | 5 | public class DurabilityUtil { 6 | public static int getItemDamage(ItemStack stack) { 7 | return stack.getMaxDamage() - stack.getItemDamage(); 8 | } 9 | 10 | public static float getDamageInPercent(ItemStack stack) { 11 | return (getItemDamage(stack) / (float) stack.getMaxDamage()) * 100; 12 | } 13 | 14 | public static int getRoundedDamage(ItemStack stack) { 15 | return (int) getDamageInPercent(stack); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/api/util/client/CooldownUtil.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.api.util.client; 2 | 3 | public class CooldownUtil { 4 | private long time; 5 | 6 | public CooldownUtil() { 7 | time = -1; 8 | } 9 | 10 | public boolean passed(double ms) { 11 | return System.currentTimeMillis() - this.time >= ms; 12 | } 13 | 14 | public void reset() { 15 | this.time = System.currentTimeMillis(); 16 | } 17 | 18 | public long getTime() { 19 | return time; 20 | } 21 | 22 | public void setTime(long time) { 23 | this.time = time; 24 | } 25 | } -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/gui/editor/component/components/Watermark.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.gui.editor.component.components; 2 | 3 | import me.olliem5.past.Past; 4 | import me.olliem5.past.impl.gui.editor.component.HudComponent; 5 | 6 | public class Watermark extends HudComponent { 7 | public Watermark() { 8 | super("Watermark"); 9 | 10 | setWidth(mc.fontRenderer.getStringWidth(Past.NAME_VERSION)); 11 | setHeight(mc.fontRenderer.FONT_HEIGHT); 12 | } 13 | 14 | public void render(float ticks) { 15 | mc.fontRenderer.drawStringWithShadow(Past.NAME_VERSION, getX(), getY(), -1); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/api/event/Event.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.api.event; 2 | 3 | import me.zero.alpine.type.Cancellable; 4 | import net.minecraft.client.Minecraft; 5 | 6 | public class Event extends Cancellable { 7 | private Era era = Era.PRE; 8 | private final float partialTicks; 9 | 10 | public Event() { 11 | partialTicks = Minecraft.getMinecraft().getRenderPartialTicks(); 12 | } 13 | 14 | public Era getEra() { 15 | return era; 16 | } 17 | 18 | public float getPartialTicks() { 19 | return partialTicks; 20 | } 21 | 22 | public enum Era { 23 | PRE, PERI, POST 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/api/command/Command.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.api.command; 2 | 3 | public class Command { 4 | private String name; 5 | private String description; 6 | private String syntax; 7 | 8 | public Command(String name, String description, String syntax) { 9 | this.name = name; 10 | this.description = description; 11 | this.syntax = syntax; 12 | } 13 | 14 | public String getName() { 15 | return name; 16 | } 17 | 18 | public String getDescription() { 19 | return description; 20 | } 21 | 22 | public String getSyntax() { 23 | return syntax; 24 | } 25 | 26 | public void runCommand(String[] args) {} 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/misc/DiscordRPC.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.misc; 2 | 3 | import me.olliem5.past.api.module.Category; 4 | import me.olliem5.past.api.module.Module; 5 | import me.olliem5.past.api.module.ModuleInfo; 6 | import me.olliem5.past.api.util.client.DiscordUtil; 7 | 8 | @ModuleInfo(name = "DiscordRPC", description = "Shows off Past on discord", category = Category.MISC) 9 | public class DiscordRPC extends Module { 10 | 11 | /** 12 | * TODO: Customisation 13 | */ 14 | 15 | @Override 16 | public void onEnable() { 17 | DiscordUtil.startup(); 18 | } 19 | 20 | @Override 21 | public void onDisable() { 22 | DiscordUtil.shutdown(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/gui/click/Component.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.gui.click; 2 | 3 | import net.minecraft.client.Minecraft; 4 | 5 | public class Component { 6 | protected Minecraft mc = Minecraft.getMinecraft(); 7 | 8 | public void renderComponent() {} 9 | 10 | public void updateComponent(int mouseX, int mouseY) {} 11 | 12 | public void mouseClicked(int mouseX, int mouseY, int button) {} 13 | 14 | public void mouseReleased(int mouseX, int mouseY, int mouseButton) {} 15 | 16 | public void keyTyped(char typedChar, int key) {} 17 | 18 | public void closeAllSub() {} 19 | 20 | public void setOff(final int newOff) {} 21 | 22 | public int getHeight() { 23 | return 0; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/gui/editor/screen/Element.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.gui.editor.screen; 2 | 3 | import net.minecraft.client.Minecraft; 4 | 5 | public class Element { 6 | protected Minecraft mc = Minecraft.getMinecraft(); 7 | 8 | public void renderElement() {} 9 | 10 | public void updateElement(int mouseX, int mouseY) {} 11 | 12 | public void mouseClicked(int mouseX, int mouseY, int button) {} 13 | 14 | public void mouseReleased(int mouseX, int mouseY, int mouseButton) {} 15 | 16 | public void keyTyped(char typedChar, int key) {} 17 | 18 | public void closeAllSub() {} 19 | 20 | public void setOff(final int newOff) {} 21 | 22 | public int getHeight() { 23 | return 0; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/events/PacketEvent.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.events; 2 | 3 | import me.olliem5.past.api.event.Event; 4 | import net.minecraft.network.Packet; 5 | 6 | public class PacketEvent extends Event { 7 | private final Packet packet; 8 | 9 | public PacketEvent(Packet packet) { 10 | super(); 11 | this.packet = packet; 12 | } 13 | 14 | public Packet getPacket() { 15 | return packet; 16 | } 17 | 18 | public static class Receive extends PacketEvent { 19 | public Receive(Packet packet) { 20 | super(packet); 21 | } 22 | } 23 | 24 | public static class Send extends PacketEvent { 25 | public Send(Packet packet) { 26 | super(packet); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/events/PlayerDamageBlockEvent.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.events; 2 | 3 | import me.olliem5.past.api.event.Event; 4 | import net.minecraft.util.EnumFacing; 5 | import net.minecraft.util.math.BlockPos; 6 | 7 | public class PlayerDamageBlockEvent extends Event { 8 | private BlockPos blockPos; 9 | private EnumFacing enumFacing; 10 | 11 | public PlayerDamageBlockEvent(BlockPos posBlock, EnumFacing directionFacing) { 12 | blockPos = posBlock; 13 | setDirection(directionFacing); 14 | } 15 | 16 | public BlockPos getPos() { 17 | return blockPos; 18 | } 19 | 20 | public EnumFacing getDirection() { 21 | return enumFacing; 22 | } 23 | 24 | public void setDirection(EnumFacing direction) { 25 | enumFacing = direction; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/mixins/MixinGuiBossOverlay.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.mixins; 2 | 3 | import me.olliem5.past.Past; 4 | import net.minecraft.client.gui.GuiBossOverlay; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 9 | 10 | @Mixin(GuiBossOverlay.class) 11 | public class MixinGuiBossOverlay { 12 | @Inject(method = "renderBossHealth", at = @At("HEAD"), cancellable = true) 13 | private void renderBossHealth(CallbackInfo callbackInfo) { 14 | if (Past.moduleManager.getModuleByName("NoRender").isToggled() && Past.settingsManager.getSettingID("NoRenderBossBar").getValBoolean()) { 15 | callbackInfo.cancel(); 16 | } 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/mixins/MixinEntityRenderer.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.mixins; 2 | 3 | import me.olliem5.past.Past; 4 | import net.minecraft.client.renderer.EntityRenderer; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 9 | 10 | @Mixin(EntityRenderer.class) 11 | public class MixinEntityRenderer { 12 | @Inject(method = "hurtCameraEffect", at = @At("HEAD"), cancellable = true) 13 | public void hurtCameraEffect(float ticks, CallbackInfo callbackInfo) { 14 | if (Past.moduleManager.getModuleByName("NoRender").isToggled() && Past.settingsManager.getSettingID("NoRenderHurtCam").getValBoolean()) { 15 | callbackInfo.cancel(); 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/exploit/XCarry.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.exploit; 2 | 3 | import me.olliem5.past.api.module.ModuleInfo; 4 | import me.olliem5.past.impl.events.PacketEvent; 5 | import me.olliem5.past.api.module.Category; 6 | import me.olliem5.past.api.module.Module; 7 | import me.zero.alpine.listener.EventHandler; 8 | import me.zero.alpine.listener.Listener; 9 | import net.minecraft.network.play.client.CPacketCloseWindow; 10 | 11 | @ModuleInfo(name = "XCarry", description = "Allows you to store items in crafting slots", category = Category.EXPLOIT) 12 | public class XCarry extends Module { 13 | 14 | @EventHandler 15 | public Listener listener = new Listener<>(event -> { 16 | if (event.getPacket() instanceof CPacketCloseWindow) { 17 | event.cancel(); 18 | } 19 | }); 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/core/Render.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.core; 2 | 3 | import me.olliem5.past.Past; 4 | import me.olliem5.past.api.module.Category; 5 | import me.olliem5.past.api.module.Module; 6 | import me.olliem5.past.api.module.ModuleInfo; 7 | import me.olliem5.past.api.setting.Setting; 8 | 9 | @ModuleInfo(name = "Render", description = "Changes values for client rendering", category = Category.CORE) 10 | public class Render extends Module { 11 | 12 | /** 13 | * Just to store values for RenderUtil.java 14 | */ 15 | 16 | Setting linewidth; 17 | 18 | @Override 19 | public void setup() { 20 | Past.settingsManager.registerSetting(linewidth = new Setting("Line Width", "RenderLineWidth", 1, 3, 5, this)); 21 | } 22 | 23 | @Override 24 | public void onEnable() { 25 | toggle(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/api/util/render/text/StringUtil.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.api.util.render.text; 2 | 3 | import java.util.regex.Pattern; 4 | 5 | public class StringUtil { 6 | public static final Pattern COLOR_CODE_PATTERN = Pattern.compile("(?i)\\u00A7[0-9A-FK-OR]"); 7 | 8 | public static String simpleTranslateColors(String string) { 9 | return string.replace("&", "\u00A7"); 10 | } 11 | 12 | public static String capitalizeFirstLetter(String string) { 13 | return string.substring(0, 1).toUpperCase() + string.substring(1); 14 | } 15 | 16 | // public static int getStringWidth(String text) { 17 | // return FontUtil.getStringWidth(stripColors(text)); 18 | // } 19 | 20 | public static String stripColors(String string) { 21 | return COLOR_CODE_PATTERN.matcher(simpleTranslateColors(string)).replaceAll(""); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/exploit/PortalGodMode.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.exploit; 2 | 3 | import me.olliem5.past.api.module.ModuleInfo; 4 | import me.olliem5.past.impl.events.PacketEvent; 5 | import me.olliem5.past.api.module.Category; 6 | import me.olliem5.past.api.module.Module; 7 | import me.zero.alpine.listener.EventHandler; 8 | import me.zero.alpine.listener.Listener; 9 | import net.minecraft.network.play.client.CPacketConfirmTeleport; 10 | 11 | @ModuleInfo(name = "PortalGodMode", description = "Temporary godmode when going through a portal", category = Category.EXPLOIT) 12 | public class PortalGodMode extends Module { 13 | 14 | @EventHandler 15 | public Listener listener = new Listener<>(event -> { 16 | if (event.getPacket() instanceof CPacketConfirmTeleport) { 17 | event.cancel(); 18 | } 19 | }); 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/gui/editor/component/HudComponentManager.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.gui.editor.component; 2 | 3 | import me.olliem5.past.impl.gui.editor.component.components.Inventory; 4 | import me.olliem5.past.impl.gui.editor.component.components.Watermark; 5 | 6 | import java.util.ArrayList; 7 | 8 | public class HudComponentManager { 9 | public ArrayList hudComponents = new ArrayList<>(); 10 | 11 | public HudComponentManager() { 12 | hudComponents.add(new Watermark()); 13 | hudComponents.add(new Inventory()); 14 | } 15 | 16 | public ArrayList getHudComponents() { 17 | return hudComponents; 18 | } 19 | 20 | public HudComponent getHudComponentByName(String name) { 21 | return hudComponents.stream().filter(hudComponent -> hudComponent.getName().equalsIgnoreCase(name)).findFirst().orElse(null); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/movement/NoSlow.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.movement; 2 | 3 | import me.olliem5.past.api.module.Category; 4 | import me.olliem5.past.api.module.Module; 5 | import me.olliem5.past.api.module.ModuleInfo; 6 | import me.zero.alpine.listener.EventHandler; 7 | import me.zero.alpine.listener.Listener; 8 | import net.minecraftforge.client.event.InputUpdateEvent; 9 | 10 | @ModuleInfo(name = "NoSlow", description = "Prevents items/blocks from slowing you down", category = Category.MOVEMENT) 11 | public class NoSlow extends Module { 12 | 13 | //Check MixinBlockSoulSand 14 | 15 | @EventHandler 16 | public Listener listener = new Listener<>(event -> { 17 | if (mc.player.isHandActive() && !mc.player.isRiding()) { 18 | event.getMovementInput().moveStrafe *= 5; 19 | event.getMovementInput().moveForward *= 5; 20 | } 21 | }); 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/mixins/MixinGuiMainMenu.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.mixins; 2 | 3 | import net.minecraft.client.gui.GuiMainMenu; 4 | import net.minecraft.client.gui.GuiScreen; 5 | import net.minecraft.util.ResourceLocation; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(GuiMainMenu.class) 12 | public class MixinGuiMainMenu extends GuiScreen { 13 | @Inject(method = "drawScreen", at = @At("TAIL"), cancellable = true) 14 | public void drawText(int mouseX, int mouseY, float partialTicks, CallbackInfo callbackInfo) { 15 | ResourceLocation resourceLocation = new ResourceLocation("pastclient", "pastbanner.png"); 16 | mc.getTextureManager().bindTexture(resourceLocation); 17 | this.drawModalRectWithCustomSizedTexture(2, 2, 0, 0, 160, 32, 160, 32); 18 | } 19 | } -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/mixins/MixinBlockSoulSand.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.mixins; 2 | 3 | import me.olliem5.past.Past; 4 | import net.minecraft.block.BlockSoulSand; 5 | import net.minecraft.block.state.IBlockState; 6 | import net.minecraft.entity.Entity; 7 | import net.minecraft.util.math.BlockPos; 8 | import net.minecraft.world.World; 9 | import org.spongepowered.asm.mixin.Mixin; 10 | import org.spongepowered.asm.mixin.injection.At; 11 | import org.spongepowered.asm.mixin.injection.Inject; 12 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 13 | 14 | @Mixin(BlockSoulSand.class) 15 | public class MixinBlockSoulSand { 16 | @Inject(method = "onEntityCollision", at = @At("HEAD"), cancellable = true) 17 | public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn, CallbackInfo callbackInfo) { 18 | if (Past.moduleManager.getModuleByName("NoSlow").isToggled()) { 19 | callbackInfo.cancel(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Build # 2 | ######### 3 | MANIFEST.MF 4 | dependency-reduced-pom.xml 5 | 6 | # Compiled # 7 | ############ 8 | bin 9 | build 10 | classes 11 | dist 12 | lib 13 | libs 14 | out 15 | run 16 | target 17 | *.com 18 | *.class 19 | *.dll 20 | *.exe 21 | *.o 22 | *.so 23 | 24 | # Databases # 25 | ############# 26 | *.db 27 | *.sql 28 | *.sqlite 29 | 30 | # Packages # 31 | ############ 32 | *.7z 33 | *.dmg 34 | *.gz 35 | *.iso 36 | *.rar 37 | *.tar 38 | *.zip 39 | 40 | # Repository # 41 | ############## 42 | .git 43 | 44 | # Logging # 45 | ########### 46 | /logs 47 | *.log 48 | 49 | # Misc # 50 | ######## 51 | *.bak 52 | 53 | # System # 54 | ########## 55 | .DS_Store 56 | ehthumbs.db 57 | Thumbs.db 58 | *.sh 59 | 60 | # Project # 61 | ########### 62 | .checkstyle 63 | .classpath 64 | .externalToolBuilders 65 | .gradle 66 | .nb-gradle 67 | .idea 68 | .project 69 | .settings 70 | eclipse 71 | nbproject 72 | atlassian-ide-plugin.xml 73 | build.xml 74 | nb-configuration.xml 75 | *.iml 76 | *.ipr 77 | *.iws 78 | *.launch 79 | *.number 80 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/player/NoRotate.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.player; 2 | 3 | import me.olliem5.past.api.module.ModuleInfo; 4 | import me.olliem5.past.impl.events.PacketEvent; 5 | import me.olliem5.past.api.module.Category; 6 | import me.olliem5.past.api.module.Module; 7 | import me.zero.alpine.listener.EventHandler; 8 | import me.zero.alpine.listener.Listener; 9 | import net.minecraft.network.play.server.SPacketPlayerPosLook; 10 | 11 | @ModuleInfo(name = "NoRotate", description = "Blocks server side rotations", category = Category.PLAYER) 12 | public class NoRotate extends Module { 13 | 14 | @EventHandler 15 | public Listener listener = new Listener<>(event -> { 16 | if (mc.player == null) return; 17 | 18 | if (event.getPacket() instanceof SPacketPlayerPosLook) { 19 | SPacketPlayerPosLook packet = (SPacketPlayerPosLook) event.getPacket(); 20 | packet.pitch = mc.player.rotationPitch; 21 | packet.yaw = mc.player.rotationYaw; 22 | } 23 | }); 24 | } 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![logo](https://github.com/olliem5/past/blob/master/src/main/resources/assets/pastclient/pastbanner.png) 2 | 3 | ## Past 4 | * This project was started by olliem5 in September 2020, to become more familiar with Java. 5 | * I don't recommend using this client as reference code for your own client, or to use it as a base for a client, due to most of the code being outdated. 6 | 7 | #### Going Forward 8 | * I will no longer be maintaining this client, if someone else wants to, contributions will always be welome. 9 | 10 | #### Credits 11 | * When creating this, I used other open-source projects as refrence code, or used a bit of code from them. They are listed below, and in the class with the code. 12 | 13 | * [Kami](https://github.com/zeroeightysix/KAMI) 14 | * [Wurst+2](https://github.com/TrvsF/wurstplus-two) 15 | * [SalHack](https://github.com/ionar2/spidermod) 16 | * [GameSense](https://github.com/IUDevman/gamesense-client) 17 | 18 | * If you feel that I have not credited you properly, please, let me know on Discord (ollie#0057), and I'll add it in a comment, as well as here. 19 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/exploit/Timer.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.exploit; 2 | 3 | import com.mojang.realmsclient.gui.ChatFormatting; 4 | import me.olliem5.past.Past; 5 | import me.olliem5.past.api.module.Category; 6 | import me.olliem5.past.api.module.Module; 7 | import me.olliem5.past.api.module.ModuleInfo; 8 | import me.olliem5.past.api.setting.Setting; 9 | 10 | @ModuleInfo(name = "Timer", description = "Changes the client's tick speed (TPS)", category = Category.EXPLOIT) 11 | public class Timer extends Module { 12 | 13 | Setting speed; 14 | 15 | @Override 16 | public void setup() { 17 | Past.settingsManager.registerSetting(speed = new Setting("Speed", "TimerSpeed", 1.0, 3.7, 20.0, this)); 18 | } 19 | 20 | public void onUpdate() { 21 | mc.timer.tickLength = 50f / (float) speed.getValueDouble(); 22 | } 23 | 24 | @Override 25 | public void onDisable() { 26 | mc.timer.tickLength = 50f; 27 | } 28 | 29 | public String getArraylistInfo() { 30 | return ChatFormatting.GRAY + " " + speed.getValueDouble(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 ollie 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/api/cape/CapesManager.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.api.cape; 2 | 3 | import me.olliem5.past.Past; 4 | 5 | import java.io.BufferedReader; 6 | import java.io.InputStreamReader; 7 | import java.net.URL; 8 | import java.util.ArrayList; 9 | import java.util.List; 10 | import java.util.UUID; 11 | 12 | /** 13 | * @author Hoosiers 14 | */ 15 | 16 | public class CapesManager { 17 | public List uuidList = new ArrayList<>(); 18 | 19 | public CapesManager() { 20 | try { 21 | URL capesPaste = new URL("https://pastebin.com/raw/RJb3cDEr"); 22 | BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(capesPaste.openStream())); 23 | String line; 24 | while ((line = bufferedReader.readLine()) != null) { 25 | uuidList.add(UUID.fromString(line)); 26 | } 27 | } catch (Exception e) { 28 | Past.log("Cape reading from URL failed! Do you an internet connection?"); 29 | } 30 | } 31 | 32 | public boolean hasCape(UUID uuid) { 33 | return uuidList.contains(uuid); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/core/OldClickGUI.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.core; 2 | 3 | import me.olliem5.past.Past; 4 | import me.olliem5.past.api.module.Category; 5 | import me.olliem5.past.api.module.Module; 6 | import me.olliem5.past.api.module.ModuleInfo; 7 | import me.olliem5.past.api.setting.Setting; 8 | 9 | @ModuleInfo(name = "OldClickGUI", description = "Opens Past's old ClickGUI", category = Category.CORE) 10 | public class OldClickGUI extends Module { 11 | 12 | Setting rgb; 13 | Setting background; 14 | Setting descriptions; 15 | 16 | @Override 17 | public void setup() { 18 | Past.settingsManager.registerSetting(rgb = new Setting("RainbowGUI", "OldClickGUIRainbow", true, this)); 19 | Past.settingsManager.registerSetting(background = new Setting("Background", "OldClickGUIBackground", true, this)); 20 | Past.settingsManager.registerSetting(descriptions = new Setting("Descriptions", "OldClickGUIDescriptions", true, this)); 21 | } 22 | 23 | public void onEnable() { 24 | mc.displayGuiScreen(Past.clickGUIOne); 25 | toggle(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/api/util/colour/GUIColourUtil.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.api.util.colour; 2 | 3 | import me.olliem5.past.Past; 4 | import me.olliem5.past.api.util.colour.ColourListUtil; 5 | 6 | public class GUIColourUtil { 7 | public static int getGUIColour() { 8 | return ColourListUtil.toRGBA( 9 | Past.settingsManager.getSettingID("ClickGUIRed").getValueInt(), 10 | Past.settingsManager.getSettingID("ClickGUIGreen").getValueInt(), 11 | Past.settingsManager.getSettingID("ClickGUIBlue").getValueInt(), 12 | Past.settingsManager.getSettingID("ClickGUIAlpha").getValueInt() 13 | ); 14 | } 15 | 16 | public static int getHudEditorColour() { 17 | return ColourListUtil.toRGBA( 18 | Past.settingsManager.getSettingID("HudEditorRed").getValueInt(), 19 | Past.settingsManager.getSettingID("HudEditorGreen").getValueInt(), 20 | Past.settingsManager.getSettingID("HudEditorBlue").getValueInt(), 21 | Past.settingsManager.getSettingID("HudEditorAlpha").getValueInt() 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/core/Font.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.core; 2 | 3 | import me.olliem5.past.Past; 4 | import me.olliem5.past.api.module.Category; 5 | import me.olliem5.past.api.module.Module; 6 | import me.olliem5.past.api.module.ModuleInfo; 7 | import me.olliem5.past.api.setting.Setting; 8 | 9 | import java.util.ArrayList; 10 | 11 | @ModuleInfo(name = "Font", description = "Changes the font that Past uses", category = Category.CORE) 12 | public class Font extends Module { 13 | 14 | Setting font; 15 | Setting shadow; 16 | 17 | public ArrayList fonts; 18 | 19 | @Override 20 | public void setup() { 21 | fonts = new ArrayList<>(); 22 | fonts.add("Lato"); 23 | fonts.add("Verdana"); 24 | fonts.add("Arial"); 25 | fonts.add("Minecraft"); 26 | 27 | Past.settingsManager.registerSetting(font = new Setting("Font", "FontFont", this, fonts, "Lato")); 28 | Past.settingsManager.registerSetting(shadow = new Setting("Shadow", "FontShadow", true, this)); 29 | } 30 | 31 | @Override 32 | public void onEnable() { 33 | toggle(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/render/HandProgress.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.render; 2 | 3 | import me.olliem5.past.Past; 4 | import me.olliem5.past.api.module.Category; 5 | import me.olliem5.past.api.module.Module; 6 | import me.olliem5.past.api.module.ModuleInfo; 7 | import me.olliem5.past.api.setting.Setting; 8 | 9 | @ModuleInfo(name = "HandProgress", description = "Changes your hand progress", category = Category.RENDER) 10 | public class HandProgress extends Module { 11 | 12 | Setting mainhand; 13 | Setting offhand; 14 | 15 | @Override 16 | public void setup() { 17 | Past.settingsManager.registerSetting(mainhand = new Setting("Main Hand", "HandProgressMainHand", 0.0, 1.0, 1.0, this)); 18 | Past.settingsManager.registerSetting(offhand = new Setting("Off Hand", "HandProgressOffHand", 0.0, 1.0, 1.0, this)); 19 | } 20 | 21 | public void onUpdate() { 22 | if (nullCheck()) return; 23 | 24 | mc.entityRenderer.itemRenderer.equippedProgressMainHand = (float) mainhand.getValueDouble(); 25 | mc.entityRenderer.itemRenderer.equippedProgressOffHand = (float) offhand.getValueDouble(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/mixins/MixinPlayerControllerMP.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.mixins; 2 | 3 | import me.olliem5.past.Past; 4 | import me.olliem5.past.impl.events.PlayerDamageBlockEvent; 5 | import net.minecraft.client.multiplayer.PlayerControllerMP; 6 | import net.minecraft.util.EnumFacing; 7 | import net.minecraft.util.math.BlockPos; 8 | import org.spongepowered.asm.mixin.Mixin; 9 | import org.spongepowered.asm.mixin.injection.At; 10 | import org.spongepowered.asm.mixin.injection.Inject; 11 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 12 | 13 | @Mixin(PlayerControllerMP.class) 14 | public class MixinPlayerControllerMP { 15 | @Inject(method = "onPlayerDamageBlock", at = @At("HEAD"), cancellable = true) 16 | public void onPlayerDamageBlock(BlockPos blockPos, EnumFacing enumFacing, CallbackInfoReturnable callbackInfoReturnable) { 17 | PlayerDamageBlockEvent event = new PlayerDamageBlockEvent(blockPos, enumFacing); 18 | Past.EVENT_BUS.post(event); 19 | 20 | if (event.isCancelled()) { 21 | callbackInfoReturnable.setReturnValue(false); 22 | callbackInfoReturnable.cancel(); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/api/command/CommandManager.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.api.command; 2 | 3 | import me.olliem5.past.Past; 4 | import me.olliem5.past.impl.commands.BindCommand; 5 | import me.olliem5.past.impl.commands.ToggleCommand; 6 | import me.zero.alpine.listener.EventHandler; 7 | import me.zero.alpine.listener.Listener; 8 | import net.minecraftforge.client.event.ClientChatEvent; 9 | 10 | import java.util.ArrayList; 11 | 12 | public class CommandManager { 13 | public CommandManager() { 14 | Past.EVENT_BUS.subscribe(this); 15 | init(); 16 | } 17 | 18 | public String prefix = "@"; 19 | 20 | public ArrayList commands = new ArrayList<>(); 21 | 22 | public void init() { 23 | commands.add(new ToggleCommand()); 24 | commands.add(new BindCommand()); 25 | } 26 | 27 | @EventHandler 28 | public Listener listener = new Listener<>(event -> { 29 | String[] args = event.getMessage().split(" "); 30 | if (event.getMessage().startsWith(prefix)) { 31 | event.setCanceled(true); 32 | for (Command command : commands) { 33 | if (args[0].equalsIgnoreCase(prefix + command.getName())) { 34 | command.runCommand(args); 35 | } 36 | } 37 | } 38 | }); 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/mixins/MixinAbstractClientPlayer.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.mixins; 2 | 3 | import me.olliem5.past.Past; 4 | import net.minecraft.client.entity.AbstractClientPlayer; 5 | import net.minecraft.client.network.NetworkPlayerInfo; 6 | import net.minecraft.util.ResourceLocation; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.Shadow; 9 | import org.spongepowered.asm.mixin.injection.At; 10 | import org.spongepowered.asm.mixin.injection.Inject; 11 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 12 | 13 | import javax.annotation.Nullable; 14 | import java.util.UUID; 15 | 16 | @Mixin(AbstractClientPlayer.class) 17 | public abstract class MixinAbstractClientPlayer { 18 | 19 | @Shadow 20 | @Nullable 21 | protected abstract NetworkPlayerInfo getPlayerInfo(); 22 | 23 | @Inject(method = "getLocationCape", at = @At("HEAD"), cancellable = true) 24 | public void getLocationCape(CallbackInfoReturnable callbackInfoReturnable) { 25 | UUID uuid = getPlayerInfo().getGameProfile().getId(); 26 | if (Past.moduleManager.getModuleByName("Capes").isToggled() && Past.capesManager.hasCape(uuid)) { 27 | callbackInfoReturnable.setReturnValue(new ResourceLocation("pastclient:pastcape.png")); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/api/mixin/MixinLoader.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.api.mixin; 2 | 3 | import me.olliem5.past.Past; 4 | import net.minecraftforge.common.ForgeVersion; 5 | import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin; 6 | import org.spongepowered.asm.launch.MixinBootstrap; 7 | import org.spongepowered.asm.mixin.MixinEnvironment; 8 | import org.spongepowered.asm.mixin.Mixins; 9 | 10 | import java.util.Map; 11 | 12 | @IFMLLoadingPlugin.MCVersion(ForgeVersion.mcVersion) 13 | public class MixinLoader implements IFMLLoadingPlugin { 14 | 15 | public MixinLoader() { 16 | Past.log("Injecting Mixins!"); 17 | MixinBootstrap.init(); 18 | Mixins.addConfiguration("mixins.past.json"); 19 | MixinEnvironment.getDefaultEnvironment().setSide(MixinEnvironment.Side.CLIENT); 20 | Past.log("Mixins Injected!"); 21 | } 22 | 23 | @Override 24 | public String[] getASMTransformerClass() { 25 | return new String[0]; 26 | } 27 | 28 | @Override 29 | public String getModContainerClass() { 30 | return null; 31 | } 32 | 33 | @Override 34 | public String getSetupClass() { 35 | return null; 36 | } 37 | 38 | @Override 39 | public String getAccessTransformerClass() { 40 | return null; 41 | } 42 | 43 | @Override 44 | public void injectData(Map data) {} 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/commands/ToggleCommand.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.commands; 2 | 3 | import com.mojang.realmsclient.gui.ChatFormatting; 4 | import me.olliem5.past.Past; 5 | import me.olliem5.past.api.command.Command; 6 | import me.olliem5.past.api.module.Module; 7 | import me.olliem5.past.api.util.client.MessageUtil; 8 | 9 | public class ToggleCommand extends Command { 10 | public ToggleCommand() { 11 | super("toggle", "Allows you to toggle a module.","toggle" + " " + "[module]"); 12 | } 13 | 14 | @Override 15 | public void runCommand(String[] args) { 16 | if (args.length > 1) { 17 | try { 18 | for (Module m : Past.moduleManager.getModules()) { 19 | if (m.getName().equalsIgnoreCase(args[1])) { 20 | m.toggle(); 21 | if (m.isToggled()) { 22 | MessageUtil.sendMessagePrefix(ChatFormatting.AQUA + m.getName() + ChatFormatting.WHITE + " has been " + ChatFormatting.GREEN + "enabled"); 23 | } else { 24 | MessageUtil.sendMessagePrefix(ChatFormatting.AQUA + m.getName() + ChatFormatting.WHITE + " has been " + ChatFormatting.RED + "disabled"); 25 | } 26 | } 27 | } 28 | } catch (Exception e) {} 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/combat/ChorusSave.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.combat; 2 | 3 | import me.olliem5.past.Past; 4 | import me.olliem5.past.api.module.ModuleInfo; 5 | import me.olliem5.past.impl.events.PacketEvent; 6 | import me.olliem5.past.api.module.Category; 7 | import me.olliem5.past.api.module.Module; 8 | import me.olliem5.past.api.util.world.HoleUtil; 9 | import me.zero.alpine.listener.EventHandler; 10 | import me.zero.alpine.listener.Listener; 11 | import net.minecraft.item.ItemChorusFruit; 12 | import net.minecraft.network.play.client.CPacketPlayerTryUseItem; 13 | 14 | @ModuleInfo(name = "ChorusSave", description = "Surrounds you while eating chorus fruit", category = Category.COMBAT) 15 | public class ChorusSave extends Module { 16 | 17 | /** 18 | * TODO: ChorusTeleportEvent, on teleport, delay, surround 19 | */ 20 | 21 | @EventHandler 22 | public Listener listener = new Listener<>(event -> { 23 | if (event.getPacket() instanceof CPacketPlayerTryUseItem && mc.player.getHeldItemMainhand().getItem() instanceof ItemChorusFruit) { 24 | if (!HoleUtil.isPlayerInHole(mc.player)) { 25 | if (!Past.moduleManager.getModuleByName("Surround").isToggled()) { 26 | Past.moduleManager.getModuleByName("Surround").toggle(); 27 | } 28 | } 29 | } 30 | }); 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/mixins/MixinNetworkManager.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.mixins; 2 | 3 | import io.netty.channel.ChannelHandlerContext; 4 | import me.olliem5.past.Past; 5 | import me.olliem5.past.impl.events.PacketEvent; 6 | import net.minecraft.network.NetworkManager; 7 | import net.minecraft.network.Packet; 8 | import org.spongepowered.asm.mixin.Mixin; 9 | import org.spongepowered.asm.mixin.injection.At; 10 | import org.spongepowered.asm.mixin.injection.Inject; 11 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 12 | 13 | @Mixin(NetworkManager.class) 14 | public class MixinNetworkManager { 15 | @Inject(method = "sendPacket(Lnet/minecraft/network/Packet;)V", at = @At("HEAD"), cancellable = true) 16 | private void onSendPacket(Packet packet, CallbackInfo callbackInfo) { 17 | PacketEvent event = new PacketEvent.Send(packet); 18 | Past.EVENT_BUS.post(event); 19 | 20 | if (event.isCancelled()) { 21 | callbackInfo.cancel(); 22 | } 23 | } 24 | 25 | @Inject(method = "channelRead0", at = @At("HEAD"), cancellable = true) 26 | private void onChannelRead(ChannelHandlerContext context, Packet packet, CallbackInfo callbackInfo) { 27 | PacketEvent event = new PacketEvent.Receive(packet); 28 | Past.EVENT_BUS.post(event); 29 | 30 | if (event.isCancelled()) { 31 | callbackInfo.cancel(); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/gui/editor/component/components/Inventory.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.gui.editor.component.components; 2 | 3 | import me.olliem5.past.impl.gui.editor.component.HudComponent; 4 | import net.minecraft.client.gui.Gui; 5 | import net.minecraft.client.renderer.GlStateManager; 6 | import net.minecraft.client.renderer.RenderHelper; 7 | import net.minecraft.item.ItemStack; 8 | 9 | public class Inventory extends HudComponent { 10 | public Inventory() { 11 | super("Inventory"); 12 | 13 | setWidth(144); 14 | setHeight(48); 15 | } 16 | 17 | public void render(float ticks) { 18 | Gui.drawRect(getX(), getY(), getX() + getWidth(), getY() + getHeight(), 0x75101010); 19 | 20 | GlStateManager.pushMatrix(); 21 | RenderHelper.enableGUIStandardItemLighting(); 22 | 23 | for (int i = 0; i < 27; i++) { 24 | ItemStack itemStack = mc.player.inventory.mainInventory.get(i + 9); 25 | 26 | int offsetX = getX() + (i % 9) * 16; 27 | int offsetY = getY() + (i / 9) * 16; 28 | 29 | mc.getRenderItem().renderItemAndEffectIntoGUI(itemStack, offsetX, offsetY); 30 | mc.getRenderItem().renderItemOverlayIntoGUI(mc.fontRenderer, itemStack, offsetX, offsetY, null); 31 | } 32 | 33 | RenderHelper.disableStandardItemLighting(); 34 | mc.getRenderItem().zLevel = 0.0F; 35 | GlStateManager.popMatrix(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/render/ViewModel.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.render; 2 | 3 | import me.olliem5.past.Past; 4 | import me.olliem5.past.api.module.Category; 5 | import me.olliem5.past.api.module.Module; 6 | import me.olliem5.past.api.module.ModuleInfo; 7 | import me.olliem5.past.api.setting.Setting; 8 | import me.zero.alpine.listener.EventHandler; 9 | import me.zero.alpine.listener.Listener; 10 | import net.minecraftforge.client.event.EntityViewRenderEvent; 11 | 12 | @ModuleInfo(name = "ViewModel", description = "Changes the way your player looks in first person", category = Category.RENDER) 13 | public class ViewModel extends Module { 14 | 15 | /** 16 | * TODO: Settings for item positioning 17 | */ 18 | 19 | Setting itemfov; 20 | Setting armpitch; 21 | 22 | @Override 23 | public void setup() { 24 | Past.settingsManager.registerSetting(itemfov = new Setting("Item FOV", "ViewModelItemFOV", 110, 130, 170, this)); 25 | Past.settingsManager.registerSetting(armpitch = new Setting("Arm Pitch", "ViewModelArmPitch", -360, 90, 360, this)); 26 | } 27 | 28 | public void onUpdate() { 29 | if (nullCheck()) return; 30 | 31 | mc.player.renderArmPitch = armpitch.getValueInt(); 32 | } 33 | 34 | @EventHandler 35 | public Listener listener = new Listener<>(event -> { 36 | event.setFOV(itemfov.getValueInt()); 37 | }); 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/render/CrystalCustomize.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.render; 2 | 3 | import me.olliem5.past.Past; 4 | import me.olliem5.past.api.module.Category; 5 | import me.olliem5.past.api.module.Module; 6 | import me.olliem5.past.api.module.ModuleInfo; 7 | import me.olliem5.past.api.setting.Setting; 8 | 9 | import java.util.ArrayList; 10 | 11 | @ModuleInfo(name = "CrystalCustomize", description = "Allows you to change how end crystals render", category = Category.RENDER) 12 | public class CrystalCustomize extends Module { 13 | 14 | /** 15 | * TODO: Crystal scale 16 | */ 17 | 18 | Setting crystalmode; 19 | Setting cube; 20 | Setting glass; 21 | Setting base; 22 | 23 | public ArrayList crystalmodes; 24 | 25 | @Override 26 | public void setup() { 27 | crystalmodes = new ArrayList<>(); 28 | crystalmodes.add("Vanilla"); 29 | crystalmodes.add("RubiksCube"); 30 | 31 | Past.settingsManager.registerSetting(crystalmode = new Setting("Crystal", "CrystalCustomizeCrystalMode", this, crystalmodes, "RubiksCube")); 32 | Past.settingsManager.registerSetting(cube = new Setting("Cube", "CrystalCustomizeCube", true, this)); 33 | Past.settingsManager.registerSetting(glass = new Setting("Glass", "CrystalCustomizeGlass", true, this)); 34 | Past.settingsManager.registerSetting(base = new Setting("Base", "CrystalCustomizeBase", true, this)); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/commands/BindCommand.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.commands; 2 | 3 | import com.mojang.realmsclient.gui.ChatFormatting; 4 | import me.olliem5.past.Past; 5 | import me.olliem5.past.api.command.Command; 6 | import me.olliem5.past.api.module.Module; 7 | import me.olliem5.past.api.util.client.MessageUtil; 8 | import org.lwjgl.input.Keyboard; 9 | 10 | public class BindCommand extends Command { 11 | public BindCommand() { 12 | super("bind", "Binds modules to a key.","bind" + " " + "[module]" + " " + "[key]"); 13 | } 14 | 15 | @Override 16 | public void runCommand(String[] args) { 17 | if (args.length > 2) { 18 | for (Module module : Past.moduleManager.getModules()) { 19 | if (module.getName().equalsIgnoreCase(args[1])) { 20 | try { 21 | module.setKey(Keyboard.getKeyIndex(args[2].toUpperCase())); 22 | MessageUtil.sendMessagePrefix(ChatFormatting.AQUA + module.getName() + ChatFormatting.WHITE + " is now bound to " + ChatFormatting.RED + args[2].toUpperCase() + ChatFormatting.GRAY + " (" + ChatFormatting.WHITE + Keyboard.getKeyIndex(args[2].toUpperCase()) + ChatFormatting.GRAY + ")"); 23 | } catch (Exception e) { 24 | MessageUtil.sendMessagePrefix(ChatFormatting.RED + "Something went wrong, yikes!"); 25 | } 26 | } 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/api/friend/FriendsManager.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.api.friend; 2 | 3 | import me.olliem5.past.Past; 4 | 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | public class FriendsManager { 9 | public static List friends = new ArrayList<>(); 10 | 11 | public static List getFriends() { 12 | return friends; 13 | } 14 | 15 | public boolean isFriend(String name) { 16 | boolean isFriend = false; 17 | for (Friend friend : getFriends()) { 18 | if (friend.getName().equalsIgnoreCase(name)) { 19 | isFriend = true; 20 | } 21 | } 22 | return isFriend; 23 | } 24 | 25 | public Friend getFriendByName(String name) { 26 | Friend fr = null; 27 | for (Friend friend : getFriends()) { 28 | if (friend.getName().equalsIgnoreCase(name)) { 29 | fr = friend; 30 | } 31 | } 32 | return fr; 33 | } 34 | 35 | public static void addFriend(String name) { 36 | friends.add(new Friend(name)); 37 | 38 | if (Past.configUtil != null) { 39 | try { 40 | Past.configUtil.saveFriends(); 41 | } catch (Exception e) {} 42 | } 43 | } 44 | 45 | public void delFriend(String name) { 46 | friends.remove(getFriendByName(name)); 47 | 48 | if (Past.configUtil != null) { 49 | try { 50 | Past.configUtil.saveFriends(); 51 | } catch (Exception e) {} 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/movement/Flight.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.movement; 2 | 3 | import me.olliem5.past.Past; 4 | import me.olliem5.past.api.module.Category; 5 | import me.olliem5.past.api.module.Module; 6 | import me.olliem5.past.api.module.ModuleInfo; 7 | import me.olliem5.past.api.setting.Setting; 8 | 9 | import java.util.ArrayList; 10 | 11 | @ModuleInfo(name = "Flight", description = "Allows you to fly", category = Category.MOVEMENT) 12 | public class Flight extends Module { 13 | 14 | /** 15 | * TODO: Packet mode! 16 | */ 17 | 18 | Setting flymode; 19 | Setting flyspeed; 20 | 21 | private ArrayList flymodes; 22 | 23 | @Override 24 | public void setup() { 25 | flymodes = new ArrayList<>(); 26 | flymodes.add("Vanilla"); 27 | 28 | Past.settingsManager.registerSetting(flymode = new Setting("Mode", "FlyMode", this, flymodes, "Vanilla")); 29 | Past.settingsManager.registerSetting(flyspeed = new Setting("Speed", "FlySpeed", 0.1, 0.1, 1.0, this)); 30 | } 31 | 32 | public void onUpdate() { 33 | if (nullCheck()) return; 34 | 35 | if (flymode.getValueString() == "Vanilla") { 36 | mc.player.capabilities.isFlying = true; 37 | mc.player.capabilities.setFlySpeed((float) flyspeed.getValueDouble()); 38 | } 39 | } 40 | 41 | @Override 42 | public void onDisable() { 43 | if (nullCheck()) return; 44 | 45 | if (flymode.getValueString() == "Vanilla") { 46 | mc.player.capabilities.isFlying = false; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/core/HUDEditor.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.core; 2 | 3 | import me.olliem5.past.Past; 4 | import me.olliem5.past.api.module.Category; 5 | import me.olliem5.past.api.module.Module; 6 | import me.olliem5.past.api.module.ModuleInfo; 7 | import me.olliem5.past.api.setting.Setting; 8 | 9 | @ModuleInfo(name = "HUDEditor", description = "Edit Past's HUD", category = Category.CORE) 10 | public class HUDEditor extends Module { 11 | 12 | Setting rgb; 13 | Setting background; 14 | Setting hoverchange; 15 | Setting red; 16 | Setting green; 17 | Setting blue; 18 | Setting alpha; 19 | 20 | @Override 21 | public void setup() { 22 | Past.settingsManager.registerSetting(rgb = new Setting("Rainbow", "HudEditorRainbow", true, this)); 23 | Past.settingsManager.registerSetting(background = new Setting("Background", "HudEditorBackground", true, this)); 24 | Past.settingsManager.registerSetting(hoverchange = new Setting("Hover Change", "HudEditorHoverChange", true, this)); 25 | Past.settingsManager.registerSetting(red = new Setting("Red", "HudEditorRed", 0, 200, 255, this)); 26 | Past.settingsManager.registerSetting(green = new Setting("Green", "HudEditorGreen", 0, 10, 255, this)); 27 | Past.settingsManager.registerSetting(blue = new Setting("Blue", "HudEditorBlue", 0, 10, 255, this)); 28 | Past.settingsManager.registerSetting(alpha = new Setting("Alpha", "HudEditorAlpha", 0, 255, 255, this)); 29 | } 30 | 31 | public void onEnable() { 32 | mc.displayGuiScreen(Past.hudEditor); 33 | toggle(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/exploit/PacketMine.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.exploit; 2 | 3 | import me.olliem5.past.api.module.ModuleInfo; 4 | import me.olliem5.past.impl.events.PlayerDamageBlockEvent; 5 | import me.olliem5.past.api.module.Category; 6 | import me.olliem5.past.api.module.Module; 7 | import me.zero.alpine.listener.EventHandler; 8 | import me.zero.alpine.listener.Listener; 9 | import net.minecraft.block.Block; 10 | import net.minecraft.block.state.IBlockState; 11 | import net.minecraft.network.play.client.CPacketPlayerDigging; 12 | import net.minecraft.util.EnumHand; 13 | import net.minecraft.util.math.BlockPos; 14 | 15 | @ModuleInfo(name = "PacketMine", description = "Mines blocks using packets", category = Category.EXPLOIT) 16 | public class PacketMine extends Module { 17 | 18 | @EventHandler 19 | public Listener listener = new Listener<>(event -> { 20 | if (canBreak(event.getPos())) { 21 | mc.player.swingArm(EnumHand.MAIN_HAND); 22 | mc.player.connection.sendPacket(new CPacketPlayerDigging(CPacketPlayerDigging.Action.START_DESTROY_BLOCK, event.getPos(), event.getDirection())); 23 | mc.player.connection.sendPacket(new CPacketPlayerDigging(CPacketPlayerDigging.Action.STOP_DESTROY_BLOCK, event.getPos(), event.getDirection())); 24 | event.cancel(); 25 | } 26 | }); 27 | 28 | @SuppressWarnings("deprecation") 29 | private boolean canBreak(BlockPos pos) { 30 | final IBlockState blockState = mc.world.getBlockState(pos); 31 | final Block block = blockState.getBlock(); 32 | 33 | return block.getBlockHardness(blockState, mc.world, pos) != -1; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/movement/Velocity.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.movement; 2 | 3 | import me.olliem5.past.Past; 4 | import me.olliem5.past.api.module.ModuleInfo; 5 | import me.olliem5.past.impl.events.PacketEvent; 6 | import me.olliem5.past.api.module.Category; 7 | import me.olliem5.past.api.module.Module; 8 | import me.olliem5.past.api.setting.Setting; 9 | import me.zero.alpine.listener.EventHandler; 10 | import me.zero.alpine.listener.Listener; 11 | import net.minecraft.network.play.server.SPacketEntityVelocity; 12 | import net.minecraft.network.play.server.SPacketExplosion; 13 | 14 | @ModuleInfo(name = "Velocity", description = "Makes you take 0 knockback", category = Category.MOVEMENT) 15 | public class Velocity extends Module { 16 | 17 | /** 18 | * TODO: Settings: fishhook, vertical, horizontal, ect. 19 | */ 20 | 21 | Setting velocity; 22 | Setting explosions; 23 | 24 | @Override 25 | public void setup() { 26 | Past.settingsManager.registerSetting(velocity = new Setting("Velocity", "VelocityVelocity", true, this)); 27 | Past.settingsManager.registerSetting(explosions = new Setting("Explosions", "VelocityExplosions", true, this)); 28 | } 29 | 30 | @EventHandler 31 | public Listener listener = new Listener<>(event -> { 32 | if (event.getPacket() instanceof SPacketEntityVelocity) { 33 | if (velocity.getValBoolean() && ((SPacketEntityVelocity) event.getPacket()).getEntityID() == mc.player.getEntityId()) { 34 | event.cancel(); 35 | } 36 | } else if (explosions.getValBoolean() && event.getPacket() instanceof SPacketExplosion) { 37 | event.cancel(); 38 | } 39 | }); 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/mixins/MixinLayerBipedArmor.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.mixins; 2 | 3 | import me.olliem5.past.Past; 4 | import net.minecraft.client.model.ModelBiped; 5 | import net.minecraft.client.renderer.entity.layers.LayerBipedArmor; 6 | import net.minecraft.inventory.EntityEquipmentSlot; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Inject; 10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 11 | 12 | @Mixin(LayerBipedArmor.class) 13 | public class MixinLayerBipedArmor { 14 | @Inject(method = "setModelSlotVisible", at = @At(value = "HEAD"), cancellable = true) 15 | private void setModelSlotVisible(ModelBiped model, EntityEquipmentSlot slotIn, CallbackInfo callbackInfo) { 16 | if (Past.moduleManager.getModuleByName("NoRender").isToggled() && Past.settingsManager.getSettingID("NoRenderArmour").getValBoolean()) { 17 | callbackInfo.cancel(); 18 | switch (slotIn) { 19 | case HEAD: 20 | model.bipedHead.showModel = false; 21 | model.bipedHeadwear.showModel = false; 22 | case CHEST: 23 | model.bipedBody.showModel = false; 24 | model.bipedRightArm.showModel = false; 25 | model.bipedLeftArm.showModel = false; 26 | case LEGS: 27 | model.bipedBody.showModel = false; 28 | model.bipedRightLeg.showModel = false; 29 | model.bipedLeftLeg.showModel = false; 30 | case FEET: 31 | model.bipedRightLeg.showModel = false; 32 | model.bipedLeftLeg.showModel = false; 33 | } 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/combat/FootEXP.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.combat; 2 | 3 | import me.olliem5.past.Past; 4 | import me.olliem5.past.api.module.ModuleInfo; 5 | import me.olliem5.past.impl.events.PacketEvent; 6 | import me.olliem5.past.api.module.Category; 7 | import me.olliem5.past.api.module.Module; 8 | import me.olliem5.past.api.setting.Setting; 9 | import me.zero.alpine.listener.EventHandler; 10 | import me.zero.alpine.listener.Listener; 11 | import net.minecraft.item.ItemExpBottle; 12 | import net.minecraft.network.play.client.CPacketPlayer; 13 | import net.minecraft.network.play.client.CPacketPlayerTryUseItem; 14 | 15 | @ModuleInfo(name = "FootEXP", description = "Makes you look down server side while using EXP bottles", category = Category.COMBAT) 16 | public class FootEXP extends Module { 17 | 18 | Setting usecustompitch; 19 | Setting custompitch; 20 | 21 | @Override 22 | public void setup() { 23 | Past.settingsManager.registerSetting(usecustompitch = new Setting("Use Custom Pitch", "FootEXPUseCustomPitch", false, this)); 24 | Past.settingsManager.registerSetting(custompitch = new Setting("Custom Pitch", "FootEXPCustomPitch", -90, 90, 90, this)); 25 | } 26 | 27 | @EventHandler 28 | public Listener listener = new Listener<>(event -> { 29 | if (event.getPacket() instanceof CPacketPlayerTryUseItem && mc.player.getHeldItemMainhand().getItem() instanceof ItemExpBottle) { 30 | if (usecustompitch.getValBoolean()) { 31 | mc.player.connection.sendPacket(new CPacketPlayer.Rotation(mc.player.rotationYaw, custompitch.getValueInt(), mc.player.onGround)); 32 | } else { 33 | mc.player.connection.sendPacket(new CPacketPlayer.Rotation(mc.player.rotationYaw, 90.0f, mc.player.onGround)); 34 | } 35 | } 36 | }); 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/player/AutoLog.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.player; 2 | 3 | import com.mojang.realmsclient.gui.ChatFormatting; 4 | import me.olliem5.past.Past; 5 | import me.olliem5.past.api.module.Category; 6 | import me.olliem5.past.api.module.Module; 7 | import me.olliem5.past.api.module.ModuleInfo; 8 | import me.olliem5.past.api.setting.Setting; 9 | import net.minecraft.client.gui.GuiMainMenu; 10 | 11 | import java.util.ArrayList; 12 | 13 | @ModuleInfo(name = "AutoLog", description = "Leaves the current server at a certain health", category = Category.PLAYER) 14 | public class AutoLog extends Module { 15 | 16 | /** 17 | * TODO: Packet kick mode! 18 | */ 19 | 20 | Setting logmode; 21 | Setting health; 22 | 23 | private ArrayList logmodes; 24 | 25 | @Override 26 | public void setup() { 27 | logmodes = new ArrayList<>(); 28 | logmodes.add("Disconnect"); 29 | logmodes.add("Kick"); 30 | 31 | Past.settingsManager.registerSetting(logmode = new Setting("Mode", "AutoLogMode", this, logmodes, "Disconnect")); 32 | Past.settingsManager.registerSetting(health = new Setting("Health", "AutoLogHealth", 1, 10, 36, this)); 33 | } 34 | 35 | public void onUpdate() { 36 | if (nullCheck()) return; 37 | 38 | if (mc.player.getHealth() < health.getValueInt()) { 39 | doAutoLog(); 40 | toggle(); 41 | } 42 | } 43 | 44 | private void doAutoLog() { 45 | if (logmode.getValueString() == "Disconnect") { 46 | mc.world.sendQuittingDisconnectingPacket(); 47 | mc.loadWorld(null); 48 | mc.displayGuiScreen(new GuiMainMenu()); 49 | } else { 50 | mc.player.inventory.currentItem = 69420; 51 | } 52 | } 53 | 54 | public String getArraylistInfo() { 55 | return ChatFormatting.GRAY + " " + logmode.getValueString().toUpperCase(); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/movement/Step.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.movement; 2 | 3 | import com.mojang.realmsclient.gui.ChatFormatting; 4 | import me.olliem5.past.Past; 5 | import me.olliem5.past.api.module.Category; 6 | import me.olliem5.past.api.module.Module; 7 | import me.olliem5.past.api.module.ModuleInfo; 8 | import me.olliem5.past.api.setting.Setting; 9 | 10 | import java.util.ArrayList; 11 | 12 | @ModuleInfo(name = "Step", description = "Allows you to step up blocks", category = Category.MOVEMENT) 13 | public class Step extends Module { 14 | 15 | /** 16 | * TODO: Packet mode! 17 | */ 18 | 19 | Setting mode; 20 | Setting height; 21 | 22 | private ArrayList stepmodes; 23 | 24 | @Override 25 | public void setup() { 26 | stepmodes = new ArrayList<>(); 27 | stepmodes.add("Vanilla"); 28 | stepmodes.add("Reverse"); 29 | 30 | Past.settingsManager.registerSetting(mode = new Setting("Mode", "StepMode", this, stepmodes, "Vanilla")); 31 | Past.settingsManager.registerSetting(height = new Setting("Height", "StepHeight", 1, 1, 10, this)); 32 | } 33 | 34 | public void onUpdate() { 35 | if (nullCheck()) return; 36 | 37 | if (mc.player.onGround && !mc.player.isInWater() && !mc.player.isInLava() && !mc.player.isOnLadder()) { 38 | if (mode.getValueString() == "Vanilla") { 39 | if (mc.player.collidedHorizontally) { 40 | mc.player.stepHeight = height.getValueInt(); 41 | mc.player.jump(); 42 | } 43 | } else { 44 | --mc.player.motionY; 45 | } 46 | } 47 | } 48 | 49 | @Override 50 | public void onDisable() { 51 | if (mode.getValueString() == "Vanilla") { 52 | mc.player.stepHeight = 0.5f; 53 | } 54 | } 55 | 56 | public String getArraylistInfo() { 57 | return ChatFormatting.GRAY + " " + mode.getValueString().toUpperCase(); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/api/setting/SettingsManager.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.api.setting; 2 | 3 | import me.olliem5.past.Past; 4 | import me.olliem5.past.impl.gui.editor.component.HudComponent; 5 | import me.olliem5.past.api.module.Module; 6 | 7 | import java.util.ArrayList; 8 | 9 | public class SettingsManager { 10 | private ArrayList settings; 11 | 12 | public SettingsManager() { 13 | this.settings = new ArrayList<>(); 14 | } 15 | 16 | public void registerSetting(Setting args) { 17 | this.settings.add(args); 18 | } 19 | 20 | public ArrayList getSettings() { 21 | return this.settings; 22 | } 23 | 24 | public Setting getSettingName(String name) { 25 | for (Setting setting : getSettings()) { 26 | if (setting.getName() == name) { 27 | return setting; 28 | } 29 | } 30 | Past.log("Setting error, setting `" + name + "` NOT found!"); 31 | return null; 32 | } 33 | 34 | public Setting getSettingID(String id) { 35 | for (Setting setting : getSettings()) { 36 | if (setting.getId() == id) { 37 | return setting; 38 | } 39 | } 40 | Past.log("Setting error, setting id `" + id + "` NOT found!"); 41 | return null; 42 | } 43 | 44 | public ArrayList getSettingsModule(Module module) { 45 | ArrayList list = new ArrayList<>(); 46 | for (Setting setting : getSettings()) { 47 | if (setting.getParent() == module) { 48 | list.add(setting); 49 | } 50 | } 51 | return list; 52 | } 53 | 54 | public ArrayList getSettingsHudComponent(HudComponent hudComponent) { 55 | ArrayList list = new ArrayList<>(); 56 | for (Setting setting : getSettings()) { 57 | if (setting.getHudParent() == hudComponent) { 58 | list.add(setting); 59 | } 60 | } 61 | return list; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/render/Fullbright.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.render; 2 | 3 | import com.mojang.realmsclient.gui.ChatFormatting; 4 | import me.olliem5.past.Past; 5 | import me.olliem5.past.api.module.Category; 6 | import me.olliem5.past.api.module.Module; 7 | import me.olliem5.past.api.module.ModuleInfo; 8 | import me.olliem5.past.api.setting.Setting; 9 | import net.minecraft.potion.Potion; 10 | import net.minecraft.potion.PotionEffect; 11 | 12 | import java.util.ArrayList; 13 | 14 | @ModuleInfo(name = "Fullbright", description = "Makes your game brighter, re-enable after changing mode", category = Category.RENDER) 15 | public class Fullbright extends Module { 16 | 17 | private PotionEffect fullbrighteffect = new PotionEffect(Potion.getPotionById(16)); 18 | 19 | private float originalGamma; 20 | 21 | Setting brightnessmode; 22 | 23 | private ArrayList brightnessmodes; 24 | 25 | @Override 26 | public void setup() { 27 | brightnessmodes = new ArrayList<>(); 28 | brightnessmodes.add("Gamma"); 29 | brightnessmodes.add("Potion"); 30 | 31 | Past.settingsManager.registerSetting(brightnessmode = new Setting("Mode", "FullbrightMode", this, brightnessmodes, "Gamma")); 32 | } 33 | 34 | @Override 35 | public void onEnable() { 36 | if (brightnessmode.getValueString() == "Gamma") { 37 | originalGamma = mc.gameSettings.gammaSetting; 38 | mc.gameSettings.gammaSetting = 10; 39 | } else { 40 | mc.player.addPotionEffect(fullbrighteffect); 41 | } 42 | } 43 | 44 | @Override 45 | public void onDisable() { 46 | if (brightnessmode.getValueString() == "Gamma") { 47 | mc.gameSettings.gammaSetting = originalGamma; 48 | } else { 49 | mc.player.removeActivePotionEffect(fullbrighteffect.getPotion()); 50 | } 51 | } 52 | 53 | public String getArraylistInfo() { 54 | return ChatFormatting.GRAY + " " + brightnessmode.getValueString().toUpperCase(); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/exploit/Blink.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.exploit; 2 | 3 | import com.mojang.realmsclient.gui.ChatFormatting; 4 | import me.olliem5.past.api.module.ModuleInfo; 5 | import me.olliem5.past.impl.events.PacketEvent; 6 | import me.olliem5.past.api.module.Category; 7 | import me.olliem5.past.api.module.Module; 8 | import me.zero.alpine.listener.EventHandler; 9 | import me.zero.alpine.listener.Listener; 10 | import net.minecraft.client.entity.EntityOtherPlayerMP; 11 | import net.minecraft.entity.player.EntityPlayer; 12 | import net.minecraft.network.play.client.CPacketPlayer; 13 | 14 | import java.util.LinkedList; 15 | import java.util.Queue; 16 | 17 | @ModuleInfo(name = "Blink", description = "Hides movement for a short time", category = Category.EXPLOIT) 18 | public class Blink extends Module { 19 | 20 | Queue packets = new LinkedList<>(); 21 | 22 | @EventHandler 23 | public Listener listener = new Listener<>(event -> { 24 | if (event.getPacket() instanceof CPacketPlayer) { 25 | event.cancel(); 26 | packets.add((CPacketPlayer) event.getPacket()); 27 | } 28 | }); 29 | 30 | @Override 31 | public void onEnable() { 32 | if (mc.world == null) return; 33 | 34 | EntityOtherPlayerMP fakePlayer = new EntityOtherPlayerMP(mc.world, mc.getSession().getProfile()); 35 | fakePlayer.copyLocationAndAnglesFrom(mc.player); 36 | fakePlayer.rotationYawHead = mc.player.rotationYawHead; 37 | mc.world.addEntityToWorld(-100, fakePlayer); 38 | } 39 | 40 | @Override 41 | public void onDisable() { 42 | while (!packets.isEmpty()) { 43 | mc.player.connection.sendPacket(packets.poll()); 44 | } 45 | 46 | EntityPlayer localPlayer = mc.player; 47 | 48 | if (localPlayer != null) { 49 | mc.world.removeEntityFromWorld(-100); 50 | } 51 | } 52 | 53 | public String getArraylistInfo() { 54 | return ChatFormatting.GRAY + " " + packets.size(); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/player/Burrow.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.player; 2 | 3 | import me.olliem5.past.Past; 4 | import me.olliem5.past.api.module.Category; 5 | import me.olliem5.past.api.module.Module; 6 | import me.olliem5.past.api.module.ModuleInfo; 7 | import me.olliem5.past.api.setting.Setting; 8 | import me.olliem5.past.api.util.player.PlayerUtil; 9 | import net.minecraft.init.Blocks; 10 | import net.minecraft.util.math.BlockPos; 11 | 12 | @ModuleInfo(name = "Burrow", description = "Places an obsidian block inside of you", category = Category.PLAYER) 13 | public class Burrow extends Module { 14 | 15 | Setting height; 16 | Setting autoswitch; 17 | 18 | @Override 19 | public void setup() { 20 | Past.settingsManager.registerSetting(height = new Setting("Height", "BurrowHeight", 1.0, 1.14, 1.3, this)); 21 | Past.settingsManager.registerSetting(autoswitch = new Setting("Auto Switch", "BurrowAutoSwitch", true, this)); 22 | } 23 | 24 | private BlockPos playerPos; 25 | 26 | @Override 27 | public void onEnable() { 28 | playerPos = new BlockPos(mc.player.posX, mc.player.posY, mc.player.posZ); 29 | 30 | if (mc.world.getBlockState(playerPos).getBlock() == Blocks.OBSIDIAN) { 31 | toggle(); 32 | return; 33 | } 34 | 35 | mc.player.jump(); 36 | } 37 | 38 | public void onUpdate() { 39 | if (nullCheck()) return; 40 | 41 | int oldSlot = -1; 42 | 43 | if (mc.player.posY > playerPos.getY() + height.getValueDouble()) { 44 | 45 | if (autoswitch.getValBoolean()) { 46 | oldSlot = mc.player.inventory.currentItem; 47 | mc.player.inventory.currentItem = PlayerUtil.getBlockInHotbar(Blocks.OBSIDIAN); 48 | } 49 | 50 | PlayerUtil.placeBlock(playerPos); 51 | 52 | if (autoswitch.getValBoolean()) { 53 | mc.player.inventory.currentItem = oldSlot; 54 | } 55 | 56 | mc.player.jump(); 57 | toggle(); 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/core/ClickGUI.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.core; 2 | 3 | import me.olliem5.past.Past; 4 | import me.olliem5.past.api.module.Category; 5 | import me.olliem5.past.api.module.Module; 6 | import me.olliem5.past.api.module.ModuleInfo; 7 | import me.olliem5.past.api.setting.Setting; 8 | import org.lwjgl.input.Keyboard; 9 | 10 | @ModuleInfo(name = "ClickGUI", description = "Opens Past's ClickGUI", category = Category.CORE, key = Keyboard.KEY_P) 11 | public class ClickGUI extends Module { 12 | 13 | Setting scrollspeed; 14 | Setting rainbow; 15 | Setting descriptions; 16 | Setting hoverchange; 17 | Setting background; 18 | Setting pausegame; 19 | Setting red; 20 | Setting green; 21 | Setting blue; 22 | Setting alpha; 23 | 24 | @Override 25 | public void setup() { 26 | Past.settingsManager.registerSetting(scrollspeed = new Setting("Scroll Speed", "ClickGUIScrollSpeed", 0.0, 10.0, 20.0, this)); 27 | Past.settingsManager.registerSetting(rainbow = new Setting("Rainbow", "ClickGUIRainbow", true, this)); 28 | Past.settingsManager.registerSetting(descriptions = new Setting("Descriptions", "ClickGUIDescriptions", true, this)); 29 | Past.settingsManager.registerSetting(hoverchange = new Setting("Hover Change", "ClickGUIHoverChange", true, this)); 30 | Past.settingsManager.registerSetting(background = new Setting("Background", "ClickGUIBackground", true, this)); 31 | Past.settingsManager.registerSetting(pausegame = new Setting("No Pause Game", "ClickGUIPauseGame", true, this)); 32 | Past.settingsManager.registerSetting(red = new Setting("Red", "ClickGUIRed", 0, 200, 255, this)); 33 | Past.settingsManager.registerSetting(green = new Setting("Green", "ClickGUIGreen", 0, 10, 255, this)); 34 | Past.settingsManager.registerSetting(blue = new Setting("Blue", "ClickGUIBlue", 0, 10, 255, this)); 35 | Past.settingsManager.registerSetting(alpha = new Setting("Alpha", "ClickGUIAlpha", 0, 255, 255, this)); 36 | } 37 | 38 | public void onEnable() { 39 | mc.displayGuiScreen(Past.clickGUITwo); 40 | toggle(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/misc/FakePlayer.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.misc; 2 | 3 | import com.mojang.authlib.GameProfile; 4 | import me.olliem5.past.Past; 5 | import me.olliem5.past.api.module.Category; 6 | import me.olliem5.past.api.module.Module; 7 | import me.olliem5.past.api.module.ModuleInfo; 8 | import me.olliem5.past.api.setting.Setting; 9 | import net.minecraft.client.entity.EntityOtherPlayerMP; 10 | 11 | import java.util.ArrayList; 12 | import java.util.UUID; 13 | 14 | @ModuleInfo(name = "FakePlayer", description = "Summons a fake player, usually for testing other modules", category = Category.MISC) 15 | public class FakePlayer extends Module { 16 | 17 | Setting name; 18 | 19 | private ArrayList names; 20 | 21 | private EntityOtherPlayerMP fakePlayer; 22 | 23 | @Override 24 | public void setup() { 25 | names = new ArrayList<>(); 26 | names.add("_o_b_a_m_a_"); 27 | names.add("LittleDraily"); 28 | names.add("You"); 29 | 30 | Past.settingsManager.registerSetting(name = new Setting("Name", "FakePlayerName", this, names, "_o_b_a_m_a_")); 31 | } 32 | 33 | public void onEnable() { 34 | if (mc.world == null) return; 35 | 36 | generateFakePlayer(); 37 | 38 | fakePlayer.copyLocationAndAnglesFrom(mc.player); 39 | fakePlayer.rotationYawHead = mc.player.rotationYawHead; 40 | 41 | mc.world.addEntityToWorld(69420, fakePlayer); 42 | } 43 | 44 | private void generateFakePlayer() { 45 | if (name.getValueString() == "_o_b_a_m_a_") { 46 | fakePlayer = new EntityOtherPlayerMP(mc.world, new GameProfile(UUID.fromString("8deac414-6c37-44fb-82bd-6873efc1b0cf"), "_o_b_a_m_a_")); 47 | } else if (name.getValueString() == "LittleDraily") { 48 | fakePlayer = new EntityOtherPlayerMP(mc.world, new GameProfile(UUID.fromString("d4b0faa7-368d-4656-a60b-f859ba0f7853"), "LittleDraily")); 49 | } else { 50 | fakePlayer = new EntityOtherPlayerMP(mc.world, mc.getSession().getProfile()); 51 | } 52 | } 53 | 54 | @Override 55 | public void onDisable() { 56 | mc.world.removeEntityFromWorld(69420); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/movement/Sprint.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.movement; 2 | 3 | import com.mojang.realmsclient.gui.ChatFormatting; 4 | import me.olliem5.past.Past; 5 | import me.olliem5.past.api.module.Category; 6 | import me.olliem5.past.api.module.Module; 7 | import me.olliem5.past.api.module.ModuleInfo; 8 | import me.olliem5.past.api.setting.Setting; 9 | 10 | import java.util.ArrayList; 11 | 12 | @ModuleInfo(name = "Sprint", description = "Automatically makes you sprint", category = Category.MOVEMENT) 13 | public class Sprint extends Module { 14 | 15 | Setting sprintmode; 16 | 17 | private ArrayList sprintmodes; 18 | 19 | @Override 20 | public void setup() { 21 | sprintmodes = new ArrayList<>(); 22 | sprintmodes.add("Legit"); 23 | sprintmodes.add("Rage"); 24 | 25 | Past.settingsManager.registerSetting(sprintmode = new Setting("Mode", "SprintMode", this, sprintmodes, "Legit")); 26 | } 27 | 28 | public void onUpdate() { 29 | if (nullCheck()) return; 30 | 31 | if (sprintmode.getValueString() == "Legit") { 32 | try { 33 | if (mc.gameSettings.keyBindForward.isKeyDown() && !(mc.player.collidedHorizontally) && !(mc.player.isSneaking()) && !(mc.player.isHandActive()) && mc.player.getFoodStats().getFoodLevel() > 6f) { 34 | mc.player.setSprinting(true); 35 | } 36 | } catch (Exception ignored) {} 37 | } else { 38 | try { 39 | if (!(mc.player.isSneaking()) && !(mc.player.collidedHorizontally) && mc.player.getFoodStats().getFoodLevel() > 6f && mc.gameSettings.keyBindForward.isKeyDown() || mc.gameSettings.keyBindLeft.isKeyDown() || mc.gameSettings.keyBindRight.isKeyDown() || mc.gameSettings.keyBindBack.isKeyDown()) { 40 | mc.player.setSprinting(true); 41 | } 42 | } catch (Exception ignored) {} 43 | } 44 | } 45 | 46 | @Override 47 | public void onDisable() { 48 | mc.player.setSprinting(false); 49 | } 50 | 51 | public String getArraylistInfo() { 52 | return ChatFormatting.GRAY + " " + sprintmode.getValueString().toUpperCase(); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/player/WeaknessAlert.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.player; 2 | 3 | import com.mojang.realmsclient.gui.ChatFormatting; 4 | import me.olliem5.past.Past; 5 | import me.olliem5.past.api.module.Category; 6 | import me.olliem5.past.api.module.Module; 7 | import me.olliem5.past.api.module.ModuleInfo; 8 | import me.olliem5.past.api.setting.Setting; 9 | import me.olliem5.past.api.util.client.MessageUtil; 10 | import net.minecraft.client.audio.PositionedSoundRecord; 11 | import net.minecraft.init.MobEffects; 12 | import net.minecraft.init.SoundEvents; 13 | 14 | @ModuleInfo(name = "WeaknessAlert", description = "Notifies you if you get weakness", category = Category.PLAYER) 15 | public class WeaknessAlert extends Module { 16 | 17 | Setting sound; 18 | 19 | @Override 20 | public void setup() { 21 | Past.settingsManager.registerSetting(sound = new Setting("Sound", "WeaknessAlertSound", true, this)); 22 | } 23 | 24 | private boolean hasAnnounced = false; 25 | 26 | public void onUpdate() { 27 | if (nullCheck()) return; 28 | 29 | if (mc.player.isPotionActive(MobEffects.WEAKNESS) && !hasAnnounced) { 30 | hasAnnounced = true; 31 | MessageUtil.sendWeaknessAlertMessage(ChatFormatting.AQUA + mc.getSession().getUsername() + ChatFormatting.GRAY + " - " + ChatFormatting.WHITE + "You now have " + ChatFormatting.RED + "weakness" + ChatFormatting.GRAY + "!"); 32 | if (sound.getValBoolean()) { 33 | mc.getSoundHandler().playSound(PositionedSoundRecord.getRecord(SoundEvents.ENTITY_EXPERIENCE_ORB_PICKUP, 1.0F, 1.0F)); 34 | } 35 | } else if (!mc.player.isPotionActive(MobEffects.WEAKNESS) && hasAnnounced) { 36 | hasAnnounced = false; 37 | MessageUtil.sendWeaknessAlertMessage(ChatFormatting.AQUA + mc.getSession().getUsername() + ChatFormatting.GRAY + " - " + ChatFormatting.WHITE + "You no longer have " + ChatFormatting.RED + "weakness" + ChatFormatting.GRAY + "!"); 38 | if (sound.getValBoolean()) { 39 | mc.getSoundHandler().playSound(PositionedSoundRecord.getRecord(SoundEvents.ENTITY_EXPERIENCE_ORB_PICKUP, 1.0F, 1.0F)); 40 | } 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/misc/MCF.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.misc; 2 | 3 | import com.mojang.realmsclient.gui.ChatFormatting; 4 | import me.olliem5.past.Past; 5 | import me.olliem5.past.api.module.Category; 6 | import me.olliem5.past.api.module.Module; 7 | import me.olliem5.past.api.module.ModuleInfo; 8 | import me.olliem5.past.api.util.client.MessageUtil; 9 | import net.minecraft.entity.Entity; 10 | import net.minecraft.entity.player.EntityPlayer; 11 | import net.minecraft.util.math.RayTraceResult; 12 | import org.lwjgl.input.Mouse; 13 | 14 | @ModuleInfo(name = "MCF", description = "Allows you to middle click to add/del friends", category = Category.MISC) 15 | public class MCF extends Module { 16 | 17 | /** 18 | * TODO: Make this a MiddleClick module with modes: friend, pearl 19 | */ 20 | 21 | private boolean hasClicked = false; 22 | 23 | public void onUpdate() { 24 | 25 | if (!Mouse.isButtonDown(2)) { 26 | hasClicked = false; 27 | return; 28 | } 29 | 30 | if (!hasClicked) { 31 | 32 | hasClicked = true; 33 | 34 | final RayTraceResult result = mc.objectMouseOver; 35 | Entity player = result.entityHit; 36 | 37 | if (result == null || result.typeOfHit != RayTraceResult.Type.ENTITY || !(result.entityHit instanceof EntityPlayer)) return; 38 | 39 | if (Past.friendsManager.isFriend(player.getName())) { 40 | Past.friendsManager.delFriend(mc.objectMouseOver.entityHit.getName()); 41 | MessageUtil.sendFreindsMessage(ChatFormatting.WHITE + "Player" + " " + ChatFormatting.AQUA + mc.objectMouseOver.entityHit.getName() + " " + ChatFormatting.WHITE + "has been" + " " + ChatFormatting.RED + "removed" + " " + ChatFormatting.WHITE + "from the friends list"); 42 | } else { 43 | Past.friendsManager.addFriend(mc.objectMouseOver.entityHit.getName()); 44 | MessageUtil.sendFreindsMessage(ChatFormatting.WHITE + "Player" + " " + ChatFormatting.AQUA + mc.objectMouseOver.entityHit.getName() + " " + ChatFormatting.WHITE + "has been" + " " + ChatFormatting.GREEN + "added" + " " + ChatFormatting.WHITE + "to the friends list"); 45 | } 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/exploit/BowBoost.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.exploit; 2 | 3 | import me.olliem5.past.Past; 4 | import me.olliem5.past.api.module.ModuleInfo; 5 | import me.olliem5.past.impl.events.PacketEvent; 6 | import me.olliem5.past.api.module.Category; 7 | import me.olliem5.past.api.module.Module; 8 | import me.olliem5.past.api.setting.Setting; 9 | import me.zero.alpine.listener.EventHandler; 10 | import me.zero.alpine.listener.Listener; 11 | import net.minecraft.item.ItemBow; 12 | import net.minecraft.network.play.client.CPacketPlayer; 13 | import net.minecraft.network.play.client.CPacketPlayerTryUseItem; 14 | 15 | @ModuleInfo(name = "BowBoost", description = "Makes shot arrows hit yourself", category = Category.EXPLOIT) 16 | public class BowBoost extends Module { 17 | 18 | /** 19 | * If you have velocity on, hitting 20 | * yourself with a lot of arrows breaks NCP, 21 | * and allows you to do some wacky movement. 22 | * 23 | * Also, a strange hover thing if you use 24 | * vanilla fly and stay with solid blocks 25 | * under you. 26 | * 27 | * https://cdn.discordapp.com/attachments/754619445489565788/778941240472371240/past_2bpvp_hover.mp4 28 | */ 29 | 30 | Setting usecustompitch; 31 | Setting custompitch; 32 | 33 | @Override 34 | public void setup() { 35 | Past.settingsManager.registerSetting(usecustompitch = new Setting("Use Custom Pitch", "BowExploitUseCustomPitch", false, this)); 36 | Past.settingsManager.registerSetting(custompitch = new Setting("Custom Pitch", "BowExploitCustomPitch", -90, -90, 90, this)); 37 | } 38 | 39 | @EventHandler 40 | public Listener listener = new Listener<>(event -> { 41 | if (event.getPacket() instanceof CPacketPlayerTryUseItem && mc.player.getHeldItemMainhand().getItem() instanceof ItemBow) { 42 | if (usecustompitch.getValBoolean()) { 43 | mc.player.connection.sendPacket(new CPacketPlayer.Rotation(mc.player.rotationYaw, custompitch.getValueInt(), mc.player.onGround)); 44 | } else { 45 | mc.player.connection.sendPacket(new CPacketPlayer.Rotation(mc.player.rotationYaw, -90.0f, mc.player.onGround)); 46 | } 47 | } 48 | }); 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/render/Time.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.render; 2 | 3 | import com.mojang.realmsclient.gui.ChatFormatting; 4 | import me.olliem5.past.Past; 5 | import me.olliem5.past.api.module.Category; 6 | import me.olliem5.past.api.module.Module; 7 | import me.olliem5.past.api.module.ModuleInfo; 8 | import me.olliem5.past.api.setting.Setting; 9 | 10 | import java.util.ArrayList; 11 | 12 | @ModuleInfo(name = "Time", description = "Changes the world time, client side", category = Category.RENDER) 13 | public class Time extends Module { 14 | 15 | Setting timemode; 16 | Setting customtimemode; 17 | 18 | private ArrayList timemodes; 19 | 20 | @Override 21 | public void setup() { 22 | timemodes = new ArrayList<>(); 23 | timemodes.add("Day"); 24 | timemodes.add("Noon"); 25 | timemodes.add("Sunset"); 26 | timemodes.add("Night"); 27 | timemodes.add("Midnight"); 28 | timemodes.add("Sunrise"); 29 | timemodes.add("Custom"); 30 | 31 | Past.settingsManager.registerSetting(timemode = new Setting("Time", "TimeMode", this, timemodes, "Day")); 32 | Past.settingsManager.registerSetting(customtimemode = new Setting("Custom", "TimeCustom", 0, 18000, 24000, this)); 33 | } 34 | 35 | public void onUpdate() { 36 | if (mc.world == null) return; 37 | 38 | if (timemode.getValueString() == "Day") { 39 | mc.world.setWorldTime(1000); 40 | } else if (timemode.getValueString() == "Noon") { 41 | mc.world.setWorldTime(6000); 42 | } else if (timemode.getValueString() == "Sunset") { 43 | mc.world.setWorldTime(12500); 44 | } else if (timemode.getValueString() == "Night") { 45 | mc.world.setWorldTime(13000); 46 | } else if (timemode.getValueString() == "Midnight") { 47 | mc.world.setWorldTime(18000); 48 | } else if (timemode.getValueString() == "Sunrise") { 49 | mc.world.setWorldTime(23500); 50 | } else { 51 | mc.world.setWorldTime(customtimemode.getValueInt()); 52 | } 53 | } 54 | 55 | public String getArraylistInfo() { 56 | return ChatFormatting.GRAY + " " + timemode.getValueString().toUpperCase(); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/gui/click/clickone/components/ModeComponent.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.gui.click.clickone.components; 2 | 3 | import com.mojang.realmsclient.gui.ChatFormatting; 4 | import me.olliem5.past.impl.gui.click.Component; 5 | import me.olliem5.past.api.setting.Setting; 6 | import me.olliem5.past.api.util.render.text.FontUtil; 7 | import net.minecraft.client.gui.Gui; 8 | 9 | public class ModeComponent extends Component { 10 | private Setting op; 11 | private ModuleButton parent; 12 | private int offset; 13 | private int x; 14 | private int y; 15 | private int modeIndex; 16 | 17 | public ModeComponent(Setting op, ModuleButton parent, int offset) { 18 | this.op = op; 19 | this.parent = parent; 20 | this.x = parent.parent.getX() + parent.parent.getWidth(); 21 | this.y = parent.parent.getY() + parent.offset; 22 | this.offset = offset; 23 | this.modeIndex = 0; 24 | } 25 | 26 | @Override 27 | public void renderComponent() { 28 | Gui.drawRect(parent.parent.getX() + 80, parent.parent.getY() - 12 + offset, parent.parent.getX() + parent.parent.getWidth() + parent.parent.getWidth(), parent.parent.getY() + offset, 0xFF111111); 29 | 30 | FontUtil.drawText(this.op.getName() + " " + ChatFormatting.GRAY + this.op.getValueString().toUpperCase(), parent.parent.getX() + 82, (parent.parent.getY() + offset - 10), -1); 31 | } 32 | 33 | @Override 34 | public void updateComponent(int mouseX, int mouseY) { 35 | this.y = parent.parent.getY() - 12 + this.offset; 36 | this.x = parent.parent.getX() + 80; 37 | } 38 | 39 | @Override 40 | public void mouseClicked(final int mouseX, final int mouseY, final int button) { 41 | if (this.isMouseOnButton(mouseX, mouseY) && button == 0 && this.parent.isOpen()) { 42 | final int maxIndex = this.op.getModes().size() - 1; 43 | this.modeIndex++; 44 | if (this.modeIndex > maxIndex) { 45 | this.modeIndex = 0; 46 | } 47 | this.op.setValueString(this.op.getModes().get(this.modeIndex)); 48 | } 49 | } 50 | 51 | public boolean isMouseOnButton(int x, int y) { 52 | if (x > this.x && x < this.x + 80 && y > this.y && y < this.y + 12) { 53 | return true; 54 | } else { 55 | return false; 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/api/util/render/RenderUtil.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.api.util.render; 2 | 3 | import me.olliem5.past.Past; 4 | import net.minecraft.client.Minecraft; 5 | import net.minecraft.client.renderer.RenderGlobal; 6 | import net.minecraft.util.math.AxisAlignedBB; 7 | import net.minecraft.util.math.BlockPos; 8 | import org.lwjgl.opengl.GL11; 9 | 10 | public class RenderUtil { 11 | protected static Minecraft mc = Minecraft.getMinecraft(); 12 | 13 | public static void prepareGL() { 14 | GL11.glPushMatrix(); 15 | GL11.glBlendFunc(770, 771); 16 | GL11.glEnable(3042); 17 | GL11.glDisable(3553); 18 | GL11.glDisable(2929); 19 | GL11.glDepthMask(false); 20 | GL11.glLineWidth(Past.settingsManager.getSettingID("RenderLineWidth").getValueInt()); 21 | } 22 | 23 | public static void releaseGL() { 24 | GL11.glEnable(3553); 25 | GL11.glEnable(2929); 26 | GL11.glDepthMask(true); 27 | GL11.glDisable(3042); 28 | GL11.glPopMatrix(); 29 | } 30 | 31 | public static AxisAlignedBB generateBB(long x, long y, long z) { 32 | BlockPos blockPos = new BlockPos(x, y, z); 33 | final AxisAlignedBB bb = new AxisAlignedBB 34 | ( 35 | blockPos.getX() - mc.getRenderManager().viewerPosX, 36 | blockPos.getY() - mc.getRenderManager().viewerPosY, 37 | blockPos.getZ() - mc.getRenderManager().viewerPosZ, 38 | blockPos.getX() + 1 - mc.getRenderManager().viewerPosX, 39 | blockPos.getY() + (1) - mc.getRenderManager().viewerPosY, 40 | blockPos.getZ() + 1 - mc.getRenderManager().viewerPosZ 41 | ); 42 | return bb; 43 | } 44 | 45 | public static void drawBox(AxisAlignedBB bb, float r, float g, float b, float a) { 46 | prepareGL(); 47 | RenderGlobal.renderFilledBox(bb, r, g, b, a); 48 | releaseGL(); 49 | } 50 | 51 | public static void drawBoxOutline(AxisAlignedBB bb, float r, float g, float b, float a) { 52 | prepareGL(); 53 | RenderGlobal.renderFilledBox(bb, r, g, b, a); 54 | RenderGlobal.drawSelectionBoundingBox(bb, r, g, b, a * 1.5F); 55 | releaseGL(); 56 | } 57 | 58 | public static void drawOutline(AxisAlignedBB bb, float r, float g, float b, float a) { 59 | prepareGL(); 60 | RenderGlobal.drawSelectionBoundingBox(bb, r, g, b, a * 1.5F); 61 | releaseGL(); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/combat/AutoTotem.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.combat; 2 | 3 | import com.mojang.realmsclient.gui.ChatFormatting; 4 | import me.olliem5.past.api.module.Category; 5 | import me.olliem5.past.api.module.Module; 6 | import me.olliem5.past.api.module.ModuleInfo; 7 | import net.minecraft.init.Items; 8 | import net.minecraft.inventory.ClickType; 9 | import net.minecraft.inventory.EntityEquipmentSlot; 10 | import net.minecraft.item.Item; 11 | import net.minecraft.item.ItemStack; 12 | 13 | @ModuleInfo(name = "AutoTotem", description = "Automatically puts a totem in your offhand", category = Category.COMBAT) 14 | public class AutoTotem extends Module { 15 | 16 | /** 17 | * TODO: Offhand module! 18 | */ 19 | 20 | public int totems; 21 | 22 | @Override 23 | public void onUpdate() { 24 | if (nullCheck()) return; 25 | 26 | totems = mc.player.inventory.mainInventory.stream().filter(itemStack -> itemStack.getItem() == Items.TOTEM_OF_UNDYING).mapToInt(ItemStack::getCount).sum(); 27 | 28 | if (mc.player.getItemStackFromSlot(EntityEquipmentSlot.OFFHAND).getItem() == Items.TOTEM_OF_UNDYING) return; 29 | 30 | final int slot = this.getItemSlot(); 31 | 32 | if (slot != -1) { 33 | mc.playerController.windowClick(mc.player.inventoryContainer.windowId, slot, 0, ClickType.PICKUP, mc.player); 34 | mc.playerController.windowClick(mc.player.inventoryContainer.windowId, 45, 0, ClickType.PICKUP, mc.player); 35 | mc.playerController.windowClick(mc.player.inventoryContainer.windowId, slot, 0, ClickType.PICKUP, mc.player); 36 | mc.playerController.updateController(); 37 | } 38 | } 39 | 40 | private int getItemSlot() { 41 | for (int i = 0; i < 36; i++) { 42 | final Item item = mc.player.inventory.getStackInSlot(i).getItem(); 43 | if (item == Items.TOTEM_OF_UNDYING) { 44 | if (i < 9) { 45 | i += 36; 46 | } 47 | return i; 48 | } 49 | } 50 | return -1; 51 | } 52 | 53 | private int getTotemCount() { 54 | Item item = mc.player.getHeldItemOffhand().getItem(); 55 | if (item == Items.TOTEM_OF_UNDYING) { 56 | return totems + 1; 57 | } else { 58 | return totems; 59 | } 60 | } 61 | 62 | public String getArraylistInfo() { 63 | return ChatFormatting.GRAY + " " + getTotemCount(); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################### 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################### 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/render/SkyColour.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.render; 2 | 3 | import me.olliem5.past.Past; 4 | import me.olliem5.past.api.module.Category; 5 | import me.olliem5.past.api.module.Module; 6 | import me.olliem5.past.api.module.ModuleInfo; 7 | import me.olliem5.past.api.setting.Setting; 8 | import me.zero.alpine.listener.EventHandler; 9 | import me.zero.alpine.listener.Listener; 10 | import net.minecraftforge.client.event.EntityViewRenderEvent; 11 | 12 | import java.awt.*; 13 | 14 | @ModuleInfo(name = "SkyColour", description = "Changes the colours of fog, best in nether & low render distance", category = Category.RENDER) 15 | public class SkyColour extends Module { 16 | 17 | /** 18 | * TODO: Make this work on the whole sky! 19 | */ 20 | 21 | Setting red; 22 | Setting green; 23 | Setting blue; 24 | Setting rainbow; 25 | Setting density; 26 | 27 | @Override 28 | public void setup() { 29 | Past.settingsManager.registerSetting(red = new Setting("Red", "SkyColourRed", 0, 255, 255, this)); 30 | Past.settingsManager.registerSetting(green = new Setting("Green", "SkyColourGreen", 0, 10, 255, this)); 31 | Past.settingsManager.registerSetting(blue = new Setting("Blue", "SkyColourBlue", 0, 10, 255, this)); 32 | Past.settingsManager.registerSetting(rainbow = new Setting("Rainbow", "SkyColourRainbow", false, this)); 33 | Past.settingsManager.registerSetting(density = new Setting("Density", "SkyColourDensity", 0, 0, 255, this)); 34 | } 35 | 36 | @EventHandler 37 | public Listener fogColorsListener = new Listener<>(event -> { 38 | 39 | float[] hue = new float[]{(float) (System.currentTimeMillis() % 7500L) / 7500f}; 40 | int rgb = Color.HSBtoRGB(hue[0], 0.8f, 0.8f); 41 | int r = rgb >> 16 & 255; 42 | int g = rgb >> 8 & 255; 43 | int b = rgb & 255; 44 | 45 | if (rainbow.getValBoolean()) { 46 | event.setRed(r / 255f); 47 | event.setGreen(g / 255f); 48 | event.setBlue(b / 255f); 49 | } else { 50 | event.setRed(red.getValueInt() / 255f); 51 | event.setGreen(green.getValueInt() / 255f); 52 | event.setBlue(blue.getValueInt() / 255f); 53 | } 54 | }); 55 | 56 | @EventHandler 57 | public Listener fogDensityListener = new Listener<>(event -> { 58 | event.setDensity(density.getValueInt() / 255f); 59 | event.setCanceled(true); 60 | }); 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/api/util/render/text/FontUtil.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.api.util.render.text; 2 | 3 | import me.olliem5.past.Past; 4 | import net.minecraft.client.Minecraft; 5 | 6 | public class FontUtil { 7 | 8 | /** 9 | * TODO: String width function 10 | */ 11 | 12 | protected static Minecraft mc = Minecraft.getMinecraft(); 13 | 14 | public static void drawString(String text, float x, float y, int colour) { 15 | if (Past.settingsManager.getSettingID("FontFont").getValueString() == "Lato") { 16 | Past.latoFont.drawString(text, x, y, colour); 17 | } else if (Past.settingsManager.getSettingID("FontFont").getValueString() == "Verdana") { 18 | Past.verdanaFont.drawString(text, x, y, colour); 19 | } else if (Past.settingsManager.getSettingID("FontFont").getValueString() == "Arial") { 20 | Past.arialFont.drawString(text, x, y, colour); 21 | } else { 22 | mc.fontRenderer.drawString(text, (int) x, (int) y, colour); 23 | } 24 | } 25 | 26 | public static void drawStringWithShadow(String text, float x, float y, int colour) { 27 | if (Past.settingsManager.getSettingID("FontFont").getValueString() == "Lato") { 28 | Past.latoFont.drawStringWithShadow(text, x, y, colour); 29 | } else if (Past.settingsManager.getSettingID("FontFont").getValueString() == "Verdana") { 30 | Past.verdanaFont.drawStringWithShadow(text, x, y, colour); 31 | } else if (Past.settingsManager.getSettingID("FontFont").getValueString() == "Arial") { 32 | Past.arialFont.drawStringWithShadow(text, x, y, colour); 33 | } else { 34 | mc.fontRenderer.drawStringWithShadow(text, (int) x, (int) y, colour); 35 | } 36 | } 37 | 38 | public static void drawText(String text, float x, float y, int colour) { 39 | if (Past.settingsManager.getSettingID("FontShadow").getValBoolean()) { 40 | drawStringWithShadow(text, x, y, colour); 41 | } else { 42 | drawString(text, x, y, colour); 43 | } 44 | } 45 | 46 | public static int getFontHeight() { 47 | if (Past.settingsManager.getSettingID("FontFont").getValueString() == "Lato") { 48 | return Past.latoFont.getHeight(); 49 | } else if (Past.settingsManager.getSettingID("FontFont").getValueString() == "Verdana") { 50 | return Past.verdanaFont.getHeight(); 51 | } else if (Past.settingsManager.getSettingID("FontFont").getValueString() == "Arial") { 52 | return Past.arialFont.getHeight(); 53 | } else { 54 | return mc.fontRenderer.FONT_HEIGHT; 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/render/ESP.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.render; 2 | 3 | import me.olliem5.past.Past; 4 | import me.olliem5.past.api.module.Category; 5 | import me.olliem5.past.api.module.Module; 6 | import me.olliem5.past.api.module.ModuleInfo; 7 | import me.olliem5.past.api.setting.Setting; 8 | import me.zero.alpine.listener.EventHandler; 9 | import me.zero.alpine.listener.Listener; 10 | import net.minecraft.entity.Entity; 11 | import net.minecraft.entity.item.EntityEnderCrystal; 12 | import net.minecraft.entity.monster.EntityMob; 13 | import net.minecraft.entity.passive.EntityAnimal; 14 | import net.minecraft.entity.player.EntityPlayer; 15 | import net.minecraftforge.client.event.RenderWorldLastEvent; 16 | 17 | @ModuleInfo(name = "ESP", description = "Highlights loaded entities", category = Category.RENDER) 18 | public class ESP extends Module { 19 | 20 | /** 21 | * TODO: Actually make this good lol 22 | */ 23 | 24 | Setting players; 25 | Setting animals; 26 | Setting mobs; 27 | Setting crystals; 28 | 29 | @Override 30 | public void setup() { 31 | Past.settingsManager.registerSetting(players = new Setting("Players", "ESPPlayers", true, this)); 32 | Past.settingsManager.registerSetting(animals = new Setting("Animals", "ESPAnimals", false, this)); 33 | Past.settingsManager.registerSetting(mobs = new Setting("Mobs", "ESPMobs", false, this)); 34 | Past.settingsManager.registerSetting(crystals = new Setting("Crystals", "ESPCrystals", false, this)); 35 | } 36 | 37 | @EventHandler 38 | public Listener listener = new Listener<>(event -> { 39 | if (mc.world == null) return; 40 | 41 | for (Entity entity : mc.world.getLoadedEntityList()) { 42 | if (entity != mc.player) { 43 | if (entity instanceof EntityPlayer && players.getValBoolean()) { 44 | entity.setGlowing(true); 45 | } else if (entity instanceof EntityAnimal && animals.getValBoolean()) { 46 | entity.setGlowing(true); 47 | } else if (entity instanceof EntityMob && mobs.getValBoolean()) { 48 | entity.setGlowing(true); 49 | } else if (entity instanceof EntityEnderCrystal && crystals.getValBoolean()) { 50 | entity.setGlowing(true); 51 | } 52 | } 53 | } 54 | }); 55 | 56 | @Override 57 | public void onDisable() { 58 | for (Entity entity : mc.world.getLoadedEntityList()) { 59 | if (entity != mc.player) { 60 | entity.setGlowing(false); 61 | } 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/gui/click/clickone/components/BooleanComponent.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.gui.click.clickone.components; 2 | 3 | import me.olliem5.past.Past; 4 | import me.olliem5.past.impl.gui.click.Component; 5 | import me.olliem5.past.api.setting.Setting; 6 | import me.olliem5.past.api.util.colour.RainbowUtil; 7 | import me.olliem5.past.api.util.render.text.FontUtil; 8 | import net.minecraft.client.gui.Gui; 9 | 10 | public class BooleanComponent extends Component { 11 | private Setting op; 12 | private ModuleButton parent; 13 | private int offset; 14 | private int x; 15 | private int y; 16 | 17 | public BooleanComponent(Setting op, ModuleButton parent, int offset) { 18 | this.op = op; 19 | this.parent = parent; 20 | this.x = parent.parent.getX() + parent.parent.getWidth(); 21 | this.y = parent.parent.getY() + parent.offset; 22 | this.offset = offset; 23 | } 24 | 25 | @Override 26 | public void renderComponent() { 27 | if (Past.settingsManager.getSettingID("OldClickGUIRainbow").getValBoolean() && this.op.getValBoolean()) { 28 | Gui.drawRect(parent.parent.getX() + 80, parent.parent.getY() - 12 + offset, parent.parent.getX() + parent.parent.getWidth() + parent.parent.getWidth(), parent.parent.getY() + offset, RainbowUtil.getMultiColour().getRGB()); 29 | } else if (this.op.getValBoolean()) { 30 | Gui.drawRect(parent.parent.getX() + 80, parent.parent.getY() - 12 + offset, parent.parent.getX() + parent.parent.getWidth() + parent.parent.getWidth(), parent.parent.getY() + offset, 0xFF222222); 31 | } else { 32 | Gui.drawRect(parent.parent.getX() + 80, parent.parent.getY() - 12 + offset, parent.parent.getX() + parent.parent.getWidth() + parent.parent.getWidth(), parent.parent.getY() + offset, 0xFF111111); 33 | } 34 | 35 | FontUtil.drawText(this.op.getName(), parent.parent.getX() + 82, (parent.parent.getY() + offset - 10), -1); 36 | } 37 | 38 | @Override 39 | public void updateComponent(int mouseX, int mouseY) { 40 | this.y = parent.parent.getY() - 12 + this.offset; 41 | this.x = parent.parent.getX() + 80; 42 | } 43 | 44 | @Override 45 | public void mouseClicked(int mouseX, int mouseY, int button) { 46 | if (isMouseOnButton(mouseX, mouseY) && button == 0 && this.parent.isOpen()) { 47 | this.op.setValBoolean(!op.getValBoolean()); 48 | } 49 | } 50 | 51 | public boolean isMouseOnButton(int x, int y) { 52 | if (x > this.x && x < this.x + 80 && y > this.y && y < this.y + 12) { 53 | return true; 54 | } else { 55 | return false; 56 | } 57 | } 58 | } -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/api/util/client/DiscordUtil.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.api.util.client; 2 | 3 | import club.minnced.discord.rpc.DiscordEventHandlers; 4 | import club.minnced.discord.rpc.DiscordRPC; 5 | import club.minnced.discord.rpc.DiscordRichPresence; 6 | import me.olliem5.past.Past; 7 | import net.minecraft.client.Minecraft; 8 | import net.minecraft.client.gui.GuiMultiplayer; 9 | import net.minecraft.client.gui.GuiWorldSelection; 10 | 11 | public class DiscordUtil { 12 | private static final Minecraft mc = Minecraft.getMinecraft(); 13 | private static final DiscordRPC rpc = DiscordRPC.INSTANCE; 14 | public static DiscordRichPresence rp = new DiscordRichPresence(); 15 | private static String details; 16 | private static String state; 17 | 18 | public static void startup() { 19 | Past.log("Discord RPC is starting up!"); 20 | final DiscordEventHandlers handlers = new DiscordEventHandlers(); 21 | rpc.Discord_Initialize(Past.APP_ID, handlers, true, ""); 22 | rp.startTimestamp = System.currentTimeMillis() / 1000L; 23 | rp.largeImageKey = "pastclient"; 24 | rp.largeImageText = Past.NAME_VERSION; 25 | rpc.Discord_UpdatePresence(rp); 26 | 27 | new Thread(() -> { 28 | while (!Thread.currentThread().isInterrupted()) { 29 | try { 30 | details = "Main Menu"; 31 | state = "discord.gg/3DBphxC"; 32 | 33 | if (mc.isIntegratedServerRunning()) { 34 | details = "Singleplayer | " + mc.getIntegratedServer().getWorldName(); 35 | } else if (mc.currentScreen instanceof GuiMultiplayer) { 36 | details = "Multiplayer Menu"; 37 | } else if (mc.currentScreen instanceof GuiWorldSelection) { 38 | details = "Singleplayer Menu"; 39 | } else if (mc.getCurrentServerData() != null) { 40 | details = "Server | " + mc.getCurrentServerData().serverIP.toLowerCase(); 41 | } 42 | 43 | rp.details = details; 44 | rp.state = state; 45 | rpc.Discord_UpdatePresence(rp); 46 | } catch (Exception e1) { 47 | e1.printStackTrace(); 48 | } 49 | try { 50 | Thread.sleep(5000L); 51 | } catch (InterruptedException e2) { 52 | e2.printStackTrace(); 53 | } 54 | } 55 | }, "RPC-Callback-Handler").start(); 56 | } 57 | 58 | public static void shutdown() { 59 | Past.log("Discord RPC is shutting down!"); 60 | rpc.Discord_Shutdown(); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/gui/editor/component/HudComponent.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.gui.editor.component; 2 | 3 | import net.minecraft.client.Minecraft; 4 | 5 | public class HudComponent { 6 | protected Minecraft mc = Minecraft.getMinecraft(); 7 | 8 | private String name; 9 | private boolean enabled; 10 | private boolean dragging; 11 | private int x = 2; 12 | private int y = 2; 13 | private int width; 14 | private int height; 15 | private int dragX; 16 | private int dragY; 17 | 18 | public HudComponent(String name) { 19 | this.name = name; 20 | setup(); 21 | } 22 | 23 | public String getName() { 24 | return name; 25 | } 26 | 27 | public void setName(String name) { 28 | this.name = name; 29 | } 30 | 31 | public boolean isEnabled() { 32 | return enabled; 33 | } 34 | 35 | public void setEnabled(boolean enabled) { 36 | this.enabled = enabled; 37 | } 38 | 39 | public boolean isDragging() { 40 | return dragging; 41 | } 42 | 43 | public void setDragging(boolean dragging) { 44 | this.dragging = dragging; 45 | } 46 | 47 | public int getX() { 48 | return x; 49 | } 50 | 51 | public void setX(int x) { 52 | this.x = x; 53 | } 54 | 55 | public int getY() { 56 | return y; 57 | } 58 | 59 | public void setY(int y) { 60 | this.y = y; 61 | } 62 | 63 | public int getWidth() { 64 | return width; 65 | } 66 | 67 | public void setWidth(int width) { 68 | this.width = width; 69 | } 70 | 71 | public int getHeight() { 72 | return height; 73 | } 74 | 75 | public void setHeight(int height) { 76 | this.height = height; 77 | } 78 | 79 | public int getDragX() { 80 | return dragX; 81 | } 82 | 83 | public void setDragX(int dragX) { 84 | this.dragX = dragX; 85 | } 86 | 87 | public int getDragY() { 88 | return dragY; 89 | } 90 | 91 | public void setDragY(int dragY) { 92 | this.dragY = dragY; 93 | } 94 | 95 | public boolean isMouseOnComponent(int x, int y) { 96 | if (x >= this.x && x <= this.x + this.width && y >= this.y && y <= this.y + this.height) { 97 | return true; 98 | } else { 99 | return false; 100 | } 101 | } 102 | 103 | public void updatePosition(int mouseX, int mouseY) { 104 | if (this.dragging) { 105 | this.setX(mouseX - getDragX()); 106 | this.setY(mouseY - getDragY()); 107 | } 108 | } 109 | 110 | public void render(float ticks) {} 111 | 112 | public void setup() {} 113 | } 114 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/render/NoRender.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.render; 2 | 3 | import me.olliem5.past.Past; 4 | import me.olliem5.past.api.module.ModuleInfo; 5 | import me.olliem5.past.impl.events.PacketEvent; 6 | import me.olliem5.past.api.module.Category; 7 | import me.olliem5.past.api.module.Module; 8 | import me.olliem5.past.api.setting.Setting; 9 | import me.zero.alpine.listener.EventHandler; 10 | import me.zero.alpine.listener.Listener; 11 | import net.minecraft.network.Packet; 12 | import net.minecraft.network.play.server.SPacketSpawnExperienceOrb; 13 | import net.minecraft.network.play.server.SPacketSpawnPainting; 14 | import net.minecraftforge.client.event.RenderBlockOverlayEvent; 15 | 16 | @ModuleInfo(name = "NoRender", description = "Disables the rendering of certain things", category = Category.RENDER) 17 | public class NoRender extends Module { 18 | 19 | Setting fire; 20 | Setting armour; 21 | Setting bossbar; 22 | Setting hurtcam; 23 | Setting xp; 24 | Setting paintings; 25 | Setting weather; 26 | 27 | @Override 28 | public void setup() { 29 | Past.settingsManager.registerSetting(fire = new Setting("Fire", "NoRenderFire", true, this)); 30 | Past.settingsManager.registerSetting(armour = new Setting("Armour", "NoRenderArmour", false, this)); 31 | Past.settingsManager.registerSetting(bossbar = new Setting("Boss Bar", "NoRenderBossBar", false, this)); 32 | Past.settingsManager.registerSetting(hurtcam = new Setting("Hurt Cam", "NoRenderHurtCam", true, this)); 33 | Past.settingsManager.registerSetting(xp = new Setting("XP", "NoRenderXP", false, this)); 34 | Past.settingsManager.registerSetting(paintings = new Setting("Paintings", "NoRenderPaintings", false, this)); 35 | Past.settingsManager.registerSetting(weather = new Setting("Weather", "NoRenderWeather", true, this)); 36 | } 37 | 38 | public void onUpdate() { 39 | if (nullCheck()) return; 40 | 41 | if (weather.getValBoolean()) { 42 | if (mc.world.isRaining()) { 43 | mc.world.setRainStrength(0); 44 | } 45 | } 46 | } 47 | 48 | @EventHandler 49 | public Listener packetSendListener = new Listener<>(event -> { 50 | Packet packet = event.getPacket(); 51 | 52 | if (packet instanceof SPacketSpawnExperienceOrb && xp.getValBoolean() || packet instanceof SPacketSpawnPainting && paintings.getValBoolean()) { 53 | event.cancel(); 54 | } 55 | }); 56 | 57 | @EventHandler 58 | public Listener renderBlockOverlayEventListener = new Listener<>(event -> { 59 | if (fire.getValBoolean() && event.getOverlayType() == RenderBlockOverlayEvent.OverlayType.FIRE) { 60 | event.setCanceled(true); 61 | } 62 | }); 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/gui/click/clickone/components/KeybindComponent.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.gui.click.clickone.components; 2 | 3 | import com.mojang.realmsclient.gui.ChatFormatting; 4 | import me.olliem5.past.impl.gui.click.Component; 5 | import me.olliem5.past.api.util.render.text.FontUtil; 6 | import net.minecraft.client.gui.Gui; 7 | import org.lwjgl.input.Keyboard; 8 | 9 | public class KeybindComponent extends Component { 10 | private boolean isBinding; 11 | private ModuleButton parent; 12 | private int offset; 13 | private int x; 14 | private int y; 15 | 16 | public KeybindComponent(ModuleButton parent, int offset) { 17 | this.parent = parent; 18 | this.x = parent.parent.getX() + parent.parent.getWidth(); 19 | this.y = parent.parent.getY() + parent.offset; 20 | this.offset = offset; 21 | } 22 | 23 | @Override 24 | public void renderComponent() { 25 | Gui.drawRect(parent.parent.getX() + 80, parent.parent.getY() - 12 + offset, parent.parent.getX() + parent.parent.getWidth() + parent.parent.getWidth(), parent.parent.getY() + offset, 0xFF111111); 26 | 27 | if (isBinding) { 28 | FontUtil.drawText("Listening" + ChatFormatting.GRAY + " " + "...", parent.parent.getX() + 82, (parent.parent.getY() + offset - 10), -1); 29 | } else { 30 | FontUtil.drawText("Bind" + ChatFormatting.GRAY + " " + Keyboard.getKeyName(this.parent.mod.getKey()), parent.parent.getX() + 82, (parent.parent.getY() + offset - 10), -1); 31 | } 32 | } 33 | 34 | @Override 35 | public void updateComponent(int mouseX, int mouseY) { 36 | this.y = parent.parent.getY() - 12 + this.offset; 37 | this.x = parent.parent.getX() + 80; 38 | } 39 | 40 | @Override 41 | public void mouseClicked(int mouseX, int mouseY, int button) { 42 | if (isMouseOnButton(mouseX, mouseY) && button == 0 && this.parent.isOpen()) { 43 | this.isBinding = !this.isBinding; 44 | } 45 | } 46 | 47 | @Override 48 | public void keyTyped(char typedChar, int key) { 49 | if (this.isBinding) { 50 | if (Keyboard.isKeyDown(Keyboard.KEY_DELETE)) { 51 | this.parent.mod.setKey(Keyboard.KEY_NONE); 52 | this.isBinding = false; 53 | } else if (Keyboard.isKeyDown(Keyboard.KEY_BACK)) { 54 | this.parent.mod.setKey(Keyboard.KEY_NONE); 55 | this.isBinding = false; 56 | } else { 57 | this.parent.mod.setKey(key); 58 | this.isBinding = false; 59 | } 60 | } 61 | } 62 | 63 | public boolean isMouseOnButton(int x, int y) { 64 | if (x > this.x && x < this.x + 80 && y > this.y && y < this.y + 12) { 65 | return true; 66 | } else { 67 | return false; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/api/util/render/text/RenderText.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.api.util.render.text; 2 | 3 | import me.olliem5.past.Past; 4 | import net.minecraft.client.Minecraft; 5 | import net.minecraft.client.renderer.GlStateManager; 6 | import net.minecraft.entity.player.EntityPlayer; 7 | import net.minecraft.util.math.BlockPos; 8 | 9 | /** 10 | * Modified from Wurst+2 11 | * https://github.com/TrvsF/wurstplus-two/blob/77b6ac96dbbf840c46e549c8df1b0f600ddc7221/src/main/java/me/travis/wurstplus/wurstplustwo/util/WurstplusRenderUtil.java#L20 12 | */ 13 | 14 | public class RenderText { 15 | protected static Minecraft mc = Minecraft.getMinecraft(); 16 | 17 | public static void glBillboard(final float x, final float y, final float z) { 18 | final float scale = 0.02666667f; 19 | GlStateManager.translate(x - mc.getRenderManager().renderPosX, y - mc.getRenderManager().renderPosY, z - mc.getRenderManager().renderPosZ); 20 | GlStateManager.glNormal3f(0.0f, 1.0f, 0.0f); 21 | GlStateManager.rotate(-mc.player.rotationYaw, 0.0f, 1.0f, 0.0f); 22 | GlStateManager.rotate(mc.player.rotationPitch, (mc.gameSettings.thirdPersonView == 2) ? -1.0f : 1.0f, 0.0f, 0.0f); 23 | GlStateManager.scale(-scale, -scale, scale); 24 | } 25 | 26 | public static void glBillboardDistanceScaled(final float x, final float y, final float z, final EntityPlayer player, final float scale) { 27 | glBillboard(x, y, z); 28 | final int distance = (int) player.getDistance(x, y, z); 29 | float scaleDistance = distance / 2.0f / (2.0f + (2.0f - scale)); 30 | if (scaleDistance < 1.0f) { 31 | scaleDistance = 1.0f; 32 | } 33 | GlStateManager.scale(scaleDistance, scaleDistance, scaleDistance); 34 | } 35 | 36 | public static void drawText(final BlockPos pos, final String text) { 37 | GlStateManager.pushMatrix(); 38 | glBillboardDistanceScaled(pos.getX() + 0.5f, pos.getY() + 0.5f, pos.getZ() + 0.5f, mc.player, 1.0f); 39 | GlStateManager.disableDepth(); 40 | 41 | if (Past.settingsManager.getSettingID("FontFont").getValueString() == "Lato") { 42 | GlStateManager.translate(-(Past.latoFont.getStringWidth(text) / 2.0), 0.0, 0.0); 43 | } else if (Past.settingsManager.getSettingID("FontFont").getValueString() == "Verdana") { 44 | GlStateManager.translate(-(Past.verdanaFont.getStringWidth(text) / 2.0), 0.0, 0.0); 45 | } else if (Past.settingsManager.getSettingID("FontFont").getValueString() == "Arial") { 46 | GlStateManager.translate(-(Past.arialFont.getStringWidth(text) / 2.0), 0.0, 0.0); 47 | } else { 48 | GlStateManager.translate(-(mc.fontRenderer.getStringWidth(text) / 2.0), 0.0, 0.0); 49 | } 50 | 51 | FontUtil.drawText(text, 0.0f, 0.0f, -1); 52 | GlStateManager.popMatrix(); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/api/util/render/RubikUtil.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.api.util.render; 2 | 3 | import org.lwjgl.util.vector.Quaternion; 4 | 5 | /** 6 | * @author rebane2001 7 | * https://github.com/rebane2001/cr3stal/blob/master/1.12/CrystalUtil.java 8 | */ 9 | 10 | public class RubikUtil { 11 | //Rotation of individual cubelets 12 | public static Quaternion[] cubeletStatus = { 13 | new Quaternion(), 14 | new Quaternion(), 15 | new Quaternion(), 16 | new Quaternion(), 17 | new Quaternion(), 18 | new Quaternion(), 19 | new Quaternion(), 20 | new Quaternion(), 21 | new Quaternion(), 22 | new Quaternion(), 23 | new Quaternion(), 24 | new Quaternion(), 25 | new Quaternion(), 26 | new Quaternion(), 27 | new Quaternion(), 28 | new Quaternion(), 29 | new Quaternion(), 30 | new Quaternion(), 31 | new Quaternion(), 32 | new Quaternion(), 33 | new Quaternion(), 34 | new Quaternion(), 35 | new Quaternion(), 36 | new Quaternion(), 37 | new Quaternion(), 38 | new Quaternion() 39 | }; 40 | 41 | //Get ID of cublet by position 42 | public static int[][][] cubletLookup = { 43 | // x 44 | { 45 | //y 46 | {17,9,0}, 47 | {20,16,3}, 48 | {23,15,6} 49 | }, 50 | { 51 | //y 52 | {18,10,1}, 53 | {21,-1,4}, 54 | {24,14,7} 55 | }, 56 | { 57 | //y 58 | {19,11,2}, 59 | {22,12,5}, 60 | {25,13,8} 61 | } 62 | }; 63 | 64 | //Get cublet IDs of a side 65 | public static int[][] cubeSides = { 66 | // front 67 | {0,1,2,3,4,5,6,7,8}, 68 | // back 69 | {19,18,17,22,21,20,25,24,23}, 70 | // top 71 | {0,1,2,9,10,11,17,18,19}, 72 | // bottom 73 | {23,24,25,15,14,13,6,7,8}, 74 | // left 75 | {17,9,0,20,16,3,23,15,6}, 76 | // right 77 | {2,11,19,5,12,22,8,13,25} 78 | }; 79 | 80 | //Transformations of cube sides 81 | public static int[][] cubeSideTransforms = { 82 | {0,0,1}, 83 | {0,0,-1}, 84 | {0,1,0}, 85 | {0,-1,0}, 86 | {-1,0,0}, 87 | {1,0,0} 88 | }; 89 | 90 | //Extra method from different class 91 | public static double easeInOutCubic (double t) { 92 | return t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2; 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/api/event/ForgeEvents.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.api.event; 2 | 3 | import me.olliem5.past.Past; 4 | import me.olliem5.past.impl.gui.editor.component.HudComponent; 5 | import me.olliem5.past.api.module.Module; 6 | import net.minecraftforge.client.event.*; 7 | import net.minecraftforge.common.MinecraftForge; 8 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; 9 | import net.minecraftforge.fml.common.gameevent.InputEvent; 10 | import net.minecraftforge.fml.common.gameevent.TickEvent; 11 | import org.lwjgl.input.Keyboard; 12 | 13 | public class ForgeEvents { 14 | 15 | public ForgeEvents() { 16 | MinecraftForge.EVENT_BUS.register(this); 17 | } 18 | 19 | @SubscribeEvent 20 | public void onKeyInput(InputEvent.KeyInputEvent event) { 21 | if (Keyboard.getEventKeyState()) { 22 | if (Keyboard.getEventKey() == Keyboard.KEY_NONE || Keyboard.getEventKey() == Keyboard.CHAR_NONE) return; 23 | for (Module modules : Past.moduleManager.getModules()) { 24 | if (modules.getKey() == Keyboard.getEventKey()) { 25 | modules.toggle(); 26 | } 27 | } 28 | // Past.EVENT_BUS.post(event); 29 | } 30 | } 31 | 32 | @SubscribeEvent 33 | public void onTick(TickEvent.ClientTickEvent event) { 34 | for (Module module : Past.moduleManager.getModules()) { 35 | if (module.isToggled()) { 36 | module.onUpdate(); 37 | } 38 | } 39 | // Past.EVENT_BUS.post(event); 40 | } 41 | 42 | @SubscribeEvent 43 | public void onRenderGameOverlay(RenderGameOverlayEvent.Text event) { 44 | for (HudComponent hudComponent : Past.hudComponentManager.getHudComponents()) { 45 | if (hudComponent.isEnabled()) { 46 | hudComponent.render(event.getPartialTicks()); 47 | } 48 | } 49 | Past.EVENT_BUS.post(event); 50 | } 51 | 52 | @SubscribeEvent 53 | public void onInputUpdate(InputUpdateEvent event) { 54 | Past.EVENT_BUS.post(event); 55 | } 56 | 57 | @SubscribeEvent 58 | public void onRender(RenderWorldLastEvent event) { 59 | Past.EVENT_BUS.post(event); 60 | } 61 | 62 | @SubscribeEvent 63 | public void fovEvent(EntityViewRenderEvent.FOVModifier event) { 64 | Past.EVENT_BUS.post(event); 65 | } 66 | 67 | @SubscribeEvent 68 | public void fogColours(EntityViewRenderEvent.FogColors event) { 69 | Past.EVENT_BUS.post(event); 70 | } 71 | 72 | @SubscribeEvent 73 | public void fogDensity(EntityViewRenderEvent.FogDensity event) { 74 | Past.EVENT_BUS.post(event); 75 | } 76 | 77 | @SubscribeEvent 78 | public void renderBlockOverlay(RenderBlockOverlayEvent event) { 79 | Past.EVENT_BUS.post(event); 80 | } 81 | 82 | @SubscribeEvent 83 | public void onChat(ClientChatEvent event) { 84 | Past.EVENT_BUS.post(event); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/chat/ChatSuffix.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.chat; 2 | 3 | import com.mojang.realmsclient.gui.ChatFormatting; 4 | import me.olliem5.past.Past; 5 | import me.olliem5.past.api.module.ModuleInfo; 6 | import me.olliem5.past.impl.events.PacketEvent; 7 | import me.olliem5.past.api.module.Category; 8 | import me.olliem5.past.api.module.Module; 9 | import me.olliem5.past.api.setting.Setting; 10 | import me.zero.alpine.listener.EventHandler; 11 | import me.zero.alpine.listener.Listener; 12 | import net.minecraft.network.play.client.CPacketChatMessage; 13 | 14 | import java.util.ArrayList; 15 | 16 | @ModuleInfo(name = "ChatSuffix", description = "Adds a custom ending to your messages", category = Category.CHAT) 17 | public class ChatSuffix extends Module { 18 | 19 | Setting suffixmode; 20 | Setting blue; 21 | Setting green; 22 | 23 | @Override 24 | public void setup() { 25 | ArrayList modes = new ArrayList<>(); 26 | modes.add("Classic"); 27 | modes.add("Version"); 28 | 29 | Past.settingsManager.registerSetting(suffixmode = new Setting("Suffix", "ChatSuffixMode", this, modes, "Classic")); 30 | Past.settingsManager.registerSetting(blue = new Setting("Blue Suffix", "ChatSuffixBlue", false, this)); 31 | Past.settingsManager.registerSetting(green = new Setting("Green Suffix", "ChatSuffixGreen", false, this)); 32 | } 33 | 34 | private String classicsuffix = " \uff30\uff41\uff53\uff54"; 35 | private String versionsuffix = " \uff30\uff41\uff53\uff54" + " " + Past.VERSION; 36 | 37 | @EventHandler 38 | public Listener listener = new Listener<>(event -> { 39 | if (event.getPacket() instanceof CPacketChatMessage) { 40 | 41 | String s = ((CPacketChatMessage) event.getPacket()).getMessage(); 42 | 43 | if (s.startsWith("/") || s.startsWith(Past.commandManager.prefix)) return; 44 | 45 | if (suffixmode.getValueString() == "Classic") { 46 | if (blue.getValBoolean()) { 47 | s += " `" + classicsuffix; 48 | } else if (green.getValBoolean()) { 49 | s += " >" + classicsuffix; 50 | } else { 51 | s += classicsuffix; 52 | } 53 | } 54 | 55 | if (suffixmode.getValueString() == "Version") { 56 | if (blue.getValBoolean()) { 57 | s += " `" + versionsuffix; 58 | } else if (green.getValBoolean()) { 59 | s += " >" + versionsuffix; 60 | } else { 61 | s += versionsuffix; 62 | } 63 | } 64 | 65 | if (s.length() >= 256) { 66 | s = s.substring(0, 256); 67 | } 68 | 69 | ((CPacketChatMessage) event.getPacket()).message = s; 70 | } 71 | }); 72 | 73 | public String getArraylistInfo() { 74 | return ChatFormatting.GRAY + " " + suffixmode.getValueString().toUpperCase(); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/player/FastUse.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.player; 2 | 3 | import me.olliem5.past.Past; 4 | import me.olliem5.past.api.module.Category; 5 | import me.olliem5.past.api.module.Module; 6 | import me.olliem5.past.api.module.ModuleInfo; 7 | import me.olliem5.past.api.setting.Setting; 8 | import net.minecraft.block.Block; 9 | import net.minecraft.item.ItemBlock; 10 | import net.minecraft.item.ItemBow; 11 | import net.minecraft.item.ItemEndCrystal; 12 | import net.minecraft.item.ItemExpBottle; 13 | import net.minecraft.network.play.client.CPacketPlayerDigging; 14 | import net.minecraft.network.play.client.CPacketPlayerTryUseItem; 15 | import net.minecraft.util.math.BlockPos; 16 | 17 | @ModuleInfo(name = "FastUse", description = "Allows you to use items faster", category = Category.PLAYER) 18 | public class FastUse extends Module { 19 | 20 | Setting bow; 21 | Setting exp; 22 | Setting crystals; 23 | Setting blocks; 24 | Setting other; 25 | 26 | @Override 27 | public void setup() { 28 | Past.settingsManager.registerSetting(bow = new Setting("Bow", "FastUseBow", true, this)); 29 | Past.settingsManager.registerSetting(exp = new Setting("Exp Bottles", "FastUseExpBottles", true, this)); 30 | Past.settingsManager.registerSetting(crystals = new Setting("End Crystals", "FastUseEndCrystals", true, this)); 31 | Past.settingsManager.registerSetting(blocks = new Setting("Blocks", "FastUseBlocks", false, this)); 32 | Past.settingsManager.registerSetting(other = new Setting("Other", "FastUseOther", false, this)); 33 | } 34 | 35 | public void onUpdate() { 36 | if (nullCheck()) return; 37 | 38 | if (mc.player.getHeldItemMainhand().getItem() instanceof ItemBow) { 39 | if (mc.player.isHandActive() && mc.player.getItemInUseMaxCount() >= 3) { 40 | if (bow.getValBoolean()) { 41 | mc.player.connection.sendPacket(new CPacketPlayerDigging(CPacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, mc.player.getHorizontalFacing())); 42 | mc.player.connection.sendPacket(new CPacketPlayerTryUseItem(mc.player.getActiveHand())); 43 | mc.player.stopActiveHand(); 44 | } 45 | } 46 | } else if (mc.player.getHeldItemMainhand().getItem() instanceof ItemExpBottle) { 47 | if (exp.getValBoolean()) { 48 | mc.rightClickDelayTimer = 0; 49 | } 50 | } else if (mc.player.getHeldItemMainhand().getItem() instanceof ItemEndCrystal) { 51 | if (crystals.getValBoolean()) { 52 | mc.rightClickDelayTimer = 0; 53 | } 54 | } else if (Block.getBlockFromItem(mc.player.getHeldItemMainhand().getItem()).getDefaultState().isFullBlock()) { 55 | if (blocks.getValBoolean()) { 56 | mc.rightClickDelayTimer = 0; 57 | } 58 | } else if (!(mc.player.getHeldItemMainhand().getItem() instanceof ItemBlock)) { 59 | if (other.getValBoolean()) { 60 | mc.rightClickDelayTimer = 0; 61 | } 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/api/module/Module.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.api.module; 2 | 3 | import me.olliem5.past.Past; 4 | import net.minecraft.client.Minecraft; 5 | import org.lwjgl.input.Keyboard; 6 | 7 | public class Module { 8 | protected Minecraft mc = Minecraft.getMinecraft(); 9 | 10 | private String name = getAnnotation().name(); 11 | private String description = getAnnotation().description(); 12 | private Category category = getAnnotation().category(); 13 | private Integer key = getAnnotation().key(); 14 | 15 | private boolean toggled; 16 | 17 | public Module() { 18 | toggled = false; 19 | setup(); 20 | } 21 | 22 | private ModuleInfo getAnnotation() { 23 | if (getClass().isAnnotationPresent(ModuleInfo.class)) { 24 | return getClass().getAnnotation(ModuleInfo.class); 25 | } 26 | throw new IllegalStateException("No annotation present!"); 27 | } 28 | 29 | public void toggle() { 30 | toggled = !toggled; 31 | onToggle(); 32 | if (toggled) { 33 | onEnableEvent(); 34 | } else { 35 | onDisableEvent(); 36 | } 37 | } 38 | 39 | public boolean isToggled() { 40 | return toggled; 41 | } 42 | 43 | public void onEnableEvent() { 44 | Past.EVENT_BUS.subscribe(this); 45 | 46 | if (Past.configUtil != null) { 47 | try { 48 | Past.configUtil.saveLoadedModules(); 49 | } catch (Exception e) {} 50 | } 51 | 52 | onEnable(); 53 | } 54 | 55 | public void onDisableEvent() { 56 | Past.EVENT_BUS.unsubscribe(this); 57 | 58 | if (Past.configUtil != null) { 59 | try { 60 | Past.configUtil.saveLoadedModules(); 61 | } catch (Exception e) {} 62 | } 63 | 64 | onDisable(); 65 | } 66 | 67 | public Integer getKey() { 68 | return key; 69 | } 70 | 71 | public void setKey(Integer key) { 72 | this.key = key; 73 | 74 | if (Past.configUtil != null) { 75 | try { 76 | Past.configUtil.saveKeybinds(); 77 | } catch (Exception e) {} 78 | } 79 | } 80 | 81 | public String getArraylistInfo() { 82 | return ""; 83 | } 84 | 85 | public String getName() { 86 | return name; 87 | } 88 | 89 | public void setName(String name) { 90 | this.name = name; 91 | } 92 | 93 | public String getDescription() { 94 | return description; 95 | } 96 | 97 | public void setDescription(String description) { 98 | this.description = description; 99 | } 100 | 101 | public Category getCategory() { 102 | return category; 103 | } 104 | 105 | public void setCategory(Category category) { 106 | this.category = category; 107 | } 108 | 109 | public boolean nullCheck() { 110 | return mc.player == null || mc.world == null; 111 | } 112 | 113 | public void onToggle() {} 114 | 115 | public void onUpdate() {} 116 | 117 | public void setup() {} 118 | 119 | public void onEnable() {} 120 | 121 | public void onDisable() {} 122 | } -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/api/module/ModuleManager.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.api.module; 2 | 3 | import me.olliem5.past.impl.modules.chat.*; 4 | import me.olliem5.past.impl.modules.combat.*; 5 | import me.olliem5.past.impl.modules.core.*; 6 | import me.olliem5.past.impl.modules.exploit.*; 7 | import me.olliem5.past.impl.modules.misc.*; 8 | import me.olliem5.past.impl.modules.movement.*; 9 | import me.olliem5.past.impl.modules.player.*; 10 | import me.olliem5.past.impl.modules.render.*; 11 | 12 | import java.util.ArrayList; 13 | 14 | public class ModuleManager { 15 | public ArrayList modules = new ArrayList<>(); 16 | 17 | public ModuleManager() { 18 | /* Chat */ 19 | modules.add(new ChatSuffix()); 20 | modules.add(new AutoInsult()); 21 | modules.add(new DurabilityWarn()); 22 | 23 | /* Combat */ 24 | modules.add(new AutoTotem()); 25 | modules.add(new BonBedAura()); 26 | modules.add(new AutoCrystal()); 27 | modules.add(new Surround()); 28 | modules.add(new FootEXP()); 29 | modules.add(new Criticals()); 30 | modules.add(new KillAura()); 31 | modules.add(new ChorusSave()); 32 | modules.add(new AutoTrap()); 33 | modules.add(new AutoCreeper()); 34 | 35 | /* Core */ 36 | modules.add(new OldClickGUI()); 37 | modules.add(new HUD()); 38 | modules.add(new HUDEditor()); 39 | modules.add(new Render()); 40 | modules.add(new Capes()); 41 | modules.add(new ClickGUI()); 42 | modules.add(new Font()); 43 | 44 | /* Exploit */ 45 | modules.add(new Blink()); 46 | modules.add(new PortalGodMode()); 47 | modules.add(new Timer()); 48 | modules.add(new XCarry()); 49 | modules.add(new BowBoost()); 50 | modules.add(new PacketMine()); 51 | 52 | /* Misc */ 53 | modules.add(new DiscordRPC()); 54 | modules.add(new EntityAlert()); 55 | modules.add(new FakePlayer()); 56 | modules.add(new AutoBuilder()); 57 | modules.add(new MCF()); 58 | 59 | /* Movement */ 60 | modules.add(new Sprint()); 61 | modules.add(new Step()); 62 | modules.add(new Flight()); 63 | modules.add(new Velocity()); 64 | modules.add(new NoSlow()); 65 | 66 | /* Player */ 67 | modules.add(new WeaknessAlert()); 68 | modules.add(new AutoLog()); 69 | modules.add(new FastUse()); 70 | modules.add(new NoRotate()); 71 | modules.add(new Burrow()); 72 | 73 | /* Render */ 74 | modules.add(new ESP()); 75 | modules.add(new ViewModel()); 76 | modules.add(new SkyColour()); 77 | modules.add(new Fullbright()); 78 | modules.add(new Time()); 79 | modules.add(new HoleESP()); 80 | modules.add(new BlockHighlight()); 81 | modules.add(new NoRender()); 82 | modules.add(new Trajectories()); 83 | modules.add(new HandProgress()); 84 | modules.add(new CrystalCustomize()); 85 | } 86 | 87 | public ArrayList getModules() { 88 | return modules; 89 | } 90 | 91 | public Module getModuleByName(String name) { 92 | return modules.stream().filter(module -> module.getName().equalsIgnoreCase(name)).findFirst().orElse(null); 93 | } 94 | } -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/api/util/client/MessageUtil.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.api.util.client; 2 | 3 | import com.mojang.realmsclient.gui.ChatFormatting; 4 | import net.minecraft.client.Minecraft; 5 | import net.minecraft.client.entity.EntityPlayerSP; 6 | import net.minecraft.util.text.TextComponentString; 7 | 8 | public class MessageUtil { 9 | private static final EntityPlayerSP player = Minecraft.getMinecraft().player; 10 | 11 | public static String prefix = ChatFormatting.GRAY + "[" + ChatFormatting.RED + "Past Client" + ChatFormatting.GRAY + "]"; 12 | public static String entityalertPrefix = ChatFormatting.GRAY + "[" + ChatFormatting.DARK_RED + "EntityAlert" + ChatFormatting.GRAY + "]"; 13 | public static String weaknessAlertPrefix = ChatFormatting.GRAY + "[" + ChatFormatting.DARK_RED + "WeaknessDetect" + ChatFormatting.GRAY + "]"; 14 | public static String bedAuraPrefix = ChatFormatting.GRAY + "[" + ChatFormatting.DARK_RED + "BedAura" + ChatFormatting.GRAY + "]"; 15 | public static String surroundPrefix = ChatFormatting.GRAY + "[" + ChatFormatting.DARK_RED + "Surround" + ChatFormatting.GRAY + "]"; 16 | public static String autoBuilderPrefix = ChatFormatting.GRAY + "[" + ChatFormatting.DARK_RED + "AutoBuilder" + ChatFormatting.GRAY + "]"; 17 | public static String friendsPrefix = ChatFormatting.GRAY + "[" + ChatFormatting.DARK_RED + "Friends" + ChatFormatting.GRAY + "]"; 18 | public static String autoCrystalPrefix = ChatFormatting.GRAY + "[" + ChatFormatting.DARK_RED + "AutoCrystal" + ChatFormatting.GRAY + "]"; 19 | public static String autoInsultPrefix = ChatFormatting.GRAY + "[" + ChatFormatting.DARK_RED + "AutoInsult" + ChatFormatting.GRAY + "]"; 20 | public static String durabilityWarnPrefix = ChatFormatting.GRAY + "[" + ChatFormatting.DARK_RED + "DurabilityWarn" + ChatFormatting.GRAY + "]"; 21 | 22 | public static void sendRawMessage(String message) { 23 | player.sendMessage(new TextComponentString(message)); 24 | } 25 | 26 | public static void sendMessagePrefix(String message) { 27 | sendRawMessage(prefix + " " + message); 28 | } 29 | 30 | public static void sendEntityAlertMessage(String message) { 31 | sendMessagePrefix(entityalertPrefix + " " + message); 32 | } 33 | 34 | public static void sendWeaknessAlertMessage(String message) { 35 | sendMessagePrefix(weaknessAlertPrefix + " " + message); 36 | } 37 | 38 | public static void sendBedAuraMessage(String message) { 39 | sendMessagePrefix(bedAuraPrefix + " " + message); 40 | } 41 | 42 | public static void sendSurroundMessage(String message) { 43 | sendMessagePrefix(surroundPrefix + " " + message); 44 | } 45 | 46 | public static void sendAutoBuilderMessage(String message) { 47 | sendMessagePrefix(autoBuilderPrefix + " " + message); 48 | } 49 | 50 | public static void sendFreindsMessage(String message) { 51 | sendMessagePrefix(friendsPrefix + " " + message); 52 | } 53 | 54 | public static void sendAutoCrystalMessage(String message) { 55 | sendMessagePrefix(autoCrystalPrefix + " " + message); 56 | } 57 | 58 | public static void sendAutoInsultMessage(String message) { 59 | sendMessagePrefix(autoInsultPrefix + " " + message); 60 | } 61 | 62 | public static void sendDurabilityWarnMessage(String message) { 63 | sendMessagePrefix(durabilityWarnPrefix + " " + message); 64 | } 65 | } -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/combat/KillAura.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.combat; 2 | 3 | import com.mojang.realmsclient.gui.ChatFormatting; 4 | import me.olliem5.past.Past; 5 | import me.olliem5.past.api.module.Category; 6 | import me.olliem5.past.api.module.Module; 7 | import me.olliem5.past.api.module.ModuleInfo; 8 | import me.olliem5.past.api.setting.Setting; 9 | import net.minecraft.entity.Entity; 10 | import net.minecraft.entity.monster.EntityMob; 11 | import net.minecraft.entity.passive.EntityAnimal; 12 | import net.minecraft.entity.player.EntityPlayer; 13 | import net.minecraft.util.EnumHand; 14 | 15 | import java.util.Comparator; 16 | import java.util.List; 17 | import java.util.stream.Collectors; 18 | 19 | @ModuleInfo(name = "KillAura", description = "Automatically attacks entities in range", category = Category.COMBAT) 20 | public class KillAura extends Module { 21 | 22 | Setting range; 23 | Setting players; 24 | Setting mobs; 25 | Setting animals; 26 | 27 | @Override 28 | public void setup() { 29 | Past.settingsManager.registerSetting(range = new Setting("Range", "KillAuraRange", 0.0, 5.0, 10.0, this)); 30 | Past.settingsManager.registerSetting(players = new Setting("Players", "KillAuraPlayers", true, this)); 31 | Past.settingsManager.registerSetting(mobs = new Setting("Mobs", "KillAuraMobs", false, this)); 32 | Past.settingsManager.registerSetting(animals = new Setting("Animals", "KillAuraAnimals", false, this)); 33 | } 34 | 35 | private Entity target = null; 36 | 37 | public void onUpdate() { 38 | if (nullCheck()) return; 39 | 40 | List targets = mc.world.loadedEntityList.stream() 41 | .filter(entity -> entity != mc.player) 42 | .filter(entity -> mc.player.getDistance(entity) <= range.getValueDouble()) 43 | .filter(entity -> !entity.isDead) 44 | .filter(entity -> attackCheck(entity)) 45 | .sorted(Comparator.comparing(e -> mc.player.getDistance(e))) 46 | .collect(Collectors.toList()); 47 | 48 | targets.forEach(target -> { 49 | attack(target); 50 | }); 51 | } 52 | 53 | public void attack(Entity entity) { 54 | if (mc.player.getCooledAttackStrength(0) >= 1) { 55 | mc.playerController.attackEntity(mc.player, entity); 56 | mc.player.swingArm(EnumHand.MAIN_HAND); 57 | } 58 | target = entity; 59 | } 60 | 61 | public boolean attackCheck(Entity entity) { 62 | if (players.getValBoolean() && entity instanceof EntityPlayer && !Past.friendsManager.isFriend(entity.getName())) { 63 | if (((EntityPlayer) entity).getHealth() > 0) { 64 | return true; 65 | } 66 | } else if (mobs.getValBoolean() && entity instanceof EntityMob) { 67 | if (((EntityMob) entity).getHealth() > 0) { 68 | return true; 69 | } 70 | } else if (animals.getValBoolean() && entity instanceof EntityAnimal) { 71 | if (((EntityAnimal) entity).getHealth() > 0) { 72 | return true; 73 | } 74 | } 75 | return false; 76 | } 77 | 78 | public String getArraylistInfo() { 79 | if (target != null) { 80 | return ChatFormatting.GRAY + " " + target.getName(); 81 | } else { 82 | return ""; 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/gui/click/clickone/ClickGUIOne.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.gui.click.clickone; 2 | 3 | import me.olliem5.past.Past; 4 | import me.olliem5.past.impl.gui.click.Component; 5 | import me.olliem5.past.api.module.Category; 6 | import net.minecraft.client.gui.GuiScreen; 7 | 8 | import java.util.ArrayList; 9 | 10 | public class ClickGUIOne extends GuiScreen { 11 | public static ArrayList panels; 12 | 13 | public ClickGUIOne() { 14 | panels = new ArrayList<>(); 15 | int panelX = 10; 16 | int panelY = 5; 17 | int panelWidth = 80; 18 | int panelHeight = 15; 19 | 20 | for (Category c : Category.values()) { 21 | ClickGUIOne.panels.add(new Panel(c.getCategoryName(), panelX, panelY, panelWidth, panelHeight, c)); 22 | panelX += 81; 23 | } 24 | } 25 | 26 | @Override 27 | public void drawScreen(int mouseX, int mouseY, float partialTicks) { 28 | if (Past.settingsManager.getSettingID("OldClickGUIBackground").getValBoolean()) { 29 | drawDefaultBackground(); 30 | } 31 | for (Panel p : panels) { 32 | p.updatePosition(mouseX, mouseY); 33 | p.drawScreen(mouseX, mouseY, partialTicks); 34 | 35 | for (Component comp : p.getComponents()) { 36 | comp.updateComponent(mouseX, mouseY); 37 | } 38 | } 39 | } 40 | 41 | @Override 42 | public void mouseClicked(int mouseX, int mouseY, int mouseButton) { 43 | for (Panel p : panels) { 44 | if (p.isWithinHeader(mouseX, mouseY) && mouseButton == 0) { 45 | p.setDragging(true); 46 | p.dragX = mouseX - p.getX(); 47 | p.dragY = mouseY - p.getY(); 48 | } 49 | 50 | if (p.isWithinHeader(mouseX, mouseY) && mouseButton == 1) { 51 | p.setOpen(!p.isOpen()); 52 | } 53 | 54 | if (p.isOpen() && !p.getComponents().isEmpty()) { 55 | for (Component component : p.getComponents()) { 56 | component.mouseClicked(mouseX, mouseY, mouseButton); 57 | } 58 | } 59 | } 60 | } 61 | 62 | @Override 63 | protected void keyTyped(char typedChar, int keyCode) { 64 | for (Panel panel : panels) { 65 | if (panel.isOpen() && !panel.getComponents().isEmpty() && keyCode != 1) { 66 | for (Component component : panel.getComponents()) { 67 | component.keyTyped(typedChar, keyCode); 68 | } 69 | } 70 | } 71 | if (keyCode == 1) { 72 | this.mc.displayGuiScreen(null); 73 | } 74 | } 75 | 76 | @Override 77 | public void mouseReleased(int mouseX, int mouseY, int state) { 78 | for (Panel p : panels) { 79 | p.setDragging(false); 80 | 81 | if (p.isOpen() && !p.getComponents().isEmpty()) { 82 | for (Component component : p.getComponents()) { 83 | component.mouseReleased(mouseX, mouseY, state); 84 | } 85 | } 86 | } 87 | } 88 | 89 | public static ArrayList getPanels() { 90 | return panels; 91 | } 92 | 93 | public static Panel getPanelByName(String name) { 94 | Panel panel = null; 95 | for (Panel p : getPanels()) { 96 | if (p.title.equalsIgnoreCase(name)) { 97 | panel = p; 98 | } 99 | } 100 | return panel; 101 | } 102 | 103 | @Override 104 | public boolean doesGuiPauseGame() { 105 | return false; 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/gui/click/clicktwo/ClickGUITwo.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.gui.click.clicktwo; 2 | 3 | import me.olliem5.past.Past; 4 | import me.olliem5.past.impl.gui.click.Component; 5 | import me.olliem5.past.api.module.Category; 6 | import net.minecraft.client.gui.GuiScreen; 7 | 8 | import java.util.ArrayList; 9 | 10 | public class ClickGUITwo extends GuiScreen { 11 | public static ArrayList panels; 12 | 13 | public ClickGUITwo() { 14 | panels = new ArrayList<>(); 15 | 16 | int panelX = 5; 17 | int panelY = 5; 18 | int panelWidth = 100; 19 | int panelHeight = 15; 20 | 21 | for (Category c : Category.values()) { 22 | ClickGUITwo.panels.add(new Panel(c.getCategoryName(), panelX, panelY, panelWidth, panelHeight, c)); 23 | panelX += 105; 24 | } 25 | } 26 | 27 | @Override 28 | public void drawScreen(int mouseX, int mouseY, float partialTicks) { 29 | if (Past.settingsManager.getSettingID("ClickGUIBackground").getValBoolean()) { 30 | drawDefaultBackground(); 31 | } 32 | 33 | for (Panel p : panels) { 34 | p.updatePosition(mouseX, mouseY); 35 | p.drawScreen(mouseX, mouseY, partialTicks); 36 | 37 | for (Component comp : p.getComponents()) { 38 | comp.updateComponent(mouseX, mouseY); 39 | } 40 | } 41 | } 42 | 43 | @Override 44 | public void mouseClicked(int mouseX, int mouseY, int mouseButton) { 45 | for (Panel p : panels) { 46 | if (p.isWithinHeader(mouseX, mouseY) && mouseButton == 0) { 47 | p.setDragging(true); 48 | p.dragX = mouseX - p.getX(); 49 | p.dragY = mouseY - p.getY(); 50 | } else if (p.isWithinHeader(mouseX, mouseY) && mouseButton == 1) { 51 | p.setOpen(!p.isOpen()); 52 | } else if (p.isOpen() && !p.getComponents().isEmpty()) { 53 | for (Component component : p.getComponents()) { 54 | component.mouseClicked(mouseX, mouseY, mouseButton); 55 | } 56 | } 57 | } 58 | } 59 | 60 | @Override 61 | protected void keyTyped(char typedChar, int keyCode) { 62 | for (Panel panel : panels) { 63 | if (panel.isOpen() && !panel.getComponents().isEmpty() && keyCode != 1) { 64 | for (Component component : panel.getComponents()) { 65 | component.keyTyped(typedChar, keyCode); 66 | } 67 | } 68 | } 69 | if (keyCode == 1) { 70 | this.mc.displayGuiScreen(null); 71 | } 72 | } 73 | 74 | @Override 75 | public void mouseReleased(int mouseX, int mouseY, int state) { 76 | for (Panel p : panels) { 77 | p.setDragging(false); 78 | 79 | if (p.isOpen() && !p.getComponents().isEmpty()) { 80 | for (Component component : p.getComponents()) { 81 | component.mouseReleased(mouseX, mouseY, state); 82 | } 83 | } 84 | } 85 | } 86 | 87 | public static ArrayList getPanels() { 88 | return panels; 89 | } 90 | 91 | public static Panel getPanelByName(String name) { 92 | Panel panel = null; 93 | for (Panel p : getPanels()) { 94 | if (p.title.equalsIgnoreCase(name)) { 95 | panel = p; 96 | } 97 | } 98 | return panel; 99 | } 100 | 101 | @Override 102 | public boolean doesGuiPauseGame() { 103 | if (Past.settingsManager.getSettingID("ClickGUIPauseGame").getValBoolean()) { 104 | return false; 105 | } else { 106 | return true; 107 | } 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/gui/click/clickone/components/IntegerComponent.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.gui.click.clickone.components; 2 | 3 | import com.mojang.realmsclient.gui.ChatFormatting; 4 | import me.olliem5.past.Past; 5 | import me.olliem5.past.impl.gui.click.Component; 6 | import me.olliem5.past.api.setting.Setting; 7 | import me.olliem5.past.api.util.colour.RainbowUtil; 8 | import me.olliem5.past.api.util.render.text.FontUtil; 9 | import net.minecraft.client.gui.Gui; 10 | 11 | import java.math.BigDecimal; 12 | import java.math.RoundingMode; 13 | 14 | public class IntegerComponent extends Component { 15 | private Setting set; 16 | private ModuleButton parent; 17 | private int offset; 18 | private int x; 19 | private int y; 20 | private boolean dragging; 21 | private double sliderWidth; 22 | 23 | public IntegerComponent(Setting value, ModuleButton button, int offset) { 24 | this.dragging = false; 25 | this.set = value; 26 | this.parent = button; 27 | this.x = button.parent.getX() + button.parent.getWidth(); 28 | this.y = button.parent.getY() + button.offset; 29 | this.offset = offset; 30 | } 31 | 32 | @Override 33 | public void renderComponent() { 34 | Gui.drawRect(parent.parent.getX() + 80, parent.parent.getY() - 12 + offset, parent.parent.getX() + parent.parent.getWidth() + parent.parent.getWidth(), parent.parent.getY() + offset, 0xFF111111); 35 | if (Past.settingsManager.getSettingID("OldClickGUIRainbow").getValBoolean()) { 36 | Gui.drawRect(parent.parent.getX() + 80, parent.parent.getY() - 12 + offset, parent.parent.getX() + parent.parent.getWidth() + (int) sliderWidth, parent.parent.getY() + offset, RainbowUtil.getMultiColour().getRGB()); 37 | } else { 38 | Gui.drawRect(parent.parent.getX() + 80, parent.parent.getY() - 12 + offset, parent.parent.getX() + parent.parent.getWidth() + (int) sliderWidth, parent.parent.getY() + offset, 0xFF222222); 39 | } 40 | 41 | FontUtil.drawText(this.set.getName() + " " + ChatFormatting.GRAY + this.set.getValueInt(), parent.parent.getX() + 82, (parent.parent.getY() + offset - 10), -1); 42 | } 43 | 44 | @Override 45 | public void updateComponent(int mouseX, int mouseY) { 46 | this.y = parent.parent.getY() - 12 + this.offset; 47 | this.x = parent.parent.getX() + 80; 48 | double diff = Math.min(80, Math.max(0, mouseX - this.x)); 49 | int min = this.set.getMin(); 50 | int max = this.set.getMax(); 51 | this.sliderWidth = 80 * (this.set.getValueInt() - min) / (max - min); 52 | if (this.dragging) { 53 | if (diff == 0) { 54 | this.set.setValueInt(this.set.getMin()); 55 | } else { 56 | int newValue = (int) roundToPlace(diff / 80 * (max - min) + min, 2); 57 | this.set.setValueInt(newValue); 58 | } 59 | } 60 | } 61 | 62 | private static double roundToPlace(double value, int places) { 63 | if (places < 0) { 64 | throw new IllegalArgumentException(); 65 | } 66 | 67 | BigDecimal bd = new BigDecimal(value); 68 | bd = bd.setScale(places, RoundingMode.HALF_UP); 69 | return bd.doubleValue(); 70 | } 71 | 72 | @Override 73 | public void mouseClicked(int mouseX, int mouseY, int button) { 74 | if (this.isMouseOnButton(mouseX, mouseY) && button == 0 && this.parent.isOpen()) { 75 | this.dragging = true; 76 | } 77 | } 78 | 79 | @Override 80 | public void mouseReleased(int mouseX, int mouseY, int mouseButton) { 81 | this.dragging = false; 82 | } 83 | 84 | public boolean isMouseOnButton(int x, int y) { 85 | if (x > this.x && x < this.x + 80 && y > this.y && y < this.y + 12) { 86 | return true; 87 | } else { 88 | return false; 89 | } 90 | } 91 | } -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/gui/click/clickone/components/DoubleComponent.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.gui.click.clickone.components; 2 | 3 | import com.mojang.realmsclient.gui.ChatFormatting; 4 | import me.olliem5.past.Past; 5 | import me.olliem5.past.impl.gui.click.Component; 6 | import me.olliem5.past.api.setting.Setting; 7 | import me.olliem5.past.api.util.colour.RainbowUtil; 8 | import me.olliem5.past.api.util.render.text.FontUtil; 9 | import net.minecraft.client.gui.Gui; 10 | 11 | import java.math.BigDecimal; 12 | import java.math.RoundingMode; 13 | 14 | public class DoubleComponent extends Component { 15 | private Setting set; 16 | private ModuleButton parent; 17 | private int offset; 18 | private int x; 19 | private int y; 20 | private boolean dragging; 21 | private double sliderWidth; 22 | 23 | public DoubleComponent(Setting value, ModuleButton button, int offset) { 24 | this.dragging = false; 25 | this.set = value; 26 | this.parent = button; 27 | this.x = button.parent.getX() + button.parent.getWidth(); 28 | this.y = button.parent.getY() + button.offset; 29 | this.offset = offset; 30 | } 31 | 32 | @Override 33 | public void renderComponent() { 34 | Gui.drawRect(parent.parent.getX() + 80, parent.parent.getY() - 12 + offset, parent.parent.getX() + parent.parent.getWidth() + parent.parent.getWidth(), parent.parent.getY() + offset, 0xFF111111); 35 | if (Past.settingsManager.getSettingID("OldClickGUIRainbow").getValBoolean()) { 36 | Gui.drawRect(parent.parent.getX() + 80, parent.parent.getY() - 12 + offset, parent.parent.getX() + parent.parent.getWidth() + (int) sliderWidth, parent.parent.getY() + offset, RainbowUtil.getMultiColour().getRGB()); 37 | } else { 38 | Gui.drawRect(parent.parent.getX() + 80, parent.parent.getY() - 12 + offset, parent.parent.getX() + parent.parent.getWidth() + (int) sliderWidth, parent.parent.getY() + offset, 0xFF222222); 39 | } 40 | 41 | FontUtil.drawText(this.set.getName() + " " + ChatFormatting.GRAY + this.set.getValueDouble(), parent.parent.getX() + 82, (parent.parent.getY() + offset - 10), -1); 42 | } 43 | 44 | @Override 45 | public void updateComponent(int mouseX, int mouseY) { 46 | this.y = parent.parent.getY() - 12 + this.offset; 47 | this.x = parent.parent.getX() + 80; 48 | double diff = Math.min(80, Math.max(0, mouseX - this.x)); 49 | double min = this.set.getDmin(); 50 | double max = this.set.getDmax(); 51 | this.sliderWidth = 80 * (this.set.getValueDouble() - min) / (max - min); 52 | if (this.dragging) { 53 | if (diff == 0) { 54 | this.set.setValueDouble(this.set.getDmin()); 55 | } else { 56 | double newValue = roundToPlace(diff / 80 * (max - min) + min, 2); 57 | this.set.setValueDouble(newValue); 58 | } 59 | } 60 | } 61 | 62 | private static double roundToPlace(double value, int places) { 63 | if (places < 0) { 64 | throw new IllegalArgumentException(); 65 | } 66 | 67 | BigDecimal bd = new BigDecimal(value); 68 | bd = bd.setScale(places, RoundingMode.HALF_UP); 69 | return bd.doubleValue(); 70 | } 71 | 72 | @Override 73 | public void mouseClicked(int mouseX, int mouseY, int button) { 74 | if (this.isMouseOnButton(mouseX, mouseY) && button == 0 && this.parent.isOpen()) { 75 | this.dragging = true; 76 | } 77 | } 78 | 79 | @Override 80 | public void mouseReleased(int mouseX, int mouseY, int mouseButton) { 81 | this.dragging = false; 82 | } 83 | 84 | public boolean isMouseOnButton(int x, int y) { 85 | if (x > this.x && x < this.x + 80 && y > this.y && y < this.y + 12) { 86 | return true; 87 | } else { 88 | return false; 89 | } 90 | } 91 | } -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/chat/AutoInsult.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.chat; 2 | 3 | import com.mojang.realmsclient.gui.ChatFormatting; 4 | import me.olliem5.past.Past; 5 | import me.olliem5.past.api.module.Category; 6 | import me.olliem5.past.api.module.Module; 7 | import me.olliem5.past.api.module.ModuleInfo; 8 | import me.olliem5.past.api.setting.Setting; 9 | import me.olliem5.past.api.util.client.MessageUtil; 10 | import me.olliem5.past.api.util.client.CooldownUtil; 11 | import net.minecraft.entity.Entity; 12 | import net.minecraft.entity.player.EntityPlayer; 13 | import net.minecraft.item.ItemBow; 14 | 15 | import java.util.ArrayList; 16 | import java.util.Comparator; 17 | import java.util.List; 18 | import java.util.stream.Collectors; 19 | 20 | @ModuleInfo(name = "AutoInsult", description = "Automatically insults players", category = Category.CHAT) 21 | public class AutoInsult extends Module { 22 | 23 | Setting sendmode; 24 | Setting range; 25 | Setting delay; 26 | Setting bowspammsg; 27 | 28 | private ArrayList sendmodes; 29 | 30 | CooldownUtil sendtimer = new CooldownUtil(); 31 | 32 | @Override 33 | public void setup() { 34 | sendmodes = new ArrayList<>(); 35 | sendmodes.add("Whisper"); 36 | sendmodes.add("Public"); 37 | sendmodes.add("Client"); 38 | 39 | Past.settingsManager.registerSetting(sendmode = new Setting("Send", "AutoInsultSendMode", this, sendmodes, "Whisper")); 40 | Past.settingsManager.registerSetting(range = new Setting("Range", "AutoInsultRange", 1.0, 25.0, 50.0, this)); 41 | Past.settingsManager.registerSetting(delay = new Setting("Delay MS", "AutoInsultDelay", 0, 8000, 10000, this)); 42 | Past.settingsManager.registerSetting(bowspammsg = new Setting("Bowspam Msg", "AutoInsultBowspamMsg", true, this)); 43 | } 44 | 45 | /** 46 | * TODO: More modes for this 47 | * * Phase mode 48 | * * Sword mode 49 | */ 50 | 51 | public void onUpdate() { 52 | if (nullCheck()) return; 53 | 54 | List entities = mc.world.loadedEntityList.stream() 55 | .filter(entity -> entity != mc.player) 56 | .filter(entity -> mc.player.getDistance(entity) <= range.getValueDouble()) 57 | .filter(entity -> !entity.isDead) 58 | .filter(entity -> sendCheck(entity)) 59 | .sorted(Comparator.comparing(e -> mc.player.getDistance(e))) 60 | .collect(Collectors.toList()); 61 | 62 | for (Entity entity : entities) { 63 | if (bowspammsg.getValBoolean()) { 64 | if (((EntityPlayer) entity).getHeldItemMainhand().getItem() instanceof ItemBow || ((EntityPlayer) entity).getHeldItemOffhand().getItem() instanceof ItemBow) { 65 | if (sendtimer.passed(delay.getValueInt())) { 66 | sendtimer.reset(); 67 | if (sendmode.getValueString() == "Whisper") { 68 | mc.player.sendChatMessage("/msg" + " " + entity.getName() + " " + "Hey, bowspammer, no one likes you!"); 69 | } else if (sendmode.getValueString() == "Public") { 70 | mc.player.sendChatMessage(entity.getName() + "," + " " + "Nasty bowspammer, fight like a real man!"); 71 | } else { 72 | MessageUtil.sendAutoInsultMessage(ChatFormatting.AQUA + entity.getName() + " " + ChatFormatting.WHITE + "is a dumb bowspammer!"); 73 | } 74 | } 75 | } 76 | } 77 | } 78 | } 79 | 80 | public boolean sendCheck(Entity entity) { 81 | if (entity instanceof EntityPlayer && !Past.friendsManager.isFriend(entity.getName())) { 82 | if (((EntityPlayer) entity).getHealth() > 0) { 83 | return true; 84 | } 85 | } 86 | return false; 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/gui/click/clicktwo/components/ModeComponent.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.gui.click.clicktwo.components; 2 | 3 | import com.mojang.realmsclient.gui.ChatFormatting; 4 | import me.olliem5.past.Past; 5 | import me.olliem5.past.impl.gui.click.Component; 6 | import me.olliem5.past.api.setting.Setting; 7 | import me.olliem5.past.api.util.colour.RainbowUtil; 8 | import me.olliem5.past.api.util.colour.GUIColourUtil; 9 | import me.olliem5.past.api.util.render.text.FontUtil; 10 | import net.minecraft.client.gui.Gui; 11 | 12 | public class ModeComponent extends Component { 13 | private Setting op; 14 | private ModuleButton parent; 15 | private int offset; 16 | private int x; 17 | private int y; 18 | private int modeIndex; 19 | 20 | public ModeComponent(Setting op, ModuleButton parent, int offset) { 21 | this.op = op; 22 | this.parent = parent; 23 | this.x = parent.parent.getX() + parent.parent.getWidth(); 24 | this.y = parent.parent.getY() + parent.offset; 25 | this.offset = offset; 26 | this.modeIndex = 0; 27 | } 28 | 29 | @Override 30 | public void setOff(final int newOff) { 31 | this.offset = newOff; 32 | } 33 | 34 | @Override 35 | public void renderComponent() { 36 | Gui.drawRect(parent.parent.getX() - 1, parent.parent.getY() + offset, parent.parent.getX(), parent.parent.getY() + 15 + offset, Past.settingsManager.getSettingID("ClickGUIRainbow").getValBoolean() ? RainbowUtil.getMultiColour().getRGB() : GUIColourUtil.getGUIColour()); 37 | Gui.drawRect(parent.parent.getX() + parent.parent.getWidth(), parent.parent.getY() + offset, parent.parent.getX() + parent.parent.getWidth() + 1, parent.parent.getY() + 15 + offset, Past.settingsManager.getSettingID("ClickGUIRainbow").getValBoolean() ? RainbowUtil.getMultiColour().getRGB() : GUIColourUtil.getGUIColour()); 38 | Gui.drawRect(parent.parent.getX() - 1, parent.parent.getY() + offset, parent.parent.getX() + parent.parent.getWidth() + 1, parent.parent.getY() + offset + 16, Past.settingsManager.getSettingID("ClickGUIRainbow").getValBoolean() ? RainbowUtil.getMultiColour().getRGB() : GUIColourUtil.getGUIColour()); 39 | 40 | Gui.drawRect(parent.parent.getX(), parent.parent.getY() + offset, parent.parent.getX() + parent.parent.getWidth(), parent.parent.getY() + offset + 15, 0xFF111111); 41 | 42 | Gui.drawRect(parent.parent.getX(), parent.parent.getY() + offset, parent.parent.getX() + 1, parent.parent.getY() + offset + 15, Past.settingsManager.getSettingID("ClickGUIRainbow").getValBoolean() ? RainbowUtil.getMultiColour().getRGB() : GUIColourUtil.getGUIColour()); 43 | Gui.drawRect(parent.parent.getX() + parent.parent.getWidth(), parent.parent.getY() + offset, parent.parent.getX() + parent.parent.getWidth() - 1, parent.parent.getY() + offset + 15, Past.settingsManager.getSettingID("ClickGUIRainbow").getValBoolean() ? RainbowUtil.getMultiColour().getRGB() : GUIColourUtil.getGUIColour()); 44 | 45 | FontUtil.drawText(this.op.getName() + " " + ChatFormatting.GRAY + this.op.getValueString().toUpperCase(), parent.parent.getX() + 4, parent.parent.getY() + offset + 4, -1); 46 | } 47 | 48 | @Override 49 | public void updateComponent(int mouseX, int mouseY) { 50 | this.y = parent.parent.getY() + this.offset; 51 | this.x = parent.parent.getX(); 52 | } 53 | 54 | @Override 55 | public void mouseClicked(final int mouseX, final int mouseY, final int button) { 56 | if (this.isMouseOnButton(mouseX, mouseY) && button == 0 && this.parent.isOpen()) { 57 | final int maxIndex = this.op.getModes().size() - 1; 58 | this.modeIndex++; 59 | if (this.modeIndex > maxIndex) { 60 | this.modeIndex = 0; 61 | } 62 | this.op.setValueString(this.op.getModes().get(this.modeIndex)); 63 | } 64 | } 65 | 66 | public boolean isMouseOnButton(int x, int y) { 67 | if (x > this.x && x < this.x + 100 && y > this.y && y < this.y + 15) { 68 | return true; 69 | } else { 70 | return false; 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/gui/click/clicktwo/components/BooleanComponent.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.gui.click.clicktwo.components; 2 | 3 | import me.olliem5.past.Past; 4 | import me.olliem5.past.impl.gui.click.Component; 5 | import me.olliem5.past.api.setting.Setting; 6 | import me.olliem5.past.api.util.colour.RainbowUtil; 7 | import me.olliem5.past.api.util.colour.GUIColourUtil; 8 | import me.olliem5.past.api.util.render.text.FontUtil; 9 | import net.minecraft.client.gui.Gui; 10 | 11 | public class BooleanComponent extends Component { 12 | private Setting op; 13 | private ModuleButton parent; 14 | private int offset; 15 | private int x; 16 | private int y; 17 | 18 | public BooleanComponent(Setting op, ModuleButton parent, int offset) { 19 | this.op = op; 20 | this.parent = parent; 21 | this.x = parent.parent.getX() + parent.parent.getWidth(); 22 | this.y = parent.parent.getY() + parent.offset; 23 | this.offset = offset; 24 | } 25 | 26 | @Override 27 | public void setOff(final int newOff) { 28 | this.offset = newOff; 29 | } 30 | 31 | @Override 32 | public void renderComponent() { 33 | Gui.drawRect(parent.parent.getX() - 1, parent.parent.getY() + offset, parent.parent.getX(), parent.parent.getY() + 15 + offset, Past.settingsManager.getSettingID("ClickGUIRainbow").getValBoolean() ? RainbowUtil.getMultiColour().getRGB() : GUIColourUtil.getGUIColour()); 34 | Gui.drawRect(parent.parent.getX() + parent.parent.getWidth(), parent.parent.getY() + offset, parent.parent.getX() + parent.parent.getWidth() + 1, parent.parent.getY() + 15 + offset, Past.settingsManager.getSettingID("ClickGUIRainbow").getValBoolean() ? RainbowUtil.getMultiColour().getRGB() : GUIColourUtil.getGUIColour()); 35 | Gui.drawRect(parent.parent.getX() - 1, parent.parent.getY() + offset, parent.parent.getX() + parent.parent.getWidth() + 1, parent.parent.getY() + offset + 16, Past.settingsManager.getSettingID("ClickGUIRainbow").getValBoolean() ? RainbowUtil.getMultiColour().getRGB() : GUIColourUtil.getGUIColour()); 36 | 37 | if (op.getValBoolean()) { 38 | Gui.drawRect(parent.parent.getX(), parent.parent.getY() + offset, parent.parent.getX() + parent.parent.getWidth(), parent.parent.getY() + offset + 15, Past.settingsManager.getSettingID("ClickGUIRainbow").getValBoolean() ? RainbowUtil.getMultiColour().getRGB() : GUIColourUtil.getGUIColour()); 39 | Gui.drawRect(parent.parent.getX(), parent.parent.getY() + offset, parent.parent.getX() + parent.parent.getWidth(), parent.parent.getY() + offset + 15, 0x75101010); 40 | } else { 41 | Gui.drawRect(parent.parent.getX(), parent.parent.getY() + offset, parent.parent.getX() + parent.parent.getWidth(), parent.parent.getY() + offset + 15, 0xFF111111); 42 | } 43 | 44 | Gui.drawRect(parent.parent.getX(), parent.parent.getY() + offset, parent.parent.getX() + 1, parent.parent.getY() + offset + 15, Past.settingsManager.getSettingID("ClickGUIRainbow").getValBoolean() ? RainbowUtil.getMultiColour().getRGB() : GUIColourUtil.getGUIColour()); 45 | Gui.drawRect(parent.parent.getX() + parent.parent.getWidth(), parent.parent.getY() + offset, parent.parent.getX() + parent.parent.getWidth() - 1, parent.parent.getY() + offset + 15, Past.settingsManager.getSettingID("ClickGUIRainbow").getValBoolean() ? RainbowUtil.getMultiColour().getRGB() : GUIColourUtil.getGUIColour()); 46 | 47 | FontUtil.drawText(this.op.getName(), parent.parent.getX() + 4, parent.parent.getY() + offset + 4, -1); 48 | } 49 | 50 | @Override 51 | public void updateComponent(int mouseX, int mouseY) { 52 | this.y = parent.parent.getY() + this.offset; 53 | this.x = parent.parent.getX(); 54 | } 55 | 56 | @Override 57 | public void mouseClicked(int mouseX, int mouseY, int button) { 58 | if (isMouseOnButton(mouseX, mouseY) && button == 0 && this.parent.isOpen()) { 59 | this.op.setValBoolean(!op.getValBoolean()); 60 | } 61 | } 62 | 63 | public boolean isMouseOnButton(int x, int y) { 64 | if (x > this.x && x < this.x + 100 && y > this.y && y < this.y + 15) { 65 | return true; 66 | } else { 67 | return false; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/gui/editor/screen/element/HudBooleanComponent.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.gui.editor.screen.element; 2 | 3 | import me.olliem5.past.Past; 4 | import me.olliem5.past.impl.gui.editor.screen.Element; 5 | import me.olliem5.past.api.setting.Setting; 6 | import me.olliem5.past.api.util.colour.RainbowUtil; 7 | import me.olliem5.past.api.util.colour.GUIColourUtil; 8 | import me.olliem5.past.api.util.render.text.FontUtil; 9 | import net.minecraft.client.gui.Gui; 10 | 11 | public class HudBooleanComponent extends Element { 12 | private Setting op; 13 | private HudButton parent; 14 | private int offset; 15 | private int x; 16 | private int y; 17 | 18 | public HudBooleanComponent(Setting op, HudButton parent, int offset) { 19 | this.op = op; 20 | this.parent = parent; 21 | this.x = parent.parent.getX() + parent.parent.getWidth(); 22 | this.y = parent.parent.getY() + parent.offset; 23 | this.offset = offset; 24 | } 25 | 26 | @Override 27 | public void setOff(final int newOff) { 28 | this.offset = newOff; 29 | } 30 | 31 | @Override 32 | public void renderElement() { 33 | Gui.drawRect(parent.parent.getX() - 1, this.parent.parent.getY() + this.offset, parent.parent.getX(), this.parent.parent.getY() + 15 + this.offset, Past.settingsManager.getSettingID("HudEditorRainbow").getValBoolean() ? RainbowUtil.getMultiColour().getRGB() : GUIColourUtil.getGUIColour()); 34 | Gui.drawRect(parent.parent.getX() + parent.parent.getWidth(), this.parent.parent.getY() + this.offset, parent.parent.getX() + parent.parent.getWidth() + 1, this.parent.parent.getY() + 15 + this.offset, Past.settingsManager.getSettingID("HudEditorRainbow").getValBoolean() ? RainbowUtil.getMultiColour().getRGB() : GUIColourUtil.getGUIColour()); 35 | Gui.drawRect(parent.parent.getX() - 1, parent.parent.getY() + offset, parent.parent.getX() + parent.parent.getWidth() + 1, parent.parent.getY() + offset + 16, Past.settingsManager.getSettingID("HudEditorRainbow").getValBoolean() ? RainbowUtil.getMultiColour().getRGB() : GUIColourUtil.getGUIColour()); 36 | 37 | if (op.getValBoolean()) { 38 | Gui.drawRect(parent.parent.getX(), parent.parent.getY() + offset, parent.parent.getX() + parent.parent.getWidth(), parent.parent.getY() + offset + 15, Past.settingsManager.getSettingID("HudEditorRainbow").getValBoolean() ? RainbowUtil.getMultiColour().getRGB() : GUIColourUtil.getGUIColour()); 39 | Gui.drawRect(parent.parent.getX(), parent.parent.getY() + offset, parent.parent.getX() + parent.parent.getWidth(), parent.parent.getY() + offset + 15, 0x75101010); 40 | } else { 41 | Gui.drawRect(parent.parent.getX(), parent.parent.getY() + offset, parent.parent.getX() + parent.parent.getWidth(), parent.parent.getY() + offset + 15, 0xFF111111); 42 | } 43 | 44 | Gui.drawRect(parent.parent.getX(), parent.parent.getY() + offset, parent.parent.getX() + 1, parent.parent.getY() + offset + 15, Past.settingsManager.getSettingID("HudEditorRainbow").getValBoolean() ? RainbowUtil.getMultiColour().getRGB() : GUIColourUtil.getGUIColour()); 45 | Gui.drawRect(parent.parent.getX() + parent.parent.getWidth(), parent.parent.getY() + offset, parent.parent.getX() + parent.parent.getWidth() - 1, parent.parent.getY() + offset + 15, Past.settingsManager.getSettingID("HudEditorRainbow").getValBoolean() ? RainbowUtil.getMultiColour().getRGB() : GUIColourUtil.getGUIColour()); 46 | 47 | FontUtil.drawText(op.getName(), parent.parent.getX() + 4, parent.parent.getY() + this.offset + 4, -1); 48 | } 49 | 50 | @Override 51 | public void updateElement(int mouseX, int mouseY) { 52 | this.y = parent.parent.getY() + this.offset; 53 | this.x = parent.parent.getX(); 54 | } 55 | 56 | @Override 57 | public void mouseClicked(int mouseX, int mouseY, int button) { 58 | if (isMouseOnButton(mouseX, mouseY) && button == 0 && this.parent.isOpen()) { 59 | this.op.setValBoolean(!op.getValBoolean()); 60 | } 61 | } 62 | 63 | public boolean isMouseOnButton(int x, int y) { 64 | if (x > this.x && x < this.x + 100 && y > this.y && y < this.y + 15) { 65 | return true; 66 | } else { 67 | return false; 68 | } 69 | } 70 | } -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/combat/AutoTrap.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.combat; 2 | 3 | import com.mojang.realmsclient.gui.ChatFormatting; 4 | import me.olliem5.past.Past; 5 | import me.olliem5.past.api.module.Category; 6 | import me.olliem5.past.api.module.Module; 7 | import me.olliem5.past.api.module.ModuleInfo; 8 | import me.olliem5.past.api.setting.Setting; 9 | import me.olliem5.past.api.util.player.PlayerUtil; 10 | import net.minecraft.entity.player.EntityPlayer; 11 | import net.minecraft.init.Blocks; 12 | import net.minecraft.util.math.BlockPos; 13 | import net.minecraft.util.math.Vec3d; 14 | 15 | import java.util.ArrayList; 16 | import java.util.Arrays; 17 | import java.util.List; 18 | 19 | @ModuleInfo(name = "AutoTrap", description = "Automatically traps players in range", category = Category.COMBAT) 20 | public class AutoTrap extends Module { 21 | 22 | Setting disable; 23 | Setting playerrange; 24 | Setting blockspertick; 25 | 26 | @Override 27 | public void setup() { 28 | Past.settingsManager.registerSetting(disable = new Setting("Disable", "AutoTrapDisable", false, this)); 29 | Past.settingsManager.registerSetting(playerrange = new Setting("Player Range", "AutoTrapPlayerRange", 1.0, 4.4, 10.0, this)); 30 | Past.settingsManager.registerSetting(blockspertick = new Setting("BPT", "AutoTrapBlocksPerTick", 1, 1, 10, this)); 31 | } 32 | 33 | private boolean hasPlaced; 34 | 35 | @Override 36 | public void onEnable() { 37 | hasPlaced = false; 38 | } 39 | 40 | public void onUpdate() { 41 | if (nullCheck()) return; 42 | 43 | if (hasPlaced && disable.getValBoolean()) { 44 | toggle(); 45 | } 46 | 47 | int blocksPlaced = 0; 48 | 49 | for (Vec3d autoTrapBox : autoTrap) { 50 | final EntityPlayer target = getClosestPlayer(); 51 | 52 | if (target != null) { 53 | BlockPos blockPos = new BlockPos(autoTrapBox.add(getClosestPlayer().getPositionVector())); 54 | 55 | if (mc.world.getBlockState(blockPos).getBlock().equals(Blocks.AIR)) { 56 | int oldInventorySlot = mc.player.inventory.currentItem; 57 | mc.player.inventory.currentItem = PlayerUtil.getBlockInHotbar(Blocks.OBSIDIAN); 58 | PlayerUtil.placeBlock(blockPos); 59 | mc.player.inventory.currentItem = oldInventorySlot; 60 | blocksPlaced++; 61 | 62 | if (blocksPlaced == blockspertick.getValueInt()) return; 63 | } 64 | } 65 | } 66 | if (blocksPlaced == 0) { 67 | hasPlaced = true; 68 | } 69 | } 70 | 71 | private EntityPlayer getClosestPlayer() { 72 | EntityPlayer closestPlayer = null; 73 | 74 | for (final EntityPlayer entityPlayer : mc.world.playerEntities) { 75 | if (!(entityPlayer == mc.player) && !Past.friendsManager.isFriend(entityPlayer.getName())) { 76 | final double distance = mc.player.getDistance(entityPlayer); 77 | 78 | if (distance < playerrange.getValueDouble()) { 79 | closestPlayer = entityPlayer; 80 | } 81 | } 82 | } 83 | return closestPlayer; 84 | } 85 | 86 | private final List autoTrap = new ArrayList<>(Arrays.asList( 87 | new Vec3d(0, -1, -1), 88 | new Vec3d(1, -1, 0), 89 | new Vec3d(0, -1, 1), 90 | new Vec3d(-1, -1, 0), 91 | new Vec3d(0, 0, -1), 92 | new Vec3d(1, 0, 0), 93 | new Vec3d(0, 0, 1), 94 | new Vec3d(-1, 0, 0), 95 | new Vec3d(0, 1, -1), 96 | new Vec3d(1, 1, 0), 97 | new Vec3d(0, 1, 1), 98 | new Vec3d(-1, 1, 0), 99 | new Vec3d(0, 2, -1), 100 | new Vec3d(0, 2, 1), 101 | new Vec3d(0, 2, 0) 102 | )); 103 | 104 | public String getArraylistInfo() { 105 | if (getClosestPlayer() != null) { 106 | return ChatFormatting.GRAY + " " + getClosestPlayer().getName(); 107 | } else { 108 | return ""; 109 | } 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/combat/Criticals.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.combat; 2 | 3 | import com.mojang.realmsclient.gui.ChatFormatting; 4 | import me.olliem5.past.Past; 5 | import me.olliem5.past.api.module.ModuleInfo; 6 | import me.olliem5.past.impl.events.PacketEvent; 7 | import me.olliem5.past.api.module.Category; 8 | import me.olliem5.past.api.module.Module; 9 | import me.olliem5.past.api.setting.Setting; 10 | import me.olliem5.past.api.util.client.CooldownUtil; 11 | import me.zero.alpine.listener.EventHandler; 12 | import me.zero.alpine.listener.Listener; 13 | import net.minecraft.network.play.client.CPacketPlayer; 14 | import net.minecraft.network.play.client.CPacketUseEntity; 15 | 16 | import java.util.ArrayList; 17 | 18 | /** 19 | * @author linustouchtips 20 | */ 21 | 22 | @ModuleInfo(name = "Criticals", description = "Makes every hit a critical", category = Category.COMBAT) 23 | public class Criticals extends Module { 24 | 25 | Setting mode; 26 | 27 | CooldownUtil timer = new CooldownUtil(); 28 | 29 | private ArrayList criticalmodes; 30 | 31 | @Override 32 | public void setup() { 33 | criticalmodes = new ArrayList<>(); 34 | criticalmodes.add("Packet"); 35 | criticalmodes.add("2b2t"); 36 | criticalmodes.add("Bypass"); 37 | criticalmodes.add("Jump"); 38 | 39 | Past.settingsManager.registerSetting(mode = new Setting("Mode", "CriticalsMode", this, criticalmodes, "Bypass")); 40 | } 41 | 42 | @EventHandler 43 | private Listener sendListener = new Listener<>(event -> { 44 | if (event.getPacket() instanceof CPacketUseEntity) { 45 | if (((CPacketUseEntity) event.getPacket()).getAction() == CPacketUseEntity.Action.ATTACK && mc.player.onGround) { 46 | if (mode.getValueString() == "Packet") { 47 | mc.player.connection.sendPacket(new CPacketPlayer.Position(mc.player.posX, mc.player.posY + 0.1f, mc.player.posZ, false)); 48 | mc.player.connection.sendPacket(new CPacketPlayer.Position(mc.player.posX, mc.player.posY, mc.player.posZ, false)); 49 | } else if (mode.getValueString() == "2b2t") { 50 | mc.player.connection.sendPacket(new CPacketPlayer.Position(mc.player.posX, mc.player.posY + 0.11, mc.player.posZ, false)); 51 | mc.player.connection.sendPacket(new CPacketPlayer.Position(mc.player.posX, mc.player.posY + 0.11, mc.player.posZ, false)); 52 | mc.player.connection.sendPacket(new CPacketPlayer.Position(mc.player.posX, mc.player.posY + 0.1100013579, mc.player.posZ, false)); 53 | mc.player.connection.sendPacket(new CPacketPlayer.Position(mc.player.posX, mc.player.posY + 0.1100013579, mc.player.posZ, false)); 54 | mc.player.connection.sendPacket(new CPacketPlayer.Position(mc.player.posX, mc.player.posY + 0.1100013579, mc.player.posZ, false)); 55 | mc.player.connection.sendPacket(new CPacketPlayer.Position(mc.player.posX, mc.player.posY + 0.1100013579, mc.player.posZ, false)); 56 | mc.player.connection.sendPacket(new CPacketPlayer.Position(mc.player.posX, mc.player.posY, mc.player.posZ, false)); 57 | } else if (mode.getValueString() == "Bypass") { 58 | if (this.mc.player.fallDistance > 0.0f) { 59 | return; 60 | } if (this.mc.player.isInLava() || this.mc.player.isInWater()) { 61 | return; 62 | } if (this.timer.passed(1000)) { 63 | this.timer.reset(); 64 | this.mc.player.connection.sendPacket(new CPacketPlayer.Position(this.mc.player.posX, this.mc.player.posY + 0.11, this.mc.player.posZ, false)); 65 | this.mc.player.connection.sendPacket(new CPacketPlayer.Position(this.mc.player.posX, this.mc.player.posY + 0.1100013579, this.mc.player.posZ, false)); 66 | this.mc.player.connection.sendPacket(new CPacketPlayer.Position(this.mc.player.posX, this.mc.player.posY + 1.3579E-6, this.mc.player.posZ, false)); 67 | } 68 | } else { 69 | mc.player.jump(); 70 | } 71 | } 72 | } 73 | }); 74 | 75 | public String getArraylistInfo() { 76 | return ChatFormatting.GRAY + " " + mode.getValueString().toUpperCase(); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/Past.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past; 2 | 3 | import me.olliem5.past.api.cape.CapesManager; 4 | import me.olliem5.past.api.command.CommandManager; 5 | import me.olliem5.past.api.event.ForgeEvents; 6 | import me.olliem5.past.api.util.render.text.font.CustomFontRenderer; 7 | import me.olliem5.past.api.friend.FriendsManager; 8 | import me.olliem5.past.impl.gui.click.clickone.ClickGUIOne; 9 | import me.olliem5.past.impl.gui.click.clicktwo.ClickGUITwo; 10 | import me.olliem5.past.impl.gui.editor.component.HudComponentManager; 11 | import me.olliem5.past.impl.gui.editor.screen.HudEditor; 12 | import me.olliem5.past.api.module.ModuleManager; 13 | import me.olliem5.past.api.setting.SettingsManager; 14 | import me.olliem5.past.api.util.config.ConfigUtil; 15 | import me.zero.alpine.EventBus; 16 | import me.zero.alpine.EventManager; 17 | import net.minecraftforge.fml.common.Mod; 18 | import net.minecraftforge.fml.common.event.FMLInitializationEvent; 19 | import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; 20 | import org.apache.logging.log4j.LogManager; 21 | import org.apache.logging.log4j.Logger; 22 | import org.lwjgl.opengl.Display; 23 | 24 | import java.awt.*; 25 | 26 | @Mod(name = Past.NAME, modid = Past.MOD_ID, version = Past.VERSION) 27 | public class Past { 28 | public static final String NAME = "Past Utility Mod"; 29 | public static final String MOD_ID = "past"; 30 | public static final String VERSION = "1.6"; 31 | public static final String APP_ID = "754509326902886411"; 32 | public static String NAME_VERSION = NAME + " " + VERSION; 33 | 34 | public static final Logger LOGGER = LogManager.getLogger(NAME_VERSION); 35 | 36 | public static CustomFontRenderer latoFont; 37 | public static CustomFontRenderer verdanaFont; 38 | public static CustomFontRenderer arialFont; 39 | 40 | public static EventBus EVENT_BUS; 41 | public static ForgeEvents forgeEvents; 42 | public static SettingsManager settingsManager; 43 | public static ModuleManager moduleManager; 44 | public static CommandManager commandManager; 45 | public static FriendsManager friendsManager; 46 | public static CapesManager capesManager; 47 | public static HudComponentManager hudComponentManager; 48 | public static ClickGUIOne clickGUIOne; 49 | public static ClickGUITwo clickGUITwo; 50 | public static HudEditor hudEditor; 51 | public static ConfigUtil configUtil; 52 | 53 | @Mod.EventHandler 54 | public void pastPreInitialize(FMLPreInitializationEvent event) { 55 | Display.setTitle(NAME_VERSION); 56 | } 57 | 58 | @Mod.EventHandler 59 | public void pastInitialize(FMLInitializationEvent event) { 60 | log("Starting Client Initialization!"); 61 | 62 | EVENT_BUS = new EventManager(); 63 | log("Event System Initialized!"); 64 | 65 | forgeEvents = new ForgeEvents(); 66 | log("Forge Events Initialized!"); 67 | 68 | settingsManager = new SettingsManager(); 69 | log("Settings initialized!"); 70 | 71 | moduleManager = new ModuleManager(); 72 | log("Modules Initialized!"); 73 | 74 | commandManager = new CommandManager(); 75 | log("Commands Initialized!"); 76 | 77 | friendsManager = new FriendsManager(); 78 | log("Friends Initialized!"); 79 | 80 | latoFont = new CustomFontRenderer(new Font("Lato", 0, 18), true, false); 81 | verdanaFont = new CustomFontRenderer(new Font("Verdana", 0, 18), true, false); 82 | arialFont = new CustomFontRenderer(new Font("Arial", 0, 18), true, false); 83 | log("Custom Fonts Initialized! (Author 086)!"); 84 | 85 | capesManager = new CapesManager(); 86 | log("Capes Initialized!"); 87 | 88 | hudComponentManager = new HudComponentManager(); 89 | log("HUD Components Initialized!"); 90 | 91 | clickGUIOne = new ClickGUIOne(); 92 | log("ClickGUI One Initialized!"); 93 | 94 | clickGUITwo = new ClickGUITwo(); 95 | log("ClickGUI Two Initialized!"); 96 | 97 | hudEditor = new HudEditor(); 98 | log("HUD Editor Initialized!"); 99 | 100 | configUtil = new ConfigUtil(); 101 | log("Config Initialized!"); 102 | 103 | log("Client has finished initializing!"); 104 | } 105 | 106 | public static void log(String message) { 107 | LOGGER.info(message); 108 | } 109 | } -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/gui/editor/screen/HudEditor.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.gui.editor.screen; 2 | 3 | import me.olliem5.past.Past; 4 | import me.olliem5.past.impl.gui.editor.component.HudComponent; 5 | import net.minecraft.client.gui.Gui; 6 | import net.minecraft.client.gui.GuiScreen; 7 | 8 | import java.util.ArrayList; 9 | 10 | public class HudEditor extends GuiScreen { 11 | public static ArrayList hudpanels; 12 | 13 | public HudEditor() { 14 | hudpanels = new ArrayList<>(); 15 | int hudPanelX = 5; 16 | int hudPanelY = 5; 17 | int hudPanelWidth = 100; 18 | int hudPanelHeight = 15; 19 | 20 | HudEditor.hudpanels.add(new HudPanel("Past Client HUD", hudPanelX, hudPanelY, hudPanelWidth, hudPanelHeight)); 21 | } 22 | 23 | @Override 24 | public void drawScreen(int mouseX, int mouseY, float partialTicks) { 25 | if (Past.settingsManager.getSettingID("HudEditorBackground").getValBoolean()) { 26 | drawDefaultBackground(); 27 | } 28 | 29 | for (HudPanel hp : hudpanels) { 30 | hp.updatePosition(mouseX, mouseY); 31 | hp.drawScreen(mouseX, mouseY, partialTicks); 32 | 33 | for (Element elem : hp.getElements()) { 34 | elem.updateElement(mouseX, mouseY); 35 | } 36 | } 37 | 38 | for (HudComponent hudComponent : Past.hudComponentManager.getHudComponents()) { 39 | if (hudComponent.isEnabled()) { 40 | hudComponent.updatePosition(mouseX,mouseY); 41 | if (hudComponent.isDragging()) { 42 | Gui.drawRect(hudComponent.getX() + -2, hudComponent.getY() + -2, hudComponent.getX() + hudComponent.getWidth() + 2, hudComponent.getY() + hudComponent.getHeight() + 2, 0x90303030); 43 | } 44 | Gui.drawRect(hudComponent.getX() + -1, hudComponent.getY() + -1, hudComponent.getX() + hudComponent.getWidth() + 1, hudComponent.getY() + hudComponent.getHeight() + 1, 0x75101010); 45 | hudComponent.render(partialTicks); 46 | } 47 | } 48 | } 49 | 50 | @Override 51 | public void mouseClicked(int mouseX, int mouseY, int mouseButton) { 52 | for (HudPanel hp : hudpanels) { 53 | if (hp.isWithinHeader(mouseX, mouseY) && mouseButton == 0) { 54 | hp.setDragging(true); 55 | hp.dragX = mouseX - hp.getX(); 56 | hp.dragY = mouseY - hp.getY(); 57 | } 58 | 59 | if (hp.isWithinHeader(mouseX, mouseY) && mouseButton == 1) { 60 | hp.setOpen(!hp.isOpen()); 61 | } 62 | 63 | if (hp.isOpen() && !hp.getElements().isEmpty()) { 64 | for (Element elem : hp.getElements()) { 65 | elem.mouseClicked(mouseX, mouseY, mouseButton); 66 | } 67 | } 68 | } 69 | 70 | for (HudComponent hudComponent : Past.hudComponentManager.getHudComponents()) { 71 | if (hudComponent.isMouseOnComponent(mouseX, mouseY) && mouseButton == 0 && hudComponent.isEnabled()) { 72 | hudComponent.setDragging(true); 73 | hudComponent.setDragX(mouseX - hudComponent.getX()); 74 | hudComponent.setDragY(mouseY - hudComponent.getY()); 75 | } 76 | } 77 | } 78 | 79 | @Override 80 | protected void keyTyped(char typedChar, int keyCode) { 81 | if (keyCode == 1) { 82 | this.mc.displayGuiScreen(null); 83 | } 84 | } 85 | 86 | @Override 87 | public void mouseReleased(int mouseX, int mouseY, int state) { 88 | for (HudPanel hp : hudpanels) { 89 | hp.setDragging(false); 90 | 91 | if (hp.isOpen() && !hp.getElements().isEmpty()) { 92 | for (Element elem : hp.getElements()) { 93 | elem.mouseReleased(mouseX, mouseY, state); 94 | } 95 | } 96 | } 97 | 98 | for (HudComponent hudComponent : Past.hudComponentManager.getHudComponents()) { 99 | if (hudComponent.isMouseOnComponent(mouseX, mouseY) && hudComponent.isEnabled()) { 100 | hudComponent.setDragging(false); 101 | } 102 | } 103 | } 104 | 105 | @Override 106 | public boolean doesGuiPauseGame() { 107 | return false; 108 | } 109 | } 110 | 111 | -------------------------------------------------------------------------------- /src/main/resources/past_at.cfg: -------------------------------------------------------------------------------- 1 | # Transformer used by FML into jar for open the publics acess. 2 | # Separate and organized by Rina. 3 | 4 | # Thank you Rina! 5 | 6 | # Renderer. 7 | public net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher * 8 | public net.minecraft.client.renderer.entity.RenderManager * 9 | public net.minecraft.client.renderer.BlockModelRenderer * 10 | public net.minecraft.client.renderer.EntityRenderer * 11 | public net.minecraft.client.renderer.BufferBuilder * 12 | public net.minecraft.client.renderer.RenderGlobal * 13 | public net.minecraft.client.renderer.ItemRenderer * 14 | public net.minecraft.client.renderer.ItemRenderer *() 15 | public net.minecraft.client.renderer.EntityRenderer *() 16 | 17 | # All methods renderer. 18 | public net.minecraft.client.renderer.BlockModelRenderer *() 19 | public net.minecraft.client.renderer.EntityRenderer *() 20 | public net.minecraft.client.renderer.RenderGlobal *() 21 | 22 | # Multiplayes. 23 | public net.minecraft.client.multiplayer.PlayerControllerMP * 24 | public net.minecraft.client.multiplayer.GuiConnecting * 25 | 26 | # All methods multiplayer. 27 | public net.minecraft.client.multiplayer.PlayerControllerMP *() 28 | 29 | # GUI mixin. 30 | public net.minecraft.client.gui.GuiBossOverlay func_184052_a(IILnet/minecraft/world/BossInfo;)V 31 | 32 | # GUI. 33 | public net.minecraft.client.gui.inventory.GuiEditSign * 34 | public net.minecraft.client.gui.GuiDisconnected * 35 | public net.minecraft.client.gui.GuiBossOverlay * 36 | public net.minecraft.client.gui.GuiTextField * 37 | public net.minecraft.client.gui.FontRenderer * 38 | public net.minecraft.client.gui.GuiChat * 39 | 40 | # Setting. 41 | public net.minecraft.client.settings.KeyBinding field_74513_e 42 | 43 | # Particule. 44 | public net.minecraft.client.particle.Particle * 45 | 46 | # Minecraft 47 | public net.minecraft.client.Minecraft * 48 | 49 | # All methods Minecraft. 50 | public net.minecraft.client.Minecraft *() 51 | 52 | # Entity. 53 | public net.minecraft.entity.Entity * 54 | 55 | # World. 56 | public net.minecraft.world.chunk.storage.ExtendedBlockStorage * 57 | public net.minecraft.world.chunk.BlockStateContainer * 58 | public net.minecraft.world.border.WorldBorder * 59 | public net.minecraft.world.WorldServer * 60 | public net.minecraft.world.chunk.Chunk * 61 | public net.minecraft.world.ChunkCache * 62 | public net.minecraft.world.Explosion * 63 | 64 | # All methods EmptyChunk and WordlBorder. 65 | public net.minecraft.world.border.WorldBorder *() 66 | public net.minecraft.world.chunk.EmptyChunk *() 67 | 68 | # Managament. 69 | public net.minecraft.server.management.PlayerInteractionManager * 70 | public net.minecraft.server.management.PlayerChunkMap * 71 | public net.minecraft.server.management.PlayerList * 72 | 73 | # F. 74 | public-f net.minecraft.server.management.PlayerChunkMapEntry * 75 | 76 | # Managament. 77 | public net.minecraft.server.management.PlayerChunkMapEntry *() 78 | public net.minecraft.server.management.PlayerChunkMap *() 79 | 80 | # CPACKET. 81 | public net.minecraft.network.play.client.CPacketChatMessage field_149440_a 82 | public net.minecraft.network.play.client.CPacketUpdateSign * 83 | public net.minecraft.network.play.client.CPacketPlayer * 84 | 85 | # SPACKET. 86 | public net.minecraft.network.play.server.SPacketEntityVelocity * 87 | public net.minecraft.network.play.server.SPacketPlayerPosLook * 88 | public net.minecraft.network.play.server.SPacketSoundEffect * 89 | public net.minecraft.network.play.server.SPacketExplosion * 90 | public net.minecraft.network.play.server.SPacketEffect * 91 | public net.minecraft.network.play.server.SPacketChat * 92 | 93 | # Entity. 94 | public net.minecraft.entity.item.EntityFallingBlock * 95 | public net.minecraft.entity.player.InventoryPlayer * 96 | public net.minecraft.entity.player.EntityPlayerMP * 97 | public net.minecraft.entity.player.EntityPlayer * 98 | 99 | # Util. 100 | public net.minecraft.util.ObjectIntIdentityMap * 101 | public net.minecraft.util.math.BlockPos * 102 | public net.minecraft.util.Timer * 103 | 104 | # F. 105 | public-f net.minecraft.util.math.Vec3i * 106 | 107 | # Item. 108 | public net.minecraft.item.ItemTool field_77865_bY 109 | public net.minecraft.item.ItemStack * 110 | 111 | # Block. 112 | public net.minecraft.block.Block * 113 | 114 | # NetworkManager. 115 | public net.minecraft.network.NetHandlerPlayServer * 116 | public net.minecraft.network.NetworkManager * 117 | 118 | # Path. 119 | public net.minecraft.pathfinding.Path * 120 | 121 | # Tile. 122 | public net.minecraft.tileentity.TileEntity field_145854_h -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/gui/click/clickone/Panel.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.gui.click.clickone; 2 | 3 | import me.olliem5.past.Past; 4 | import me.olliem5.past.impl.gui.click.Component; 5 | import me.olliem5.past.impl.gui.click.clickone.components.ModuleButton; 6 | import me.olliem5.past.api.module.Category; 7 | import me.olliem5.past.api.module.Module; 8 | import me.olliem5.past.api.util.colour.RainbowUtil; 9 | import me.olliem5.past.api.util.render.text.FontUtil; 10 | import net.minecraft.client.Minecraft; 11 | import net.minecraft.client.gui.Gui; 12 | 13 | import java.util.ArrayList; 14 | 15 | public class Panel { 16 | protected Minecraft mc = Minecraft.getMinecraft(); 17 | 18 | public ArrayList components; 19 | public String title; 20 | public int x; 21 | public int y; 22 | public int width; 23 | public int height; 24 | public boolean isSettingOpen; 25 | private boolean isDragging; 26 | private boolean open; 27 | public int dragX; 28 | public int dragY; 29 | public Category cat; 30 | 31 | public Panel(String title, int x, int y, int width, int height, Category cat) { 32 | this.components = new ArrayList<>(); 33 | this.title = title; 34 | this.x = x; 35 | this.y = y; 36 | this.width = width; 37 | this.height = height; 38 | this.dragX = 0; 39 | this.isSettingOpen = true; 40 | this.isDragging = false; 41 | this.open = true; 42 | this.cat = cat; 43 | int tY = this.height; 44 | 45 | for (Module mod : Past.moduleManager.getModules()) { 46 | if (mod.getCategory() == cat) { 47 | ModuleButton modButton = new ModuleButton(mod, this, tY); 48 | this.components.add(modButton); 49 | tY += 12; 50 | } 51 | } 52 | } 53 | 54 | public void drawScreen(int mouseX, int mouseY, float partialTicks) { 55 | if (Past.settingsManager.getSettingID("OldClickGUIRainbow").getValBoolean()) { 56 | Gui.drawRect(x, y, x + width, y + height, RainbowUtil.getMultiColour().getRGB()); 57 | } else { 58 | Gui.drawRect(x, y, x + width, y + height, 0xFF222222); 59 | } 60 | 61 | FontUtil.drawText(title, x + 2, y + height / 2 - mc.fontRenderer.FONT_HEIGHT / 2, -1); 62 | 63 | if (this.open && !this.components.isEmpty()) { 64 | for (Component component : components) { 65 | component.renderComponent(); 66 | } 67 | } 68 | } 69 | 70 | public boolean isWithinHeader(int x, int y) { 71 | if (x >= this.x && x <= this.x + this.width && y >= this.y && y <= this.y + this.height) { 72 | return true; 73 | } else { 74 | return false; 75 | } 76 | } 77 | 78 | public void updatePosition(int mouseX, int mouseY) { 79 | if (this.isDragging) { 80 | this.setX(mouseX - dragX); 81 | this.setY(mouseY - dragY); 82 | } 83 | } 84 | 85 | public void closeAllSetting() { 86 | for (Component component : components) { 87 | component.closeAllSub(); 88 | } 89 | } 90 | 91 | public ArrayList getComponents() { 92 | return components; 93 | } 94 | 95 | public int getWidth() { 96 | return width; 97 | } 98 | 99 | public void setDragging(boolean drag) { 100 | this.isDragging = drag; 101 | } 102 | 103 | public boolean isOpen() { 104 | return open; 105 | } 106 | 107 | public void setOpen(boolean open) { 108 | this.open = open; 109 | 110 | if (Past.configUtil != null) { 111 | try { 112 | Past.configUtil.saveGuiPanels(); 113 | } catch (Exception e) {} 114 | } 115 | } 116 | 117 | public int getX() { 118 | return x; 119 | } 120 | 121 | public int getY() { 122 | return y; 123 | } 124 | 125 | public void setX(int newX) { 126 | this.x = newX; 127 | 128 | if (Past.configUtil != null) { 129 | try { 130 | Past.configUtil.saveGuiPanels(); 131 | } catch (Exception e) {} 132 | } 133 | } 134 | 135 | public void setY(int newY) { 136 | this.y = newY; 137 | 138 | if (Past.configUtil != null) { 139 | try { 140 | Past.configUtil.saveGuiPanels(); 141 | } catch (Exception e) {} 142 | } 143 | } 144 | 145 | public Category getCategory() { 146 | return cat; 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/render/BlockHighlight.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.render; 2 | 3 | import me.olliem5.past.Past; 4 | import me.olliem5.past.api.module.Category; 5 | import me.olliem5.past.api.module.Module; 6 | import me.olliem5.past.api.module.ModuleInfo; 7 | import me.olliem5.past.api.setting.Setting; 8 | import me.olliem5.past.api.util.render.RenderUtil; 9 | import me.zero.alpine.listener.EventHandler; 10 | import me.zero.alpine.listener.Listener; 11 | import net.minecraft.util.math.BlockPos; 12 | import net.minecraft.util.math.RayTraceResult; 13 | import net.minecraftforge.client.event.RenderWorldLastEvent; 14 | 15 | import java.awt.*; 16 | import java.util.ArrayList; 17 | 18 | @ModuleInfo(name = "BlockHighlight", description = "Highlights the block that you are looking at", category = Category.RENDER) 19 | public class BlockHighlight extends Module { 20 | 21 | Setting rendermode; 22 | Setting red; 23 | Setting green; 24 | Setting blue; 25 | Setting alpha; 26 | Setting rainbow; 27 | 28 | private ArrayList rendermodes; 29 | 30 | private RayTraceResult rayTraceResult; 31 | 32 | @Override 33 | public void setup() { 34 | rendermodes = new ArrayList<>(); 35 | rendermodes.add("Full"); 36 | rendermodes.add("FullFrame"); 37 | rendermodes.add("Frame"); 38 | 39 | Past.settingsManager.registerSetting(rendermode = new Setting("Mode", "BlockHighlightMode", this, rendermodes, "FullFrame")); 40 | Past.settingsManager.registerSetting(red = new Setting("Red", "BlockHighlightRed", 0, 100, 255, this)); 41 | Past.settingsManager.registerSetting(green = new Setting("Green", "BlockHighlightGreen", 0, 100, 255, this)); 42 | Past.settingsManager.registerSetting(blue = new Setting("Blue", "BlockHighlightBlue", 0, 100, 255, this)); 43 | Past.settingsManager.registerSetting(alpha = new Setting("Alpha", "BlockHighlightAlpha", 0, 100, 255, this)); 44 | Past.settingsManager.registerSetting(rainbow = new Setting("Rainbow", "BlockHighlightRainbow", false, this)); 45 | } 46 | 47 | @Override 48 | public void onUpdate() { 49 | if (nullCheck()) return; 50 | 51 | rayTraceResult = mc.objectMouseOver; 52 | } 53 | 54 | @EventHandler 55 | public Listener listener = new Listener<>(event -> { 56 | if (nullCheck()) return; 57 | 58 | float[] hue = new float[] {(float) (System.currentTimeMillis() % 7500L) / 7500f}; 59 | int rgb = Color.HSBtoRGB(hue[0], 0.8f, 0.8f); 60 | int rgbred = rgb >> 16 & 255; 61 | int rgbgreen = rgb >> 8 & 255; 62 | int rgbblue = rgb & 255; 63 | 64 | if (rayTraceResult.typeOfHit == RayTraceResult.Type.BLOCK) { 65 | 66 | BlockPos blockPos = rayTraceResult.getBlockPos(); 67 | 68 | if (rayTraceResult != null) { 69 | if (!rainbow.getValBoolean()) { 70 | if (rendermode.getValueString() == "Full") { 71 | RenderUtil.drawBox(RenderUtil.generateBB(blockPos.getX(), blockPos.getY(), blockPos.getZ()), red.getValueInt() / 255f, green.getValueInt() / 255f, blue.getValueInt() / 255f, alpha.getValueInt() / 255f); 72 | } else if (rendermode.getValueString() == "FullFrame") { 73 | RenderUtil.drawBoxOutline(RenderUtil.generateBB(blockPos.getX(), blockPos.getY(), blockPos.getZ()), red.getValueInt() / 255f, green.getValueInt() / 255f, blue.getValueInt() / 255f, alpha.getValueInt() / 255f); 74 | } else { 75 | RenderUtil.drawOutline(RenderUtil.generateBB(blockPos.getX(), blockPos.getY(), blockPos.getZ()), red.getValueInt() / 255f, green.getValueInt() / 255f, blue.getValueInt() / 255f, alpha.getValueInt() / 255f); 76 | } 77 | } else { 78 | if (rendermode.getValueString() == "Full") { 79 | RenderUtil.drawBox(RenderUtil.generateBB(blockPos.getX(), blockPos.getY(), blockPos.getZ()), rgbred / 255f, rgbgreen / 255f, rgbblue / 255f, alpha.getValueInt() / 255f); 80 | } else if (rendermode.getValueString() == "FullFrame") { 81 | RenderUtil.drawBoxOutline(RenderUtil.generateBB(blockPos.getX(), blockPos.getY(), blockPos.getZ()), rgbred / 255f, rgbgreen / 255f, rgbblue / 255f, alpha.getValueInt() / 255f); 82 | } else { 83 | RenderUtil.drawOutline(RenderUtil.generateBB(blockPos.getX(), blockPos.getY(), blockPos.getZ()), rgbred / 255f, rgbgreen / 255f, rgbblue / 255f, alpha.getValueInt() / 255f); 84 | } 85 | } 86 | } 87 | } 88 | }); 89 | } 90 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/api/setting/Setting.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.api.setting; 2 | 3 | import me.olliem5.past.Past; 4 | import me.olliem5.past.impl.gui.editor.component.HudComponent; 5 | import me.olliem5.past.api.module.Module; 6 | 7 | import java.util.ArrayList; 8 | 9 | public class Setting { 10 | private Module parent; 11 | private HudComponent hudParent; 12 | 13 | private String name; 14 | private String id; 15 | private String type; 16 | 17 | private int min; 18 | private int start; 19 | private int max; 20 | 21 | private double dmin; 22 | private double dstart; 23 | private double dmax; 24 | 25 | private boolean bval; 26 | 27 | private String sval; 28 | private ArrayList modes; 29 | 30 | public Setting(String name, String id, int min, int start, int max, Module module) { 31 | this.parent = module; 32 | this.name = name; 33 | this.id = id; 34 | this.min = min; 35 | this.start = start; 36 | this.max = max; 37 | this.type = "integer"; 38 | } 39 | 40 | public Setting(String name, String id, double dmin, double dstart, double dmax, Module module) { 41 | this.parent = module; 42 | this.name = name; 43 | this.id = id; 44 | this.dmin = dmin; 45 | this.dstart = dstart; 46 | this.dmax = dmax; 47 | this.type = "double"; 48 | } 49 | 50 | public Setting(String name, String id, boolean bval, Module module) { 51 | this.parent = module; 52 | this.name = name; 53 | this.id = id; 54 | this.bval = bval; 55 | this.type = "boolean"; 56 | } 57 | 58 | public Setting(String name, String id, Module module, ArrayList modes, String sval) { 59 | this.parent = module; 60 | this.name = name; 61 | this.id = id; 62 | this.sval = sval; 63 | this.modes = modes; 64 | this.type = "mode"; 65 | } 66 | 67 | public Setting(String name, String id, boolean bval, HudComponent hudComponent) { 68 | this.hudParent = hudComponent; 69 | this.name = name; 70 | this.id = id; 71 | this.bval = bval; 72 | this.type = "hudboolean"; 73 | } 74 | 75 | public int getValueInt() { 76 | return this.start; 77 | } 78 | 79 | public double getValueDouble() { 80 | return this.dstart; 81 | } 82 | 83 | public boolean getValBoolean() { 84 | return this.bval; 85 | } 86 | 87 | public String getValueString() { 88 | return this.sval; 89 | } 90 | 91 | public String getType() { 92 | return type; 93 | } 94 | 95 | public String getName() { 96 | return name; 97 | } 98 | 99 | public int getMin() { 100 | return min; 101 | } 102 | 103 | public int getStart() { 104 | return start; 105 | } 106 | 107 | public int getMax() { 108 | return max; 109 | } 110 | 111 | public double getDmin() { 112 | return dmin; 113 | } 114 | 115 | public double getDstart() { 116 | return dstart; 117 | } 118 | 119 | public double getDmax() { 120 | return dmax; 121 | } 122 | 123 | public String getId() { 124 | return id; 125 | } 126 | 127 | public Module getParent() { 128 | return parent; 129 | } 130 | 131 | public HudComponent getHudParent() { 132 | return hudParent; 133 | } 134 | 135 | public ArrayList getModes() { 136 | return this.modes; 137 | } 138 | 139 | public void setValueInt(final int value) { 140 | this.start = value; 141 | 142 | if (Past.configUtil != null) { 143 | try { 144 | Past.configUtil.saveIntegers(); 145 | } catch (Exception e) {} 146 | } 147 | } 148 | 149 | public void setValueDouble(final double value) { 150 | this.dstart = value; 151 | 152 | if (Past.configUtil != null) { 153 | try { 154 | Past.configUtil.saveDoubles(); 155 | } catch (Exception e) {} 156 | } 157 | } 158 | 159 | public void setValBoolean(boolean value) { 160 | this.bval = value; 161 | 162 | if (Past.configUtil != null) { 163 | try { 164 | Past.configUtil.saveBooleans(); 165 | } catch (Exception e) {} 166 | } 167 | } 168 | 169 | public void setValueString(String value) { 170 | this.sval = value; 171 | 172 | if (Past.configUtil != null) { 173 | try { 174 | Past.configUtil.saveModes(); 175 | } catch (Exception e) {} 176 | } 177 | } 178 | } 179 | -------------------------------------------------------------------------------- /src/main/java/me/olliem5/past/impl/modules/misc/EntityAlert.java: -------------------------------------------------------------------------------- 1 | package me.olliem5.past.impl.modules.misc; 2 | 3 | import com.mojang.realmsclient.gui.ChatFormatting; 4 | import me.olliem5.past.Past; 5 | import me.olliem5.past.api.module.Category; 6 | import me.olliem5.past.api.module.Module; 7 | import me.olliem5.past.api.module.ModuleInfo; 8 | import me.olliem5.past.api.setting.Setting; 9 | import me.olliem5.past.api.util.client.MessageUtil; 10 | import me.olliem5.past.api.util.client.CooldownUtil; 11 | import net.minecraft.client.audio.PositionedSoundRecord; 12 | import net.minecraft.entity.Entity; 13 | import net.minecraft.entity.passive.EntityDonkey; 14 | import net.minecraft.entity.passive.EntityLlama; 15 | import net.minecraft.entity.passive.EntityMule; 16 | import net.minecraft.init.SoundEvents; 17 | 18 | @ModuleInfo(name = "EntityAlert", description = "Alerts you when selected entities enter render distance", category = Category.MISC) 19 | public class EntityAlert extends Module { 20 | 21 | Setting donkey; 22 | Setting llama; 23 | Setting mule; 24 | Setting donkeydelay; 25 | Setting llamadelay; 26 | Setting muledelay; 27 | Setting sound; 28 | 29 | @Override 30 | public void setup() { 31 | Past.settingsManager.registerSetting(donkey = new Setting("Donkey", "EntityAlertDonkey", true, this)); 32 | Past.settingsManager.registerSetting(llama = new Setting("Llama", "EntityAlertLlama", true, this)); 33 | Past.settingsManager.registerSetting(mule = new Setting("Mule", "EntityAlertMule", true, this)); 34 | Past.settingsManager.registerSetting(donkeydelay = new Setting("D Delay", "EntityAlertDonkeyDelay", 0, 3000, 10000, this)); 35 | Past.settingsManager.registerSetting(llamadelay = new Setting("L Delay", "EntityAlertLlamaDelay", 0, 3000, 10000, this)); 36 | Past.settingsManager.registerSetting(muledelay = new Setting("M Delay", "EntityAlertMuleDelay", 0, 3000, 10000, this)); 37 | Past.settingsManager.registerSetting(sound = new Setting("Sound", "EntityAlertSound", true, this)); 38 | } 39 | 40 | CooldownUtil donkeyCooldown = new CooldownUtil(); 41 | CooldownUtil llamaCooldown = new CooldownUtil(); 42 | CooldownUtil muleCooldown = new CooldownUtil(); 43 | 44 | public void onUpdate() { 45 | if (nullCheck()) return; 46 | 47 | for (Entity entity : mc.world.getLoadedEntityList()) { 48 | if (entity instanceof EntityDonkey && donkey.getValBoolean() && donkeyCooldown.passed(donkeydelay.getValueInt())) { 49 | donkeyCooldown.reset(); 50 | MessageUtil.sendEntityAlertMessage(ChatFormatting.WHITE + "Found a " + ChatFormatting.AQUA + "donkey " + ChatFormatting.WHITE + "at " + ChatFormatting.GRAY + "[" + ChatFormatting.WHITE + Math.round(entity.lastTickPosX) + ChatFormatting.GRAY + ", " + ChatFormatting.WHITE + Math.round(entity.lastTickPosY) + ChatFormatting.GRAY + ", " + ChatFormatting.WHITE + Math.round(entity.lastTickPosZ) + ChatFormatting.GRAY + "]"); 51 | if (sound.getValBoolean()) { 52 | mc.getSoundHandler().playSound(PositionedSoundRecord.getRecord(SoundEvents.ENTITY_EXPERIENCE_ORB_PICKUP, 1.0F, 1.0F)); 53 | } 54 | } else if (entity instanceof EntityLlama && llama.getValBoolean() && llamaCooldown.passed(llamadelay.getValueInt())) { 55 | llamaCooldown.reset(); 56 | MessageUtil.sendEntityAlertMessage(ChatFormatting.WHITE + "Found a " + ChatFormatting.AQUA + "llama " + ChatFormatting.WHITE + "at " + ChatFormatting.GRAY + "[" + ChatFormatting.WHITE + Math.round(entity.lastTickPosX) + ChatFormatting.GRAY + ", " + ChatFormatting.WHITE + Math.round(entity.lastTickPosY) + ChatFormatting.GRAY + ", " + ChatFormatting.WHITE + Math.round(entity.lastTickPosZ) + ChatFormatting.GRAY + "]"); 57 | if (sound.getValBoolean()) { 58 | mc.getSoundHandler().playSound(PositionedSoundRecord.getRecord(SoundEvents.ENTITY_EXPERIENCE_ORB_PICKUP, 1.0F, 1.0F)); 59 | } 60 | } else if (entity instanceof EntityMule && mule.getValBoolean() && muleCooldown.passed(muledelay.getValueInt())) { 61 | muleCooldown.reset(); 62 | MessageUtil.sendEntityAlertMessage(ChatFormatting.WHITE + "Found a " + ChatFormatting.AQUA + "mule " + ChatFormatting.WHITE + "at " + ChatFormatting.GRAY + "[" + ChatFormatting.WHITE + Math.round(entity.lastTickPosX) + ChatFormatting.GRAY + ", " + ChatFormatting.WHITE + Math.round(entity.lastTickPosY) + ChatFormatting.GRAY + ", " + ChatFormatting.WHITE + Math.round(entity.lastTickPosZ) + ChatFormatting.GRAY + "]"); 63 | if (sound.getValBoolean()) { 64 | mc.getSoundHandler().playSound(PositionedSoundRecord.getRecord(SoundEvents.ENTITY_EXPERIENCE_ORB_PICKUP, 1.0F, 1.0F)); 65 | } 66 | } 67 | } 68 | } 69 | } 70 | --------------------------------------------------------------------------------