├── .gitattributes ├── src └── main │ ├── java │ ├── org │ │ └── newdawn │ │ │ └── slick │ │ │ ├── muffin │ │ │ ├── package.html │ │ │ ├── WebstartMuffin.java │ │ │ ├── Muffin.java │ │ │ └── FileMuffin.java │ │ │ ├── tests │ │ │ ├── states │ │ │ │ └── package.html │ │ │ ├── package.html │ │ │ ├── xml │ │ │ │ ├── package.html │ │ │ │ ├── Item.java │ │ │ │ ├── Stats.java │ │ │ │ ├── Inventory.java │ │ │ │ ├── GameData.java │ │ │ │ ├── ObjectParserTest.java │ │ │ │ ├── Entity.java │ │ │ │ └── ItemContainer.java │ │ │ ├── StateBasedTest.java │ │ │ ├── ImageMemTest.java │ │ │ ├── AntiAliasTest.java │ │ │ ├── IsoTiledTest.java │ │ │ ├── LameTest.java │ │ │ ├── DoubleClickTest.java │ │ │ ├── TransparentColorTest.java │ │ │ ├── CanvasSizeTest.java │ │ │ └── ImageBufferTest.java │ │ │ ├── imageout │ │ │ ├── package.html │ │ │ └── ImageWriter.java │ │ │ ├── fills │ │ │ └── package.html │ │ │ ├── geom │ │ │ ├── package.html │ │ │ ├── TexCoordGenerator.java │ │ │ ├── GeomUtilListener.java │ │ │ ├── Triangulator.java │ │ │ └── Point.java │ │ │ ├── data │ │ │ ├── particle.tga │ │ │ ├── defaultfont.png │ │ │ └── package.html │ │ │ ├── particles │ │ │ ├── effects │ │ │ │ └── package.html │ │ │ ├── package.html │ │ │ └── ConfigurableEmitterFactory.java │ │ │ ├── util │ │ │ ├── package.html │ │ │ ├── pathfinding │ │ │ │ ├── package.html │ │ │ │ ├── Mover.java │ │ │ │ ├── heuristics │ │ │ │ │ ├── ClosestHeuristic.java │ │ │ │ │ ├── ClosestSquaredHeuristic.java │ │ │ │ │ └── ManhattanHeuristic.java │ │ │ │ ├── PathFindingContext.java │ │ │ │ ├── PathFinder.java │ │ │ │ ├── AStarHeuristic.java │ │ │ │ └── navmesh │ │ │ │ │ ├── NavPath.java │ │ │ │ │ └── Link.java │ │ │ ├── xml │ │ │ │ ├── package.html │ │ │ │ ├── SlickXMLException.java │ │ │ │ └── XMLElementList.java │ │ │ ├── OperationNotSupportedException.java │ │ │ ├── ResourceLocation.java │ │ │ ├── Bootstrap.java │ │ │ ├── ClasspathLocation.java │ │ │ ├── LogSystem.java │ │ │ ├── FileSystemLocation.java │ │ │ ├── MaskUtil.java │ │ │ └── FastTrig.java │ │ │ ├── gui │ │ │ ├── package.html │ │ │ └── ComponentListener.java │ │ │ ├── loading │ │ │ ├── package.html │ │ │ └── DeferredResource.java │ │ │ ├── svg │ │ │ ├── package.html │ │ │ ├── Loader.java │ │ │ ├── inkscape │ │ │ │ ├── GroupProcessor.java │ │ │ │ ├── InkscapeNonGeometricData.java │ │ │ │ ├── ElementProcessor.java │ │ │ │ ├── RectProcessor.java │ │ │ │ └── EllipseProcessor.java │ │ │ ├── ParsingException.java │ │ │ ├── RadialGradientFill.java │ │ │ └── LinearGradientFill.java │ │ │ ├── command │ │ │ ├── package.html │ │ │ ├── Control.java │ │ │ ├── Command.java │ │ │ ├── ControllerButtonControl.java │ │ │ ├── InputProviderListener.java │ │ │ ├── KeyControl.java │ │ │ ├── MouseButtonControl.java │ │ │ ├── BasicCommand.java │ │ │ └── ControllerDirectionControl.java │ │ │ ├── openal │ │ │ ├── package.html │ │ │ ├── OggData.java │ │ │ └── NullAudio.java │ │ │ ├── opengl │ │ │ ├── package.html │ │ │ ├── GLUtils.java │ │ │ ├── CompositeIOException.java │ │ │ ├── ImageData.java │ │ │ ├── EmptyImageData.java │ │ │ └── renderer │ │ │ │ ├── LineStripRenderer.java │ │ │ │ └── DefaultLineStripRenderer.java │ │ │ ├── state │ │ │ ├── package.html │ │ │ └── transition │ │ │ │ └── EmptyTransition.java │ │ │ ├── InputListener.java │ │ │ ├── tiled │ │ │ └── package.html │ │ │ ├── Renderable.java │ │ │ ├── MusicListener.java │ │ │ ├── KeyListener.java │ │ │ ├── SlickException.java │ │ │ ├── font │ │ │ └── effects │ │ │ │ ├── Effect.java │ │ │ │ ├── ConfigurableEffect.java │ │ │ │ └── FilterEffect.java │ │ │ ├── ControlledInputReciever.java │ │ │ ├── ShapeFill.java │ │ │ └── Game.java │ └── me │ │ └── lyric │ │ └── infinity │ │ ├── mixin │ │ ├── transformer │ │ │ ├── IEntity.java │ │ │ ├── IEntityRenderer.java │ │ │ ├── IMinecraft.java │ │ │ ├── IPlayerControllerMP.java │ │ │ ├── ICPacketUseEntity.java │ │ │ ├── INetworkManager.java │ │ │ └── IItemRenderer.java │ │ ├── mixins │ │ │ ├── accessors │ │ │ │ ├── ICPacketChat.java │ │ │ │ ├── ITimer.java │ │ │ │ ├── IEntity.java │ │ │ │ ├── IEntityPlayer.java │ │ │ │ ├── ISPacketChat.java │ │ │ │ ├── ISPacketPlayerPosLook.java │ │ │ │ ├── IRenderManager.java │ │ │ │ ├── IEntityPlayerSP.java │ │ │ │ └── ICPacketPlayer.java │ │ │ ├── network │ │ │ │ ├── MixinCPacketUseEntity.java │ │ │ │ └── MixinPlayerControllerMP.java │ │ │ ├── render │ │ │ │ ├── MixinSplashProgressRun.java │ │ │ │ ├── MixinItemRenderer.java │ │ │ │ └── MixinLayerArmorBase.java │ │ │ ├── gui │ │ │ │ ├── MixinGui.java │ │ │ │ └── MixinGuiIngame.java │ │ │ ├── blocks │ │ │ │ └── MixinBlockLiquid.java │ │ │ └── entity │ │ │ │ └── MixinEntity.java │ │ └── MixinLoader.java │ │ ├── api │ │ ├── command │ │ │ ├── CommandState.java │ │ │ └── Command.java │ │ ├── module │ │ │ ├── Category.java │ │ │ └── ModuleInformation.java │ │ ├── event │ │ │ ├── render │ │ │ │ ├── crystal │ │ │ │ │ ├── CrystalTextureEvent.java │ │ │ │ │ ├── RenderCrystalPostEvent.java │ │ │ │ │ └── RenderCrystalPreEvent.java │ │ │ │ ├── crosshair │ │ │ │ │ └── CrosshairEvent.java │ │ │ │ ├── RenderNametagEvent.java │ │ │ │ ├── Render3DEvent.java │ │ │ │ └── AspectEvent.java │ │ │ ├── misc │ │ │ │ └── GameLoopEvent.java │ │ │ ├── blocks │ │ │ │ └── CanCollideCheckEvent.java │ │ │ ├── entity │ │ │ │ └── LivingUpdateEvent.java │ │ │ ├── network │ │ │ │ └── PacketEvent.java │ │ │ └── player │ │ │ │ └── MoveEvent.java │ │ ├── util │ │ │ ├── minecraft │ │ │ │ ├── IGlobals.java │ │ │ │ └── rotation │ │ │ │ │ └── Rotation.java │ │ │ ├── metadata │ │ │ │ └── FileUtils.java │ │ │ ├── time │ │ │ │ ├── DateTimeUtils.java │ │ │ │ └── Timer.java │ │ │ ├── gl │ │ │ │ ├── Interpolation.java │ │ │ │ ├── AnimationUtils.java │ │ │ │ ├── shader │ │ │ │ │ └── shaders │ │ │ │ │ │ └── SpaceShader.java │ │ │ │ └── ImageUtils.java │ │ │ └── client │ │ │ │ └── BlockUtil.java │ │ └── setting │ │ │ ├── settings │ │ │ ├── KeySetting.java │ │ │ ├── ColorSetting.java │ │ │ ├── BooleanSetting.java │ │ │ ├── StringSetting.java │ │ │ ├── IntegerSetting.java │ │ │ ├── FloatSetting.java │ │ │ └── ModeSetting.java │ │ │ └── Setting.java │ │ ├── impl │ │ ├── modules │ │ │ ├── player │ │ │ │ ├── Exception.java │ │ │ │ ├── Resolver.java │ │ │ │ ├── Delays.java │ │ │ │ └── HitboxDesync.java │ │ │ ├── render │ │ │ │ ├── Ambience.java │ │ │ │ ├── CModifier.java │ │ │ │ ├── PlayerChams.java │ │ │ │ ├── NoRender.java │ │ │ │ ├── Aspect.java │ │ │ │ ├── CustomTime.java │ │ │ │ ├── Portals.java │ │ │ │ └── Swing.java │ │ │ ├── misc │ │ │ │ ├── LiquidInteract.java │ │ │ │ ├── AntiHunger.java │ │ │ │ ├── SkinBlink.java │ │ │ │ ├── NoHandshake.java │ │ │ │ └── AutoRespawn.java │ │ │ ├── client │ │ │ │ ├── RPC.java │ │ │ │ └── ClickGUI.java │ │ │ └── movement │ │ │ │ ├── AutoWalk.java │ │ │ │ └── InstantSpeed.java │ │ └── commands │ │ │ ├── ListCommand.java │ │ │ ├── PrefixCommand.java │ │ │ └── ToggleCommand.java │ │ ├── gui │ │ └── Csgo │ │ │ └── CsgoSetting.java │ │ ├── rcefix │ │ └── ASMTransformer.java │ │ ├── manager │ │ └── client │ │ │ ├── FriendManager.java │ │ │ └── CommandManager.java │ │ └── Infinity.java │ └── resources │ ├── darwin │ └── libdiscord-rpc.dylib │ ├── linux-x86-64 │ └── libdiscord-rpc.so │ ├── win32-x86-64 │ └── discord-rpc.dll │ ├── assets │ ├── infinity │ │ └── font │ │ │ └── Comfortaa-Regular.ttf │ └── minecraft │ │ └── infinity │ │ ├── textures │ │ ├── splash.png │ │ └── icons │ │ │ ├── arrow.png │ │ │ ├── logo.png │ │ │ ├── misc.png │ │ │ ├── client.png │ │ │ ├── combat.png │ │ │ ├── player.png │ │ │ ├── render.png │ │ │ └── movement.png │ │ └── shader │ │ └── vertex.vert │ ├── mcmod.info │ └── mixins.infinity.json ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradle.properties ├── README.md └── .github └── workflows └── build.yml /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/muffin/package.html: -------------------------------------------------------------------------------- 1 | 2 | Muffins for storing local data 3 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/tests/states/package.html: -------------------------------------------------------------------------------- 1 | 2 | States for the StateBasedGameTest 3 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lyricnight/infinity/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/tests/package.html: -------------------------------------------------------------------------------- 1 | 2 | Tests for the facilities provided by the library. 3 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/tests/xml/package.html: -------------------------------------------------------------------------------- 1 | 2 | Tests for the XML Parser and Object Tree Parser 3 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/imageout/package.html: -------------------------------------------------------------------------------- 1 | 2 | Supports saving of slick images to various file types. 3 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/fills/package.html: -------------------------------------------------------------------------------- 1 | 2 | Fill effects used to colour and mogrify shapes during rendering 3 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/geom/package.html: -------------------------------------------------------------------------------- 1 | 2 | Simple geometric wrappers that can be used for rendering and collision. 3 | -------------------------------------------------------------------------------- /src/main/resources/darwin/libdiscord-rpc.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lyricnight/infinity/HEAD/src/main/resources/darwin/libdiscord-rpc.dylib -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/data/particle.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lyricnight/infinity/HEAD/src/main/java/org/newdawn/slick/data/particle.tga -------------------------------------------------------------------------------- /src/main/resources/linux-x86-64/libdiscord-rpc.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lyricnight/infinity/HEAD/src/main/resources/linux-x86-64/libdiscord-rpc.so -------------------------------------------------------------------------------- /src/main/resources/win32-x86-64/discord-rpc.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lyricnight/infinity/HEAD/src/main/resources/win32-x86-64/discord-rpc.dll -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/particles/effects/package.html: -------------------------------------------------------------------------------- 1 | 2 | This package should contain stock effects for simple particle systems. 3 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/util/package.html: -------------------------------------------------------------------------------- 1 | 2 | Utilities to support the library. Basically anything that didn't fit elsewhere. 3 | 4 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/data/defaultfont.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lyricnight/infinity/HEAD/src/main/java/org/newdawn/slick/data/defaultfont.png -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/util/pathfinding/package.html: -------------------------------------------------------------------------------- 1 | 2 | A set of classes to provide configurable A* path finding on tilebased maps 3 | 4 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/gui/package.html: -------------------------------------------------------------------------------- 1 | 2 | Some extremely simple GUI elements which should be used where a game does not require a full GUI 3 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/util/xml/package.html: -------------------------------------------------------------------------------- 1 | 2 | Some utilities for reading XML using Java DOM and for mapping XML onto existing data models 3 | 4 | -------------------------------------------------------------------------------- /src/main/resources/assets/infinity/font/Comfortaa-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lyricnight/infinity/HEAD/src/main/resources/assets/infinity/font/Comfortaa-Regular.ttf -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs =-Xmx4G 2 | client_name = Infinity 3 | client_version = v5 4 | client_group = me.lyric.infinity 5 | client_base_name = infinity -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/mixin/transformer/IEntity.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.mixin.transformer; 2 | 3 | public interface IEntity { 4 | boolean isInWeb(); 5 | } 6 | -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/infinity/textures/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lyricnight/infinity/HEAD/src/main/resources/assets/minecraft/infinity/textures/splash.png -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/loading/package.html: -------------------------------------------------------------------------------- 1 | 2 | Adds support for deferring loading of resources to a set time to allow loading/progress bar 3 | style effects. 4 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/particles/package.html: -------------------------------------------------------------------------------- 1 | 2 | The particle engine maintains a set of small sprites being controlled 3 | by emitters to give some special effect. 4 | -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/infinity/textures/icons/arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lyricnight/infinity/HEAD/src/main/resources/assets/minecraft/infinity/textures/icons/arrow.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/infinity/textures/icons/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lyricnight/infinity/HEAD/src/main/resources/assets/minecraft/infinity/textures/icons/logo.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/infinity/textures/icons/misc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lyricnight/infinity/HEAD/src/main/resources/assets/minecraft/infinity/textures/icons/misc.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/infinity/textures/icons/client.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lyricnight/infinity/HEAD/src/main/resources/assets/minecraft/infinity/textures/icons/client.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/infinity/textures/icons/combat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lyricnight/infinity/HEAD/src/main/resources/assets/minecraft/infinity/textures/icons/combat.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/infinity/textures/icons/player.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lyricnight/infinity/HEAD/src/main/resources/assets/minecraft/infinity/textures/icons/player.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/infinity/textures/icons/render.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lyricnight/infinity/HEAD/src/main/resources/assets/minecraft/infinity/textures/icons/render.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/infinity/textures/icons/movement.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lyricnight/infinity/HEAD/src/main/resources/assets/minecraft/infinity/textures/icons/movement.png -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/mixin/transformer/IEntityRenderer.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.mixin.transformer; 2 | 3 | public interface IEntityRenderer { 4 | void setupCamera(float partialTicks, int pass); 5 | } -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/mixin/transformer/IMinecraft.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.mixin.transformer; 2 | 3 | import net.minecraft.util.Timer; 4 | public interface IMinecraft { 5 | Timer getTimer(); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/svg/package.html: -------------------------------------------------------------------------------- 1 | 2 | Demo/Test SVG area. Tiny line is integrated to render-to-texture - however a full implementation is 3 | to follow rendering SVG to OpenGL geometric shapes. 4 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/api/command/CommandState.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.api.command; 2 | 3 | /** 4 | * @author lyric (-_0) 5 | */ 6 | 7 | public enum CommandState { 8 | PERFORMED, ERROR 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/command/package.html: -------------------------------------------------------------------------------- 1 | 2 | Provides abstract input by mapping physical device inputs (mouse, keyboard and controllers) to abstract 3 | commands that are relevant to a particular game. 4 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/data/package.html: -------------------------------------------------------------------------------- 1 | 2 | This package contains the default data required for the basic functions of YASL. Currently this includes a default 3 | font to ensure text can always be displayed. 4 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/api/module/Category.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.api.module; 2 | 3 | public enum Category 4 | { 5 | Combat, 6 | Misc, 7 | Movement, 8 | Player, 9 | Render, 10 | Client 11 | } -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/command/Control.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.command; 2 | 3 | /** 4 | * Marker class for abstract input controls 5 | * 6 | * @author joverton 7 | */ 8 | public interface Control { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/openal/package.html: -------------------------------------------------------------------------------- 1 | 2 | This package contains the nitty gritty sound manipulation code for using OpenAL with standard audio formats. As 3 | a user you shouldn't need to access anything here directly. 4 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/opengl/package.html: -------------------------------------------------------------------------------- 1 | 2 | This package contains the nitty gritty image manipulation code for using OpenGL with standard image formats. As 3 | a user you shouldn't need to access anything here directly. 4 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/mixin/transformer/IPlayerControllerMP.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.mixin.transformer; 2 | 3 | public interface IPlayerControllerMP { 4 | 5 | void syncItem(); 6 | 7 | void setBlockHitDelay(int delay); 8 | 9 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # **Archived because servers are going to 1.20.x versions** 3 | 4 | 5 | client made by lyric 6 | 7 | thanks to bush for bushbus - https://github.com/lyricnight/eventbus 8 | 9 | thank you to Newdawn for the Slick2D library 10 | 11 | _skidded_ 12 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Oct 22 11:12:30 MDT 2019 2 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip 3 | distributionBase=GRADLE_USER_HOME 4 | distributionPath=wrapper/dists 5 | zipStorePath=wrapper/dists 6 | zipStoreBase=GRADLE_USER_HOME -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/api/event/render/crystal/CrystalTextureEvent.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.api.event.render.crystal; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Event; 4 | 5 | 6 | public class CrystalTextureEvent extends Event { 7 | } 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/state/package.html: -------------------------------------------------------------------------------- 1 | 2 | State based games allow the game to be broken down into the different activities the player may 3 | take part in, for instance menu, highscores, play and credits. However, states can be used to simply 4 | segregate section on the play. 5 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/InputListener.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick; 2 | 3 | /** 4 | * A listener that will be notified of keyboard, mouse and controller events 5 | * 6 | * @author kevin 7 | */ 8 | public interface InputListener extends MouseListener, KeyListener, ControllerListener { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/mixin/transformer/ICPacketUseEntity.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.mixin.transformer; 2 | 3 | import net.minecraft.entity.Entity; 4 | /** 5 | * @author lyric 6 | * @link {Criticals} 7 | */ 8 | public interface ICPacketUseEntity { 9 | 10 | Entity getAttackedEntity(); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/mixin/transformer/INetworkManager.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.mixin.transformer; 2 | 3 | import net.minecraft.network.Packet; 4 | 5 | /** 6 | * @author lyric 7 | * @link {PacketDelay} 8 | */ 9 | 10 | public interface INetworkManager { 11 | Packet sendPacketNoEvent(Packet packetIn); 12 | } -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/api/util/minecraft/IGlobals.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.api.util.minecraft; 2 | 3 | import net.minecraft.client.Minecraft; 4 | 5 | /** 6 | * @author lyric 7 | * wrapper 8 | * {@link Minecraft} 9 | */ 10 | 11 | public interface IGlobals { 12 | Minecraft mc = Minecraft.getMinecraft(); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/tiled/package.html: -------------------------------------------------------------------------------- 1 | 2 | Contains utilities for working with the TilED (http://www.mapeditor.org) 3 | utility for creating tiled maps. The default rendering for the tile map will simply render it flat. The data 4 | from the tilemaps is also available in it's raw form. 5 | -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/infinity/shader/vertex.vert: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | void main(void) { 4 | //Map gl_MultiTexCoord0 to index zero of gl_TexCoord 5 | gl_TexCoord[0] = gl_MultiTexCoord0; 6 | 7 | //Calculate position by multiplying model, view and projection matrix by the vertex vector 8 | gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; 9 | } -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/mixin/transformer/IItemRenderer.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.mixin.transformer; 2 | 3 | import net.minecraft.item.ItemStack; 4 | 5 | public interface IItemRenderer 6 | { 7 | float getprevEquippedProgressMainHand(); 8 | 9 | void setequippedProgressMainHand(float progress); 10 | 11 | void setitemStackMainHand(ItemStack itemStack); 12 | } -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/api/event/render/crosshair/CrosshairEvent.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.api.event.render.crosshair; 2 | 3 | import me.bush.eventbus.event.Event; 4 | 5 | /** 6 | * @author lyric 7 | */ 8 | 9 | public class CrosshairEvent extends Event { 10 | @Override 11 | protected boolean isCancellable() { 12 | return true; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/api/module/ModuleInformation.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.api.module; 2 | 3 | import java.lang.annotation.Retention; 4 | import java.lang.annotation.RetentionPolicy; 5 | 6 | @Retention(value = RetentionPolicy.RUNTIME) 7 | public @interface ModuleInformation { 8 | Category category(); 9 | 10 | String name(); 11 | 12 | String description(); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/api/event/render/RenderNametagEvent.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.api.event.render; 2 | 3 | import me.bush.eventbus.event.Event; 4 | 5 | /** 6 | * @author lyric ;) 7 | */ 8 | 9 | public class RenderNametagEvent extends Event { 10 | public RenderNametagEvent() {} 11 | @Override 12 | protected boolean isCancellable() { 13 | return true; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/command/Command.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.command; 2 | 3 | /** 4 | * The description of a action feedback from the abstract input system. This marker allows the 5 | * creation of action objects that can contain useful state. If you don't need state and just 6 | * a name use BasicCommand { 12 | public KeySetting(String name, int value) { 13 | super(name, value); 14 | } 15 | 16 | public KeySetting(String name, int value, Predicate shown) { 17 | super(name, value, shown); 18 | } 19 | } -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/mixin/mixins/network/MixinCPacketUseEntity.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.mixin.mixins.network; 2 | 3 | import me.lyric.infinity.mixin.transformer.ICPacketUseEntity; 4 | import net.minecraft.entity.Entity; 5 | import net.minecraft.network.play.client.CPacketUseEntity; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | 8 | @Mixin(CPacketUseEntity.class) 9 | public class MixinCPacketUseEntity implements ICPacketUseEntity { 10 | private Entity entity; 11 | @Override 12 | public Entity getAttackedEntity() 13 | { 14 | return entity; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/particles/ConfigurableEmitterFactory.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.particles; 2 | 3 | /** 4 | * A description of any class that can create Configurable Emitters during the ParticleIO 5 | * load phase. 6 | * 7 | * @author kevin 8 | */ 9 | public interface ConfigurableEmitterFactory { 10 | /** 11 | * Create a configurable emitter that will be populated with 12 | * loaded data 13 | * 14 | * @param name The name given to the emitter 15 | * @return The newly created configurable emitter 16 | */ 17 | public ConfigurableEmitter createEmitter(String name); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/api/util/time/DateTimeUtils.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.api.util.time; 2 | 3 | import java.time.LocalDateTime; 4 | import java.time.format.DateTimeFormatter; 5 | 6 | /** 7 | * @author lyric 8 | */ 9 | 10 | public class DateTimeUtils { 11 | 12 | public static final String TIME_AND_DATE = "uuuu-MM-dd-HH-mm-ss"; 13 | 14 | public static String time(String pattern) { 15 | final DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern); 16 | final LocalDateTime time = LocalDateTime.now(); 17 | 18 | return formatter.format(time); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/api/util/gl/Interpolation.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.api.util.gl; 2 | 3 | import me.lyric.infinity.api.util.minecraft.IGlobals; 4 | import net.minecraft.util.math.Vec3d; 5 | 6 | /** 7 | * @author lyric 8 | * @apiNote handles interpolation of player 9 | */ 10 | public class Interpolation implements IGlobals { 11 | public static Vec3d interpolatedEyePos() { 12 | return mc.player.getPositionEyes(mc.getRenderPartialTicks()); 13 | } 14 | 15 | public static Vec3d interpolatedEyeVec() { 16 | return mc.player.getLook(mc.getRenderPartialTicks()); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/impl/modules/render/Ambience.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.impl.modules.render; 2 | 3 | import me.lyric.infinity.api.module.Category; 4 | import me.lyric.infinity.api.module.Module; 5 | import me.lyric.infinity.api.module.ModuleInformation; 6 | import me.lyric.infinity.api.setting.settings.ColorSetting; 7 | 8 | 9 | /** 10 | * @author lyric 11 | */ 12 | 13 | @ModuleInformation(name = "Ambience", description = "Changes the color of your game.", category = Category.Render) 14 | public class Ambience extends Module { 15 | 16 | public ColorSetting color = createSetting("Colour", defaultColor); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/svg/Loader.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.svg; 2 | 3 | import org.newdawn.slick.geom.Transform; 4 | import org.w3c.dom.Element; 5 | 6 | /** 7 | * Description of a simple XML loader 8 | * 9 | * @author kevin 10 | */ 11 | public interface Loader { 12 | /** 13 | * Load the children of a given element 14 | * 15 | * @param element The element whose children should be loaded 16 | * @param t The transform to apply to all the children 17 | * @throws ParsingException Indicates a failure to read the XML 18 | */ 19 | public void loadChildren(Element element, Transform t) throws ParsingException; 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/tests/xml/Item.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.tests.xml; 2 | 3 | 4 | /** 5 | * A test example of some object data that can be configured via XML 6 | * 7 | * @author kevin 8 | */ 9 | public class Item { 10 | /** The name injected by the XML parser */ 11 | protected String name; 12 | /** The condition value injected by the XML parser */ 13 | protected int condition; 14 | 15 | /** 16 | * Dump this object to sysout 17 | * 18 | * @param prefix The prefix to apply to all lines 19 | */ 20 | public void dump(String prefix) { 21 | System.out.println(prefix+"Item "+name+","+condition); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/mixin/mixins/accessors/IEntityPlayerSP.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.mixin.mixins.accessors; 2 | 3 | import net.minecraft.client.entity.EntityPlayerSP; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin( EntityPlayerSP.class ) 8 | public interface IEntityPlayerSP { 9 | @Accessor(value = "lastReportedPosY") 10 | void setLastReportedPosY(double lastReportedPosY); 11 | 12 | @Accessor(value = "lastReportedPitch") 13 | void setLastReportedPitch(float lastReportedPitch); 14 | 15 | @Accessor(value = "lastReportedPitch") 16 | float getLastReportedPitch(); 17 | } -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/geom/TexCoordGenerator.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.geom; 2 | 3 | /** 4 | * A class capable of generating texture coordiantes based on 5 | * rendering positions of verticies. This allows custom texturing 6 | * of geometric shapes 7 | * 8 | * @author kevin 9 | */ 10 | public interface TexCoordGenerator { 11 | /** 12 | * Get the texture coordinate for a given render position 13 | * 14 | * @param x The x coordinate of the vertex being rendered 15 | * @param y The y coordinate of the vertex being rendered 16 | * @return The texture coordinate to apply 17 | */ 18 | public Vector2f getCoordFor(float x, float y); 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/tests/xml/Stats.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.tests.xml; 2 | 3 | /** 4 | * A test example of some object data that can be configured via XML 5 | * 6 | * @author kevin 7 | */ 8 | public class Stats { 9 | /** hit points */ 10 | private int hp; 11 | /** magic points */ 12 | private int mp; 13 | /** age in years */ 14 | private float age; 15 | /** experience points */ 16 | private int exp; 17 | 18 | /** 19 | * Dump this object to sysout 20 | * 21 | * @param prefix The prefix to apply to all lines 22 | */ 23 | public void dump(String prefix) { 24 | System.out.println(prefix+"Stats "+hp+","+mp+","+age+","+exp); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/api/event/render/AspectEvent.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.api.event.render; 2 | 3 | import me.bush.eventbus.event.Event; 4 | 5 | /** 6 | * @author lyric 7 | * for aspect module 8 | */ 9 | 10 | public class AspectEvent extends Event { 11 | 12 | private float aspect; 13 | 14 | public AspectEvent(float aspect) { 15 | this.aspect = aspect; 16 | } 17 | 18 | public float getAspect() { 19 | return aspect; 20 | } 21 | 22 | public void setAspect(float aspect) { 23 | this.aspect = aspect; 24 | } 25 | @Override 26 | protected boolean isCancellable() { 27 | return true; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/api/setting/settings/ColorSetting.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.api.setting.settings; 2 | 3 | import me.lyric.infinity.api.setting.Setting; 4 | 5 | import java.awt.*; 6 | import java.util.function.Predicate; 7 | 8 | /** 9 | * @author lyric and vikas!!! 10 | */ 11 | 12 | public class ColorSetting extends Setting { 13 | public ColorSetting(String name, Color value) { 14 | super(name, value); 15 | } 16 | 17 | public ColorSetting(String name, Color value, Predicate shown) { 18 | super(name, value, shown); 19 | } 20 | 21 | public void setColor(Color value) { 22 | this.value = value; 23 | } 24 | } -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/api/setting/settings/BooleanSetting.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.api.setting.settings; 2 | 3 | import me.lyric.infinity.api.setting.Setting; 4 | 5 | import java.util.function.Predicate; 6 | 7 | /** 8 | * @author lyric and vikas !!! 9 | */ 10 | 11 | public class BooleanSetting extends Setting { 12 | public BooleanSetting(String name, Boolean value) { 13 | super(name, value); 14 | } 15 | 16 | public BooleanSetting(String name, boolean value, Predicate shown) { 17 | super(name, value, shown); 18 | } 19 | 20 | @Override 21 | public Boolean getValue() { 22 | return (Boolean)this.value; 23 | } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/command/ControllerButtonControl.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.command; 2 | 3 | /** 4 | * A control indicating that a gamepad/joystick button must be pressed 5 | * or released to invoke an command. 6 | * 7 | * @author kevin 8 | */ 9 | public class ControllerButtonControl extends ControllerControl { 10 | 11 | /** 12 | * Create a new control based on a controller input 13 | * 14 | * @param controllerIndex The index of the controller to listen to 15 | * @param button The index of the button that causes the command 16 | */ 17 | public ControllerButtonControl(int controllerIndex, int button) { 18 | super(controllerIndex, BUTTON_EVENT, button); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/loading/DeferredResource.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.loading; 2 | 3 | import java.io.IOException; 4 | 5 | /** 6 | * A description of any class providing a resource handle that be loaded 7 | * at a later date (i.e. deferrred) 8 | * 9 | * @author kevin 10 | */ 11 | public interface DeferredResource { 12 | 13 | /** 14 | * Load the actual resource 15 | * 16 | * @throws IOException Indicates a failure to load the resource 17 | */ 18 | public void load() throws IOException; 19 | 20 | /** 21 | * Get a description of the resource to be loaded 22 | * 23 | * @return The description of the resource to be loaded 24 | */ 25 | public String getDescription(); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/util/pathfinding/Mover.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.util.pathfinding; 2 | 3 | /** 4 | * A tagging interface for an object representing the entity in the game that 5 | * is going to moving along the path. This allows us to pass around entity/state 6 | * information to determine whether a particular tile is blocked, or how much 7 | * cost to apply on a particular tile. 8 | * 9 | * For instance, a Mover might represent a tank or plane on a game map. Passing round 10 | * this entity allows us to determine whether rough ground on a map should effect 11 | * the unit's cost for moving through the tile. 12 | * 13 | * @author Kevin Glass 14 | */ 15 | public interface Mover { 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/impl/modules/player/Resolver.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.impl.modules.player; 2 | 3 | import me.lyric.infinity.api.module.Category; 4 | import me.lyric.infinity.api.module.Module; 5 | import me.lyric.infinity.api.module.ModuleInformation; 6 | 7 | /** 8 | * @author lyric 9 | * @link {MixinEntityOtherPlayerMP} 10 | */ 11 | 12 | @ModuleInformation(name = "Resolver", description = "we REMOVING INTERPOLATION out here", category = Category.Player) 13 | public class Resolver extends Module { 14 | @Override 15 | public String getDisplayInfo() 16 | { 17 | if (mc.world == null || mc.player == null) return ""; 18 | return String.valueOf(mc.world.playerEntities.size()); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/mixin/mixins/accessors/ICPacketPlayer.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.mixin.mixins.accessors; 2 | 3 | import net.minecraft.network.play.client.CPacketPlayer; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | /** 8 | * @author lyric 9 | */ 10 | 11 | @Mixin(CPacketPlayer.class) 12 | public interface ICPacketPlayer { 13 | 14 | @Accessor("rotating") 15 | boolean isRotating(); 16 | 17 | @Accessor("moving") 18 | boolean isMoving(); 19 | 20 | @Accessor("yaw") 21 | void setYaw(float yaw); 22 | 23 | @Accessor("pitch") 24 | void setPitch(float pitch); 25 | 26 | @Accessor("onGround") 27 | void setOnGround(boolean onGround); 28 | } -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/MusicListener.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick; 2 | 3 | /** 4 | * The description of any class needing to recieve notification of changes 5 | * to music state. 6 | * 7 | * @author kevin 8 | */ 9 | public interface MusicListener { 10 | 11 | /** 12 | * Notification that a piece of music finished playing 13 | * 14 | * @param music The music that finished playing 15 | */ 16 | public void musicEnded(Music music); 17 | 18 | /** 19 | * Notification that a piece of music has been swapped 20 | * for another. 21 | * 22 | * @param music The music that has been swapped out 23 | * @param newMusic The new music we're playing 24 | */ 25 | public void musicSwapped(Music music, Music newMusic); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/impl/modules/misc/LiquidInteract.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.impl.modules.misc; 2 | 3 | import me.bush.eventbus.annotation.EventListener; 4 | import me.lyric.infinity.api.event.blocks.CanCollideCheckEvent; 5 | import me.lyric.infinity.api.module.Category; 6 | import me.lyric.infinity.api.module.Module; 7 | import me.lyric.infinity.api.module.ModuleInformation; 8 | 9 | /** 10 | * @author lyric 11 | */ 12 | 13 | @ModuleInformation(name = "LiquidInteract", description = "????", category = Category.Misc) 14 | public class LiquidInteract extends Module { 15 | @EventListener 16 | public void canCollide(CanCollideCheckEvent event) { 17 | if (!nullSafe()) return; 18 | event.cancel(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/opengl/GLUtils.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.opengl; 2 | 3 | import org.newdawn.slick.opengl.renderer.Renderer; 4 | 5 | /** 6 | * A collection of utilities to allow aid interaction with the GL provider 7 | * 8 | * @author kevin 9 | */ 10 | public final class GLUtils { 11 | 12 | /** 13 | * Check that we're in the right place to be doing GL operations 14 | */ 15 | public static void checkGLContext() { 16 | try { 17 | Renderer.get().glGetError(); 18 | } catch (NullPointerException e) { 19 | throw new RuntimeException("OpenGL based resources (images, fonts, sprites etc) must be loaded as part of init() or the game loop. They cannot be loaded before initialisation."); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/api/setting/settings/StringSetting.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.api.setting.settings; 2 | 3 | import me.lyric.infinity.api.setting.Setting; 4 | 5 | import java.util.function.Predicate; 6 | 7 | /** 8 | * @author lyric and vikas!! 9 | */ 10 | 11 | public class StringSetting extends Setting { 12 | public StringSetting(String name, String value) { 13 | super(name, value); 14 | } 15 | 16 | public StringSetting(String name, String value, Predicate shown) { 17 | super(name, value, shown); 18 | } 19 | 20 | @Override 21 | public String getValue() { 22 | return (String)this.value; 23 | } 24 | 25 | @Override 26 | public void setValue(String value) { 27 | this.value = value; 28 | } 29 | } -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/KeyListener.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick; 2 | 3 | /** 4 | * Describes classes capable of responding to key presses 5 | * 6 | * @author kevin 7 | */ 8 | public interface KeyListener extends ControlledInputReciever { 9 | /** 10 | * Notification that a key was pressed 11 | * 12 | * @param key The key code that was pressed (@see org.newdawn.slick.Input) 13 | * @param c The character of the key that was pressed 14 | */ 15 | public abstract void keyPressed(int key, char c); 16 | 17 | /** 18 | * Notification that a key was released 19 | * 20 | * @param key The key code that was released (@see org.newdawn.slick.Input) 21 | * @param c The character of the key that was released 22 | */ 23 | public abstract void keyReleased(int key, char c); 24 | 25 | } -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/SlickException.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick; 2 | 3 | /** 4 | * A generic exception thrown by everything in the library 5 | * 6 | * @author kevin 7 | */ 8 | public class SlickException extends Exception { 9 | /** 10 | * Create a new exception with a detail message 11 | * 12 | * @param message The message describing the cause of this exception 13 | */ 14 | public SlickException(String message) { 15 | super(message); 16 | } 17 | 18 | /** 19 | * Create a new exception with a detail message 20 | * 21 | * @param message The message describing the cause of this exception 22 | * @param e The exception causing this exception to be thrown 23 | */ 24 | public SlickException(String message, Throwable e) { 25 | super(message, e); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/font/effects/Effect.java: -------------------------------------------------------------------------------- 1 | 2 | package org.newdawn.slick.font.effects; 3 | 4 | import org.newdawn.slick.UnicodeFont; 5 | import org.newdawn.slick.font.Glyph; 6 | 7 | import java.awt.*; 8 | import java.awt.image.BufferedImage; 9 | 10 | /** 11 | * A graphical effect that is applied to glyphs in a {@link UnicodeFont}. 12 | * 13 | * @author Nathan Sweet 14 | */ 15 | public interface Effect { 16 | /** 17 | * Called to draw the effect. 18 | * 19 | * @param image The image to draw into 20 | * @param g The graphics context to use for applying the effect 21 | * @param unicodeFont The font being rendered 22 | * @param glyph The particular glyph being rendered 23 | */ 24 | public void draw (BufferedImage image, Graphics2D g, UnicodeFont unicodeFont, Glyph glyph); 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/muffin/WebstartMuffin.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.muffin; 2 | 3 | import java.io.IOException; 4 | import java.util.HashMap; 5 | 6 | /** 7 | * A muffin load/save implementation based on using Webstart Muffins (a bit like cookies only 8 | * for webstart) 9 | * 10 | * @author kappaOne 11 | */ 12 | public class WebstartMuffin implements Muffin { 13 | 14 | /** 15 | * @see org.newdawn.slick.muffin.Muffin#saveFile(java.util.HashMap, java.lang.String) 16 | */ 17 | public void saveFile(HashMap scoreMap, String fileName) throws IOException { 18 | 19 | } 20 | 21 | /** 22 | * @see org.newdawn.slick.muffin.Muffin#loadFile(java.lang.String) 23 | */ 24 | public HashMap loadFile(String fileName) throws IOException { 25 | HashMap hashMap = new HashMap(); 26 | 27 | return hashMap; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/mixin/mixins/render/MixinSplashProgressRun.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.mixin.mixins.render; 2 | 3 | import me.lyric.infinity.api.util.gl.SplashProgress; 4 | import org.jetbrains.annotations.NotNull; 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(targets="net.minecraftforge.fml.client.SplashProgress$2", remap=false) 11 | public abstract class MixinSplashProgressRun { 12 | @Inject(method="run()V", at = @At(value="HEAD"), remap = false, cancellable = true) 13 | private void run(@NotNull CallbackInfo callbackInfo) { 14 | callbackInfo.cancel(); 15 | SplashProgress.drawSplash(); 16 | } 17 | 18 | } -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/util/ResourceLocation.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.util; 2 | 3 | import java.io.InputStream; 4 | import java.net.URL; 5 | 6 | /** 7 | * A location from which resources can be loaded 8 | * 9 | * @author kevin 10 | */ 11 | public interface ResourceLocation { 12 | 13 | /** 14 | * Get a resource as an input stream 15 | * 16 | * @param ref The reference to the resource to retrieve 17 | * @return A stream from which the resource can be read or 18 | * null if the resource can't be found in this location 19 | */ 20 | public InputStream getResourceAsStream(String ref); 21 | 22 | /** 23 | * Get a resource as a URL 24 | * 25 | * @param ref The reference to the resource to retrieve 26 | * @return A URL from which the resource can be read 27 | */ 28 | public URL getResource(String ref); 29 | } 30 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Gradle Build 2 | 3 | on: 4 | push: 5 | workflow_dispatch: 6 | pull_request: 7 | types: [opened, reopened] 8 | 9 | jobs: 10 | build: 11 | 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - uses: actions/checkout@v2 16 | - name: Set up JDK 1.8 17 | uses: actions/setup-java@v1 18 | with: 19 | java-version: 1.8 20 | - name: Grant execute permission for gradlew 21 | run: chmod +x gradlew 22 | - name: Build with Gradle 23 | run: | 24 | ./gradlew setupDecompWorkspace 25 | ./gradlew build 26 | - name: List files 27 | run: ls 28 | - name: Upload a Build Artifact 29 | uses: actions/upload-artifact@v2 30 | with: 31 | name: infinity dev build 32 | path: ./build/libs/*.jar 33 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/mixin/mixins/gui/MixinGui.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.mixin.mixins.gui; 2 | 3 | import net.minecraft.client.gui.Gui; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.Shadow; 6 | 7 | /** 8 | * @author lyric 9 | * @apiNote used for MixinGuiNewChat customFont 10 | */ 11 | 12 | 13 | @Mixin( Gui.class ) 14 | public abstract class MixinGui 15 | { 16 | @Shadow 17 | public static void drawRect(final int left, final int top, final int right, final int bottom, final int color) { 18 | } 19 | 20 | @Shadow 21 | protected abstract void drawGradientRect(final int p0, final int p1, final int p2, final int p3, final int p4, final int p5); 22 | 23 | @Shadow 24 | public abstract void drawTexturedModalRect(final int p0, final int p1, final int p2, final int p3, final int p4, final int p5); 25 | } -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/util/pathfinding/heuristics/ClosestHeuristic.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.util.pathfinding.heuristics; 2 | 3 | import org.newdawn.slick.util.pathfinding.AStarHeuristic; 4 | import org.newdawn.slick.util.pathfinding.Mover; 5 | import org.newdawn.slick.util.pathfinding.TileBasedMap; 6 | 7 | /** 8 | * A heuristic that uses the tile that is closest to the target 9 | * as the next best tile. 10 | * 11 | * @author Kevin Glass 12 | */ 13 | public class ClosestHeuristic implements AStarHeuristic { 14 | /** 15 | * @see AStarHeuristic#getCost(TileBasedMap, Mover, int, int, int, int) 16 | */ 17 | public float getCost(TileBasedMap map, Mover mover, int x, int y, int tx, int ty) { 18 | float dx = tx - x; 19 | float dy = ty - y; 20 | 21 | float result = (float) (Math.sqrt((dx*dx)+(dy*dy))); 22 | 23 | return result; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/command/InputProviderListener.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.command; 2 | 3 | /** 4 | * Description of any class wishing to recieve notifications of command invocations. Implementations 5 | * should be added to an appropriate input provider to recieve input notification 6 | * 7 | * @author joverton 8 | */ 9 | public interface InputProviderListener { 10 | 11 | /** 12 | * A control representing an control was pressed relating to a given command. 13 | * 14 | * @param command The command that the control related to 15 | */ 16 | public void controlPressed(Command command); 17 | 18 | /** 19 | * A control representing an control was released relating to a given command. 20 | * 21 | * @param command The command that the control related to 22 | */ 23 | public void controlReleased(Command command); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/util/Bootstrap.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.util; 2 | 3 | import org.newdawn.slick.AppGameContainer; 4 | import org.newdawn.slick.Game; 5 | 6 | /** 7 | * Utility class to wrap up starting a game in a single line 8 | * 9 | * @author kevin 10 | */ 11 | public class Bootstrap { 12 | 13 | /** 14 | * Start the game as an application 15 | * 16 | * @param game The game to be started 17 | * @param width The width of the window 18 | * @param height The height of the window 19 | * @param fullscreen True if the window should be fullscreen 20 | */ 21 | public static void runAsApplication(Game game, int width, int height, boolean fullscreen) { 22 | try { 23 | AppGameContainer container = new AppGameContainer(game, width, height, fullscreen); 24 | container.start(); 25 | } catch (Exception e) { 26 | e.printStackTrace(); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/util/xml/SlickXMLException.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.util.xml; 2 | 3 | import org.newdawn.slick.SlickException; 4 | 5 | /** 6 | * An exception to describe failures in XML. Made a special case because with XML 7 | * to object parsing you might want to handle it differently 8 | * 9 | * @author kevin 10 | */ 11 | public class SlickXMLException extends SlickException { 12 | 13 | /** 14 | * Create a new exception 15 | * 16 | * @param message The message describing the failure 17 | */ 18 | public SlickXMLException(String message) { 19 | super(message); 20 | } 21 | 22 | /** 23 | * Create a new exception 24 | * 25 | * @param message The message describing the failure 26 | * @param e The exception causing this failure 27 | */ 28 | public SlickXMLException(String message, Throwable e) { 29 | super(message, e); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/api/event/entity/LivingUpdateEvent.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.api.event.entity; 2 | 3 | import me.bush.eventbus.event.Event; 4 | import net.minecraft.client.entity.EntityPlayerSP; 5 | 6 | /** 7 | * author lyric ;) 8 | */ 9 | 10 | public class LivingUpdateEvent extends Event { 11 | 12 | private final EntityPlayerSP entityPlayerSP; 13 | private final boolean sprinting; 14 | 15 | public LivingUpdateEvent(EntityPlayerSP entityPlayerSP, boolean sprinting) { 16 | this.entityPlayerSP = entityPlayerSP; 17 | this.sprinting = sprinting; 18 | } 19 | 20 | public EntityPlayerSP getEntityPlayerSP() { 21 | return this.entityPlayerSP; 22 | } 23 | 24 | public boolean isSprinting() { 25 | return this.sprinting; 26 | } 27 | @Override 28 | protected boolean isCancellable() { 29 | return true; 30 | } 31 | } -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/tests/xml/Inventory.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.tests.xml; 2 | 3 | import java.util.ArrayList; 4 | 5 | /** 6 | * A test example of some object data that can be configured via XML 7 | * 8 | * @author kevin 9 | */ 10 | public class Inventory { 11 | /** The items held in the inventory */ 12 | private ArrayList items = new ArrayList(); 13 | 14 | /** 15 | * Called by XML parser to add a configured item to the entity 16 | * 17 | * @param item The item to be added 18 | */ 19 | private void add(Item item) { 20 | items.add(item); 21 | } 22 | 23 | /** 24 | * Dump this object to sysout 25 | * 26 | * @param prefix The prefix to apply to all lines 27 | */ 28 | public void dump(String prefix) { 29 | System.out.println(prefix+"Inventory"); 30 | for (int i=0;i packet; 10 | 11 | public PacketEvent(Packet packet) { 12 | super(); 13 | 14 | this.packet = packet; 15 | } 16 | 17 | public Packet getPacket() { 18 | return packet; 19 | } 20 | 21 | public static class Send extends PacketEvent { 22 | public Send(Packet packet) { 23 | super(packet); 24 | } 25 | } 26 | 27 | public static class Receive extends PacketEvent { 28 | public Receive(Packet packet) { 29 | super(packet); 30 | } 31 | } 32 | @Override 33 | protected boolean isCancellable() { 34 | return true; 35 | } 36 | } -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/tests/xml/GameData.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.tests.xml; 2 | 3 | import java.util.ArrayList; 4 | 5 | /** 6 | * The top level node of our test structure for XML -> object parsing 7 | * 8 | * @author kevin 9 | */ 10 | public class GameData { 11 | /** The list of entities added */ 12 | private ArrayList entities = new ArrayList(); 13 | 14 | /** 15 | * Called by XML parser to add a configured entity to the GameData 16 | * 17 | * @param entity The entity to be added 18 | */ 19 | private void add(Entity entity) { 20 | entities.add(entity); 21 | } 22 | 23 | /** 24 | * Dump this object to sysout 25 | * 26 | * @param prefix The prefix to apply to all lines 27 | */ 28 | public void dump(String prefix) { 29 | System.out.println(prefix+"GameData"); 30 | for (int i=0;i setting; 12 | 13 | public CsgoSetting(final Setting setting) { 14 | this.setting = setting; 15 | } 16 | 17 | public void drawScreen(final int mouseX, final int mouseY) { 18 | } 19 | 20 | public void mouseClicked(final int mouseX, final int mouseY, final int clickedButton) { 21 | } 22 | 23 | public void keyTyped(final char typedChar, final int keyCode) { 24 | } 25 | 26 | public void mouseReleased(final int mouseX, final int mouseY, final int releaseButton) { 27 | } 28 | 29 | public boolean isInside(final int mouseX, final int mouseY) { 30 | return mouseX > this.x && mouseX < this.x + this.width && mouseY > this.y && mouseY < this.y + this.height; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/mixin/mixins/gui/MixinGuiIngame.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.mixin.mixins.gui; 2 | 3 | import me.lyric.infinity.Infinity; 4 | import me.lyric.infinity.api.event.render.crosshair.CrosshairEvent; 5 | import net.minecraft.client.gui.GuiIngame; 6 | import net.minecraft.client.gui.ScaledResolution; 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 | /** 13 | * @author lyric 14 | */ 15 | 16 | @Mixin(GuiIngame.class) 17 | public abstract class MixinGuiIngame { 18 | @Inject(method = "renderAttackIndicator", at = @At("HEAD"), cancellable = true) 19 | protected void renderAttackIndicator(float partialTicks, ScaledResolution p_184045_2_, CallbackInfo ci) { 20 | final CrosshairEvent event = new CrosshairEvent(); 21 | Infinity.eventBus.post(event); 22 | if (event.isCancelled()) 23 | ci.cancel(); 24 | } 25 | } -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/tests/xml/ObjectParserTest.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.tests.xml; 2 | 3 | import org.newdawn.slick.util.xml.ObjectTreeParser; 4 | import org.newdawn.slick.util.xml.SlickXMLException; 5 | 6 | /** 7 | * A simple test to check that the object parser from XML works. Read the Javadoc of 8 | * ObjectParser to work out whats going on here 9 | * 10 | * @author kevin 11 | */ 12 | public class ObjectParserTest { 13 | 14 | /** 15 | * Entity point to our test. Simple read some XML which should 16 | * generate an object tree. 17 | * 18 | * @param argv The arguments passed into the test 19 | * @throws SlickXMLException Indicates a failure to parse XML or generate objects 20 | */ 21 | public static void main(String[] argv) throws SlickXMLException { 22 | ObjectTreeParser parser = new ObjectTreeParser("org.newdawn.slick.tests.xml"); 23 | parser.addElementMapping("Bag", ItemContainer.class); 24 | 25 | GameData parsedData = (GameData) parser.parse("testdata/objxmltest.xml"); 26 | parsedData.dump(""); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/mixin/mixins/blocks/MixinBlockLiquid.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.mixin.mixins.blocks; 2 | 3 | import me.lyric.infinity.Infinity; 4 | import me.lyric.infinity.api.event.blocks.CanCollideCheckEvent; 5 | import net.minecraft.block.BlockLiquid; 6 | import net.minecraft.block.state.IBlockState; 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.CallbackInfoReturnable; 11 | 12 | /** 13 | * @author lyric 14 | */ 15 | 16 | @Mixin(value = BlockLiquid.class) 17 | public class MixinBlockLiquid { 18 | 19 | @Inject(method = "canCollideCheck", at = @At("HEAD"), cancellable = true) 20 | public void canCollideCheck(final IBlockState blockState, final boolean b, final CallbackInfoReturnable ci) { 21 | CanCollideCheckEvent event = new CanCollideCheckEvent(); 22 | Infinity.eventBus.post(event); 23 | ci.setReturnValue(event.isCancelled()); 24 | } 25 | } -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/api/util/time/Timer.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.api.util.time; 2 | 3 | /** 4 | * @author lyric 5 | */ 6 | 7 | public class Timer { 8 | 9 | public long time; 10 | public Timer() { 11 | this.time = System.currentTimeMillis(); 12 | } 13 | public Timer reset(long time) { 14 | this.time = time; 15 | return this; 16 | } 17 | public long getTime() { 18 | return time; 19 | } 20 | 21 | public void setTime(long time) { 22 | this.time = time; 23 | } 24 | 25 | public void setTimer(long time) { 26 | if (time > 0.0f) { 27 | this.time = time; 28 | } 29 | } 30 | public boolean passedMs(long ms) { 31 | return passedNS(convertToNS(ms)); 32 | } 33 | public long convertToNS(long time) { 34 | return time * 1000000L; 35 | } 36 | 37 | public boolean passedNS(long ns) { 38 | return System.nanoTime() - time >= ns; 39 | } 40 | public void reset() { 41 | this.time = System.nanoTime(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/api/setting/settings/IntegerSetting.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.api.setting.settings; 2 | 3 | import me.lyric.infinity.api.setting.Setting; 4 | 5 | import java.util.function.Predicate; 6 | 7 | /** 8 | * @author lyric and vikas!! 9 | */ 10 | public class IntegerSetting extends Setting { 11 | int minimum; 12 | int maximum; 13 | 14 | public IntegerSetting(String name, int value, int minimum, int maximum) { 15 | super(name, value); 16 | this.minimum = minimum; 17 | this.maximum = maximum; 18 | } 19 | 20 | public IntegerSetting(String name, int value, int minimum, int maximum, Predicate shown) { 21 | super(name, value, shown); 22 | this.minimum = minimum; 23 | this.maximum = maximum; 24 | } 25 | 26 | @Override 27 | public Integer getValue() { 28 | return (Integer)this.value; 29 | } 30 | 31 | public int getMaximum() { 32 | return this.maximum; 33 | } 34 | 35 | public int getMinimum() { 36 | return this.minimum; 37 | } 38 | } -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/opengl/CompositeIOException.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.opengl; 2 | 3 | import java.io.IOException; 4 | import java.util.ArrayList; 5 | 6 | /** 7 | * A collection of IOException that failed image data loading 8 | * 9 | * @author kevin 10 | */ 11 | public class CompositeIOException extends IOException { 12 | /** The list of exceptions causing this one */ 13 | private ArrayList exceptions = new ArrayList(); 14 | 15 | /** 16 | * Create a new composite IO Exception 17 | */ 18 | public CompositeIOException() { 19 | super(); 20 | } 21 | 22 | /** 23 | * Add an exception that caused this exceptino 24 | * 25 | * @param e The exception 26 | */ 27 | public void addException(Exception e) { 28 | exceptions.add(e); 29 | } 30 | 31 | /** 32 | * @see java.lang.Throwable#getMessage() 33 | */ 34 | public String getMessage() { 35 | String msg = "Composite Exception: \n"; 36 | for (int i=0;i { 12 | float minimum; 13 | float maximum; 14 | 15 | public FloatSetting(String name, float value, float minimum, float maximum) { 16 | super(name, Float.valueOf(value)); 17 | this.minimum = minimum; 18 | this.maximum = maximum; 19 | } 20 | 21 | public FloatSetting(String name, float value, float minimum, float maximum, Predicate shown) { 22 | super(name, Float.valueOf(value), shown); 23 | this.minimum = minimum; 24 | this.maximum = maximum; 25 | } 26 | 27 | @Override 28 | public Float getValue() { 29 | return (Float)this.value; 30 | } 31 | 32 | public float getMaximum() { 33 | return this.maximum; 34 | } 35 | 36 | public float getMinimum() { 37 | return this.minimum; 38 | } 39 | } -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/impl/commands/ListCommand.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.impl.commands; 2 | 3 | import com.mojang.realmsclient.gui.ChatFormatting; 4 | import me.lyric.infinity.api.command.Command; 5 | import me.lyric.infinity.api.command.CommandState; 6 | import me.lyric.infinity.api.util.minecraft.chat.ChatUtils; 7 | import me.lyric.infinity.api.util.string.StringUtils; 8 | import me.lyric.infinity.manager.client.CommandManager; 9 | 10 | public class ListCommand extends Command { 11 | 12 | public ListCommand() 13 | { 14 | super("commands", "shows a list of all available commands."); 15 | } 16 | 17 | @Override 18 | public String theCommand() 19 | { 20 | return "commands"; 21 | } 22 | 23 | @Override 24 | public void onCommand(String[] args) 25 | { 26 | if(args.length > 1) 27 | { 28 | this.splash(CommandState.ERROR); 29 | return; 30 | } 31 | ChatUtils.sendMessage(ChatFormatting.GREEN + CommandManager.getCommandsAsString().toString()); 32 | this.splash(CommandState.PERFORMED); 33 | } 34 | 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/impl/modules/client/RPC.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.impl.modules.client; 2 | 3 | import me.lyric.infinity.api.module.Category; 4 | import me.lyric.infinity.api.module.Module; 5 | import me.lyric.infinity.api.module.ModuleInformation; 6 | import me.lyric.infinity.api.setting.settings.BooleanSetting; 7 | import me.lyric.infinity.api.setting.settings.StringSetting; 8 | import me.lyric.infinity.manager.client.PresenceManager; 9 | @ModuleInformation(name = "RPC", description = "Displays a Rich Presence on discord.", category = Category.Client) 10 | public class RPC extends Module { 11 | 12 | public StringSetting largeImageText = createSetting("Large Image Text", "Infinity v5"); 13 | public StringSetting details = createSetting("Details","yung n rich"); 14 | public BooleanSetting showIP = createSetting("Show IP", true); 15 | public BooleanSetting ign = createSetting("Show IGN", false); 16 | @Override 17 | public void onEnable() { 18 | PresenceManager.start(); 19 | } 20 | 21 | @Override 22 | public void onDisable() { 23 | PresenceManager.shutdown(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/command/KeyControl.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.command; 2 | 3 | /** 4 | * A control relating to a command indicate that it should be fired when a specific key is pressed 5 | * or released. 6 | * 7 | * @author joverton 8 | */ 9 | public class KeyControl implements Control { 10 | /** The key code that needs to be pressed */ 11 | private int keycode; 12 | 13 | /** 14 | * Create a new control that caused an command to be fired on a key pressed/released 15 | * 16 | * @param keycode The code of the key that causes the command 17 | */ 18 | public KeyControl(int keycode) { 19 | this.keycode = keycode; 20 | } 21 | 22 | /** 23 | * @see java.lang.Object#equals(java.lang.Object) 24 | */ 25 | public boolean equals(Object o) { 26 | if (o instanceof KeyControl) { 27 | return ((KeyControl)o).keycode == keycode; 28 | } 29 | 30 | return false; 31 | } 32 | 33 | /** 34 | * @see java.lang.Object#hashCode() 35 | */ 36 | public int hashCode() { 37 | return keycode; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/command/MouseButtonControl.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.command; 2 | 3 | /** 4 | * A control indicating that a mouse button must be pressed or released to cause an command 5 | * 6 | * @author joverton 7 | */ 8 | public class MouseButtonControl implements Control { 9 | /** The button to be pressed */ 10 | private int button; 11 | 12 | /** 13 | * Create a new control that indicates a mouse button to be pressed or released 14 | * 15 | * @param button The button that should be pressed to cause the command 16 | */ 17 | public MouseButtonControl(int button) { 18 | this.button = button; 19 | } 20 | 21 | /** 22 | * @see java.lang.Object#equals(java.lang.Object) 23 | */ 24 | public boolean equals(Object o) { 25 | if (o instanceof MouseButtonControl) 26 | { 27 | return ((MouseButtonControl)o).button == button; 28 | } 29 | 30 | return false; 31 | } 32 | 33 | /** 34 | * @see java.lang.Object#hashCode() 35 | */ 36 | public int hashCode() { 37 | return button; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/mixin/mixins/entity/MixinEntity.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.mixin.mixins.entity; 2 | 3 | import me.lyric.infinity.api.util.minecraft.IGlobals; 4 | import me.lyric.infinity.impl.modules.render.NoRender; 5 | import me.lyric.infinity.manager.Managers; 6 | import me.lyric.infinity.mixin.mixins.accessors.IEntity; 7 | import net.minecraft.entity.Entity; 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(value = {Entity.class}) 14 | public abstract class MixinEntity implements IEntity, IGlobals { 15 | 16 | @Inject(method = "isSneaking", at = @At(value = "RETURN"), cancellable = true) 17 | private void isSneaking(CallbackInfoReturnable cir) 18 | { 19 | if (mc.player != null && mc.world != null) 20 | { 21 | cir.setReturnValue(Managers.MODULES.getModuleByClass(NoRender.class).isEnabled() && Managers.MODULES.getModuleByClass(NoRender.class).sneak.getValue()); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/impl/modules/misc/AntiHunger.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.impl.modules.misc; 2 | 3 | import me.bush.eventbus.annotation.EventListener; 4 | import me.lyric.infinity.api.event.network.PacketEvent; 5 | import me.lyric.infinity.api.module.Category; 6 | import me.lyric.infinity.api.module.Module; 7 | import me.lyric.infinity.api.module.ModuleInformation; 8 | import net.minecraft.network.play.client.CPacketEntityAction; 9 | 10 | /** 11 | * @author lyric ;) 12 | */ 13 | 14 | @ModuleInformation(name = "AntiHunger", description = "Reduces hunger.", category = Category.Misc) 15 | public class AntiHunger extends Module { 16 | @EventListener 17 | public void onPacketSend(PacketEvent.Send event) { 18 | if (!nullSafe()) return; 19 | if (event.getPacket() instanceof CPacketEntityAction) { 20 | CPacketEntityAction packet = (CPacketEntityAction) event.getPacket(); 21 | if (packet.getAction() == CPacketEntityAction.Action.START_SPRINTING || packet.getAction() == CPacketEntityAction.Action.STOP_SPRINTING) { 22 | event.setCancelled(true); 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/impl/modules/render/CModifier.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.impl.modules.render; 2 | 3 | import me.lyric.infinity.api.module.Category; 4 | import me.lyric.infinity.api.module.Module; 5 | import me.lyric.infinity.api.module.ModuleInformation; 6 | import me.lyric.infinity.api.setting.settings.FloatSetting; 7 | 8 | import java.text.DecimalFormat; 9 | 10 | 11 | /** 12 | * @author lyricccc 13 | */ 14 | @ModuleInformation(name = "CModifier", description = "Changes things about crystal rendering.", category = Category.Render) 15 | public class CModifier extends Module { 16 | 17 | public FloatSetting scale = createSetting("Scale", 1f, 0f, 2f); 18 | public FloatSetting spinSpeed = createSetting("SpinSpeed", 1.0f, 0f, 5f); 19 | public FloatSetting bounceFactor = createSetting("BounceFactor", 1.0f, 0.0f, 2f); 20 | 21 | DecimalFormat format = new DecimalFormat("#.0"); 22 | 23 | @Override 24 | public String getDisplayInfo() 25 | { 26 | if (!nullSafe()) return ""; 27 | return format.format(scale.getValue()) + ", " + format.format(spinSpeed.getValue()) + ", " + format.format(bounceFactor.getValue()); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/util/pathfinding/heuristics/ManhattanHeuristic.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.util.pathfinding.heuristics; 2 | 3 | import org.newdawn.slick.util.pathfinding.AStarHeuristic; 4 | import org.newdawn.slick.util.pathfinding.Mover; 5 | import org.newdawn.slick.util.pathfinding.TileBasedMap; 6 | 7 | /** 8 | * A heuristic that drives the search based on the Manhattan distance 9 | * between the current location and the target 10 | * 11 | * @author Kevin Glass 12 | */ 13 | public class ManhattanHeuristic implements AStarHeuristic { 14 | /** The minimum movement cost from any one square to the next */ 15 | private int minimumCost; 16 | 17 | /** 18 | * Create a new heuristic 19 | * 20 | * @param minimumCost The minimum movement cost from any one square to the next 21 | */ 22 | public ManhattanHeuristic(int minimumCost) { 23 | this.minimumCost = minimumCost; 24 | } 25 | 26 | /** 27 | * @see AStarHeuristic#getCost(TileBasedMap, Mover, int, int, int, int) 28 | */ 29 | public float getCost(TileBasedMap map, Mover mover, int x, int y, int tx, 30 | int ty) { 31 | return minimumCost * (Math.abs(x-tx) + Math.abs(y-ty)); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/ControlledInputReciever.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick; 2 | 3 | /** 4 | * Description of any class capable of recieving and controlling it's own 5 | * reception of input 6 | * 7 | * You'll shouldn't really need to implement this one for your self, use one of the sub-interfaces: 8 | * 9 | * {@link InputListener} 10 | * {@link MouseListener} 11 | * {@link KeyListener} 12 | * {@link ControllerListener} 13 | * 14 | * @author kevin 15 | */ 16 | public interface ControlledInputReciever { 17 | 18 | /** 19 | * Set the input that events are being sent from 20 | * 21 | * @param input The input instance sending events 22 | */ 23 | public abstract void setInput(Input input); 24 | 25 | /** 26 | * Check if this input listener is accepting input 27 | * 28 | * @return True if the input listener should recieve events 29 | */ 30 | public abstract boolean isAcceptingInput(); 31 | 32 | /** 33 | * Notification that all input events have been sent for this frame 34 | */ 35 | public abstract void inputEnded(); 36 | 37 | /** 38 | * Notification that input is about to be processed 39 | */ 40 | public abstract void inputStarted(); 41 | 42 | } -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/ShapeFill.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick; 2 | 3 | import org.newdawn.slick.geom.Shape; 4 | import org.newdawn.slick.geom.Vector2f; 5 | 6 | /** 7 | * A filling method for a shape. This allows changing colours at shape verticies and 8 | * modify they're positions as required 9 | * 10 | * @author kevin 11 | */ 12 | public interface ShapeFill { 13 | 14 | /** 15 | * Get the colour that should be applied at the specified location 16 | * 17 | * @param shape The shape being filled 18 | * @param x The x coordinate of the point being coloured 19 | * @param y The y coordinate of the point being coloured 20 | * @return The colour that should be applied based on the control points of this gradient 21 | */ 22 | public Color colorAt(Shape shape, float x, float y); 23 | 24 | /** 25 | * Get the offset for a vertex at a given location based on it's shape 26 | * 27 | * @param shape The shape being filled 28 | * @param x The x coordinate of the point being drawn 29 | * @param y The y coordinate of the point being drawn 30 | * @return The offset to apply to this vertex 31 | */ 32 | public Vector2f getOffsetAt(Shape shape, float x, float y); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/resources/mixins.infinity.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "compatibilityLevel": "JAVA_8", 4 | "package": "me.lyric.infinity.mixin.mixins", 5 | "refmap": "mixins.infinity.refmap.json", 6 | "mixins": [ 7 | "accessors.ICPacketChat", 8 | "accessors.ICPacketPlayer", 9 | "accessors.IEntity", 10 | "accessors.IEntityPlayer", 11 | "accessors.IEntityPlayerSP", 12 | "accessors.IRenderManager", 13 | "accessors.ISPacketChat", 14 | "accessors.ISPacketPlayerPosLook", 15 | "accessors.ITimer", 16 | "blocks.MixinBlockLiquid", 17 | "entity.MixinEntity", 18 | "entity.MixinEntityLivingBase", 19 | "entity.MixinEntityOtherPlayerMP", 20 | "entity.MixinEntityPlayerSP", 21 | "entity.MixinEntityRenderer", 22 | "entity.MixinMinecraft", 23 | "gui.MixinGui", 24 | "gui.MixinGuiIngame", 25 | "gui.MixinGuiNewChat", 26 | "network.MixinCPacketUseEntity", 27 | "network.MixinNetworkManager", 28 | "network.MixinPlayerControllerMP", 29 | "render.MixinItemRenderer", 30 | "render.MixinLayerArmorBase", 31 | "render.MixinRenderEnderCrystal", 32 | "render.MixinRenderLivingBase", 33 | "render.MixinSplashProgressRun" 34 | ] 35 | } -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/util/pathfinding/PathFinder.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.util.pathfinding; 2 | 3 | /** 4 | * A description of an implementation that can find a path from one 5 | * location on a tile map to another based on information provided 6 | * by that tile map. 7 | * 8 | * @see TileBasedMap 9 | * @author Kevin Glass 10 | */ 11 | public interface PathFinder { 12 | 13 | /** 14 | * Find a path from the starting location provided (sx,sy) to the target 15 | * location (tx,ty) avoiding blockages and attempting to honour costs 16 | * provided by the tile map. 17 | * 18 | * @param mover The entity that will be moving along the path. This provides 19 | * a place to pass context information about the game entity doing the moving, e.g. 20 | * can it fly? can it swim etc. 21 | * 22 | * @param sx The x coordinate of the start location 23 | * @param sy The y coordinate of the start location 24 | * @param tx The x coordinate of the target location 25 | * @param ty Teh y coordinate of the target location 26 | * @return The path found from start to end, or null if no path can be found. 27 | */ 28 | public Path findPath(Mover mover, int sx, int sy, int tx, int ty); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/command/BasicCommand.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.command; 2 | 3 | /** 4 | * A simple named command 5 | * 6 | * @author kevin 7 | */ 8 | public class BasicCommand implements Command { 9 | /** The name of the command */ 10 | private String name; 11 | 12 | /** 13 | * Create a new basic command 14 | * 15 | * @param name The name to give this command 16 | */ 17 | public BasicCommand(String name) { 18 | this.name = name; 19 | } 20 | 21 | /** 22 | * Get the name given for this basic command 23 | * 24 | * @return The name given for this basic command 25 | */ 26 | public String getName() { 27 | return name; 28 | } 29 | 30 | /** 31 | * @see java.lang.Object#hashCode() 32 | */ 33 | public int hashCode() { 34 | return name.hashCode(); 35 | } 36 | 37 | /** 38 | * @see java.lang.Object#equals(java.lang.Object) 39 | */ 40 | public boolean equals(Object other) { 41 | if (other instanceof BasicCommand) { 42 | return ((BasicCommand) other).name.equals(name); 43 | } 44 | 45 | return false; 46 | } 47 | 48 | /** 49 | * @see java.lang.Object#toString() 50 | */ 51 | public String toString() { 52 | return "[Command="+name+"]"; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/svg/inkscape/GroupProcessor.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.svg.inkscape; 2 | 3 | import org.newdawn.slick.geom.Transform; 4 | import org.newdawn.slick.svg.Diagram; 5 | import org.newdawn.slick.svg.Loader; 6 | import org.newdawn.slick.svg.ParsingException; 7 | import org.w3c.dom.Element; 8 | 9 | /** 10 | * TODO: Document this class 11 | * 12 | * @author kevin 13 | */ 14 | public class GroupProcessor implements ElementProcessor { 15 | 16 | /** 17 | * @see org.newdawn.slick.svg.inkscape.ElementProcessor#handles(org.w3c.dom.Element) 18 | */ 19 | public boolean handles(Element element) { 20 | if (element.getNodeName().equals("g")) { 21 | return true; 22 | } 23 | return false; 24 | } 25 | 26 | /**O 27 | * @see org.newdawn.slick.svg.inkscape.ElementProcessor#process(org.newdawn.slick.svg.Loader, org.w3c.dom.Element, org.newdawn.slick.svg.Diagram, org.newdawn.slick.geom.Transform) 28 | */ 29 | public void process(Loader loader, Element element, Diagram diagram, Transform t) throws ParsingException { 30 | Transform transform = Util.getTransform(element); 31 | transform = new Transform(t, transform); 32 | 33 | loader.loadChildren(element, transform); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/util/pathfinding/AStarHeuristic.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.util.pathfinding; 2 | 3 | /** 4 | * The description of a class providing a cost for a given tile based 5 | * on a target location and entity being moved. This heuristic controls 6 | * what priority is placed on different tiles during the search for a path 7 | * 8 | * @author Kevin Glass 9 | */ 10 | public interface AStarHeuristic { 11 | 12 | /** 13 | * Get the additional heuristic cost of the given tile. This controls the 14 | * order in which tiles are searched while attempting to find a path to the 15 | * target location. The lower the cost the more likely the tile will 16 | * be searched. 17 | * 18 | * @param map The map on which the path is being found 19 | * @param mover The entity that is moving along the path 20 | * @param x The x coordinate of the tile being evaluated 21 | * @param y The y coordinate of the tile being evaluated 22 | * @param tx The x coordinate of the target location 23 | * @param ty Teh y coordinate of the target location 24 | * @return The cost associated with the given tile 25 | */ 26 | public float getCost(TileBasedMap map, Mover mover, int x, int y, int tx, int ty); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/api/event/player/MoveEvent.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.api.event.player; 2 | 3 | import me.bush.eventbus.event.Event; 4 | import net.minecraft.entity.MoverType; 5 | 6 | public class MoveEvent extends Event { 7 | private MoverType moverType; 8 | 9 | private double motionX, motionY, motionZ; 10 | 11 | public MoveEvent(MoverType type, double motionX, double motionY, double motionZ) { 12 | this.moverType = type; 13 | this.motionX = motionX; 14 | this.motionY = motionY; 15 | this.motionZ = motionZ; 16 | } 17 | public double getMotionX() { 18 | return motionX; 19 | } 20 | 21 | public double getMotionY() { 22 | return motionY; 23 | } 24 | 25 | public double getMotionZ() { 26 | return motionZ; 27 | } 28 | 29 | 30 | public void setMotionX(double motionX) { 31 | this.motionX = motionX; 32 | } 33 | 34 | public void setMotionY(double motionY) { 35 | this.motionY = motionY; 36 | } 37 | 38 | public void setMotionZ(double motionZ) { 39 | this.motionZ = motionZ; 40 | } 41 | @Override 42 | protected boolean isCancellable() { 43 | return true; 44 | } 45 | 46 | } -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/tests/xml/Entity.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.tests.xml; 2 | 3 | /** 4 | * A test example of some object data that can be configured via XML 5 | * 6 | * @author kevin 7 | */ 8 | public class Entity { 9 | /** X position for the entity */ 10 | private float x; 11 | /** Y position for the entity */ 12 | private float y; 13 | /** items held */ 14 | private Inventory invent; 15 | /** Entity statistics */ 16 | private Stats stats; 17 | 18 | /** 19 | * Called by XML parser to add a configured inventory to the entity 20 | * 21 | * @param inventory The inventory to be added 22 | */ 23 | private void add(Inventory inventory) { 24 | this.invent = inventory; 25 | } 26 | 27 | /** 28 | * Called by XML parser to add a configured statistics object to the entity 29 | * 30 | * @param stats The statistics to be added 31 | */ 32 | private void add(Stats stats) { 33 | this.stats = stats; 34 | } 35 | 36 | /** 37 | * Dump this object to sysout 38 | * 39 | * @param prefix The prefix to apply to all lines 40 | */ 41 | public void dump(String prefix) { 42 | System.out.println(prefix+"Entity "+x+","+y); 43 | invent.dump(prefix+"\t"); 44 | stats.dump(prefix+"\t"); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/mixin/mixins/render/MixinLayerArmorBase.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.mixin.mixins.render; 2 | 3 | import me.lyric.infinity.impl.modules.render.NoRender; 4 | import me.lyric.infinity.manager.Managers; 5 | import net.minecraft.client.renderer.entity.layers.LayerArmorBase; 6 | import net.minecraft.entity.EntityLivingBase; 7 | import net.minecraft.inventory.EntityEquipmentSlot; 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(LayerArmorBase.class) 14 | public class MixinLayerArmorBase { 15 | @Inject(method = "renderArmorLayer", at = @At("HEAD"), cancellable = true) 16 | public void renderArmorLayer(EntityLivingBase p_Entity, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale, EntityEquipmentSlot slotIn, CallbackInfo callbackInfo) { 17 | if(Managers.MODULES.getModuleByClass(NoRender.class).isEnabled() && Managers.MODULES.getModuleByClass(NoRender.class).NoArmor.getValue()) { 18 | callbackInfo.cancel(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/geom/Triangulator.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.geom; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * A collection of triangles 7 | * 8 | * @author kevin 9 | */ 10 | public interface Triangulator extends Serializable { 11 | 12 | /** 13 | * Get a count of the number of triangles produced 14 | * 15 | * @return The number of triangles produced 16 | */ 17 | public int getTriangleCount(); 18 | 19 | /** 20 | * Get a point on a specified generated triangle 21 | * 22 | * @param tri The index of the triangle to interegate 23 | * @param i The index of the point within the triangle to retrieve 24 | * (0 - 2) 25 | * @return The x,y coordinate pair for the point 26 | */ 27 | public float[] getTrianglePoint(int tri, int i); 28 | 29 | /** 30 | * Add a point that forms part of the outer polygon 31 | * 32 | * @param x The x coordinate of the point 33 | * @param y The y coordiante of the point 34 | */ 35 | public void addPolyPoint(float x, float y); 36 | 37 | /** 38 | * Start a hole in the polygon 39 | */ 40 | public void startHole(); 41 | 42 | /** 43 | * Run the triangulation 44 | * 45 | * @return True if successful 46 | */ 47 | public boolean triangulate(); 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/api/setting/settings/ModeSetting.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.api.setting.settings; 2 | 3 | import me.lyric.infinity.Infinity; 4 | import me.lyric.infinity.api.setting.Setting; 5 | 6 | import java.util.List; 7 | import java.util.function.Predicate; 8 | 9 | /** 10 | * @author lyric and vikas!! 11 | */ 12 | 13 | public final class ModeSetting extends Setting { 14 | public List modes; 15 | 16 | public ModeSetting(String name, String value, List modeList) { 17 | super(name, value); 18 | this.modes = modeList; 19 | } 20 | 21 | public ModeSetting(String name, String value, List modeList, Predicate shown) { 22 | super(name, value, shown); 23 | this.modes = modeList; 24 | } 25 | 26 | @Override 27 | public void setValue(String value) { 28 | for (String mode : modes) 29 | { 30 | if (mode.equalsIgnoreCase(value)) 31 | { 32 | this.value = mode; 33 | } 34 | else { 35 | Infinity.LOGGER.error("A ModeSetting may have been set incorrectly! Module: " + this.getModule() + " Value passed to the method: " + value + " All the possible values: " + modes.toString()); 36 | } 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/impl/modules/movement/AutoWalk.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.impl.modules.movement; 2 | 3 | import me.lyric.infinity.api.module.Category; 4 | import me.lyric.infinity.api.module.Module; 5 | import me.lyric.infinity.api.module.ModuleInformation; 6 | import me.lyric.infinity.api.setting.settings.BooleanSetting; 7 | import me.lyric.infinity.manager.Managers; 8 | import net.minecraftforge.client.event.InputUpdateEvent; 9 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; 10 | 11 | /** 12 | * @author lyric 13 | * what a useful module 14 | */ 15 | 16 | @ModuleInformation(name = "AutoWalk", description = "so useful", category = Category.Movement) 17 | public class AutoWalk extends Module { 18 | 19 | public BooleanSetting sprint = createSetting("Sprint", false); 20 | 21 | @SubscribeEvent 22 | public void onUpdateInput(InputUpdateEvent event) { 23 | if (!nullSafe()) return; 24 | if (sprint.getValue()) { 25 | Managers.MODULES.getModuleByClass(Sprint.class).enable(); 26 | } 27 | event.getMovementInput().moveForward = 1; 28 | } 29 | 30 | @Override 31 | public void onDisable() { 32 | if (sprint.getValue()) { 33 | Managers.MODULES.getModuleByClass(Sprint.class).disable(); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/impl/modules/misc/SkinBlink.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.impl.modules.misc; 2 | 3 | import me.lyric.infinity.api.module.Category; 4 | import me.lyric.infinity.api.module.Module; 5 | import me.lyric.infinity.api.module.ModuleInformation; 6 | import net.minecraft.entity.player.EnumPlayerModelParts; 7 | 8 | /** 9 | * @author lyric 10 | */ 11 | 12 | @ModuleInformation(name = "SkinBlink", description = "useless", category = Category.Misc) 13 | public class SkinBlink extends Module { 14 | 15 | static EnumPlayerModelParts[] PARTS_HORIZONTAL; 16 | 17 | static { 18 | PARTS_HORIZONTAL = new EnumPlayerModelParts[]{EnumPlayerModelParts.LEFT_SLEEVE, EnumPlayerModelParts.JACKET, EnumPlayerModelParts.HAT, EnumPlayerModelParts.LEFT_PANTS_LEG, EnumPlayerModelParts.RIGHT_PANTS_LEG, EnumPlayerModelParts.RIGHT_SLEEVE}; 19 | } 20 | 21 | @Override 22 | public void onUpdate() { 23 | if (!nullSafe()) return; 24 | int delay = mc.player.ticksExisted % (PARTS_HORIZONTAL.length * 2); 25 | boolean renderLayer = false; 26 | 27 | if (delay >= PARTS_HORIZONTAL.length) { 28 | renderLayer = true; 29 | delay -= PARTS_HORIZONTAL.length; 30 | } 31 | 32 | mc.gameSettings.setModelPartEnabled(PARTS_HORIZONTAL[delay], renderLayer); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/impl/modules/render/PlayerChams.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.impl.modules.render; 2 | 3 | import me.lyric.infinity.api.module.Category; 4 | import me.lyric.infinity.api.module.Module; 5 | import me.lyric.infinity.api.module.ModuleInformation; 6 | import me.lyric.infinity.api.setting.settings.BooleanSetting; 7 | import net.minecraft.entity.Entity; 8 | import net.minecraft.entity.player.EntityPlayer; 9 | 10 | @ModuleInformation(name = "PlayerChams", description = "See people thru walls.", category = Category.Render) 11 | public class PlayerChams extends Module { 12 | public BooleanSetting self = createSetting("Self", false); 13 | 14 | public boolean isValid(Entity entity) 15 | { 16 | Entity renderEntity = getEntity(); 17 | if (entity == null) 18 | { 19 | return false; 20 | } 21 | else if (!self.getValue() && entity.equals(renderEntity)) 22 | { 23 | return false; 24 | } 25 | else if (entity instanceof EntityPlayer) 26 | { 27 | return true; 28 | } 29 | else 30 | { 31 | return true; 32 | } 33 | } 34 | public static Entity getEntity() 35 | { 36 | return mc.getRenderViewEntity() == null ? mc.player : mc.getRenderViewEntity(); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/opengl/ImageData.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.opengl; 2 | 3 | import java.nio.ByteBuffer; 4 | 5 | /** 6 | * A description of any class providing ImageData in a form suitable for OpenGL texture 7 | * creation. 8 | * 9 | * @author kevin 10 | */ 11 | public interface ImageData { 12 | 13 | /** 14 | * Get the last bit depth read from a TGA 15 | * 16 | * @return The last bit depth read 17 | */ 18 | public int getDepth(); 19 | 20 | /** 21 | * Get the last width read from a TGA 22 | * 23 | * @return Get the last width in pixels fread from a TGA 24 | */ 25 | public int getWidth(); 26 | 27 | /** 28 | * Get the last height read from a TGA 29 | * 30 | * @return Get the last height in pixels fread from a TGA 31 | */ 32 | public int getHeight(); 33 | 34 | /** 35 | * Get the last required texture width for a loaded image 36 | * 37 | * @return Get the ast required texture width for a loaded image 38 | */ 39 | public int getTexWidth(); 40 | 41 | /** 42 | * Get the ast required texture height for a loaded image 43 | * 44 | * @return Get the ast required texture height for a loaded image 45 | */ 46 | public int getTexHeight(); 47 | 48 | /** 49 | * Get the store image 50 | * 51 | * @return The stored image 52 | */ 53 | public ByteBuffer getImageBufferData(); 54 | 55 | } -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/impl/commands/PrefixCommand.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.impl.commands; 2 | 3 | import com.mojang.realmsclient.gui.ChatFormatting; 4 | import me.lyric.infinity.Infinity; 5 | import me.lyric.infinity.api.command.Command; 6 | import me.lyric.infinity.api.command.CommandState; 7 | import me.lyric.infinity.api.util.minecraft.chat.ChatUtils; 8 | import me.lyric.infinity.manager.Managers; 9 | import me.lyric.infinity.manager.client.CommandManager; 10 | 11 | /** 12 | * @author lyric 13 | */ 14 | 15 | public class PrefixCommand extends Command { 16 | 17 | public PrefixCommand() { 18 | super("prefix", "Change the command prefix."); 19 | } 20 | 21 | @Override 22 | public String theCommand() { 23 | return "prefix "; 24 | } 25 | 26 | @Override 27 | public void onCommand(String[] args) { 28 | String character = null; 29 | 30 | if (args.length > 1) { 31 | character = args[1]; 32 | } 33 | 34 | if (character == null || args.length > 2) { 35 | this.splash(CommandState.ERROR); 36 | 37 | return; 38 | } 39 | 40 | CommandManager.setPrefix(character); 41 | 42 | ChatUtils.sendMessage("Prefix changed to " + ChatFormatting.WHITE + character); 43 | 44 | this.splash(CommandState.PERFORMED); 45 | } 46 | } -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/impl/modules/render/NoRender.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.impl.modules.render; 2 | 3 | import me.lyric.infinity.api.module.Category; 4 | import me.lyric.infinity.api.module.Module; 5 | import me.lyric.infinity.api.module.ModuleInformation; 6 | import me.lyric.infinity.api.setting.settings.BooleanSetting; 7 | import net.minecraft.init.MobEffects; 8 | 9 | @ModuleInformation(name = "NoRender", description = "Prevents certain things from rendering.", category = Category.Render) 10 | public class NoRender extends Module { 11 | public BooleanSetting effects = createSetting("Effects", false); 12 | public BooleanSetting weather = createSetting("Weather", false); 13 | 14 | //public BooleanSetting Fire = createSetting("Fire", "Avoids fire overlay render.", false)); 15 | public BooleanSetting NoArmor = createSetting("NoArmor", false); 16 | public BooleanSetting sneak = createSetting("Force Sneak", true); 17 | 18 | @Override 19 | public void onUpdate() { 20 | if (effects.getValue()) { 21 | mc.player.removePotionEffect(MobEffects.NAUSEA); 22 | mc.player.removePotionEffect(MobEffects.BLINDNESS); 23 | mc.player.removePotionEffect(MobEffects.UNLUCK); 24 | } 25 | if (weather.getValue()) { 26 | mc.world.setRainStrength(0.0f); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/svg/inkscape/InkscapeNonGeometricData.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.svg.inkscape; 2 | 3 | import org.newdawn.slick.svg.NonGeometricData; 4 | import org.w3c.dom.Element; 5 | 6 | /** 7 | * A custom non-geometric data type that can pass back any attribute 8 | * on the field. 9 | * 10 | * @author kevin 11 | */ 12 | public class InkscapeNonGeometricData extends NonGeometricData { 13 | /** The element read from the SVG */ 14 | private Element element; 15 | 16 | /** 17 | * Create a new non-geometric data holder 18 | * 19 | * @param metaData The metadata provided 20 | * @param element The XML element from the SVG document 21 | */ 22 | public InkscapeNonGeometricData(String metaData, Element element) { 23 | super(metaData); 24 | 25 | this.element = element; 26 | } 27 | 28 | /** 29 | * @see org.newdawn.slick.svg.NonGeometricData#getAttribute(java.lang.String) 30 | */ 31 | public String getAttribute(String attribute) { 32 | String result = super.getAttribute(attribute); 33 | if (result == null) { 34 | result = element.getAttribute(attribute); 35 | } 36 | 37 | return result; 38 | } 39 | 40 | /** 41 | * Returns the XML element that is wrapped by this instance. 42 | * 43 | * @return The XML element for this instance 44 | */ 45 | public Element getElement() { 46 | return element; 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/api/util/gl/AnimationUtils.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.api.util.gl; 2 | 3 | import me.lyric.infinity.api.util.minecraft.IGlobals; 4 | 5 | /** 6 | * @author lyric 7 | * @apiNote this is used for the GUI animations. 8 | */ 9 | public class AnimationUtils implements IGlobals { 10 | public static Integer increaseNumber(int input, int target, int delta) { 11 | if (input < target) { 12 | return input + delta; 13 | } 14 | return target; 15 | } 16 | 17 | public static Float increaseNumber(float input, float target, float delta) { 18 | if (input < target) { 19 | return input + delta; 20 | } 21 | return target; 22 | } 23 | 24 | public static Double increaseNumber(double input, double target, double delta) { 25 | if (input < target) { 26 | return input + delta; 27 | } 28 | return target; 29 | } 30 | 31 | public static Integer decreaseNumber(int input, int target, int delta) { 32 | if (input > target) { 33 | return input - delta; 34 | } 35 | return target; 36 | } 37 | 38 | public static Float decreaseNumber(float input, float target, float delta) { 39 | if (input > target) { 40 | return input - delta; 41 | } 42 | return target; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/impl/modules/render/Aspect.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.impl.modules.render; 2 | 3 | import me.bush.eventbus.annotation.EventListener; 4 | import me.bush.eventbus.annotation.ListenerPriority; 5 | import me.lyric.infinity.api.event.render.AspectEvent; 6 | import me.lyric.infinity.api.module.Category; 7 | import me.lyric.infinity.api.module.Module; 8 | import me.lyric.infinity.api.module.ModuleInformation; 9 | import me.lyric.infinity.api.setting.settings.FloatSetting; 10 | 11 | import java.text.DecimalFormat; 12 | 13 | /** 14 | * @author lyric 15 | */ 16 | 17 | @ModuleInformation(name = "Aspect", description = "Changes the aspect ratio of your game.", category = Category.Render) 18 | public class Aspect extends Module { 19 | 20 | public FloatSetting aspect = createSetting("Aspect", (float) mc.displayWidth / mc.displayHeight + 0.0f, 0.1f, 3.0f); 21 | 22 | public DecimalFormat format = new DecimalFormat("#.0"); 23 | 24 | @EventListener(priority = ListenerPriority.LOW) 25 | public void onAspect(AspectEvent event) { 26 | if (!nullSafe()) return; 27 | event.setAspect(aspect.getValue()); 28 | } 29 | @Override 30 | public String getDisplayInfo() 31 | { 32 | if(mc.player == null) 33 | { 34 | return ""; 35 | } 36 | return format.format(aspect.getValue()); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/svg/inkscape/ElementProcessor.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.svg.inkscape; 2 | 3 | import org.newdawn.slick.geom.Transform; 4 | import org.newdawn.slick.svg.Diagram; 5 | import org.newdawn.slick.svg.Loader; 6 | import org.newdawn.slick.svg.ParsingException; 7 | import org.w3c.dom.Element; 8 | 9 | /** 10 | * The description of a module which processes a single XML element from a SVG (inkscape) 11 | * document. 12 | * 13 | * @author kevin 14 | */ 15 | public interface ElementProcessor { 16 | /** 17 | * Process a document extracting all the elements that the processor is 18 | * interested in and producing appropriate diagram components for the 19 | * element. 20 | * 21 | * @param loader The loader/context of the parsing 22 | * @param element The element to be processed 23 | * @param diagram The diagram to be built 24 | * @param transform The transform to apply to all elements at this level 25 | * @throws ParsingException Indicates an invalid content to an element 26 | */ 27 | public void process(Loader loader, Element element, Diagram diagram, Transform transform) throws ParsingException; 28 | 29 | /** 30 | * Check if this processor handles the element specified 31 | * 32 | * @param element The element to check 33 | * @return True if this processor can handle the given element 34 | */ 35 | public boolean handles(Element element); 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/impl/modules/client/ClickGUI.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.impl.modules.client; 2 | 3 | import me.lyric.infinity.api.module.Category; 4 | import me.lyric.infinity.api.module.Module; 5 | import me.lyric.infinity.api.module.ModuleInformation; 6 | import me.lyric.infinity.api.setting.settings.ColorSetting; 7 | import me.lyric.infinity.api.setting.settings.FloatSetting; 8 | import me.lyric.infinity.api.setting.settings.IntegerSetting; 9 | import me.lyric.infinity.gui.Csgo.CsgoGui; 10 | import net.minecraft.client.gui.GuiScreen; 11 | 12 | import java.awt.*; 13 | 14 | @ModuleInformation(name = "ClickGUI", description = "what do you think", category = Category.Client) 15 | public class ClickGUI extends Module { 16 | public IntegerSetting scrollSpeed = createSetting("ScrollSpeed", 5, 1, 25); 17 | 18 | public FloatSetting animationSpeed = createSetting("AnimationSpeed", 5.0f, 0.0f, 25.0f); 19 | 20 | public ColorSetting color = createSetting("Colour", new Color(255, 0, 0)); 21 | 22 | public ClickGUI() 23 | { 24 | this.bind.setValue(54); 25 | } 26 | 27 | @Override 28 | public void onEnable() { 29 | mc.displayGuiScreen((GuiScreen) new CsgoGui()); 30 | } 31 | 32 | @Override 33 | public void onUpdate() { 34 | if (!(this.mc.currentScreen instanceof CsgoGui)) { 35 | this.disable(); 36 | } 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/util/LogSystem.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.util; 2 | 3 | /** 4 | * Plugin in interface for the logging of Slick 5 | * 6 | * @author kevin 7 | */ 8 | public interface LogSystem { 9 | 10 | /** 11 | * Log an error 12 | * 13 | * @param message The message describing the error 14 | * @param e The exception causing the error 15 | */ 16 | public void error(String message, Throwable e); 17 | 18 | /** 19 | * Log an error 20 | * 21 | * @param e The exception causing the error 22 | */ 23 | public void error(Throwable e); 24 | 25 | /** 26 | * Log an error 27 | * 28 | * @param message The message describing the error 29 | */ 30 | public void error(String message); 31 | 32 | /** 33 | * Log a warning 34 | * 35 | * @param message The message describing the warning 36 | */ 37 | public void warn(String message); 38 | 39 | /** 40 | * Log a warning 41 | * 42 | * @param message The message describing the warning 43 | * @param e The cause of the warning 44 | */ 45 | public void warn(String message, Throwable e); 46 | 47 | /** 48 | * Log an information message 49 | * 50 | * @param message The message describing the infomation 51 | */ 52 | public void info(String message); 53 | 54 | /** 55 | * Log a debug message 56 | * 57 | * @param message The message describing the debug 58 | */ 59 | public void debug(String message); 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/tests/StateBasedTest.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.tests; 2 | 3 | import org.newdawn.slick.AppGameContainer; 4 | import org.newdawn.slick.GameContainer; 5 | import org.newdawn.slick.SlickException; 6 | import org.newdawn.slick.state.StateBasedGame; 7 | import org.newdawn.slick.tests.states.TestState1; 8 | import org.newdawn.slick.tests.states.TestState2; 9 | import org.newdawn.slick.tests.states.TestState3; 10 | 11 | /** 12 | * A test for the multi-state based functionality 13 | * 14 | * @author kevin 15 | */ 16 | public class StateBasedTest extends StateBasedGame { 17 | 18 | /** 19 | * Create a new test 20 | */ 21 | public StateBasedTest() { 22 | super("State Based Test"); 23 | } 24 | 25 | /** 26 | * @see org.newdawn.slick.state.StateBasedGame#initStatesList(org.newdawn.slick.GameContainer) 27 | */ 28 | public void initStatesList(GameContainer container) { 29 | addState(new TestState1()); 30 | addState(new TestState2()); 31 | addState(new TestState3()); 32 | } 33 | 34 | /** 35 | * Entry point to our test 36 | * 37 | * @param argv The arguments to pass into the test 38 | */ 39 | public static void main(String[] argv) { 40 | try { 41 | AppGameContainer container = new AppGameContainer(new StateBasedTest()); 42 | container.setDisplayMode(800,600,false); 43 | container.start(); 44 | } catch (SlickException e) { 45 | e.printStackTrace(); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/mixin/MixinLoader.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.mixin; 2 | 3 | import me.lyric.infinity.rcefix.ASMTransformer; 4 | import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin; 5 | import org.spongepowered.asm.launch.MixinBootstrap; 6 | import org.spongepowered.asm.mixin.MixinEnvironment; 7 | import org.spongepowered.asm.mixin.Mixins; 8 | 9 | import javax.annotation.Nullable; 10 | import java.util.Map; 11 | public class MixinLoader implements IFMLLoadingPlugin { 12 | 13 | public MixinLoader() { 14 | MixinBootstrap.init(); 15 | Mixins.addConfiguration("mixins.infinity.json"); 16 | MixinEnvironment.getDefaultEnvironment().setObfuscationContext("searge"); 17 | } 18 | 19 | @Override 20 | public String[] getASMTransformerClass() { 21 | return new String[]{ASMTransformer.class.getName()}; 22 | } 23 | 24 | @Override 25 | public String getModContainerClass() { 26 | return null; 27 | } 28 | 29 | @Nullable 30 | @Override 31 | public String getSetupClass() { 32 | return null; 33 | } 34 | 35 | @Override 36 | public void injectData(Map data) { 37 | boolean isObfuscated = (boolean) data.get("runtimeDeobfuscationEnabled"); 38 | ASMTransformer.isObfuscated = isObfuscated; 39 | } 40 | 41 | @Override 42 | public String getAccessTransformerClass() { 43 | return null; 44 | } 45 | } -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/api/command/Command.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.api.command; 2 | 3 | import com.mojang.realmsclient.gui.ChatFormatting; 4 | import me.lyric.infinity.Infinity; 5 | import me.lyric.infinity.api.util.minecraft.chat.ChatUtils; 6 | import me.lyric.infinity.manager.Managers; 7 | 8 | /** 9 | * @author lyric -_- 10 | */ 11 | 12 | public class Command { 13 | 14 | private final String command; 15 | private final String description; 16 | 17 | public Command(String command, String description) { 18 | this.command = command; 19 | this.description = description; 20 | } 21 | 22 | public String getCommand() { 23 | return command; 24 | } 25 | 26 | public String getDescription() { 27 | return description; 28 | } 29 | 30 | public String theCommand() { 31 | return ""; 32 | } 33 | 34 | public void splash(CommandState state) { 35 | switch (state) { 36 | case ERROR: { 37 | ChatUtils.sendMessage(ChatFormatting.RED + "Invalid syntax. Try: '" + Managers.COMMANDS.getPrefix() + theCommand() + "'"); 38 | 39 | break; 40 | } 41 | 42 | case PERFORMED: { 43 | break; 44 | } 45 | } 46 | } 47 | 48 | /** 49 | * override 50 | * @param args the arguments in chat 51 | */ 52 | 53 | public void onCommand(String[] args) { 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/impl/modules/misc/NoHandshake.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.impl.modules.misc; 2 | 3 | import io.netty.buffer.Unpooled; 4 | import me.bush.eventbus.annotation.EventListener; 5 | import me.lyric.infinity.api.event.network.PacketEvent; 6 | import me.lyric.infinity.api.module.Category; 7 | import me.lyric.infinity.api.module.Module; 8 | import me.lyric.infinity.api.module.ModuleInformation; 9 | import net.minecraft.network.PacketBuffer; 10 | import net.minecraft.network.play.client.CPacketCustomPayload; 11 | import net.minecraftforge.fml.common.network.internal.FMLProxyPacket; 12 | 13 | /** 14 | * @author lyric 15 | * very useful 16 | */ 17 | 18 | @ModuleInformation(name = "NoHandshake", description = "hypixel players when", category = Category.Misc) 19 | public class NoHandshake extends Module { 20 | @EventListener 21 | public void onPacketReceive(PacketEvent.Receive event) { 22 | if (!nullSafe()) return; 23 | if (mc.isSingleplayer()) return; 24 | CPacketCustomPayload packet; 25 | if (event.getPacket() instanceof FMLProxyPacket && !mc.isSingleplayer()) { 26 | event.cancel(); 27 | } 28 | if (event.getPacket() instanceof CPacketCustomPayload && (packet = (CPacketCustomPayload) event.getPacket()).getChannelName().equals("MC|Brand")) { 29 | packet.data = new PacketBuffer(Unpooled.buffer()).writeString("vanilla"); 30 | } 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/impl/modules/render/CustomTime.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.impl.modules.render; 2 | 3 | import me.bush.eventbus.annotation.EventListener; 4 | import me.bush.eventbus.annotation.ListenerPriority; 5 | import me.lyric.infinity.api.event.misc.GameLoopEvent; 6 | import me.lyric.infinity.api.module.Category; 7 | import me.lyric.infinity.api.module.Module; 8 | import me.lyric.infinity.api.module.ModuleInformation; 9 | import me.lyric.infinity.api.setting.settings.IntegerSetting; 10 | 11 | /** 12 | * @author lyrrrric 13 | */ 14 | 15 | @ModuleInformation(name = "CustomTime", description = "Sets a world time.", category = Category.Render) 16 | public class CustomTime extends Module { 17 | 18 | public IntegerSetting time = createSetting("Time",0,0, 24000); 19 | 20 | @Override 21 | public String getDisplayInfo() 22 | { 23 | if(mc.world == null || mc.player == null) return ""; 24 | if (time.getValue() >= 12000) return "night"; 25 | if (time.getValue() > 0) 26 | { 27 | return "day"; 28 | } 29 | else 30 | { 31 | return "natural"; 32 | } 33 | } 34 | 35 | @EventListener(priority = ListenerPriority.LOW) 36 | public void onGameLoop(GameLoopEvent event) 37 | { 38 | if (mc.world != null && time.getValue() != 0) 39 | { 40 | mc.world.setWorldTime(-time.getValue()); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/api/setting/Setting.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.api.setting; 2 | 3 | import me.lyric.infinity.api.module.Module; 4 | 5 | import java.util.function.Predicate; 6 | 7 | /** 8 | * @author lyric and vikas!!! 9 | */ 10 | 11 | public class Setting { 12 | 13 | public String name; 14 | public Module module; 15 | public T value; 16 | public Predicate shown; 17 | public boolean isOpen = false; 18 | 19 | public Setting(String name) { 20 | this.name = name; 21 | } 22 | 23 | public Setting(String name, T value) { 24 | this.name = name; 25 | this.value = value; 26 | } 27 | 28 | public Setting(String name, T value, Predicate shown) { 29 | this.name = name; 30 | this.value = value; 31 | this.shown = shown; 32 | } 33 | 34 | public T getValue() { 35 | return this.value; 36 | } 37 | 38 | public void setValue(T value) { 39 | this.value = value; 40 | } 41 | 42 | public String getName() { 43 | return this.name; 44 | } 45 | 46 | public Module getModule() { 47 | return this.module; 48 | } 49 | 50 | public void setModule(Module module) { 51 | this.module = module; 52 | } 53 | 54 | public boolean isVisible() { 55 | if (this.shown == null) { 56 | return true; 57 | } 58 | return this.shown.test(this.getValue()); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/impl/modules/render/Portals.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.impl.modules.render; 2 | 3 | import me.lyric.infinity.api.module.Category; 4 | import me.lyric.infinity.api.module.Module; 5 | import me.lyric.infinity.api.module.ModuleInformation; 6 | import me.lyric.infinity.api.setting.settings.BooleanSetting; 7 | import me.lyric.infinity.mixin.mixins.accessors.IEntity; 8 | import net.minecraftforge.client.GuiIngameForge; 9 | 10 | /** 11 | * @author lyric 12 | * top ten useful modules 13 | */ 14 | @ModuleInformation(name = "Portals", description = "Changes portal stuff.", category = Category.Render) 15 | public class Portals extends Module { 16 | 17 | public BooleanSetting gui = createSetting("GUI", true); 18 | 19 | public BooleanSetting noRender = createSetting("Render", true); 20 | 21 | private boolean renderPortal = false; 22 | 23 | @Override 24 | public void onEnable() { 25 | renderPortal = GuiIngameForge.renderPortal; 26 | } 27 | 28 | @Override 29 | public void onDisable() { 30 | GuiIngameForge.renderPortal = renderPortal; 31 | } 32 | 33 | @Override 34 | public void onUpdate() { 35 | if(mc.player == null || mc.world == null) return; 36 | if (gui.getValue()) { 37 | ((IEntity) mc.player).setInPortal(false); 38 | } 39 | if (noRender.getValue()) { 40 | GuiIngameForge.renderPortal = false; 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/api/util/gl/shader/shaders/SpaceShader.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.api.util.gl.shader.shaders; 2 | 3 | import me.lyric.infinity.api.util.gl.shader.FramebufferShader; 4 | import me.lyric.infinity.api.util.minecraft.IGlobals; 5 | import org.lwjgl.opengl.GL20; 6 | 7 | /** 8 | * @author lyric 9 | */ 10 | 11 | public class SpaceShader extends FramebufferShader { 12 | 13 | public static final FramebufferShader INSTANCE = new SpaceShader("space.frag"); 14 | 15 | float time = 1.0f; 16 | 17 | public SpaceShader(String fragmentShader) { 18 | super(fragmentShader); 19 | } 20 | 21 | @Override 22 | public void setupUniforms() { 23 | this.setupUniform("texture"); 24 | this.setupUniform("texelSize"); 25 | this.setupUniform("color"); 26 | this.setupUniform("time"); 27 | this.setupUniform("resolution"); 28 | } 29 | 30 | @Override 31 | public void updateUniforms() { 32 | GL20.glUniform1i(this.getUniform("texture"), 0); 33 | GL20.glUniform2f(this.getUniform("texelSize"), 1.0f / this.mc.displayWidth * (this.radius * this.quality), 1.0f / this.mc.displayHeight * (this.radius * this.quality)); 34 | GL20.glUniform4f(this.getUniform("color"), this.red, this.green, this.blue, this.alpha); 35 | GL20.glUniform1f(this.getUniform("time"), time); 36 | GL20.glUniform2f(this.getUniform("resolution"), IGlobals.mc.displayWidth, IGlobals.mc.displayHeight); 37 | time += 0.003; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/font/effects/ConfigurableEffect.java: -------------------------------------------------------------------------------- 1 | 2 | package org.newdawn.slick.font.effects; 3 | 4 | import java.util.List; 5 | 6 | /** 7 | * An effect that has a number of configuration values. This allows the effect to be configured in the Hiero GUI and to be saved 8 | * and loaded to and from a file. 9 | * 10 | * @author Nathan Sweet 11 | */ 12 | public interface ConfigurableEffect extends Effect { 13 | /** 14 | * Returns the list of {@link Value}s for this effect. This list is not typically backed by the effect, so changes to the 15 | * values will not take affect until {@link #setValues(List)} is called. 16 | */ 17 | public List getValues(); 18 | 19 | /** 20 | * Sets the list of {@link Value}s for this effect. 21 | */ 22 | public void setValues(List values); 23 | 24 | /** 25 | * Represents a configurable value for an effect. 26 | */ 27 | static public interface Value { 28 | /** 29 | * Returns the name of the value. 30 | */ 31 | public String getName (); 32 | 33 | /** 34 | * Sets the string representation of the value. 35 | */ 36 | public void setString (String value); 37 | 38 | /** 39 | * Gets the string representation of the value. 40 | */ 41 | public String getString (); 42 | 43 | /** 44 | * Gets the object representation of the value. 45 | */ 46 | public Object getObject (); 47 | 48 | /** 49 | * Shows a dialog allowing a user to configure this value. 50 | */ 51 | public void showDialog (); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/util/FileSystemLocation.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.util; 2 | 3 | import java.io.File; 4 | import java.io.FileInputStream; 5 | import java.io.IOException; 6 | import java.io.InputStream; 7 | import java.net.URL; 8 | 9 | /** 10 | * A resource loading location that searches somewhere on the classpath 11 | * 12 | * @author kevin 13 | */ 14 | public class FileSystemLocation implements ResourceLocation { 15 | /** The root of the file system to search */ 16 | private File root; 17 | 18 | /** 19 | * Create a new resoruce location based on the file system 20 | * 21 | * @param root The root of the file system to search 22 | */ 23 | public FileSystemLocation(File root) { 24 | this.root = root; 25 | } 26 | 27 | /** 28 | * @see ResourceLocation#getResource(String) 29 | */ 30 | public URL getResource(String ref) { 31 | try { 32 | File file = new File(root, ref); 33 | if (!file.exists()) { 34 | file = new File(ref); 35 | } 36 | if (!file.exists()) { 37 | return null; 38 | } 39 | 40 | return file.toURI().toURL(); 41 | } catch (IOException e) { 42 | return null; 43 | } 44 | } 45 | 46 | /** 47 | * @see ResourceLocation#getResourceAsStream(String) 48 | */ 49 | public InputStream getResourceAsStream(String ref) { 50 | try { 51 | File file = new File(root, ref); 52 | if (!file.exists()) { 53 | file = new File(ref); 54 | } 55 | return new FileInputStream(file); 56 | } catch (IOException e) { 57 | return null; 58 | } 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/api/util/client/BlockUtil.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.api.util.client; 2 | 3 | import me.lyric.infinity.api.util.minecraft.IGlobals; 4 | import net.minecraft.entity.Entity; 5 | import net.minecraft.util.EnumFacing; 6 | import net.minecraft.util.math.BlockPos; 7 | import net.minecraft.world.IBlockAccess; 8 | 9 | import java.util.ArrayList; 10 | import java.util.List; 11 | 12 | public class BlockUtil implements IGlobals { 13 | public static List getBlocksInRadius(double range, boolean movePredict, int predictTicks) { 14 | final List posses = new ArrayList<>(); 15 | float xRange = (float)Math.round(range); 16 | float yRange = (float)Math.round(range); 17 | float zRange = (float)Math.round(range); 18 | if (movePredict) { 19 | xRange += (float)(mc.player.motionX * predictTicks); 20 | yRange += (float)(mc.player.motionY * predictTicks); 21 | zRange += (float)(mc.player.motionZ * predictTicks); 22 | } 23 | for (float x = -xRange; x <= xRange; ++x) { 24 | for (float y = -yRange; y <= yRange; ++y) { 25 | for (float z = -zRange; z <= zRange; ++z) { 26 | BlockPos position = mc.player.getPosition().add(x, y, z); 27 | if (mc.player.getDistance(position.getX() + 0.5, (position.getY() + 1), position.getZ() + 0.5) <= range) { 28 | posses.add(position); 29 | } 30 | } 31 | } 32 | } 33 | return posses; 34 | } 35 | } -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/mixin/mixins/network/MixinPlayerControllerMP.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.mixin.mixins.network; 2 | 3 | import me.lyric.infinity.api.util.minecraft.IGlobals; 4 | import me.lyric.infinity.impl.modules.player.Announcer; 5 | import me.lyric.infinity.manager.Managers; 6 | import me.lyric.infinity.mixin.transformer.IPlayerControllerMP; 7 | import net.minecraft.client.multiplayer.PlayerControllerMP; 8 | import net.minecraft.util.math.BlockPos; 9 | import org.spongepowered.asm.mixin.Mixin; 10 | import org.spongepowered.asm.mixin.gen.Accessor; 11 | import org.spongepowered.asm.mixin.gen.Invoker; 12 | import org.spongepowered.asm.mixin.injection.At; 13 | import org.spongepowered.asm.mixin.injection.Inject; 14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 15 | 16 | @Mixin(PlayerControllerMP.class) 17 | public abstract class MixinPlayerControllerMP implements IPlayerControllerMP, IGlobals { 18 | @Override 19 | @Accessor(value = "blockHitDelay") 20 | public abstract void setBlockHitDelay(int delay); 21 | 22 | @Override 23 | @Invoker("syncCurrentPlayItem") 24 | public abstract void syncItem(); 25 | 26 | @Inject(method = "onPlayerDestroyBlock" , at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;playEvent(ILnet/minecraft/util/math/BlockPos;I)V")) 27 | private void onPlayerDestroyBlock(BlockPos pos, CallbackInfoReturnable callbackInfoReturnable) { 28 | if (Managers.MODULES.getModuleByClass(Announcer.class).isEnabled()) { 29 | Managers.MODULES.getModuleByClass(Announcer.class).onBreakBlock(pos); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/openal/NullAudio.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.openal; 2 | 3 | /** 4 | * A null implementation used to provide an object reference when sound 5 | * has failed. 6 | * 7 | * @author kevin 8 | */ 9 | public class NullAudio implements Audio { 10 | /** 11 | * @see org.newdawn.slick.openal.Audio#getBufferID() 12 | */ 13 | public int getBufferID() { 14 | return 0; 15 | } 16 | 17 | /** 18 | * @see org.newdawn.slick.openal.Audio#getPosition() 19 | */ 20 | public float getPosition() { 21 | return 0; 22 | } 23 | 24 | /** 25 | * @see org.newdawn.slick.openal.Audio#isPlaying() 26 | */ 27 | public boolean isPlaying() { 28 | return false; 29 | } 30 | 31 | /** 32 | * @see org.newdawn.slick.openal.Audio#playAsMusic(float, float, boolean) 33 | */ 34 | public int playAsMusic(float pitch, float gain, boolean loop) { 35 | return 0; 36 | } 37 | 38 | /** 39 | * @see org.newdawn.slick.openal.Audio#playAsSoundEffect(float, float, boolean) 40 | */ 41 | public int playAsSoundEffect(float pitch, float gain, boolean loop) { 42 | return 0; 43 | } 44 | 45 | /** 46 | * @see org.newdawn.slick.openal.Audio#playAsSoundEffect(float, float, boolean, float, float, float) 47 | */ 48 | public int playAsSoundEffect(float pitch, float gain, boolean loop, 49 | float x, float y, float z) { 50 | return 0; 51 | } 52 | 53 | /** 54 | * @see org.newdawn.slick.openal.Audio#setPosition(float) 55 | */ 56 | public boolean setPosition(float position) { 57 | return false; 58 | } 59 | 60 | /** 61 | * @see org.newdawn.slick.openal.Audio#stop() 62 | */ 63 | public void stop() { 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/util/xml/XMLElementList.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.util.xml; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Collection; 5 | 6 | /** 7 | * A simple typed list. 8 | * 9 | * @author kevin 10 | */ 11 | public class XMLElementList { 12 | /** The list of elements */ 13 | private ArrayList list = new ArrayList(); 14 | 15 | /** 16 | * Create a new list 17 | */ 18 | public XMLElementList() { 19 | 20 | } 21 | 22 | /** 23 | * Add an element to the list 24 | * 25 | * @param element The element to be added 26 | */ 27 | public void add(XMLElement element) { 28 | list.add(element); 29 | } 30 | 31 | /** 32 | * Get the number of elements in the list 33 | * 34 | * @return The number of elements in the list 35 | */ 36 | public int size() { 37 | return list.size(); 38 | } 39 | 40 | /** 41 | * Get the element at a specified index 42 | * 43 | * @param i The index of the element 44 | * @return The element at the specified index 45 | */ 46 | public XMLElement get(int i) { 47 | return (XMLElement) list.get(i); 48 | } 49 | 50 | /** 51 | * Check if this list contains the given element 52 | * 53 | * @param element The element to check for 54 | * @return True if the element is in the list 55 | */ 56 | public boolean contains(XMLElement element) { 57 | return list.contains(element); 58 | } 59 | 60 | /** 61 | * Add all the elements in this list to another collection 62 | * 63 | * @param collection The collection the elements should be added to 64 | */ 65 | public void addAllTo(Collection collection) { 66 | collection.addAll(list); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/api/util/gl/ImageUtils.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.api.util.gl; 2 | 3 | import me.lyric.infinity.api.util.minecraft.IGlobals; 4 | import net.minecraft.client.gui.Gui; 5 | import net.minecraft.client.gui.GuiScreen; 6 | import net.minecraft.client.gui.ScaledResolution; 7 | import net.minecraft.client.renderer.GlStateManager; 8 | import net.minecraft.util.ResourceLocation; 9 | import org.lwjgl.opengl.GL11; 10 | 11 | import java.awt.image.BufferedImage; 12 | import java.nio.ByteBuffer; 13 | 14 | public class ImageUtils implements IGlobals { 15 | /** 16 | * Reads the image to a byte buffer that works with LWJGL. 17 | * @author func16 18 | */ 19 | public static ByteBuffer readImageToBuffer(BufferedImage bufferedImage){ 20 | int[] rgbArray = bufferedImage.getRGB(0, 0, bufferedImage.getWidth(), bufferedImage.getHeight(), null, 0, bufferedImage.getWidth()); 21 | 22 | ByteBuffer byteBuffer = ByteBuffer.allocateDirect(4 * rgbArray.length); 23 | for(int rgb : rgbArray){ 24 | byteBuffer.putInt(rgb << 8 | rgb >> 24 & 255); 25 | } 26 | byteBuffer.flip(); 27 | 28 | return byteBuffer; 29 | } 30 | 31 | public static void image(ResourceLocation resourceLocation, int x, int y, int width, int height) { 32 | GL11.glPushMatrix(); 33 | GlStateManager.enableAlpha(); 34 | mc.getTextureManager().bindTexture(resourceLocation); 35 | GlStateManager.color(1.0f, 1.0f, 1.0f); 36 | GuiScreen.drawScaledCustomSizeModalRect(x, y, 0.0f, 0.0f, width, height, width, height, (float)width, (float)height); 37 | GlStateManager.disableAlpha(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/tests/ImageMemTest.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.tests; 2 | 3 | import org.newdawn.slick.*; 4 | 5 | /** 6 | * A test for basic image rendering 7 | * 8 | * @author kevin 9 | */ 10 | public class ImageMemTest extends BasicGame { 11 | 12 | /** 13 | * Create a new image rendering test 14 | */ 15 | public ImageMemTest() { 16 | super("Image Memory Test"); 17 | } 18 | 19 | /** 20 | * @see org.newdawn.slick.BasicGame#init(org.newdawn.slick.GameContainer) 21 | */ 22 | public void init(GameContainer container) throws SlickException { 23 | try { 24 | Image img = new Image(2400, 2400); 25 | img.getGraphics(); 26 | img.destroy(); 27 | img = new Image(2400, 2400); 28 | img.getGraphics(); 29 | } catch (Exception ex) { 30 | ex.printStackTrace(); 31 | } 32 | } 33 | 34 | /** 35 | * @see org.newdawn.slick.BasicGame#render(org.newdawn.slick.GameContainer, org.newdawn.slick.Graphics) 36 | */ 37 | public void render(GameContainer container, Graphics g) { 38 | } 39 | 40 | /** 41 | * @see org.newdawn.slick.BasicGame#update(org.newdawn.slick.GameContainer, int) 42 | */ 43 | public void update(GameContainer container, int delta) { 44 | } 45 | 46 | /** 47 | * Entry point to our test 48 | * 49 | * @param argv The arguments to pass into the test 50 | */ 51 | public static void main(String[] argv) { 52 | try { 53 | AppGameContainer container = new AppGameContainer(new ImageMemTest()); 54 | container.setDisplayMode(800,600,false); 55 | container.start(); 56 | } catch (SlickException e) { 57 | e.printStackTrace(); 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/util/MaskUtil.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.util; 2 | 3 | import org.newdawn.slick.opengl.renderer.Renderer; 4 | import org.newdawn.slick.opengl.renderer.SGL; 5 | 6 | /** 7 | * A utility to provide full screen masking 8 | * 9 | * @author kevin 10 | */ 11 | public class MaskUtil { 12 | /** The renderer to use for all GL operations */ 13 | protected static SGL GL = Renderer.get(); 14 | 15 | /** 16 | * Start defining the screen mask. After calling this use graphics functions to 17 | * mask out the area 18 | */ 19 | public static void defineMask() { 20 | GL.glDepthMask(true); 21 | GL.glClearDepth(1); 22 | GL.glClear(SGL.GL_DEPTH_BUFFER_BIT); 23 | GL.glDepthFunc(SGL.GL_ALWAYS); 24 | GL.glEnable(SGL.GL_DEPTH_TEST); 25 | GL.glDepthMask(true); 26 | GL.glColorMask(false, false, false, false); 27 | } 28 | 29 | /** 30 | * Finish defining the screen mask 31 | */ 32 | public static void finishDefineMask() { 33 | GL.glDepthMask(false); 34 | GL.glColorMask(true, true, true, true); 35 | } 36 | 37 | /** 38 | * Start drawing only on the masked area 39 | */ 40 | public static void drawOnMask() { 41 | GL.glDepthFunc(SGL.GL_EQUAL); 42 | } 43 | 44 | /** 45 | * Start drawing only off the masked area 46 | */ 47 | public static void drawOffMask() { 48 | GL.glDepthFunc(SGL.GL_NOTEQUAL); 49 | } 50 | 51 | /** 52 | * Reset the masked area - should be done after you've finished rendering 53 | */ 54 | public static void resetMask() { 55 | GL.glDepthMask(true); 56 | GL.glClearDepth(0); 57 | GL.glClear(SGL.GL_DEPTH_BUFFER_BIT); 58 | GL.glDepthMask(false); 59 | 60 | GL.glDisable(SGL.GL_DEPTH_TEST); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/api/util/minecraft/rotation/Rotation.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.api.util.minecraft.rotation; 2 | 3 | import me.lyric.infinity.api.util.minecraft.IGlobals; 4 | import me.lyric.infinity.manager.Managers; 5 | import net.minecraft.util.math.Vec3d; 6 | 7 | /** 8 | * @author lyric 9 | */ 10 | 11 | public class Rotation implements IGlobals { 12 | 13 | private final Rotate rotate; 14 | private float yaw; 15 | private float pitch; 16 | 17 | public Rotation(float yaw, float pitch, Rotate rotate) { 18 | this.yaw = yaw; 19 | this.pitch = pitch; 20 | this.rotate = rotate; 21 | } 22 | 23 | public void updateModelRotations() { 24 | if (mc.player != null && mc.world != null) { 25 | switch (rotate) { 26 | case PACKET: 27 | mc.player.renderYawOffset = this.yaw; 28 | mc.player.rotationYawHead = this.yaw; 29 | mc.player.rotationPitch = this.pitch; 30 | Managers.ROTATIONS.setYaw(this.yaw); 31 | Managers.ROTATIONS.setPitch(this.pitch); 32 | break; 33 | case CLIENT: 34 | mc.player.rotationYaw = this.yaw; 35 | mc.player.rotationPitch = this.pitch; 36 | break; 37 | case NONE: 38 | break; 39 | } 40 | } 41 | } 42 | public static Vec3d getEyesPos() { 43 | return new Vec3d(mc.player.posX, mc.player.posY + mc.player.getEyeHeight(), mc.player.posZ); 44 | } 45 | 46 | 47 | public enum Rotate { 48 | PACKET, CLIENT, NONE 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/svg/ParsingException.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.svg; 2 | 3 | import org.newdawn.slick.SlickException; 4 | import org.w3c.dom.Element; 5 | 6 | /** 7 | * Exception indicating a failure to parse XML, giving element information 8 | * 9 | * @author kevin 10 | */ 11 | public class ParsingException extends SlickException { 12 | 13 | /** 14 | * Create a new exception 15 | * 16 | * @param nodeID The ID of the node that failed validation 17 | * @param message The description of the failure 18 | * @param cause The exception causing this one 19 | */ 20 | public ParsingException(String nodeID, String message, Throwable cause) { 21 | super("("+nodeID+") "+message, cause); 22 | } 23 | 24 | /** 25 | * Create a new exception 26 | * 27 | * @param element The element that failed validation 28 | * @param message The description of the failure 29 | * @param cause The exception causing this one 30 | */ 31 | public ParsingException(Element element, String message, Throwable cause) { 32 | super("("+element.getAttribute("id")+") "+message, cause); 33 | } 34 | 35 | /** 36 | * Create a new exception 37 | * 38 | * @param nodeID The ID of the node that failed validation 39 | * @param message The description of the failure 40 | */ 41 | public ParsingException(String nodeID, String message) { 42 | super("("+nodeID+") "+message); 43 | } 44 | 45 | /** 46 | * Create a new exception 47 | * 48 | * @param element The element that failed validation 49 | * @param message The description of the failure 50 | */ 51 | public ParsingException(Element element, String message) { 52 | super("("+element.getAttribute("id")+") "+message); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/tests/xml/ItemContainer.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.tests.xml; 2 | 3 | import java.util.ArrayList; 4 | 5 | /** 6 | * A test example of some object data that can be configured via XML 7 | * 8 | * @author kevin 9 | */ 10 | public class ItemContainer extends Item { 11 | /** The items held in this container */ 12 | private ArrayList items = new ArrayList(); 13 | 14 | /** 15 | * Called by XML parser to add a configured item to the entity 16 | * 17 | * @param item The item to be added 18 | */ 19 | private void add(Item item) { 20 | items.add(item); 21 | } 22 | 23 | /** 24 | * Called by the XML to set the name attribute. Note that set methods can 25 | * be used as well as direct field injection. In this case the setter *has* 26 | * to be used to access the protected field from the super class 27 | * 28 | * @param name The value to set 29 | */ 30 | private void setName(String name) { 31 | this.name = name; 32 | } 33 | 34 | /** 35 | * Called by the XML to set the condition attribute. Note that set methods can 36 | * be used as well as direct field injection. In this case the setter *has* 37 | * to be used to access the protected field from the super class 38 | * 39 | * @param condition The value to set 40 | */ 41 | private void setCondition(int condition) { 42 | this.condition = condition; 43 | } 44 | 45 | /** 46 | * Dump this object to sysout 47 | * 48 | * @param prefix The prefix to apply to all lines 49 | */ 50 | public void dump(String prefix) { 51 | System.out.println(prefix+"Item Container "+name+","+condition); 52 | for (int i=0;i Math.PI) { // put us in -PI to +PI space 22 | radians = radians - (Math.PI * 2.0); 23 | } 24 | if (Math.abs(radians) > Math.PI / 2) {// put us in -PI/2 to +PI/2 space 25 | radians = Math.PI - radians; 26 | } 27 | 28 | return radians; 29 | } 30 | 31 | /** 32 | * Get the sine of an angle 33 | * 34 | * @param radians The angle 35 | * @return The sine of the angle 36 | */ 37 | public static double sin(double radians) { 38 | radians = reduceSinAngle(radians); // limits angle to between -PI/2 and +PI/2 39 | if (Math.abs(radians) <= Math.PI / 4) { 40 | return Math.sin(radians); 41 | } else { 42 | return Math.cos(Math.PI / 2 - radians); 43 | } 44 | } 45 | 46 | /** 47 | * Get the cosine of an angle 48 | * 49 | * @param radians The angle 50 | * @return The cosine of the angle 51 | */ 52 | public static double cos(double radians) { 53 | return sin(radians + Math.PI / 2); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/opengl/renderer/LineStripRenderer.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.opengl.renderer; 2 | 3 | /** 4 | * The description of a class able to render line strips through 5 | * OpenGL 6 | * 7 | * @author kevin 8 | */ 9 | public interface LineStripRenderer { 10 | /** 11 | * Check if we should apply default line fixes 12 | * 13 | * @return True if we should apply GL fixes 14 | */ 15 | public abstract boolean applyGLLineFixes(); 16 | 17 | /** 18 | * Start the line strips 19 | */ 20 | public abstract void start(); 21 | 22 | /** 23 | * End the line strips 24 | */ 25 | public abstract void end(); 26 | 27 | /** 28 | * Add a vertex 29 | * 30 | * @param x The x coordinate of the vertex 31 | * @param y The y coordinate of the vertex 32 | */ 33 | public abstract void vertex(float x, float y); 34 | 35 | /** 36 | * Apply a colour to the next vertex 37 | * 38 | * @param r The red component of the colour 39 | * @param g The green component of the colour 40 | * @param b The blue component of the colour 41 | * @param a The alpha component of the colour 42 | */ 43 | public abstract void color(float r, float g, float b, float a); 44 | 45 | /** 46 | * Set the width of the lines to be drawn 47 | * 48 | * @param width The width of the lines to be drawn 49 | */ 50 | public abstract void setWidth(float width); 51 | 52 | /** 53 | * Indicate whether antialiasing should be applied 54 | * 55 | * @param antialias True if antialiasing should be applied 56 | */ 57 | public abstract void setAntiAlias(boolean antialias); 58 | 59 | /** 60 | * Indicate if we should render end caps 61 | * 62 | * @param caps True if we should render end caps 63 | */ 64 | public void setLineCaps(boolean caps); 65 | 66 | } -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/tests/LameTest.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.tests; 2 | 3 | import org.newdawn.slick.*; 4 | import org.newdawn.slick.geom.Polygon; 5 | 6 | /** 7 | * Lame test 8 | * 9 | * @author kevin 10 | */ 11 | public class LameTest extends BasicGame { 12 | /** The poly being drawn */ 13 | private Polygon poly = new Polygon(); 14 | /** The image being textured */ 15 | private Image image; 16 | 17 | /** 18 | * Create the test 19 | */ 20 | public LameTest() { 21 | super("Lame Test"); 22 | } 23 | 24 | /** 25 | * @see org.newdawn.slick.BasicGame#init(org.newdawn.slick.GameContainer) 26 | */ 27 | public void init(GameContainer container) throws SlickException { 28 | poly.addPoint(100, 100); 29 | poly.addPoint(120, 100); 30 | poly.addPoint(120, 120); 31 | poly.addPoint(100, 120); 32 | 33 | image = new Image("testdata/rocks.png"); 34 | } 35 | 36 | /** 37 | * @see org.newdawn.slick.BasicGame#update(org.newdawn.slick.GameContainer, int) 38 | */ 39 | public void update(GameContainer container, int delta) throws SlickException { 40 | } 41 | 42 | /** 43 | * @see org.newdawn.slick.Game#render(org.newdawn.slick.GameContainer, org.newdawn.slick.Graphics) 44 | */ 45 | public void render(GameContainer container, Graphics g) throws SlickException { 46 | g.setColor(Color.white); 47 | g.texture(poly, image); 48 | } 49 | 50 | /** 51 | * Entry point to our test 52 | * 53 | * @param argv The arguments to pass into the test 54 | */ 55 | public static void main(String[] argv) { 56 | try { 57 | AppGameContainer container = new AppGameContainer(new LameTest()); 58 | container.setDisplayMode(800,600,false); 59 | container.start(); 60 | } catch (SlickException e) { 61 | e.printStackTrace(); 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/util/pathfinding/navmesh/NavPath.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.util.pathfinding.navmesh; 2 | 3 | import java.util.ArrayList; 4 | 5 | /** 6 | * A path across a navigation mesh 7 | * 8 | * @author kevin 9 | */ 10 | public class NavPath { 11 | /** The list of links that form this path */ 12 | private ArrayList links = new ArrayList(); 13 | 14 | /** 15 | * Create a new path 16 | */ 17 | public NavPath() { 18 | } 19 | 20 | /** 21 | * Push a link to the end of the path 22 | * 23 | * @param link The link to the end of the path 24 | */ 25 | public void push(Link link) { 26 | links.add(link); 27 | } 28 | 29 | /** 30 | * Get the length of the path 31 | * 32 | * @return The number of steps in the path 33 | */ 34 | public int length() { 35 | return links.size(); 36 | } 37 | 38 | /** 39 | * Get the x coordinate of the given step 40 | * 41 | * @param step The index of the step to retrieve 42 | * @return The x coordinate at the given step index 43 | */ 44 | public float getX(int step) { 45 | return ((Link) links.get(step)).getX(); 46 | } 47 | 48 | /** 49 | * Get the y coordinate of the given step 50 | * 51 | * @param step The index of the step to retrieve 52 | * @return The y coordinate at the given step index 53 | */ 54 | public float getY(int step) { 55 | return ((Link) links.get(step)).getY(); 56 | } 57 | 58 | /** 59 | * Get a string representation of this instance 60 | * 61 | * @return The string representation of this instance 62 | */ 63 | public String toString() { 64 | return "[Path length="+length()+"]"; 65 | } 66 | 67 | /** 68 | * Remove a step in the path 69 | * 70 | * @param i 71 | */ 72 | public void remove(int i) { 73 | links.remove(i); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/util/pathfinding/navmesh/Link.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.util.pathfinding.navmesh; 2 | 3 | /** 4 | * A link between this space and another 5 | * 6 | * @author kevin 7 | */ 8 | public class Link { 9 | /** The x coordinate of the joining point */ 10 | private float px; 11 | /** The y coordinate of the joining point */ 12 | private float py; 13 | /** The target space we'd be linking to */ 14 | private Space target; 15 | 16 | /** 17 | * Create a new link 18 | * 19 | * @param px The x coordinate of the linking point 20 | * @param py The y coordinate of the linking point 21 | * @param target The target space we're linking to 22 | */ 23 | public Link(float px, float py, Space target) { 24 | this.px = px; 25 | this.py = py; 26 | this.target = target; 27 | } 28 | 29 | /** 30 | * Get the distance squared from this link to the given position 31 | * 32 | * @param tx The x coordinate of the target location 33 | * @param ty The y coordinate of the target location 34 | * @return The distance squared from this link to the target 35 | */ 36 | public float distance2(float tx, float ty) { 37 | float dx = tx - px; 38 | float dy = ty - py; 39 | 40 | return ((dx*dx) + (dy*dy)); 41 | } 42 | 43 | /** 44 | * Get the x coordinate of the link 45 | * 46 | * @return The x coordinate of the link 47 | */ 48 | public float getX() { 49 | return px; 50 | } 51 | 52 | /** 53 | * Get the y coordinate of the link 54 | * 55 | * @return The y coordinate of the link 56 | */ 57 | public float getY() { 58 | return py; 59 | } 60 | 61 | /** 62 | * Get the space this object links to 63 | * 64 | * @return The space this object links to 65 | */ 66 | public Space getTarget() { 67 | return target; 68 | } 69 | } -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/impl/modules/player/Delays.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.impl.modules.player; 2 | 3 | import me.lyric.infinity.api.module.Category; 4 | import me.lyric.infinity.api.module.Module; 5 | import me.lyric.infinity.api.module.ModuleInformation; 6 | import me.lyric.infinity.api.setting.settings.BooleanSetting; 7 | import me.lyric.infinity.api.setting.settings.IntegerSetting; 8 | import me.lyric.infinity.mixin.transformer.IPlayerControllerMP; 9 | 10 | import java.util.function.Predicate; 11 | 12 | /** 13 | * @author lyric 14 | * delays 15 | */ 16 | @ModuleInformation(name = "Delays", description = "we GOING FASTER out here", category = Category.Player) 17 | public class Delays extends Module { 18 | public BooleanSetting eat = createSetting("Eating", false); 19 | public BooleanSetting bk = createSetting("Breaking", false); 20 | public BooleanSetting drop = createSetting("Dropping", false); 21 | public IntegerSetting dropspeed = createSetting("Speed", 5, 0, 5, (Predicate) v -> drop.getValue()); 22 | int delay = 0; 23 | @Override 24 | public void onUpdate() 25 | { 26 | if (bk.getValue()) 27 | { 28 | IPlayerControllerMP controllerMP = (IPlayerControllerMP) mc.playerController; 29 | controllerMP.setBlockHitDelay(0); 30 | } 31 | if (drop.getValue()) 32 | { 33 | if(mc.gameSettings.keyBindDrop.isKeyDown()) 34 | { 35 | delay++; 36 | if(delay > dropspeed.getValue()) 37 | { 38 | mc.player.dropItem(false); 39 | delay = 0; 40 | } 41 | } 42 | else 43 | { 44 | delay = 0; 45 | } 46 | } 47 | } 48 | 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/rcefix/ASMTransformer.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.rcefix; 2 | 3 | import net.minecraft.launchwrapper.IClassTransformer; 4 | import org.objectweb.asm.ClassReader; 5 | import org.objectweb.asm.ClassWriter; 6 | import org.objectweb.asm.tree.ClassNode; 7 | import org.objectweb.asm.tree.MethodNode; 8 | 9 | public class ASMTransformer implements IClassTransformer { 10 | 11 | public static boolean isObfuscated = false; 12 | 13 | private boolean matches(MethodNode methodNode) { 14 | if (isObfuscated) { 15 | return methodNode.name.equals("a") && methodNode.desc.equals("(Lhh;I)V"); 16 | } else { 17 | return methodNode.name.equals("printChatMessageWithOptionalDeletion") && methodNode.desc.equals("(Lnet/minecraft/util/text/ITextComponent;I)V"); 18 | } 19 | } 20 | 21 | @Override 22 | public byte[] transform(String name, String transformedName, byte[] basicClass) { 23 | if (transformedName.equals("net.minecraft.client.gui.GuiNewChat")) { 24 | ClassNode node = new ClassNode(); 25 | ClassReader reader = new ClassReader(basicClass); 26 | reader.accept(node, ClassReader.EXPAND_FRAMES); 27 | 28 | for (MethodNode methodNode : node.methods) { 29 | if (matches(methodNode)) { 30 | 31 | for (int i = 0; i < 13; i++) { 32 | methodNode.instructions.remove(methodNode.instructions.get(11)); 33 | } 34 | } 35 | } 36 | 37 | ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS); 38 | node.accept(writer); 39 | return writer.toByteArray(); 40 | } else { 41 | return basicClass; 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/state/transition/EmptyTransition.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.state.transition; 2 | 3 | import org.newdawn.slick.GameContainer; 4 | import org.newdawn.slick.Graphics; 5 | import org.newdawn.slick.SlickException; 6 | import org.newdawn.slick.state.GameState; 7 | import org.newdawn.slick.state.StateBasedGame; 8 | 9 | /** 10 | * A transition that has no effect and instantly finishes. Used as a utility for the people 11 | * not using transitions 12 | * 13 | * @author kevin 14 | */ 15 | public class EmptyTransition implements Transition { 16 | 17 | /** 18 | * @see org.newdawn.slick.state.transition.Transition#isComplete() 19 | */ 20 | public boolean isComplete() { 21 | return true; 22 | } 23 | 24 | 25 | /** 26 | * @see org.newdawn.slick.state.transition.Transition#postRender(org.newdawn.slick.state.StateBasedGame, org.newdawn.slick.GameContainer, org.newdawn.slick.Graphics) 27 | */ 28 | public void postRender(StateBasedGame game, GameContainer container, Graphics g) throws SlickException { 29 | // no op 30 | } 31 | 32 | /** 33 | * @see org.newdawn.slick.state.transition.Transition#preRender(org.newdawn.slick.state.StateBasedGame, org.newdawn.slick.GameContainer, org.newdawn.slick.Graphics) 34 | */ 35 | public void preRender(StateBasedGame game, GameContainer container, Graphics g) throws SlickException { 36 | // no op 37 | } 38 | 39 | /** 40 | * @see org.newdawn.slick.state.transition.Transition#update(org.newdawn.slick.state.StateBasedGame, org.newdawn.slick.GameContainer, int) 41 | */ 42 | public void update(StateBasedGame game, GameContainer container, int delta) throws SlickException { 43 | // no op 44 | } 45 | 46 | 47 | public void init(GameState firstState, GameState secondState) { 48 | // TODO Auto-generated method stub 49 | 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/impl/modules/misc/AutoRespawn.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.impl.modules.misc; 2 | 3 | import com.mojang.realmsclient.gui.ChatFormatting; 4 | import me.lyric.infinity.api.module.Category; 5 | import me.lyric.infinity.api.module.Module; 6 | import me.lyric.infinity.api.module.ModuleInformation; 7 | import me.lyric.infinity.api.setting.settings.BooleanSetting; 8 | import me.lyric.infinity.api.util.minecraft.chat.ChatUtils; 9 | import net.minecraft.client.gui.GuiGameOver; 10 | import net.minecraftforge.client.event.GuiOpenEvent; 11 | import net.minecraftforge.fml.common.eventhandler.EventPriority; 12 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; 13 | 14 | /** 15 | * @author who knows 16 | */ 17 | 18 | @ModuleInformation(name = "AutoRespawn", description = "useful", category = Category.Misc) 19 | public class AutoRespawn extends Module { 20 | 21 | public BooleanSetting message = createSetting("Message", true); 22 | @SubscribeEvent(priority = EventPriority.LOWEST) 23 | public void onDisplayDeathScreen(GuiOpenEvent event) { 24 | if (event.getGui() instanceof GuiGameOver) { 25 | if (message.getValue()) { 26 | ChatUtils.sendOverwriteMessage(ChatFormatting.WHITE + "[" + ChatFormatting.BOLD + "AutoRespawn" + ChatFormatting.RESET + ChatFormatting.WHITE + "]" + ChatFormatting.DARK_RED + " You died at: " + ChatFormatting.RESET + ChatFormatting.GREEN + ChatFormatting.BOLD + "X: " + (int) mc.player.posX + " " + "Y: " + (int) mc.player.posY + " " + "Z: " + (int) mc.player.posZ + ChatFormatting.RESET); 27 | } 28 | if ((mc.player.getHealth() <= 0) || (mc.player.getHealth() > 0) 29 | ) { 30 | event.setCanceled(true); 31 | mc.player.respawnPlayer(); 32 | } 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/svg/inkscape/RectProcessor.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.svg.inkscape; 2 | 3 | import org.newdawn.slick.geom.Rectangle; 4 | import org.newdawn.slick.geom.Shape; 5 | import org.newdawn.slick.geom.Transform; 6 | import org.newdawn.slick.svg.*; 7 | import org.w3c.dom.Element; 8 | 9 | /** 10 | * A processor for the element. 11 | * 12 | * @author kevin 13 | */ 14 | public class RectProcessor implements ElementProcessor { 15 | 16 | /** 17 | * @see org.newdawn.slick.svg.inkscape.ElementProcessor#process(org.newdawn.slick.svg.Loader, org.w3c.dom.Element, org.newdawn.slick.svg.Diagram, org.newdawn.slick.geom.Transform) 18 | */ 19 | public void process(Loader loader, Element element, Diagram diagram, Transform t) throws ParsingException { 20 | Transform transform = Util.getTransform(element); 21 | transform = new Transform(t, transform); 22 | 23 | float width = Float.parseFloat(element.getAttribute("width")); 24 | float height = Float.parseFloat(element.getAttribute("height")); 25 | float x = Float.parseFloat(element.getAttribute("x")); 26 | float y = Float.parseFloat(element.getAttribute("y")); 27 | 28 | Rectangle rect = new Rectangle(x,y,width+1,height+1); 29 | Shape shape = rect.transform(transform); 30 | 31 | NonGeometricData data = Util.getNonGeometricData(element); 32 | data.addAttribute("width", ""+width); 33 | data.addAttribute("height", ""+height); 34 | data.addAttribute("x", ""+x); 35 | data.addAttribute("y", ""+y); 36 | 37 | diagram.addFigure(new Figure(Figure.RECTANGLE, shape, data, transform)); 38 | } 39 | 40 | /** 41 | * @see org.newdawn.slick.svg.inkscape.ElementProcessor#handles(org.w3c.dom.Element) 42 | */ 43 | public boolean handles(Element element) { 44 | if (element.getNodeName().equals("rect")) { 45 | return true; 46 | } 47 | 48 | return false; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/impl/modules/player/HitboxDesync.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.impl.modules.player; 2 | 3 | import me.lyric.infinity.api.module.Category; 4 | import me.lyric.infinity.api.module.Module; 5 | import me.lyric.infinity.api.module.ModuleInformation; 6 | import net.minecraft.util.EnumFacing; 7 | import net.minecraft.util.math.AxisAlignedBB; 8 | import net.minecraft.util.math.BlockPos; 9 | import net.minecraft.util.math.MathHelper; 10 | import net.minecraft.util.math.Vec3d; 11 | 12 | import static net.minecraft.util.math.MathHelper.abs; 13 | 14 | /** 15 | * @author cattyn and mironov ig? 16 | requires you to look at the +X or +Z dirs 17 | maybe automatically rotate the player to look at that dir when active? 18 | */ 19 | @ModuleInformation(name = "HitboxDesync", description = "we BEING WEIRD out here", category = Category.Player) 20 | public class HitboxDesync extends Module { 21 | private static final double MAGIC_OFFSET = .200009968835369999878673424677777777777761; 22 | @Override 23 | public void onTick() { 24 | if (mc.world == null) return; 25 | EnumFacing f = mc.player.getHorizontalFacing(); 26 | AxisAlignedBB bb = mc.player.getEntityBoundingBox(); 27 | Vec3d center = bb.getCenter(); 28 | Vec3d offset = new Vec3d(f.getDirectionVec()); 29 | 30 | Vec3d fin = merge(new Vec3d(new BlockPos(MathHelper.floor(center.x), MathHelper.floor(center.y), MathHelper.floor(center.z))).add(.5, 0, .5).add(offset.scale(MAGIC_OFFSET)), f); 31 | mc.player.setPosition(fin.x == 0 ? mc.player.posX : fin.x, mc.player.posY, fin.z == 0 ? mc.player.posZ : fin.z); 32 | disable(); 33 | } 34 | 35 | private Vec3d merge(Vec3d a, EnumFacing facing) { 36 | return new Vec3d(a.x * abs(facing.getDirectionVec().getX()), a.y * abs(facing.getDirectionVec().getY()), a.z * abs(facing.getDirectionVec().getZ())); 37 | } 38 | } -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/Game.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick; 2 | 3 | /** 4 | * The main game interface that should be implemented by any game being developed 5 | * using the container system. There will be some utility type sub-classes as development 6 | * continues. 7 | * 8 | * @see org.newdawn.slick.BasicGame 9 | * 10 | * @author kevin 11 | */ 12 | public interface Game { 13 | /** 14 | * Initialise the game. This can be used to load static resources. It's called 15 | * before the game loop starts 16 | * 17 | * @param container The container holding the game 18 | * @throws SlickException Throw to indicate an internal error 19 | */ 20 | public void init(GameContainer container) throws SlickException; 21 | 22 | /** 23 | * Update the game logic here. No rendering should take place in this method 24 | * though it won't do any harm. 25 | * 26 | * @param container The container holing this game 27 | * @param delta The amount of time thats passed since last update in milliseconds 28 | * @throws SlickException Throw to indicate an internal error 29 | */ 30 | public void update(GameContainer container, int delta) throws SlickException; 31 | 32 | /** 33 | * Render the game's screen here. 34 | * 35 | * @param container The container holing this game 36 | * @param g The graphics context that can be used to render. However, normal rendering 37 | * routines can also be used. 38 | * @throws SlickException Throw to indicate a internal error 39 | */ 40 | public void render(GameContainer container, Graphics g) throws SlickException; 41 | 42 | /** 43 | * Notification that a game close has been requested 44 | * 45 | * @return True if the game should close 46 | */ 47 | public boolean closeRequested(); 48 | 49 | /** 50 | * Get the title of this game 51 | * 52 | * @return The title of the game 53 | */ 54 | public String getTitle(); 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/font/effects/FilterEffect.java: -------------------------------------------------------------------------------- 1 | 2 | package org.newdawn.slick.font.effects; 3 | 4 | import org.newdawn.slick.UnicodeFont; 5 | import org.newdawn.slick.font.Glyph; 6 | 7 | import java.awt.*; 8 | import java.awt.image.BufferedImage; 9 | import java.awt.image.BufferedImageOp; 10 | 11 | /** 12 | * Applys a {@link BufferedImageOp} filter to glyphs. Many filters can be found 13 | * here: http://www.jhlabs.com/ip/filters/index.html 14 | * 15 | * @author Nathan Sweet 16 | */ 17 | public class FilterEffect implements Effect { 18 | /** The filter to be applied */ 19 | private BufferedImageOp filter; 20 | 21 | /** 22 | * Default constructor for injection 23 | */ 24 | public FilterEffect () { 25 | } 26 | 27 | /** 28 | * Create a new filtering effect based on a convolution operation 29 | * 30 | * @param filter The filter to apply 31 | */ 32 | public FilterEffect (BufferedImageOp filter) { 33 | this.filter = filter; 34 | } 35 | 36 | /** 37 | * @see org.newdawn.slick.font.effects.Effect#draw(java.awt.image.BufferedImage, java.awt.Graphics2D, org.newdawn.slick.UnicodeFont, org.newdawn.slick.font.Glyph) 38 | */ 39 | public void draw(BufferedImage image, Graphics2D g, UnicodeFont unicodeFont, Glyph glyph) { 40 | BufferedImage scratchImage = EffectUtil.getScratchImage(); 41 | filter.filter(image, scratchImage); 42 | image.getGraphics().drawImage(scratchImage, 0, 0, null); 43 | } 44 | 45 | /** 46 | * Get the filter being applied by this effect 47 | * 48 | * @return The filter being applied by this effect 49 | */ 50 | public BufferedImageOp getFilter() { 51 | return filter; 52 | } 53 | 54 | /** 55 | * Set the filter being applied by this effect 56 | * 57 | * @param filter The filter being used by this effect 58 | */ 59 | public void setFilter(BufferedImageOp filter) { 60 | this.filter = filter; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/manager/client/FriendManager.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.manager.client; 2 | 3 | import com.mojang.realmsclient.gui.ChatFormatting; 4 | import me.lyric.infinity.api.util.minecraft.chat.ChatUtils; 5 | 6 | import java.util.ArrayList; 7 | import java.util.Objects; 8 | 9 | public class FriendManager { 10 | 11 | public ArrayList friendList; 12 | 13 | public FriendManager() { 14 | friendList = new ArrayList<>(); 15 | } 16 | 17 | public void addFriend(String name) { 18 | if (!isFriend(name)) { 19 | friendList.add(new FriendPlayer(name)); 20 | ChatUtils.sendMessage(ChatFormatting.AQUA + name + " has been added to your friend list."); 21 | } 22 | else 23 | { 24 | ChatUtils.sendMessage(ChatFormatting.RED + name + " is already a friend!"); 25 | } 26 | } 27 | 28 | public void removeFriend(String name) { 29 | if (!isFriend(name)) 30 | { 31 | ChatUtils.sendMessage(ChatFormatting.RED + name + " is not a friend!"); 32 | return; 33 | } 34 | for(FriendPlayer player : friendList) 35 | { 36 | if (Objects.equals(player.getName(), name)) 37 | { 38 | ChatUtils.sendMessage(ChatFormatting.GREEN + name + " has been deleted from your friend list."); 39 | friendList.remove(player); 40 | } 41 | } 42 | } 43 | 44 | public boolean isFriend(String name) { 45 | return friendList.stream().anyMatch(player -> player.getName().equals(name)); 46 | } 47 | 48 | public static class FriendPlayer 49 | { 50 | String name; 51 | 52 | public FriendPlayer(final String name) { 53 | this.name = name; 54 | } 55 | 56 | public String getName() { 57 | return this.name; 58 | } 59 | } 60 | 61 | } -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/tests/DoubleClickTest.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.tests; 2 | 3 | import org.newdawn.slick.*; 4 | 5 | /** 6 | * The double click testing 7 | * 8 | * @author kevin 9 | */ 10 | public class DoubleClickTest extends BasicGame { 11 | 12 | /** 13 | * Create the test game 14 | */ 15 | public DoubleClickTest() { 16 | super("Double Click Test"); 17 | } 18 | 19 | /** The test message to display */ 20 | private String message = "Click or Double Click"; 21 | 22 | /** 23 | * @see org.newdawn.slick.BasicGame#init(org.newdawn.slick.GameContainer) 24 | */ 25 | public void init(GameContainer container) throws SlickException { 26 | } 27 | 28 | /** 29 | * @see org.newdawn.slick.BasicGame#update(org.newdawn.slick.GameContainer, int) 30 | */ 31 | public void update(GameContainer container, int delta) throws SlickException { 32 | } 33 | 34 | /** 35 | * @see org.newdawn.slick.Game#render(org.newdawn.slick.GameContainer, org.newdawn.slick.Graphics) 36 | */ 37 | public void render(GameContainer container, Graphics g) throws SlickException { 38 | g.drawString(message, 100, 100); 39 | } 40 | 41 | /** 42 | * Entry point to our test 43 | * 44 | * @param argv The arguments to pass into the test, not used here 45 | */ 46 | public static void main(String[] argv) { 47 | try { 48 | AppGameContainer container = new AppGameContainer(new DoubleClickTest()); 49 | container.setDisplayMode(800,600,false); 50 | container.start(); 51 | } catch (SlickException e) { 52 | e.printStackTrace(); 53 | } 54 | } 55 | 56 | /** 57 | * @see org.newdawn.slick.BasicGame#mouseClicked(int, int, int, int) 58 | */ 59 | public void mouseClicked(int button, int x, int y, int clickCount) { 60 | if (clickCount == 1) { 61 | message = "Single Click: "+button+" "+x+","+y; 62 | } 63 | if (clickCount == 2) { 64 | message = "Double Click: "+button+" "+x+","+y; 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/tests/TransparentColorTest.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.tests; 2 | 3 | import org.newdawn.slick.*; 4 | 5 | /** 6 | * A test for transparent colour specification 7 | * 8 | * @author kevin 9 | */ 10 | public class TransparentColorTest extends BasicGame { 11 | /** The image we're currently displaying */ 12 | private Image image; 13 | /** The image we're currently displaying */ 14 | private Image timage; 15 | 16 | /** 17 | * Create a new image rendering test 18 | */ 19 | public TransparentColorTest() { 20 | super("Transparent Color Test"); 21 | } 22 | 23 | /** 24 | * @see org.newdawn.slick.BasicGame#init(org.newdawn.slick.GameContainer) 25 | */ 26 | public void init(GameContainer container) throws SlickException { 27 | image = new Image("testdata/transtest.png"); 28 | timage = new Image("testdata/transtest.png",new Color(94,66,41,255)); 29 | } 30 | 31 | /** 32 | * @see org.newdawn.slick.BasicGame#render(org.newdawn.slick.GameContainer, org.newdawn.slick.Graphics) 33 | */ 34 | public void render(GameContainer container, Graphics g) { 35 | g.setBackground(Color.red); 36 | image.draw(10,10); 37 | timage.draw(10,310); 38 | } 39 | 40 | /** 41 | * @see org.newdawn.slick.BasicGame#update(org.newdawn.slick.GameContainer, int) 42 | */ 43 | public void update(GameContainer container, int delta) { 44 | } 45 | 46 | /** 47 | * Entry point to our test 48 | * 49 | * @param argv The arguments to pass into the test 50 | */ 51 | public static void main(String[] argv) { 52 | try { 53 | AppGameContainer container = new AppGameContainer(new TransparentColorTest()); 54 | container.setDisplayMode(800,600,false); 55 | container.start(); 56 | } catch (SlickException e) { 57 | e.printStackTrace(); 58 | } 59 | } 60 | 61 | /** 62 | * @see org.newdawn.slick.BasicGame#keyPressed(int, char) 63 | */ 64 | public void keyPressed(int key, char c) { 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/impl/modules/movement/InstantSpeed.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.impl.modules.movement; 2 | 3 | import com.mojang.realmsclient.gui.ChatFormatting; 4 | import me.bush.eventbus.annotation.EventListener; 5 | import me.lyric.infinity.api.event.player.MoveEvent; 6 | import me.lyric.infinity.api.module.Category; 7 | import me.lyric.infinity.api.module.Module; 8 | import me.lyric.infinity.api.module.ModuleInformation; 9 | import me.lyric.infinity.api.setting.settings.BooleanSetting; 10 | import me.lyric.infinity.api.util.client.EntityUtil; 11 | import me.lyric.infinity.api.util.client.SpeedUtil; 12 | 13 | @ModuleInformation(name = "InstantSpeed", description = "we GOING TOO FAST out here", category = Category.Movement) 14 | public class InstantSpeed extends Module { 15 | 16 | public BooleanSetting air = createSetting("Air", false); 17 | 18 | public BooleanSetting keycheck = createSetting("Key", false); 19 | 20 | public boolean pause = false; 21 | private boolean pauseLocal = false; 22 | 23 | @Override 24 | public String getDisplayInfo() 25 | { 26 | if(!nullSafe()) return ""; 27 | if(pause || pauseLocal) 28 | { 29 | return ChatFormatting.RED + "false"; 30 | } 31 | return ChatFormatting.GREEN + "true"; 32 | } 33 | 34 | @Override 35 | public void onUpdate() 36 | { 37 | pauseLocal = EntityUtil.isInLiquid() || mc.player.noClip || mc.player.isElytraFlying() || mc.player.isSpectator() || mc.player.isSneaking(); 38 | } 39 | 40 | @EventListener 41 | public void onMove(MoveEvent e) { 42 | if (pause || pauseLocal) { 43 | return; 44 | } 45 | if ((keycheck.getValue() && !SpeedUtil.anyMovementKeys()) || (air.getValue() && !mc.player.onGround)) 46 | { 47 | return; 48 | } 49 | SpeedUtil.instant(e, SpeedUtil.getSpeed()); 50 | } 51 | 52 | 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/muffin/FileMuffin.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.muffin; 2 | 3 | import org.newdawn.slick.util.Log; 4 | 5 | import java.io.*; 6 | import java.util.HashMap; 7 | 8 | /** 9 | * An implementation of the muffin load/save mechanism based around using the 10 | * local file system. 11 | * 12 | * @author kappaOne 13 | */ 14 | public class FileMuffin implements Muffin { 15 | 16 | /** 17 | * @see org.newdawn.slick.muffin.Muffin#saveFile(java.util.HashMap, 18 | * java.lang.String) 19 | */ 20 | public void saveFile(HashMap scoreMap, String fileName) throws IOException { 21 | String userHome = System.getProperty("user.home"); 22 | File file = new File(userHome); 23 | file = new File(file, ".java"); 24 | if (!file.exists()) { 25 | file.mkdir(); 26 | } 27 | 28 | file = new File(file, fileName); 29 | FileOutputStream fos = new FileOutputStream(file); 30 | ObjectOutputStream oos = new ObjectOutputStream(fos); 31 | 32 | // save hashMap 33 | oos.writeObject(scoreMap); 34 | 35 | oos.close(); 36 | } 37 | 38 | /** 39 | * @see org.newdawn.slick.muffin.Muffin#loadFile(java.lang.String) 40 | */ 41 | public HashMap loadFile(String fileName) throws IOException { 42 | HashMap hashMap = new HashMap(); 43 | String userHome = System.getProperty("user.home"); 44 | 45 | File file = new File(userHome); 46 | file = new File(file, ".java"); 47 | file = new File(file, fileName); 48 | 49 | if (file.exists()) { 50 | try { 51 | FileInputStream fis = new FileInputStream(file); 52 | ObjectInputStream ois = new ObjectInputStream(fis); 53 | 54 | hashMap = (HashMap) ois.readObject(); 55 | 56 | ois.close(); 57 | 58 | } catch (EOFException e) { 59 | // End of the file reached, do nothing 60 | } catch (ClassNotFoundException e) { 61 | Log.error(e); 62 | throw new IOException("Failed to pull state from store - class not found"); 63 | } 64 | } 65 | 66 | return hashMap; 67 | } 68 | } -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/svg/RadialGradientFill.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.svg; 2 | 3 | import org.newdawn.slick.geom.Shape; 4 | import org.newdawn.slick.geom.TexCoordGenerator; 5 | import org.newdawn.slick.geom.Transform; 6 | import org.newdawn.slick.geom.Vector2f; 7 | 8 | /** 9 | * A filler to apply a SVG radial gradient across a shape 10 | * 11 | * @author kevin 12 | */ 13 | public class RadialGradientFill implements TexCoordGenerator { 14 | /** The centre of the gradient */ 15 | private Vector2f centre; 16 | /** The radius before the gradient is complete */ 17 | private float radius; 18 | /** The gradient to apply */ 19 | private Gradient gradient; 20 | /** The shape being filled */ 21 | private Shape shape; 22 | 23 | /** 24 | * Create a new fill for a radial gradient 25 | * 26 | * @param shape The shape being filled 27 | * @param trans The transform given for the shape in the SVG 28 | * @param gradient The gradient to apply across the shape 29 | */ 30 | public RadialGradientFill(Shape shape, Transform trans, Gradient gradient) { 31 | this.gradient = gradient; 32 | 33 | radius = gradient.getR(); 34 | float x = gradient.getX1(); 35 | float y = gradient.getY1(); 36 | 37 | float[] c = new float[] {x,y}; 38 | gradient.getTransform().transform(c, 0, c, 0, 1); 39 | trans.transform(c, 0, c, 0, 1); 40 | float[] rt = new float[] {x,y-radius}; 41 | gradient.getTransform().transform(rt, 0, rt, 0, 1); 42 | trans.transform(rt, 0, rt, 0, 1); 43 | 44 | centre = new Vector2f(c[0],c[1]); 45 | Vector2f dis = new Vector2f(rt[0],rt[1]); 46 | radius = dis.distance(centre); 47 | } 48 | 49 | /** 50 | * @see org.newdawn.slick.geom.TexCoordGenerator#getCoordFor(float, float) 51 | */ 52 | public Vector2f getCoordFor(float x, float y) { 53 | float u = centre.distance(new Vector2f(x,y)); 54 | u /= radius; 55 | 56 | if (u > 0.99f) { 57 | u = 0.99f; 58 | } 59 | 60 | return new Vector2f(u,0); 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/Infinity.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity; 2 | 3 | import me.bush.eventbus.bus.EventBus; 4 | import me.bush.eventbus.handler.handlers.LambdaHandler; 5 | import me.lyric.infinity.api.util.gl.SplashProgress; 6 | import me.lyric.infinity.api.util.string.ClientFont; 7 | import me.lyric.infinity.manager.Managers; 8 | import net.minecraftforge.fml.common.Mod; 9 | import net.minecraftforge.fml.common.event.FMLInitializationEvent; 10 | import org.apache.logging.log4j.LogManager; 11 | import org.apache.logging.log4j.Logger; 12 | import org.lwjgl.opengl.Display; 13 | 14 | @Mod( 15 | modid = "infinity", 16 | version = "v5" 17 | ) 18 | 19 | public class Infinity { 20 | public static final Logger LOGGER = LogManager.getLogger("Infinity"); 21 | 22 | public static ClientFont infinityFont; 23 | 24 | public static EventBus eventBus = new EventBus(LambdaHandler.class, Infinity.LOGGER::error, Infinity.LOGGER::info); 25 | 26 | public String version = "v5"; 27 | 28 | @Mod.Instance 29 | public static Infinity INSTANCE; 30 | 31 | @Mod.EventHandler 32 | public void init(FMLInitializationEvent event) { 33 | this.whoosh("Infinity"); 34 | } 35 | 36 | public void whoosh(String whoosh) { 37 | SplashProgress.setProgress(1, "Initializing Minecraft"); 38 | LOGGER.info("Initialising Infinity."); 39 | Display.setTitle("Infinity " + version); 40 | LOGGER.info("Attempted to set window title."); 41 | Managers.init(); 42 | infinityFont = new ClientFont("Comfortaa-Regular", 17.0f); 43 | LOGGER.info("Infinity has set its font."); 44 | LOGGER.info("Infinity fully initialised!"); 45 | 46 | Runtime.getRuntime().addShutdownHook(new Thread("Infinity ShutdownHook") { 47 | @Override 48 | public void run() { 49 | Managers.unload(); 50 | LOGGER.info("Infinity shutdown success!"); 51 | } 52 | }); 53 | } 54 | } -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/svg/inkscape/EllipseProcessor.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.svg.inkscape; 2 | 3 | import org.newdawn.slick.geom.Ellipse; 4 | import org.newdawn.slick.geom.Shape; 5 | import org.newdawn.slick.geom.Transform; 6 | import org.newdawn.slick.svg.*; 7 | import org.w3c.dom.Element; 8 | 9 | /** 10 | * Processor for and nodes marked as arcs 11 | * 12 | * @author kevin 13 | */ 14 | public class EllipseProcessor implements ElementProcessor { 15 | 16 | /** 17 | * @see org.newdawn.slick.svg.inkscape.ElementProcessor#process(org.newdawn.slick.svg.Loader, org.w3c.dom.Element, org.newdawn.slick.svg.Diagram, org.newdawn.slick.geom.Transform) 18 | */ 19 | public void process(Loader loader, Element element, Diagram diagram, Transform t) throws ParsingException { 20 | Transform transform = Util.getTransform(element); 21 | transform = new Transform(t, transform); 22 | 23 | float x = Util.getFloatAttribute(element,"cx"); 24 | float y = Util.getFloatAttribute(element,"cy"); 25 | float rx = Util.getFloatAttribute(element,"rx"); 26 | float ry = Util.getFloatAttribute(element,"ry"); 27 | 28 | Ellipse ellipse = new Ellipse(x,y,rx,ry); 29 | Shape shape = ellipse.transform(transform); 30 | 31 | NonGeometricData data = Util.getNonGeometricData(element); 32 | data.addAttribute("cx", ""+x); 33 | data.addAttribute("cy", ""+y); 34 | data.addAttribute("rx", ""+rx); 35 | data.addAttribute("ry", ""+ry); 36 | 37 | diagram.addFigure(new Figure(Figure.ELLIPSE, shape, data, transform)); 38 | } 39 | 40 | /** 41 | * @see org.newdawn.slick.svg.inkscape.ElementProcessor#handles(org.w3c.dom.Element) 42 | */ 43 | public boolean handles(Element element) { 44 | if (element.getNodeName().equals("ellipse")) { 45 | return true; 46 | } 47 | if (element.getNodeName().equals("path")) { 48 | if ("arc".equals(element.getAttributeNS(Util.SODIPODI, "type"))) { 49 | return true; 50 | } 51 | } 52 | 53 | return false; 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/impl/modules/render/Swing.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.impl.modules.render; 2 | 3 | import me.lyric.infinity.api.module.Category; 4 | import me.lyric.infinity.api.module.Module; 5 | import me.lyric.infinity.api.module.ModuleInformation; 6 | import me.lyric.infinity.api.setting.settings.BooleanSetting; 7 | import me.lyric.infinity.api.setting.settings.ModeSetting; 8 | import me.lyric.infinity.mixin.transformer.IItemRenderer; 9 | 10 | import java.util.Arrays; 11 | 12 | @ModuleInformation(name = "Swing", description = "Modifies Swing.", category = Category.Render) 13 | public class Swing extends Module { 14 | public ModeSetting swing = createSetting("Swing","Mainhand", Arrays.asList("Mainhand", "Offhand", "None")); 15 | public BooleanSetting slowSwing = createSetting("SlowSwing", false); 16 | public BooleanSetting instantSwap = createSetting("InstantSwap", false); 17 | 18 | @Override 19 | public void onUpdate(){ 20 | if (mc.player == null) 21 | { 22 | return; 23 | } 24 | 25 | if (instantSwap.getValue()) { 26 | 27 | if (((IItemRenderer)mc.entityRenderer.itemRenderer).getprevEquippedProgressMainHand() >= 0.9) { 28 | ((IItemRenderer)mc.entityRenderer.itemRenderer).setequippedProgressMainHand(1.0f); 29 | ((IItemRenderer)mc.entityRenderer.itemRenderer).setitemStackMainHand(mc.player.getHeldItemMainhand()); 30 | } 31 | } 32 | } 33 | @Override 34 | public String getDisplayInfo() 35 | { 36 | if (mc.player == null) 37 | { 38 | return ""; 39 | } 40 | if (swing.getValue() == "Mainhand") 41 | { 42 | return "mainhand"; 43 | } 44 | if (swing.getValue() == "Offhand") 45 | { 46 | return "offhand"; 47 | } 48 | if (swing.getValue() == "None") 49 | { 50 | return "none"; 51 | } 52 | return ""; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/svg/LinearGradientFill.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.svg; 2 | 3 | import org.newdawn.slick.geom.*; 4 | 5 | /** 6 | * A filler for shapes that applys SVG linear gradients 7 | * 8 | * @author kevin 9 | */ 10 | public class LinearGradientFill implements TexCoordGenerator { 11 | /** The start position of the gradient line */ 12 | private Vector2f start; 13 | /** The ends position of the gradient line */ 14 | private Vector2f end; 15 | /** The gradient being applied */ 16 | private Gradient gradient; 17 | /** The line of the gradient */ 18 | private Line line; 19 | /** The shape being filled with gradient */ 20 | private Shape shape; 21 | 22 | /** 23 | * Create a new fill for gradients 24 | * 25 | * @param shape The shape being filled 26 | * @param trans The transform given for the shape 27 | * @param gradient The gradient to apply 28 | */ 29 | public LinearGradientFill(Shape shape, Transform trans, Gradient gradient) { 30 | this.gradient = gradient; 31 | 32 | float x = gradient.getX1(); 33 | float y = gradient.getY1(); 34 | float mx = gradient.getX2(); 35 | float my = gradient.getY2(); 36 | 37 | float h = my - y; 38 | float w = mx - x; 39 | 40 | float[] s = new float[] {x,y+(h/2)}; 41 | gradient.getTransform().transform(s, 0, s, 0, 1); 42 | trans.transform(s, 0, s, 0, 1); 43 | float[] e = new float[] {x+w,y+(h/2)}; 44 | gradient.getTransform().transform(e, 0, e, 0, 1); 45 | trans.transform(e, 0, e, 0, 1); 46 | 47 | start = new Vector2f(s[0],s[1]); 48 | end = new Vector2f(e[0],e[1]); 49 | 50 | line = new Line(start, end); 51 | } 52 | 53 | /** 54 | * @see org.newdawn.slick.geom.TexCoordGenerator#getCoordFor(float, float) 55 | */ 56 | public Vector2f getCoordFor(float x, float y) { 57 | Vector2f result = new Vector2f(); 58 | line.getClosestPoint(new Vector2f(x,y), result); 59 | float u = result.distance(start); 60 | u /= line.length(); 61 | 62 | return new Vector2f(u,0); 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/impl/commands/ToggleCommand.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.impl.commands; 2 | 3 | import com.mojang.realmsclient.gui.ChatFormatting; 4 | import me.lyric.infinity.api.command.Command; 5 | import me.lyric.infinity.api.command.CommandState; 6 | import me.lyric.infinity.api.module.Module; 7 | import me.lyric.infinity.api.util.minecraft.chat.ChatUtils; 8 | import me.lyric.infinity.manager.Managers; 9 | 10 | /** 11 | * @author lyric 12 | */ 13 | 14 | public class ToggleCommand extends Command { 15 | 16 | public ToggleCommand() { 17 | super("toggle", "Enable or disable a module."); 18 | } 19 | 20 | @Override 21 | public String theCommand() { 22 | return "toggle "; 23 | } 24 | 25 | @Override 26 | public void onCommand(String[] args) { 27 | String module = null; 28 | 29 | if (args.length > 1) { 30 | module = args[1]; 31 | } 32 | 33 | if (module == null || args.length > 2) { 34 | this.splash(CommandState.ERROR); 35 | return; 36 | } 37 | 38 | boolean isModule = false; 39 | 40 | for (Module modules : Managers.MODULES.getModules()) { 41 | if (modules.name.equalsIgnoreCase(module)) { 42 | if (Managers.MODULES.getModuleByString(module).isEnabled()) 43 | { 44 | Managers.MODULES.getModuleByString(module).disable(); 45 | } 46 | else 47 | { 48 | Managers.MODULES.getModuleByString(module).enable(); 49 | } 50 | isModule = true; 51 | break; 52 | } 53 | } 54 | if (!isModule) { 55 | ChatUtils.sendMessage(ChatFormatting.RED + "Unknown module."); 56 | } else { 57 | ChatUtils.sendMessage(ChatFormatting.BOLD + module + ChatFormatting.RESET + " " + "has been toggled."); 58 | } 59 | 60 | this.splash(CommandState.PERFORMED); 61 | } 62 | } -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/opengl/renderer/DefaultLineStripRenderer.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.opengl.renderer; 2 | 3 | /** 4 | * The default version of the renderer relies of GL calls to do everything. 5 | * Unfortunately this is driver dependent and often implemented inconsistantly 6 | * 7 | * @author kevin 8 | */ 9 | public class DefaultLineStripRenderer implements LineStripRenderer { 10 | /** The access to OpenGL */ 11 | private SGL GL = Renderer.get(); 12 | 13 | /** 14 | * @see org.newdawn.slick.opengl.renderer.LineStripRenderer#end() 15 | */ 16 | public void end() { 17 | GL.glEnd(); 18 | } 19 | 20 | /** 21 | * @see org.newdawn.slick.opengl.renderer.LineStripRenderer#setAntiAlias(boolean) 22 | */ 23 | public void setAntiAlias(boolean antialias) { 24 | if (antialias) { 25 | GL.glEnable(SGL.GL_LINE_SMOOTH); 26 | } else { 27 | GL.glDisable(SGL.GL_LINE_SMOOTH); 28 | } 29 | } 30 | 31 | /** 32 | * @see org.newdawn.slick.opengl.renderer.LineStripRenderer#setWidth(float) 33 | */ 34 | public void setWidth(float width) { 35 | GL.glLineWidth(width); 36 | } 37 | 38 | /** 39 | * @see org.newdawn.slick.opengl.renderer.LineStripRenderer#start() 40 | */ 41 | public void start() { 42 | GL.glBegin(SGL.GL_LINE_STRIP); 43 | } 44 | 45 | /** 46 | * @see org.newdawn.slick.opengl.renderer.LineStripRenderer#vertex(float, float) 47 | */ 48 | public void vertex(float x, float y) { 49 | GL.glVertex2f(x,y); 50 | } 51 | 52 | /** 53 | * @see org.newdawn.slick.opengl.renderer.LineStripRenderer#color(float, float, float, float) 54 | */ 55 | public void color(float r, float g, float b, float a) { 56 | GL.glColor4f(r, g, b, a); 57 | } 58 | 59 | /** 60 | * @see org.newdawn.slick.opengl.renderer.LineStripRenderer#setLineCaps(boolean) 61 | */ 62 | public void setLineCaps(boolean caps) { 63 | } 64 | 65 | /** 66 | * @see org.newdawn.slick.opengl.renderer.LineStripRenderer#applyGLLineFixes() 67 | */ 68 | public boolean applyGLLineFixes() { 69 | return true; 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/tests/CanvasSizeTest.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.tests; 2 | 3 | import org.newdawn.slick.Graphics; 4 | import org.newdawn.slick.*; 5 | import org.newdawn.slick.util.Log; 6 | 7 | import java.awt.*; 8 | import java.awt.event.WindowAdapter; 9 | import java.awt.event.WindowEvent; 10 | 11 | /** 12 | * Quick test to confirm canvas size is reported correctly 13 | * 14 | * @author kevin 15 | */ 16 | public class CanvasSizeTest extends BasicGame { 17 | 18 | /** 19 | * Create test 20 | */ 21 | public CanvasSizeTest() { 22 | super("Test"); 23 | } 24 | 25 | /** 26 | * @see org.newdawn.slick.BasicGame#init(org.newdawn.slick.GameContainer) 27 | */ 28 | public void init(GameContainer container) throws SlickException { 29 | System.out.println(container.getWidth() + ", " + container.getHeight()); 30 | } 31 | 32 | /** 33 | * @see org.newdawn.slick.Game#render(org.newdawn.slick.GameContainer, org.newdawn.slick.Graphics) 34 | */ 35 | public void render(GameContainer container, Graphics g) 36 | throws SlickException { 37 | } 38 | 39 | /** 40 | * @see org.newdawn.slick.BasicGame#update(org.newdawn.slick.GameContainer, int) 41 | */ 42 | public void update(GameContainer container, int delta) 43 | throws SlickException { 44 | } 45 | 46 | /** 47 | * Entry point to the test 48 | * 49 | * @param args The command line arguments passed in (none honoured) 50 | */ 51 | public static void main(String[] args) { 52 | try { 53 | CanvasGameContainer container = new CanvasGameContainer( 54 | new CanvasSizeTest()); 55 | container.setSize(640,480); 56 | Frame frame = new Frame("Test"); 57 | frame.setLayout(new GridLayout(1,2)); 58 | frame.add(container); 59 | frame.pack(); 60 | frame.addWindowListener(new WindowAdapter() { 61 | public void windowClosing(WindowEvent e) { 62 | System.exit(0); 63 | } 64 | }); 65 | frame.setVisible(true); 66 | 67 | container.start(); 68 | } catch (Exception e) { 69 | Log.error(e); 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/manager/client/CommandManager.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.manager.client; 2 | 3 | import me.lyric.infinity.api.command.Command; 4 | import me.lyric.infinity.impl.commands.*; 5 | 6 | import java.util.HashSet; 7 | import java.util.Set; 8 | 9 | /** 10 | * @author lyric - forced to use clientMessage here 11 | */ 12 | 13 | public class CommandManager { 14 | private String clientMessage = "[Infinity]"; 15 | 16 | private static final Set commands = new HashSet<>(); 17 | 18 | private static String prefix = "-"; 19 | 20 | public static Command get(final String commandStr) { 21 | Command command = null; 22 | 23 | for (Command commands : getCommands()) { 24 | if (commands.getCommand().equalsIgnoreCase(commandStr)) { 25 | command = commands; 26 | 27 | break; 28 | } 29 | } 30 | 31 | return command; 32 | } 33 | 34 | public void init() { 35 | commands.add(new PrefixCommand()); 36 | commands.add(new ConfigCommand()); 37 | commands.add(new ListCommand()); 38 | commands.add(new FriendCommand()); 39 | commands.add(new ToggleCommand()); 40 | } 41 | 42 | public String getPrefix() { 43 | return prefix; 44 | } 45 | 46 | public static void setPrefix(String in) { 47 | prefix = in; 48 | } 49 | 50 | public static Set getCommands() { 51 | return commands; 52 | } 53 | public static StringBuilder getCommandsAsString() 54 | { 55 | StringBuilder returnval = new StringBuilder(); 56 | for(Command commands : getCommands()) 57 | { 58 | returnval.append(commands.getCommand()).append(" "); 59 | } 60 | return returnval; 61 | } 62 | 63 | public String getClientMessage() { 64 | return this.clientMessage; 65 | } 66 | 67 | public void setClientMessage(String clientMessage) { 68 | this.clientMessage = clientMessage; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/org/newdawn/slick/tests/ImageBufferTest.java: -------------------------------------------------------------------------------- 1 | package org.newdawn.slick.tests; 2 | 3 | import org.newdawn.slick.*; 4 | 5 | /** 6 | * A test for image buffer maniupulation rendering 7 | * 8 | * @author kevin 9 | */ 10 | public class ImageBufferTest extends BasicGame { 11 | /** The image we're currently displaying */ 12 | private Image image; 13 | 14 | /** 15 | * Create a new image buffer rendering test 16 | */ 17 | public ImageBufferTest() { 18 | super("Image Buffer Test"); 19 | } 20 | 21 | /** 22 | * @see org.newdawn.slick.BasicGame#init(org.newdawn.slick.GameContainer) 23 | */ 24 | public void init(GameContainer container) throws SlickException { 25 | ImageBuffer buffer = new ImageBuffer(320,200); 26 | for (int x=0;x<320;x++) { 27 | for (int y=0;y<200;y++) { 28 | if (y == 20) { 29 | buffer.setRGBA(x, y, 255,255,255,255); 30 | } else { 31 | buffer.setRGBA(x, y, x,y,0,255); 32 | } 33 | } 34 | } 35 | image = buffer.getImage(); 36 | } 37 | 38 | /** 39 | * @see org.newdawn.slick.BasicGame#render(org.newdawn.slick.GameContainer, org.newdawn.slick.Graphics) 40 | */ 41 | public void render(GameContainer container, Graphics g) { 42 | image.draw(50,50); 43 | } 44 | 45 | /** 46 | * @see org.newdawn.slick.BasicGame#update(org.newdawn.slick.GameContainer, int) 47 | */ 48 | public void update(GameContainer container, int delta) { 49 | } 50 | 51 | /** 52 | * @see org.newdawn.slick.BasicGame#keyPressed(int, char) 53 | */ 54 | public void keyPressed(int key, char c) { 55 | if (key == Input.KEY_ESCAPE) { 56 | System.exit(0); 57 | } 58 | } 59 | 60 | /** 61 | * Entry point to our test 62 | * 63 | * @param argv The arguments to pass into the test 64 | */ 65 | public static void main(String[] argv) { 66 | try { 67 | AppGameContainer container = new AppGameContainer(new ImageBufferTest()); 68 | container.setDisplayMode(800,600,false); 69 | container.start(); 70 | } catch (SlickException e) { 71 | e.printStackTrace(); 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/api/event/render/crystal/RenderCrystalPostEvent.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.api.event.render.crystal; 2 | 3 | import me.bush.eventbus.event.Event; 4 | import net.minecraft.client.model.ModelBase; 5 | import net.minecraft.entity.item.EntityEnderCrystal; 6 | 7 | /** 8 | * @author lyric <-_-> 9 | */ 10 | 11 | public class RenderCrystalPostEvent extends Event { 12 | 13 | @Override 14 | protected boolean isCancellable() { 15 | return true; 16 | } 17 | private final ModelBase modelBase; 18 | private final ModelBase modelNoBase; 19 | private final EntityEnderCrystal entityEnderCrystal; 20 | private final double x; 21 | private final double y; 22 | private final double z; 23 | private final float entityYaw; 24 | private final float partialTicks; 25 | 26 | public RenderCrystalPostEvent(ModelBase modelBase, ModelBase modelNoBase, EntityEnderCrystal entityEnderCrystal, double x, double y, double z, float entityYaw, float partialTicks) { 27 | this.modelBase = modelBase; 28 | this.modelNoBase = modelNoBase; 29 | this.entityEnderCrystal = entityEnderCrystal; 30 | this.x = x; 31 | this.y = y; 32 | this.z = z; 33 | this.entityYaw = entityYaw; 34 | this.partialTicks = partialTicks; 35 | } 36 | 37 | public ModelBase getModelBase() { 38 | return this.modelBase; 39 | } 40 | 41 | public ModelBase getModelNoBase() { 42 | return this.modelNoBase; 43 | } 44 | 45 | public EntityEnderCrystal getEntityEnderCrystal() { 46 | return this.entityEnderCrystal; 47 | } 48 | 49 | public double getX() { 50 | return this.x; 51 | } 52 | 53 | public double getY() { 54 | return this.y; 55 | } 56 | 57 | public double getZ() { 58 | return this.z; 59 | } 60 | 61 | public float getEntityYaw() { 62 | return this.entityYaw; 63 | } 64 | 65 | public float getPartialTicks() { 66 | return this.partialTicks; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/main/java/me/lyric/infinity/api/event/render/crystal/RenderCrystalPreEvent.java: -------------------------------------------------------------------------------- 1 | package me.lyric.infinity.api.event.render.crystal; 2 | 3 | import me.bush.eventbus.event.Event; 4 | import net.minecraft.client.model.ModelBase; 5 | import net.minecraft.entity.Entity; 6 | 7 | /** 8 | * @author lyric :o 9 | */ 10 | 11 | public class RenderCrystalPreEvent extends Event { 12 | 13 | @Override 14 | protected boolean isCancellable() { 15 | return true; 16 | } 17 | private final ModelBase modelBase; 18 | private final Entity entity; 19 | private final float limbSwing; 20 | private final float limbSwingAmount; 21 | private final float ageInTicks; 22 | private final float netHeadYaw; 23 | private final float headPitch; 24 | private float scaleFactor; 25 | 26 | public RenderCrystalPreEvent(ModelBase modelBase, Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) { 27 | this.modelBase = modelBase; 28 | this.entity = entity; 29 | this.limbSwing = limbSwing; 30 | this.limbSwingAmount = limbSwingAmount; 31 | this.ageInTicks = ageInTicks; 32 | this.netHeadYaw = netHeadYaw; 33 | this.headPitch = headPitch; 34 | this.scaleFactor = this.scaleFactor; 35 | } 36 | 37 | public ModelBase getModelBase() { 38 | return this.modelBase; 39 | } 40 | 41 | public Entity getEntity() { 42 | return this.entity; 43 | } 44 | 45 | public float getLimbSwing() { 46 | return this.limbSwing; 47 | } 48 | 49 | public float getLimbSwingAmount() { 50 | return this.limbSwingAmount; 51 | } 52 | 53 | public float getAgeInTicks() { 54 | return this.ageInTicks; 55 | } 56 | 57 | public float getNetHeadYaw() { 58 | return this.netHeadYaw; 59 | } 60 | 61 | public float getHeadPitch() { 62 | return this.headPitch; 63 | } 64 | 65 | public float getScaleFactor() { 66 | return this.scaleFactor; 67 | } 68 | } --------------------------------------------------------------------------------