This commit is contained in:
bbldrizzy committed 2026-10-23 00:28:57 +01:00
1 parent 83aea53e57
commit aa4f6b6ddc
842 files changed
+47284 -91563

No files matched your search

+5
View File
@@ -13,3 +13,8 @@ hs_err_pid*
/reverse/
/client/
/logs/
openvape.zip
/dist/
/injector/target/
+15
View File
@@ -0,0 +1,15 @@
# Builds the Prestige payload jar (remapped for the production Fabric runtime), then the Rust injector and loader DLL,
# and collects PrestigeInjector.exe + prestige_native.dll in dist\.
$ErrorActionPreference = 'Stop'
Set-Location $PSScriptRoot
if (Test-Path 'C:\Program Files\Eclipse Adoptium\jdk-21.0.12.101-hotspot') { $env:JAVA_HOME = 'C:\Program Files\Eclipse Adoptium\jdk-21.0.12.101-hotspot' }
& .\gradlew.bat remapJar --console=plain
if ($LASTEXITCODE -ne 0) { throw 'gradle remapJar failed' }
# cargo reports progress on stderr, which PowerShell would treat as an error under 'Stop'
$ErrorActionPreference = 'Continue'
cargo build --release --manifest-path injector\Cargo.toml
if ($LASTEXITCODE -ne 0) { throw 'cargo build failed' }
$ErrorActionPreference = 'Stop'
New-Item -ItemType Directory -Force dist | Out-Null
Copy-Item injector\target\release\PrestigeInjector.exe, injector\target\release\prestige_native.dll dist\ -Force
Write-Host 'Done: dist\PrestigeInjector.exe + dist\prestige_native.dll'
+646
View File
@@ -0,0 +1,646 @@
# Code map
Every class of the client, grouped by package, with a one-line description.
Package paths are relative to `src/main/java/dev/zprestige/prestige/`.
## `(root)` — Core API: module/setting model, event bus, module manager (names here are used by the UI bridge via reflection).
- **BoolSetting** — Boolean (on/off) module setting.
- **Category** — ClickGUI category of a module (Combat, Misc, Movement, Visual, Mace, Spear, Menu).
- **ColorSetting** — Color (java.awt.Color) module setting.
- **EnumSetting** — Single-choice module setting whose value is one of a fixed list of string options.
- **EventBus** — Copy-on-write event bus: registers @Subscribe methods as MethodHandles and dispatches events by exact event class.
- **FloatSetting** — Float slider module setting with a min/max range.
- **Gamemode** — PvP game modes a module is tagged for (Crystal, Mace, Sword, Spear, UHC, Cart, Any); used by the UI gamemode filter.
- **IntSetting** — Integer slider module setting with a min/max range.
- **KeybindSetting** — Key/mouse-button bind setting (mouse buttons encoded as 9999 - button) with an optional hold/toggle mode.
- **ListenerEntry** — One registered event listener: the @Subscribe method, its owner object, the event type and a bound invoker handle.
- **MenuModule** — Pseudo-module holding the ClickGUI settings: menu key, description mode, rounded corners, accent colour.
- **Module** — Base class of every feature module: enabled/keybind core settings, metadata, toggling and event-bus (un)registration.
- **ModuleManager** — Holds the module list and menu module and runs onEnable/onDisable calls that were queued while no world was loaded.
- **MultiSetting** — Multi-select module setting: a list of string options each with its own on/off flag.
- **Native** — Empty stubs for the JNI functions of the removed native companion module (bound by @NativeId UUID): module registration, external menu toggling/query and opaque data calls.
- **RangeSetting** — Low/high range setting that can roll a random value inside the range (used for randomized delays).
- **Setting** — Base class of all module settings: name, value, description and a visibility predicate on the value.
- **SettingHolder** — Owns a list of settings and offers factory methods that create and register them (base of Module).
- **Subscribe** — Marks an event-handler method; EventBus registers @Subscribe methods by their single event parameter type.
- **TextSetting** — Free-text module setting with a placeholder hint.
## `client` — Mod entrypoint and the client-wide singletons.
- **Prestige** — Fabric mod entrypoint: creates the event bus, module manager and all client-wide singletons and hooks the HUD/world render callbacks.
## `module/*` — The modules, one package per ClickGUI category.
### `module/combat`
- **AimAssist** — Frame-based aim assist that smoothly pulls the camera yaw/pitch toward the best player or end-crystal target inside the FOV/range, with reaction delay, jitter, smoothing and movement prediction.
- **AnchorExploder** — Combat module that charges the respawn anchor under the crosshair with glowstone and detonates it from a chosen hotbar slot (optionally only your own anchors, with swap-back, enemy damage-tick timing and silent aim), and flags while it is looking at an anchor so vanilla item use is suppressed.
- **AnchorMacro** — Combat macro that places a respawn anchor at the crosshair while Place Bind is held, charges anchors with glowstone and explodes them from a chosen hotbar slot, each step with None/Swap/Silent swapping, and flags while it is acting so other anchor modules and item use stand down.
- **AnchorPearlCatch** — Combat module that predicts where an enemy's thrown ender pearl will land, pre-places a respawn anchor (optionally behind a safe cover block) beside the landing spot, charges it with glowstone and detonates it as the thrower arrives.
- **AnchorPlacer** — Combat module that places a respawn anchor where you aim (or silently aims at the nearest placeable spot), charges empty anchors with glowstone and detonates charged ones while holding a totem, in One-Shot or Persistent fire mode, flagging for two ticks after each action.
- **AntiAction** — Cancels accidental actions that hurt a PvP fight: double-charging anchors, opening ender chests with combat items, misplacing glowstone, ground fireworks, and sword hits into a raised shield.
- **AntiBot** — Flags server-side bots for BotFilter by position-packet validation counts, UUID version, missing tab-list entries and sustained zero ping.
- **AntiWeb** — Escapes cobwebs by placing a water bucket on top of the web column, waiting for the webs to wash away and scooping the water back up, either crosshair-triggered (Legit) or via silent rotations (Blatant).
- **AutoAnchor** — Fully automatic anchor-PvP module: picks the nearest enemy, scores candidate anchor spots by predicted target and self damage (with an optional glowstone/obsidian blast cover), then runs a place -> safe-cover -> charge -> detonate state machine with randomized stage delays, optional silent rotations, swap-back and fading box renders.
- **AutoCart** — TNT-minecart module: places a rail and TNT minecart at the crosshair or at the predicted landing of your bow/crossbow shot (on bow shot, on the trigger bind, or overload-stacked several carts), optionally drops a safe block, then ignites the cart with a bow/crossbow shot or auto-hits placed carts, using silent arc-aim rotations.
- **AutoCrystal** — Crystal-PvP module that breaks the end crystal under the crosshair (or, with Head Bob, a reachable crystal on the last base by adjusting pitch) and places crystals on the obsidian/bedrock you look at, with randomized delays, damage-tick gating and an optional last break before disabling.
- **AutoDrain** — Crystal-PvP module that drains water/lava sources near an enemy with an empty bucket (or covers them with cobweb as a fallback), either on the crosshair block (Legit) or via silent-aim rotations, then swaps back.
- **AutoElytra** — Combat module that swaps an elytra into the chest slot (inventory clicks or hotbar use), jumps and starts gliding with optional firework boosts, then swaps the chestplate and rockets back; also fires a rocket when Space is pressed mid-glide.
- **AutoHitCrystal** — Hit-crystal macro: places obsidian at the crosshair, switches to and places an end crystal on it, then breaks it (single tap, double tap or infinite), optionally synced to the enemy's damage ticks and using silent pitch changes.
- **AutoObbyCrystal** — Fully automatic obsidian-crystal module: picks the closest enemy, scores nearby crystal bases by predicted target/self damage, momentum and yaw change, then runs a PLACE_OBSIDIAN -> PLACE_CRYSTAL -> BREAK_CRYSTAL sequence with (silent) rotations, hotbar swapping, mid-sequence abort checks and fading box rendering.
- **AutoSafeCart** — Detects TNT minecarts that would deal enough damage to you (optionally only your own or only enemy carts) and places cover blocks (logs/planks/cobblestone/obsidian) next to you or the cart, either silently aimed or only at the crosshair in Legit mode.
- **AutoShield** — Sword/UHC module that holds the use key to block with a shield while a close enemy's swing cooldown is ready or they move towards you, lets go for your own falling crits, and tracks the ~5s axe shield-disable lockout (optionally swapping to a sword).
- **AutoShieldBreaker** — Sword module that swaps to an axe (hotbar, or silently pulled from the inventory) and hits a shield-blocking player to disable the shield, either when you click (On Hit) or automatically with optional silent aim, then swaps back.
- **AutoTotem** — Re-totems after a pop: Crystal mode double-hands a hotbar totem and runs an inventory routine that moves totems into the offhand/hotbar (optionally hover-only or with humanized robot mouse paths, dynamic danger-scaled delay and anti-TotemGuard checks); SMP mode swaps a totem into the offhand at low health or on a mace dive and swaps it back afterwards.
- **Backtrack** — Delays all incoming packets by a random latency while the attacked player moves away, tracking the target's real server position and rendering an interpolated box where it actually is.
- **CartAura** — Aura that hits nearby TNT minecarts placed by others: acquires a cart within the target FOV, tracks it with silent (optionally jittered) rotations, swaps to a sword and attacks after randomized reaction/attack delays, then swaps back.
- **CartPearlCatch** — Combat module that predicts an enemy pearl's landing spot, places a rail and TNT minecart within blast range of it, and detonates the cart with a flaming crossbow shot (through flint-and-steel fire) or a bow shot timed to the pearl's arrival.
- **CobwebPlacer** — Places cobwebs on enemies: Manual mode webs the block you look at, Auto mode predicts where the closest enemy will stand or land, aims there with silent rotations and places a web, pulling it from the hotbar or inventory and switching back afterwards via a deferred switch-back task.
- **DoubleAnchor** — Module that, when you right-click a charged anchor while holding another anchor, instantly re-places a second anchor in the blast spot (by chance, optionally charging it with glowstone after a delay), plus a Macro Bind that runs the full place/charge/explode+double-place/charge/explode sequence with damage-tick waiting and swap-back.
- **GhostPlace** — Crystal-PvP helper that, while you right-click an enemy, raycasts past them and places the held block (cobweb by default) on the block behind instead of interacting with the entity.
- **HitFix** — Holds back swings/attacks on players that are still in hurt time or airborne and lands the queued hit through a silent rotation once the target is hittable again (gives up after one second).
- **HitFlick** — Cancels each attack, flicks the silent rotation sideways by a random angle for one tick, then snaps back onto the target and lands the hit to obscure aim patterns.
- **Hitboxes** — Expands entity hitboxes, either directly through the bounding-box hook or (Grim/Vulcan mode) by turning air swings that would hit the expanded box into silent-rotation hits, and renders the boxes.
- **InstantCrossbow** — One-shot module that swaps to a crossbow (hotbar, or pulled from the inventory), holds use until it is charged, and restores the previous slot and disables itself once the crossbow leaves the hand.
- **InstantShield** — Keybind-driven module that swaps to a shield (hotbar, or pulled from the inventory) and holds block, swapping back on the next press (or on key release in hold mode).
- **KeepSprint** — After a sprint hit, releases the forward key and re-presses it after a random tick delay so the server-side sprint state is restored (stays out of the way while WTap is tapping).
- **KillAura** — Silent-rotation kill aura that locks the closest valid entity inside the target FOV, aims at the nearest enabled anatomy point of its hitbox and attacks when cooldown, reach and line of sight allow (optional axe swap against shields, miss chance and aim-dot rendering).
- **NoMissDelay** — Keeps the attack cooldown and hides the swing animation on missed sword/axe swings, with a humanize chance to behave like vanilla and an optional in-combat-only gate.
- **PearlFollow** — Combat module that simulates where an enemy's ender pearl will land and throws your own pearl at a solved pitch so it lands on the same spot, then swaps back to the previous hotbar slot.
- **PredictDoubleHand** — Crystal-PvP module that pre-emptively selects a hotbar totem when ThreatAssessor predicts lethal anchor/crystal/obsidian/mace damage from the closest enemy, on low-HP sword pops, or when throwing a pearl.
- **SafeAnchor** — Module that shields you from your own respawn-anchor blast by placing a glowstone/obsidian cover block between you and the anchor (Legit: the anchor you just placed, via your crosshair; Blatant: any nearby anchor via silent rotations), and reports when a cover is pending so the other anchor modules hold off detonating.
- **SilentAim** — Redirects missed sword/axe/mace swings (and block clicks) onto the closest nearby target through a silent rotation toward its nearest enabled aim point, optionally tracking continuously and rendering the aim dot.
- **SwapHit** — When attacking a player without a sword, swaps to a hotbar sword (or an axe against a raised shield), hits after the swap delay and swaps back after the swap-back delay.
- **TotemHit** — When hitting a player while holding a totem, re-issues the attack with a hotbar sword through a temporary slot swap.
- **Triggerbot** — Attacks the entity under the crosshair (or the ExtendedReach target) once the randomized delay and cooldown windows pass, with sticky targeting, crit timing, crystal rules, TPS-synced cooldown, miss chance and rate-limited debug logging of rejected targets.
- **XbowCart** — One-shot crossbow cart combo: places a rail and TNT minecart at the crosshair, lights fire with flint and steel on the arrow's path, then fires an arrow-loaded crossbow through the fire to detonate the cart and disables itself.
### `module/mace`
- **AutoMace** — Mace PvP assistant: swaps to the best Density/Breach mace once falling far enough, optionally auto-hits the target (trigger / silent aim), axe stun-slams shield-blocking targets before the mace hit, expands the target hitbox, swaps the elytra for a chestplate before impact and swaps back to the previous slot afterwards.
- **AutoPearlCatch** — Throws an ender pearl straight up and then a wind charge (forward-speed compensated) to catch it, either with a smoothed real-camera rotation (legit) or a silent server-side rotation lock, then disables itself.
- **AutoReMace** — After a mace hit on a player, re-enables AutoElytra and smoothly steers the camera above and then back onto the same target to chain another elytra mace dive.
- **BreachSwap** — On manual or automated attacks while holding a sword (and not falling), rolls a chance to swap to the highest-Breach mace for the hit and swaps back to the previous slot one tick later.
- **DiagonalPearlCatch** — Throws a pearl along the view direction and catches it with a wind charge, either after a fixed macro delay or by simulating the player, pearl and wind-charge trajectories to find the best intercept tick and angle, using a silent rotation lock for each throw.
- **ElytraWindCharge** — Equips and deploys the elytra, then throws a wind charge steeply downward whenever the glide gets close to the ground (threshold lowered by forward speed) to boost back up; disables if the player switches to a chestplate.
- **FastPearlCatch** — Pearl-and-wind-charge catch thrown back-to-back at configurable angles, either by swapping hotbar slots (silent lock or legit camera rotation) or by pre-loading the wind charge into the offhand and restoring the original offhand item and slot afterwards.
- **KeyWindCharge** — One-shot module that throws a wind charge when enabled, either by switching the hotbar with randomized delays and switching back (Normal) or via an instant silent slot swap (Silent), then disables itself.
- **MacePot** — Throws Speed and Strength splash potions downward (silent pitch) when those effects are missing, pulling potions from the main inventory into the hotbar when needed and swapping them back once both effects are active.
- **MacePrediction** — Renders the closest enemy's predicted airborne arc (with a landing marker) or on-ground movement path as boxes/outlines, plus range circles at the current or predicted landing position, to help time mace hits.
- **PearlWindCharge** — Throws an ender pearl and, as soon as the server teleports the player (pearl landed), throws a wind charge straight down at the feet (optionally jumping) and disables itself.
- **ShieldDrain** — Spams several attacks per tick on a shield-blocking player (crosshair target or nearest within horizontal range) to drain the shield, optionally auto-swapping to a mace and back; publishes a static per-tick draining flag that AutoMace checks.
- **ShortWindCharge** — Throws a wind charge at the player's feet, either through a staged legit sequence (switch slot, smoothly look down, throw, look back, switch back) or with a silent server-side pitch, optionally jumping as it is thrown.
- **WindChargeAura** — Silently rotates to and attacks other players' wind charges within reach to deflect them, with optional humanized aim jitter, a max-yaw cap and an in-air-only option.
### `module/misc`
- **AntiTrap** — Hides trap-bait entities (armor stands, minecarts, item frames, boats, crystals) near the player by dropping their spawn packets or discarding loaded ones, and blocks forced sign-edit screens.
- **AutoArmor** — Equips the highest-scoring armor piece (material tier plus weighted enchantments) from the inventory into each armor slot, gated by mode (always, inventory open, or held key) and a swap delay.
- **AutoClicker** — Left/right auto clicker: Interval mode clicks at a fixed rate, Ghost mode clicks at a randomized CPS with a Gaussian human reaction delay whenever the crosshair acquires a new entity.
- **AutoLoot** — While the inventory screen is open and the loot key is held, throws out surplus totems and ender pearls beyond the configured minimums to make room for looted items.
- **AutoPickaxe** — Switches to the best pickaxe (hotbar, or silently swapped in from the inventory) while the player mines the block beneath them, and switches back afterwards.
- **AutoPot** — Throws splash healing potions at the configured pitch, either automatically at low health or whenever a potion is held.
- **AutoText** — One-shot module that sends the configured chat message or slash command when enabled, then turns itself off.
- **AutoTool** — While the attack key is held on a block, selects the hotbar tool with the best mining speed plus Efficiency level and returns to the previous slot afterwards.
- **CartRefill** — Keeps a chosen hotbar slot stocked with a TNT minecart by swapping one in from the main inventory while the inventory is open or the refill key is held.
- **CartStealer** — Shift-clicks TNT minecarts out of an open shulker box at a randomized delay and optionally closes it when none are left or the inventory is full.
- **ChestStealer** — While the activate key is held, shift-clicks every item out of an open chest at a randomized delay and optionally closes it once empty.
- **Criticals** — Turns melee hits into critical hits, either by sending fake position packets (Silent) or by delaying the attack until after a real jump or micro-hop (Legit/Minimal).
- **CrystalOptimizer** — Removes an end crystal client-side as soon as it is attacked (unless the player has Weakness) instead of waiting for the server to confirm.
- **EnemyFaker** — Disguises the nearest non-friend player under a fake name, skin and tier/gamemode nametag, fetching the fake skin from Mojang on demand.
- **FastEXP** — Throws experience bottles quickly, either while right-click is held (Manual) or automatically swapping to bottles and looking down to mend damaged Mending gear (Automatic), as a silent rotation provider.
- **FastPlace** — Lowers the client's item-use cooldown to a random value in the configured range each tick so blocks (or any items) can be placed faster.
- **Friends** — Friend handling: highlights friend names in aqua in rendered text and blocks attacks, swings and attack-cooldown resets aimed at friends.
- **KeyPearl** — One-shot module that switches to an ender pearl in the hotbar, throws it and switches back to the previous slot with randomized delays, then disables itself.
- **MiddleClickFriend** — Adds or removes the player under the crosshair as a friend when the middle mouse button is clicked.
- **NameHider** — Replaces the local player's username in rendered text with a custom name or a periodically re-rolled random one.
- **PotionRefill** — While the inventory screen is open, shift-clicks splash potions (optionally healing only) from the main inventory into empty hotbar slots at a randomized delay.
- **Reach** — Randomly extends the player's attack reach by an amount from the configured range, with a configurable chance per hit.
- **Refill** — Tops off low stackable hotbar stacks with matching items from the main inventory while the inventory is open or the refill key is held.
- **RightClicker** — Schedules right clicks at a random CPS between the configured minimum and maximum while no screen is open and no item is being used.
- **SelfDestruct** — Panic switch that disables, disposes and unbinds every module, clears the module list and marks the client as self-destructed.
- **StreamerMode** — Masks every other player's name in nametags and rendered text with a stable numbered or random alias, optionally skipping friends and the local player.
- **Teams** — Tracks players whose display-name color matches the local player's as teammates so FriendManager treats them as friends (no attacking teammates).
### `module/movement`
- **AutoJumpReset** — Presses jump (by chance) on the tick you take a hit from a player while on ground, performing a jump reset to reduce knockback.
- **AutoShortPearl** — Anti-knockback module that, after you are hit by a player, waits a random delay and throws an ender pearl straight down at your feet using a silent ~90 degree pitch rotation.
- **FakeLag** — Holds outgoing packets in a queue and releases them manually, on a timer, by enemy distance, dynamically or after knockback (and on selected actions/explosions), drawing a ring at the last flushed position.
- **FastBridge** — Holds sneak automatically while looking down with a block in hand and standing over air, so you can bridge quickly at block edges.
- **Freecam** — Detaches the camera into a free-flying view driven by the movement keys while freezing the player's real position/rotation for the server, optionally drawing a box where the body stays.
- **NoJumpDelay** — Resets the player's jumping cooldown every tick to remove the delay between jumps.
- **Parkour** — Automatically jumps when the player is about to walk off a block edge (randomised edge distance).
- **ShortPearl** — One-shot module that throws an ender pearl at your feet at a steep pitch, either through a staged legit camera rotation (swap, rotate, throw, rotate back, switch back) or a silent server-side rotation.
- **Sprint** — Keeps the sprint key pressed while moving forward.
- **Velocity** — Scales incoming knockback by random vertical/horizontal percentages (with a chance), optionally skipping while you are still airborne from an explosion's knockback.
- **WTap** — After hitting a player while sprinting forward, waits a reaction delay and releases W for a random time to reset server-side sprint for extra knockback.
### `module/spear`
- **ExtendedReach** — Spear-mode module that, when attacking with a selected sword/axe/mace, briefly swaps to a non-Lunge spear for its longer reach and swaps back a tick later; also exposes the extended-reach raycast target to Triggerbot.
- **InstantLunge** — One-shot spear module that swaps to a Lunge-enchanted spear, fires the lunge (stab packet or piercing attack) immediately, and optionally swaps back after a random delay before disabling itself.
- **SpearDamageIndicator** — HUD overlay shown while charging a netherite spear that estimates the kinetic charge damage against the closest enemy and draws it as an animated text + bar panel below the crosshair.
- **SpearMaceDoubleTap** — Spear+mace combo module: when a KINETIC_ATTACK entity status (spear charge hit) arrives while falling farther than the trigger distance, stops the spear charge, swaps to the best Density/Breach mace and hits the crosshair target again on the next tick.
### `module/visual`
- **Ambience** — Visual module that overrides fog distances/color, the sky color and the client-side time of day.
- **Animations** — Visual module that replaces the first-person swing animation with one of three custom styles, can slow swings down and suppresses the item re-equip animation.
- **AntiResourcePack** — Module that cancels server resource-pack requests while replying that the pack was accepted and loaded.
- **ESP** — Shader ESP module: picks the outline/chams/aura post shader and the entity types to highlight for EspShaderManager, and holds the thread-local render layer captured by the model-render hook.
- **FreeLook** — Module that detaches the camera rotation from the player so you can look around (optionally in third person) without turning.
- **HealthIndicators** — Module that appends a color-coded health plus absorption value to player name tags.
- **HitEffect** — Visual module that spawns glowing physics particles when you hit an entity or a player pops a totem.
- **HudEditor** — Module that opens the HUD editor screen and holds the global HUD scale setting (percent).
- **ItemESP** — Item ESP module: collects dropped item entities within range every tick and draws "name xCount" labels above them on the 2D overlay.
- **JumpCircles** — Visual module that draws expanding glow rings where players jump.
- **NameTags** — Name Tags module: suppresses vanilla player labels and draws custom cards with name, totem pops, distance, a smoothed health bar, held/armor items and short enchantment labels.
- **NoBounce** — Module that cancels the hotbar item bobbing animation (e.g. while crystal modules swap items).
- **OreSimulation** — Ore Simulation module: re-runs vanilla ore and scattered-ore feature generation for loaded chunks from the entered world seed and outlines the predicted ore blocks around the player.
- **PearlTrajectory** — Pearl Trajectory module: simulates the flight of every thrown ender pearl, draws the predicted path in 3D and shows a landing tag with a pearl icon and the flight time at the predicted landing point.
- **RenderOptimizer** — Module that removes assorted visuals (hurt cam, fire overlay, particles, GUI background tint, weather, terrain loading screen, scoreboard, titles, hotbar item names) and can force full bright.
- **ShieldRenderer** — Module that publishes the shield overlay render settings (offset, scale, colors, mode) and tracks per-player shield blocking and break state.
- **StorageESP** — Storage ESP module: collects selected storage block entities (chests, shulkers, barrels, hoppers, furnaces, ...) every tick and renders them into a mask that StorageOutlineRenderer turns into colored glow outlines/fills.
- **TargetRenderer** — Visual module that highlights the current combat target with an orbiting ghost glow or a spinning square marker.
- **TotemAnimation** — Module that speeds up the totem-pop floating item animation by adding extra ticks.
- **Trails** — Visual module that leaves fading footstep, ring or particle trails behind players.
- **Trajectories** — Trajectories module: simulates the held bow, charged crossbow (including multishot spread) or ender pearl with dummy projectiles and renders the predicted path as an animated beam with an impact marker.
- **TwoDESP** — 2D ESP module: projects nearby players' bounding boxes to screen space and draws fading boxes/corners/brackets with optional glow, fill, animated gradient, health bar, name tag and distance label.
- **Weather** — Visual module that renders custom client-side rain, snow, firefly or ember particles around the player.
- **XRay** — XRay module: hides every block except a fixed list of ores, valuables and utility blocks via BlockVisibilityEvent, reloads chunk meshes on toggle and optionally forces full-bright lighting.
## `event` — Event types posted on the EventBus (fired from the hooks in `mixin/` through `util/HookBridge`).
- **AddParticleEvent** — Fired from ParticleManager.addParticle; cancelling drops the particle.
- **AntiBotQueryEvent** — Query posted by the bot filter; the AntiBot module cancels it to signal that bot filtering is active.
- **AttackEntityEvent** — Fired from ClientPlayerInteractionManager.attackEntity when the local player attacks; cancellable.
- **AutoAttackEvent** — Posted by combat modules right before they attack a player themselves (lets BreachSwap swap weapons first).
- **BlockStateUpdateEvent** — Fired after WorldChunk.setBlockState with the changed position and new block state.
- **BlockVisibilityEvent** — X-ray query fired from Block.shouldDrawSide, chunk occlusion and ambient-occlusion hooks: whether a block face should be drawn.
- **BotCheckEvent** — Query posted by the bot filter; AntiBot cancels it when the player looks like a bot.
- **BoundingBoxEvent** — Fired from Entity.getBoundingBox; when cancelled the returned box is replaced (used by Hitboxes).
- **CameraPositionEvent** — Fired from Camera.setPos; when cancelled the camera is moved to the event position instead (used by Freecam).
- **CameraRotationEvent** — Fired from Camera.setRotation; when cancelled the camera uses the event yaw/pitch (used by FreeLook).
- **ChunkDataEvent** — Fired after a chunk data packet has been applied, with the loaded chunk.
- **ClientTickEvent** — Main per-tick event, posted from MinecraftClient.tick (after the HUD tick) while a world and player exist.
- **DoAttackEvent** — Fired from MinecraftClient.doAttack (attack key); cancelling blocks the attack.
- **DoItemUseEvent** — Fired from MinecraftClient.doItemUse (use key); cancelling blocks the item use.
- **EntityAddRemoveEvent** — Fired when the client world adds (PRE phase) or removes (POST phase) an entity.
- **Event** — Base class of all client events: optional PRE/POST phase, a cancelled flag and post() to dispatch it on the event bus.
- **ExplosionEvent** — Fired from ServerWorld.createExplosion (integrated server) with the explosion power and position.
- **ExtendedReachAttackEvent** — Posted by Triggerbot before it clicks on a target found through ExtendedReach (lets the spear swap happen first).
- **FireOverlayEvent** — Fired while rendering the first-person fire overlay; cancelling hides it.
- **FloatingItemTickEvent** — Fired at GameRenderer.tick; the floating-item (totem) animation timer is advanced by the extra ticks set by listeners.
- **FogEvent** — Fired from FogRenderer.applyFog; when cancelled the fog color, start/end distances and sky end come from the event.
- **FrameEvent** — Posted once per rendered frame with the 2D render context (null context when no render pass ran); used for per-frame logic and notifications.
- **FrustumSetupEvent** — Fired after WorldRenderer.setupFrustum with the new view frustum (for visibility checks of 2D/3D overlays).
- **FullBrightEvent** — Fired from the lightmap update and EntityRenderer.getSkyLight; cancelling forces full brightness.
- **GameJoinEvent** — Fired after the client handles the GameJoin packet (joining a server or changing world); listeners reset per-world state.
- **HandSwingDurationEvent** — Fired from LivingEntity.getHandSwingDuration; when cancelled the event duration is returned (used by Animations).
- **HandleBlockBreakingEvent** — Fired from MinecraftClient.handleBlockBreaking; cancelling stops block breaking for that tick.
- **HealthIndicatorEvent** — Asks for a suffix (e.g. health) to append to a player's name label (used by HealthIndicators).
- **HurtCamEvent** — Fired from GameRenderer.tiltViewWhenHurt; cancelling removes the hurt camera shake.
- **ItemBobbingEvent** — Fired from ItemStack get/setBobbingAnimationTime; cancelling disables the item pickup bounce (used by NoBounce).
- **KeyEvent** — Fired from Keyboard.onKey with the GLFW key code and action; cancellable.
- **KeyboardInputTickEvent** — Fired PRE/POST around KeyboardInput.tick.
- **LabelTextEvent** — Lets modules rewrite the name label of a player (entity renderer and text-display hooks).
- **LoadingScreenEvent** — Cancellable event for skipping the downloading-terrain screen (RenderOptimizer); currently never posted.
- **ModuleStateSync** — Per-tick sync of module enabled state changed outside toggle() (e.g. by the UI), plus hiding the vanilla status-effect overlay while HUD elements are drawn.
- **MouseButtonEvent** — Fired from Mouse.onMouseButton with the button and action.
- **MouseUpdateEvent** — Fired from Mouse.updateMouse with the cursor delta; cancelling stops the vanilla camera turn (used by FreeLook).
- **MovementYawEvent** — Fired from Entity.updateVelocity and the sprint-jump boost of LivingEntity.jump; when cancelled movement uses the event yaw (silent rotation).
- **OverlayMessageEvent** — Fired from InGameHud.renderOverlayMessage; cancelling hides the action-bar/hotbar text.
- **PacketReceiveEvent** — Fired from ClientConnection.handlePacket for every incoming packet; cancelling drops it.
- **PacketSendEvent** — Fired from ClientConnection.send for every outgoing packet; cancelling drops it.
- **PlayerRenderStateEvent** — Fired PRE/POST around EntityRenderer.getAndUpdateRenderState for the local player so the server-side rotation can be shown on the model.
- **PreTickEvent** — Fired at the head of every MinecraftClient.tick, also without a world.
- **RainGradientEvent** — Fired from World.getRainGradient; cancelling removes rain and snow.
- **ReachEvent** — Fired from GameRenderer.updateCrosshairTarget; when cancelled the extra reach is added to the crosshair raycast distance.
- **Render2DEvent** — 2D HUD overlay render event, posted each frame while no screen (other than chat) is open.
- **Render3DEvent** — World-space render event posted from WorldRenderer.render with the world camera matrices.
- **RenderCrosshairEvent** — Fired from InGameHud.renderCrosshair; cancelling hides the vanilla crosshair.
- **RenderLabelEvent** — Fired before an entity name label is rendered; cancelling hides the vanilla label (used by NameTags).
- **RenderScoreboardEvent** — Fired from InGameHud.renderScoreboardSidebar; cancelling hides the scoreboard.
- **RenderStatusEffectsEvent** — Fired from InGameHud.renderStatusEffectOverlay; cancelling hides the vanilla status effect icons.
- **ResetAttackCooldownEvent** — Fired from PlayerEntity.resetTicksSince (attack cooldown reset); cancelling keeps the cooldown progress.
- **ResolutionChangedEvent** — Fired after MinecraftClient.onResolutionChanged with the game window.
- **ScreenBackgroundEvent** — Fired from Screen.renderBackground/renderBackgroundTexture; cancelling removes the dark GUI background tint.
- **SendMovementPacketsEvent** — Fired PRE/POST around ClientPlayerEntity.sendMovementPackets; PRE may change the rotation sent to the server, the real rotation is restored after POST.
- **ShieldBreakEvent** — Fired from LivingEntity.handleStatus when an entity's shield is broken (status 30).
- **ShieldRenderSettingsEvent** — Query event that the ShieldRenderer module fills with its overlay settings (offset, scale, mode, colors).
- **SkinTexturesEvent** — Fired when a player's skin textures are looked up (player list entry / client player); when cancelled the event skin is used.
- **SkyColorEvent** — Fired from SkyRendering.updateRenderState so modules can override the sky and sunrise/sunset colors.
- **SwingArmEvent** — Fired from HeldItemRenderer.swingArm so swing animations can be replaced (used by Animations).
- **SwingHandEvent** — Fired (PRE, then POST) from ClientPlayerEntity.swingHand; cancelling suppresses the swing, skipPost suppresses the POST phase.
- **TextReplaceEvent** — Fired for every visited text string; when cancelled occurrences of the target are replaced with the event text (name hiding).
- **TimeOfDayEvent** — Fired from World.getTimeOfDay; when cancelled the event time is returned (used by Ambience).
- **TravelEvent** — Fired PRE/POST around LivingEntity.travel for the local player so movement uses the silent rotation; the real rotation is restored afterwards.
- **VelocityUpdateEvent** — Fired from Entity.setVelocityClient for the local player (server knockback); cancelling applies the modified velocity.
- **WorldRendererReloadEvent** — Fired at the start of WorldRenderer.reload.
## `mixin` — ClassTransform hook classes injected into Minecraft (applied by `engine/EnginePlugin`).
- **AbstractBlockStateMixin** — ClassTransform hook into AbstractBlockState.getAmbientOcclusionLightLevel that lets the ambient-occlusion visibility event force full AO light (XRay).
- **AbstractClientPlayerEntityMixin** — ClassTransform hook into AbstractClientPlayerEntity.getSkin that lets SkinTexturesEvent replace a player's skin textures.
- **BlockMixin** — ClassTransform hook into Block.shouldDrawSide that lets the draw-side visibility event override face culling (XRay).
- **CameraMixin** — ClassTransform hook into Camera.setPos/setRotation that lets camera position and rotation events override the camera transform.
- **ChunkOcclusionDataBuilderMixin** — ClassTransform hook into ChunkOcclusionDataBuilder.markClosed that can skip occlusion marking so hidden blocks keep rendering (XRay).
- **ClientConnectionMixin** — ClassTransform hook into ClientConnection that posts cancellable packet receive/send events and feeds outgoing packets to the inventory swap queue.
- **ClientPlayNetworkHandlerMixin** — ClassTransform hook into ClientPlayNetworkHandler that posts GameJoinEvent and ChunkDataEvent after the vanilla packet handlers.
- **ClientPlayerEntityMixin** — ClassTransform hook into ClientPlayerEntity that posts swing-hand events and spoofs, then restores, the rotation sent in movement packets.
- **ClientPlayerInteractionManagerMixin** — ClassTransform hook into ClientPlayerInteractionManager.attackEntity that posts a cancellable AttackEntityEvent for the local player.
- **ClientWorldMixin** — ClassTransform hook into ClientWorld that posts entity added and removed events.
- **EntityMixin** — ClassTransform hook into Entity that applies silent-rotation movement and aim fixes and lets events override bounding boxes and client-set velocity.
- **EntityRendererMixin** — ClassTransform hook into EntityRenderer that applies the visual rotation to the local player's render state, forces full entity sky light and rewrites name labels.
- **FogRendererMixin** — ClassTransform hook into FogRenderer that lets FogEvent rewrite the fog uniform buffer and the returned fog color.
- **GameRendererMixin** — ClassTransform hook into GameRenderer that runs the client's HUD render pass, captures camera matrices, cancels hurt cam, speeds up the floating totem item and extends reach in crosshair targeting.
- **HeightContextMixin** — ClassTransform hook into HeightContext's constructor that accepts a null chunk generator (client-side ore simulation) by using unbounded height limits.
- **HeldItemRendererMixin** — ClassTransform hook into HeldItemRenderer.swingArm that posts SwingArmEvent so modules can replace the first-person swing animation.
- **InGameHudMixin** — ClassTransform hook into InGameHud that lets events hide the status effect overlay, crosshair, scoreboard sidebar and overlay message.
- **InGameOverlayRendererMixin** — ClassTransform hook into InGameOverlayRenderer.renderFireOverlay that lets FireOverlayEvent hide the fire overlay.
- **InactivityFpsLimiterMixin** — ClassTransform hook into InactivityFpsLimiter.update that keeps the full FPS limit while the ClickGUI is open.
- **ItemStackMixin** — ClassTransform hook into ItemStack that lets the item bobbing events suppress the hotbar bobbing animation time.
- **KeyboardInputMixin** — ClassTransform hook into KeyboardInput.tick that posts input tick pre/post events and blocks movement input (then restores sprint) around inventory swaps.
- **KeyboardMixin** — ClassTransform hook into Keyboard.onKey that posts a cancellable KeyEvent.
- **LightmapTextureManagerMixin** — ClassTransform hook into LightmapTextureManager.update that clears the lightmap to white for full bright.
- **LivingEntityMixin** — ClassTransform hook into LivingEntity that spoofs the rotation during travel, overrides hand swing duration, posts shield-break events and applies the silent jump yaw.
- **LivingEntityRendererMixin** — ClassTransform hook into LivingEntityRenderer.isVisible that forces invisible ESP-targeted entities to render.
- **MinecraftClientMixin** — ClassTransform hook into MinecraftClient that posts client tick, pre-tick, resolution change, item use, attack and block breaking events.
- **ModelCommandRendererMixin** — ClassTransform hook into ModelCommandRenderer that tracks the render layer being drawn and wraps model vertex consumers with the ESP outline consumer.
- **MouseMixin** — ClassTransform hook into Mouse that posts a cancellable mouse move event and mouse button events.
- **NamespaceResourceManagerMixin** — ClassTransform hook into NamespaceResourceManager.getResource that serves resources in the prestige namespace from the client jar.
- **ParticleManagerMixin** — ClassTransform hook into ParticleManager.addParticle that posts a cancellable AddParticleEvent.
- **PlayerEntityMixin** — ClassTransform hook into PlayerEntity.resetTicksSince that posts a cancellable attack-cooldown reset event.
- **PlayerListEntryMixin** — ClassTransform hook into PlayerListEntry.getSkinTextures that lets SkinTexturesEvent replace tab-list skins.
- **PostEffectProcessorMixin** — Empty transformer for PostEffectProcessor (its hook bodies were not recovered); kept because the engine checks the hooked-class count against prestige-engine/targets.*.list.
- **ReloadableResourceManagerImplMixin** — ClassTransform hook into ReloadableResourceManagerImpl.getResource that serves prestige resources and the client's own glow, blur and rounded-rect shader files.
- **ScreenMixin** — ClassTransform hook into Screen that lets ScreenBackgroundEvent hide the menu background and background texture.
- **ServerWorldMixin** — ClassTransform hook into ServerWorld.createExplosion that posts an ExplosionEvent (integrated server).
- **SkyRenderingMixin** — ClassTransform hook into SkyRendering.updateRenderState that lets SkyColorEvent override the sky and horizon colors.
- **TextDisplayEntityRendererMixin** — ClassTransform hook into TextDisplayEntityRenderer.getLines that lets the label text event rewrite text-display lines naming a player.
- **TextVisitFactoryMixin** — ClassTransform hook into TextVisitFactory.visitFormatted that applies TextReplaceEvent replacements to rendered text.
- **WorldChunkMixin** — ClassTransform hook into WorldChunk.setBlockState that posts a BlockStateUpdateEvent for client-side block changes.
- **WorldMixin** — ClassTransform hook into World that lets events override the rain gradient and the time of day.
- **WorldRendererMixin** — ClassTransform hook into WorldRenderer that runs the client's 3D render pass after the frame graph and posts frustum setup and renderer reload events.
## `util` — Hook bridge between the injected game hooks and the client, keybinds, simulated clicks, notifications.
- **FrameDeltaTimer** — Measures the time between rendered frames (capped at 30 ms) and exposes it as an animation delta factor used for smooth rotations.
- **HookBridge** — Static trampolines called by the ClassTransform hook classes in mixin/: each creates, queries or posts one client event for a hooked Minecraft method, plus resource loading for prestige assets/shaders and the GUI/world render-pass plumbing.
- **LruCache** — Access-ordered LinkedHashMap that evicts its eldest entry once it holds more than maxSize entries.
- **NotificationManager** — Queues toast notifications (title, message, duration, type) and renders them stacked in the bottom-right corner every frame, dismissing duplicates.
- **SimulatedClickManager** — Tracks simulated mouse-button presses (button -> remaining hold ticks), releases them when they expire or the window loses focus, and suppresses vanilla attack/use/block-breaking while a simulated click is held.
## `combat` — Targeting, rotations, damage and threat calculation.
- **BotFilter** — AntiBot backend: keeps the set of position-packet-validated players and answers (cached per tick) whether an entity is a valid, non-bot target.
- **ClickScheduler** — Schedules a simulated mouse-button click after a delay and releases it after a randomized hold time (used by AutoClicker/RightClicker).
- **EquipmentSlotSwitchMap** — Compiler-generated enum switch map translating EquipmentSlot ordinals to AutoArmor switch cases.
- **ExplosionDamageCalculator** — Computes end-crystal, respawn-anchor and TNT-minecart explosion damage to an entity (exposure raycasts, armor, protection, resistance, difficulty) with a per-tick cache.
- **HudStyle** — Shared HUD style constants (text scales, paddings, corner radius, palette) and row/card height helpers used by HUD elements and nametags.
- **ItemUseCooldownAccessor** — Reflective accessor that reads and writes MinecraftClient.itemUseCooldown (used by FastPlace).
- **JumpCooldownAccessor** — Reflective accessor that writes LivingEntity.jumpingCooldown (used by NoJumpDelay).
- **NameTagEntry** — Per-player snapshot rendered by the NameTags module (name, pop count, health ratios and texts, measured widths, equipment and enchantment labels).
- **PearlFollowSimulatedPearl** — Client-side simulated ender pearl used by PearlFollow to predict where a pearl lands; stops and snaps to the hit position on collision.
- **PearlTrajectorySimulatedPearl** — Client-side simulated ender pearl stepped by the PearlTrajectory module to trace a thrown pearl's flight path.
- **PotionDisplayEntry** — Per-status-effect row state of the Potion Display HUD element (name, level, color, durations and fade animation).
- **TargetSelector** — Static target-selection helpers: closest enemy player/entity (optionally within an aim angle), player detection and shield-blocking checks.
- **TargetTracker** — Remembers the enemy player the local player last attacked (directly or via a nearby crystal) and forgets it after 5 s, death or 15 blocks.
- **ThreatAssessor** — Finds the most dangerous incoming damage source around an enemy (crystals, charged anchors, obsidian crystal spots, mace smashes) for totem prediction.
- **TrajectoriesSimulatedPearl** — Client-side simulated ender pearl stepped by the Trajectories module to preview the local player's pearl throw.
- **TwoDEspTarget** — Per-tick snapshot of a player shown by the 2D ESP module (name, health, size, distance, friend flag).
- **VisualRotationManager** — Smoothly interpolates the server-side rotation and temporarily applies it to the local player model while its render state is built, restoring the real rotation afterwards.
## `inventory` — Hotbar/inventory search and swapping.
- **AnchorUseGuard** — Decides whether vanilla item use should be cancelled while an anchor module is active and the player holds or aims at a respawn anchor.
- **DeathLootDetector** — Detects valuable PvP loot (gear, totems, gapples, crystals...) dropped near a position, i.e. a fresh kill, for the Pause On Kill options.
- **EnchantmentLabel** — Short enchantment label (e.g. "pro 4") drawn above an item in the NameTags module.
- **HeldItemRendererAccessor** — Reflective accessor for HeldItemRenderer equip progress and held stacks (used by the Animations module).
- **InventoryUtil** — Static inventory and hotbar helpers: weapon/item type checks, slot clicks and swaps, hotbar slot search/selection and splash potion lookup.
- **ItemEspLabel** — Label text and stack of a dropped item rendered by the ItemESP module.
- **PlayerInteractions** — Static helpers that perform player interactions (use block/item, attack, start gliding) and query reach distance and shield/usable-item state.
## `world` — Raycasts, block placement checks, rotation math, Minecraft accessors.
- **BlockUtil** — Block queries for combat placement: clickable blocks, crystal spots, entity occupancy, nearby block scans, respawn-anchor charges and cobweb-in-line-of-sight checks.
- **ClientChunkManagerAccessor** — Reflective accessor for ClientChunkManager's private chunk map.
- **ClientChunkMapAccessor** — Reflective accessor for ClientChunkMap's private chunk array.
- **CobwebSwitchBackTask** — Deferred task queued on the rotation handler that retries CobwebPlacer's hotbar switch-back on the next tick and re-queues itself while it is still pending.
- **CountPlacementModifierAccessor** — Reflective accessor for CountPlacementModifier's count provider (Ore Simulation).
- **DifficultySwitchMap** — Compiler-generated switch table mapping Difficulty ordinals to case numbers (used by DamageUtil).
- **HeightContextAccessor** — Reflective setter for HeightContext's minY and height fields (used when a HeightContext is built without a chunk generator).
- **HeightRangePlacementModifierAccessor** — Reflective accessor for HeightRangePlacementModifier's height provider (Ore Simulation).
- **HitParticlePhysics** — Base motion model for Hit Effect particles (legacy/pop variants): advances a particle and provides the passable-block test used for its block collisions.
- **LoadedChunkIterator** — Iterator over the client world's loaded chunks (read through the chunk-map accessors), optionally skipping chunks whose four neighbours are not loaded yet.
- **MeshBuilder** — Chainable mesh-building interface implemented by render/TextRenderer (MappedMeshBuilder): writes positions, colors, float attributes and indices, tracks a base-vertex offset and generates indices per GL primitive.
- **OreDefinition** — Ore-generation parameters of one placed ore feature (generation step, feature index, count, height range, rarity, vein size, discard-on-air chance, targets) plus display name and color, used by Ore Simulation.
- **PositionUtil** — Static helpers for entity positions (current/last tick), elytra gliding, game-profile names and a player's height above the ground.
- **RarityFilterPlacementModifierAccessor** — Reflective accessor for RarityFilterPlacementModifier's chance (Ore Simulation).
- **RaycastContextAccessor** — Reflective setter for RaycastContext's private start/end/shape/fluid/shape-context fields so one context object can be reused for many raycasts.
- **RaycastUtil** — Finds a point on a block's faces (or only its top face) that the player can see and reach within 4.25 blocks without blocks or entities in the way.
- **RotationUtil** — Rotation math: yaw/pitch toward points (optionally yaw-limited or jittered), angle distances, smoothed camera rotation, rotation direction vectors and raycasts along a rotation.
- **SimulatedBowArrow** — Client-only arrow entity ticked manually by the Trajectories module to trace bow/crossbow flight paths, recording whether the arrow hit an entity.
## `math` — Math helpers, particles, interpolation.
- **AutoCrystalRenderer** — Renders AutoCrystal's animated, fading target-block box that glides towards the current placement position.
- **BlockChangeTracker** — Tracks recently cleared blocks, explosions and our own block placements so anchor modules avoid acting on stale or just-exploded positions.
- **HitParticle** — A glow particle spawned by the HitEffect module on hits/totem pops, moved by a mode-specific motion model.
- **JumpCircle** — A ground ring spawned by the JumpCircles module where a player jumped, with its spawn time and lifetime.
- **LegacyParticlePhysics** — Legacy hit-particle motion model: slow gravity, damping and block-bounce collisions.
- **MotionState** — One predicted tick of the local player's motion (eye position, velocity, on-ground) used by DiagonalPearlCatch.
- **ObbyCrystalCandidate** — A scored AutoObbyCrystal placement candidate: base block, obsidian support block/side, aim point and whether obsidian must be placed or a crystal broken.
- **PearlLandingMarker** — Predicted landing point of a thrown ender pearl with its flight time and fade alpha, drawn by the PearlTrajectory module.
- **PopParticlePhysics** — Totem-pop hit-particle motion model: stronger gravity, damping and block-bounce collisions.
- **RenderCacheUtil** — Render helpers for LRU caches, quarter-step quantized cache keys and ARGB channel unpacking.
- **SettingValueParser** — Parses and validates textual config values and applies them to module settings of every setting type.
- **TexturedDrawModeKey** — Cache key (texture, corner radii, blend mode, depth test) for RoundedTextureShader draw modes.
- **TrailMark** — A single trail mark (footstep, ring or particle) spawned by the Trails module with its lifetime, yaw and motion.
- **TrailTracker** — Per-player state of the Trails module: last position a mark was dropped at and which foot steps next.
- **TwoDEspBox** — Animated screen-space box of a 2D ESP target (bounds, fade alpha, last frame seen, target snapshot).
- **UiMath** — UI math helpers (accent color, alpha, clamp, smooth approach, decimal flooring, special key names) plus an unused positioned-label component.
- **Vec3dMutator** — Reflectively overwrites the final x/y/z fields of a Vec3d so it can be reused as a scratch vector.
- **WeatherParticle** — A rain/snow/firefly/ember particle of the Weather module with position, velocity, age and flicker phase.
## `network` — Packet sending/queueing, ping and server-tick tracking.
- **BlockChangeListener** — Packet listener feeding BlockChangeTracker with cleared blocks, explosion centers and our own block placements, pruning old entries.
- **InteractItemPacketAccessor** — Reflectively overwrites the yaw/pitch of a PlayerInteractItemC2SPacket for silent rotations.
- **InventorySwapQueue** — Queues inventory slot-swap clicks until the player is stationary and not sprinting server-side, holding movement input meanwhile and running completion callbacks.
- **PacketSender** — Sends a packet through the client's network handler.
- **SilentSlotManager** — Silently switches the server-side selected hotbar slot, blocks vanilla slot packets while spoofing and restores the real slot before interactions.
- **TotemPopManager** — Counts totem pops per player from entity-status packets, clearing counts on death, despawn and world join.
## `render` — Custom renderer: shaders, GPU buffers, 2D/3D drawing, fonts, ESP outlines.
- **ApplyCallbackState** — Pipeline state that runs a callback when the render pass is applied (e.g. to bind a texture).
- **AuraOutlineShader** — ESP post shader for the 'Aura' mode: draws entity models into the mask texture and composites it with aura_outline.frag (crisp core line plus soft halo).
- **AxisSwitchMap** — Compiler-generated switch map over Axis.
- **BlurredRoundedRectShader** — Frosted-glass panel renderer: draws a rounded rectangle that samples the GaussianBlur of the main framebuffer (rounded_texture_blurred.frag), caching one blur per blur radius and one DrawMode per corner-radius set.
- **BoundMethod** — MethodAccessor bound to a target instance so it can be invoked with just the arguments.
- **BufferSource** — Per-DrawMode pool of GPU vertex/index buffers (like vanilla's VertexConsumerProvider.Immediate): hands out a mesh builder per draw mode during a render event and draws every requested mode on flush.
- **CallbackDrawCommand** — Draw command whose vertices are produced by a lambda (depth, builder), for a given pipeline and optional scissor rect.
- **ChamsOutlineShader** — ESP post shader for the 'Chams' mode: composites the entity mask with chams_outline.frag as a flat translucent fill with a darker rim.
- **ConfigReport** — Counters collected while saving or loading a config (sections, values, warnings, errors) with a compact summary string.
- **ConfigureCallbackState** — Pipeline state that runs a callback on the render-pass builder before the pass is built.
- **CooldownProgress** — Progress value (0..1) of the current item use or attack cooldown shown by the cooldown indicator HUD element.
- **CoreShaders** — Shared shader programs: position-color, position-color-texture, rounded rect, gaussian blur and MSDF text.
- **CornerRadii** — Rounded-rect corner radii quantized to 0.25 px (shader component order x=top-right, y=bottom-right, z=top-left, w=bottom-left); hashable so it can key the rounded-rect pipeline cache.
- **CornerRadiiUniform** — Pipeline state that uploads quantized per-corner radii to the rounded_pos_color shader's 'roundness' vec4 uniform.
- **DamageSample** — Timestamped amount of health lost, kept by AutoTotem to estimate the recent damage rate.
- **DelayTimer** — One-shot timer that reports once a fixed delay (ms) has passed since creation; SafeAnchor keeps one per anchor as a randomized reaction delay.
- **DrawCommand** — Deferred 2D draw command: emits its vertices into a vertex builder at a given depth and exposes the batch key (pipeline + scissor) used for batching.
- **DrawCommandQueue** — Deferred 2D draw queue: collects draw commands with increasing depth, batches consecutive commands sharing pipeline and scissor, and draws them from shared vertex/index buffers.
- **DrawPipeline** — Immutable draw pipeline: vertex format, GL primitive mode, entity-mask flag and the pipeline states that are configured, applied and reset around each indexed draw.
- **DrawPipelines** — Predefined DrawModes for the pos_col shader (triangles/lines with or without depth test and culling) plus a cache of rounded-rectangle DrawModes keyed by corner radii.
- **EntityTypeSet** — Thread-safe set (with a read-only view) of the entity types selected as shader-ESP targets.
- **EspShaderManager** — Global state of the shader ESP: active post shader, enabled/force-invisible flags, target entity types and caches mapping entity model classes to those types; hooks the shader into the render events.
- **FontManager** — Loads and caches MSDF fonts by name; the default font is 'inter'.
- **FullscreenPassChain** — Ordered list of fullscreen shader passes (shared static screen quad), each with a target framebuffer and a uniform-setup callback; used for post-processing (outlines, blur, storage glow).
- **GameRendererAccessor** — Reflective accessor for GameRenderer's overlayRenderer field.
- **GaussianBlur** — Two-pass separable Gaussian blur of Minecraft's main colour buffer into its own textures (horizontal then vertical pass), re-run at most once per frame or on resize; its output texture backs the frosted-glass HUD panels.
- **GlBuffer** — Cleaner-managed OpenGL buffer object (bound as GL_ARRAY_BUFFER) supporting allocation, mapped ranges and unmapping.
- **GlFramebuffer** — Cleaner-managed OpenGL framebuffer object with helpers to attach textures and clear its color buffer.
- **GlPrimitiveSwitchMap** — Compiler-generated switch map over GlPrimitive used by the vertex builder's index generation, plus that interface's assertion flag.
- **GlRenderPass** — One OpenGL draw pass: binds a target framebuffer, optionally clears colour/depth, uses a shader program, uploads the projection/view matrices and issues indexed draws.
- **GlRenderPassBuilder** — Builder for a RenderPass: target framebuffer (id or supplier), optional clear color/depth and the shader program.
- **GlStateSnapshot** — Snapshot of the OpenGL state (capabilities, program, VAO/buffers, texture bindings, blend, scissor, read/draw framebuffers) captured before custom rendering and restored afterwards.
- **GlTextureHandle** — Wrapper around an OpenGL texture object (owned and Cleaner-deleted, or wrapping an existing GL/Minecraft texture) with one-time storage allocation, sub-image uploads and filter/wrap parameters.
- **GlyphQuadCommand** — Draw command for one textured MSDF glyph quad: screen rect, atlas UVs, ABGR color and optional transform matrix.
- **GlyphVisitor** — Callback invoked for each glyph while iterating a string; returning false stops the iteration.
- **GuiRendererAccessor** — Reflective accessor for GuiRenderer's guiProjectionMatrix field.
- **JumpKeyPresser** — Presses the jump key programmatically for two ticks (used by elytra/wind-charge modules) and releases it again unless the player is physically holding it.
- **JumpKeyReleaser** — Client-tick listener for JumpKeyPresser that counts down the forced jump press and releases the key when it expires.
- **KeyBindingAccessor** — Reflective accessor for a KeyBinding's bound key.
- **MappedMeshBuilder** — Mesh builder (the only WorldContract implementation) that writes vertex attributes and indices straight into mapped GPU vertex/index buffers, growing them on demand and tracking a base vertex for index generation.
- **MinecraftAccess** — Interface exposing the MinecraftClient instance as the constant 'mc' to modules, HUD elements, managers and render helpers.
- **ModuleToast** — Toast entry of the module-notifications HUD element: title, message, type, creation time, fade animation and dismissed flag.
- **MouseAccessor** — Reflectively invokes Mouse.onMouseButton to simulate mouse button presses and releases.
- **MsdfFont** — MSDF atlas font loaded from assets/prestige/font/<name>.json/.png; measures text and queues glyph quads into the deferred 2D draw queue.
- **Notification** — Animated on-screen notification (icon, title, message, timed progress bar) drawn and stacked by the notification manager.
- **NotificationTypeSwitchMap** — Compiler-generated switch map over NotificationType.
- **OutlineShader** — ESP post shader for the 'Normal' mode: composites the entity mask with outline.frag (glowing outline with optional fill).
- **PearlThrowSolution** — Best pearl throw found by DiagonalPearlCatch: throw tick, yaw/pitch, closest miss distance and the target-path tick of closest approach.
- **PostShader** — Base class of the ESP post-processing shaders: entity models are drawn into an offscreen mask texture, which is then composited onto the screen by a full-screen pass with shader-specific uniforms.
- **ProjectionMatrixAccessor** — Reflectively calls ProjectionMatrix2.getMatrix(width, height).
- **QueuedSlotSelect** — Deferred hotbar slot selection run by the rotation manager, limited to one slot switch per tick (re-queues itself otherwise).
- **QueuedSwapClick** — Inventory SWAP click (slot, hotbar button, owner, completion callback) queued by PacketQueue until it can be sent.
- **RainbowOutlineShader** — ESP post shader that composites the entity mask with rainbow_outline.frag (animated rainbow outline and glow).
- **RandomUtil** — Shared Random plus helpers for a random float/int within a range (used for humanised delays, chances and jitter).
- **Render2D** — Static 2D/overlay render helpers: per-frame projection/model-view/camera matrices and viewport, world-to-screen projection, tick interpolation, wave colors and convenience draw calls (rects, circles, textures, item icons).
- **RenderCallback** — Listener type of RenderEvents, called with the per-pipeline buffer cache and the camera matrices.
- **RenderCore** — Core of the custom renderer: GL-resource Cleaner, global BufferSource, render-thread task queue and executor, frame counter, main-framebuffer queries, camera-relative transforms, and dispatch of the world/HUD render events.
- **RenderEvents** — Fabric events fired by the render hooks (2D/HUD pass, world pass, and after the HUD pass), each receiving the per-pipeline buffer cache and the camera matrices.
- **RenderLayerAccessor** — Reflective accessor for a RenderLayer's renderSetup field.
- **RenderLayerUtil** — Helpers for the entity-outline ESP hook: reads the GL texture id of a vanilla RenderLayer and tees a model's VertexConsumer into the ESP outline shader's buffer.
- **RenderStateElement** — One piece of GL pipeline state of a DrawMode (target framebuffer, shader, capability toggle, blend, depth mask/func, scissor, uniforms): configures the pass builder, applies before the draw and restores afterwards; static factories create the standard elements.
- **Rotation** — Yaw/pitch rotation, flagged as clamped when the yaw step towards the target was limited by the maximum rotation speed.
- **RotationProvider** — Implemented by modules that want to control the player's rotation; the rotation manager polls registered providers by priority every tick.
- **RoundedOutlineShader** — Draws anti-aliased rounded-rectangle outlines (rounded_outline_pos_color.frag) on the 2D draw queue, emitting only the four edge strips when the rectangle is large enough.
- **RoundedRectShader** — Draws filled anti-aliased rounded rectangles (rounded_pos_color shader, SDF corners) on the 2D draw queue, caching one DrawMode per corner-radius set.
- **RoundedTextureShader** — Draws textures inside rounded rectangles with a tint blend mode (rounded_texture shader): 2D icons/sprite regions on the draw queue and world-space (optionally per-corner tinted) quads through the BufferSource.
- **ScheduledClick** — Simulated mouse click scheduled by AimManager: button, creation time, press delay, hold duration and whether it is already pressed.
- **Shader** — Linked OpenGL shader program handle (freed via the Cleaner) with cached projMat/viewMat uniform locations and uniform helpers.
- **ShaderBase** — Abstract base for renderers that own one GLSL program loaded from a vertex/fragment resource pair; also exposes the client and a start timestamp for time-based uniforms.
- **ShaderCompiler** — Compiles GLSL vertex/fragment sources from the classpath and links them into a Shader program (SPIR-V path removed).
- **ShapeRenderer** — Static shape-drawing API: world-space paths, discs, glow rings and boxes written into the BufferSource, and 2D triangles, rects, (gradient) rounded rects, circles and rings queued on the shared 2D draw queue; also ARGB->ABGR colour helpers.
- **SilentRotationManager** — Server-side (silent) rotation manager (Prestige.o): collects rotation requests from registered providers, applies them to movement packets/travel/jump and item-use packets, supports an owner-held rotation lock, tracks whether an action was already performed this tick and runs scheduled tasks and hotbar switches on the next tick.
- **SnapGuide** — HUD-editor snap guide line along one axis at a fixed coordinate.
- **StopWatch** — Millisecond stopwatch used for click/place delays (fixed or randomized via a RangeSetting).
- **StorageOutlineRenderer** — StorageESP glow effect: renders storage-block geometry into an offscreen mipmapped framebuffer and composites it onto the screen with the storage_outline post shader (quality/radius/fill).
- **SwapBackTracker** — Global owner-tracked record of the hotbar slot that was selected before a module started swapping, so the owning module can swap back when it is done.
- **TextureLoader** — Loads PNG/JPEG classpath resources into GL textures via STBImage, with optional mipmaps and anisotropic filtering.
- **ThreatAssessment** — Most dangerous nearby damage source (crystal/anchor/obsidian/mace) with raw and confidence-weighted damage, used for totem decisions.
- **ToggleAnimation** — Time-based eased animation between an off and an on state that reverses smoothly from its current progress when toggled.
- **VertexArray** — Cleaner-managed OpenGL vertex array object that tracks and updates its vertex attribute bindings.
- **VertexLayout** — Vertex layout: ordered attribute elements with computed byte offsets and stride; creates per-attribute buffer bindings for a VAO.
- **VertexLayouts** — Predefined vertex layouts matching the shaders (position, position+colour, +uv, +normal, rounded-rect uv/size/colour, fullscreen uv).
- **VirtualKeyMapper** — Translates Windows virtual-key codes (how keybinds are stored) into GLFW key codes.
## `hud` — Draggable HUD widgets.
- **CartHelperElement** — Cart-PvP HUD panel showing trigger readiness (rail, TNT minecarts and a bow or charged crossbow in the hotbar), the crossbow charge state/bar and the TNT-minecart stock.
- **CooldownIndicatorElement** — Themed cooldown bar under the crosshair that replaces the vanilla attack indicator and shows attack cooldown, item cooldowns and bow/crossbow/trident charge with fade and ready-flash animations.
- **CrosshairElement** — Custom crosshair widget that cancels the vanilla crosshair and draws an accent-colored dot and pulsing ring that flashes white while the aimed-at entity is hurt.
- **FPSElement** — HUD panel showing the client's frame rate with a smoothed, color-graded value and a 24-sample history bar graph.
- **HudElement** — Base class of every draggable HUD widget: stores its name, enabled toggle and screen rectangle, resolves an edge/center anchor + offset layout (persisted in the config), and implements the HUD-editor row, dragging with snap guides and keyboard nudging.
- **KeybindsElement** — HUD panel listing every enabled module that has a keybind, each row showing the key name and module name with fade-in/out animations.
- **LatencyElement** — HUD panel showing the player's own ping from the tab list with a smoothed, color-graded value and a 24-sample history bar graph.
- **ModuleListElement** — Array-list HUD widget showing all enabled modules sorted by name width, with slide/fade animations and a brief highlight when a module gets enabled.
- **ModuleNotificationsElement** — Toast-notification HUD widget (global instance) that stacks module toggle and module status messages with type icons, colors and a lifetime bar.
- **OffscreenArrowElement** — Draws a glowing arrowhead around the screen center pointing toward the closest player while that player is outside the view cone.
- **PotionDisplayElement** — HUD panel listing the player's active status effects with roman-numeral level badges, remaining duration (blinking when low) and a duration progress bar.
- **ResourcesElement** — HUD panel counting gapples, totems, end crystals and XP bottles in the inventory and raising a warning toast when a count drops below its threshold.
- **TPSElement** — HUD panel estimating the server tick rate from the interval between WorldTimeUpdate packets, with a smoothed, color-graded value and a 24-sample history graph.
- **TargetElement** — Target HUD card for the current combat target (or yourself in the editor) with skin face, name, distance, armor/held items and an animated health bar with damage trail and hurt flash.
- **TimeElement** — HUD clock panel showing the weekday, HH:MM with a blinking colon, small seconds and a bar tracking progress through the current minute.
- **WatermarkElement** — HUD watermark panel with the client logo and a pulsing accent-colored "Prestige Client" title.
- **WebsiteElement** — HUD panel showing the client website address in a pulsing accent color.
## `gui` — ClickGUI / HUD-editor screens.
- **BaseScreen** — Minimal Minecraft Screen with an empty title that Prestige's own screens extend.
- **ClickGuiScreen** — Placeholder Minecraft screen for the ClickGUI: on first render it opens the native GUI overlay and it closes itself (and the overlay) when the overlay is dismissed or the screen is closed.
- **HandledScreenAccessor** — Reflective accessor that reads a HandledScreen's private focusedSlot (the inventory slot under the mouse).
- **HudEditorScreen** — Owner of all HUD elements and the HUD editor screen: renders enabled elements in-game and, while editing, draws the grid, the draggable element-list panel, snap guide lines and key hints, handling dragging, toggling, arrow-key nudging and layout reset.
- **LockedInventoryScreen** — InventoryScreen variant that ignores mouse clicks and hotbar number keys, opened by AutoTotem so the player cannot interfere with its scripted totem slot clicks.
## `config` — Config (de)serialisation and resource loading.
- **ClasspathResource** — Normalized classpath resource path (e.g. a font's .json/.png under assets/prestige) that can open itself as an InputStream from the mod jar.
- **ClasspathResourcePack** — Stub ResourcePack whose static factories wrap mod-jar classpath files as Minecraft Resources/InputSuppliers, used by resource-manager mixins to inject Prestige shaders and assets.
- **ConfigManager** — Serializes the Menu, every module's settings/enabled state and the HUD layout into a JSON snapshot and applies such snapshots back (size/depth checks, lifecycle rollback, unknown-key warnings), reporting results as a config toast.
- **MsdfFontMetrics** — Font-wide metrics (em size, line height, ascender/descender, underline position/thickness) parsed from the 'metrics' block of an msdf-atlas-gen font JSON for the MSDF text renderer.
- **MsdfGlyph** — One glyph entry of an msdf-atlas-gen font JSON: its unicode code point, advance, and plane (layout) and atlas (texture) bounds used to build glyph quads.
## `reflect` — Reflection/MethodHandle access to private Minecraft members.
- **BoundField** — A FieldAccessor bound to one target instance, exposing get() and set(value).
- **CameraAccessor** — Wraps a Camera and calls its protected setPos/setRotation through statically cached, remapped MethodAccessors.
- **FieldAccessor** — Fast get/set accessor for one resolved (possibly private/final) field using Unsafe offsets, a VarHandle or plain reflection, with factories that remap Yarn field names to runtime names and can bind it to an instance.
- **FieldCacheKey** — Cache key (owner class, Yarn field name, field type, target runtime class) for remapped FieldAccessor lookups.
- **MappedField** — Field handle resolved once from a Yarn field name (kept in static finals) offering fast Unsafe/VarHandle/reflective setDouble/setFloat/set/get, falling back to a per-call remapped lookup when resolution failed.
- **MethodAccessor** — Invoker for a resolved (possibly private) method through a cached MethodHandle spreader, with factories that remap Yarn method names to runtime names, cache the results and bind to an instance.
- **ReflectionBase** — Shared reflection core for the accessors: obtains sun.misc.Unsafe, forces accessibility, strips final modifiers, parses type descriptors and caches resolved fields and methods across class hierarchies.
- **ResolvedField** — Immutable result of resolving a field: the reflective Field, whether it is static, its Unsafe static base and offset, and an optional VarHandle.
- **ResolvedMethod** — Immutable result of resolving a method: the reflective Method, its unreflected MethodHandle and whether it is static.
## `data` — Small records and value holders.
- **AnchorCandidate** — AutoAnchor candidate anchor position with placement click, charge count, distances to the target and a heuristic score.
- **AnchorCatchPearlLanding** — AnchorPearlCatch prediction of where an enemy ender pearl lands and in how many ticks.
- **AuraCartPlacement** — CartAura record of a TNT minecart the player placed (position and time).
- **AutoAnchorPlaceTarget** — AutoAnchor placement click: the neighbouring block to click and the hit vector on its face.
- **AutoAnchorPlan** — AutoAnchor plan: chosen anchor position with its placement click and an optional blocker that shields the player.
- **BlendFuncState** — Render-state element that enables blending with a custom separate blend function and restores the blend flag afterwards.
- **BlendToggleState** — Render-state element that enables standard alpha blending (or disables blending) for a pass and restores it afterwards.
- **CameraMatrices** — Matrices for a render pass: projection, model-view and the camera (null for the 2D HUD pass).
- **CartBlockerPlacement** — AutoSafeCart candidate block placement that shields the player from a TNT minecart, with the resulting self damage.
- **CartCatchPearlLanding** — CartPearlCatch prediction of where an enemy ender pearl lands and in how many ticks.
- **CartThreat** — AutoSafeCart threat: a TNT minecart, where it would explode, its horizontal speed and the damage it would deal.
- **DelayedPacket** — Backtrack packet held back until its release time.
- **DepthFuncState** — Render-state element that sets glDepthFunc for a pass and restores the previous function afterwards.
- **DepthMaskState** — Render-state element that sets glDepthMask for a pass and restores the previous value afterwards.
- **DimensionChunkKey** — OreSimulation map key: dimension registry key plus packed chunk position.
- **DrawBatchKey** — Key that groups queued 2D draws into one batch: optional scissor rectangle and draw mode.
- **DrawModeBuffers** — Per-draw-mode GPU resources of the batching buffer source: vertex/index buffers, vertex array and the builder currently writing into them.
- **ExplosionDamageKey** — Per-tick cache key for explosion damage calculations (target, explosion position and calculation options).
- **FramebufferBindState** — Render-state element that selects the target framebuffer (via an id supplier) for a pass.
- **GlCapabilityState** — Render-state element that glEnables/glDisables a capability (cull face, depth test, ...) for a pass and restores it afterwards.
- **KeybindListEntry** — Row of the keybinds HUD element: module, bound key name and fade-in alpha.
- **MeshInfo** — Size of a built mesh: vertex layout, vertex count and index count.
- **MethodLookupKey** — Cache key for reflective method accessors (owner, name, return type, parameter types, receiver class).
- **MsdfFontState** — Render-state element that binds an MSDF font atlas texture and uploads its unitRange uniform.
- **OutlineCaptureConsumer** — VertexConsumer that copies positions and UVs of vanilla geometry into the outline shader mesh with a fixed mask color.
- **PearlCatchAnchorPlan** — AnchorPearlCatch plan: where to place/charge the anchor near the pearl landing and an optional blocker that shields the player.
- **PearlCatchPlaceTarget** — AnchorPearlCatch placement click: the neighbouring block to click and the hit vector on its face.
- **PearlFollowLanding** — PearlFollow simulation result of a pearl throw: landing position, flight ticks and peak height.
- **PearlThrowOption** — PearlFollow candidate pearl throw: pitch, landing distance to the followed pearl, flight time and peak height.
- **PendingModuleActivation** — Config loading: a module whose saved Enabled state is applied after all settings have been loaded.
- **ProgramUniforms** — Fluent uniform setter for a GL shader program with a per-program cache of uniform locations.
- **QueuedCrystalAttack** — AutoCrystal crystal attack queued for a later tick together with the rotation it was aimed with.
- **QueuedDraw** — A queued 2D draw call with the depth value that keeps submission order when batches are flushed.
- **QueuedRenderPass** — A configured render pass queued in a vertex buffer together with the callback that draws into it.
- **RoundedOutlineKey** — Cache key for rounded-outline draw modes: per-corner radii and outline thickness.
- **SafeCartPlacement** — AutoSafeCart record of a TNT minecart the player placed (position and time) so own carts are not treated as threats.
- **ScissorState** — Render-state element that sets (or disables) the GL scissor rectangle for a pass and restores the scissor flag afterwards.
- **ShaderBindState** — Render-state element that selects the shader program used by a pass.
- **StorageBlockMarker** — StorageESP marker for one storage block: block coordinates and the packed ABGR color to draw it with.
- **TrajectoryPath** — Simulated projectile path for the Trajectories module: the points and whether the projectile hit something.
- **UniformCallbackState** — Render-state element that hands the pass shader program's uniform setter to a callback.
- **VertexAttributeBinding** — Binding of one vertex attribute to a GPU buffer (element format, stride and byte offset) inside a vertex array object.
- **VertexElement** — One element of a vertex layout: component count, GL component type, bytes per component and normalization flag.
## `type` — Enums.
- **AnchorCatchState** — State machine of the AnchorPearlCatch module.
- **AnimationMode** — Animation style of the HitEffect module.
- **ArmorState** — Armor swap state of the AutoTotem module (none, equip, restore).
- **AutoAnchorState** — State machine of the AutoAnchor module.
- **AutoCartState** — State machine of the AutoCart module.
- **BlendMode** — Color blend mode for textures/shaders (multiply, overlay, replace, add, screen).
- **CartCatchState** — State machine of the CartPearlCatch module.
- **CartIgnitionMode** — How AutoCart ignites the TNT minecart: wait passively or shoot it with a bow.
- **CobwebPlaceState** — Placement progress of the CobwebPlacer module.
- **DiagonalPearlState** — State machine of the DiagonalPearlCatch module.
- **DoubleAnchorState** — State machine of the DoubleAnchor module.
- **Easing** — Standard easing curves (sine, cubic, quad, ..., back) applied to a 0..1 progress value.
- **EventPhase** — Phase of an event: PRE, NONE or POST.
- **FastPearlCatchStage** — Stages of the FastPearlCatch module.
- **GlPrimitive** — Primitive type of a mesh draw (quads, triangles, fan, line strip, lines).
- **GuideAxis** — Axis of a HUD-editor snapping guide line.
- **HitFlickState** — State machine of the HitFlick module (idle, flick, attack).
- **HudAlignment** — Horizontal/vertical alignment of a HUD element (start, center, end).
- **HudAnchor** — Screen corner a HUD element is anchored to.
- **NotificationType** — Notification severity with its accent color.
- **ObbyCrystalState** — State machine of the AutoObbyCrystal module.
- **ScoopState** — State machine of the AntiWeb module (place water, wait, scoop it back).
- **ShaderMode** — ESP outline style and the post-processing shader that renders it.
- **SwapQueueResult** — Outcome of an inventory swap request: done immediately, queued or rejected.
- **ThreatType** — Kinds of incoming damage threats (crystal, anchor, obsidian+crystal, mace) with a confidence weight for totem prediction.
- **XbowCartState** — State machine of the XbowCart module.
## `social` — Friends and Mojang profile lookups.
- **FriendManager** — Stores friend names (teammates count as friends) and lists online non-friend players.
- **MojangApi** — Looks up player UUIDs and signed game profiles (with skin properties) from the Mojang web APIs.
## `input` — Mouse/keyboard input handling.
- **KeybindManager** — Turns key and mouse-button events into module keybind toggles, opens the click GUI on the menu key (or when the native side requests it) and applies a pending GUI scale change each frame.
## `annotation` — Marker annotations left by the original build.
- **Chainable** — Marker annotation for API methods that the native module calls/chains into.
- **NativeId** — Annotation carrying the UUID that binds a Java stub to a function of the native module.
## `engine` — Loader glue: applies the ClassTransform hooks from inside Sponge Mixin (written for the open-source build).
- **EngineDev**
- **EnginePlugin**
- **EngineState**
## `ui` — Dear ImGui ClickGUI and the reflection bridge to the client (written for the open-source build).
- **ConfigsPage**
- **CreateConfigPage**
- **Data**
- **DetailPage**
- **DevCmd**
- **Glow**
- **Input**
- **KeybindsPage**
- **Lib**
- **LocalConfigs**
- **ModulesPage**
- **SettingsPage**
- **SocialsPage**
- **Theme**
- **ThemesPage**
- **Ui**
- **WidgetsPage**
## `ui/bridge`
- **Bootstrap**
- **Bridge**
- **DumpHook**
## `ui/mc`
- **Entry**
- **Icons**
- **Overlay**
- **Skid**
## `ui/mixin`
- **EventBusStatsMixin**
- **KeyboardHandlerMixin**
- **MouseHandlerMixin**
- **RenderSystemMixin**
`engine/mixin/I00..I41` and `N00..N41` are empty anchor mixins (one per hooked Minecraft class, intermediary/named); `EnginePlugin` addresses them by index, so they keep numeric names.
+50
View File
@@ -0,0 +1,50 @@
# Readability refactor
The decompiled tree was still Zelix-KlassMaster-shaped: methods took a packed `Object[]` plus a fake `long` key,
every class carried unused reflection helpers, and almost every identifier was `a`, `b_float____`, `var12` or
`RenderHelper27`. This pass turned it into normal, readable Java without changing behaviour.
## What changed
**Structure** (done with a javac-driven tool, so every call site was resolved by the compiler, not by text matching):
- `m(Object[] a) { T x = (T) a[0]; long key = (Long) a[1]; ... }` called as `m(new Object[]{v, key})` became
`m(T x)` called as `m(v)` — 1,488 method families, 7,262 call sites; constructors lost their trailing key too.
- The key plumbing (`long k2 = key ^ 0x...L;`, `var1 = 0L;`) is gone (~5,300 statements).
- Removed: ~1,500 unused per-class reflection helpers, 445 no-op string-table calls (`Event.b();`), 1,302 redundant
casts (`(Float) floatSetting.getValue()`), unused locals/imports, and 30 dead classes — including the obfuscator's
key-generator runtime that an earlier pass had misnamed `BufferBuilder`/`RenderHelper33`/`VertexSink`.
- Decompiler stack temporaries (`float var10002 = ...; f(var10002)`) were inlined back into expressions wherever the
evaluation order provably stays the same; constant tables recovered by the previous pipeline were folded into literals.
**Names**: ~276 classes, ~2,400 fields, ~2,200 method families (overrides renamed together) and ~8,300 locals/parameters
now have descriptive names. Module setting fields are named after their UI display names, event classes after the game
hook that fires them, `@Subscribe` handlers `on<Event>`, hook handlers after the hooked method and injection point.
`docs/CODE_MAP.md` describes every class; `docs/rename_log.tsv` maps each old class/field/method name to its new one.
(`docs/classmap*.tsv`, `docs/mapping.tsv` and `docs/notes/` describe the tree *before* this refactor.)
**Runtime contracts updated alongside** (these bind by string, so the compiler cannot check them):
- `prestige_ui/manifest_live.json` — setting `field` names rewritten for all 686 settings.
- `ui/bridge/Bridge` — calls `Module.toggle()` without the old packed argument.
- `ui/mixin/EventBusStatsMixin` — targets `post(Event)` instead of the old `post(Object[])` descriptor.
- `ui/DevCmd` — uses compile-checked references instead of reflection on obfuscated names.
- `prestige-engine/transformers.list` — three empty `MinecraftClient` transformers removed, the remaining one renamed.
## Bug fixed: modules switching off when the menu closes
The client's keybind flag means **hold** (active only while the key is down, switched off whenever a screen opens), but
the previous pipeline had named it `toggleMode` and the ImGui menu was built on that name, so it showed the flag as
"Toggle" and set it when a key was bound. Every key bound in the menu became a hold bind; closing the menu with the menu
key (whose release briefly opens the legacy `ClickGuiScreen`) then switched those modules off. The flag is now
`KeybindSetting.holdMode` and `ui/bridge/Bridge` inverts it for the menu. The config format (`key.hold`) is unchanged;
binds saved while the bug existed show as "Hold" and can be switched back to "Toggle" in the menu.
## How it was verified
- Every pass recompiled the full tree with 0 errors; `gradlew build` succeeds.
- Each rename pass re-attributed the tree and compared all ~122,000 references: every one still resolves to the same
declaration as before (no shadowing, overload capture or accidental overrides).
- A contract check loads the compiled classes and verifies every reflective name the UI bridge, `Bootstrap`, the manifest,
the mixin configs, the transformer list and the Fabric entrypoints rely on.
## Known leftovers
- Raw types (`List`, `Set`, `Map`) and some casts on lambdas are decompiler output and were left as they are.
- A few names are best guesses where the original code is ambiguous or partly stripped (e.g. the empty `Native` stubs).
- `engine/mixin/I00..N41` keep numeric names on purpose: `EnginePlugin` generates those names by index.
+4905
View File
File diff suppressed because it is too large. Load diff
+11
View File
@@ -0,0 +1,11 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4
[[package]]
name = "prestige-injector"
version = "0.1.0"
[[package]]
name = "prestige_native"
version = "0.1.0"
+10
View File
@@ -0,0 +1,10 @@
[workspace]
resolver = "2"
members = ["crates/loader", "crates/injector"]
[profile.release]
opt-level = "s"
lto = true
codegen-units = 1
panic = "abort"
strip = true
+32
View File
@@ -0,0 +1,32 @@
# Prestige injector (Rust)
`PrestigeInjector.exe` loads `prestige_native.dll` into a running Minecraft **1.21.11 Fabric** JVM (64-bit, Fabric Loader 0.19.x,
Fabric API installed). It uses the same overall method as the openvape bundle, written from scratch in Rust with no external crates.
## How it works
1. **Injector** lists visible `java.exe`/`javaw.exe` windows (refreshed every 750 ms), then runs `LoadLibraryW` in the chosen
process through `CreateRemoteThread` and confirms the module is mapped.
2. **`prestige_native.dll`** (`DllMain` only spawns a worker thread):
- waits for `jvm.dll`, `JNI_GetCreatedJavaVMs`, attaches, acquires the JVMTI redefine/retransform capabilities;
- writes the embedded payload jar (the remapped `prestige-*.jar`) to `%TEMP%\PrestigeLoader`;
- `FabricLauncherBase.getLauncher().addToClassPath(jar)` so payload and game classes share the Knot class loader;
- registers `NativeBridge.classBytes` / `NativeBridge.redefine` and calls `Bootstrap.start()`.
3. **`Bootstrap`** (Java) waits for the client window, then for every ClassTransform hook target gets the current class bytes
(JVMTI retransform capture), runs the hooks through `InPlaceTransformer` and redefines the class. The bundled ClassTransform
inlines hook handlers into the target methods, so normally nothing is added to the class and a plain redefine works. If a
transformer ever does add methods (a running JVM cannot), they are moved into generated `dev.zprestige.prestige.hooks.H*`
helper classes, call sites become `invokestatic`, and private member access goes through `Access` MethodHandles.
Finally the Prestige and ClickGUI entrypoints run on the client thread.
Log: `prestige-native.log` beside the DLL, plus `[Prestige-Inject]` lines in the game log.
## Build
```powershell
.\build-injector.ps1 # gradlew remapJar, cargo build --release, copies to dist\
```
## Use
Start a Fabric 1.21.11 instance, then run `dist\PrestigeInjector.exe` (or `PrestigeInjector.exe <pid> [dll]`).
+8
View File
@@ -0,0 +1,8 @@
[package]
name = "prestige-injector"
version = "0.1.0"
edition = "2021"
[[bin]]
name = "PrestigeInjector"
path = "src/main.rs"
+280
View File
@@ -0,0 +1,280 @@
//! PrestigeInjector: lists the running Minecraft (javaw/java) processes and loads prestige_native.dll into the selected one
//! with the classic remote LoadLibraryW thread. The DLL does everything else once it is inside the JVM; the injector tails
//! the DLL's log so every stage (transforming, injecting, initialising) is visible.
//!
//! PrestigeInjector.exe interactive process picker (Up/Down, Enter, Esc)
//! PrestigeInjector.exe <pid> [dll path] non-interactive
mod win;
use std::fs;
use std::io::{self, Read, Seek, SeekFrom, Write};
use std::path::{Path, PathBuf};
use std::process::ExitCode;
use std::time::{Duration, Instant};
const DLL_NAME: &str = "prestige_native.dll";
const WATERMARK: &str = "Cracked by Skid Solutions";
const INVITE_URL: &str = "https://discord.gg/M56rd2wwC5";
/// How long to follow the DLL's progress after it has been loaded.
const FOLLOW_TIMEOUT: Duration = Duration::from_secs(180);
const RESET: &str = "\x1b[0m";
const DIM: &str = "\x1b[90m";
const CYAN: &str = "\x1b[96m";
const GREEN: &str = "\x1b[92m";
const YELLOW: &str = "\x1b[93m";
const RED: &str = "\x1b[91m";
fn default_dll() -> PathBuf {
std::env::current_exe()
.ok()
.and_then(|exe| exe.parent().map(|dir| dir.join(DLL_NAME)))
.unwrap_or_else(|| PathBuf::from(DLL_NAME))
}
fn banner() {
println!("{CYAN} ___ ___ ___ ___ _____ ___ ___ ___ ");
println!(" | _ \\ _ \\ __/ __|_ _|_ _/ __| __|");
println!(" | _/ / _|\\__ \\ | | | | (_ | _| ");
println!(" |_| |_|_\\___|___/ |_| |___\\___|___|{RESET} injector");
println!("{YELLOW} {WATERMARK}{RESET}\n");
}
fn step(label: &str, message: &str) {
println!("{DIM}[{:>7}]{RESET} {CYAN}{label:<12}{RESET} {message}", clock());
}
fn ok(label: &str, message: &str) {
println!("{DIM}[{:>7}]{RESET} {GREEN}{label:<12}{RESET} {message}", clock());
}
fn fail(label: &str, message: &str) {
println!("{DIM}[{:>7}]{RESET} {RED}{label:<12}{RESET} {message}", clock());
}
/// Seconds since the injector started, for the log prefix.
fn clock() -> String {
use std::sync::OnceLock;
static START: OnceLock<Instant> = OnceLock::new();
format!("{:.1}s", START.get_or_init(Instant::now).elapsed().as_secs_f32())
}
fn main() -> ExitCode {
win::enable_ansi();
let _ = clock();
let args: Vec<String> = std::env::args().skip(1).collect();
let interactive = args.is_empty();
let (pid, dll): (Option<u32>, PathBuf) = match args.as_slice() {
[] => {
banner();
invite_prompt();
(pick_process(), default_dll())
}
[pid] => (parse_pid(pid), default_dll()),
[pid, dll] => (parse_pid(pid), PathBuf::from(dll)),
_ => {
eprintln!("usage: PrestigeInjector.exe [<pid> [dll path]]");
return ExitCode::from(2);
}
};
let Some(pid) = pid else {
// interactive mode quit with Esc, or an unparsable pid was given
return if interactive { ExitCode::SUCCESS } else { ExitCode::from(2) };
};
if !interactive {
banner();
}
let code = run(pid, &dll);
if interactive {
print!("\nPress Enter to close...");
let _ = io::stdout().flush();
let mut line = String::new();
let _ = io::stdin().read_line(&mut line);
}
code
}
fn parse_pid(text: &str) -> Option<u32> {
text.parse().ok()
}
fn run(pid: u32, dll: &Path) -> ExitCode {
println!();
step("target", &format!("process {pid}"));
let dll = match dll.canonicalize() {
Ok(p) => p,
Err(e) => {
fail("error", &format!("cannot find {}: {e}", dll.display()));
return ExitCode::from(1);
}
};
let dll_display = dll.display().to_string();
step("loader", &dll_display.trim_start_matches(r"\\?\").to_string());
// The DLL appends to prestige-native.log beside itself; remember where it ends so only this run's lines are shown.
let log_path = dll.with_file_name("prestige-native.log");
let log_start = fs::metadata(&log_path).map(|m| m.len()).unwrap_or(0);
step("checking", "64-bit JVM, process access, DLL not already loaded");
step("injecting", "remote thread LoadLibraryW");
match win::inject(pid, &dll) {
Ok(()) => ok("injected", "prestige_native.dll is loaded in the game process"),
Err(e) => {
fail("failed", &e);
return ExitCode::from(1);
}
}
step("transforming", "following the loader log (attach, class loader, hook transformer)...");
match follow_log(&log_path, log_start) {
Outcome::Done => {
println!();
ok("success", "successfully injected - Prestige is running in the game");
println!("{YELLOW} {WATERMARK}{RESET} {DIM}{INVITE_URL}{RESET}");
ExitCode::SUCCESS
}
Outcome::Failed(line) => {
fail("failed", &format!("injection did not complete: {line}"));
println!("{DIM} details: {} and the game's latest.log{RESET}", log_path.display());
ExitCode::from(1)
}
Outcome::TimedOut => {
fail("timeout", "no completion message from the loader within 3 minutes");
println!("{DIM} check {} and the game's latest.log{RESET}", log_path.display());
ExitCode::from(1)
}
}
}
enum Outcome {
Done,
Failed(String),
TimedOut,
}
/// Prints the lines the loader/bootstrap append to the log until they report success or failure.
fn follow_log(path: &Path, start: u64) -> Outcome {
let deadline = Instant::now() + FOLLOW_TIMEOUT;
let mut offset = start;
let mut pending = String::new();
while Instant::now() < deadline {
if let Ok(mut file) = fs::File::open(path) {
if file.seek(SeekFrom::Start(offset)).is_ok() {
let mut chunk = String::new();
if let Ok(n) = file.read_to_string(&mut chunk) {
offset += n as u64;
pending.push_str(&chunk);
}
}
}
while let Some(end) = pending.find('\n') {
let line: String = pending.drain(..=end).collect();
let line = line.trim_end();
// lines look like "[unix seconds] message"
let message = line.split_once("] ").map(|(_, m)| m).unwrap_or(line);
let lower = message.to_ascii_lowercase();
if lower.contains("failed") || lower.contains("not found") {
fail("loader", message);
return Outcome::Failed(message.to_string());
}
if message.contains("client initialised") {
ok("loader", message);
return Outcome::Done;
}
step("loader", message);
}
std::thread::sleep(Duration::from_millis(200));
}
Outcome::TimedOut
}
fn config_path() -> Option<PathBuf> {
std::env::var_os("APPDATA").map(|dir| PathBuf::from(dir).join("PrestigeInjector").join("settings.txt"))
}
/// First launch: open the Discord invite, then ask whether to open it again on later launches.
fn invite_prompt() {
let Some(path) = config_path() else { return };
let saved = fs::read_to_string(&path).ok();
let show = match saved.as_deref() {
None => true, // first launch
Some(text) => !text.lines().any(|l| l.trim() == "show_invite=false"),
};
if !show {
return;
}
let first = saved.is_none();
step("discord", &format!("opening {INVITE_URL}"));
if !win::open_url(INVITE_URL) {
fail("discord", &format!("could not open a browser, visit {INVITE_URL} manually"));
}
let again = ask_yes_no(if first {
"Show the Discord invite again next time you start the injector? [Y/n] "
} else {
"Keep showing the Discord invite on launch? [Y/n] "
});
if let Some(dir) = path.parent() {
let _ = fs::create_dir_all(dir);
}
let _ = fs::write(&path, format!("show_invite={again}\n"));
println!();
}
fn ask_yes_no(question: &str) -> bool {
print!("{question}");
let _ = io::stdout().flush();
let mut line = String::new();
if io::stdin().read_line(&mut line).is_err() {
return true;
}
!matches!(line.trim().to_ascii_lowercase().as_str(), "n" | "no")
}
/// Interactive list of Minecraft JVM windows, refreshed every 750 ms. Returns the chosen pid.
fn pick_process() -> Option<u32> {
let mut selected = 0usize;
let mut processes = win::java_windows();
let mut last_refresh = Instant::now();
loop {
if selected >= processes.len() {
selected = processes.len().saturating_sub(1);
}
draw(&processes, selected);
let deadline = Instant::now() + Duration::from_millis(50);
while Instant::now() < deadline {
if let Some(key) = win::poll_key() {
match key {
win::Key::Up => selected = selected.saturating_sub(1),
win::Key::Down => selected = (selected + 1).min(processes.len().saturating_sub(1)),
win::Key::Enter => {
if let Some(p) = processes.get(selected) {
return Some(p.pid);
}
}
win::Key::Escape => return None,
}
draw(&processes, selected);
}
std::thread::sleep(Duration::from_millis(10));
}
if last_refresh.elapsed() >= Duration::from_millis(750) {
processes = win::java_windows();
last_refresh = Instant::now();
}
}
}
fn draw(processes: &[win::JavaWindow], selected: usize) {
let mut out = String::from("\x1b[2J\x1b[H");
out.push_str(&format!("{CYAN}Prestige injector{RESET} - Minecraft 1.21.11 (Fabric, 64-bit) {YELLOW}{WATERMARK}{RESET}\n"));
out.push_str("Up/Down select, Enter inject, Esc quit\n\n");
if processes.is_empty() {
out.push_str(" waiting for a javaw.exe / java.exe window...\n");
}
for (i, p) in processes.iter().enumerate() {
let marker = if i == selected { ">" } else { " " };
out.push_str(&format!("{marker} [{:>6}] {} ({})\n", p.pid, p.title, p.exe));
}
print!("{out}");
let _ = io::stdout().flush();
}
+278
View File
@@ -0,0 +1,278 @@
//! Win32 plumbing of the injector (raw bindings, no external crates).
use std::ffi::c_void;
use std::os::windows::ffi::OsStrExt;
use std::path::Path;
use std::time::Duration;
type Handle = *mut c_void;
const PROCESS_CREATE_THREAD: u32 = 0x0002;
const PROCESS_VM_OPERATION: u32 = 0x0008;
const PROCESS_VM_WRITE: u32 = 0x0020;
const PROCESS_VM_READ: u32 = 0x0010;
const PROCESS_QUERY_INFORMATION: u32 = 0x0400;
const PROCESS_QUERY_LIMITED_INFORMATION: u32 = 0x1000;
const MEM_COMMIT: u32 = 0x1000;
const MEM_RESERVE: u32 = 0x2000;
const MEM_RELEASE: u32 = 0x8000;
const PAGE_READWRITE: u32 = 0x04;
const TH32CS_SNAPMODULE: u32 = 0x8;
const TH32CS_SNAPMODULE32: u32 = 0x10;
const WAIT_OBJECT_0: u32 = 0;
#[repr(C)]
struct ModuleEntry32W {
size: u32,
module_id: u32,
process_id: u32,
glblcnt_usage: u32,
proccnt_usage: u32,
base_addr: *mut u8,
base_size: u32,
module: Handle,
sz_module: [u16; 256],
sz_exe_path: [u16; 260],
}
extern "system" {
fn OpenProcess(access: u32, inherit: i32, pid: u32) -> Handle;
fn CloseHandle(h: Handle) -> i32;
fn VirtualAllocEx(process: Handle, address: *mut c_void, size: usize, alloc_type: u32, protect: u32) -> *mut c_void;
fn VirtualFreeEx(process: Handle, address: *mut c_void, size: usize, free_type: u32) -> i32;
fn WriteProcessMemory(process: Handle, address: *mut c_void, buf: *const c_void, size: usize, written: *mut usize) -> i32;
fn CreateRemoteThread(process: Handle, attrs: *mut c_void, stack: usize, start: *mut c_void, param: *mut c_void, flags: u32, id: *mut u32) -> Handle;
fn WaitForSingleObject(h: Handle, ms: u32) -> u32;
fn GetExitCodeThread(h: Handle, code: *mut u32) -> i32;
fn GetModuleHandleW(name: *const u16) -> Handle;
fn GetProcAddress(module: Handle, name: *const u8) -> *mut c_void;
fn IsWow64Process(process: Handle, wow64: *mut i32) -> i32;
fn QueryFullProcessImageNameW(process: Handle, flags: u32, buf: *mut u16, size: *mut u32) -> i32;
fn GetLastError() -> u32;
fn CreateToolhelp32Snapshot(flags: u32, pid: u32) -> Handle;
fn Module32FirstW(snapshot: Handle, entry: *mut ModuleEntry32W) -> i32;
fn Module32NextW(snapshot: Handle, entry: *mut ModuleEntry32W) -> i32;
fn GetStdHandle(id: u32) -> Handle;
fn GetConsoleMode(h: Handle, mode: *mut u32) -> i32;
fn SetConsoleMode(h: Handle, mode: u32) -> i32;
}
#[link(name = "user32")]
extern "system" {
fn EnumWindows(callback: unsafe extern "system" fn(Handle, isize) -> i32, param: isize) -> i32;
fn IsWindowVisible(hwnd: Handle) -> i32;
fn GetWindowTextW(hwnd: Handle, buf: *mut u16, max: i32) -> i32;
fn GetWindowThreadProcessId(hwnd: Handle, pid: *mut u32) -> u32;
}
#[link(name = "shell32")]
extern "system" {
fn ShellExecuteW(hwnd: Handle, verb: *const u16, file: *const u16, params: *const u16, dir: *const u16, show: i32) -> isize;
}
extern "C" {
fn _kbhit() -> i32;
fn _getch() -> i32;
}
pub struct JavaWindow {
pub pid: u32,
pub title: String,
pub exe: String,
}
pub enum Key {
Up,
Down,
Enter,
Escape,
}
pub fn enable_ansi() {
unsafe {
let out = GetStdHandle(-11i32 as u32);
let mut mode = 0;
if GetConsoleMode(out, &mut mode) != 0 {
SetConsoleMode(out, mode | 0x0004);
}
}
}
/// Non-blocking key read: arrows arrive as 0xE0/0x00 followed by 72 (up) / 80 (down).
pub fn poll_key() -> Option<Key> {
unsafe {
if _kbhit() == 0 {
return None;
}
match _getch() {
13 => Some(Key::Enter),
27 => Some(Key::Escape),
0 | 0xE0 => match _getch() {
72 => Some(Key::Up),
80 => Some(Key::Down),
_ => None,
},
_ => None,
}
}
}
fn wide(path: &Path) -> Vec<u16> {
path.as_os_str().encode_wide().chain(std::iter::once(0)).collect()
}
fn image_name(pid: u32) -> Option<String> {
unsafe {
let process = OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION, 0, pid);
if process.is_null() {
return None;
}
let mut buf = [0u16; 1024];
let mut len = buf.len() as u32;
let ok = QueryFullProcessImageNameW(process, 0, buf.as_mut_ptr(), &mut len);
CloseHandle(process);
if ok == 0 {
return None;
}
Some(String::from_utf16_lossy(&buf[..len as usize]))
}
}
unsafe extern "system" fn collect(hwnd: Handle, param: isize) -> i32 {
let out = &mut *(param as *mut Vec<(u32, String)>);
if IsWindowVisible(hwnd) == 0 {
return 1;
}
let mut buf = [0u16; 256];
let len = GetWindowTextW(hwnd, buf.as_mut_ptr(), buf.len() as i32);
if len <= 0 {
return 1;
}
let mut pid = 0;
GetWindowThreadProcessId(hwnd, &mut pid);
out.push((pid, String::from_utf16_lossy(&buf[..len as usize])));
1
}
/// Visible top-level windows that belong to java.exe / javaw.exe, one entry per process.
pub fn java_windows() -> Vec<JavaWindow> {
let mut windows: Vec<(u32, String)> = Vec::new();
unsafe {
EnumWindows(collect, &mut windows as *mut _ as isize);
}
let mut out: Vec<JavaWindow> = Vec::new();
for (pid, title) in windows {
if out.iter().any(|w| w.pid == pid) {
continue;
}
let Some(path) = image_name(pid) else { continue };
let exe = path.rsplit(['\\', '/']).next().unwrap_or("").to_string();
if exe.eq_ignore_ascii_case("javaw.exe") || exe.eq_ignore_ascii_case("java.exe") {
out.push(JavaWindow { pid, title, exe });
}
}
out
}
fn last_error(what: &str) -> String {
format!("{what} failed (error {})", unsafe { GetLastError() })
}
/// True when the module file name is loaded in the process.
fn module_loaded(pid: u32, file_name: &str) -> bool {
unsafe {
let snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE | TH32CS_SNAPMODULE32, pid);
if snapshot.is_null() || snapshot as isize == -1 {
return false;
}
let mut entry: ModuleEntry32W = std::mem::zeroed();
entry.size = std::mem::size_of::<ModuleEntry32W>() as u32;
let mut found = false;
let mut ok = Module32FirstW(snapshot, &mut entry);
while ok != 0 {
let len = entry.sz_module.iter().position(|&c| c == 0).unwrap_or(entry.sz_module.len());
if String::from_utf16_lossy(&entry.sz_module[..len]).eq_ignore_ascii_case(file_name) {
found = true;
break;
}
ok = Module32NextW(snapshot, &mut entry);
}
CloseHandle(snapshot);
found
}
}
/// LoadLibraryW(dll) in the target process through CreateRemoteThread.
pub fn inject(pid: u32, dll: &Path) -> Result<(), String> {
unsafe {
let access = PROCESS_CREATE_THREAD | PROCESS_QUERY_INFORMATION | PROCESS_VM_OPERATION | PROCESS_VM_WRITE | PROCESS_VM_READ;
let process = OpenProcess(access, 0, pid);
if process.is_null() {
return Err(last_error("OpenProcess (run as the same user, or as administrator)"));
}
let result = inject_into(process, pid, dll);
CloseHandle(process);
result
}
}
unsafe fn inject_into(process: Handle, pid: u32, dll: &Path) -> Result<(), String> {
let mut wow64 = 0;
if IsWow64Process(process, &mut wow64) != 0 && wow64 != 0 {
return Err("the target is a 32-bit JVM; only 64-bit JVMs are supported".into());
}
let file_name = dll.file_name().map(|n| n.to_string_lossy().into_owned()).unwrap_or_default();
if module_loaded(pid, &file_name) {
return Err(format!("{file_name} is already loaded in process {pid}"));
}
let path = wide(dll);
let bytes = path.len() * 2;
let remote = VirtualAllocEx(process, std::ptr::null_mut(), bytes, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
if remote.is_null() {
return Err(last_error("VirtualAllocEx"));
}
let cleanup = |err: String| {
VirtualFreeEx(process, remote, 0, MEM_RELEASE);
Err(err)
};
if WriteProcessMemory(process, remote, path.as_ptr() as *const c_void, bytes, std::ptr::null_mut()) == 0 {
return cleanup(last_error("WriteProcessMemory"));
}
// kernel32 is mapped at the same base in every process of a boot session, so the local address is valid remotely.
let kernel32 = GetModuleHandleW(wide(Path::new("kernel32.dll")).as_ptr());
let load_library = GetProcAddress(kernel32, c"LoadLibraryW".as_ptr() as *const u8);
if load_library.is_null() {
return cleanup(last_error("resolve LoadLibraryW"));
}
let thread = CreateRemoteThread(process, std::ptr::null_mut(), 0, load_library, remote, 0, std::ptr::null_mut());
if thread.is_null() {
return cleanup(last_error("CreateRemoteThread"));
}
let wait = WaitForSingleObject(thread, 30_000);
let mut exit = 0;
GetExitCodeThread(thread, &mut exit);
CloseHandle(thread);
if wait != WAIT_OBJECT_0 {
// The thread may still be running inside the target; leave the buffer alone.
return Err("remote LoadLibraryW did not finish within 30 seconds".into());
}
VirtualFreeEx(process, remote, 0, MEM_RELEASE);
// LoadLibraryW's return value is truncated to 32 bits by GetExitCodeThread, so confirm through the module list.
for _ in 0..20 {
if module_loaded(pid, &file_name) {
return Ok(());
}
std::thread::sleep(Duration::from_millis(100));
}
Err(format!("LoadLibraryW returned {exit:#x} but {file_name} is not mapped (missing dependency or blocked by security software?)"))
}
/// Opens a URL in the default web browser.
pub fn open_url(url: &str) -> bool {
let verb: Vec<u16> = "open".encode_utf16().collect();
let target: Vec<u16> = url.encode_utf16().chain(std::iter::once(0)).collect();
// ShellExecute returns a value greater than 32 on success
unsafe { ShellExecuteW(std::ptr::null_mut(), verb.as_ptr(), target.as_ptr(), std::ptr::null(), std::ptr::null(), 1) > 32 }
}
+8
View File
@@ -0,0 +1,8 @@
[package]
name = "prestige_native"
version = "0.1.0"
edition = "2021"
build = "build.rs"
[lib]
crate-type = ["cdylib"]
+35
View File
@@ -0,0 +1,35 @@
//! Locates the remapped Prestige payload jar (built by `gradlew remapJar`) so lib.rs can embed it with include_bytes!.
use std::env;
use std::fs;
use std::path::PathBuf;
fn main() {
println!("cargo:rerun-if-env-changed=PRESTIGE_PAYLOAD");
let jar = match env::var("PRESTIGE_PAYLOAD") {
Ok(p) => PathBuf::from(p),
Err(_) => newest_remapped_jar(),
};
if !jar.is_file() {
panic!("payload jar not found: {} (run `gradlew remapJar` or set PRESTIGE_PAYLOAD)", jar.display());
}
println!("cargo:rerun-if-changed={}", jar.display());
println!("cargo:rustc-env=PRESTIGE_PAYLOAD_JAR={}", jar.display());
}
fn newest_remapped_jar() -> PathBuf {
let libs = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap()).join("../../../build/libs");
let mut best: Option<(std::time::SystemTime, PathBuf)> = None;
if let Ok(entries) = fs::read_dir(&libs) {
for entry in entries.flatten() {
let name = entry.file_name().to_string_lossy().to_string();
if !name.starts_with("prestige-") || !name.ends_with(".jar") || name.ends_with("-dev.jar") || name.ends_with("-sources.jar") {
continue;
}
let time = entry.metadata().and_then(|m| m.modified()).unwrap_or(std::time::UNIX_EPOCH);
if best.as_ref().map_or(true, |(t, _)| time > *t) {
best = Some((time, entry.path()));
}
}
}
best.map(|(_, p)| p).unwrap_or_else(|| libs.join("prestige-0.1.0.jar"))
}
+106
View File
@@ -0,0 +1,106 @@
//! JVMTI state and the two natives of dev.zprestige.prestige.inject.NativeBridge.
use crate::jni::*;
use std::ffi::{c_char, c_void};
use std::sync::atomic::{AtomicPtr, AtomicUsize, Ordering};
use std::sync::Mutex;
static JVMTI: AtomicPtr<*const *const c_void> = AtomicPtr::new(std::ptr::null_mut());
/// jclass whose bytes the ClassFileLoadHook should capture during the current RetransformClasses call (0 = none).
static CAPTURE_TARGET: AtomicUsize = AtomicUsize::new(0);
static CAPTURED: Mutex<Option<Vec<u8>>> = Mutex::new(None);
/// Acquires the JVMTI capabilities and enables the class file load hook. Called once from the worker thread.
pub unsafe fn init_jvmti(vm: VmPtr) -> Result<(), String> {
let jvmti = get_jvmti(vm)?;
let mut caps = Capabilities::default();
for bit in [CAN_REDEFINE_CLASSES, CAN_REDEFINE_ANY_CLASS, CAN_GENERATE_ALL_CLASS_HOOK_EVENTS, CAN_RETRANSFORM_CLASSES, CAN_RETRANSFORM_ANY_CLASS] {
caps.set(bit);
}
let rc = add_capabilities(jvmti, &caps);
if rc != 0 {
return Err(format!("AddCapabilities failed ({rc})"));
}
enable_class_file_load_hook(jvmti, class_file_load_hook)?;
JVMTI.store(jvmti, Ordering::SeqCst);
Ok(())
}
/// Copies the class bytes the JVM hands to us while a classBytes() call retransforms its target; never modifies anything.
unsafe extern "system" fn class_file_load_hook(
_jvmti: JvmtiPtr,
env: EnvPtr,
class_being_redefined: JClass,
_loader: JObject,
_name: *const c_char,
_domain: JObject,
data_len: JInt,
data: *const u8,
_new_len: *mut JInt,
_new_data: *mut *mut u8,
) {
let target = CAPTURE_TARGET.load(Ordering::SeqCst);
if target == 0 || class_being_redefined.is_null() || data.is_null() {
return;
}
let jni = Jni::new(env);
if jni.is_same_object(class_being_redefined, target as JObject) {
if let Ok(mut slot) = CAPTURED.lock() {
*slot = Some(std::slice::from_raw_parts(data, data_len as usize).to_vec());
}
}
}
/// byte[] classBytes(Class): the bytes the JVM currently holds for the class (HotSpot reconstitutes them for retransformation).
pub unsafe extern "system" fn native_class_bytes(env: EnvPtr, _cls: JClass, target: JClass) -> JObject {
let jvmti = JVMTI.load(Ordering::SeqCst);
if jvmti.is_null() {
return std::ptr::null_mut();
}
if let Ok(mut slot) = CAPTURED.lock() {
*slot = None;
}
CAPTURE_TARGET.store(target as usize, Ordering::SeqCst);
let rc = retransform_class(jvmti, target);
CAPTURE_TARGET.store(0, Ordering::SeqCst);
if rc != 0 {
crate::log!("RetransformClasses failed ({rc})");
return std::ptr::null_mut();
}
let bytes = CAPTURED.lock().ok().and_then(|mut slot| slot.take());
let Some(bytes) = bytes else {
return std::ptr::null_mut();
};
let jni = Jni::new(env);
let array = jni.new_byte_array(bytes.len() as JInt);
if !array.is_null() {
jni.set_byte_array_region(array, 0, bytes.len() as JInt, bytes.as_ptr());
}
array
}
/// int redefine(Class, byte[]): JVMTI RedefineClasses of a single class; returns the JVMTI error code (0 = success).
pub unsafe extern "system" fn native_redefine(env: EnvPtr, _cls: JClass, target: JClass, bytes: JObject) -> JInt {
let jvmti = JVMTI.load(Ordering::SeqCst);
if jvmti.is_null() || bytes.is_null() {
return -1;
}
let jni = Jni::new(env);
let len = jni.get_array_length(bytes);
let mut buf = vec![0u8; len as usize];
jni.get_byte_array_region(bytes, 0, len, buf.as_mut_ptr());
let def = ClassDefinition { klass: target, class_byte_count: len, class_bytes: buf.as_ptr() };
let rc = redefine_class(jvmti, &def);
if rc != 0 {
crate::log!("RedefineClasses failed ({rc})");
}
rc
}
/// void log(String): lets the Java side write progress lines into prestige-native.log.
pub unsafe extern "system" fn native_log(env: EnvPtr, _cls: JClass, message: JObject) {
if message.is_null() {
return;
}
let text = Jni::new(env).get_string_utf(message);
crate::log!("[java] {text}");
}
+255
View File
@@ -0,0 +1,255 @@
//! Minimal raw JNI / JVMTI bindings. Function-table indices were checked against the JDK 21 jni.h / jvmti.h.
use std::ffi::{c_char, c_void, CStr, CString};
pub type JObject = *mut c_void;
pub type JClass = JObject;
pub type JMethodId = *mut c_void;
pub type JValue = u64;
pub type JInt = i32;
pub type JBool = u8;
/// JNIEnv*: pointer to a pointer to the function table.
pub type EnvPtr = *mut *const *const c_void;
pub const JNI_OK: JInt = 0;
pub const JNI_VERSION_1_8: JInt = 0x0001_0008;
pub const JVMTI_VERSION_1_2: JInt = 0x3001_0200;
#[repr(C)]
pub struct NativeMethod {
pub name: *const c_char,
pub signature: *const c_char,
pub fn_ptr: *mut c_void,
}
/// Packs a JNI argument into the 8-byte jvalue slot.
pub fn obj(o: JObject) -> JValue {
o as usize as u64
}
pub fn boolean(b: bool) -> JValue {
b as u64
}
pub struct Jni {
pub env: EnvPtr,
}
macro_rules! f {
($self:expr, $idx:expr, $ty:ty) => {
std::mem::transmute::<*const c_void, $ty>(*(*$self.env).add($idx))
};
}
impl Jni {
/// # Safety
/// `env` must be a valid JNIEnv* of the current thread.
pub unsafe fn new(env: EnvPtr) -> Self {
Jni { env }
}
pub unsafe fn find_class(&self, name: &str) -> JClass {
let n = CString::new(name).unwrap();
f!(self, 6, unsafe extern "system" fn(EnvPtr, *const c_char) -> JClass)(self.env, n.as_ptr())
}
pub unsafe fn exception_occurred(&self) -> JObject {
f!(self, 15, unsafe extern "system" fn(EnvPtr) -> JObject)(self.env)
}
pub unsafe fn exception_clear(&self) {
f!(self, 17, unsafe extern "system" fn(EnvPtr))(self.env)
}
pub unsafe fn new_global_ref(&self, o: JObject) -> JObject {
f!(self, 21, unsafe extern "system" fn(EnvPtr, JObject) -> JObject)(self.env, o)
}
pub unsafe fn delete_local_ref(&self, o: JObject) {
f!(self, 23, unsafe extern "system" fn(EnvPtr, JObject))(self.env, o)
}
pub unsafe fn is_same_object(&self, a: JObject, b: JObject) -> bool {
f!(self, 24, unsafe extern "system" fn(EnvPtr, JObject, JObject) -> JBool)(self.env, a, b) != 0
}
pub unsafe fn get_object_class(&self, o: JObject) -> JClass {
f!(self, 31, unsafe extern "system" fn(EnvPtr, JObject) -> JClass)(self.env, o)
}
pub unsafe fn get_method_id(&self, c: JClass, name: &str, sig: &str) -> JMethodId {
let (n, s) = (CString::new(name).unwrap(), CString::new(sig).unwrap());
f!(self, 33, unsafe extern "system" fn(EnvPtr, JClass, *const c_char, *const c_char) -> JMethodId)(self.env, c, n.as_ptr(), s.as_ptr())
}
pub unsafe fn new_object(&self, c: JClass, ctor: JMethodId, args: &[JValue]) -> JObject {
f!(self, 30, unsafe extern "system" fn(EnvPtr, JClass, JMethodId, *const JValue) -> JObject)(self.env, c, ctor, args.as_ptr())
}
pub unsafe fn call_object(&self, o: JObject, m: JMethodId, args: &[JValue]) -> JObject {
f!(self, 36, unsafe extern "system" fn(EnvPtr, JObject, JMethodId, *const JValue) -> JObject)(self.env, o, m, args.as_ptr())
}
pub unsafe fn call_void(&self, o: JObject, m: JMethodId, args: &[JValue]) {
f!(self, 63, unsafe extern "system" fn(EnvPtr, JObject, JMethodId, *const JValue))(self.env, o, m, args.as_ptr())
}
pub unsafe fn get_static_method_id(&self, c: JClass, name: &str, sig: &str) -> JMethodId {
let (n, s) = (CString::new(name).unwrap(), CString::new(sig).unwrap());
f!(self, 113, unsafe extern "system" fn(EnvPtr, JClass, *const c_char, *const c_char) -> JMethodId)(self.env, c, n.as_ptr(), s.as_ptr())
}
pub unsafe fn call_static_object(&self, c: JClass, m: JMethodId, args: &[JValue]) -> JObject {
f!(self, 116, unsafe extern "system" fn(EnvPtr, JClass, JMethodId, *const JValue) -> JObject)(self.env, c, m, args.as_ptr())
}
pub unsafe fn call_static_void(&self, c: JClass, m: JMethodId, args: &[JValue]) {
f!(self, 143, unsafe extern "system" fn(EnvPtr, JClass, JMethodId, *const JValue))(self.env, c, m, args.as_ptr())
}
pub unsafe fn new_string(&self, s: &str) -> JObject {
let c = CString::new(s).unwrap();
f!(self, 167, unsafe extern "system" fn(EnvPtr, *const c_char) -> JObject)(self.env, c.as_ptr())
}
pub unsafe fn get_string_utf(&self, s: JObject) -> String {
let chars = f!(self, 169, unsafe extern "system" fn(EnvPtr, JObject, *mut JBool) -> *const c_char)(self.env, s, std::ptr::null_mut());
if chars.is_null() {
return String::new();
}
let out = CStr::from_ptr(chars).to_string_lossy().into_owned();
f!(self, 170, unsafe extern "system" fn(EnvPtr, JObject, *const c_char))(self.env, s, chars);
out
}
pub unsafe fn get_array_length(&self, a: JObject) -> JInt {
f!(self, 171, unsafe extern "system" fn(EnvPtr, JObject) -> JInt)(self.env, a)
}
pub unsafe fn new_object_array(&self, len: JInt, c: JClass, init: JObject) -> JObject {
f!(self, 172, unsafe extern "system" fn(EnvPtr, JInt, JClass, JObject) -> JObject)(self.env, len, c, init)
}
pub unsafe fn new_byte_array(&self, len: JInt) -> JObject {
f!(self, 176, unsafe extern "system" fn(EnvPtr, JInt) -> JObject)(self.env, len)
}
pub unsafe fn get_byte_array_region(&self, a: JObject, start: JInt, len: JInt, buf: *mut u8) {
f!(self, 200, unsafe extern "system" fn(EnvPtr, JObject, JInt, JInt, *mut u8))(self.env, a, start, len, buf)
}
pub unsafe fn set_byte_array_region(&self, a: JObject, start: JInt, len: JInt, buf: *const u8) {
f!(self, 208, unsafe extern "system" fn(EnvPtr, JObject, JInt, JInt, *const u8))(self.env, a, start, len, buf)
}
pub unsafe fn register_natives(&self, c: JClass, methods: &[NativeMethod]) -> JInt {
f!(self, 215, unsafe extern "system" fn(EnvPtr, JClass, *const NativeMethod, JInt) -> JInt)(self.env, c, methods.as_ptr(), methods.len() as JInt)
}
pub unsafe fn exception_check(&self) -> bool {
f!(self, 228, unsafe extern "system" fn(EnvPtr) -> JBool)(self.env) != 0
}
/// Returns "ExceptionClass: message" of the pending exception and clears it.
pub unsafe fn take_exception(&self) -> Option<String> {
let ex = self.exception_occurred();
if ex.is_null() {
return None;
}
self.exception_clear();
let cls = self.get_object_class(ex);
let to_string = self.get_method_id(cls, "toString", "()Ljava/lang/String;");
let text = if to_string.is_null() {
"<exception>".to_string()
} else {
let s = self.call_object(ex, to_string, &[]);
self.exception_clear();
if s.is_null() { "<exception>".to_string() } else { self.get_string_utf(s) }
};
Some(text)
}
/// Converts a pending Java exception into an Err carrying `context`.
pub unsafe fn check(&self, context: &str) -> Result<(), String> {
match self.take_exception() {
Some(e) => Err(format!("{context}: {e}")),
None => Ok(()),
}
}
}
/// JavaVM*: pointer to a pointer to the invoke interface.
pub type VmPtr = *mut *const *const c_void;
pub unsafe fn attach_current_thread(vm: VmPtr) -> Result<EnvPtr, String> {
let attach = std::mem::transmute::<*const c_void, unsafe extern "system" fn(VmPtr, *mut EnvPtr, *mut c_void) -> JInt>(*(*vm).add(4));
let mut env: EnvPtr = std::ptr::null_mut();
let rc = attach(vm, &mut env, std::ptr::null_mut());
if rc != JNI_OK || env.is_null() {
return Err(format!("AttachCurrentThread failed ({rc})"));
}
Ok(env)
}
pub unsafe fn get_jvmti(vm: VmPtr) -> Result<JvmtiPtr, String> {
let get_env = std::mem::transmute::<*const c_void, unsafe extern "system" fn(VmPtr, *mut *mut c_void, JInt) -> JInt>(*(*vm).add(6));
let mut out: *mut c_void = std::ptr::null_mut();
let rc = get_env(vm, &mut out, JVMTI_VERSION_1_2);
if rc != JNI_OK || out.is_null() {
return Err(format!("GetEnv(JVMTI) failed ({rc})"));
}
Ok(out as JvmtiPtr)
}
/// jvmtiEnv*: pointer to a pointer to the JVMTI function table (entry n of the spec is index n-1).
pub type JvmtiPtr = *mut *const *const c_void;
#[repr(C)]
pub struct ClassDefinition {
pub klass: JClass,
pub class_byte_count: JInt,
pub class_bytes: *const u8,
}
#[repr(C)]
#[derive(Default, Clone, Copy)]
pub struct Capabilities {
pub bits: [u32; 4],
}
impl Capabilities {
pub fn set(&mut self, bit: u32) {
self.bits[(bit / 32) as usize] |= 1 << (bit % 32);
}
}
// capability bit positions, counted in jvmtiCapabilities declaration order
pub const CAN_REDEFINE_CLASSES: u32 = 9;
pub const CAN_REDEFINE_ANY_CLASS: u32 = 21;
pub const CAN_GENERATE_ALL_CLASS_HOOK_EVENTS: u32 = 26;
pub const CAN_RETRANSFORM_CLASSES: u32 = 37;
pub const CAN_RETRANSFORM_ANY_CLASS: u32 = 38;
pub const EVENT_CLASS_FILE_LOAD_HOOK: JInt = 54;
pub type ClassFileLoadHook = unsafe extern "system" fn(
JvmtiPtr,
EnvPtr,
JClass,
JObject,
*const c_char,
JObject,
JInt,
*const u8,
*mut JInt,
*mut *mut u8,
);
pub unsafe fn add_capabilities(j: JvmtiPtr, caps: &Capabilities) -> JInt {
let f = std::mem::transmute::<*const c_void, unsafe extern "system" fn(JvmtiPtr, *const Capabilities) -> JInt>(*(*j).add(141));
f(j, caps)
}
/// Installs the ClassFileLoadHook callback (field 5 of jvmtiEventCallbacks) and enables the event.
pub unsafe fn enable_class_file_load_hook(j: JvmtiPtr, hook: ClassFileLoadHook) -> Result<(), String> {
let mut callbacks = [0usize; 40];
callbacks[4] = hook as usize;
let set_callbacks = std::mem::transmute::<*const c_void, unsafe extern "system" fn(JvmtiPtr, *const usize, JInt) -> JInt>(*(*j).add(121));
let rc = set_callbacks(j, callbacks.as_ptr(), std::mem::size_of_val(&callbacks) as JInt);
if rc != 0 {
return Err(format!("SetEventCallbacks failed ({rc})"));
}
let set_mode = std::mem::transmute::<*const c_void, unsafe extern "C" fn(JvmtiPtr, JInt, JInt, JObject, ...) -> JInt>(*(*j).add(1));
let rc = set_mode(j, 1, EVENT_CLASS_FILE_LOAD_HOOK, std::ptr::null_mut());
if rc != 0 {
return Err(format!("SetEventNotificationMode failed ({rc})"));
}
Ok(())
}
pub unsafe fn retransform_class(j: JvmtiPtr, class: JClass) -> JInt {
let f = std::mem::transmute::<*const c_void, unsafe extern "system" fn(JvmtiPtr, JInt, *const JClass) -> JInt>(*(*j).add(151));
f(j, 1, &class)
}
pub unsafe fn redefine_class(j: JvmtiPtr, def: &ClassDefinition) -> JInt {
let f = std::mem::transmute::<*const c_void, unsafe extern "system" fn(JvmtiPtr, JInt, *const ClassDefinition) -> JInt>(*(*j).add(86));
f(j, 1, def)
}
+32
View File
@@ -0,0 +1,32 @@
//! prestige_native.dll: loaded into a running Minecraft 1.21.11 (Fabric) JVM by PrestigeInjector.exe.
//!
//! The DLL worker waits for the JVM, appends the embedded Prestige payload jar to Fabric's Knot class loader, registers the
//! JVMTI-backed natives of `dev.zprestige.prestige.inject.NativeBridge` and starts `Bootstrap`, which transforms the already
//! loaded game classes and initialises the client.
mod bridge;
mod jni;
mod log;
mod worker;
use std::ffi::c_void;
const DLL_PROCESS_ATTACH: u32 = 1;
extern "system" {
fn DisableThreadLibraryCalls(module: *mut c_void) -> i32;
}
pub(crate) static mut MODULE: *mut c_void = std::ptr::null_mut();
#[no_mangle]
pub extern "system" fn DllMain(module: *mut c_void, reason: u32, _reserved: *mut c_void) -> i32 {
if reason == DLL_PROCESS_ATTACH {
unsafe {
MODULE = module;
DisableThreadLibraryCalls(module);
}
// Nothing but thread creation may happen under the loader lock.
let _ = std::thread::Builder::new().name("prestige-loader".into()).spawn(worker::run);
}
1
}
+33
View File
@@ -0,0 +1,33 @@
use std::ffi::c_void;
use std::fs::OpenOptions;
use std::io::Write;
use std::path::PathBuf;
use std::sync::OnceLock;
use std::time::{SystemTime, UNIX_EPOCH};
extern "system" {
fn GetModuleFileNameW(module: *mut c_void, buf: *mut u16, size: u32) -> u32;
}
fn log_path() -> &'static PathBuf {
static PATH: OnceLock<PathBuf> = OnceLock::new();
PATH.get_or_init(|| {
let mut buf = [0u16; 1024];
let len = unsafe { GetModuleFileNameW(crate::MODULE, buf.as_mut_ptr(), buf.len() as u32) } as usize;
let dll = PathBuf::from(String::from_utf16_lossy(&buf[..len]));
dll.with_file_name("prestige-native.log")
})
}
/// Appends a line to prestige-native.log beside the DLL.
pub fn log(message: &str) {
let secs = SystemTime::now().duration_since(UNIX_EPOCH).map(|d| d.as_secs()).unwrap_or(0);
if let Ok(mut file) = OpenOptions::new().create(true).append(true).open(log_path()) {
let _ = writeln!(file, "[{secs}] {message}");
}
}
#[macro_export]
macro_rules! log {
($($arg:tt)*) => { $crate::log::log(&format!($($arg)*)) };
}
+175
View File
@@ -0,0 +1,175 @@
//! The loader worker: JVM discovery, payload installation into Fabric's Knot class loader, native registration, bootstrap.
use crate::bridge::{init_jvmti, native_class_bytes, native_log, native_redefine};
use crate::jni::*;
use crate::log;
use std::ffi::{c_char, c_void};
use std::path::PathBuf;
use std::time::Duration;
extern "system" {
fn GetModuleHandleA(name: *const c_char) -> *mut c_void;
fn GetProcAddress(module: *mut c_void, name: *const c_char) -> *mut c_void;
fn GetCurrentProcessId() -> u32;
}
static PAYLOAD: &[u8] = include_bytes!(env!("PRESTIGE_PAYLOAD_JAR"));
const NATIVE_BRIDGE: &str = "dev.zprestige.prestige.inject.NativeBridge";
const BOOTSTRAP: &str = "dev.zprestige.prestige.inject.Bootstrap";
pub fn run() {
log!("worker started, pid {}", unsafe { GetCurrentProcessId() });
match unsafe { install() } {
Ok(()) => log!("bootstrap returned"),
Err(e) => log!("FAILED: {e}"),
}
}
unsafe fn install() -> Result<(), String> {
let vm = find_vm()?;
let env = attach_current_thread(vm)?;
let jni = Jni::new(env);
log!("attached to the JVM");
init_jvmti(vm)?;
log!("JVMTI ready");
let jar = write_payload()?;
log!("payload written to {}", jar.display());
let loader = add_to_knot(&jni, &jar)?;
log!("payload appended to the Fabric Knot class loader");
register_natives(&jni, loader)?;
log!("natives registered");
let bootstrap = class_for_name(&jni, BOOTSTRAP, loader)?;
let start = jni.get_static_method_id(bootstrap, "start", "()V");
jni.check("resolve Bootstrap.start")?;
// Bootstrap.start waits for the client, installs the hooks and schedules the client initialisation.
jni.call_static_void(bootstrap, start, &[]);
jni.check("Bootstrap.start")?;
Ok(())
}
/// Waits for jvm.dll and a created JavaVM (the injector may run before Minecraft has started its JVM).
unsafe fn find_vm() -> Result<VmPtr, String> {
let mut module = std::ptr::null_mut();
for _ in 0..600 {
module = GetModuleHandleA(c"jvm.dll".as_ptr());
if !module.is_null() {
break;
}
std::thread::sleep(Duration::from_millis(100));
}
if module.is_null() {
return Err("jvm.dll is not loaded in this process".into());
}
let get_vms = GetProcAddress(module, c"JNI_GetCreatedJavaVMs".as_ptr());
if get_vms.is_null() {
return Err("JNI_GetCreatedJavaVMs export not found".into());
}
let get_vms: unsafe extern "system" fn(*mut VmPtr, JInt, *mut JInt) -> JInt = std::mem::transmute(get_vms);
for _ in 0..600 {
let mut vm: VmPtr = std::ptr::null_mut();
let mut count: JInt = 0;
if get_vms(&mut vm, 1, &mut count) == JNI_OK && count > 0 && !vm.is_null() {
return Ok(vm);
}
std::thread::sleep(Duration::from_millis(100));
}
Err("no JavaVM was created".into())
}
fn write_payload() -> Result<PathBuf, String> {
let dir = std::env::temp_dir().join("PrestigeLoader");
std::fs::create_dir_all(&dir).map_err(|e| format!("create {}: {e}", dir.display()))?;
let path = dir.join(format!("prestige-payload-{}.jar", unsafe { GetCurrentProcessId() }));
std::fs::write(&path, PAYLOAD).map_err(|e| format!("write {}: {e}", path.display()))?;
Ok(path)
}
/// FabricLauncherBase.getLauncher().addToClassPath(path) so the payload and the game classes share the Knot class loader.
/// Returns a global reference to the Knot target class loader.
unsafe fn add_to_knot(jni: &Jni, jar: &std::path::Path) -> Result<JObject, String> {
// A thread attached from native code resolves classes through the system class loader, which holds fabric-loader.
let base = jni.find_class("net/fabricmc/loader/impl/launch/FabricLauncherBase");
jni.check("FabricLauncherBase (is this a Fabric instance?)")?;
let get_launcher = jni.get_static_method_id(base, "getLauncher", "()Lnet/fabricmc/loader/impl/launch/FabricLauncher;");
jni.check("FabricLauncherBase.getLauncher")?;
let launcher = jni.call_static_object(base, get_launcher, &[]);
jni.check("getLauncher()")?;
if launcher.is_null() {
return Err("Fabric launcher is not available yet".into());
}
let launcher_class = jni.find_class("net/fabricmc/loader/impl/launch/FabricLauncher");
jni.check("FabricLauncher")?;
let add = jni.get_method_id(launcher_class, "addToClassPath", "(Ljava/nio/file/Path;[Ljava/lang/String;)V");
jni.check("FabricLauncher.addToClassPath")?;
let target = jni.get_method_id(launcher_class, "getTargetClassLoader", "()Ljava/lang/ClassLoader;");
jni.check("FabricLauncher.getTargetClassLoader")?;
// Path path = new java.io.File(jar).toPath()
let file_class = jni.find_class("java/io/File");
let file_ctor = jni.get_method_id(file_class, "<init>", "(Ljava/lang/String;)V");
let to_path = jni.get_method_id(file_class, "toPath", "()Ljava/nio/file/Path;");
jni.check("java.io.File")?;
let jar_string = jni.new_string(&jar.to_string_lossy());
let file = jni.new_object(file_class, file_ctor, &[obj(jar_string)]);
let path = jni.call_object(file, to_path, &[]);
jni.check("File.toPath")?;
let string_class = jni.find_class("java/lang/String");
let prefixes = jni.new_object_array(0, string_class, std::ptr::null_mut());
jni.call_void(launcher, add, &[obj(path), obj(prefixes)]);
jni.check("addToClassPath")?;
let loader = jni.call_object(launcher, target, &[]);
jni.check("getTargetClassLoader()")?;
if loader.is_null() {
return Err("Knot target class loader is null".into());
}
Ok(jni.new_global_ref(loader))
}
/// Class.forName(name, true, loader)
unsafe fn class_for_name(jni: &Jni, name: &str, loader: JObject) -> Result<JClass, String> {
let class_class = jni.find_class("java/lang/Class");
let for_name = jni.get_static_method_id(class_class, "forName", "(Ljava/lang/String;ZLjava/lang/ClassLoader;)Ljava/lang/Class;");
jni.check("Class.forName")?;
let name_string = jni.new_string(name);
let class = jni.call_static_object(class_class, for_name, &[obj(name_string), boolean(true), obj(loader)]);
jni.check(&format!("load {name}"))?;
if class.is_null() {
return Err(format!("{name} not found"));
}
Ok(class)
}
unsafe fn register_natives(jni: &Jni, loader: JObject) -> Result<(), String> {
let class = class_for_name(jni, NATIVE_BRIDGE, loader)?;
let methods = [
NativeMethod {
name: c"classBytes".as_ptr(),
signature: c"(Ljava/lang/Class;)[B".as_ptr(),
fn_ptr: native_class_bytes as *const () as usize as *mut c_void,
},
NativeMethod {
name: c"redefine".as_ptr(),
signature: c"(Ljava/lang/Class;[B)I".as_ptr(),
fn_ptr: native_redefine as *const () as usize as *mut c_void,
},
NativeMethod {
name: c"log".as_ptr(),
signature: c"(Ljava/lang/String;)V".as_ptr(),
fn_ptr: native_log as *const () as usize as *mut c_void,
},
];
let rc = jni.register_natives(class, &methods);
if rc != JNI_OK {
let _ = jni.take_exception();
return Err(format!("RegisterNatives failed ({rc})"));
}
Ok(())
}
@@ -1,8 +1,6 @@
package dev.zprestige.prestige;
import dev.zprestige.prestige.annotation.Chainable;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.function.Predicate;
public class BoolSetting extends Setting {
@@ -12,104 +10,29 @@ public class BoolSetting extends Setting {
return (Boolean)super.getValue();
}
public BoolSetting(String var1, boolean var2) {
super(var1, var2);
public BoolSetting(String settingName, boolean defaultValue) {
super(settingName, defaultValue);
}
public BoolSetting setVisibility_BoolSetting(Object[] var1) {
Predicate var4 = (Predicate)var1[0];
long var2 = (Long)var1[1];
var2 = 93508073420995L ^ var2;
long var5 = var2 ^ 15920284625090L;
super.setVisibility(new Object[]{var4, var5});
public BoolSetting visibleWhen(Predicate visibilityPredicate) {
super.setVisibility(visibilityPredicate);
return this;
}
@Chainable
public BoolSetting setDescription_BoolSetting(String var1) {
super.setDescription(var1);
public BoolSetting withDescription(String newDescription) {
super.setDescription(newDescription);
return this;
}
@Override
public Setting setVisibility(Object[] var1) {
Predicate var4 = (Predicate)var1[0];
long var2 = (Long)var1[1];
long var5 = var2 ^ 100541721415681L;
return this.setVisibility_BoolSetting(new Object[]{var4, var5});
public Setting setVisibility(Predicate visibilityPredicate) {
return this.visibleWhen(visibilityPredicate);
}
@Chainable
@Override
public Setting setDescription(String var1) {
return this.setDescription_BoolSetting(var1);
}
private static Field c(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field d(Class var0, String var1, Class var2) {
Field var3 = c(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = d(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method c(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method d(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = c(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = d(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
public Setting setDescription(String newDescription) {
return this.withDescription(newDescription);
}
}
@@ -1,8 +1,5 @@
package dev.zprestige.prestige;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
public enum Category {
Combat,
Misc,
@@ -11,76 +8,4 @@ public enum Category {
Mace,
Spear,
Menu;
static {
Object[] var10001 = new Object[]{0L};
}
private static Field a(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field b(Class var0, String var1, Class var2) {
Field var3 = a(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = b(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method a(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method b(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = a(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = b(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
}
}
@@ -2,8 +2,6 @@ package dev.zprestige.prestige;
import dev.zprestige.prestige.annotation.Chainable;
import java.awt.Color;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.function.Predicate;
public class ColorSetting extends Setting {
@@ -13,104 +11,29 @@ public class ColorSetting extends Setting {
return (java.awt.Color)super.getValue();
}
public ColorSetting(String var1, Color var2) {
super(var1, var2);
public ColorSetting(String settingName, Color defaultColor) {
super(settingName, defaultColor);
}
public ColorSetting setVisibility_ColorSetting(Object[] var1) {
Predicate var2 = (Predicate)var1[0];
long var3 = (Long)var1[1];
var3 = 17254503104146L ^ var3;
long var5 = var3 ^ 135571304499614L;
super.setVisibility(new Object[]{var2, var5});
public ColorSetting visibleWhen(Predicate visibilityPredicate) {
super.setVisibility(visibilityPredicate);
return this;
}
@Chainable
public ColorSetting setDescription_ColorSetting(String var1) {
super.setDescription(var1);
public ColorSetting withDescription(String newDescription) {
super.setDescription(newDescription);
return this;
}
@Override
public Setting setVisibility(Object[] var1) {
Predicate var2 = (Predicate)var1[0];
long var3 = (Long)var1[1];
long var5 = var3 ^ 128626887849740L;
return this.setVisibility_ColorSetting(new Object[]{var2, var5});
public Setting setVisibility(Predicate visibilityPredicate) {
return this.visibleWhen(visibilityPredicate);
}
@Chainable
@Override
public Setting setDescription(String var1) {
return this.setDescription_ColorSetting(var1);
}
private static Field c(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field d(Class var0, String var1, Class var2) {
Field var3 = c(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = d(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method c(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method d(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = c(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = d(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
public Setting setDescription(String newDescription) {
return this.withDescription(newDescription);
}
}
@@ -1,24 +0,0 @@
package dev.zprestige.prestige;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles.Lookup;
public final class Constants {
private Constants() {
}
public static MethodHandle a(Lookup var0, String var1, Class var2, int var3) {
throw new IllegalStateException("prestige: native constant bridge was statically restored; this call must never happen");
}
public static int b(Lookup var0, String var1, Class var2, int var3) {
throw new IllegalStateException("prestige: native constant bridge was statically restored; this call must never happen");
}
public static long c(Lookup var0, String var1, Class var2, int var3) {
throw new IllegalStateException("prestige: native constant bridge was statically restored; this call must never happen");
}
public static void d(int var0, int var1, int var2) {
}
}
@@ -1,8 +1,6 @@
package dev.zprestige.prestige;
import dev.zprestige.prestige.annotation.Chainable;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.function.Predicate;
public class EnumSetting extends Setting {
@@ -14,9 +12,9 @@ public class EnumSetting extends Setting {
private final String[] options;
public EnumSetting(String var1, String var2, String[] var3) {
super(var1, var2);
this.options = var3;
public EnumSetting(String settingName, String defaultOption, String[] optionValues) {
super(settingName, defaultOption);
this.options = optionValues;
}
@Chainable
@@ -24,100 +22,25 @@ public class EnumSetting extends Setting {
return this.options;
}
public EnumSetting setVisibility_EnumSetting(Object[] var1) {
Predicate var2 = (Predicate)var1[0];
long var3 = (Long)var1[1];
var3 = 87505960059751L ^ var3;
long var5 = var3 ^ 4743213844807L;
super.setVisibility(new Object[]{var2, var5});
public EnumSetting visibleWhen(Predicate visibilityPredicate) {
super.setVisibility(visibilityPredicate);
return this;
}
@Chainable
public EnumSetting setDescription_EnumSetting(String var1) {
super.setDescription(var1);
public EnumSetting withDescription(String newDescription) {
super.setDescription(newDescription);
return this;
}
@Override
public Setting setVisibility(Object[] var1) {
Predicate var4 = (Predicate)var1[0];
long var2 = (Long)var1[1];
long var5 = var2 ^ 83315054463520L;
return this.setVisibility_EnumSetting(new Object[]{var4, var5});
public Setting setVisibility(Predicate visibilityPredicate) {
return this.visibleWhen(visibilityPredicate);
}
@Chainable
@Override
public Setting setDescription(String var1) {
return this.setDescription_EnumSetting(var1);
}
private static Field c(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field d(Class var0, String var1, Class var2) {
Field var3 = c(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = d(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method c(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method d(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = c(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = d(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
public Setting setDescription(String newDescription) {
return this.withDescription(newDescription);
}
}
@@ -4,8 +4,6 @@ import dev.zprestige.prestige.event.Event;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
@@ -18,55 +16,51 @@ import java.util.concurrent.CopyOnWriteArrayList;
public class EventBus {
private volatile Map listeners = new HashMap();
private final Object lock = new Object();
private static final MethodType c;
private static final Set d;
public final CopyOnWriteArrayList e = new CopyOnWriteArrayList();
private static final String g = "[Prestige/EventBus] listener threw (logged once per type): ";
private static final MethodType LISTENER_TYPE;
private static final Set LOGGED_FAILURES;
public final CopyOnWriteArrayList registrationBlockers = new CopyOnWriteArrayList();
private static final String LISTENER_ERROR_PREFIX = "[Prestige/EventBus] listener threw (logged once per type): ";
public void register(Object[] var1) {
Object var4 = var1[0];
long var2 = (Long)var1[1];
var2 = 114818700636565L ^ var2;
long var5 = var2 ^ 56241223455158L;
if (var4 != null) {
if (this.e.isEmpty()) {
Class var8 = var4.getClass();
ArrayList var9 = new ArrayList();
public void register(Object subscriber) {
if (subscriber != null) {
if (this.registrationBlockers.isEmpty()) {
Class subscriberClass = subscriber.getClass();
ArrayList found = new ArrayList();
for (Method var13 : var8.getDeclaredMethods()) {
if (var13.isAnnotationPresent(Subscribe.class)) {
Class[] var14 = var13.getParameterTypes();
if (var14.length == 1) {
for (Method method : subscriberClass.getDeclaredMethods()) {
if (method.isAnnotationPresent(Subscribe.class)) {
Class[] paramTypes = method.getParameterTypes();
if (paramTypes.length == 1) {
try {
var13.setAccessible(true);
MethodHandle var15 = MethodHandles.lookup().unreflect(var13).bindTo(var4).asType(c);
var9.add(new ListenerEntry(var13, var4, var14[0], var15));
} catch (Throwable var21) {
method.setAccessible(true);
MethodHandle handle = MethodHandles.lookup().unreflect(method).bindTo(subscriber).asType(LISTENER_TYPE);
found.add(new ListenerEntry(method, subscriber, paramTypes[0], handle));
} catch (Throwable ignored) {
}
}
}
}
if (!var9.isEmpty()) {
if (!found.isEmpty()) {
synchronized (this.lock) {
if (!d(new Object[]{this.listeners, var4, var5})) {
HashMap var25 = new HashMap(this.listeners);
if (!isRegistered(this.listeners, subscriber)) {
HashMap updated = new HashMap(this.listeners);
for (ListenerEntry var27 : (Iterable<ListenerEntry>)(var9)) {
ListenerEntry[] var28 = (ListenerEntry[])var25.get(var27.a_Class(new Object[0]));
ListenerEntry[] var29;
if (var28 == null) {
var29 = new ListenerEntry[]{var27};
for (ListenerEntry entry : (Iterable<ListenerEntry>)(found)) {
ListenerEntry[] existing = (ListenerEntry[])updated.get(entry.getEventType());
ListenerEntry[] merged;
if (existing == null) {
merged = new ListenerEntry[]{entry};
} else {
var29 = new ListenerEntry[var28.length + 1];
System.arraycopy(var28, 0, var29, 0, var28.length);
var29[var28.length] = var27;
merged = new ListenerEntry[existing.length + 1];
System.arraycopy(existing, 0, merged, 0, existing.length);
merged[existing.length] = entry;
}
var25.put(var27.a_Class(new Object[0]), var29);
updated.put(entry.getEventType(), merged);
}
this.listeners = var25;
this.listeners = updated;
}
}
}
@@ -74,88 +68,77 @@ public class EventBus {
}
}
public void unregister(Object[] var1) {
Object var4 = var1[0];
if (var4 != null) {
public void unregister(Object subscriber) {
if (subscriber != null) {
synchronized (this.lock) {
HashMap var7 = new HashMap(this.listeners);
boolean var8 = false;
HashMap updated = new HashMap(this.listeners);
boolean changed = false;
for (Entry var10 : (Iterable<Entry>)(new ArrayList(var7.entrySet()))) {
ListenerEntry[] var11 = (ListenerEntry[])var10.getValue();
int var12 = 0;
for (Entry bucket : (Iterable<Entry>)(new ArrayList(updated.entrySet()))) {
ListenerEntry[] entries = (ListenerEntry[])bucket.getValue();
int remaining = 0;
for (ListenerEntry var16 : var11) {
if (var16.a_Object(new Object[0]) != var4) {
var12++;
for (ListenerEntry entry : entries) {
if (entry.getTarget() != subscriber) {
remaining++;
}
}
if (var12 != var11.length) {
var8 = true;
if (var12 == 0) {
var7.remove(var10.getKey());
if (remaining != entries.length) {
changed = true;
if (remaining == 0) {
updated.remove(bucket.getKey());
} else {
ListenerEntry[] var21 = new ListenerEntry[var12];
int var22 = 0;
ListenerEntry[] kept = new ListenerEntry[remaining];
int index = 0;
for (ListenerEntry var18 : var11) {
if (var18.a_Object(new Object[0]) != var4) {
var21[var22++] = var18;
for (ListenerEntry candidate : entries) {
if (candidate.getTarget() != subscriber) {
kept[index++] = candidate;
}
}
var7.put((Class)var10.getKey(), var21);
updated.put((Class)bucket.getKey(), kept);
}
}
}
if (var8) {
this.listeners = var7;
if (changed) {
this.listeners = updated;
}
}
}
}
public boolean post(Object[] var1) {
Event var4 = (Event)var1[0];
long var2 = (Long)var1[1];
var2 = 114818700636565L ^ var2;
long var5 = var2 ^ 52036292005796L;
Event.b();
ListenerEntry[] var8 = (ListenerEntry[])this.listeners.get(var4.getClass());
if (var8 == null) {
return var4.a_boolean___(new Object[0]);
public boolean post(Event event) {
ListenerEntry[] entries = (ListenerEntry[])this.listeners.get(event.getClass());
if (entries == null) {
return event.isCancelled();
} else {
for (ListenerEntry var12 : var8) {
for (ListenerEntry entry : entries) {
try {
var12.a_MethodHandle(new Object[0]).invokeExact((Event)var4);
} catch (Throwable var14) {
c(new Object[]{var12, var14, var5});
entry.getHandle().invokeExact(event);
} catch (Throwable error) {
logListenerFailure(entry, error);
}
}
return var4.a_boolean___(new Object[0]);
return event.isCancelled();
}
}
public boolean hasListeners(Object[] var1) {
Class var4 = (Class)var1[0];
Event.b();
ListenerEntry[] var6 = (ListenerEntry[])this.listeners.get(var4);
return var6 != null && var6.length > 0;
public boolean hasListeners(Class eventType) {
ListenerEntry[] entries = (ListenerEntry[])this.listeners.get(eventType);
return entries != null && entries.length > 0;
}
public boolean hasListenerOfType(Object[] var1) {
Class var5 = (Class)var1[0];
Class var4 = (Class)var1[1];
Event.b();
ListenerEntry[] var7 = (ListenerEntry[])this.listeners.get(var5);
if (var7 == null) {
public boolean hasListenerOfType(Class eventType, Class ownerType) {
ListenerEntry[] entries = (ListenerEntry[])this.listeners.get(eventType);
if (entries == null) {
return false;
} else {
for (ListenerEntry var11 : var7) {
if (var4.isInstance(var11.a_Object(new Object[0]))) {
for (ListenerEntry entry : entries) {
if (ownerType.isInstance(entry.getTarget())) {
return true;
}
}
@@ -164,14 +147,10 @@ public class EventBus {
}
}
private static boolean d(Object[] var0) {
Map var1 = (Map)var0[0];
Object var4 = var0[1];
Event.b();
for (ListenerEntry[] var7 : (Iterable<ListenerEntry[]>)(var1.values())) {
for (ListenerEntry var11 : var7) {
if (var11.a_Object(new Object[0]) == var4) {
private static boolean isRegistered(Map listenerMap, Object subscriber) {
for (ListenerEntry[] entries : (Iterable<ListenerEntry[]>)(listenerMap.values())) {
for (ListenerEntry entry : entries) {
if (entry.getTarget() == subscriber) {
return true;
}
}
@@ -180,103 +159,16 @@ public class EventBus {
return false;
}
private static void c(Object[] var0) {
ListenerEntry var4 = (ListenerEntry)var0[0];
Throwable var3 = (Throwable)var0[1];
Event.b();
String var6 = var4.a_Object(new Object[0]).getClass().getName() + "#" + var4.a(new Object[0]).getName();
if (d.add(var6 + ":" + var3.getClass().getName())) {
System.err.println(g + var6);
var3.printStackTrace();
private static void logListenerFailure(ListenerEntry entry, Throwable error) {
String listenerName = entry.getTarget().getClass().getName() + "#" + entry.getMethod().getName();
if (LOGGED_FAILURES.add(listenerName + ":" + error.getClass().getName())) {
System.err.println(LISTENER_ERROR_PREFIX + listenerName);
error.printStackTrace();
}
}
static {
c = MethodType.methodType(void.class, Event.class);
d = ConcurrentHashMap.newKeySet();
}
private static Field a(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field b(Class var0, String var1, Class var2) {
Field var3 = a(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = b(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method a(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method b(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = a(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = b(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
}
private static Object[] b() {
return new Object[0];
}
private static Object[] a(Object var0, Object var1) {
return new Object[]{var0, var1};
}
private static Object[] a(Object var0) {
return new Object[]{var0};
}
private static Throwable a(Throwable var0) {
return var0;
LISTENER_TYPE = MethodType.methodType(void.class, Event.class);
LOGGED_FAILURES = ConcurrentHashMap.newKeySet();
}
}
@@ -1,8 +1,6 @@
package dev.zprestige.prestige;
import dev.zprestige.prestige.annotation.Chainable;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.function.Predicate;
public class FloatSetting extends Setting {
@@ -15,10 +13,10 @@ public class FloatSetting extends Setting {
private final float min;
private final float max;
public FloatSetting(String var1, float var2, float var3, float var4) {
super(var1, var2);
this.min = var3;
this.max = var4;
public FloatSetting(String settingName, float defaultValue, float minValue, float maxValue) {
super(settingName, defaultValue);
this.min = minValue;
this.max = maxValue;
}
@Chainable
@@ -31,100 +29,25 @@ public class FloatSetting extends Setting {
return this.max;
}
public FloatSetting setVisibility_FloatSetting(Object[] var1) {
Predicate var2 = (Predicate)var1[0];
long var3 = (Long)var1[1];
var3 = 123628267853707L ^ var3;
long var5 = var3 ^ 130072979389281L;
super.setVisibility(new Object[]{var2, var5});
public FloatSetting visibleWhen(Predicate visibilityPredicate) {
super.setVisibility(visibilityPredicate);
return this;
}
@Chainable
public FloatSetting setDescription_FloatSetting(String var1) {
super.setDescription(var1);
public FloatSetting withDescription(String newDescription) {
super.setDescription(newDescription);
return this;
}
@Override
public Setting setVisibility(Object[] var1) {
Predicate var2 = (Predicate)var1[0];
long var3 = (Long)var1[1];
long var5 = var3 ^ 6857104452842L;
return this.setVisibility_FloatSetting(new Object[]{var2, var5});
public Setting setVisibility(Predicate visibilityPredicate) {
return this.visibleWhen(visibilityPredicate);
}
@Chainable
@Override
public Setting setDescription(String var1) {
return this.setDescription_FloatSetting(var1);
}
private static Field c(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field d(Class var0, String var1, Class var2) {
Field var3 = c(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = d(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method c(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method d(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = c(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = d(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
public Setting setDescription(String newDescription) {
return this.withDescription(newDescription);
}
}
@@ -1,8 +1,5 @@
package dev.zprestige.prestige;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
public enum Gamemode {
Crystal,
Mace,
@@ -11,76 +8,4 @@ public enum Gamemode {
UHC,
Cart,
Any;
static {
Object[] var10001 = new Object[]{0L};
}
private static Field a(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field b(Class var0, String var1, Class var2) {
Field var3 = a(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = b(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method a(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method b(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = a(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = b(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
}
}
@@ -1,8 +1,6 @@
package dev.zprestige.prestige;
import dev.zprestige.prestige.annotation.Chainable;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.function.Predicate;
public class IntSetting extends Setting {
@@ -15,10 +13,10 @@ public class IntSetting extends Setting {
private final int min;
private final int max;
public IntSetting(String var1, int var2, int var3, int var4) {
super(var1, var2);
this.min = var3;
this.max = var4;
public IntSetting(String settingName, int defaultValue, int minValue, int maxValue) {
super(settingName, defaultValue);
this.min = minValue;
this.max = maxValue;
}
@Chainable
@@ -31,100 +29,25 @@ public class IntSetting extends Setting {
return this.max;
}
public IntSetting setVisibility_IntSetting(Object[] var1) {
Predicate var4 = (Predicate)var1[0];
long var2 = (Long)var1[1];
var2 = 3997353521073L ^ var2;
long var5 = var2 ^ 73798710165983L;
super.setVisibility(new Object[]{var4, var5});
public IntSetting visibleWhen(Predicate visibilityPredicate) {
super.setVisibility(visibilityPredicate);
return this;
}
@Chainable
public IntSetting setDescription_IntSetting(String var1) {
super.setDescription(var1);
public IntSetting withDescription(String newDescription) {
super.setDescription(newDescription);
return this;
}
@Override
public Setting setVisibility(Object[] var1) {
Predicate var2 = (Predicate)var1[0];
long var3 = (Long)var1[1];
long var5 = var3 ^ 71176956259950L;
return this.setVisibility_IntSetting(new Object[]{var2, var5});
public Setting setVisibility(Predicate visibilityPredicate) {
return this.visibleWhen(visibilityPredicate);
}
@Chainable
@Override
public Setting setDescription(String var1) {
return this.setDescription_IntSetting(var1);
}
private static Field c(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field d(Class var0, String var1, Class var2) {
Field var3 = c(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = d(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method c(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method d(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = c(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = d(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
public Setting setDescription(String newDescription) {
return this.withDescription(newDescription);
}
}
@@ -1,8 +1,6 @@
package dev.zprestige.prestige;
import dev.zprestige.prestige.annotation.Chainable;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.function.Predicate;
import net.minecraft.client.MinecraftClient;
import org.lwjgl.glfw.GLFW;
@@ -14,126 +12,47 @@ public class KeybindSetting extends Setting {
return (Integer)super.getValue();
}
private boolean toggleMode;
private boolean holdMode;
public KeybindSetting(String var1, int var2) {
super(var1, var2);
public KeybindSetting(String settingName, int defaultKey) {
super(settingName, defaultKey);
}
@Chainable
public boolean isToggleMode() {
return this.toggleMode;
public boolean isHoldMode() {
return this.holdMode;
}
@Chainable
public void setToggleMode(boolean var1) {
this.toggleMode = var1;
public void setHoldMode(boolean hold) {
this.holdMode = hold;
}
public KeybindSetting setVisibility_KeybindSetting(Object[] var1) {
Predicate var4 = (Predicate)var1[0];
long var2 = (Long)var1[1];
var2 = 99049240658274L ^ var2;
long var5 = var2 ^ 41186392833473L;
super.setVisibility(new Object[]{var4, var5});
public KeybindSetting visibleWhen(Predicate visibilityPredicate) {
super.setVisibility(visibilityPredicate);
return this;
}
@Chainable
public KeybindSetting setDescription_KeybindSetting(String var1) {
super.setDescription(var1);
public KeybindSetting withDescription(String newDescription) {
super.setDescription(newDescription);
return this;
}
public boolean isPressed(Object[] var1) {
public boolean isPressed() {
return this.getValue() != -1 && this.getValue() > 9994
? GLFW.glfwGetMouseButton(MinecraftClient.getInstance().getWindow().getHandle(), 9999 - (Integer)this.getValue()) == 1
: GLFW.glfwGetKey(MinecraftClient.getInstance().getWindow().getHandle(), (Integer)this.getValue()) == 1;
? GLFW.glfwGetMouseButton(MinecraftClient.getInstance().getWindow().getHandle(), 9999 - this.getValue()) == 1
: GLFW.glfwGetKey(MinecraftClient.getInstance().getWindow().getHandle(), this.getValue()) == 1;
}
@Override
public Setting setVisibility(Object[] var1) {
Predicate var4 = (Predicate)var1[0];
long var2 = (Long)var1[1];
long var5 = var2 ^ 140053625863331L;
return this.setVisibility_KeybindSetting(new Object[]{var4, var5});
public Setting setVisibility(Predicate visibilityPredicate) {
return this.visibleWhen(visibilityPredicate);
}
@Chainable
@Override
public Setting setDescription(String var1) {
return this.setDescription_KeybindSetting(var1);
}
private static Field c(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field d(Class var0, String var1, Class var2) {
Field var3 = c(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = d(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method c(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method d(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = c(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = d(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
}
private static MatchException b(MatchException var0) {
return var0;
public Setting setDescription(String newDescription) {
return this.withDescription(newDescription);
}
}
@@ -9,30 +9,30 @@ public class ListenerEntry {
private final Class eventType;
private final MethodHandle handle;
public ListenerEntry(Method var1, Object var2, Class var3) {
this(var1, var2, var3, null);
public ListenerEntry(Method subscriberMethod, Object subscriber, Class subscribedType) {
this(subscriberMethod, subscriber, subscribedType, null);
}
public ListenerEntry(Method var1, Object var2, Class var3, MethodHandle var4) {
this.method = var1;
this.target = var2;
this.eventType = var3;
this.handle = var4;
public ListenerEntry(Method subscriberMethod, Object subscriber, Class subscribedType, MethodHandle boundHandle) {
this.method = subscriberMethod;
this.target = subscriber;
this.eventType = subscribedType;
this.handle = boundHandle;
}
public Method a(Object[] var1) {
public Method getMethod() {
return this.method;
}
public Object a_Object(Object[] var1) {
public Object getTarget() {
return this.target;
}
public Class a_Class(Object[] var1) {
public Class getEventType() {
return this.eventType;
}
public MethodHandle a_MethodHandle(Object[] var1) {
public MethodHandle getHandle() {
return this.handle;
}
}
@@ -1,8 +1,6 @@
package dev.zprestige.prestige;
import java.awt.Color;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
public class MenuModule extends Module {
private final KeybindSetting menuKey;
@@ -12,99 +10,25 @@ public class MenuModule extends Module {
public MenuModule() {
dev.zprestige.prestige.ui.bridge.Bootstrap.pre(this);
Object[] var10006 = new Object[]{null, null, 137970699205822L};
var10006[1] = 161;
var10006[0] = "Menu Key";
this.menuKey = this.addKeybind(var10006);
this.descriptionMode = this.addEnum(new Object[]{"Descriptions", "Mouse", new String[]{"Mouse", "Search Bar"}, 85198277421524L});
var10006 = new Object[]{null, null, 136800689510088L};
var10006[1] = false;
var10006[0] = "Rounded";
this.rounded = this.addBool(var10006);
this.menuColor = this.addColor(new Object[]{"Menu Color", new Color(131, 118, 252), 17358566314135L});
this.menuKey = this.addKeybind("Menu Key", 161);
this.descriptionMode = this.addEnum("Descriptions", "Mouse", new String[]{"Mouse", "Search Bar"});
this.rounded = this.addBool("Rounded", false);
this.menuColor = this.addColor("Menu Color", new Color(131, 118, 252));
}
public KeybindSetting getMenuKey(Object[] var1) {
public KeybindSetting getMenuKey() {
return this.menuKey;
}
public EnumSetting getDescriptionMode(Object[] var1) {
public EnumSetting getDescriptionMode() {
return this.descriptionMode;
}
public BoolSetting getRounded(Object[] var1) {
public BoolSetting getRounded() {
return this.rounded;
}
public ColorSetting getMenuColor(Object[] var1) {
public ColorSetting getMenuColor() {
return this.menuColor;
}
private static Field g(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field h(Class var0, String var1, Class var2) {
Field var3 = g(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = h(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method g(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method h(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = g(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = h(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
}
}
+77 -177
View File
@@ -3,17 +3,14 @@ package dev.zprestige.prestige;
import dev.zprestige.prestige.annotation.Chainable;
import dev.zprestige.prestige.annotation.NativeId;
import dev.zprestige.prestige.client.Prestige;
import dev.zprestige.prestige.event.Event;
import dev.zprestige.prestige.hud.ModuleNotificationsElement;
import dev.zprestige.prestige.render.RenderContract2;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import dev.zprestige.prestige.render.MinecraftAccess;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
public class Module extends SettingHolder implements RenderContract2 {
public class Module extends SettingHolder implements MinecraftAccess {
private final List coreSettings = new ArrayList();
private final BoolSetting enabledSetting = new BoolSetting("Enabled", false);
private String name;
@@ -24,139 +21,120 @@ public class Module extends SettingHolder implements RenderContract2 {
private volatile List allSettingsCache;
public Module() {
this.keybind = new KeybindSetting("Bind", -1).setDescription_KeybindSetting("Keybind for " + this.name);
this.keybind = new KeybindSetting("Bind", -1).withDescription("Keybind for " + this.name);
this.coreSettings.add(this.enabledSetting);
this.coreSettings.add(this.keybind);
}
public Module(String var1, String var2, int var3) {
public Module(String moduleName, String moduleDescription, int categoryOrdinal) {
this();
Event.b();
this.name = var1;
this.description = var2;
this.name = moduleName;
this.description = moduleDescription;
for (Category var10 : Category.values()) {
if (var10.ordinal() == var3) {
this.category = var10;
for (Category candidate : Category.values()) {
if (candidate.ordinal() == categoryOrdinal) {
this.category = candidate;
break;
}
}
}
@NativeId("")
public void a(Object var1, String var2, String var3, int var4) {
if (var1 != null) {
this.settings.add((Setting)var1);
public void injectFromNative(Object injectedSetting, String moduleName, String moduleDescription, int categoryOrdinal) {
if (injectedSetting != null) {
this.settings.add((Setting)injectedSetting);
this.allSettingsCache = null;
} else {
this.name = var2;
this.description = var3;
this.category = Arrays.stream(Category.values()).filter(lpL71_0 -> ((dev.zprestige.prestige.Category)lpL71_0).ordinal() == var4).findFirst().orElse(this.category);
this.name = moduleName;
this.description = moduleDescription;
this.category = Arrays.stream(Category.values()).filter(candidate -> candidate.ordinal() == categoryOrdinal).findFirst().orElse(this.category);
}
}
@Chainable
public boolean isEnabled() {
return (Boolean)this.enabledSetting.getValue();
return this.enabledSetting.getValue();
}
public int getKey(Object[] var1) {
return (Integer)this.keybind.getValue();
public int getKey() {
return this.keybind.getValue();
}
public KeybindSetting getKeybind(Object[] var1) {
public KeybindSetting getKeybind() {
return this.keybind;
}
public void toggle(Object[] var1) {
long var2 = (Long)var1[0];
long var4 = var2 ^ 55958956532363L;
long var6 = var2 ^ 15872977247914L;
long var8 = var2 ^ 22594282158762L;
long var10 = var2 ^ 37299566365261L;
long var12 = var2 ^ 75993416544364L;
long var14 = var2 ^ 86929222885577L;
long var16 = var2 ^ 79146057582229L;
public void toggle() {
this.enabledSetting.setValue(!this.isEnabled());
this.setLastEnabled(new Object[]{this.isEnabled()});
this.setLastEnabled(this.isEnabled());
if (this.isEnabled()) {
Prestige.eventBus.register(new Object[]{this, var6});
if (b.world != null && b.player != null) {
this.onEnable(new Object[]{var8});
Prestige.eventBus.register(this);
if (mc.world != null && mc.player != null) {
this.onEnable();
} else {
Prestige.moduleManager.queueEnable(new Object[]{this, var12});
Prestige.moduleManager.queueEnable(this);
}
} else {
Prestige.eventBus.unregister(new Object[]{this, var4});
if (b.world != null && b.player != null) {
this.onDisable(new Object[]{var14});
Prestige.eventBus.unregister(this);
if (mc.world != null && mc.player != null) {
this.onDisable();
} else {
Prestige.moduleManager.queueDisable(new Object[]{this, var16});
Prestige.moduleManager.queueDisable(this);
}
}
ModuleNotificationsElement.r(new Object[]{this, var10});
ModuleNotificationsElement.notifyToggle(this);
}
public void applyState(Object[] var1) {
long var2 = (Long)var1[0];
var2 = 25781655103684L ^ var2;
long var4 = var2 ^ 120644081699938L;
long var6 = var2 ^ 89278968246339L;
long var8 = var2 ^ 83365083665475L;
long var10 = var2 ^ 139299437470884L;
long var12 = var2 ^ 28865644895877L;
long var14 = var2 ^ 17947047808544L;
long var16 = var2 ^ 27105383311484L;
public void applyState() {
if (this.isEnabled()) {
Prestige.eventBus.register(new Object[]{this, var6});
if (b.world != null && b.player != null) {
this.onEnable(new Object[]{var8});
Prestige.eventBus.register(this);
if (mc.world != null && mc.player != null) {
this.onEnable();
} else {
Prestige.moduleManager.queueEnable(new Object[]{this, var12});
Prestige.moduleManager.queueEnable(this);
}
} else {
Prestige.eventBus.unregister(new Object[]{this, var4});
if (b.world != null && b.player != null) {
this.onDisable(new Object[]{var14});
Prestige.eventBus.unregister(this);
if (mc.world != null && mc.player != null) {
this.onDisable();
} else {
Prestige.moduleManager.queueDisable(new Object[]{this, var16});
Prestige.moduleManager.queueDisable(this);
}
}
ModuleNotificationsElement.r(new Object[]{this, var10});
ModuleNotificationsElement.notifyToggle(this);
}
public void dispose(Object[] var1) {
public void dispose() {
this.name = null;
Event.b();
this.description = null;
ArrayList var5 = new ArrayList();
var5.addAll(this.settings);
var5.addAll(this.coreSettings);
ArrayList allSettings = new ArrayList();
allSettings.addAll(this.settings);
allSettings.addAll(this.coreSettings);
for (Setting var7 : (Iterable<Setting>)(var5)) {
var7.setName(new Object[]{null});
var7.setDescription(null);
var7.setValue(null);
for (Setting setting : (Iterable<Setting>)(allSettings)) {
setting.setName(null);
setting.setDescription(null);
setting.setValue(null);
}
}
public void onEnable(Object[] var1) {
public void onEnable() {
}
public void onDisable(Object[] var1) {
public void onDisable() {
}
public boolean b(Object[] var1) {
public boolean isPersistent() {
return true;
}
public String getInfo(Object[] var1) {
public String getInfo() {
return "";
}
public List getCoreSettings(Object[] var1) {
public List getCoreSettings() {
return this.coreSettings;
}
@@ -165,9 +143,8 @@ public class Module extends SettingHolder implements RenderContract2 {
return this.name;
}
public void setName(Object[] var1) {
String var2 = (String)var1[0];
this.name = var2;
public void setName(String newName) {
this.name = newName;
}
@Chainable
@@ -175,9 +152,8 @@ public class Module extends SettingHolder implements RenderContract2 {
return this.description;
}
public void setDescription(Object[] var1) {
String var2 = (String)var1[0];
this.description = var2;
public void setDescription(String newDescription) {
this.description = newDescription;
}
@Chainable
@@ -185,123 +161,47 @@ public class Module extends SettingHolder implements RenderContract2 {
return this.category;
}
public void setCategory(Object[] var1) {
Category var2 = (Category)var1[0];
this.category = var2;
public void setCategory(Category newCategory) {
this.category = newCategory;
}
public boolean getLastEnabled(Object[] var1) {
public boolean getLastEnabled() {
return this.lastEnabled;
}
public void setLastEnabled(Object[] var1) {
boolean var2 = (Boolean)var1[0];
this.lastEnabled = var2;
public void setLastEnabled(boolean wasEnabled) {
this.lastEnabled = wasEnabled;
}
@Chainable
public List getSettings() {
Event.b();
List var4 = this.allSettingsCache;
if (var4 == null) {
ArrayList var5 = new ArrayList(this.coreSettings.size() + this.settings.size());
var5.addAll(this.coreSettings);
var5.addAll(this.settings);
var4 = List.copyOf(var5);
this.allSettingsCache = var4;
List cachedSettings = this.allSettingsCache;
if (cachedSettings == null) {
ArrayList combinedSettings = new ArrayList(this.coreSettings.size() + this.settings.size());
combinedSettings.addAll(this.coreSettings);
combinedSettings.addAll(this.settings);
cachedSettings = List.copyOf(combinedSettings);
this.allSettingsCache = cachedSettings;
}
return var4;
return cachedSettings;
}
public Set getGamemodes(Object[] var1) {
public Set getGamemodes() {
return Set.of(Gamemode.Any);
}
@Chainable
public int getGamemodeMask() {
Set var6 = this.getGamemodes(new Object[]{33917734280704L});
Event.b();
int var7 = 0;
Set gamemodes = this.getGamemodes();
int gamemodeMask = 0;
for (Gamemode var9 : (Iterable<Gamemode>)(var6)) {
if (var9 != Gamemode.Any) {
var7 |= 1 << var9.ordinal();
for (Gamemode gamemode : (Iterable<Gamemode>)(gamemodes)) {
if (gamemode != Gamemode.Any) {
gamemodeMask |= 1 << gamemode.ordinal();
}
}
return var7;
}
private static Field e(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field f(Class var0, String var1, Class var2) {
Field var3 = e(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = f(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method e(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method f(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = e(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = f(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
}
private static MatchException b(MatchException var0) {
return var0;
return gamemodeMask;
}
}
@@ -2,64 +2,57 @@ package dev.zprestige.prestige;
import dev.zprestige.prestige.annotation.Chainable;
import dev.zprestige.prestige.client.Prestige;
import dev.zprestige.prestige.event.TickEvent19;
import dev.zprestige.prestige.render.RenderContract2;
import dev.zprestige.prestige.event.ClientTickEvent;
import dev.zprestige.prestige.render.MinecraftAccess;
import java.awt.Color;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ConcurrentLinkedQueue;
public class ModuleManager implements RenderContract2 {
public class ModuleManager implements MinecraftAccess {
private final MenuModule menu;
private List modules;
private final ConcurrentLinkedQueue enableQueue;
private final ConcurrentLinkedQueue disableQueue;
public static boolean f = true;
public static boolean headTickFallback = true;
public ModuleManager(long var1) {
public ModuleManager() {
super();
var1 = 0L;
var1 = 22310984220293L ^ var1;
long var3 = var1 ^ 31757000116027L;
this.menu = new MenuModule();
this.modules = new ArrayList();
this.enableQueue = new ConcurrentLinkedQueue();
this.disableQueue = new ConcurrentLinkedQueue();
Prestige.eventBus.register(new Object[]{this, var3});
Prestige.eventBus.register(this);
}
@Subscribe
public void onTick(TickEvent19 var1) {
if (b.world != null && b.player != null) {
public void onClientTick(ClientTickEvent event) {
if (mc.world != null && mc.player != null) {
while (!this.enableQueue.isEmpty()) {
Module var9 = (Module)this.enableQueue.poll();
if (var9 != null && var9.isEnabled()) {
var9.onEnable(new Object[]{136490818940166L});
Module pendingEnable = (Module)this.enableQueue.poll();
if (pendingEnable != null && pendingEnable.isEnabled()) {
pendingEnable.onEnable();
}
}
while (!this.disableQueue.isEmpty()) {
Module var10 = (Module)this.disableQueue.poll();
if (var10 != null && !var10.isEnabled()) {
var10.onDisable(new Object[]{43569551062885L});
Module pendingDisable = (Module)this.disableQueue.poll();
if (pendingDisable != null && !pendingDisable.isEnabled()) {
pendingDisable.onDisable();
}
}
}
}
public void queueEnable(Object[] var1) {
Module var4 = (Module)var1[0];
if (!this.enableQueue.contains(var4)) {
this.enableQueue.offer(var4);
public void queueEnable(Module module) {
if (!this.enableQueue.contains(module)) {
this.enableQueue.offer(module);
}
}
public void queueDisable(Object[] var1) {
Module var4 = (Module)var1[0];
if (!this.disableQueue.contains(var4)) {
this.disableQueue.offer(var4);
public void queueDisable(Module module) {
if (!this.disableQueue.contains(module)) {
this.disableQueue.offer(module);
}
}
@@ -69,89 +62,21 @@ public class ModuleManager implements RenderContract2 {
}
@Chainable
public void setModules(List var1) {
this.modules = var1;
public void setModules(List moduleList) {
this.modules = moduleList;
}
public MenuModule getMenu(Object[] var1) {
public MenuModule getMenu() {
return this.menu;
}
@Chainable
public void setMenuColor(Color var1) {
this.menu.getMenuColor(new Object[0]).setValue(var1);
public void setMenuColor(Color color) {
this.menu.getMenuColor().setValue(color);
}
@Chainable
public void setMenuKey(int var1) {
this.menu.getMenuKey(new Object[0]).setValue(var1);
}
private static Field c(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field d(Class var0, String var1, Class var2) {
Field var3 = c(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = d(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method c(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method d(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = c(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = d(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
public void setMenuKey(int key) {
this.menu.getMenuKey().setValue(key);
}
}
@@ -1,9 +1,6 @@
package dev.zprestige.prestige;
import dev.zprestige.prestige.annotation.Chainable;
import dev.zprestige.prestige.event.Event;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Predicate;
@@ -19,15 +16,14 @@ public class MultiSetting extends Setting {
private final boolean[] selected;
private final Map indexByOption;
public MultiSetting(String var1, String[] var2, boolean[] var3) {
super(var1, "");
Event.b();
this.options = var2;
this.selected = var3;
this.indexByOption = new HashMap(var2.length * 2);
public MultiSetting(String settingName, String[] optionValues, boolean[] defaultSelection) {
super(settingName, "");
this.options = optionValues;
this.selected = defaultSelection;
this.indexByOption = new HashMap(optionValues.length * 2);
for (int var7 = 0; var7 < var2.length; var7++) {
this.indexByOption.put(var2[var7], var7);
for (int index = 0; index < optionValues.length; index++) {
this.indexByOption.put(optionValues[index], index);
}
}
@@ -36,24 +32,22 @@ public class MultiSetting extends Setting {
return this.options;
}
public boolean isSelected(Object[] var1) {
String var2 = (String)var1[0];
Integer var5 = (Integer)this.indexByOption.get(var2);
if (var5 == null) {
throw new IllegalArgumentException("Value not found: " + var2);
public boolean isSelected(String option) {
Integer optionIndex = (Integer)this.indexByOption.get(option);
if (optionIndex == null) {
throw new IllegalArgumentException("Value not found: " + option);
} else {
return this.selected[var5];
return this.selected[optionIndex];
}
}
@Chainable
public void setSelected(String var1, boolean var2) {
Event.b();
Integer var6 = (Integer)this.indexByOption.get(var1);
if (var6 == null) {
throw new IllegalArgumentException("Value not found: " + var1);
public void setSelected(String option, boolean selectedState) {
Integer optionIndex = (Integer)this.indexByOption.get(option);
if (optionIndex == null) {
throw new IllegalArgumentException("Value not found: " + option);
} else {
this.selected[var6] = var2;
this.selected[optionIndex] = selectedState;
}
}
@@ -62,104 +56,25 @@ public class MultiSetting extends Setting {
return this.selected;
}
public MultiSetting setVisibility_MultiSetting(Object[] var1) {
Predicate var4 = (Predicate)var1[0];
long var2 = (Long)var1[1];
var2 = 89151985553059L ^ var2;
long var5 = var2 ^ 96972061473817L;
super.setVisibility(new Object[]{var4, var5});
public MultiSetting visibleWhen(Predicate visibilityPredicate) {
super.setVisibility(visibilityPredicate);
return this;
}
@Chainable
public MultiSetting setDescription_MultiSetting(String var1) {
super.setDescription(var1);
public MultiSetting withDescription(String newDescription) {
super.setDescription(newDescription);
return this;
}
@Override
public Setting setVisibility(Object[] var1) {
Predicate var4 = (Predicate)var1[0];
long var2 = (Long)var1[1];
long var5 = var2 ^ 10064201577146L;
return this.setVisibility_MultiSetting(new Object[]{var4, var5});
public Setting setVisibility(Predicate visibilityPredicate) {
return this.visibleWhen(visibilityPredicate);
}
@Chainable
@Override
public Setting setDescription(String var1) {
return this.setDescription_MultiSetting(var1);
}
private static Field c(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field d(Class var0, String var1, Class var2) {
Field var3 = c(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = d(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method c(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method d(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = c(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = d(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
}
private static IllegalArgumentException a(IllegalArgumentException var0) {
return var0;
public Setting setDescription(String newDescription) {
return this.withDescription(newDescription);
}
}
@@ -4,46 +4,46 @@ import dev.zprestige.prestige.annotation.NativeId;
import java.util.List;
public class Native {
public static Class a;
public static Class callbackClass;
@NativeId("f29b5f2e-3df2-4db8-bb6e-1c01a5f91f12")
public static void a(List var0) {
public static void registerModules(List modules) {
}
@NativeId("6937e6e7-60ef-45de-98e1-f177ec613e99")
public static void b(int var0, StringBuilder var1) {
public static void fetchString(int id, StringBuilder out) {
}
@NativeId("c4f1db16-7850-44eb-8f8a-863dfe33ab26")
public static void c(StringBuilder var0) {
public static void fetchStatus(StringBuilder out) {
}
@NativeId("774de945-aba3-4038-b5ae-d8ff48635feb")
public static void d(String var0, String var1, boolean var2, String var3, StringBuilder var4, String var5) {
public static void request(String key, String value, boolean flag, String extra, StringBuilder out, String context) {
}
@NativeId("b6356619-bb5a-4616-a076-93f620a7d9de")
public static void e(int var0, StringBuilder var1) {
public static void fetchText(int id, StringBuilder out) {
}
@NativeId("9ae73026-310d-4cbc-b283-12f3f530fe67")
public static void f(int var0, String var1, StringBuilder var2) {
public static void fetchField(int id, String key, StringBuilder out) {
}
@NativeId("08dcf01c-9943-4f66-8dfd-120714d7abdd")
public static void g(String var0) {
public static void submit(String message) {
}
@NativeId("018b2f19-e79e-7d6a-a56d-29feb6211b04")
public static void h() {
public static void onClientTick() {
}
@NativeId("70d16b96-40d4-4e4b-8d11-111b87ee88c2")
public static void i() {
public static void toggleMenu() {
}
@NativeId("0dfaa780-8d92-4e8f-aa2e-9dae747c4dd6")
public static boolean j() {
public static boolean isMenuOpen() {
return false;
}
}
@@ -1,9 +1,7 @@
package dev.zprestige.prestige;
import dev.zprestige.prestige.annotation.Chainable;
import dev.zprestige.prestige.render.RenderUtil5;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import dev.zprestige.prestige.render.RandomUtil;
import java.util.function.Predicate;
public class RangeSetting extends Setting {
@@ -19,13 +17,13 @@ public class RangeSetting extends Setting {
private float high;
private float rolled;
public RangeSetting(String var1, float var2, float var3, float var4, float var5) {
super(var1, var2);
this.low = var2;
this.high = var3;
this.min = var4;
this.max = var5;
this.rolled = var2;
public RangeSetting(String settingName, float defaultLow, float defaultHigh, float minValue, float maxValue) {
super(settingName, defaultLow);
this.low = defaultLow;
this.high = defaultHigh;
this.min = minValue;
this.max = maxValue;
this.rolled = defaultLow;
}
@Chainable
@@ -34,8 +32,8 @@ public class RangeSetting extends Setting {
}
@Chainable
public void setLow(float var1) {
this.low = var1;
public void setLow(float newLow) {
this.low = newLow;
}
@Chainable
@@ -44,8 +42,8 @@ public class RangeSetting extends Setting {
}
@Chainable
public void setHigh(float var1) {
this.high = var1;
public void setHigh(float newHigh) {
this.high = newHigh;
}
@Chainable
@@ -58,128 +56,41 @@ public class RangeSetting extends Setting {
return this.max;
}
public float getRolled(Object[] var1) {
public float getRolled() {
return this.rolled;
}
public void setRolled(Object[] var1) {
float var2 = (Float)var1[0];
this.rolled = var2;
public void setRolled(float newRolled) {
this.rolled = newRolled;
}
public void reroll(Object[] var1) {
long var2 = (Long)var1[0];
var2 = 104704689118488L ^ var2;
long var4 = var2 ^ 118870168785476L;
this.rolled = this.randomInRange(new Object[]{var4});
public void reroll() {
this.rolled = this.randomInRange();
}
public float randomInRange(Object[] var1) {
long var2 = (Long)var1[0];
var2 = 104704689118488L ^ var2;
long var4 = var2 ^ 76056962614760L;
float var10000 = this.low;
float var10001 = this.high;
Object[] var10004 = new Object[]{null, null, var4};
var10004[1] = var10001;
var10004[0] = var10000;
return RenderUtil5.a(var10004);
public float randomInRange() {
return RandomUtil.randomFloat(this.low, this.high);
}
public RangeSetting setVisibility_RangeSetting(Object[] var1) {
Predicate var2 = (Predicate)var1[0];
long var3 = (Long)var1[1];
var3 = 104704689118488L ^ var3;
long var5 = var3 ^ 113704341411105L;
super.setVisibility(new Object[]{var2, var5});
public RangeSetting visibleWhen(Predicate visibilityPredicate) {
super.setVisibility(visibilityPredicate);
return this;
}
@Chainable
public RangeSetting setDescription_RangeSetting(String var1) {
super.setDescription(var1);
public RangeSetting withDescription(String newDescription) {
super.setDescription(newDescription);
return this;
}
@Override
public Setting setVisibility(Object[] var1) {
Predicate var2 = (Predicate)var1[0];
long var3 = (Long)var1[1];
long var5 = var3 ^ 61932072339513L;
return this.setVisibility_RangeSetting(new Object[]{var2, var5});
public Setting setVisibility(Predicate visibilityPredicate) {
return this.visibleWhen(visibilityPredicate);
}
@Chainable
@Override
public Setting setDescription(String var1) {
return this.setDescription_RangeSetting(var1);
}
private static Field c(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field d(Class var0, String var1, Class var2) {
Field var3 = c(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = d(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method c(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method d(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = c(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = d(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
public Setting setDescription(String newDescription) {
return this.withDescription(newDescription);
}
}
@@ -1,8 +1,6 @@
package dev.zprestige.prestige;
import dev.zprestige.prestige.annotation.Chainable;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.function.Predicate;
public abstract class Setting {
@@ -10,11 +8,10 @@ public abstract class Setting {
private Object value;
private String description;
private Predicate visibility;
private static int[] e;
public Setting(String var1, Object var2) {
this.name = var1;
this.value = var2;
public Setting(String settingName, Object defaultValue) {
this.name = settingName;
this.value = defaultValue;
}
@Chainable
@@ -22,9 +19,8 @@ public abstract class Setting {
return this.name;
}
public void setName(Object[] var1) {
String var2 = (String)var1[0];
this.name = var2;
public void setName(String newName) {
this.name = newName;
}
@Chainable
@@ -33,8 +29,8 @@ public abstract class Setting {
}
@Chainable
public void setValue(Object var1) {
this.value = var1;
public void setValue(Object newValue) {
this.value = newValue;
}
@Chainable
@@ -43,14 +39,13 @@ public abstract class Setting {
}
@Chainable
public Setting setDescription(String var1) {
this.description = var1;
public Setting setDescription(String newDescription) {
this.description = newDescription;
return this;
}
public Setting setVisibility(Object[] var1) {
Predicate var2 = (Predicate)var1[0];
this.visibility = var2;
public Setting setVisibility(Predicate visibilityPredicate) {
this.visibility = visibilityPredicate;
return this;
}
@@ -58,84 +53,4 @@ public abstract class Setting {
public boolean isVisible() {
return this.visibility == null || this.visibility.test(this.getValue());
}
public static void b(int[] var0) {
e = var0;
}
public static int[] b() {
return e;
}
static {
b();
}
private static Field a(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field b(Class var0, String var1, Class var2) {
Field var3 = a(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = b(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method a(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method b(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = a(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = b(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
}
}
@@ -1,111 +1,32 @@
package dev.zprestige.prestige;
import java.awt.Color;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.ArrayList;
public class SettingHolder {
public final ArrayList settings = new ArrayList();
public KeybindSetting addKeybind(Object[] var1) {
String var2 = (String)var1[0];
int var5 = (Integer)var1[1];
KeybindSetting var6 = new KeybindSetting(var2, var5);
this.settings.add(var6);
return var6;
public KeybindSetting addKeybind(String settingName, int defaultKey) {
KeybindSetting createdSetting = new KeybindSetting(settingName, defaultKey);
this.settings.add(createdSetting);
return createdSetting;
}
public BoolSetting addBool(Object[] var1) {
String var2 = (String)var1[0];
boolean var3 = (Boolean)var1[1];
BoolSetting var6 = new BoolSetting(var2, var3);
this.settings.add(var6);
return var6;
public BoolSetting addBool(String settingName, boolean defaultValue) {
BoolSetting createdSetting = new BoolSetting(settingName, defaultValue);
this.settings.add(createdSetting);
return createdSetting;
}
public EnumSetting addEnum(Object[] var1) {
String var4 = (String)var1[0];
String var2 = (String)var1[1];
String[] var3 = (String[])var1[2];
EnumSetting var7 = new EnumSetting(var4, var2, var3);
this.settings.add(var7);
return var7;
public EnumSetting addEnum(String settingName, String defaultOption, String[] optionValues) {
EnumSetting createdSetting = new EnumSetting(settingName, defaultOption, optionValues);
this.settings.add(createdSetting);
return createdSetting;
}
public ColorSetting addColor(Object[] var1) {
String var4 = (String)var1[0];
Color var5 = (Color)var1[1];
ColorSetting var6 = new ColorSetting(var4, var5);
this.settings.add(var6);
return var6;
}
private static Field c(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field d(Class var0, String var1, Class var2) {
Field var3 = c(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = d(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method c(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method d(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = c(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = d(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
public ColorSetting addColor(String settingName, Color defaultColor) {
ColorSetting createdSetting = new ColorSetting(settingName, defaultColor);
this.settings.add(createdSetting);
return createdSetting;
}
}
@@ -1,8 +1,6 @@
package dev.zprestige.prestige;
import dev.zprestige.prestige.annotation.Chainable;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.function.Predicate;
public class TextSetting extends Setting {
@@ -14,109 +12,34 @@ public class TextSetting extends Setting {
private final String placeholder;
public TextSetting(String var1, String var2, String var3) {
super(var1, var2);
this.placeholder = var3;
public TextSetting(String settingName, String defaultText, String placeholderText) {
super(settingName, defaultText);
this.placeholder = placeholderText;
}
public String getPlaceholder(Object[] var1) {
public String getPlaceholder() {
return this.placeholder;
}
public TextSetting setVisibility_TextSetting(Object[] var1) {
Predicate var2 = (Predicate)var1[0];
long var3 = (Long)var1[1];
var3 = 90219420051481L ^ var3;
long var5 = var3 ^ 38810053965316L;
super.setVisibility(new Object[]{var2, var5});
public TextSetting visibleWhen(Predicate visibilityPredicate) {
super.setVisibility(visibilityPredicate);
return this;
}
@Chainable
public TextSetting setDescription_TextSetting(String var1) {
super.setDescription(var1);
public TextSetting withDescription(String newDescription) {
super.setDescription(newDescription);
return this;
}
@Override
public Setting setVisibility(Object[] var1) {
Predicate var4 = (Predicate)var1[0];
long var2 = (Long)var1[1];
long var5 = var2 ^ 124528063749661L;
return this.setVisibility_TextSetting(new Object[]{var4, var5});
public Setting setVisibility(Predicate visibilityPredicate) {
return this.visibleWhen(visibilityPredicate);
}
@Chainable
@Override
public Setting setDescription(String var1) {
return this.setDescription_TextSetting(var1);
}
private static Field c(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field d(Class var0, String var1, Class var2) {
Field var3 = c(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = d(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method c(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method d(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = c(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = d(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
public Setting setDescription(String newDescription) {
return this.withDescription(newDescription);
}
}
@@ -4,247 +4,144 @@ import dev.zprestige.prestige.EventBus;
import dev.zprestige.prestige.Module;
import dev.zprestige.prestige.ModuleManager;
import dev.zprestige.prestige.Native;
import dev.zprestige.prestige.Setting;
import dev.zprestige.prestige.combat.AimManager;
import dev.zprestige.prestige.combat.DamageUtil;
import dev.zprestige.prestige.combat.RotationManager;
import dev.zprestige.prestige.combat.TargetManager;
import dev.zprestige.prestige.combat.ClickScheduler;
import dev.zprestige.prestige.combat.ExplosionDamageCalculator;
import dev.zprestige.prestige.combat.VisualRotationManager;
import dev.zprestige.prestige.combat.BotFilter;
import dev.zprestige.prestige.combat.TargetTracker;
import dev.zprestige.prestige.config.ConfigManager;
import dev.zprestige.prestige.event.EventManager;
import dev.zprestige.prestige.event.TickEvent24;
import dev.zprestige.prestige.event.TickEvent25;
import dev.zprestige.prestige.event.TickEvent27;
import dev.zprestige.prestige.event.ModuleStateSync;
import dev.zprestige.prestige.event.FrameEvent;
import dev.zprestige.prestige.event.Render2DEvent;
import dev.zprestige.prestige.event.Render3DEvent;
import dev.zprestige.prestige.gui.ClickGuiScreen;
import dev.zprestige.prestige.gui.HudEditorScreen;
import dev.zprestige.prestige.input.MouseManager;
import dev.zprestige.prestige.network.PacketManager;
import dev.zprestige.prestige.network.PacketQueue;
import dev.zprestige.prestige.network.PingManager;
import dev.zprestige.prestige.render.ESPUtil;
import dev.zprestige.prestige.input.KeybindManager;
import dev.zprestige.prestige.network.SilentSlotManager;
import dev.zprestige.prestige.network.InventorySwapQueue;
import dev.zprestige.prestige.network.TotemPopManager;
import dev.zprestige.prestige.render.EspShaderManager;
import dev.zprestige.prestige.render.FontManager;
import dev.zprestige.prestige.render.MatrixStack;
import dev.zprestige.prestige.render.RenderContract2;
import dev.zprestige.prestige.render.RenderContract5;
import dev.zprestige.prestige.render.RenderContract6;
import dev.zprestige.prestige.render.RenderState;
import dev.zprestige.prestige.render.RenderUtil;
import dev.zprestige.prestige.render.Renderer2D;
import dev.zprestige.prestige.render.Render2D;
import dev.zprestige.prestige.render.MinecraftAccess;
import dev.zprestige.prestige.render.RenderEvents;
import dev.zprestige.prestige.render.RenderCallback;
import dev.zprestige.prestige.render.ShapeRenderer;
import dev.zprestige.prestige.render.RenderCore;
import dev.zprestige.prestige.render.SilentRotationManager;
import dev.zprestige.prestige.social.FriendManager;
import dev.zprestige.prestige.util.BindManager;
import dev.zprestige.prestige.util.Timer;
import dev.zprestige.prestige.util.TpsTimer;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import dev.zprestige.prestige.util.SimulatedClickManager;
import dev.zprestige.prestige.util.FrameDeltaTimer;
import dev.zprestige.prestige.util.NotificationManager;
import java.util.concurrent.atomic.AtomicBoolean;
import net.fabricmc.api.ModInitializer;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.ChatScreen;
public class Prestige implements ModInitializer {
private static final AtomicBoolean a = new AtomicBoolean(false);
private static final AtomicBoolean initialized = new AtomicBoolean(false);
public static EventBus eventBus;
public static FontManager c;
public static FontManager fontManager;
public static ModuleManager moduleManager;
public static ConfigManager e;
public static DamageUtil f;
public static FriendManager g;
public static Timer h;
public static TargetManager i;
public static AimManager j;
public static ClickGuiScreen k;
public static HudEditorScreen l;
public static EventManager m;
public static TargetTracker n;
public static Renderer2D o;
public static RotationManager p;
public static BindManager q;
public static PingManager r;
public static MouseManager s;
public static PacketManager t;
public static PacketQueue u;
public static TpsTimer v;
public static boolean w = false;
private static Setting[] x;
public static ConfigManager configManager;
public static ExplosionDamageCalculator damageCalculator;
public static FriendManager friendManager;
public static FrameDeltaTimer frameDeltaTimer;
public static BotFilter botFilter;
public static ClickScheduler clickScheduler;
public static ClickGuiScreen clickGuiScreen;
public static HudEditorScreen hudEditorScreen;
public static ModuleStateSync moduleStateSync;
public static TargetTracker targetTracker;
public static SilentRotationManager silentRotationManager;
public static VisualRotationManager visualRotationManager;
public static SimulatedClickManager simulatedClickManager;
public static TotemPopManager totemPopManager;
public static KeybindManager keybindManager;
public static SilentSlotManager silentSlotManager;
public static InventorySwapQueue inventorySwapQueue;
public static NotificationManager notificationManager;
public static boolean selfDestructed = false;
public void init() {
b();
boolean var34 = false;
boolean partiallyInitialized = false;
try {
if (a.compareAndSet(false, true)) {
if (initialized.compareAndSet(false, true)) {
eventBus = new EventBus();
moduleManager = new ModuleManager(121395157283000L);
Native.a(moduleManager.getModules());
c = new FontManager();
e = new ConfigManager();
f = new DamageUtil(41691316515293L);
g = new FriendManager();
h = new Timer(111601052018604L);
i = new TargetManager(137451367958631L);
j = new AimManager();
k = new ClickGuiScreen();
var34 = true;
l = new HudEditorScreen(90003821237034L);
m = new EventManager(53157928465092L);
n = new TargetTracker(139559845293095L);
o = new Renderer2D(112473680974252L);
p = new RotationManager(101976830556898L);
q = new BindManager(139206864016440L);
r = new PingManager(57309624251050L);
t = new PacketManager(117193470404248L);
u = new PacketQueue(87229227786379L);
s = new MouseManager(82291833307369L);
v = new TpsTimer(55175676787666L);
RenderUtil.g(new Object[]{Thread.currentThread()});
RenderContract5.a
moduleManager = new ModuleManager();
Native.registerModules(moduleManager.getModules());
fontManager = new FontManager();
configManager = new ConfigManager();
damageCalculator = new ExplosionDamageCalculator();
friendManager = new FriendManager();
frameDeltaTimer = new FrameDeltaTimer();
botFilter = new BotFilter();
clickScheduler = new ClickScheduler();
clickGuiScreen = new ClickGuiScreen();
partiallyInitialized = true;
hudEditorScreen = new HudEditorScreen();
moduleStateSync = new ModuleStateSync();
targetTracker = new TargetTracker();
silentRotationManager = new SilentRotationManager();
visualRotationManager = new VisualRotationManager();
simulatedClickManager = new SimulatedClickManager();
totemPopManager = new TotemPopManager();
silentSlotManager = new SilentSlotManager();
inventorySwapQueue = new InventorySwapQueue();
keybindManager = new KeybindManager();
notificationManager = new NotificationManager();
RenderCore.setRenderThread(Thread.currentThread());
RenderEvents.HUD_RENDER
.register(
(RenderContract6)(lpL44_0, lpL44_1) -> {
b();
if (!w) {
(RenderCallback)(hudRenderer, hudContext) -> {
if (!selfDestructed) {
if (MinecraftClient.getInstance().world != null && MinecraftClient.getInstance().player != null) {
if ((RenderContract2.b.currentScreen == null || RenderContract2.b.currentScreen instanceof ChatScreen)
&& eventBus.hasListeners(new Object[]{TickEvent25.class, 135978089436075L})) {
new TickEvent25(((dev.zprestige.prestige.render.RenderHelper8)lpL44_0), ((dev.zprestige.prestige.data.MatrixCameraData)lpL44_1)).b_boolean__(new Object[]{122499962143880L});
if ((MinecraftAccess.mc.currentScreen == null || MinecraftAccess.mc.currentScreen instanceof ChatScreen)
&& eventBus.hasListeners(Render2DEvent.class)) {
new Render2DEvent((hudRenderer), (hudContext)).post();
}
new TickEvent24(((dev.zprestige.prestige.render.RenderHelper8)lpL44_0), ((dev.zprestige.prestige.data.MatrixCameraData)lpL44_1)).b_boolean__(new Object[]{122499962143880L});
RenderState.b(new Object[]{93665931432117L});
new FrameEvent((hudRenderer), (hudContext)).post();
ShapeRenderer.flushDrawQueue();
}
}
}
);
RenderContract5.b.register((RenderContract6)(lpL43_0, lpL43_1) -> {
b();
if (!w) {
RenderEvents.WORLD_RENDER.register((RenderCallback)(worldRenderer, worldContext) -> {
if (!selfDestructed) {
if (MinecraftClient.getInstance().world != null && MinecraftClient.getInstance().player != null) {
MatrixStack.a(new Object[]{14373979246969L});
new TickEvent27(((dev.zprestige.prestige.render.RenderHelper8)lpL43_0), ((dev.zprestige.prestige.data.MatrixCameraData)lpL43_1)).b_boolean__(new Object[]{122499962143880L});
Render2D.captureViewport();
new Render3DEvent((worldRenderer), (worldContext)).post();
}
}
});
}
} catch (Throwable var35) {
if (!var34) {
a.set(false);
} catch (Throwable error) {
if (!partiallyInitialized) {
initialized.set(false);
}
var35.printStackTrace();
error.printStackTrace();
}
}
public static boolean a(Object[] var0) {
long var1 = (Long)var0[0];
var1 = 9499999619609L ^ var1;
long var3 = var1 ^ 18103143018681L;
b();
return ESPUtil.e || eventBus != null && eventBus.hasListeners(new Object[]{TickEvent27.class, var3});
public static boolean needsWorldRender() {
return EspShaderManager.enabled || eventBus != null && eventBus.hasListeners(Render3DEvent.class);
}
public static boolean b(Object[] var0) {
long var1 = (Long)var0[0];
var1 = 9499999619609L ^ var1;
long var3 = var1 ^ 11198839193506L;
long var5 = var1 ^ 39355797438358L;
long var7 = var1 ^ 65000825783606L;
long var9 = var1 ^ 20328730886810L;
long var11 = var1 ^ 20640679731384L;
b();
public static boolean needsHudRender() {
return eventBus == null
? false
: a(new Object[]{var5})
|| eventBus.hasListeners(new Object[]{TickEvent25.class, var7})
|| eventBus.hasListenerOfType(new Object[]{TickEvent24.class, Module.class, var11})
|| l != null && l.c_boolean_(new Object[]{var3})
|| v != null && v.a_boolean______________________________________________(new Object[]{var9});
: needsWorldRender()
|| eventBus.hasListeners(Render2DEvent.class)
|| eventBus.hasListenerOfType(FrameEvent.class, Module.class)
|| hudEditorScreen != null && hudEditorScreen.shouldRenderHud()
|| notificationManager != null && notificationManager.hasNotifications();
}
public static void a_void(Object[] var0) {
long var1 = (Long)var0[0];
var1 = 9499999619609L ^ var1;
long var3 = var1 ^ 34804161661929L;
b();
if (!w && eventBus != null && RenderContract2.b.world != null && RenderContract2.b.player != null) {
new TickEvent24(RenderUtil.b, null).b_boolean__(new Object[]{var3});
}
}
static {
b(null);
}
public static void b(Setting[] var0) {
x = var0;
}
public static Setting[] b() {
return x;
}
private static Field a(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field b(Class var0, String var1, Class var2) {
Field var3 = a(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = b(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method a(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method b(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = a(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = b(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
public static void postFrameEvent() {
if (!selfDestructed && eventBus != null && MinecraftAccess.mc.world != null && MinecraftAccess.mc.player != null) {
new FrameEvent(RenderCore.BUFFER_SOURCE, null).post();
}
}
@@ -252,8 +149,4 @@ public class Prestige implements ModInitializer {
public void onInitialize() {
this.init();
}
private static Throwable a(Throwable var0) {
return var0;
}
}
@@ -1,141 +0,0 @@
package dev.zprestige.prestige.combat;
import dev.zprestige.prestige.render.RenderContract2;
import dev.zprestige.prestige.render.RenderHelper10;
import dev.zprestige.prestige.render.RenderHelper36;
import dev.zprestige.prestige.render.RenderUtil5;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
public class AimManager implements RenderContract2 {
private RenderHelper10 a = null;
public boolean a(Object[] var1) {
long var2 = (Long)var1[0];
var2 = 68553623989839L ^ var2;
long var4 = var2 ^ 127895873690737L;
if (this.a != null) {
if ((float)(System.currentTimeMillis() - this.a.a_long_(new Object[0])) > this.a.a_float________________(new Object[0])
&& !this.a.a_boolean_________________________________________(new Object[0])) {
RenderHelper36 var10000 = new RenderHelper36(b.mouse);
long var10001 = b.getWindow().getHandle();
int var10002 = this.a.a(new Object[0]);
Object[] var10007 = new Object[]{null, null, null, null, var4};
var10007[3] = 0;
var10007[2] = 1;
var10007[1] = var10002;
var10007[0] = var10001;
var10000.a(var10007);
this.a.a_void____________________(new Object[]{true});
}
if ((float)(System.currentTimeMillis() - this.a.a_long_(new Object[0])) > this.a.a_float________________(new Object[0])
&& (float)(System.currentTimeMillis() - this.a.a_long_(new Object[0]))
> this.a.a_float________________(new Object[0]) + this.a.b(new Object[0])) {
RenderHelper36 var7 = new RenderHelper36(b.mouse);
long var8 = b.getWindow().getHandle();
int var9 = this.a.a(new Object[0]);
Object[] var10 = new Object[]{null, null, null, null, var4};
var10[3] = 0;
var10[2] = 0;
var10[1] = var9;
var10[0] = var8;
var7.a(var10);
this.a = null;
}
return true;
} else {
return false;
}
}
public void a_void_(Object[] var1) {
int var4 = (Integer)var1[0];
float var5 = (Float)var1[1];
long var2 = (Long)var1[2];
var2 = 68553623989839L ^ var2;
long var6 = var2 ^ 21461094467110L;
long var10004 = System.currentTimeMillis();
Object[] var10010 = new Object[]{null, null, var6};
var10010[1] = 15.0F;
var10010[0] = 5.0F;
float var10006 = RenderUtil5.a(var10010);
Object[] var10011 = new Object[]{null, null, var6};
var10011[1] = 55.0F;
var10011[0] = 35.0F;
float var10007 = RenderUtil5.a(var10011);
var10010 = new Object[]{null, null, var6};
var10010[1] = var10007;
var10010[0] = var10006;
this.a = new RenderHelper10(var4, var10004, var5, RenderUtil5.a(var10010), false);
}
private static Field c(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field d(Class var0, String var1, Class var2) {
Field var3 = c(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = d(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method c(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method d(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = c(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = d(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
}
}
@@ -1,100 +0,0 @@
package dev.zprestige.prestige.combat;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import net.minecraft.entity.EquipmentSlot;
// $VF: synthetic class
public class AutoArmorHelper {
public static final int[] a = new int[EquipmentSlot.values().length];
static {
try {
a[EquipmentSlot.HEAD.ordinal()] = 1;
} catch (NoSuchFieldError var3) {
}
try {
a[EquipmentSlot.CHEST.ordinal()] = 2;
} catch (NoSuchFieldError var2) {
}
try {
a[EquipmentSlot.LEGS.ordinal()] = 3;
} catch (NoSuchFieldError var1) {
}
try {
a[EquipmentSlot.FEET.ordinal()] = 4;
} catch (NoSuchFieldError var0) {
}
}
private static Field a(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field b(Class var0, String var1, Class var2) {
Field var3 = a(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = b(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method a(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method b(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = a(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = b(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
}
}
@@ -0,0 +1,77 @@
package dev.zprestige.prestige.combat;
import dev.zprestige.prestige.Subscribe;
import dev.zprestige.prestige.client.Prestige;
import dev.zprestige.prestige.event.BotCheckEvent;
import dev.zprestige.prestige.event.ClientTickEvent;
import dev.zprestige.prestige.event.GameJoinEvent;
import dev.zprestige.prestige.event.AntiBotQueryEvent;
import dev.zprestige.prestige.render.MinecraftAccess;
import java.util.HashSet;
import java.util.IdentityHashMap;
import java.util.Map;
import java.util.Set;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.PlayerEntity;
public class BotFilter implements MinecraftAccess {
private final Set validatedPlayers;
private final Map validityCache;
public BotFilter() {
super();
this.validatedPlayers = new HashSet();
this.validityCache = new IdentityHashMap();
Prestige.eventBus.register(this);
}
@Subscribe
public void onClientTick(ClientTickEvent event) {
this.validityCache.clear();
if (!this.validatedPlayers.isEmpty()) {
this.validatedPlayers.removeIf(player -> !((net.minecraft.entity.Entity)player).isAlive());
}
}
@Subscribe
public void onGameJoin(GameJoinEvent event) {
this.validatedPlayers.clear();
}
public void markValidated(PlayerEntity player) {
this.validatedPlayers.add(player);
}
public Set getValidatedPlayers() {
return this.validatedPlayers;
}
public boolean isValidTarget(Entity entity) {
if (entity == mc.player) {
return false;
} else {
Boolean cached = (Boolean)this.validityCache.get(entity);
if (cached != null) {
return cached;
} else {
boolean valid = this.checkValidTarget(entity);
this.validityCache.put(entity, valid);
return valid;
}
}
}
private boolean checkValidTarget(Entity entity) {
if (!(entity instanceof PlayerEntity)) {
return true;
} else if (!Prestige.eventBus.hasListeners(AntiBotQueryEvent.class)) {
return true;
} else if (!new AntiBotQueryEvent().post()) {
return true;
} else {
return Prestige.eventBus.hasListeners(BotCheckEvent.class) && new BotCheckEvent((PlayerEntity)entity).post()
? false
: this.validatedPlayers.contains(entity) && entity.isAlive();
}
}
}
@@ -0,0 +1,35 @@
package dev.zprestige.prestige.combat;
import dev.zprestige.prestige.render.MinecraftAccess;
import dev.zprestige.prestige.render.ScheduledClick;
import dev.zprestige.prestige.render.MouseAccessor;
import dev.zprestige.prestige.render.RandomUtil;
public class ClickScheduler implements MinecraftAccess {
private ScheduledClick pendingClick = null;
public boolean processPendingClick() {
if (this.pendingClick != null) {
if ((float)(System.currentTimeMillis() - this.pendingClick.getScheduledAt()) > this.pendingClick.getPressDelay()
&& !this.pendingClick.isPressed()) {
new MouseAccessor(mc.mouse).invokeMouseButton(mc.getWindow().getHandle(), this.pendingClick.getButton(), 1, 0);
this.pendingClick.setPressed(true);
}
if ((float)(System.currentTimeMillis() - this.pendingClick.getScheduledAt()) > this.pendingClick.getPressDelay()
&& (float)(System.currentTimeMillis() - this.pendingClick.getScheduledAt())
> this.pendingClick.getPressDelay() + this.pendingClick.getHoldDuration()) {
new MouseAccessor(mc.mouse).invokeMouseButton(mc.getWindow().getHandle(), this.pendingClick.getButton(), 0, 0);
this.pendingClick = null;
}
return true;
} else {
return false;
}
}
public void scheduleClick(int button, float delayMs) {
this.pendingClick = new ScheduledClick(button, System.currentTimeMillis(), delayMs, RandomUtil.randomFloat(RandomUtil.randomFloat(5.0F, 15.0F), RandomUtil.randomFloat(35.0F, 55.0F)), false);
}
}
@@ -1,86 +0,0 @@
package dev.zprestige.prestige.combat;
import java.awt.Color;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
public final class CombatHelper {
public String a = "";
public String b;
public Color c = Color.WHITE;
public int d;
public int e;
public boolean f;
public float g;
public CombatHelper(long var1) {
}
private static Field a(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field b(Class var0, String var1, Class var2) {
Field var3 = a(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = b(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method a(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method b(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = a(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = b(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
}
}
@@ -1,94 +0,0 @@
package dev.zprestige.prestige.combat;
import dev.zprestige.prestige.reflect.FieldAccessor;
import dev.zprestige.prestige.reflect.FieldValue;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import net.minecraft.entity.LivingEntity;
public class CombatHelper2 {
private final LivingEntity a;
private static final String c = "jumpingCooldown";
public CombatHelper2(LivingEntity var1) {
this.a = var1;
}
public void a(Object[] var1) {
int var4 = (Integer)var1[0];
long var2 = (Long)var1[1];
var2 = 55898427641531L ^ var2;
long var5 = var2 ^ 35550231918533L;
long var7 = var2 ^ 25339285087169L;
FieldValue var9 = FieldAccessor.b(new Object[]{this.a, c, LivingEntity.class, int.class, var7});
var9.a_void_____________(new Object[]{var4, var5});
}
private static Field a(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field b(Class var0, String var1, Class var2) {
Field var3 = a(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = b(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method a(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method b(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = a(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = b(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
}
}
@@ -1,102 +0,0 @@
package dev.zprestige.prestige.combat;
import dev.zprestige.prestige.reflect.FieldAccessor;
import dev.zprestige.prestige.reflect.FieldValue;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import net.minecraft.client.MinecraftClient;
public class CombatHelper3 {
private final MinecraftClient a;
public CombatHelper3(MinecraftClient var1) {
this.a = var1;
}
public int a(Object[] var1) {
long var2 = (Long)var1[0];
var2 = 20571854547171L ^ var2;
long var4 = var2 ^ 50573642575059L;
long var6 = var2 ^ 97271680844069L;
FieldValue var8 = FieldAccessor.b(new Object[]{this.a, "itemUseCooldown", MinecraftClient.class, int.class, var6});
return (Integer)var8.a(new Object[]{var4});
}
public void a_void__(Object[] var1) {
int var4 = (Integer)var1[0];
long var2 = (Long)var1[1];
var2 = 20571854547171L ^ var2;
long var5 = var2 ^ 36864578943679L;
long var7 = var2 ^ 25124917358267L;
FieldValue var9 = FieldAccessor.b(new Object[]{this.a, "itemUseCooldown", MinecraftClient.class, int.class, var7});
var9.a_void_____________(new Object[]{var4, var5});
}
private static Field a(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field b(Class var0, String var1, Class var2) {
Field var3 = a(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = b(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method a(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method b(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = a(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = b(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
}
}
@@ -1,214 +0,0 @@
package dev.zprestige.prestige.combat;
import dev.zprestige.prestige.client.Prestige;
import dev.zprestige.prestige.event.Event;
import dev.zprestige.prestige.render.RenderContract2;
import dev.zprestige.prestige.world.PositionUtil;
import dev.zprestige.prestige.world.WorldUtil;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import net.minecraft.client.network.PlayerListEntry;
import net.minecraft.component.DataComponentTypes;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Items;
import net.minecraft.util.math.Vec3d;
public class CombatUtil implements RenderContract2 {
public static boolean a(Object[] var0) {
Entity var1 = (Entity)var0[0];
long var2 = (Long)var0[1];
var2 = 42632450102655L ^ var2;
long var4 = var2 ^ 57986789991100L;
if (var1 instanceof PlayerEntity) {
return true;
} else if (var1 instanceof LivingEntity && b.getNetworkHandler() != null) {
String var7 = var1.getName().getString();
for (PlayerListEntry var9 : b.getNetworkHandler().getPlayerList()) {
if (PositionUtil.a_String________(new Object[]{var9.getProfile(), var4}).equals(var7)) {
return true;
}
}
return false;
} else {
return false;
}
}
public static PlayerEntity a_class_1657(Object[] var0) {
long var1 = (Long)var0[0];
var1 = 42632450102655L ^ var1;
long var3 = var1 ^ 69502222699245L;
long var5 = var1 ^ 27342419042136L;
PlayerEntity var8 = null;
Event.b();
for (PlayerEntity var10 : b.world.getPlayers()) {
if (var10.isAlive()
&& !var10.equals(b.player)
&& !Prestige.g.a(new Object[]{var10.getName().getString(), var3})
&& Prestige.i.a_boolean_(new Object[]{var10, var5})
&& (var8 == null || b.player.squaredDistanceTo(var10) < b.player.squaredDistanceTo(var8))) {
var8 = var10;
}
}
return var8;
}
public static PlayerEntity b(Object[] var0) {
float var1 = (Float)var0[0];
long var2 = (Long)var0[1];
var2 = 42632450102655L ^ var2;
long var4 = var2 ^ 92283722434249L;
long var6 = var2 ^ 57728975127273L;
long var8 = var2 ^ 127570764469116L;
long var10 = var2 ^ 70986972797420L;
Event.b();
PlayerEntity var13 = null;
for (PlayerEntity var15 : b.world.getPlayers()) {
if (var15.isAlive()
&& !var15.equals(b.player)
&& !Prestige.g.a(new Object[]{var15.getName().getString(), var4})
&& Prestige.i.a_boolean_(new Object[]{var15, var8})
&& (var13 == null || b.player.squaredDistanceTo(var15) < b.player.squaredDistanceTo(var13))
&& !(WorldUtil.a(new Object[]{WorldUtil.a_RenderBatch_(new Object[]{var15.getEyePos(), var10}), var6}) > var1)) {
var13 = var15;
}
}
return var13;
}
public static Entity a_class_1297(Object[] var0) {
long var1 = (Long)var0[0];
var1 = 42632450102655L ^ var1;
long var3 = var1 ^ 20222013439035L;
long var5 = var1 ^ 58876846827918L;
Entity var8 = null;
Event.b();
for (Entity var10 : b.world.getEntities()) {
if (var10.isAlive()
&& !var10.equals(b.player)
&& !Prestige.g.a(new Object[]{var10.getName().getString(), var3})
&& var10.isAttackable()
&& Prestige.i.a_boolean_(new Object[]{var10, var5})
&& (var8 == null || b.player.squaredDistanceTo(var10) < b.player.squaredDistanceTo(var8))) {
var8 = var10;
}
}
return var8;
}
public static boolean b_boolean(Object[] var0) {
PlayerEntity var1 = (PlayerEntity)var0[0];
long var2 = (Long)var0[1];
var2 = 42632450102655L ^ var2;
long var4 = var2 ^ 91326150591869L;
return (
var1.getMainHandStack().getItem() == Items.SHIELD
|| var1.getOffHandStack().getItem() == Items.SHIELD && var1.getMainHandStack().get(DataComponentTypes.FOOD) == null
)
&& var1.isUsingItem()
&& !c(new Object[]{var1, var4});
}
private static boolean c(Object[] var0) {
PlayerEntity var3 = (PlayerEntity)var0[0];
long var1 = (Long)var0[1];
var1 = 42632450102655L ^ var1;
long var4 = var1 ^ 105124625454497L;
long var6 = var1 ^ 10499210163888L;
if (b.player != null && var3 != null) {
Vec3d var9 = PositionUtil.b(new Object[]{var6});
Vec3d var10 = PositionUtil.a(new Object[]{var3, var4});
Vec3d var11 = var9.subtract(var10).normalize();
float var12 = var3.getYaw();
float var13 = var3.getPitch();
Vec3d var14 = new Vec3d(
-Math.sin(Math.toRadians(var12)) * Math.cos(Math.toRadians(var13)),
-Math.sin(Math.toRadians(var13)),
Math.cos(Math.toRadians(var12)) * Math.cos(Math.toRadians(var13))
)
.normalize();
double var15 = var14.dotProduct(var11);
return var15 < 0.0;
} else {
return false;
}
}
private static Field c(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field d(Class var0, String var1, Class var2) {
Field var3 = c(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = d(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method c(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method d(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = c(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = d(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
}
}
@@ -1,230 +0,0 @@
package dev.zprestige.prestige.combat;
import dev.zprestige.prestige.client.Prestige;
import dev.zprestige.prestige.inventory.InventoryUtil;
import dev.zprestige.prestige.render.RenderHelper26;
import dev.zprestige.prestige.type.BlockBreakType;
import dev.zprestige.prestige.world.WorldUtil2;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.EnumSet;
import java.util.function.Predicate;
import net.minecraft.block.Blocks;
import net.minecraft.client.MinecraftClient;
import net.minecraft.entity.Entity;
import net.minecraft.entity.decoration.EndCrystalEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.state.property.Properties;
import net.minecraft.util.math.BlockPos;
public final class CombatUtil2 {
private static final MinecraftClient a = MinecraftClient.getInstance();
private static final int b = 5;
private static final double c = 5.0;
public static final RenderHelper26 d = new RenderHelper26(null, 0.0F, 0.0F);
private CombatUtil2() {
}
public static RenderHelper26 a(Object[] var0) {
PlayerEntity var1 = (PlayerEntity)var0[0];
EnumSet var4 = (EnumSet)var0[1];
float var5 = (Float)var0[2];
long var2 = (Long)var0[3];
var2 = 5849964192769L ^ var2;
long var6 = var2 ^ 34097876804470L;
long var8 = var2 ^ 86803075311893L;
long var10 = var2 ^ 13231043016274L;
long var12 = var2 ^ 33321315552121L;
long var14 = var2 ^ 45904547140773L;
if (a.player != null && a.world != null && var1 != null) {
RenderHelper26 var17 = d;
if (var4.contains(BlockBreakType.CRYSTAL)) {
for (Entity var19 : a.world.getEntities()) {
if (var19 instanceof EndCrystalEntity) {
float var20 = (float)Prestige.f.a(new Object[]{a.player, var19.getBlockPos().toCenterPos(), var10});
BlockBreakType var10001 = BlockBreakType.CRYSTAL;
Object[] var10006 = new Object[]{null, null, null, null, var6};
var10006[3] = var5;
var10006[2] = var20;
var10006[1] = var10001;
var10006[0] = var17;
var17 = c(var10006);
}
}
}
if (var4.contains(BlockBreakType.ANCHOR)) {
Object[] var10004 = new Object[]{
null,
(Predicate<BlockPos>)lpL319_0 -> a_boolean(new Object[]{var1, ((net.minecraft.util.math.BlockPos)lpL319_0), 127524255025262L})
&& a.world.getBlockState(((net.minecraft.util.math.BlockPos)lpL319_0)).getBlock() == Blocks.RESPAWN_ANCHOR
&& a.world.getBlockState(((net.minecraft.util.math.BlockPos)lpL319_0)).get(Properties.CHARGES) != 0,
var8
};
var10004[0] = 5;
for (BlockPos var28 : (Iterable<BlockPos>)(WorldUtil2.a_List___(var10004))) {
float var21 = (float)Prestige.f.k(new Object[]{a.player, var28.toCenterPos(), var14});
BlockBreakType var31 = BlockBreakType.ANCHOR;
Object[] var35 = new Object[]{null, null, null, null, var6};
var35[3] = var5;
var35[2] = var21;
var35[1] = var31;
var35[0] = var17;
var17 = c(var35);
}
}
if (var4.contains(BlockBreakType.OBSIDIAN) && !a.player.isOnGround()) {
Object[] var34 = new Object[]{
null,
(Predicate<BlockPos>)lpL318_0 -> ((net.minecraft.util.math.BlockPos)lpL318_0).getY() < a.player.getY()
&& a_boolean(new Object[]{var1, ((net.minecraft.util.math.BlockPos)lpL318_0), 127524255025262L})
&& a.world.getBlockState(((net.minecraft.util.math.BlockPos)lpL318_0)).getBlock() == Blocks.OBSIDIAN
&& a.world.getBlockState(((net.minecraft.util.math.BlockPos)lpL318_0).up()).getBlock() == Blocks.AIR,
var8
};
var34[0] = 5;
for (BlockPos var29 : (Iterable<BlockPos>)(WorldUtil2.a_List___(var34))) {
float var30 = (float)Prestige.f.a(new Object[]{a.player, var29.up().toCenterPos(), var10});
BlockBreakType var32 = BlockBreakType.OBSIDIAN;
Object[] var36 = new Object[]{null, null, null, null, var6};
var36[3] = var5;
var36[2] = var30;
var36[1] = var32;
var36[0] = var17;
var17 = c(var36);
}
}
if (var4.contains(BlockBreakType.MACE)) {
float var25 = a_float(new Object[]{var1, var12});
if (var25 > 0.0F) {
BlockBreakType var33 = BlockBreakType.MACE;
Object[] var37 = new Object[]{null, null, null, null, var6};
var37[3] = var5;
var37[2] = var25;
var37[1] = var33;
var37[0] = var17;
var17 = c(var37);
}
}
return var17;
} else {
return d;
}
}
public static RenderHelper26 b(Object[] var0) {
PlayerEntity var4 = (PlayerEntity)var0[0];
EnumSet var1 = (EnumSet)var0[1];
long var2 = (Long)var0[2];
var2 = 5849964192769L ^ var2;
long var5 = var2 ^ 29537693058044L;
Object[] var10005 = new Object[]{null, null, null, var5};
var10005[2] = 1.0F;
var10005[1] = var1;
var10005[0] = var4;
return a(var10005);
}
public static float a_float(Object[] var0) {
PlayerEntity var1 = (PlayerEntity)var0[0];
long var2 = (Long)var0[1];
var2 = 5849964192769L ^ var2;
long var4 = var2 ^ 43436368200278L;
return InventoryUtil.o(new Object[]{var1.getMainHandStack(), var4}) && !(var1.fallDistance <= 1.5) && !(var1.getY() <= a.player.getY())
? (float)(6.0 + var1.fallDistance * 5.0)
: 0.0F;
}
private static boolean a_boolean(Object[] var0) {
PlayerEntity var4 = (PlayerEntity)var0[0];
BlockPos var3 = (BlockPos)var0[1];
return var4.squaredDistanceTo(var3.getX() + 0.5, var3.getY() + 0.5, var3.getZ() + 0.5) < 25.0;
}
private static RenderHelper26 c(Object[] var0) {
RenderHelper26 var6 = (RenderHelper26)var0[0];
BlockBreakType var1 = (BlockBreakType)var0[1];
float var4 = (Float)var0[2];
float var5 = (Float)var0[3];
if (var4 <= 0.0F) {
return var6;
} else {
float var8 = var4 * var1.confidence * var5;
return var8 <= var6.c ? var6 : new RenderHelper26(var1, var4, var8);
}
}
private static Field a(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field b(Class var0, String var1, Class var2) {
Field var3 = a(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = b(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method a(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method b(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = a(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = b(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
}
}
@@ -1,723 +0,0 @@
package dev.zprestige.prestige.combat;
import dev.zprestige.prestige.Subscribe;
import dev.zprestige.prestige.client.Prestige;
import dev.zprestige.prestige.data.DoubleBoolData;
import dev.zprestige.prestige.event.Event;
import dev.zprestige.prestige.event.TickEvent3;
import dev.zprestige.prestige.math.MathHelper3;
import dev.zprestige.prestige.render.RenderContract2;
import dev.zprestige.prestige.world.PositionUtil;
import dev.zprestige.prestige.world.WorldHelper;
import dev.zprestige.prestige.world.WorldHelper10;
import it.unimi.dsi.fastutil.objects.Object2IntMap;
import it.unimi.dsi.fastutil.objects.Object2IntMaps;
import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
import it.unimi.dsi.fastutil.objects.Object2IntMap.Entry;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.concurrent.ConcurrentHashMap;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.component.DataComponentTypes;
import net.minecraft.component.type.AttributeModifierSlot;
import net.minecraft.component.type.ItemEnchantmentsComponent;
import net.minecraft.enchantment.Enchantments;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.attribute.EntityAttributes;
import net.minecraft.entity.damage.DamageSource;
import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.entry.RegistryEntry;
import net.minecraft.registry.tag.DamageTypeTags;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.hit.HitResult.Type;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Box;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.BlockView;
import net.minecraft.world.GameMode;
import net.minecraft.world.RaycastContext;
import net.minecraft.world.RaycastContext.FluidHandling;
import net.minecraft.world.RaycastContext.ShapeType;
import net.minecraft.world.explosion.Explosion;
public class DamageUtil implements RenderContract2 {
private final Vec3d a;
private Explosion c;
private RaycastContext d;
private volatile long e;
private final ConcurrentHashMap f;
private static final ThreadLocal g = ThreadLocal.withInitial(Object2IntOpenHashMap::new);
private static final long i = Long.MIN_VALUE;
public DamageUtil(long var1) {
super();
var1 = 0L;
var1 = 18350856574938L ^ var1;
long var3 = var1 ^ 91927560072961L;
this.a = new Vec3d(0.0, 0.0, 0.0);
this.e = i;
this.f = new ConcurrentHashMap();
Prestige.eventBus.register(new Object[]{this, var3});
}
@Subscribe
public void a(TickEvent3 var1) {
this.d = new RaycastContext(null, null, ShapeType.COLLIDER, FluidHandling.ANY, b.player);
}
public double a(Object[] var1) {
LivingEntity var5 = (LivingEntity)var1[0];
Vec3d var4 = (Vec3d)var1[1];
long var2 = (Long)var1[2];
var2 = 18350856574938L ^ var2;
long var6 = var2 ^ 62045040412105L;
Object[] var10008 = new Object[]{null, null, null, null, null, var6};
var10008[4] = false;
var10008[3] = null;
var10008[2] = false;
var10008[1] = var4;
var10008[0] = var5;
return this.b(var10008);
}
public double b(Object[] var1) {
LivingEntity var2 = (LivingEntity)var1[0];
Vec3d var4 = (Vec3d)var1[1];
boolean var7 = (Boolean)var1[2];
BlockPos var3 = (BlockPos)var1[3];
boolean var8 = (Boolean)var1[4];
long var5 = (Long)var1[5];
var5 = 18350856574938L ^ var5;
long var9 = var5 ^ 60394376658852L;
Event.b();
long var12 = b.world.getTime();
if (var12 != this.e) {
this.f.clear();
this.e = var12;
}
DoubleBoolData var14 = new DoubleBoolData(var2, var4.x, var4.y, var4.z, var7, var3, var8);
Double var15 = (Double)this.f.get(var14);
if (var15 != null) {
return var15;
} else {
Object[] var10008 = new Object[]{null, null, null, null, null, var9};
var10008[4] = var8;
var10008[3] = var3;
var10008[2] = var7;
var10008[1] = var4;
var10008[0] = var2;
double var16 = this.c(var10008);
this.f.put(var14, var16);
return var16;
}
}
private double c(Object[] var1) {
LivingEntity var2 = (LivingEntity)var1[0];
Vec3d var7 = (Vec3d)var1[1];
boolean var3 = (Boolean)var1[2];
BlockPos var4 = (BlockPos)var1[3];
boolean var8 = (Boolean)var1[4];
long var5 = (Long)var1[5];
var5 = 18350856574938L ^ var5;
long var9 = var5 ^ 70663714774065L;
long var11 = var5 ^ 116854953095835L;
long var13 = var5 ^ 140262527072875L;
long var15 = var5 ^ 45612110305298L;
long var17 = var5 ^ 23558358614720L;
long var19 = var5 ^ 125910066054471L;
if (var2 instanceof PlayerEntity
&& b.getNetworkHandler().getPlayerListEntry(var2.getUuid()) != null
&& b.getNetworkHandler().getPlayerListEntry(var2.getUuid()).getGameMode() == GameMode.CREATIVE) {
return 0.0;
} else {
Vec3d var22 = PositionUtil.a(new Object[]{var2, var11});
MathHelper3 var10000 = new MathHelper3(this.a);
double var10001 = var22.x;
double var10002 = var22.y;
double var10003 = var22.z;
Object[] var10006 = new Object[]{null, null, null, var15};
var10006[2] = var10003;
var10006[1] = var10002;
var10006[0] = var10001;
var10000.d(var10006);
if (var3) {
var10000 = new MathHelper3(this.a);
var10001 = this.a.x + var2.getVelocity().x;
var10002 = this.a.y + var2.getVelocity().y;
var10003 = this.a.z + var2.getVelocity().z;
var10006 = new Object[]{null, null, null, var15};
var10006[2] = var10003;
var10006[1] = var10002;
var10006[0] = var10001;
var10000.d(var10006);
}
double var23 = Math.sqrt(this.a.squaredDistanceTo(var7));
if (var23 > 12.0) {
return 0.0;
} else {
RaycastContext var10004 = this.d;
Object[] var10012 = new Object[]{null, null, null, null, null, null, null, null, null, var9};
var10012[5] = var8;
var10012[4] = var4;
var10012[3] = var10004;
var10012[2] = var3;
var10012[1] = var2;
var10012[0] = var7;
double var25 = this.o(var10012);
double var27 = (1.0 - var23 / 12.0) * var25;
double var29 = (var27 * var27 + var27) / 2.0 * 7.0 * 12.0 + 1.0;
Object[] var40 = new Object[]{null, var17};
var40[0] = var29;
var29 = this.m(var40);
var29 = net.minecraft.entity.DamageUtil.getDamageLeft(
var2,
(float)var29,
b.world.getDamageSources().explosion(null),
var2.getArmor(),
(float)var2.getAttributeInstance(EntityAttributes.ARMOR_TOUGHNESS).getValue()
);
Object[] var10005 = new Object[]{null, null, var19};
var10005[1] = var29;
var10005[0] = var2;
var29 = this.n(var10005);
var10005 = new Object[]{null, null, b.world.getDamageSources().explosion(null), var13};
var10005[1] = var29;
var10005[0] = var2;
var29 = j(var10005);
return var29 < 0.0 ? 0.0 : var29;
}
}
}
public double d(Object[] var1) {
LivingEntity var3 = (LivingEntity)var1[0];
Vec3d var7 = (Vec3d)var1[1];
Vec3d var6 = (Vec3d)var1[2];
BlockPos var2 = (BlockPos)var1[3];
long var4 = (Long)var1[4];
var4 = 18350856574938L ^ var4;
long var8 = var4 ^ 140583619040745L;
long var10 = var4 ^ 38438316372702L;
long var12 = var4 ^ 60626111085102L;
long var14 = var4 ^ 107516225165399L;
long var16 = var4 ^ 103216323854981L;
long var18 = var4 ^ 63983453963522L;
if (var3 instanceof PlayerEntity
&& b.getNetworkHandler().getPlayerListEntry(var3.getUuid()) != null
&& b.getNetworkHandler().getPlayerListEntry(var3.getUuid()).getGameMode() == GameMode.CREATIVE) {
return 0.0;
} else {
MathHelper3 var10000 = new MathHelper3(this.a);
double var10001 = var6.x;
double var10002 = var6.y;
double var10003 = var6.z;
Object[] var10006 = new Object[]{null, null, null, var14};
var10006[2] = var10003;
var10006[1] = var10002;
var10006[0] = var10001;
var10000.d(var10006);
double var21 = Math.sqrt(this.a.squaredDistanceTo(var7));
if (var21 > 12.0) {
return 0.0;
} else {
Vec3d var23 = var6.subtract(PositionUtil.a(new Object[]{var3, var10}));
RaycastContext var10004 = this.d;
Object[] var10012 = new Object[]{null, null, null, null, null, null, null, null, null, var8};
var10012[5] = false;
var10012[4] = var2;
var10012[3] = var10004;
var10012[2] = var23;
var10012[1] = var3;
var10012[0] = var7;
double var24 = this.p(var10012);
double var26 = (1.0 - var21 / 12.0) * var24;
double var28 = (var26 * var26 + var26) / 2.0 * 7.0 * 12.0 + 1.0;
Object[] var35 = new Object[]{null, var16};
var35[0] = var28;
var28 = this.m(var35);
var28 = net.minecraft.entity.DamageUtil.getDamageLeft(
var3,
(float)var28,
b.world.getDamageSources().explosion(null),
var3.getArmor(),
(float)var3.getAttributeInstance(EntityAttributes.ARMOR_TOUGHNESS).getValue()
);
Object[] var10005 = new Object[]{null, null, var18};
var10005[1] = var28;
var10005[0] = var3;
var28 = this.n(var10005);
var10005 = new Object[]{null, null, b.world.getDamageSources().explosion(null), var12};
var10005[1] = var28;
var10005[0] = var3;
var28 = j(var10005);
return var28 < 0.0 ? 0.0 : var28;
}
}
}
private double f(Object[] var1) {
LivingEntity var2 = (LivingEntity)var1[0];
Vec3d var4 = (Vec3d)var1[1];
BlockPos var5 = (BlockPos)var1[2];
BlockPos var3 = (BlockPos)var1[3];
BlockState var8 = (BlockState)var1[4];
long var6 = (Long)var1[5];
var6 = 18350856574938L ^ var6;
long var9 = var6 ^ 137608125675640L;
long var11 = var6 ^ 73609917046306L;
long var13 = var6 ^ 44044175812233L;
long var15 = var6 ^ 87825474003214L;
if (var2 instanceof PlayerEntity && ((PlayerEntity)var2).getAbilities().creativeMode) {
return 0.0;
} else {
double var18 = Math.sqrt(var2.squaredDistanceTo(var4));
if (var18 > 10.0) {
return 0.0;
} else {
RaycastContext var10004 = this.d;
Object[] var10012 = new Object[]{null, null, null, null, null, null, var5, var3, var8, var9};
var10012[5] = false;
var10012[4] = null;
var10012[3] = var10004;
var10012[2] = false;
var10012[1] = var2;
var10012[0] = var4;
double var20 = this.o(var10012);
double var22 = (1.0 - var18 / 10.0) * var20;
double var24 = (var22 * var22 + var22) / 2.0 * 7.0 * 10.0 + 1.0;
Object[] var31 = new Object[]{null, var13};
var31[0] = var24;
var24 = this.m(var31);
Object[] var10005 = new Object[]{null, null, var15};
var10005[1] = var24;
var10005[0] = var2;
var24 = this.n(var10005);
var24 = net.minecraft.entity.DamageUtil.getDamageLeft(
var2,
(float)var24,
b.world.getDamageSources().explosion(null),
var2.getArmor(),
(float)var2.getAttributeInstance(EntityAttributes.ARMOR_TOUGHNESS).getValue()
);
var10005 = new Object[]{null, null, b.world.getDamageSources().explosion(null), var11};
var10005[1] = var24;
var10005[0] = var2;
var24 = j(var10005);
return var24 < 0.0 ? 0.0 : var24;
}
}
}
public double g(Object[] var1) {
LivingEntity var2 = (LivingEntity)var1[0];
Vec3d var7 = (Vec3d)var1[1];
double var3 = (Double)var1[2];
long var5 = (Long)var1[3];
var5 = 18350856574938L ^ var5;
long var8 = var5 ^ 50002521674027L;
Object[] var10009 = new Object[]{null, null, null, null, null, null, var8};
var10009[2] = var3;
var10009[1] = var7;
var10009[0] = var2;
return this.i(var10009);
}
public double h(Object[] var1) {
LivingEntity var5 = (LivingEntity)var1[0];
Vec3d var3 = (Vec3d)var1[1];
double var7 = (Double)var1[2];
BlockPos var6 = (BlockPos)var1[3];
BlockPos var2 = (BlockPos)var1[4];
BlockState var4 = (BlockState)var1[5];
long var9 = (Long)var1[6];
var9 = 18350856574938L ^ var9;
long var11 = var9 ^ 93789556771378L;
Object[] var10009 = new Object[]{null, null, null, var6, var2, var4, var11};
var10009[2] = var7;
var10009[1] = var3;
var10009[0] = var5;
return this.i(var10009);
}
private double i(Object[] var1) {
LivingEntity var10 = (LivingEntity)var1[0];
Vec3d var8 = (Vec3d)var1[1];
double var6 = (Double)var1[2];
BlockPos var4 = (BlockPos)var1[3];
BlockPos var9 = (BlockPos)var1[4];
BlockState var5 = (BlockState)var1[5];
long var2 = (Long)var1[6];
var2 = 18350856574938L ^ var2;
long var11 = var2 ^ 79313669683112L;
long var13 = var2 ^ 131904361501170L;
long var15 = var2 ^ 31933369002329L;
long var17 = var2 ^ 135126957141726L;
if (var10 instanceof PlayerEntity && ((PlayerEntity)var10).getAbilities().creativeMode) {
return 0.0;
} else {
double var20 = 4.0 + 1.5 * Math.min(var6, 5.0);
double var22 = Math.sqrt(var10.squaredDistanceTo(var8));
if (var22 > var20 * 2.0) {
return 0.0;
} else {
RaycastContext var10004 = this.d;
Object[] var10012 = new Object[]{null, null, null, null, null, null, null, var9, var5, var11};
var10012[5] = false;
var10012[4] = var4;
var10012[3] = var10004;
var10012[2] = false;
var10012[1] = var10;
var10012[0] = var8;
double var24 = this.o(var10012);
double var26 = (1.0 - var22 / (var20 * 2.0)) * var24;
double var28 = (var26 * var26 + var26) / 2.0 * 7.0 * (var20 * 2.0) + 1.0;
Object[] var35 = new Object[]{null, var15};
var35[0] = var28;
var28 = this.m(var35);
Object[] var10005 = new Object[]{null, null, var17};
var10005[1] = var28;
var10005[0] = var10;
var28 = this.n(var10005);
var28 = net.minecraft.entity.DamageUtil.getDamageLeft(
var10,
(float)var28,
b.world.getDamageSources().explosion(null),
var10.getArmor(),
(float)var10.getAttributeInstance(EntityAttributes.ARMOR_TOUGHNESS).getValue()
);
var10005 = new Object[]{null, null, b.world.getDamageSources().explosion(null), var13};
var10005[1] = var28;
var10005[0] = var10;
var28 = j(var10005);
return var28 < 0.0 ? 0.0 : var28;
}
}
}
private static double j(Object[] var0) {
LivingEntity var3 = (LivingEntity)var0[0];
double var1 = (Double)var0[1];
DamageSource var6 = (DamageSource)var0[2];
long var4 = (Long)var0[3];
var4 = 18350856574938L ^ var4;
long var7 = var4 ^ 63254382195539L;
long var9 = var4 ^ 137971209152305L;
if (var6.isIn(DamageTypeTags.BYPASSES_INVULNERABILITY)) {
return var1;
} else {
int var12 = 0;
Object2IntMap var13 = (Object2IntMap)g.get();
for (EquipmentSlot var15 : AttributeModifierSlot.ARMOR) {
ItemStack var16 = var3.getEquippedStack(var15);
a_void___(new Object[]{var16, var13, var7});
int var17 = a_int(new Object[]{var13, Enchantments.PROTECTION, var9});
if (var17 > 0) {
var12 += var17;
}
int var18 = a_int(new Object[]{var13, Enchantments.FIRE_PROTECTION, var9});
if (var18 > 0 && var6.isIn(DamageTypeTags.IS_FIRE)) {
var12 += 2 * var18;
}
int var19 = a_int(new Object[]{var13, Enchantments.BLAST_PROTECTION, var9});
if (var19 > 0 && var6.isIn(DamageTypeTags.IS_EXPLOSION)) {
var12 += 2 * var19;
}
int var20 = a_int(new Object[]{var13, Enchantments.PROJECTILE_PROTECTION, var9});
if (var20 > 0 && var6.isIn(DamageTypeTags.IS_PROJECTILE)) {
var12 += 2 * var20;
}
int var21 = a_int(new Object[]{var13, Enchantments.FEATHER_FALLING, var9});
if (var21 > 0 && var6.isIn(DamageTypeTags.IS_FALL)) {
var12 += 3 * var21;
}
}
return net.minecraft.entity.DamageUtil.getInflictedDamage((float)var1, var12);
}
}
public static void a_void___(Object[] var0) {
ItemStack var4 = (ItemStack)var0[0];
Object2IntMap var1 = (Object2IntMap)var0[1];
Event.b();
var1.clear();
if (!var4.isEmpty()) {
for (Entry var8 : var4.getItem() == Items.ENCHANTED_BOOK
? var4.getOrDefault(DataComponentTypes.STORED_ENCHANTMENTS, ItemEnchantmentsComponent.DEFAULT).getEnchantmentEntries()
: var4.getEnchantments().getEnchantmentEntries()) {
var1.put((RegistryEntry)var8.getKey(), var8.getIntValue());
}
}
}
public static int a_int(Object[] var0) {
Object2IntMap var4 = (Object2IntMap)var0[0];
RegistryKey var1 = (RegistryKey)var0[1];
Event.b();
for (Entry var7 : (Iterable<Entry>)(Object2IntMaps.fastIterable(var4))) {
if (((RegistryEntry)var7.getKey()).matchesKey(var1)) {
return var7.getIntValue();
}
}
return 0;
}
public double k(Object[] var1) {
LivingEntity var2 = (LivingEntity)var1[0];
Vec3d var3 = (Vec3d)var1[1];
long var4 = (Long)var1[2];
var4 = 18350856574938L ^ var4;
long var6 = var4 ^ 7577744648969L;
return this.f(new Object[]{var2, var3, BlockPos.ofFloored(var3), null, null, var6});
}
public double l(Object[] var1) {
LivingEntity var6 = (LivingEntity)var1[0];
Vec3d var4 = (Vec3d)var1[1];
BlockPos var5 = (BlockPos)var1[2];
BlockState var7 = (BlockState)var1[3];
long var2 = (Long)var1[4];
var2 = 18350856574938L ^ var2;
long var8 = var2 ^ 64892925663312L;
return this.f(new Object[]{var6, var4, BlockPos.ofFloored(var4), var5, var7, var8});
}
private double m(Object[] var1) {
double var2 = (Double)var1[0];
return switch (WorldHelper.a[b.world.getDifficulty().ordinal()]) {
case 1 -> 0.0;
case 2 -> Math.min(var2 / 2.0 + 1.0, var2);
case 3 -> var2 * 3.0 / 2.0;
default -> var2;
};
}
private double n(Object[] var1) {
LivingEntity var2 = (LivingEntity)var1[0];
double var3 = (Double)var1[1];
Event.b();
double var8 = var3;
if (var2.hasStatusEffect(StatusEffects.RESISTANCE)) {
int var10 = var2.getStatusEffect(StatusEffects.RESISTANCE).getAmplifier() + 1;
var8 = var3 * (1.0 - var10 * 0.2);
}
return var8 < 0.0 ? 0.0 : var8;
}
private double o(Object[] var1) {
Vec3d var5 = (Vec3d)var1[0];
Entity var8 = (Entity)var1[1];
boolean var9 = (Boolean)var1[2];
RaycastContext var10 = (RaycastContext)var1[3];
BlockPos var6 = (BlockPos)var1[4];
boolean var3 = (Boolean)var1[5];
BlockPos var4 = (BlockPos)var1[6];
BlockPos var7 = (BlockPos)var1[7];
BlockState var2 = (BlockState)var1[8];
long var11 = (Long)var1[9];
var11 = 18350856574938L ^ var11;
long var13 = var11 ^ 113914657529415L;
Vec3d var10003 = var9 ? var8.getVelocity() : null;
Object[] var10012 = new Object[]{null, null, null, null, null, null, var4, var7, var2, var13};
var10012[5] = var3;
var10012[4] = var6;
var10012[3] = var10;
var10012[2] = var10003;
var10012[1] = var8;
var10012[0] = var5;
return this.p(var10012);
}
private double p(Object[] var1) {
Vec3d var3 = (Vec3d)var1[0];
Entity var8 = (Entity)var1[1];
Vec3d var4 = (Vec3d)var1[2];
RaycastContext var10 = (RaycastContext)var1[3];
BlockPos var5 = (BlockPos)var1[4];
boolean var2 = (Boolean)var1[5];
BlockPos var9 = (BlockPos)var1[6];
BlockPos var11 = (BlockPos)var1[7];
BlockState var12 = (BlockState)var1[8];
long var6 = (Long)var1[9];
var6 = 18350856574938L ^ var6;
long var13 = var6 ^ 54174853893221L;
long var15 = var6 ^ 53612852969307L;
long var17 = var6 ^ 16104425364068L;
Event.b();
Box var20 = var8.getBoundingBox();
if (var4 != null) {
var20 = var20.offset(var4.x, var4.y, var4.z);
}
double var21 = 1.0 / ((var20.maxX - var20.minX) * 2.0 + 1.0);
double var23 = 1.0 / ((var20.maxY - var20.minY) * 2.0 + 1.0);
double var25 = 1.0 / ((var20.maxZ - var20.minZ) * 2.0 + 1.0);
double var27 = (1.0 - Math.floor(1.0 / var21) * var21) / 2.0;
double var29 = (1.0 - Math.floor(1.0 / var25) * var25) / 2.0;
if (var21 >= 0.0 && var23 >= 0.0 && var25 >= 0.0) {
int var31 = 0;
int var32 = 0;
MathHelper3 var33 = new MathHelper3(this.a);
WorldHelper10 var34 = new WorldHelper10(var10);
for (double var35 = 0.0; var35 <= 1.0; var35 += var21) {
for (double var37 = 0.0; var37 <= 1.0; var37 += var23) {
for (double var39 = 0.0; var39 <= 1.0; var39 += var25) {
double var41 = MathHelper.lerp(var35, var20.minX, var20.maxX);
double var43 = MathHelper.lerp(var37, var20.minY, var20.maxY);
double var45 = MathHelper.lerp(var39, var20.minZ, var20.maxZ);
double var10001 = var41 + var27;
double var10003 = var45 + var29;
Object[] var10006 = new Object[]{null, null, null, var17};
var10006[2] = var10003;
var10006[1] = var43;
var10006[0] = var10001;
var33.d(var10006);
var34.f(new Object[]{this.a, var3, ShapeType.COLLIDER, FluidHandling.NONE, var8, var15});
Object[] var10009 = new Object[]{null, null, null, var9, var11, var12, var13};
var10009[2] = var2;
var10009[1] = var5;
var10009[0] = var10;
if (this.a_class_3965(var10009).getType() == Type.MISS) {
var31++;
}
var32++;
}
}
}
return (double)var31 / var32;
} else {
return 0.0;
}
}
private BlockHitResult a_class_3965(Object[] var1) {
RaycastContext var7 = (RaycastContext)var1[0];
BlockPos var8 = (BlockPos)var1[1];
boolean var9 = (Boolean)var1[2];
BlockPos var5 = (BlockPos)var1[3];
BlockPos var2 = (BlockPos)var1[4];
BlockState var6 = (BlockState)var1[5];
return BlockView.raycast(var7.getStart(), var7.getEnd(), var7, (lpL1_0, lpL1_1) -> {
BlockState var10;
if (var5 != null && ((net.minecraft.util.math.BlockPos)lpL1_1).equals(var5)) {
var10 = Blocks.AIR.getDefaultState();
} else if (var2 != null && ((net.minecraft.util.math.BlockPos)lpL1_1).equals(var2)) {
var10 = var6;
} else if (((net.minecraft.util.math.BlockPos)lpL1_1).equals(var8)) {
var10 = Blocks.OBSIDIAN.getDefaultState();
} else {
var10 = b.world.getBlockState(((net.minecraft.util.math.BlockPos)lpL1_1));
if (var10.getBlock().getBlastResistance() < 600.0F && var9) {
var10 = Blocks.AIR.getDefaultState();
}
}
Vec3d var11 = ((net.minecraft.world.RaycastContext)lpL1_0).getStart();
Vec3d var12 = ((net.minecraft.world.RaycastContext)lpL1_0).getEnd();
VoxelShape var13 = ((net.minecraft.world.RaycastContext)lpL1_0).getBlockShape(var10, b.world, ((net.minecraft.util.math.BlockPos)lpL1_1));
BlockHitResult var14 = b.world.raycastBlock(var11, var12, ((net.minecraft.util.math.BlockPos)lpL1_1), var13, var10);
VoxelShape var15 = VoxelShapes.empty();
BlockHitResult var16 = var15.raycast(var11, var12, ((net.minecraft.util.math.BlockPos)lpL1_1));
double var17 = var14 == null ? Double.MAX_VALUE : ((net.minecraft.world.RaycastContext)lpL1_0).getStart().squaredDistanceTo(var14.getPos());
double var19 = var16 == null ? Double.MAX_VALUE : ((net.minecraft.world.RaycastContext)lpL1_0).getStart().squaredDistanceTo(var16.getPos());
return var17 <= var19 ? var14 : var16;
}, lpL0_0 -> {
Vec3d var3 = ((net.minecraft.world.RaycastContext)lpL0_0).getStart().subtract(((net.minecraft.world.RaycastContext)lpL0_0).getEnd());
return BlockHitResult.createMissed(((net.minecraft.world.RaycastContext)lpL0_0).getEnd(), Direction.getFacing(var3.x, var3.y, var3.z), BlockPos.ofFloored(((net.minecraft.world.RaycastContext)lpL0_0).getEnd()));
});
}
private static Field c(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field d(Class var0, String var1, Class var2) {
Field var3 = c(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = d(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method c(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method d(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = c(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = d(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
}
}
@@ -0,0 +1,30 @@
package dev.zprestige.prestige.combat;
import net.minecraft.entity.EquipmentSlot;
// $VF: synthetic class
public class EquipmentSlotSwitchMap {
public static final int[] SWITCH_MAP = new int[EquipmentSlot.values().length];
static {
try {
SWITCH_MAP[EquipmentSlot.HEAD.ordinal()] = 1;
} catch (NoSuchFieldError headMissing) {
}
try {
SWITCH_MAP[EquipmentSlot.CHEST.ordinal()] = 2;
} catch (NoSuchFieldError chestMissing) {
}
try {
SWITCH_MAP[EquipmentSlot.LEGS.ordinal()] = 3;
} catch (NoSuchFieldError legsMissing) {
}
try {
SWITCH_MAP[EquipmentSlot.FEET.ordinal()] = 4;
} catch (NoSuchFieldError feetMissing) {
}
}
}
@@ -0,0 +1,371 @@
package dev.zprestige.prestige.combat;
import dev.zprestige.prestige.Subscribe;
import dev.zprestige.prestige.client.Prestige;
import dev.zprestige.prestige.data.ExplosionDamageKey;
import dev.zprestige.prestige.event.GameJoinEvent;
import dev.zprestige.prestige.math.Vec3dMutator;
import dev.zprestige.prestige.render.MinecraftAccess;
import dev.zprestige.prestige.world.PositionUtil;
import dev.zprestige.prestige.world.DifficultySwitchMap;
import dev.zprestige.prestige.world.RaycastContextAccessor;
import it.unimi.dsi.fastutil.objects.Object2IntMap;
import it.unimi.dsi.fastutil.objects.Object2IntMaps;
import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
import it.unimi.dsi.fastutil.objects.Object2IntMap.Entry;
import java.util.concurrent.ConcurrentHashMap;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.component.DataComponentTypes;
import net.minecraft.component.type.AttributeModifierSlot;
import net.minecraft.component.type.ItemEnchantmentsComponent;
import net.minecraft.enchantment.Enchantments;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.attribute.EntityAttributes;
import net.minecraft.entity.damage.DamageSource;
import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.entry.RegistryEntry;
import net.minecraft.registry.tag.DamageTypeTags;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.hit.HitResult.Type;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Box;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.BlockView;
import net.minecraft.world.GameMode;
import net.minecraft.world.RaycastContext;
import net.minecraft.world.RaycastContext.FluidHandling;
import net.minecraft.world.RaycastContext.ShapeType;
public class ExplosionDamageCalculator implements MinecraftAccess {
private final Vec3d scratchPos;
private RaycastContext raycastContext;
private volatile long cacheTime;
private final ConcurrentHashMap damageCache;
private static final ThreadLocal ENCHANTMENT_BUFFER = ThreadLocal.withInitial(Object2IntOpenHashMap::new);
private static final long NO_CACHE_TIME = Long.MIN_VALUE;
public ExplosionDamageCalculator() {
super();
this.scratchPos = new Vec3d(0.0, 0.0, 0.0);
this.cacheTime = NO_CACHE_TIME;
this.damageCache = new ConcurrentHashMap();
Prestige.eventBus.register(this);
}
@Subscribe
public void onGameJoin(GameJoinEvent event) {
this.raycastContext = new RaycastContext(null, null, ShapeType.COLLIDER, FluidHandling.ANY, mc.player);
}
public double getCrystalDamage(LivingEntity target, Vec3d crystalPos) {
return this.getCrystalDamage(target, crystalPos, false, null, false);
}
public double getCrystalDamage(LivingEntity target, Vec3d crystalPos, boolean predictMotion, BlockPos obsidianPos, boolean ignoreTerrain) {
long worldTime = mc.world.getTime();
if (worldTime != this.cacheTime) {
this.damageCache.clear();
this.cacheTime = worldTime;
}
ExplosionDamageKey cacheKey = new ExplosionDamageKey(target, crystalPos.x, crystalPos.y, crystalPos.z, predictMotion, obsidianPos, ignoreTerrain);
Double cached = (Double)this.damageCache.get(cacheKey);
if (cached != null) {
return cached;
} else {
double damage = this.computeCrystalDamage(target, crystalPos, predictMotion, obsidianPos, ignoreTerrain);
this.damageCache.put(cacheKey, damage);
return damage;
}
}
private double computeCrystalDamage(LivingEntity target, Vec3d crystalPos, boolean predictMotion, BlockPos obsidianPos, boolean ignoreTerrain) {
if (target instanceof PlayerEntity
&& mc.getNetworkHandler().getPlayerListEntry(target.getUuid()) != null
&& mc.getNetworkHandler().getPlayerListEntry(target.getUuid()).getGameMode() == GameMode.CREATIVE) {
return 0.0;
} else {
Vec3d targetPos = PositionUtil.getEntityPos(target);
new Vec3dMutator(this.scratchPos).set(targetPos.x, targetPos.y, targetPos.z);
if (predictMotion) {
new Vec3dMutator(this.scratchPos).set(this.scratchPos.x + target.getVelocity().x, this.scratchPos.y + target.getVelocity().y, this.scratchPos.z + target.getVelocity().z);
}
double distance = Math.sqrt(this.scratchPos.squaredDistanceTo(crystalPos));
if (distance > 12.0) {
return 0.0;
} else {
double exposure = this.getExposure(crystalPos, target, predictMotion, this.raycastContext, obsidianPos, ignoreTerrain, null, null, null);
double impact = (1.0 - distance / 12.0) * exposure;
double damage = (impact * impact + impact) / 2.0 * 7.0 * 12.0 + 1.0;
damage = this.scaleByDifficulty(damage);
damage = net.minecraft.entity.DamageUtil.getDamageLeft(
target,
(float)damage,
mc.world.getDamageSources().explosion(null),
target.getArmor(),
(float)target.getAttributeInstance(EntityAttributes.ARMOR_TOUGHNESS).getValue()
);
damage = this.applyResistance(target, damage);
damage = applyProtectionEnchantments(target, damage, mc.world.getDamageSources().explosion(null));
return damage < 0.0 ? 0.0 : damage;
}
}
}
public double getCrystalDamageAt(LivingEntity target, Vec3d crystalPos, Vec3d predictedPos, BlockPos obsidianPos) {
if (target instanceof PlayerEntity
&& mc.getNetworkHandler().getPlayerListEntry(target.getUuid()) != null
&& mc.getNetworkHandler().getPlayerListEntry(target.getUuid()).getGameMode() == GameMode.CREATIVE) {
return 0.0;
} else {
new Vec3dMutator(this.scratchPos).set(predictedPos.x, predictedPos.y, predictedPos.z);
double distance = Math.sqrt(this.scratchPos.squaredDistanceTo(crystalPos));
if (distance > 12.0) {
return 0.0;
} else {
double exposure = this.getExposureWithOffset(crystalPos, target, predictedPos.subtract(PositionUtil.getEntityPos(target)), this.raycastContext, obsidianPos, false, null, null, null);
double impact = (1.0 - distance / 12.0) * exposure;
double damage = (impact * impact + impact) / 2.0 * 7.0 * 12.0 + 1.0;
damage = this.scaleByDifficulty(damage);
damage = net.minecraft.entity.DamageUtil.getDamageLeft(
target,
(float)damage,
mc.world.getDamageSources().explosion(null),
target.getArmor(),
(float)target.getAttributeInstance(EntityAttributes.ARMOR_TOUGHNESS).getValue()
);
damage = this.applyResistance(target, damage);
damage = applyProtectionEnchantments(target, damage, mc.world.getDamageSources().explosion(null));
return damage < 0.0 ? 0.0 : damage;
}
}
}
private double computeAnchorDamage(LivingEntity target, Vec3d anchorPos, BlockPos anchorBlockPos, BlockPos placedBlockPos, BlockState placedBlockState) {
if (target instanceof PlayerEntity && ((PlayerEntity)target).getAbilities().creativeMode) {
return 0.0;
} else {
double distance = Math.sqrt(target.squaredDistanceTo(anchorPos));
if (distance > 10.0) {
return 0.0;
} else {
double exposure = this.getExposure(anchorPos, target, false, this.raycastContext, null, false, anchorBlockPos, placedBlockPos, placedBlockState);
double impact = (1.0 - distance / 10.0) * exposure;
double damage = (impact * impact + impact) / 2.0 * 7.0 * 10.0 + 1.0;
damage = this.scaleByDifficulty(damage);
damage = this.applyResistance(target, damage);
damage = net.minecraft.entity.DamageUtil.getDamageLeft(
target,
(float)damage,
mc.world.getDamageSources().explosion(null),
target.getArmor(),
(float)target.getAttributeInstance(EntityAttributes.ARMOR_TOUGHNESS).getValue()
);
damage = applyProtectionEnchantments(target, damage, mc.world.getDamageSources().explosion(null));
return damage < 0.0 ? 0.0 : damage;
}
}
}
public double getTntCartDamage(LivingEntity target, Vec3d cartPos, double cartSpeed) {
return this.computeTntCartDamage(target, cartPos, cartSpeed, null, null, null);
}
public double getTntCartDamage(LivingEntity target, Vec3d cartPos, double cartSpeed, BlockPos obsidianPos, BlockPos placedBlockPos, BlockState placedBlockState) {
return this.computeTntCartDamage(target, cartPos, cartSpeed, obsidianPos, placedBlockPos, placedBlockState);
}
private double computeTntCartDamage(LivingEntity target, Vec3d cartPos, double cartSpeed, BlockPos obsidianPos, BlockPos placedBlockPos, BlockState placedBlockState) {
if (target instanceof PlayerEntity && ((PlayerEntity)target).getAbilities().creativeMode) {
return 0.0;
} else {
double power = 4.0 + 1.5 * Math.min(cartSpeed, 5.0);
double distance = Math.sqrt(target.squaredDistanceTo(cartPos));
if (distance > power * 2.0) {
return 0.0;
} else {
double exposure = this.getExposure(cartPos, target, false, this.raycastContext, obsidianPos, false, null, placedBlockPos, placedBlockState);
double impact = (1.0 - distance / (power * 2.0)) * exposure;
double damage = (impact * impact + impact) / 2.0 * 7.0 * (power * 2.0) + 1.0;
damage = this.scaleByDifficulty(damage);
damage = this.applyResistance(target, damage);
damage = net.minecraft.entity.DamageUtil.getDamageLeft(
target,
(float)damage,
mc.world.getDamageSources().explosion(null),
target.getArmor(),
(float)target.getAttributeInstance(EntityAttributes.ARMOR_TOUGHNESS).getValue()
);
damage = applyProtectionEnchantments(target, damage, mc.world.getDamageSources().explosion(null));
return damage < 0.0 ? 0.0 : damage;
}
}
}
private static double applyProtectionEnchantments(LivingEntity target, double damage, DamageSource source) {
if (source.isIn(DamageTypeTags.BYPASSES_INVULNERABILITY)) {
return damage;
} else {
int protectionFactor = 0;
Object2IntMap enchantments = (Object2IntMap)ENCHANTMENT_BUFFER.get();
for (EquipmentSlot slot : AttributeModifierSlot.ARMOR) {
collectEnchantments(target.getEquippedStack(slot), enchantments);
int protection = getEnchantmentLevel(enchantments, Enchantments.PROTECTION);
if (protection > 0) {
protectionFactor += protection;
}
int fireProtection = getEnchantmentLevel(enchantments, Enchantments.FIRE_PROTECTION);
if (fireProtection > 0 && source.isIn(DamageTypeTags.IS_FIRE)) {
protectionFactor += 2 * fireProtection;
}
int blastProtection = getEnchantmentLevel(enchantments, Enchantments.BLAST_PROTECTION);
if (blastProtection > 0 && source.isIn(DamageTypeTags.IS_EXPLOSION)) {
protectionFactor += 2 * blastProtection;
}
int projectileProtection = getEnchantmentLevel(enchantments, Enchantments.PROJECTILE_PROTECTION);
if (projectileProtection > 0 && source.isIn(DamageTypeTags.IS_PROJECTILE)) {
protectionFactor += 2 * projectileProtection;
}
int featherFalling = getEnchantmentLevel(enchantments, Enchantments.FEATHER_FALLING);
if (featherFalling > 0 && source.isIn(DamageTypeTags.IS_FALL)) {
protectionFactor += 3 * featherFalling;
}
}
return net.minecraft.entity.DamageUtil.getInflictedDamage((float)damage, protectionFactor);
}
}
public static void collectEnchantments(ItemStack stack, Object2IntMap enchantments) {
enchantments.clear();
if (!stack.isEmpty()) {
for (Entry entry : stack.getItem() == Items.ENCHANTED_BOOK
? stack.getOrDefault(DataComponentTypes.STORED_ENCHANTMENTS, ItemEnchantmentsComponent.DEFAULT).getEnchantmentEntries()
: stack.getEnchantments().getEnchantmentEntries()) {
enchantments.put((RegistryEntry)entry.getKey(), entry.getIntValue());
}
}
}
public static int getEnchantmentLevel(Object2IntMap enchantments, RegistryKey enchantmentKey) {
for (Entry entry : (Iterable<Entry>)(Object2IntMaps.fastIterable(enchantments))) {
if (((RegistryEntry)entry.getKey()).matchesKey(enchantmentKey)) {
return entry.getIntValue();
}
}
return 0;
}
public double getAnchorDamage(LivingEntity target, Vec3d anchorPos) {
return this.computeAnchorDamage(target, anchorPos, BlockPos.ofFloored(anchorPos), null, null);
}
public double getAnchorDamage(LivingEntity target, Vec3d anchorPos, BlockPos placedBlockPos, BlockState placedBlockState) {
return this.computeAnchorDamage(target, anchorPos, BlockPos.ofFloored(anchorPos), placedBlockPos, placedBlockState);
}
private double scaleByDifficulty(double damage) {
return switch (DifficultySwitchMap.CASE_BY_ORDINAL[mc.world.getDifficulty().ordinal()]) {
case 1 -> 0.0;
case 2 -> Math.min(damage / 2.0 + 1.0, damage);
case 3 -> damage * 3.0 / 2.0;
default -> damage;
};
}
private double applyResistance(LivingEntity target, double damage) {
double reduced = damage;
if (target.hasStatusEffect(StatusEffects.RESISTANCE)) {
reduced = damage * (1.0 - (target.getStatusEffect(StatusEffects.RESISTANCE).getAmplifier() + 1) * 0.2);
}
return reduced < 0.0 ? 0.0 : reduced;
}
private double getExposure(Vec3d source, Entity entity, boolean predictMotion, RaycastContext context, BlockPos obsidianPos, boolean ignoreTerrain, BlockPos airPos, BlockPos placedBlockPos, BlockState placedBlockState) {
return this.getExposureWithOffset(source, entity, predictMotion ? entity.getVelocity() : null, context, obsidianPos, ignoreTerrain, airPos, placedBlockPos, placedBlockState);
}
private double getExposureWithOffset(Vec3d source, Entity entity, Vec3d boxOffset, RaycastContext context, BlockPos obsidianPos, boolean ignoreTerrain, BlockPos airPos, BlockPos placedBlockPos, BlockState placedBlockState) {
Box box = entity.getBoundingBox();
if (boxOffset != null) {
box = box.offset(boxOffset.x, boxOffset.y, boxOffset.z);
}
double stepX = 1.0 / ((box.maxX - box.minX) * 2.0 + 1.0);
double stepY = 1.0 / ((box.maxY - box.minY) * 2.0 + 1.0);
double stepZ = 1.0 / ((box.maxZ - box.minZ) * 2.0 + 1.0);
double offsetX = (1.0 - Math.floor(1.0 / stepX) * stepX) / 2.0;
double offsetZ = (1.0 - Math.floor(1.0 / stepZ) * stepZ) / 2.0;
if (stepX >= 0.0 && stepY >= 0.0 && stepZ >= 0.0) {
int unobstructed = 0;
int samples = 0;
Vec3dMutator sampleSetter = new Vec3dMutator(this.scratchPos);
RaycastContextAccessor contextSetter = new RaycastContextAccessor(context);
for (double fracX = 0.0; fracX <= 1.0; fracX += stepX) {
for (double fracY = 0.0; fracY <= 1.0; fracY += stepY) {
for (double fracZ = 0.0; fracZ <= 1.0; fracZ += stepZ) {
sampleSetter.set(MathHelper.lerp(fracX, box.minX, box.maxX) + offsetX, MathHelper.lerp(fracY, box.minY, box.maxY), MathHelper.lerp(fracZ, box.minZ, box.maxZ) + offsetZ);
contextSetter.setAll(this.scratchPos, source, ShapeType.COLLIDER, FluidHandling.NONE, entity);
if (this.raycastWithOverrides(context, obsidianPos, ignoreTerrain, airPos, placedBlockPos, placedBlockState).getType() == Type.MISS) {
unobstructed++;
}
samples++;
}
}
}
return (double)unobstructed / samples;
} else {
return 0.0;
}
}
private BlockHitResult raycastWithOverrides(RaycastContext context, BlockPos obsidianPos, boolean ignoreTerrain, BlockPos airPos, BlockPos placedBlockPos, BlockState placedBlockState) {
return BlockView.raycast(context.getStart(), context.getEnd(), context, (ctx, blockPos) -> {
BlockState state;
if (airPos != null && blockPos.equals(airPos)) {
state = Blocks.AIR.getDefaultState();
} else if (placedBlockPos != null && blockPos.equals(placedBlockPos)) {
state = placedBlockState;
} else if (blockPos.equals(obsidianPos)) {
state = Blocks.OBSIDIAN.getDefaultState();
} else {
state = mc.world.getBlockState(blockPos);
if (state.getBlock().getBlastResistance() < 600.0F && ignoreTerrain) {
state = Blocks.AIR.getDefaultState();
}
}
Vec3d start = ctx.getStart();
Vec3d end = ctx.getEnd();
VoxelShape shape = ctx.getBlockShape(state, mc.world, blockPos);
BlockHitResult blockHit = mc.world.raycastBlock(start, end, blockPos, shape, state);
BlockHitResult emptyHit = VoxelShapes.empty().raycast(start, end, blockPos);
return (blockHit == null ? Double.MAX_VALUE : ctx.getStart().squaredDistanceTo(blockHit.getPos())) <= (emptyHit == null ? Double.MAX_VALUE : ctx.getStart().squaredDistanceTo(emptyHit.getPos())) ? blockHit : emptyHit;
}, missCtx -> {
Vec3d delta = missCtx.getStart().subtract(missCtx.getEnd());
return BlockHitResult.createMissed(missCtx.getEnd(), Direction.getFacing(delta.x, delta.y, delta.z), BlockPos.ofFloored(missCtx.getEnd()));
});
}
}
@@ -0,0 +1,39 @@
package dev.zprestige.prestige.combat;
import java.awt.Color;
public final class HudStyle {
public static final float SCALE_SMALL = 0.65F;
public static final float SCALE_MEDIUM = 0.75F;
public static final float SCALE_ROW = 0.9F;
public static final float SCALE_TITLE = 1.0F;
public static final float SCALE_VALUE = 1.0F;
public static final float SCALE_NORMAL = 1.0F;
public static final float CORNER_RADIUS = 4.0F;
public static final float PADDING_Y = 3.0F;
public static final float BADGE_PADDING = 1.5F;
public static final int BLUR_RADIUS = 5;
public static final float PADDING_X = 5.5F;
public static final float DIVIDER_INSET = 3.0F;
public static final float ROW_SPACING = 3.0F;
public static final float LINE_GAP = 1.0F;
public static final float DIVIDER_WIDTH = 0.5F;
public static final float BAR_HEIGHT = 4.0F;
public static final float BAR_GAP = 1.0F;
public static final Color BACKGROUND_COLOR = new Color(14, 14, 14, 200);
public static final Color TEXT_COLOR = Color.WHITE;
public static final Color SECONDARY_TEXT_COLOR = new Color(200, 200, 200, 220);
public static final Color MUTED_TEXT_COLOR = new Color(160, 160, 168, 200);
public static final Color DIVIDER_COLOR = new Color(255, 255, 255, 40);
private HudStyle() {
}
public static float getRowHeight(float fontHeight, float scale) {
return fontHeight * scale + 6.0F;
}
public static float getCardHeight(float fontHeight) {
return 3.0F + fontHeight * 1.0F + 1.0F + 4.0F + 3.0F;
}
}
@@ -0,0 +1,20 @@
package dev.zprestige.prestige.combat;
import dev.zprestige.prestige.reflect.FieldAccessor;
import net.minecraft.client.MinecraftClient;
public class ItemUseCooldownAccessor {
private final MinecraftClient client;
public ItemUseCooldownAccessor(MinecraftClient minecraftClient) {
this.client = minecraftClient;
}
public int getItemUseCooldown() {
return (Integer)FieldAccessor.bindMapped(this.client, "itemUseCooldown", MinecraftClient.class, int.class).get();
}
public void setItemUseCooldown(int ticks) {
FieldAccessor.bindMapped(this.client, "itemUseCooldown", MinecraftClient.class, int.class).set(ticks);
}
}
@@ -0,0 +1,17 @@
package dev.zprestige.prestige.combat;
import dev.zprestige.prestige.reflect.FieldAccessor;
import net.minecraft.entity.LivingEntity;
public class JumpCooldownAccessor {
private final LivingEntity entity;
private static final String JUMPING_COOLDOWN_FIELD = "jumpingCooldown";
public JumpCooldownAccessor(LivingEntity livingEntity) {
this.entity = livingEntity;
}
public void setJumpingCooldown(int ticks) {
FieldAccessor.bindMapped(this.entity, JUMPING_COOLDOWN_FIELD, LivingEntity.class, int.class).set(ticks);
}
}
@@ -0,0 +1,25 @@
package dev.zprestige.prestige.combat;
import java.awt.Color;
import java.util.ArrayList;
import java.util.List;
public class NameTagEntry {
public NameTagEntry() {
dev.zprestige.prestige.ui.bridge.Bootstrap.pre(this);
}
public String name;
public Color nameColor;
public int pops;
public String popText;
public float healthRatio;
public float displayedHealthRatio;
public Color healthColor;
public String healthText;
public float nameWidth;
public float popTextWidth;
public float healthTextWidth;
public List items = new ArrayList();
public List enchantLabels = new ArrayList();
}
@@ -1,25 +0,0 @@
package dev.zprestige.prestige.combat;
import java.awt.Color;
import java.util.ArrayList;
import java.util.List;
public class NameTags {
public NameTags() {
dev.zprestige.prestige.ui.bridge.Bootstrap.pre(this);
}
public String a;
public Color b;
public int c;
public String d;
public float e;
public float f;
public Color g;
public String h;
public float i;
public float j;
public float k;
public List l = new ArrayList();
public List m = new ArrayList();
}
@@ -1,112 +0,0 @@
package dev.zprestige.prestige.combat;
import java.awt.Color;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
public final class NameTagsUtil {
public static final float a = 0.65F;
public static final float b = 0.75F;
public static final float c = 0.9F;
public static final float d = 1.0F;
public static final float e = 1.0F;
public static final float f = 1.0F;
public static final float g = 4.0F;
public static final float h = 3.0F;
public static final float i = 1.5F;
public static final int j = 5;
public static final float k = 5.5F;
public static final float l = 3.0F;
public static final float m = 3.0F;
public static final float n = 1.0F;
public static final float o = 0.5F;
public static final float p = 4.0F;
public static final float q = 1.0F;
public static final Color r = new Color(14, 14, 14, 200);
public static final Color s = Color.WHITE;
public static final Color t = new Color(200, 200, 200, 220);
public static final Color u = new Color(160, 160, 168, 200);
public static final Color v = new Color(255, 255, 255, 40);
private NameTagsUtil() {
}
public static float a(Object[] var0) {
float var1 = (Float)var0[0];
float var2 = (Float)var0[1];
return var1 * var2 + 6.0F;
}
public static float b(Object[] var0) {
float var1 = (Float)var0[0];
return 3.0F + var1 * 1.0F + 1.0F + 4.0F + 3.0F;
}
private static Field a(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field b(Class var0, String var1, Class var2) {
Field var3 = a(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = b(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method a(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method b(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = a(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = b(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
}
}
@@ -1,151 +0,0 @@
package dev.zprestige.prestige.combat;
import dev.zprestige.prestige.event.Event;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.projectile.PersistentProjectileEntity;
import net.minecraft.entity.projectile.ProjectileUtil;
import net.minecraft.item.ItemStack;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.hit.EntityHitResult;
import net.minecraft.util.hit.HitResult;
import net.minecraft.util.hit.HitResult.Type;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
public final class PearlFollowHelper extends PersistentProjectileEntity {
public boolean a;
public PearlFollowHelper(World var1, LivingEntity var2, ItemStack var3, long var4) {
super(EntityType.ARROW, var2, var1, var3, var3);
}
@Override
public void tick() {
Event.b();
HitResult var4 = ProjectileUtil.getCollision(this, lpL396_0 -> this.canHit(((net.minecraft.entity.Entity)lpL396_0)));
if (var4.getType() != Type.MISS) {
this.onCollision(var4);
} else {
this.tickBlockCollision();
if (!this.a) {
Vec3d var5 = this.getVelocity();
double var6 = this.getX() + var5.x;
double var8 = this.getY() + var5.y;
double var10 = this.getZ() + var5.z;
this.updateRotation();
float var12 = this.isTouchingWater() ? 0.8F : 0.99F;
this.setVelocity(var5.multiply(var12));
if (!this.hasNoGravity()) {
Vec3d var13 = this.getVelocity();
this.setVelocity(var13.x, var13.y - 0.03, var13.z);
}
this.setPosition(var6, var8, var10);
}
}
}
@Override
public void onBlockHit(BlockHitResult blockHitResult) {
this.a = true;
this.setPosition(blockHitResult.getPos());
}
@Override
public void onEntityHit(EntityHitResult entityHitResult) {
this.a = true;
this.setPosition(entityHitResult.getPos());
}
@Override
public ItemStack asItemStack() {
return null;
}
@Override
public ItemStack getDefaultItemStack() {
return null;
}
@Override
public void setVelocity(double x, double y, double z, float power, float uncertainty) {
Vec3d var11 = new Vec3d(x, y, z).normalize().multiply(power);
this.setVelocity(var11);
this.setYaw((float)(MathHelper.atan2(var11.x, var11.z) * 180.0F / (float)Math.PI));
this.setPitch((float)(MathHelper.atan2(var11.y, var11.horizontalLength()) * 180.0F / (float)Math.PI));
this.lastYaw = this.getYaw();
this.lastPitch = this.getPitch();
}
private static Field a(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field b(Class var0, String var1, Class var2) {
Field var3 = a(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = b(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method a(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method b(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = a(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = b(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
}
}
@@ -0,0 +1,78 @@
package dev.zprestige.prestige.combat;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.projectile.PersistentProjectileEntity;
import net.minecraft.entity.projectile.ProjectileUtil;
import net.minecraft.item.ItemStack;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.hit.EntityHitResult;
import net.minecraft.util.hit.HitResult;
import net.minecraft.util.hit.HitResult.Type;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
public final class PearlFollowSimulatedPearl extends PersistentProjectileEntity {
public boolean landed;
public PearlFollowSimulatedPearl(World worldIn, LivingEntity shooter, ItemStack pearlStack) {
super(EntityType.ARROW, shooter, worldIn, pearlStack, pearlStack);
}
@Override
public void tick() {
HitResult hitResult = ProjectileUtil.getCollision(this, candidate -> this.canHit(candidate));
if (hitResult.getType() != Type.MISS) {
this.onCollision(hitResult);
} else {
this.tickBlockCollision();
if (!this.landed) {
Vec3d motion = this.getVelocity();
double nextX = this.getX() + motion.x;
double nextY = this.getY() + motion.y;
double nextZ = this.getZ() + motion.z;
this.updateRotation();
this.setVelocity(motion.multiply(this.isTouchingWater() ? 0.8F : 0.99F));
if (!this.hasNoGravity()) {
Vec3d currentMotion = this.getVelocity();
this.setVelocity(currentMotion.x, currentMotion.y - 0.03, currentMotion.z);
}
this.setPosition(nextX, nextY, nextZ);
}
}
}
@Override
public void onBlockHit(BlockHitResult blockHitResult) {
this.landed = true;
this.setPosition(blockHitResult.getPos());
}
@Override
public void onEntityHit(EntityHitResult entityHitResult) {
this.landed = true;
this.setPosition(entityHitResult.getPos());
}
@Override
public ItemStack asItemStack() {
return null;
}
@Override
public ItemStack getDefaultItemStack() {
return null;
}
@Override
public void setVelocity(double x, double y, double z, float power, float uncertainty) {
Vec3d scaledMotion = new Vec3d(x, y, z).normalize().multiply(power);
this.setVelocity(scaledMotion);
this.setYaw((float)(MathHelper.atan2(scaledMotion.x, scaledMotion.z) * 180.0F / (float)Math.PI));
this.setPitch((float)(MathHelper.atan2(scaledMotion.y, scaledMotion.horizontalLength()) * 180.0F / (float)Math.PI));
this.lastYaw = this.getYaw();
this.lastPitch = this.getPitch();
}
}
@@ -1,147 +0,0 @@
package dev.zprestige.prestige.combat;
import dev.zprestige.prestige.event.Event;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.projectile.PersistentProjectileEntity;
import net.minecraft.entity.projectile.ProjectileUtil;
import net.minecraft.item.ItemStack;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.hit.EntityHitResult;
import net.minecraft.util.hit.HitResult;
import net.minecraft.util.hit.HitResult.Type;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
public final class PearlTrajectoryHelper extends PersistentProjectileEntity {
public boolean a;
public PearlTrajectoryHelper(World var1, LivingEntity var2, ItemStack var3, long var4) {
super(EntityType.ARROW, var2, var1, var3, var3);
}
@Override
public void tick() {
Event.b();
HitResult var4 = ProjectileUtil.getCollision(this, lpL397_0 -> this.canHit(((net.minecraft.entity.Entity)lpL397_0)));
if (var4.getType() != Type.MISS) {
this.onCollision(var4);
}
this.tickBlockCollision();
Vec3d var5 = this.getVelocity();
double var6 = this.getX() + var5.x;
double var8 = this.getY() + var5.y;
double var10 = this.getZ() + var5.z;
this.updateRotation();
float var12 = this.isTouchingWater() ? 0.8F : 0.99F;
this.setVelocity(var5.multiply(var12));
if (!this.hasNoGravity()) {
Vec3d var13 = this.getVelocity();
this.setVelocity(var13.x, var13.y - 0.03, var13.z);
}
this.setPosition(var6, var8, var10);
}
@Override
public void onBlockHit(BlockHitResult blockHitResult) {
this.a = true;
}
@Override
public void onEntityHit(EntityHitResult entityHitResult) {
this.a = true;
}
@Override
public ItemStack asItemStack() {
return null;
}
@Override
public ItemStack getDefaultItemStack() {
return null;
}
@Override
public void setVelocity(double x, double y, double z, float power, float uncertainty) {
Vec3d var11 = new Vec3d(x, y, z).normalize().multiply(power);
this.setVelocity(var11);
this.setYaw((float)(MathHelper.atan2(var11.x, var11.z) * 180.0F / (float)Math.PI));
this.setPitch((float)(MathHelper.atan2(var11.y, var11.horizontalLength()) * 180.0F / (float)Math.PI));
this.lastYaw = this.getYaw();
this.lastPitch = this.getPitch();
}
private static Field a(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field b(Class var0, String var1, Class var2) {
Field var3 = a(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = b(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method a(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method b(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = a(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = b(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
}
}
@@ -0,0 +1,74 @@
package dev.zprestige.prestige.combat;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.projectile.PersistentProjectileEntity;
import net.minecraft.entity.projectile.ProjectileUtil;
import net.minecraft.item.ItemStack;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.hit.EntityHitResult;
import net.minecraft.util.hit.HitResult;
import net.minecraft.util.hit.HitResult.Type;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
public final class PearlTrajectorySimulatedPearl extends PersistentProjectileEntity {
public boolean landed;
public PearlTrajectorySimulatedPearl(World worldIn, LivingEntity shooter, ItemStack pearlStack) {
super(EntityType.ARROW, shooter, worldIn, pearlStack, pearlStack);
}
@Override
public void tick() {
HitResult hitResult = ProjectileUtil.getCollision(this, candidate -> this.canHit(candidate));
if (hitResult.getType() != Type.MISS) {
this.onCollision(hitResult);
}
this.tickBlockCollision();
Vec3d motion = this.getVelocity();
double nextX = this.getX() + motion.x;
double nextY = this.getY() + motion.y;
double nextZ = this.getZ() + motion.z;
this.updateRotation();
this.setVelocity(motion.multiply(this.isTouchingWater() ? 0.8F : 0.99F));
if (!this.hasNoGravity()) {
Vec3d currentMotion = this.getVelocity();
this.setVelocity(currentMotion.x, currentMotion.y - 0.03, currentMotion.z);
}
this.setPosition(nextX, nextY, nextZ);
}
@Override
public void onBlockHit(BlockHitResult blockHitResult) {
this.landed = true;
}
@Override
public void onEntityHit(EntityHitResult entityHitResult) {
this.landed = true;
}
@Override
public ItemStack asItemStack() {
return null;
}
@Override
public ItemStack getDefaultItemStack() {
return null;
}
@Override
public void setVelocity(double x, double y, double z, float power, float uncertainty) {
Vec3d scaledMotion = new Vec3d(x, y, z).normalize().multiply(power);
this.setVelocity(scaledMotion);
this.setYaw((float)(MathHelper.atan2(scaledMotion.x, scaledMotion.z) * 180.0F / (float)Math.PI));
this.setPitch((float)(MathHelper.atan2(scaledMotion.y, scaledMotion.horizontalLength()) * 180.0F / (float)Math.PI));
this.lastYaw = this.getYaw();
this.lastPitch = this.getPitch();
}
}
@@ -0,0 +1,16 @@
package dev.zprestige.prestige.combat;
import java.awt.Color;
public final class PotionDisplayEntry {
public String name = "";
public String levelText;
public Color color = Color.WHITE;
public int duration;
public int maxDuration;
public boolean infinite;
public float visibility;
public PotionDisplayEntry() {
}
}
@@ -1,190 +0,0 @@
package dev.zprestige.prestige.combat;
import dev.zprestige.prestige.Subscribe;
import dev.zprestige.prestige.client.Prestige;
import dev.zprestige.prestige.event.EntityEvent4;
import dev.zprestige.prestige.event.TickEvent19;
import dev.zprestige.prestige.render.RenderBatch;
import dev.zprestige.prestige.render.RenderContract2;
import dev.zprestige.prestige.type.EventPhase;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import net.minecraft.util.math.MathHelper;
public class RotationManager implements RenderContract2 {
private static final float a = 0.4F;
private static final float c = 0.5F;
private boolean d;
private float e;
private float f;
private float g;
private float h;
private boolean i;
private float j;
private float k;
private float l;
private float m;
private float n;
private float o;
private float p;
private float q;
public RotationManager(long var1) {
super();
var1 = 0L;
var1 = 60632727332545L ^ var1;
long var3 = var1 ^ 14681560044837L;
this.d = false;
this.i = false;
Prestige.eventBus.register(new Object[]{this, var3});
}
@Subscribe
public void a(TickEvent19 var1) {
if (b.player == null) {
this.d = false;
} else if (!this.d) {
this.e = b.player.getYaw();
this.f = b.player.getPitch();
this.g = this.e;
this.h = this.f;
this.d = true;
} else {
RenderBatch var5 = Prestige.o.b_RenderBatch____________(new Object[0]);
if (var5 == null) {
this.e = b.player.getYaw();
this.f = b.player.getPitch();
this.g = this.e;
this.h = this.f;
} else {
this.g = this.e;
this.h = this.f;
float var6 = MathHelper.wrapDegrees(var5.a(new Object[0]) - this.e);
float var7 = var5.b(new Object[0]) - this.f;
this.e = MathHelper.wrapDegrees(this.e + var6 * 0.4F);
this.f = MathHelper.clamp(this.f + var7 * 0.4F, -90.0F, 90.0F);
}
}
}
@Subscribe
public void a(EntityEvent4 var1) {
if (var1.a == b.player && this.d) {
if (var1.a_EventPhase(new Object[0]) == EventPhase.PRE) {
if (this.i) {
return;
}
if (Prestige.o.b_RenderBatch____________(new Object[0]) == null) {
return;
}
float var5 = Math.abs(MathHelper.wrapDegrees(this.e - b.player.getYaw()));
float var6 = Math.abs(this.f - b.player.getPitch());
if (var5 < 0.5F && var6 < 0.5F) {
return;
}
this.j = b.player.getYaw();
this.k = b.player.getPitch();
this.l = b.player.bodyYaw;
this.m = b.player.headYaw;
this.n = b.player.lastYaw;
this.o = b.player.lastPitch;
this.p = b.player.lastBodyYaw;
this.q = b.player.lastHeadYaw;
b.player.setYaw(this.e);
b.player.setPitch(this.f);
b.player.bodyYaw = this.e;
b.player.headYaw = this.e;
b.player.lastYaw = this.g;
b.player.lastPitch = this.h;
b.player.lastBodyYaw = this.g;
b.player.lastHeadYaw = this.g;
this.i = true;
} else if (var1.a_EventPhase(new Object[0]) == EventPhase.POST && this.i) {
b.player.setYaw(this.j);
b.player.setPitch(this.k);
b.player.bodyYaw = this.l;
b.player.headYaw = this.m;
b.player.lastYaw = this.n;
b.player.lastPitch = this.o;
b.player.lastBodyYaw = this.p;
b.player.lastHeadYaw = this.q;
this.i = false;
}
}
}
public boolean a(Object[] var1) {
return this.i;
}
private static Field c(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field d(Class var0, String var1, Class var2) {
Field var3 = c(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = d(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method c(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method d(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = c(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = d(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
}
}
@@ -1,162 +0,0 @@
package dev.zprestige.prestige.combat;
import dev.zprestige.prestige.Subscribe;
import dev.zprestige.prestige.client.Prestige;
import dev.zprestige.prestige.event.Event;
import dev.zprestige.prestige.event.PlayerEvent;
import dev.zprestige.prestige.event.TickEvent19;
import dev.zprestige.prestige.event.TickEvent3;
import dev.zprestige.prestige.event.TickEvent6;
import dev.zprestige.prestige.render.RenderContract2;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.HashSet;
import java.util.IdentityHashMap;
import java.util.Map;
import java.util.Set;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.PlayerEntity;
public class TargetManager implements RenderContract2 {
private final Set a;
private final Map c;
public TargetManager(long var1) {
super();
var1 = 0L;
var1 = 135428133275062L ^ var1;
long var3 = var1 ^ 106554379797719L;
this.a = new HashSet();
this.c = new IdentityHashMap();
Prestige.eventBus.register(new Object[]{this, var3});
}
@Subscribe
public void a(TickEvent19 var1) {
Event.b();
this.c.clear();
if (!this.a.isEmpty()) {
this.a.removeIf(lpL9_0 -> !((net.minecraft.entity.Entity)lpL9_0).isAlive());
}
}
@Subscribe
public void a(TickEvent3 var1) {
this.a.clear();
}
public void a(Object[] var1) {
PlayerEntity var2 = (PlayerEntity)var1[0];
this.a.add(var2);
}
public Set a_Set(Object[] var1) {
return this.a;
}
public boolean a_boolean_(Object[] var1) {
Entity var2 = (Entity)var1[0];
long var3 = (Long)var1[1];
var3 = 135428133275062L ^ var3;
long var5 = var3 ^ 5217238789553L;
if (var2 == b.player) {
return false;
} else {
Boolean var8 = (Boolean)this.c.get(var2);
if (var8 != null) {
return var8;
} else {
boolean var9 = this.b(new Object[]{var2, var5});
this.c.put(var2, var9);
return var9;
}
}
}
private boolean b(Object[] var1) {
Entity var4 = (Entity)var1[0];
long var2 = (Long)var1[1];
var2 = 135428133275062L ^ var2;
long var5 = var2 ^ 99671251868934L;
long var7 = var2 ^ 86195271010853L;
if (!(var4 instanceof PlayerEntity)) {
return true;
} else if (!Prestige.eventBus.hasListeners(new Object[]{TickEvent6.class, var7})) {
return true;
} else if (!new TickEvent6().b_boolean__(new Object[]{var5})) {
return true;
} else {
return Prestige.eventBus.hasListeners(new Object[]{PlayerEvent.class, var7}) && new PlayerEvent((PlayerEntity)var4).b_boolean__(new Object[]{var5})
? false
: this.a.contains(var4) && var4.isAlive();
}
}
private static Field c(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field d(Class var0, String var1, Class var2) {
Field var3 = c(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = d(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method c(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method d(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = c(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = d(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
}
}
@@ -0,0 +1,108 @@
package dev.zprestige.prestige.combat;
import dev.zprestige.prestige.client.Prestige;
import dev.zprestige.prestige.render.MinecraftAccess;
import dev.zprestige.prestige.world.PositionUtil;
import dev.zprestige.prestige.world.RotationUtil;
import net.minecraft.client.network.PlayerListEntry;
import net.minecraft.component.DataComponentTypes;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Items;
import net.minecraft.util.math.Vec3d;
public class TargetSelector implements MinecraftAccess {
public static boolean isPlayer(Entity entity) {
if (entity instanceof PlayerEntity) {
return true;
} else if (entity instanceof LivingEntity && mc.getNetworkHandler() != null) {
String entityName = entity.getName().getString();
for (PlayerListEntry entry : mc.getNetworkHandler().getPlayerList()) {
if (PositionUtil.getProfileName(entry.getProfile()).equals(entityName)) {
return true;
}
}
return false;
} else {
return false;
}
}
public static PlayerEntity getClosestEnemy() {
PlayerEntity closest = null;
for (PlayerEntity player : mc.world.getPlayers()) {
if (player.isAlive()
&& !player.equals(mc.player)
&& !Prestige.friendManager.isFriend(player.getName().getString())
&& Prestige.botFilter.isValidTarget(player)
&& (closest == null || mc.player.squaredDistanceTo(player) < mc.player.squaredDistanceTo(closest))) {
closest = player;
}
}
return closest;
}
public static PlayerEntity getClosestEnemyInFov(float maxAngle) {
PlayerEntity closest = null;
for (PlayerEntity player : mc.world.getPlayers()) {
if (player.isAlive()
&& !player.equals(mc.player)
&& !Prestige.friendManager.isFriend(player.getName().getString())
&& Prestige.botFilter.isValidTarget(player)
&& (closest == null || mc.player.squaredDistanceTo(player) < mc.player.squaredDistanceTo(closest))
&& !(RotationUtil.getAngleFromPlayerRotation(RotationUtil.getRotationTo(player.getEyePos())) > maxAngle)) {
closest = player;
}
}
return closest;
}
public static Entity getClosestEntity() {
Entity closest = null;
for (Entity entity : mc.world.getEntities()) {
if (entity.isAlive()
&& !entity.equals(mc.player)
&& !Prestige.friendManager.isFriend(entity.getName().getString())
&& entity.isAttackable()
&& Prestige.botFilter.isValidTarget(entity)
&& (closest == null || mc.player.squaredDistanceTo(entity) < mc.player.squaredDistanceTo(closest))) {
closest = entity;
}
}
return closest;
}
public static boolean isBlockingWithShield(PlayerEntity player) {
return (
player.getMainHandStack().getItem() == Items.SHIELD
|| player.getOffHandStack().getItem() == Items.SHIELD && player.getMainHandStack().get(DataComponentTypes.FOOD) == null
)
&& player.isUsingItem()
&& !isFacingAway(player);
}
private static boolean isFacingAway(PlayerEntity player) {
if (mc.player != null && player != null) {
Vec3d toSelf = PositionUtil.getPlayerPos().subtract(PositionUtil.getEntityPos(player)).normalize();
float yaw = player.getYaw();
float pitch = player.getPitch();
return new Vec3d(
-Math.sin(Math.toRadians(yaw)) * Math.cos(Math.toRadians(pitch)),
-Math.sin(Math.toRadians(pitch)),
Math.cos(Math.toRadians(yaw)) * Math.cos(Math.toRadians(pitch))
)
.normalize().dotProduct(toSelf) < 0.0;
} else {
return false;
}
}
}
@@ -2,135 +2,56 @@ package dev.zprestige.prestige.combat;
import dev.zprestige.prestige.Subscribe;
import dev.zprestige.prestige.client.Prestige;
import dev.zprestige.prestige.event.EntityEvent;
import dev.zprestige.prestige.event.Event;
import dev.zprestige.prestige.event.TickEvent19;
import dev.zprestige.prestige.render.RenderContract2;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import dev.zprestige.prestige.event.AttackEntityEvent;
import dev.zprestige.prestige.event.ClientTickEvent;
import dev.zprestige.prestige.render.MinecraftAccess;
import net.minecraft.entity.Entity;
import net.minecraft.entity.decoration.EndCrystalEntity;
import net.minecraft.entity.player.PlayerEntity;
public class TargetTracker implements RenderContract2 {
private PlayerEntity a;
private long c;
public class TargetTracker implements MinecraftAccess {
private PlayerEntity target;
private long lastAttackTime;
public TargetTracker(long var1) {
public TargetTracker() {
super();
var1 = 0L;
var1 = 108076624727597L ^ var1;
long var3 = var1 ^ 134580352215820L;
this.a = null;
this.c = 0L;
Prestige.eventBus.register(new Object[]{this, var3});
this.target = null;
this.lastAttackTime = 0L;
Prestige.eventBus.register(this);
}
@Subscribe
public void a(TickEvent19 var1) {
if (this.a != null && (b.world == null || !this.a.isAlive() || this.a.distanceTo(b.player) > 15.0F || System.currentTimeMillis() - this.c > 5000L)) {
this.a = null;
public void onClientTick(ClientTickEvent event) {
if (this.target != null && (mc.world == null || !this.target.isAlive() || this.target.distanceTo(mc.player) > 15.0F || System.currentTimeMillis() - this.lastAttackTime > 5000L)) {
this.target = null;
}
}
@Subscribe
public void a(EntityEvent var1) {
Event.b();
Entity var9 = var1.a(new Object[0]);
if (var9 instanceof PlayerEntity var10) {
this.a_void____(new Object[]{var10, 64033097141446L});
} else if (var9 instanceof EndCrystalEntity) {
for (PlayerEntity var12 : b.world.getPlayers()) {
if (var12 != null
&& var12 != b.player
&& !Prestige.g.a(new Object[]{var12.getName().getString(), 24848952222090L})
&& var12.distanceTo(var9) <= 5.0F) {
this.a_void____(new Object[]{var12, 64033097141446L});
public void onAttackEntity(AttackEntityEvent event) {
Entity attacked = event.getTarget();
if (attacked instanceof PlayerEntity attackedPlayer) {
this.setTarget(attackedPlayer);
} else if (attacked instanceof EndCrystalEntity) {
for (PlayerEntity player : mc.world.getPlayers()) {
if (player != null
&& player != mc.player
&& !Prestige.friendManager.isFriend(player.getName().getString())
&& player.distanceTo(attacked) <= 5.0F) {
this.setTarget(player);
}
}
}
}
public PlayerEntity a(Object[] var1) {
return this.a;
public PlayerEntity getTarget() {
return this.target;
}
public void a_void____(Object[] var1) {
PlayerEntity var2 = (PlayerEntity)var1[0];
long var3 = (Long)var1[1];
var3 = 108076624727597L ^ var3;
long var5 = var3 ^ 86787500893025L;
if (!Prestige.g.a(new Object[]{var2.getName().getString(), var5})) {
this.a = var2;
this.c = System.currentTimeMillis();
}
}
private static Field c(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field d(Class var0, String var1, Class var2) {
Field var3 = c(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = d(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method c(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method d(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = c(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = d(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
public void setTarget(PlayerEntity newTarget) {
if (!Prestige.friendManager.isFriend(newTarget.getName().getString())) {
this.target = newTarget;
this.lastAttackTime = System.currentTimeMillis();
}
}
}
@@ -0,0 +1,88 @@
package dev.zprestige.prestige.combat;
import dev.zprestige.prestige.client.Prestige;
import dev.zprestige.prestige.inventory.InventoryUtil;
import dev.zprestige.prestige.render.ThreatAssessment;
import dev.zprestige.prestige.type.ThreatType;
import dev.zprestige.prestige.world.BlockUtil;
import java.util.EnumSet;
import java.util.function.Predicate;
import net.minecraft.block.Blocks;
import net.minecraft.client.MinecraftClient;
import net.minecraft.entity.Entity;
import net.minecraft.entity.decoration.EndCrystalEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.state.property.Properties;
import net.minecraft.util.math.BlockPos;
public final class ThreatAssessor {
private static final MinecraftClient mc = MinecraftClient.getInstance();
public static final ThreatAssessment NO_THREAT = new ThreatAssessment(null, 0.0F, 0.0F);
private ThreatAssessor() {
}
public static ThreatAssessment findBiggestThreat(PlayerEntity enemy, EnumSet threatTypes, float sensitivity) {
if (mc.player != null && mc.world != null && enemy != null) {
ThreatAssessment biggest = NO_THREAT;
if (threatTypes.contains(ThreatType.CRYSTAL)) {
for (Entity entity : mc.world.getEntities()) {
if (entity instanceof EndCrystalEntity) {
biggest = keepBiggerThreat(biggest, ThreatType.CRYSTAL, (float)Prestige.damageCalculator.getCrystalDamage(mc.player, entity.getBlockPos().toCenterPos()), sensitivity);
}
}
}
if (threatTypes.contains(ThreatType.ANCHOR)) {
for (BlockPos anchorPos : (Iterable<BlockPos>)(BlockUtil.getBlocksInRadius(5, (Predicate<BlockPos>)anchorCandidate -> isNearPlayer(enemy, anchorCandidate)
&& mc.world.getBlockState(anchorCandidate).getBlock() == Blocks.RESPAWN_ANCHOR
&& mc.world.getBlockState(anchorCandidate).get(Properties.CHARGES) != 0))) {
biggest = keepBiggerThreat(biggest, ThreatType.ANCHOR, (float)Prestige.damageCalculator.getAnchorDamage(mc.player, anchorPos.toCenterPos()), sensitivity);
}
}
if (threatTypes.contains(ThreatType.OBSIDIAN) && !mc.player.isOnGround()) {
for (BlockPos obsidianPos : (Iterable<BlockPos>)(BlockUtil.getBlocksInRadius(5, (Predicate<BlockPos>)obsidianCandidate -> obsidianCandidate.getY() < mc.player.getY()
&& isNearPlayer(enemy, obsidianCandidate)
&& mc.world.getBlockState(obsidianCandidate).getBlock() == Blocks.OBSIDIAN
&& mc.world.getBlockState(obsidianCandidate.up()).getBlock() == Blocks.AIR))) {
biggest = keepBiggerThreat(biggest, ThreatType.OBSIDIAN, (float)Prestige.damageCalculator.getCrystalDamage(mc.player, obsidianPos.up().toCenterPos()), sensitivity);
}
}
if (threatTypes.contains(ThreatType.MACE)) {
float maceDamage = getMaceDamage(enemy);
if (maceDamage > 0.0F) {
biggest = keepBiggerThreat(biggest, ThreatType.MACE, maceDamage, sensitivity);
}
}
return biggest;
} else {
return NO_THREAT;
}
}
public static ThreatAssessment findBiggestThreat(PlayerEntity enemy, EnumSet threatTypes) {
return findBiggestThreat(enemy, threatTypes, 1.0F);
}
public static float getMaceDamage(PlayerEntity attacker) {
return InventoryUtil.isMace(attacker.getMainHandStack()) && !(attacker.fallDistance <= 1.5) && !(attacker.getY() <= mc.player.getY())
? (float)(6.0 + attacker.fallDistance * 5.0)
: 0.0F;
}
private static boolean isNearPlayer(PlayerEntity player, BlockPos pos) {
return player.squaredDistanceTo(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5) < 25.0;
}
private static ThreatAssessment keepBiggerThreat(ThreatAssessment current, ThreatType type, float damage, float sensitivity) {
if (damage <= 0.0F) {
return current;
} else {
float weightedDamage = damage * type.confidence * sensitivity;
return weightedDamage <= current.weightedDamage ? current : new ThreatAssessment(type, damage, weightedDamage);
}
}
}
@@ -1,147 +0,0 @@
package dev.zprestige.prestige.combat;
import dev.zprestige.prestige.event.Event;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.projectile.PersistentProjectileEntity;
import net.minecraft.entity.projectile.ProjectileUtil;
import net.minecraft.item.ItemStack;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.hit.EntityHitResult;
import net.minecraft.util.hit.HitResult;
import net.minecraft.util.hit.HitResult.Type;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
public final class TrajectoriesHelper extends PersistentProjectileEntity {
public boolean a;
public TrajectoriesHelper(World var1, LivingEntity var2, ItemStack var3, long var4) {
super(EntityType.ARROW, var2, var1, var3, var3);
}
@Override
public void tick() {
Event.b();
HitResult var4 = ProjectileUtil.getCollision(this, lpL398_0 -> this.canHit(((net.minecraft.entity.Entity)lpL398_0)));
if (var4.getType() != Type.MISS) {
this.onCollision(var4);
}
this.tickBlockCollision();
Vec3d var5 = this.getVelocity();
double var6 = this.getX() + var5.x;
double var8 = this.getY() + var5.y;
double var10 = this.getZ() + var5.z;
this.updateRotation();
float var12 = this.isTouchingWater() ? 0.8F : 0.99F;
this.setVelocity(var5.multiply(var12));
if (!this.hasNoGravity()) {
Vec3d var13 = this.getVelocity();
this.setVelocity(var13.x, var13.y - 0.03, var13.z);
}
this.setPosition(var6, var8, var10);
}
@Override
public void onBlockHit(BlockHitResult blockHitResult) {
this.a = true;
}
@Override
public ItemStack asItemStack() {
return null;
}
@Override
public ItemStack getDefaultItemStack() {
return null;
}
@Override
public void onEntityHit(EntityHitResult entityHitResult) {
this.a = true;
}
@Override
public void setVelocity(double x, double y, double z, float power, float uncertainty) {
Vec3d var11 = new Vec3d(x, y, z).normalize().multiply(power);
this.setVelocity(var11);
this.setYaw((float)(MathHelper.atan2(var11.x, var11.z) * 180.0F / (float)Math.PI));
this.setPitch((float)(MathHelper.atan2(var11.y, var11.horizontalLength()) * 180.0F / (float)Math.PI));
this.lastYaw = this.getYaw();
this.lastPitch = this.getPitch();
}
private static Field a(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field b(Class var0, String var1, Class var2) {
Field var3 = a(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = b(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method a(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method b(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = a(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = b(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
}
}
@@ -0,0 +1,74 @@
package dev.zprestige.prestige.combat;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.projectile.PersistentProjectileEntity;
import net.minecraft.entity.projectile.ProjectileUtil;
import net.minecraft.item.ItemStack;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.hit.EntityHitResult;
import net.minecraft.util.hit.HitResult;
import net.minecraft.util.hit.HitResult.Type;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
public final class TrajectoriesSimulatedPearl extends PersistentProjectileEntity {
public boolean landed;
public TrajectoriesSimulatedPearl(World worldIn, LivingEntity shooter, ItemStack pearlStack) {
super(EntityType.ARROW, shooter, worldIn, pearlStack, pearlStack);
}
@Override
public void tick() {
HitResult hitResult = ProjectileUtil.getCollision(this, candidate -> this.canHit(candidate));
if (hitResult.getType() != Type.MISS) {
this.onCollision(hitResult);
}
this.tickBlockCollision();
Vec3d motion = this.getVelocity();
double nextX = this.getX() + motion.x;
double nextY = this.getY() + motion.y;
double nextZ = this.getZ() + motion.z;
this.updateRotation();
this.setVelocity(motion.multiply(this.isTouchingWater() ? 0.8F : 0.99F));
if (!this.hasNoGravity()) {
Vec3d currentMotion = this.getVelocity();
this.setVelocity(currentMotion.x, currentMotion.y - 0.03, currentMotion.z);
}
this.setPosition(nextX, nextY, nextZ);
}
@Override
public void onBlockHit(BlockHitResult blockHitResult) {
this.landed = true;
}
@Override
public ItemStack asItemStack() {
return null;
}
@Override
public ItemStack getDefaultItemStack() {
return null;
}
@Override
public void onEntityHit(EntityHitResult entityHitResult) {
this.landed = true;
}
@Override
public void setVelocity(double x, double y, double z, float power, float uncertainty) {
Vec3d scaledMotion = new Vec3d(x, y, z).normalize().multiply(power);
this.setVelocity(scaledMotion);
this.setYaw((float)(MathHelper.atan2(scaledMotion.x, scaledMotion.z) * 180.0F / (float)Math.PI));
this.setPitch((float)(MathHelper.atan2(scaledMotion.y, scaledMotion.horizontalLength()) * 180.0F / (float)Math.PI));
this.lastYaw = this.getYaw();
this.lastPitch = this.getPitch();
}
}
@@ -1,14 +0,0 @@
package dev.zprestige.prestige.combat;
import net.minecraft.entity.player.PlayerEntity;
public final class TwoDESPHelper {
public PlayerEntity a;
public String b;
public float c;
public float d;
public float e;
public float f;
public float g;
public boolean h;
}
@@ -0,0 +1,14 @@
package dev.zprestige.prestige.combat;
import net.minecraft.entity.player.PlayerEntity;
public final class TwoDEspTarget {
public PlayerEntity player;
public String name;
public float health;
public float maxHealth;
public float width;
public float height;
public float distance;
public boolean friend;
}
@@ -0,0 +1,115 @@
package dev.zprestige.prestige.combat;
import dev.zprestige.prestige.Subscribe;
import dev.zprestige.prestige.client.Prestige;
import dev.zprestige.prestige.event.PlayerRenderStateEvent;
import dev.zprestige.prestige.event.ClientTickEvent;
import dev.zprestige.prestige.render.Rotation;
import dev.zprestige.prestige.render.MinecraftAccess;
import dev.zprestige.prestige.type.EventPhase;
import net.minecraft.util.math.MathHelper;
public class VisualRotationManager implements MinecraftAccess {
private boolean initialized;
private float renderYaw;
private float renderPitch;
private float prevRenderYaw;
private float prevRenderPitch;
private boolean applied;
private float savedYaw;
private float savedPitch;
private float savedBodyYaw;
private float savedHeadYaw;
private float savedLastYaw;
private float savedLastPitch;
private float savedLastBodyYaw;
private float savedLastHeadYaw;
public VisualRotationManager() {
super();
this.initialized = false;
this.applied = false;
Prestige.eventBus.register(this);
}
@Subscribe
public void onClientTick(ClientTickEvent event) {
if (mc.player == null) {
this.initialized = false;
} else if (!this.initialized) {
this.renderYaw = mc.player.getYaw();
this.renderPitch = mc.player.getPitch();
this.prevRenderYaw = this.renderYaw;
this.prevRenderPitch = this.renderPitch;
this.initialized = true;
} else {
Rotation targetRotation = Prestige.silentRotationManager.getServerRotation();
if (targetRotation == null) {
this.renderYaw = mc.player.getYaw();
this.renderPitch = mc.player.getPitch();
this.prevRenderYaw = this.renderYaw;
this.prevRenderPitch = this.renderPitch;
} else {
this.prevRenderYaw = this.renderYaw;
this.prevRenderPitch = this.renderPitch;
float yawDelta = MathHelper.wrapDegrees(targetRotation.getYaw() - this.renderYaw);
float pitchDelta = targetRotation.getPitch() - this.renderPitch;
this.renderYaw = MathHelper.wrapDegrees(this.renderYaw + yawDelta * 0.4F);
this.renderPitch = MathHelper.clamp(this.renderPitch + pitchDelta * 0.4F, -90.0F, 90.0F);
}
}
}
@Subscribe
public void onPlayerRenderState(PlayerRenderStateEvent event) {
if (event.entity == mc.player && this.initialized) {
if (event.getPhase() == EventPhase.PRE) {
if (this.applied) {
return;
}
if (Prestige.silentRotationManager.getServerRotation() == null) {
return;
}
float yawDiff = Math.abs(MathHelper.wrapDegrees(this.renderYaw - mc.player.getYaw()));
float pitchDiff = Math.abs(this.renderPitch - mc.player.getPitch());
if (yawDiff < 0.5F && pitchDiff < 0.5F) {
return;
}
this.savedYaw = mc.player.getYaw();
this.savedPitch = mc.player.getPitch();
this.savedBodyYaw = mc.player.bodyYaw;
this.savedHeadYaw = mc.player.headYaw;
this.savedLastYaw = mc.player.lastYaw;
this.savedLastPitch = mc.player.lastPitch;
this.savedLastBodyYaw = mc.player.lastBodyYaw;
this.savedLastHeadYaw = mc.player.lastHeadYaw;
mc.player.setYaw(this.renderYaw);
mc.player.setPitch(this.renderPitch);
mc.player.bodyYaw = this.renderYaw;
mc.player.headYaw = this.renderYaw;
mc.player.lastYaw = this.prevRenderYaw;
mc.player.lastPitch = this.prevRenderPitch;
mc.player.lastBodyYaw = this.prevRenderYaw;
mc.player.lastHeadYaw = this.prevRenderYaw;
this.applied = true;
} else if (event.getPhase() == EventPhase.POST && this.applied) {
mc.player.setYaw(this.savedYaw);
mc.player.setPitch(this.savedPitch);
mc.player.bodyYaw = this.savedBodyYaw;
mc.player.headYaw = this.savedHeadYaw;
mc.player.lastYaw = this.savedLastYaw;
mc.player.lastPitch = this.savedLastPitch;
mc.player.lastBodyYaw = this.savedLastBodyYaw;
mc.player.lastHeadYaw = this.savedLastHeadYaw;
this.applied = false;
}
}
}
public boolean isRotationApplied() {
return this.applied;
}
}
@@ -0,0 +1,49 @@
package dev.zprestige.prestige.config;
import java.io.InputStream;
import java.util.Objects;
public class ClasspathResource {
private final String path;
private static final String NOT_FOUND_MESSAGE = "resource not found: ";
private ClasspathResource(String resourcePath) {
this.path = resourcePath;
}
public static ClasspathResource of(String resourcePath) {
return new ClasspathResource(resourcePath.startsWith("/") ? resourcePath.substring(1) : resourcePath);
}
public InputStream openStream() {
InputStream stream = ClasspathResource.class.getClassLoader().getResourceAsStream(this.path);
if (stream == null) {
throw new IllegalArgumentException(NOT_FOUND_MESSAGE + this);
} else {
return stream;
}
}
public String getPath() {
return this.path;
}
@Override
public String toString() {
return this.path;
}
@Override
public boolean equals(Object other) {
if (this == other) {
return true;
} else {
return !(other instanceof ClasspathResource resource) ? false : this.path.equals(resource.path);
}
}
@Override
public int hashCode() {
return Objects.hash(this.path);
}
}
@@ -0,0 +1,75 @@
package dev.zprestige.prestige.config;
import dev.zprestige.prestige.client.Prestige;
import java.io.IOException;
import java.util.Optional;
import java.util.Set;
import net.minecraft.resource.InputSupplier;
import net.minecraft.resource.Resource;
import net.minecraft.resource.ResourcePack;
import net.minecraft.resource.ResourcePackInfo;
import net.minecraft.resource.ResourceType;
import net.minecraft.resource.ResourcePack.ResultConsumer;
import net.minecraft.resource.metadata.ResourceMetadataSerializer;
import net.minecraft.util.Identifier;
import org.jetbrains.annotations.Nullable;
public class ClasspathResourcePack implements ResourcePack {
@Nullable
@Override
public InputSupplier openRoot(String[] segments) {
return null;
}
@Nullable
@Override
public InputSupplier open(ResourceType type, Identifier id) {
return null;
}
@Override
public void findResources(ResourceType type, String namespace, String prefix, ResultConsumer consumer) {
}
@Override
public Set getNamespaces(ResourceType type) {
return null;
}
@Nullable
@Override
public Object parseMetadata(ResourceMetadataSerializer metadataSerializer) throws IOException {
return null;
}
@Override
public String getId() {
return "Prestige";
}
@Override
public Optional getKnownPackInfo() {
return ResourcePack.super.getKnownPackInfo();
}
@Override
public ResourcePackInfo getInfo() {
return null;
}
@Override
public void close() {
}
public static Resource createAssetResource(Identifier id) {
return new Resource(new ClasspathResourcePack(), () -> Prestige.class.getClassLoader().getResourceAsStream("assets/prestige/" + id.getPath()));
}
public static Resource createResource(String path) {
return new Resource(new ClasspathResourcePack(), () -> Prestige.class.getClassLoader().getResourceAsStream(path));
}
public static InputSupplier createInputSupplier(String path) {
return () -> Prestige.class.getClassLoader().getResourceAsStream(path);
}
}
@@ -1,130 +0,0 @@
package dev.zprestige.prestige.config;
import com.google.gson.JsonObject;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
public class ConfigHelper {
private int a;
private float b;
private float c;
private float d;
private float e;
private float f;
public ConfigHelper() {
}
public ConfigHelper(int var1, float var2, float var3, float var4, float var5, float var6) {
this.a = var1;
this.b = var2;
this.c = var3;
this.d = var4;
this.e = var5;
this.f = var6;
}
public static ConfigHelper a(Object[] var0) {
JsonObject var1 = (JsonObject)var0[0];
ConfigHelper var4 = new ConfigHelper();
var4.a = var1.get("emSize").getAsInt();
var4.b = var1.get("lineHeight").getAsFloat();
var4.c = var1.get("ascender").getAsFloat();
var4.d = var1.get("descender").getAsFloat();
var4.e = var1.get("underlineY").getAsFloat();
var4.f = var1.get("underlineThickness").getAsFloat();
return var4;
}
public int a_int_(Object[] var1) {
return this.a;
}
public float a_float_(Object[] var1) {
return this.b;
}
public float b(Object[] var1) {
return this.c;
}
public float c(Object[] var1) {
return this.d;
}
public float d(Object[] var1) {
return this.e;
}
public float e(Object[] var1) {
return this.f;
}
private static Field a(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field b(Class var0, String var1, Class var2) {
Field var3 = a(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = b(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method a(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method b(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = a(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = b(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
}
}
@@ -1,152 +0,0 @@
package dev.zprestige.prestige.config;
import com.google.gson.JsonObject;
import dev.zprestige.prestige.event.Event;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
public class ConfigHelper2 {
private int a;
private float b;
private float c;
private float d;
private float e;
private float f;
private float g;
private float h;
private float i;
private float j;
public static ConfigHelper2 a(Object[] var0) {
JsonObject var1 = (JsonObject)var0[0];
Event.b();
ConfigHelper2 var5 = new ConfigHelper2();
var5.a = var1.get("unicode").getAsInt();
var5.b = var1.get("advance").getAsFloat();
if (var1.has("planeBounds")) {
JsonObject var6 = var1.get("planeBounds").getAsJsonObject();
var5.c = var6.get("left").getAsFloat();
var5.d = var6.get("bottom").getAsFloat();
var5.e = var6.get("right").getAsFloat();
var5.f = var6.get("top").getAsFloat();
}
if (var1.has("atlasBounds")) {
JsonObject var7 = var1.get("atlasBounds").getAsJsonObject();
var5.g = var7.get("left").getAsFloat();
var5.h = var7.get("bottom").getAsFloat();
var5.i = var7.get("right").getAsFloat();
var5.j = var7.get("top").getAsFloat();
}
return var5;
}
public int a_int__(Object[] var1) {
return this.a;
}
public float a_float__(Object[] var1) {
return this.b;
}
public float b(Object[] var1) {
return this.c;
}
public float c(Object[] var1) {
return this.d;
}
public float d(Object[] var1) {
return this.e;
}
public float e(Object[] var1) {
return this.f;
}
public float f(Object[] var1) {
return this.g;
}
public float g(Object[] var1) {
return this.h;
}
public float h(Object[] var1) {
return this.i;
}
public float i(Object[] var1) {
return this.j;
}
private static Field a(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field b(Class var0, String var1, Class var2) {
Field var3 = a(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = b(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method a(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method b(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = a(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = b(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
}
}
@@ -1,127 +0,0 @@
package dev.zprestige.prestige.config;
import dev.zprestige.prestige.event.Event;
import java.io.InputStream;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Objects;
public class ConfigHelper3 {
private final String a;
private static final String c = "resource not found: ";
private ConfigHelper3(String var1) {
this.a = var1;
}
public static ConfigHelper3 a(Object[] var0) {
String var1 = (String)var0[0];
String var5 = var1.startsWith("/") ? var1.substring(1) : var1;
return new ConfigHelper3(var5);
}
public InputStream a_InputStream(Object[] var1) {
Event.b();
InputStream var5 = ConfigHelper3.class.getClassLoader().getResourceAsStream(this.a);
if (var5 == null) {
throw new IllegalArgumentException(c + this);
} else {
return var5;
}
}
public String a_String(Object[] var1) {
return this.a;
}
@Override
public String toString() {
return this.a;
}
@Override
public boolean equals(Object var1) {
if (this == var1) {
return true;
} else {
return !(var1 instanceof ConfigHelper3 var5) ? false : this.a.equals(var5.a);
}
}
@Override
public int hashCode() {
return Objects.hash(this.a);
}
private static Field a(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field b(Class var0, String var1, Class var2) {
Field var3 = a(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = b(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method a(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method b(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = a(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = b(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
}
private static IllegalArgumentException a(IllegalArgumentException var0) {
return var0;
}
}
File diff suppressed because it is too large. Load diff
@@ -1,162 +0,0 @@
package dev.zprestige.prestige.config;
import dev.zprestige.prestige.client.Prestige;
import java.io.IOException;
import java.lang.invoke.CallSite;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.lang.invoke.MutableCallSite;
import java.lang.invoke.MethodHandles.Lookup;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESKeySpec;
import javax.crypto.spec.IvParameterSpec;
import net.minecraft.resource.InputSupplier;
import net.minecraft.resource.Resource;
import net.minecraft.resource.ResourcePack;
import net.minecraft.resource.ResourcePackInfo;
import net.minecraft.resource.ResourceType;
import net.minecraft.resource.ResourcePack.ResultConsumer;
import net.minecraft.resource.metadata.ResourceMetadataSerializer;
import net.minecraft.util.Identifier;
import org.jetbrains.annotations.Nullable;
public class ConfigUtil implements ResourcePack {
@Nullable
@Override
public InputSupplier openRoot(String[] segments) {
return null;
}
@Nullable
@Override
public InputSupplier open(ResourceType type, Identifier id) {
return null;
}
@Override
public void findResources(ResourceType type, String namespace, String prefix, ResultConsumer consumer) {
}
@Override
public Set getNamespaces(ResourceType type) {
return null;
}
@Nullable
@Override
public Object parseMetadata(ResourceMetadataSerializer metadataSerializer) throws IOException {
return null;
}
@Override
public String getId() {
return "Prestige";
}
@Override
public Optional getKnownPackInfo() {
return ResourcePack.super.getKnownPackInfo();
}
@Override
public ResourcePackInfo getInfo() {
return null;
}
@Override
public void close() {
}
public static Resource a(Object[] var0) {
Identifier var1 = (Identifier)var0[0];
return new Resource(new ConfigUtil(), () -> Prestige.class.getClassLoader().getResourceAsStream("assets/prestige/" + var1.getPath()));
}
public static Resource b(Object[] var0) {
String var1 = (String)var0[0];
return new Resource(new ConfigUtil(), () -> Prestige.class.getClassLoader().getResourceAsStream(var1));
}
public static InputSupplier a_class_7367(Object[] var0) {
String var1 = (String)var0[0];
return () -> Prestige.class.getClassLoader().getResourceAsStream(var1);
}
private static Field a(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field b(Class var0, String var1, Class var2) {
Field var3 = a(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = b(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method a(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method b(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = a(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = b(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
}
}
@@ -0,0 +1,59 @@
package dev.zprestige.prestige.config;
import com.google.gson.JsonObject;
public class MsdfFontMetrics {
private int emSize;
private float lineHeight;
private float ascender;
private float descender;
private float underlineY;
private float underlineThickness;
public MsdfFontMetrics() {
}
public MsdfFontMetrics(int size, float lineSpacing, float ascent, float descent, float underlineOffset, float underlineHeight) {
this.emSize = size;
this.lineHeight = lineSpacing;
this.ascender = ascent;
this.descender = descent;
this.underlineY = underlineOffset;
this.underlineThickness = underlineHeight;
}
public static MsdfFontMetrics fromJson(JsonObject json) {
MsdfFontMetrics metrics = new MsdfFontMetrics();
metrics.emSize = json.get("emSize").getAsInt();
metrics.lineHeight = json.get("lineHeight").getAsFloat();
metrics.ascender = json.get("ascender").getAsFloat();
metrics.descender = json.get("descender").getAsFloat();
metrics.underlineY = json.get("underlineY").getAsFloat();
metrics.underlineThickness = json.get("underlineThickness").getAsFloat();
return metrics;
}
public int getEmSize() {
return this.emSize;
}
public float getLineHeight() {
return this.lineHeight;
}
public float getAscender() {
return this.ascender;
}
public float getDescender() {
return this.descender;
}
public float getUnderlineY() {
return this.underlineY;
}
public float getUnderlineThickness() {
return this.underlineThickness;
}
}
@@ -0,0 +1,79 @@
package dev.zprestige.prestige.config;
import com.google.gson.JsonObject;
public class MsdfGlyph {
private int codePoint;
private float advance;
private float planeLeft;
private float planeBottom;
private float planeRight;
private float planeTop;
private float atlasLeft;
private float atlasBottom;
private float atlasRight;
private float atlasTop;
public static MsdfGlyph fromJson(JsonObject json) {
MsdfGlyph glyph = new MsdfGlyph();
glyph.codePoint = json.get("unicode").getAsInt();
glyph.advance = json.get("advance").getAsFloat();
if (json.has("planeBounds")) {
JsonObject planeBounds = json.get("planeBounds").getAsJsonObject();
glyph.planeLeft = planeBounds.get("left").getAsFloat();
glyph.planeBottom = planeBounds.get("bottom").getAsFloat();
glyph.planeRight = planeBounds.get("right").getAsFloat();
glyph.planeTop = planeBounds.get("top").getAsFloat();
}
if (json.has("atlasBounds")) {
JsonObject atlasBounds = json.get("atlasBounds").getAsJsonObject();
glyph.atlasLeft = atlasBounds.get("left").getAsFloat();
glyph.atlasBottom = atlasBounds.get("bottom").getAsFloat();
glyph.atlasRight = atlasBounds.get("right").getAsFloat();
glyph.atlasTop = atlasBounds.get("top").getAsFloat();
}
return glyph;
}
public int getCodePoint() {
return this.codePoint;
}
public float getAdvance() {
return this.advance;
}
public float getPlaneLeft() {
return this.planeLeft;
}
public float getPlaneBottom() {
return this.planeBottom;
}
public float getPlaneRight() {
return this.planeRight;
}
public float getPlaneTop() {
return this.planeTop;
}
public float getAtlasLeft() {
return this.atlasLeft;
}
public float getAtlasBottom() {
return this.atlasBottom;
}
public float getAtlasRight() {
return this.atlasRight;
}
public float getAtlasTop() {
return this.atlasTop;
}
}
@@ -0,0 +1,7 @@
package dev.zprestige.prestige.data;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
public record AnchorCandidate(BlockPos anchorPos, BlockPos supportPos, Vec3d hitVec, boolean anchorExists, int charges, double distance, boolean sameLevel, boolean adjacent, int scanIndex, double targetDamageEstimate, double predictedDamageEstimate, double score) {
}
@@ -0,0 +1,6 @@
package dev.zprestige.prestige.data;
import net.minecraft.util.math.Vec3d;
public record AnchorCatchPearlLanding(Vec3d landingPos, int ticksUntilLanding) {
}
@@ -2,5 +2,5 @@ package dev.zprestige.prestige.data;
import net.minecraft.util.math.BlockPos;
public record LongData4(BlockPos ay, long az) {
public record AuraCartPlacement(BlockPos pos, long time) {
}
@@ -3,5 +3,5 @@ package dev.zprestige.prestige.data;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
public record VecData2(BlockPos ae, Vec3d af) {
public record AutoAnchorPlaceTarget(BlockPos supportPos, Vec3d hitVec) {
}
@@ -0,0 +1,7 @@
package dev.zprestige.prestige.data;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
public record AutoAnchorPlan(BlockPos anchorPos, BlockPos anchorSupportPos, Vec3d anchorHitVec, boolean anchorExists, BlockPos blockerPos, BlockPos blockerSupportPos, Vec3d blockerHitVec) {
}
@@ -0,0 +1,29 @@
package dev.zprestige.prestige.data;
import dev.zprestige.prestige.render.GlRenderPass;
import dev.zprestige.prestige.render.RenderStateElement;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL14;
public record BlendFuncState(boolean enabled, boolean restoreEnabled, int srcRgb, int dstRgb, int srcAlpha, int dstAlpha) implements RenderStateElement {
@Override
public void apply(GlRenderPass renderPass) {
if (this.enabled) {
GL11.glEnable(3042);
GL14.glBlendFuncSeparate(this.srcRgb, this.dstRgb, this.srcAlpha, this.dstAlpha);
} else {
GL11.glDisable(3042);
}
}
@Override
public void cleanup() {
if (this.restoreEnabled != this.enabled) {
if (this.restoreEnabled) {
GL11.glEnable(3042);
} else {
GL11.glDisable(3042);
}
}
}
}
@@ -0,0 +1,29 @@
package dev.zprestige.prestige.data;
import dev.zprestige.prestige.render.GlRenderPass;
import dev.zprestige.prestige.render.RenderStateElement;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL14;
public record BlendToggleState(boolean enabled, boolean wasEnabled) implements RenderStateElement {
@Override
public void apply(GlRenderPass renderPass) {
if (this.enabled) {
GL11.glEnable(3042);
GL14.glBlendFuncSeparate(770, 771, 1, 771);
} else {
GL11.glDisable(3042);
}
}
@Override
public void cleanup() {
if (this.wasEnabled != this.enabled) {
if (this.wasEnabled) {
GL11.glEnable(3042);
} else {
GL11.glDisable(3042);
}
}
}
}
@@ -1,89 +0,0 @@
package dev.zprestige.prestige.data;
import dev.zprestige.prestige.render.RenderPass;
import dev.zprestige.prestige.render.Uniform;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import org.lwjgl.opengl.GL11;
public record BoolData(boolean bP, boolean bQ) implements Uniform {
@Override
public void a(RenderPass var1) {
GL11.glDepthMask(this.bP);
}
@Override
public void a() {
if (this.bQ != this.bP) {
GL11.glDepthMask(this.bQ);
}
}
private static Field a(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field b(Class var0, String var1, Class var2) {
Field var3 = a(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = b(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method a(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method b(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = a(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = b(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
}
}
@@ -1,99 +0,0 @@
package dev.zprestige.prestige.data;
import dev.zprestige.prestige.render.RenderPass;
import dev.zprestige.prestige.render.Uniform;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL14;
public record BoolData2(boolean b1, boolean b2) implements Uniform {
@Override
public void a(RenderPass var1) {
if (this.b1) {
GL11.glEnable(3042);
GL14.glBlendFuncSeparate(770, 771, 1, 771);
} else {
GL11.glDisable(3042);
}
}
@Override
public void a() {
if (this.b2 != this.b1) {
if (this.b2) {
GL11.glEnable(3042);
} else {
GL11.glDisable(3042);
}
}
}
private static Field a(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field b(Class var0, String var1, Class var2) {
Field var3 = a(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = b(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method a(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method b(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = a(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = b(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
}
}
@@ -1,99 +0,0 @@
package dev.zprestige.prestige.data;
import dev.zprestige.prestige.render.RenderPass;
import dev.zprestige.prestige.render.Uniform;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL14;
public record BoolIntData(boolean bH, boolean bI, int bJ, int bK, int bL, int bM) implements Uniform {
@Override
public void a(RenderPass var1) {
if (this.bH) {
GL11.glEnable(3042);
GL14.glBlendFuncSeparate(this.bJ, this.bK, this.bL, this.bM);
} else {
GL11.glDisable(3042);
}
}
@Override
public void a() {
if (this.bI != this.bH) {
if (this.bI) {
GL11.glEnable(3042);
} else {
GL11.glDisable(3042);
}
}
}
private static Field a(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field b(Class var0, String var1, Class var2) {
Field var3 = a(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = b(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method a(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method b(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = a(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = b(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
}
}
@@ -1,103 +0,0 @@
package dev.zprestige.prestige.data;
import dev.zprestige.prestige.render.RenderPass;
import dev.zprestige.prestige.render.Uniform;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import org.lwjgl.opengl.GL11;
public record BoolIntData2(boolean bU, boolean bV, int bW, int bX, int bY, int bZ) implements Uniform {
@Override
public void a(RenderPass var1) {
if (this.bU) {
GL11.glEnable(3089);
GL11.glScissor(this.bW, this.bX, this.bY, this.bZ);
} else {
GL11.glDisable(3089);
}
}
@Override
public void a() {
if (this.bV != this.bU) {
if (this.bV) {
GL11.glEnable(3089);
} else {
GL11.glDisable(3089);
}
}
}
@Override
public boolean a_boolean() {
return true;
}
private static Field a(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field b(Class var0, String var1, Class var2) {
Field var3 = a(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = b(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method a(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method b(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = a(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = b(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
}
}
@@ -1,8 +0,0 @@
package dev.zprestige.prestige.data;
import dev.zprestige.prestige.render.GpuBuffer;
import dev.zprestige.prestige.render.RenderHelper31;
import java.util.concurrent.atomic.AtomicReference;
public record BufferData(GpuBuffer au, GpuBuffer av, RenderHelper31 aw, AtomicReference ax) {
}
@@ -1,6 +0,0 @@
package dev.zprestige.prestige.data;
import dev.zprestige.prestige.render.GpuBuffer;
public record BufferQuadIntData(GpuBuffer cc, IntBoolData cd, int ce, long cf) {
}
@@ -3,5 +3,5 @@ package dev.zprestige.prestige.data;
import net.minecraft.client.render.Camera;
import org.joml.Matrix4f;
public record MatrixCameraData(Matrix4f bA, Matrix4f bB, Camera bC) {
public record CameraMatrices(Matrix4f projection, Matrix4f modelView, Camera camera) {
}
@@ -3,5 +3,5 @@ package dev.zprestige.prestige.data;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
public record DoubleData(BlockPos al, BlockHitResult am, double an) {
public record CartBlockerPlacement(BlockPos pos, BlockHitResult hitResult, double damage) {
}
@@ -2,5 +2,5 @@ package dev.zprestige.prestige.data;
import net.minecraft.util.math.Vec3d;
public record VecIntData(Vec3d a, int b) {
public record CartCatchPearlLanding(Vec3d landingPos, int ticksUntilLanding) {
}
@@ -3,5 +3,5 @@ package dev.zprestige.prestige.data;
import net.minecraft.entity.vehicle.TntMinecartEntity;
import net.minecraft.util.math.Vec3d;
public record VecDoubleData(TntMinecartEntity ao, Vec3d ap, double aq, double ar) {
public record CartThreat(TntMinecartEntity cart, Vec3d explosionPos, double horizontalSpeed, double damage) {
}
@@ -1,131 +0,0 @@
package dev.zprestige.prestige.data;
import dev.zprestige.prestige.world.WorldContract;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import net.minecraft.client.render.VertexConsumer;
public record ConsumerData(WorldContract bp) implements VertexConsumer {
@Override
public VertexConsumer vertex(float x, float y, float z) {
WorldContract var10000 = this.bp;
Object[] var10006 = new Object[]{null, null, null, 65484385065975L};
var10006[2] = z;
var10006[1] = y;
var10006[0] = x;
var10000.c_WorldContract(var10006);
return this;
}
@Override
public VertexConsumer color(int red, int green, int blue, int alpha) {
WorldContract var10000 = this.bp;
Object[] var10004 = new Object[]{null, 106573078251021L};
var10004[0] = -16776961;
var10000.e(var10004);
return this;
}
@Override
public VertexConsumer color(int argb) {
WorldContract var10000 = this.bp;
Object[] var10004 = new Object[]{null, 106573078251021L};
var10004[0] = -16776961;
var10000.e(var10004);
return this;
}
@Override
public VertexConsumer lineWidth(float width) {
return null;
}
@Override
public VertexConsumer texture(float u, float v) {
this.bp.b_WorldContract(new Object[]{new float[]{u, v}, 118034685045795L});
return this;
}
@Override
public VertexConsumer overlay(int u, int v) {
return this;
}
@Override
public VertexConsumer light(int u, int v) {
return this;
}
@Override
public VertexConsumer normal(float x, float y, float z) {
return this;
}
private static Field a(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field b(Class var0, String var1, Class var2) {
Field var3 = a(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = b(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method a(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method b(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = a(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = b(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
}
}
@@ -1,87 +0,0 @@
package dev.zprestige.prestige.data;
import dev.zprestige.prestige.render.RenderPass;
import dev.zprestige.prestige.render.Uniform;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.function.Consumer;
public record ConsumerData2(Consumer b4) implements Uniform {
@Override
public void a(RenderPass var1) {
this.b4.accept(IntData.a(var1.d.a(new Object[0])));
}
@Override
public boolean a_boolean() {
return true;
}
private static Field a(Class var0, String var1, Class var2) {
for (Field var6 : var0.getDeclaredFields()) {
if (var6.getName().equals(var1) && var6.getType() == var2) {
return var6;
}
}
return null;
}
private static Field b(Class var0, String var1, Class var2) {
Field var3 = a(var0, var1, var2);
if (var3 != null) {
return var3;
} else {
Class[] var4 = var0.getInterfaces();
if (var4 != null) {
for (int var5 = 0; var5 < var4.length; var5++) {
var3 = b(var4[var5], var1, var2);
if (var3 != null) {
return var3;
}
}
}
return null;
}
}
private static Method a(Class var0, String var1, Class var2, int var3, Class[] var4) {
label33:
for (Method var8 : var0.getDeclaredMethods()) {
if (var8.getName().equals(var1) && var8.getReturnType() == var2) {
Class[] var9 = var8.getParameterTypes();
if (var9.length == var3) {
for (int var10 = 0; var10 < var3; var10++) {
if (var9[var10] != var4[var10]) {
continue label33;
}
}
return var8;
}
}
}
return null;
}
private static Method b(Class var0, String var1, Class var2, int var3, Class[] var4) {
Method var5 = a(var0, var1, var2, var3, var4);
if (var5 != null) {
return var5;
} else {
Class[] var6 = var0.getInterfaces();
if (var6 != null) {
for (int var7 = 0; var7 < var6.length; var7++) {
var5 = b(var6[var7], var1, var2, var3, var4);
if (var5 != null) {
return var5;
}
}
}
return null;
}
}
}
Loaded 100 of 842 files, more files were not shown because too many files have changed in this diff. Show more