Skip to content

Commit

Permalink
v1.2.9 ActivatedSpawnerDetector added, and bugfixes
Browse files Browse the repository at this point in the history
**BaseFinder Changes/Fixes**
- Moved Hoppers from block list 1 to list 6 to prevent false positives with Trial Chambers. (Trouser for 1.21.3 only)
- Moved all beds from block lists to list 5 due to Trial Chambers now having beds of randomized colors in their chambers. (Trouser for 1.21.3 only)
- Fixed the Entity Cluster detector not working. It detects if there are large clusters of certain entities (such as dozens of chickens in a farm or something)

**New ActivatedSpawnerDetector Module!**
This new module can detect if a player was ever near a spawner block. 
It does so by checking the countdown value on the next spawn which gets changed from a certain value that it generates with.
The intended use for this module would be on anarchy servers where people try to hide their items within chests in dungeons and mineshafts.
This allows you to see if a dungeon or mineshaft has been visited even if the player who visited has not modified ANY of the natural blocks.
  • Loading branch information
etianl authored Dec 13, 2024
1 parent 4be6f0b commit 8c2284f
Show file tree
Hide file tree
Showing 10 changed files with 179 additions and 16 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ In no particular order
</p>

## Features:
- **ActivatedSpawnerDetector** Detects if a player was ever near a spawner block. The intended use for this module would be on anarchy servers where people try to hide their items within chests in dungeons and mineshafts. (Credits to etianl :D)
- **Airstrike+:** Rains down whatever entities you desire. It used to only rain fireballs, and I also changed the positioning of the spawning. (Credits to Allah-Hack for the original)
- **AnHero:** Become An Hero! (A quick way back to spawn.) (Credits to etianl :D)
- **AutoCommand:** Automates a list of commands you set in it's options at the push of a button! Credits to [aaaasdfghjkllll](https://github.com/aaaasdfghjkllll). I only added a full auto option because who doesn't love full auto?
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.21.3+build.2
loader_version=0.16.9

# Mod Properties
mod_version=1.2.8-1.21.3
mod_version=1.2.9-1.21.3
maven_group=pwn.noobs
archives_base_name=1trouser-streak

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
3 changes: 2 additions & 1 deletion src/main/java/pwn/noobs/trouserstreak/Trouser.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ public void onInitialize() {

//Modules.get().add(new -----> Find and Grief noobs! <-----());
Modules.get().add(new NewerNewChunks());
Modules.get().add(new OnlinePlayerActivityDetector());
Modules.get().add(new BaseFinder());
Modules.get().add(new ActivatedSpawnerDetector());
Modules.get().add(new OnlinePlayerActivityDetector());
Modules.get().add(new HoleAndTunnelAndStairsESP());
Modules.get().add(new TrouserBlockESP());
Modules.get().add(new StorageLooter());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
//made by etianl :D
package pwn.noobs.trouserstreak.modules;

import meteordevelopment.meteorclient.events.render.Render3DEvent;
import meteordevelopment.meteorclient.events.world.TickEvent;
import meteordevelopment.meteorclient.renderer.ShapeMode;
import meteordevelopment.meteorclient.settings.*;
import meteordevelopment.meteorclient.systems.modules.Module;
import meteordevelopment.meteorclient.utils.player.ChatUtils;
import meteordevelopment.meteorclient.utils.render.color.Color;
import meteordevelopment.meteorclient.utils.render.color.SettingColor;
import meteordevelopment.orbit.EventHandler;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.MobSpawnerBlockEntity;
import net.minecraft.text.Text;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Box;
import net.minecraft.util.math.ChunkPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.chunk.WorldChunk;
import pwn.noobs.trouserstreak.Trouser;

import java.util.*;

public class ActivatedSpawnerDetector extends Module {
private final SettingGroup sgGeneral = settings.getDefaultGroup();
private final SettingGroup sgRender = settings.createGroup("Render");

private final Setting<Boolean> extramessage = sgGeneral.add(new BoolSetting.Builder()
.name("Extra Warning Message")
.description("Toggle the message reminding you about stashes.")
.defaultValue(true)
.build()
);
public final Setting<Integer> renderDistance = sgRender.add(new IntSetting.Builder()
.name("Render-Distance(Chunks)")
.description("How many chunks from the character to render the detected chunks.")
.defaultValue(32)
.min(6)
.sliderRange(6,1024)
.build()
);
private final Setting<ShapeMode> shapeMode = sgRender.add(new EnumSetting.Builder<ShapeMode>()
.name("shape-mode")
.description("How the shapes are rendered.")
.defaultValue(ShapeMode.Both)
.build()
);
private final Setting<SettingColor> spawnerSideColor = sgRender.add(new ColorSetting.Builder()
.name("spawner-side-color")
.description("Color of the triggered spawner.")
.defaultValue(new SettingColor(251, 5, 5, 70))
.visible(() -> (shapeMode.get() == ShapeMode.Sides || shapeMode.get() == ShapeMode.Both))
.build()
);
private final Setting<SettingColor> spawnerLineColor = sgRender.add(new ColorSetting.Builder()
.name("spawner-line-color")
.description("Color of the triggered spawner.")
.defaultValue(new SettingColor(251, 5, 5, 235))
.visible(() -> (shapeMode.get() == ShapeMode.Lines || shapeMode.get() == ShapeMode.Both))
.build()
);
private final Setting<Boolean> rangerendering = sgRender.add(new BoolSetting.Builder()
.name("spawner-range-rendering")
.description("Renders the rough active range of a mob spawner block.")
.defaultValue(true)
.build()
);
private final Setting<SettingColor> rangeSideColor = sgRender.add(new ColorSetting.Builder()
.name("spawner-range-side-color")
.description("Color of the chunks.")
.defaultValue(new SettingColor(5, 178, 251, 30))
.visible(() -> rangerendering.get() && (shapeMode.get() == ShapeMode.Sides || shapeMode.get() == ShapeMode.Both))
.build()
);
private final Setting<SettingColor> rangeLineColor = sgRender.add(new ColorSetting.Builder()
.name("spawner-range-line-color")
.description("Color of the chunks.")
.defaultValue(new SettingColor(5, 178, 251, 155))
.visible(() -> rangerendering.get() && (shapeMode.get() == ShapeMode.Lines || shapeMode.get() == ShapeMode.Both))
.build()
);
private final Setting<Boolean> removerenderdist = sgRender.add(new BoolSetting.Builder()
.name("RemoveOutsideRenderDistance")
.description("Removes the cached chunks when they leave the defined render distance.")
.defaultValue(true)
.build()
);

private final Set<BlockPos> spawnerPositions = Collections.synchronizedSet(new HashSet<>());

public ActivatedSpawnerDetector() {
super(Trouser.Main,"ActivatedSpawnerDetector", "Detects if a player has been near a mob spawner in the past. May be useful for finding player made stashes in dungeons, mineshafts, and other places.");
}
@Override
public void onActivate() {
spawnerPositions.clear();
}
@Override
public void onDeactivate() {
spawnerPositions.clear();
}
@EventHandler
private void onPreTick(TickEvent.Pre event) {
if (mc.world == null) return;

int renderDistance = mc.options.getViewDistance().getValue();
ChunkPos playerChunkPos = new ChunkPos(mc.player.getBlockPos());
for (int chunkX = playerChunkPos.x - renderDistance; chunkX <= playerChunkPos.x + renderDistance; chunkX++) {
for (int chunkZ = playerChunkPos.z - renderDistance; chunkZ <= playerChunkPos.z + renderDistance; chunkZ++) {
WorldChunk chunk = mc.world.getChunk(chunkX, chunkZ);
List<BlockEntity> blockEntities = new ArrayList<>(chunk.getBlockEntities().values());

for (BlockEntity blockEntity : blockEntities) {
if (blockEntity instanceof MobSpawnerBlockEntity){
MobSpawnerBlockEntity spawner = (MobSpawnerBlockEntity) blockEntity;
BlockPos pos = spawner.getPos();
if (!spawnerPositions.contains(pos) && spawner.getLogic().spawnDelay != 20) {
ChatUtils.sendMsg(Text.of("Detected Triggered Spawner! Block Position: " + pos));
if (extramessage.get()) error("There may be stashed items in the storage near the spawners!");
spawnerPositions.add(pos);
}
}
}
}
}
if (removerenderdist.get())removeChunksOutsideRenderDistance();
}
@EventHandler
private void onRender(Render3DEvent event) {
if (spawnerSideColor.get().a > 5 || spawnerLineColor.get().a > 5 || rangeSideColor.get().a > 5 || rangeLineColor.get().a > 5) {
synchronized (spawnerPositions) {
for (BlockPos pos : spawnerPositions) {
if (pos != null && mc.getCameraEntity().getBlockPos().isWithinDistance(pos, renderDistance.get() * 16)) {
int startX = pos.getX();
int startY = pos.getY();
int startZ = pos.getZ();
int endX = pos.getX();
int endY = pos.getY();
int endZ = pos.getZ();
if (rangerendering.get())render(new Box(new Vec3d(startX+15, startY+15, startZ+15), new Vec3d(endX-14, endY-14, endZ-14)), rangeSideColor.get(), rangeLineColor.get(), shapeMode.get(), event);
render(new Box(new Vec3d(startX+1, startY+1, startZ+1), new Vec3d(endX, endY, endZ)), spawnerSideColor.get(), spawnerLineColor.get(), shapeMode.get(), event);
}
}
}
}
}

private void render(Box box, Color sides, Color lines, ShapeMode shapeMode, Render3DEvent event) {
event.renderer.box(box.minX, box.minY, box.minZ, box.maxX, box.maxY, box.maxZ, sides, lines, shapeMode, 0);
}
private void removeChunksOutsideRenderDistance() {
BlockPos cameraPos = mc.getCameraEntity().getBlockPos();
double renderDistanceBlocks = renderDistance.get() * 16;

removeChunksOutsideRenderDistance(spawnerPositions, cameraPos, renderDistanceBlocks);
}
private void removeChunksOutsideRenderDistance(Set<BlockPos> chunkSet, BlockPos cameraPos, double renderDistanceBlocks) {
chunkSet.removeIf(chunkPos -> !cameraPos.isWithinDistance(chunkPos, renderDistanceBlocks));
}
}
17 changes: 8 additions & 9 deletions src/main/java/pwn/noobs/trouserstreak/modules/BaseFinder.java
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ private Set<EntityType<?>> getDefaultCreatures() {
private final Setting<Integer> animalsFoundThreshold = sgEDetectors.add(new IntSetting.Builder()
.name("Entity Cluster Threshold")
.description("Once this many entities are found in a chunk trigger it as being a base.")
.min(0)
.sliderRange(0,100)
.min(1)
.sliderRange(1,100)
.defaultValue(12)
.build());
private final Setting<Integer> bsefndtickdelay = sgGeneral.add(new IntSetting.Builder()
Expand All @@ -219,8 +219,7 @@ private Set<EntityType<?>> getDefaultCreatures() {
.name("Block List #1 (Default)")
.description("If the total amount of any of these found is greater than the Number specified, throw a base location.")
.defaultValue(
Blocks.CRAFTER, Blocks.BLACK_BED, Blocks.GRAY_BED, Blocks.LIGHT_BLUE_BED, Blocks.LIGHT_GRAY_BED, Blocks.PINK_BED,
Blocks.SPRUCE_SAPLING, Blocks.OAK_SAPLING, Blocks.BIRCH_SAPLING, Blocks.JUNGLE_SAPLING, Blocks.CHERRY_SAPLING, Blocks.BAMBOO_SAPLING,
Blocks.CRAFTER, Blocks.SPRUCE_SAPLING, Blocks.OAK_SAPLING, Blocks.BIRCH_SAPLING, Blocks.JUNGLE_SAPLING, Blocks.CHERRY_SAPLING, Blocks.BAMBOO_SAPLING,
Blocks.CHERRY_BUTTON, Blocks.CHERRY_DOOR, Blocks.CHERRY_FENCE, Blocks.CHERRY_FENCE_GATE, Blocks.CHERRY_PLANKS, Blocks.CHERRY_PRESSURE_PLATE, Blocks.CHERRY_STAIRS, Blocks.CHERRY_WOOD, Blocks.CHERRY_TRAPDOOR, Blocks.CHERRY_SLAB,
Blocks.MANGROVE_PLANKS, Blocks.MANGROVE_BUTTON, Blocks.MANGROVE_DOOR, Blocks.MANGROVE_FENCE, Blocks.MANGROVE_FENCE_GATE, Blocks.MANGROVE_STAIRS, Blocks.MANGROVE_SLAB, Blocks.MANGROVE_TRAPDOOR,
Blocks.BIRCH_DOOR, Blocks.BIRCH_FENCE_GATE, Blocks.BIRCH_BUTTON, Blocks.ACACIA_BUTTON, Blocks.DARK_OAK_BUTTON, Blocks.POLISHED_BLACKSTONE_BUTTON, Blocks.SPRUCE_BUTTON,
Expand All @@ -247,7 +246,7 @@ private Set<EntityType<?>> getDefaultCreatures() {
Blocks.SHULKER_BOX, Blocks.BLACK_SHULKER_BOX, Blocks.BLUE_SHULKER_BOX, Blocks.BROWN_SHULKER_BOX, Blocks.CYAN_SHULKER_BOX, Blocks.GRAY_SHULKER_BOX, Blocks.GREEN_SHULKER_BOX, Blocks.LIGHT_BLUE_SHULKER_BOX, Blocks.LIGHT_GRAY_SHULKER_BOX, Blocks.LIME_SHULKER_BOX, Blocks.MAGENTA_SHULKER_BOX, Blocks.ORANGE_SHULKER_BOX, Blocks.PINK_SHULKER_BOX, Blocks.PURPLE_SHULKER_BOX, Blocks.RED_SHULKER_BOX, Blocks.WHITE_SHULKER_BOX, Blocks.YELLOW_SHULKER_BOX,
Blocks.LAVA_CAULDRON, Blocks.POWDER_SNOW_CAULDRON, Blocks.ACTIVATOR_RAIL, Blocks.BEACON, Blocks.BEEHIVE, Blocks.REPEATING_COMMAND_BLOCK, Blocks.COMMAND_BLOCK, Blocks.CHAIN_COMMAND_BLOCK, Blocks.EMERALD_BLOCK, Blocks.IRON_BLOCK, Blocks.NETHERITE_BLOCK, Blocks.RAW_GOLD_BLOCK, Blocks.CONDUIT, Blocks.DAYLIGHT_DETECTOR, Blocks.DETECTOR_RAIL, Blocks.DRIED_KELP_BLOCK, Blocks.DROPPER, Blocks.ENCHANTING_TABLE,
Blocks.PIGLIN_HEAD, Blocks.PIGLIN_WALL_HEAD, Blocks.CREEPER_HEAD, Blocks.CREEPER_WALL_HEAD, Blocks.DRAGON_WALL_HEAD, Blocks.DRAGON_HEAD, Blocks.PLAYER_HEAD, Blocks.PLAYER_WALL_HEAD, Blocks.ZOMBIE_HEAD, Blocks.ZOMBIE_WALL_HEAD, Blocks.SKELETON_WALL_SKULL, Blocks.WITHER_SKELETON_SKULL, Blocks.WITHER_SKELETON_WALL_SKULL, Blocks.HEAVY_CORE,
Blocks.HONEY_BLOCK, Blocks.HONEYCOMB_BLOCK, Blocks.HOPPER, Blocks.JUKEBOX, Blocks.LIGHTNING_ROD, Blocks.LODESTONE, Blocks.OBSERVER, Blocks.POWERED_RAIL, Blocks.HEAVY_WEIGHTED_PRESSURE_PLATE, Blocks.LIGHT_WEIGHTED_PRESSURE_PLATE, Blocks.POLISHED_BLACKSTONE_PRESSURE_PLATE, Blocks.BIRCH_PRESSURE_PLATE, Blocks.JUNGLE_PRESSURE_PLATE, Blocks.DARK_OAK_PRESSURE_PLATE, Blocks.MANGROVE_PRESSURE_PLATE, Blocks.CRIMSON_PRESSURE_PLATE, Blocks.WARPED_PRESSURE_PLATE, Blocks.RESPAWN_ANCHOR, Blocks.CALIBRATED_SCULK_SENSOR, Blocks.SNIFFER_EGG
Blocks.HONEY_BLOCK, Blocks.HONEYCOMB_BLOCK, Blocks.JUKEBOX, Blocks.LIGHTNING_ROD, Blocks.LODESTONE, Blocks.OBSERVER, Blocks.POWERED_RAIL, Blocks.HEAVY_WEIGHTED_PRESSURE_PLATE, Blocks.LIGHT_WEIGHTED_PRESSURE_PLATE, Blocks.POLISHED_BLACKSTONE_PRESSURE_PLATE, Blocks.BIRCH_PRESSURE_PLATE, Blocks.JUNGLE_PRESSURE_PLATE, Blocks.DARK_OAK_PRESSURE_PLATE, Blocks.MANGROVE_PRESSURE_PLATE, Blocks.CRIMSON_PRESSURE_PLATE, Blocks.WARPED_PRESSURE_PLATE, Blocks.RESPAWN_ANCHOR, Blocks.CALIBRATED_SCULK_SENSOR, Blocks.SNIFFER_EGG
)
.filter(this::filterBlocks)
.build()
Expand All @@ -262,7 +261,7 @@ private Set<EntityType<?>> getDefaultCreatures() {
private final Setting<List<Block>> Blawcks3 = sglists.add(new BlockListSetting.Builder()
.name("Block List #3 (Default)")
.description("If the total amount of any of these found is greater than the Number specified, throw a base location.")
.defaultValue(Blocks.CRAFTING_TABLE, Blocks.BREWING_STAND, Blocks.ENDER_CHEST, Blocks.SMOOTH_QUARTZ, Blocks.REDSTONE_BLOCK, Blocks.DIAMOND_BLOCK, Blocks.BROWN_STAINED_GLASS, Blocks.MAGENTA_BED, Blocks.BROWN_BED)
.defaultValue(Blocks.CRAFTING_TABLE, Blocks.BREWING_STAND, Blocks.ENDER_CHEST, Blocks.SMOOTH_QUARTZ, Blocks.REDSTONE_BLOCK, Blocks.DIAMOND_BLOCK, Blocks.BROWN_STAINED_GLASS)
.filter(this::filterBlocks)
.build()
);
Expand All @@ -276,14 +275,14 @@ private Set<EntityType<?>> getDefaultCreatures() {
private final Setting<List<Block>> Blawcks5 = sglists.add(new BlockListSetting.Builder()
.name("Block List #5 (Default)")
.description("If the total amount of any of these found is greater than the Number specified, throw a base location.")
.defaultValue(Blocks.QUARTZ_BLOCK, Blocks.RED_BED, Blocks.WHITE_BED, Blocks.YELLOW_BED, Blocks.ORANGE_BED, Blocks.BLUE_BED, Blocks.CYAN_BED, Blocks.GREEN_BED, Blocks.LIME_BED, Blocks.PURPLE_BED, Blocks.WHITE_CONCRETE)
.defaultValue(Blocks.QUARTZ_BLOCK, Blocks.BLACK_BED, Blocks.GRAY_BED, Blocks.LIGHT_BLUE_BED, Blocks.LIGHT_GRAY_BED, Blocks.PINK_BED, Blocks.RED_BED, Blocks.WHITE_BED, Blocks.YELLOW_BED, Blocks.ORANGE_BED, Blocks.BLUE_BED, Blocks.CYAN_BED, Blocks.GREEN_BED, Blocks.LIME_BED, Blocks.PURPLE_BED, Blocks.MAGENTA_BED, Blocks.BROWN_BED, Blocks.WHITE_CONCRETE)
.filter(this::filterBlocks)
.build()
);
private final Setting<List<Block>> Blawcks6 = sglists.add(new BlockListSetting.Builder()
.name("Block List #6 (Default)")
.description("If the total amount of any of these found is greater than the Number specified, throw a base location.")
.defaultValue(Blocks.REDSTONE_TORCH, Blocks.REDSTONE_WALL_TORCH, Blocks.FURNACE)
.defaultValue(Blocks.REDSTONE_TORCH, Blocks.REDSTONE_WALL_TORCH, Blocks.FURNACE, Blocks.HOPPER)
.filter(this::filterBlocks)
.build()
);
Expand Down Expand Up @@ -841,7 +840,7 @@ else if (basefoundspamTicks >= bsefndtickdelay.get()) {
LastBaseFound = new ChunkPos(chunk.getPos().x, chunk.getPos().z);
basefound = true;
}
} else if (entitieslist.get().contains(entity) && entityClusterFinder.get()) {
} else if (entitieslist.get().contains(entity.getType()) && entityClusterFinder.get()) {
animalsFound.getAndIncrement();
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,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!");
}
@EventHandler
private void onScreenOpen(OpenScreenEvent event) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ public class StorageLooter extends Module {
private float originalPitch;

public StorageLooter() {
super(Trouser.Main, "Storage Looter", "Steals stuff from containers around you.");
super(Trouser.Main, "Storage-Looter", "Steals stuff from containers around you.");
}

@EventHandler
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.2.8",
"version": "1.2.9",
"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
3 changes: 2 additions & 1 deletion src/main/resources/streak-addon.accesswidener
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ accessible method net/minecraft/world/chunk/PalettedContainer$Data palette ()Lne
accessible method net/minecraft/client/network/ClientPlayerEntity getPermissionLevel ()I
accessible class net/minecraft/network/packet/c2s/play/PlayerInteractEntityC2SPacket$InteractType
accessible class net/minecraft/network/packet/c2s/play/PlayerInteractEntityC2SPacket$InteractAtHandler
accessible class net/minecraft/network/packet/c2s/play/PlayerInteractEntityC2SPacket$InteractTypeHandler
accessible class net/minecraft/network/packet/c2s/play/PlayerInteractEntityC2SPacket$InteractTypeHandler
accessible field net/minecraft/block/spawner/MobSpawnerLogic spawnDelay I

0 comments on commit 8c2284f

Please sign in to comment.