Skip to content

Commit

Permalink
1.4.4 ElytraCount added, merged pr from crosby
Browse files Browse the repository at this point in the history
- Added ElytraCount HUD option. This module tells you just how many Elytra you have left in your inventory. Thank you to https://github.com/Nataani3825 for adding this!
- Merged pull request #89 from https://github.com/RacoonDog to make the build.gradle file better. Thanks! 
- Made the "Check Air Disturbances" option in **ActivatedSpawnerDetector** false by default because there are some false positives with it.
On a side note, I recently confirmed that the Book and Quill dupe only works on server versions 1.21.1 and less! 
If the server is 1.21.1 and is **NOT** vanilla then the dupe will not work. If the server is less than 1.21.1 or is 1.21.1 vanilla then the dupe will work!
Issue: #77
  • Loading branch information
etianl authored Jan 31, 2025
1 parent 07ce18a commit 00d543f
Show file tree
Hide file tree
Showing 8 changed files with 177 additions and 7 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ In no particular order
- [DAMcraft (ServerSeeker)](https://github.com/DAMcraft/MeteorServerSeeker)
- [Meteor Client](https://github.com/meteordevelopment/meteor-client)
- [Allah-Hack](https://github.com/TaxEvasiqn/allah-hack)
- [Meteor-Tweaks](https://github.com/Declipsonator/Meteor-Tweaks)
- [Meteor-Rejects](https://github.com/AntiCope/meteor-rejects)
- [Frostburn Client](https://github.com/evaan/FrostBurn)
- [Banana](https://github.com/Bennooo/banana-for-everyone) Credits for checkbox array from AutoBuild, and the idea for TrouserBuild
Expand Down
5 changes: 5 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ dependencies {
}

processResources {
inputs.properties([
"version": project.version,
"mc_version": project.minecraft_version
])

filesMatching("fabric.mod.json") {
expand "version": project.version, "mc_version": project.minecraft_version
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ yarn_mappings=1.20.4+build.3
loader_version=0.15.3

# Mod Properties
mod_version=1.4.3-1.20.4
mod_version=1.4.4-1.20.4
maven_group=pwn.noobs
archives_base_name=3trouser-streak

Expand Down
7 changes: 6 additions & 1 deletion src/main/java/pwn/noobs/trouserstreak/Trouser.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

import meteordevelopment.meteorclient.addons.MeteorAddon;
import meteordevelopment.meteorclient.commands.Commands;
import meteordevelopment.meteorclient.systems.hud.Hud;
import meteordevelopment.meteorclient.systems.modules.Category;
import meteordevelopment.meteorclient.systems.modules.Modules;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import pwn.noobs.trouserstreak.commands.*;
import pwn.noobs.trouserstreak.hud.*;
import pwn.noobs.trouserstreak.modules.*;


Expand Down Expand Up @@ -68,14 +70,14 @@ public void onInitialize() {
Modules.get().add(new OPplayerTPmodule());

//Modules.get().add(new -----> Exploits for old versions! <-----());
Modules.get().add(new BookAndQuillDupe());
Modules.get().add(new ShulkerDupe());
Modules.get().add(new InvDupeModule());
Modules.get().add(new BoatKill());
Modules.get().add(new InstantKill());
Modules.get().add(new LecternCrash());

//Modules.get().add(new -----> And much more <-----());
Modules.get().add(new BookAndQuillDupe());
Modules.get().add(new AttributeSwap());
Modules.get().add(new Teleport());
Modules.get().add(new TPFly());
Expand All @@ -93,6 +95,9 @@ public void onInitialize() {
Commands.add(new AutoVaultClipCommand());
Modules.get().add(new BlockListMineCommand());
Commands.add(new GarbageCleanerCommand());

//Modules.get().add(new -----> Additions to the HUD module! <-----());
Hud.get().register(ElytraCount.INFO);
}

@Override
Expand Down
160 changes: 160 additions & 0 deletions src/main/java/pwn/noobs/trouserstreak/hud/ElytraCount.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
/**
* ElytraCount
* =======
* - Written by Nataani
* - Pulled from the Meteorite module.
* This hud feature displays a count of elytra's in your inventory.
* You can configure the minimum durability for the item to be counted.
* This is helpful when autoswapping Elytra's to have a visual count of available Elytra to swap.
*/

package pwn.noobs.trouserstreak.hud;

import meteordevelopment.meteorclient.settings.*;
import meteordevelopment.meteorclient.systems.hud.Hud;
import meteordevelopment.meteorclient.systems.hud.HudElement;
import meteordevelopment.meteorclient.systems.hud.HudElementInfo;
import meteordevelopment.meteorclient.systems.hud.HudRenderer;
import meteordevelopment.meteorclient.utils.player.InvUtils;
import meteordevelopment.meteorclient.utils.render.color.Color;
import meteordevelopment.meteorclient.utils.render.color.SettingColor;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;

public class ElytraCount extends HudElement {
public static final HudElementInfo<ElytraCount> INFO = new HudElementInfo<>(Hud.GROUP, "elytra-count", "Displays a count of elytra's in inventory with configurable minimum durability.", ElytraCount::new);

private final SettingGroup sgGeneral = settings.getDefaultGroup();
private final SettingGroup sgBackground = settings.createGroup("Background");

// General

public final Setting<Integer> minDurability = sgGeneral.add(new IntSetting.Builder()
.name("min-durability")
.description("Durability threshold to count elytras.")
.defaultValue(300)
.range(1, Items.ELYTRA.getMaxDamage() - 1)
.sliderRange(1, Items.ELYTRA.getMaxDamage() - 1)
.build()
);

private final Setting<Mode> mode = sgGeneral.add(new EnumSetting.Builder<Mode>()
.name("none-mode")
.description("How to render the item when you don't have the specified item in your inventory.")
.defaultValue(Mode.HideCount)
.build()
);

private final Setting<Double> scale = sgGeneral.add(new DoubleSetting.Builder()
.name("scale")
.description("Scale of the item.")
.defaultValue(2)
.onChanged(aDouble -> calculateSize())
.min(1)
.sliderRange(1, 4)
.build()
);

private final Setting<Integer> border = sgGeneral.add(new IntSetting.Builder()
.name("border")
.description("How much space to add around the element.")
.defaultValue(0)
.onChanged(integer -> calculateSize())
.build()
);

// Background

private final Setting<Boolean> background = sgBackground.add(new BoolSetting.Builder()
.name("background")
.description("Displays background.")
.defaultValue(false)
.build()
);

private final Setting<SettingColor> backgroundColor = sgBackground.add(new ColorSetting.Builder()
.name("background-color")
.description("Color used for the background.")
.visible(background::get)
.defaultValue(new SettingColor(25, 25, 25, 50))
.build()
);

public ElytraCount() {
super(INFO);

calculateSize();
}

@Override
public void setSize(double width, double height) {
super.setSize(width + border.get() * 2, height + border.get() * 2);
}

private void calculateSize() {
setSize(17 * scale.get(), 17 * scale.get());
}

@Override
public void render(HudRenderer renderer) {

ItemStack itemStack = new ItemStack(Items.ELYTRA, InvUtils.find(stack ->
stack.getItem() == Items.ELYTRA &&
(stack.getMaxDamage() - stack.getDamage()) > minDurability.get()
).count());

if (mode.get() == Mode.HideItem && itemStack.isEmpty()) {
if (isInEditor()) {
renderer.line(x, y, x + getWidth(), y + getHeight(), Color.GRAY);
renderer.line(x, y + getHeight(), x + getWidth(), y, Color.GRAY);
}
} else {
renderer.post(() -> {
double x = this.x + border.get();
double y = this.y + border.get();

render(renderer, itemStack, (int) x, (int) y);
});
}

if (background.get()) renderer.quad(x, y, getWidth(), getHeight(), backgroundColor.get());
}

private void render(HudRenderer renderer, ItemStack itemStack, int x, int y) {
if (mode.get() == Mode.HideItem) {
renderer.item(itemStack, x, y, scale.get().floatValue(), true);
return;
}

String countOverride = null;
boolean resetToZero = false;

if (itemStack.isEmpty()) {
if (mode.get() == Mode.ShowCount)
countOverride = "0";

itemStack.setCount(1);
resetToZero = true;
}

renderer.item(itemStack, x, y, scale.get().floatValue(), true, countOverride);

if (resetToZero)
itemStack.setCount(0);
}

public enum Mode {
HideItem,
HideCount,
ShowCount;

@Override
public String toString() {
return switch (this) {
case HideItem -> "Hide Item";
case HideCount -> "Hide Count";
case ShowCount -> "Show Count";
};
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ public class ActivatedSpawnerDetector extends Module {
);
private final Setting<Boolean> airChecker = sgGeneral.add(new BoolSetting.Builder()
.name("Check Air Disturbances")
.description("Displays spawners as activated if there are disturbances in the air around them. For example if a torch was placed and removed it will detect that.")
.defaultValue(true)
.description("Displays spawners as activated if there are disturbances in the air around them. For example if a torch was placed and removed it will detect that. THERE CAN BE SOME FALSE POSITIVES WITH THIS!")
.defaultValue(false)
.build()
);
private final Setting<List<Block>> blocks = sgGeneral.add(new BlockListSetting.Builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

public class BookAndQuillDupe extends Module {
private final SettingGroup sgSpecial = settings.createGroup("Book And Quill Dupe works on server versions 1.20.6+");
private final SettingGroup sgSpecial2 = settings.createGroup("Does not work on latest Paper updates.");
private final Setting<Boolean> disconnectdisable = sgSpecial.add(new BoolSetting.Builder()
.name("Disable on Disconnect")
.description("Disables module on disconnecting")
Expand All @@ -39,7 +38,7 @@ public class BookAndQuillDupe extends Module {
.build()
);
public BookAndQuillDupe() {
super(Trouser.Main, "Book-And-Quill-Dupe", "Overflows data in a book's title to cause dupes and chunk bans. Credits to Thorioum!");
super(Trouser.Main, "Book-And-Quill-Dupe", "Overflows data in a book's title to cause dupes and chunk bans. Credits to Thorioum! Only works in servers up to version 1.21, or Vanilla 1.21.1.");
}
@EventHandler
private void onScreenOpen(OpenScreenEvent event) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"schemaVersion": 1,
"id": "streak-addon",
"version": "1.4.3",
"version": "1.4.4",
"name": "TrouserStreak",
"description": "Trouser-Streak is a compilation of modules, updated to the latest version and optimized for maximum grief. I did not make all of these.",
"authors": [
Expand Down

0 comments on commit 00d543f

Please sign in to comment.