Skip to content

Commit

Permalink
0.8.1 OPplayerTPmodule and OPServerKillModule bugfixes
Browse files Browse the repository at this point in the history
**0.8.1**
- Fixed OPplayerTPmodule not considering people outside of render distance. Thanks to [aaaasdfghjkllll](https://github.com/aaaasdfghjkllll) for fix
- Ignore Friends option added to OPplayerTPmodule to prevent friends from getting teleported. [aaaasdfghjkllll](https://github.com/aaaasdfghjkllll)
- Fixed OPServerKillModule crash-players option. It was sometimes crashing yourself as well. Credits to etianl :D
- Added a no crash friends option to OPServerKillModule using skidded code from the OPServerKillModule "Ignore Friends" option. Thanks to [aaaasdfghjkllll](https://github.com/aaaasdfghjkllll) for the bit of code I skidded for it
  • Loading branch information
etianl authored Jan 30, 2024
1 parent d6550da commit dde952b
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 6 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.20.4+build.3
loader_version=0.15.3

# Mod Properties
mod_version=0.8.0-1.20.4
mod_version=0.8.1-1.20.4
maven_group=pwn.noobs
archives_base_name=1trouser-streak

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,18 @@

import meteordevelopment.meteorclient.events.world.TickEvent;
import meteordevelopment.meteorclient.settings.*;
import meteordevelopment.meteorclient.systems.friends.Friend;
import meteordevelopment.meteorclient.systems.friends.Friends;
import meteordevelopment.meteorclient.systems.modules.Module;
import meteordevelopment.meteorclient.utils.player.ChatUtils;
import meteordevelopment.orbit.EventHandler;
import net.minecraft.client.network.PlayerListEntry;
import pwn.noobs.trouserstreak.Trouser;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

public class OPServerKillModule extends Module {
private final SettingGroup sgGeneral = settings.getDefaultGroup();
public final Setting<Boolean> dontBeStupid = sgGeneral.add(new BoolSetting.Builder()
Expand Down Expand Up @@ -39,6 +46,12 @@ public class OPServerKillModule extends Module {
.defaultValue(true)
.build()
);
private final Setting<Boolean> nocrashfrend = sgGeneral.add(new BoolSetting.Builder()
.name("dont-crash-friends")
.description("Crashes everyone excluding your friends and you.")
.defaultValue(true)
.build()
);
private final Setting<Integer> tickdelay = sgGeneral.add(new IntSetting.Builder()
.name("Tick Delay")
.description("The delay between commands sent.")
Expand All @@ -60,6 +73,7 @@ public OPServerKillModule() {
}

private int ticks=0;
private CopyOnWriteArrayList<PlayerListEntry> players;

@Override
public void onActivate() {
Expand Down Expand Up @@ -126,7 +140,17 @@ public void onTick(TickEvent.Pre event) {
ChatUtils.sendPlayerMsg("/gamerule logAdminCommands false");
}
if (ticks == 2*tickdelay.get()){ //crash players
ChatUtils.sendPlayerMsg("/execute at @a[distance=.1..] run particle ash ~ ~ ~ 1 1 1 1 2147483647 force @a[distance=.1..]");
if (!nocrashfrend.get())ChatUtils.sendPlayerMsg("/execute at @a[name=!"+mc.player.getName().getLiteralString()+"] run particle ash ~ ~ ~ 1 1 1 1 2147483647 force @a[name=!"+mc.player.getName().getLiteralString()+"]");
else if (nocrashfrend.get()) {
players = new CopyOnWriteArrayList<>(mc.getNetworkHandler().getPlayerList());
List<String> friendNames = new ArrayList<>();
friendNames.add("name=!" + mc.player.getName().getLiteralString());
for(PlayerListEntry player : players) {
if(Friends.get().isFriend(player) && nocrashfrend.get()) friendNames.add("name=!" + player.getProfile().getName());
}
String friendsString = String.join(",", friendNames);
ChatUtils.sendPlayerMsg("/execute at @a[" + friendsString + "] run particle ash ~ ~ ~ 1 1 1 1 2147483647 force @a[" + friendsString + "]");
}
}
if (ticks == 3*tickdelay.get()){
ChatUtils.sendPlayerMsg("/gamerule randomTickSpeed "+killvalue.get());
Expand All @@ -140,7 +164,17 @@ public void onTick(TickEvent.Pre event) {
ChatUtils.sendPlayerMsg("/gamerule sendCommandFeedback false");
}
if (ticks == 2*tickdelay.get()){ //crash players
ChatUtils.sendPlayerMsg("/execute at @a[distance=.1..] run particle ash ~ ~ ~ 1 1 1 1 2147483647 force @a[distance=.1..]");
if (!nocrashfrend.get())ChatUtils.sendPlayerMsg("/execute at @a[name=!"+mc.player.getName().getLiteralString()+"] run particle ash ~ ~ ~ 1 1 1 1 2147483647 force @a[name=!"+mc.player.getName().getLiteralString()+"]");
else if (nocrashfrend.get()) {
players = new CopyOnWriteArrayList<>(mc.getNetworkHandler().getPlayerList());
List<String> friendNames = new ArrayList<>();
friendNames.add("name=!" + mc.player.getName().getLiteralString());
for(PlayerListEntry player : players) {
if(Friends.get().isFriend(player) && nocrashfrend.get()) friendNames.add("name=!" + player.getProfile().getName());
}
String friendsString = String.join(",", friendNames);
ChatUtils.sendPlayerMsg("/execute at @a[" + friendsString + "] run particle ash ~ ~ ~ 1 1 1 1 2147483647 force @a[" + friendsString + "]");
}
}
if (ticks == 3*tickdelay.get()){
ChatUtils.sendPlayerMsg("/gamerule randomTickSpeed "+killvalue.get());
Expand All @@ -157,7 +191,17 @@ public void onTick(TickEvent.Pre event) {
ChatUtils.sendPlayerMsg("/gamerule logAdminCommands false");
}
if (ticks == 3*tickdelay.get()){ //crash players
ChatUtils.sendPlayerMsg("/execute at @a[distance=.1..] run particle ash ~ ~ ~ 1 1 1 1 2147483647 force @a[distance=.1..]");
if (!nocrashfrend.get())ChatUtils.sendPlayerMsg("/execute at @a[name=!"+mc.player.getName().getLiteralString()+"] run particle ash ~ ~ ~ 1 1 1 1 2147483647 force @a[name=!"+mc.player.getName().getLiteralString()+"]");
else if (nocrashfrend.get()) {
players = new CopyOnWriteArrayList<>(mc.getNetworkHandler().getPlayerList());
List<String> friendNames = new ArrayList<>();
friendNames.add("name=!" + mc.player.getName().getLiteralString());
for(PlayerListEntry player : players) {
if(Friends.get().isFriend(player) && nocrashfrend.get()) friendNames.add("name=!" + player.getProfile().getName());
}
String friendsString = String.join(",", friendNames);
ChatUtils.sendPlayerMsg("/execute at @a[" + friendsString + "] run particle ash ~ ~ ~ 1 1 1 1 2147483647 force @a[" + friendsString + "]");
}
}
if (ticks == 4*tickdelay.get()){ //kill server
ChatUtils.sendPlayerMsg("/gamerule randomTickSpeed "+killvalue.get());
Expand All @@ -168,4 +212,4 @@ public void onTick(TickEvent.Pre event) {
}
}
}
}
}
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": "0.8.0",
"version": "0.8.1",
"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 dde952b

Please sign in to comment.