Skip to content

Commit

Permalink
1.3.6 ActivatedSpawnerDetector and PotESP bugfixes
Browse files Browse the repository at this point in the history
- Fixed a bug with the ActivatedSpawnerDetector where it would continuously spam you about spawners outside of render distance.
- Made it so you can actually turn off the Trial Spawner Detector in the ActivatedSpawnerDetector module (the checkbox did nothing).
- Fixed a false positive with PotESP pertaining to naturally occuring raw iron blocks in pots.
- Added a item list setting for PotESP where you can define items that will not be flagged, meaning decorated pots with those items will not be highlighted.
  • Loading branch information
etianl authored Dec 25, 2024
1 parent 1bc9228 commit 0790933
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
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.3.5-1.21.3
mod_version=1.3.6-1.21.3
maven_group=pwn.noobs
archives_base_name=1trouser-streak

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,18 +200,19 @@ public void onDeactivate() {
private void onPreTick(TickEvent.Pre event) {
if (mc.world == null) return;

int renderDistance = mc.options.getViewDistance().getValue();
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++) {
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 (!trialspawnerPositions.contains(pos) && !noRenderPositions.contains(pos) && !deactivatedSpawnerPositions.contains(pos) && !spawnerPositions.contains(pos) && spawner.getLogic().spawnDelay != 20) {
BlockPos playerPos = new BlockPos(mc.player.getBlockX(), pos.getY(), mc.player.getBlockZ());
if (playerPos.isWithinDistance(pos, renderDistance.get() * 16) && !trialspawnerPositions.contains(pos) && !noRenderPositions.contains(pos) && !deactivatedSpawnerPositions.contains(pos) && !spawnerPositions.contains(pos) && spawner.getLogic().spawnDelay != 20) {
if (mc.world.getRegistryKey() == World.NETHER && spawner.getLogic().spawnDelay == 0) return;
if (spawner.getLogic().spawnEntry.getNbt().get("id") != null){
String monster = spawner.getLogic().spawnEntry.getNbt().get("id").toString();
Expand Down Expand Up @@ -298,9 +299,10 @@ private void onPreTick(TickEvent.Pre event) {
}
}
if (blockEntity instanceof TrialSpawnerBlockEntity){
TrialSpawnerBlockEntity trialSpawner = (TrialSpawnerBlockEntity) blockEntity;
BlockPos tPos = trialSpawner.getPos();
if (!trialspawnerPositions.contains(tPos) && !noRenderPositions.contains(tPos) && !deactivatedSpawnerPositions.contains(tPos) && !spawnerPositions.contains(tPos) && trialSpawner.getSpawnerState() != TrialSpawnerState.WAITING_FOR_PLAYERS) {
TrialSpawnerBlockEntity trialspawner = (TrialSpawnerBlockEntity) blockEntity;
BlockPos tPos = trialspawner.getPos();
BlockPos playerPos = new BlockPos(mc.player.getBlockX(), tPos.getY(), mc.player.getBlockZ());
if (playerPos.isWithinDistance(tPos, renderDistance.get() * 16) && trialSpawner.get() && !trialspawnerPositions.contains(tPos) && !noRenderPositions.contains(tPos) && !deactivatedSpawnerPositions.contains(tPos) && !spawnerPositions.contains(tPos) && trialspawner.getSpawnerState() != TrialSpawnerState.WAITING_FOR_PLAYERS) {
if (displaycoords.get()) ChatUtils.sendMsg(Text.of("Detected Activated §cTRIAL§r Spawner! Block Position: " + tPos));
else ChatUtils.sendMsg(Text.of("Detected Activated §cTRIAL§r Spawner!"));
trialspawnerPositions.add(tPos);
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/pwn/noobs/trouserstreak/modules/PotESP.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ public class PotESP extends Module {
.visible(()->potMessage.get())
.build()
);
private final Setting<List<Item>> junkItemList = sgGeneral.add(new ItemListSetting.Builder()
.name("Junk Items")
.description("Select the items to no look for. Decorated pots containing these items will not be highlighted.")
.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.")
Expand Down Expand Up @@ -83,6 +88,7 @@ public class PotESP extends Module {
naturalPot.add(Items.STRING);
naturalPot.add(Items.EMERALD);
naturalPot.add(Items.EMERALD_BLOCK);
naturalPot.add(Items.RAW_IRON_BLOCK);
naturalPot.add(Items.IRON_INGOT);
naturalPot.add(Items.TRIAL_KEY);
naturalPot.add(Items.DIAMOND);
Expand Down Expand Up @@ -117,7 +123,7 @@ private void onPreTick(TickEvent.Pre event) {
Item potItem = pot.stack.getItem();

BlockPos potLocation = pot.getPos();
if (!potLocations.contains(potLocation) && !naturalPot.contains(potItem)) {
if (!potLocations.contains(potLocation) && !naturalPot.contains(potItem) && !junkItemList.get().contains(potItem)) {
if (potMessage.get()) {
if (displaycoords.get())
ChatUtils.sendMsg(Text.of("Found a dank pot! It contains: " + potItem + " Location: " + potLocation));
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.3.5",
"version": "1.3.6",
"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 0790933

Please sign in to comment.