Skip to content

Commit

Permalink
*1.1.9* New and Old Chunk detection accuracy improved
Browse files Browse the repository at this point in the history
- Improved New and old chunk detection accuracy by allowing NewerNewChunks to loop through all of the non empty chunk sections for more accurate quantification of new and old chunks if there are structures generating.
- Removed the thing that doubled the weight of a new sections for the newchunk quantifier in the code if the section had structure generation. This hopefully will reduce some false positives.
- Changed the threshold for the newchunk quantifier from 65% sections being new to 51%. This is only applicable when the chunk isn't immediately defined as new by the first chunk section. (This may improve accuracy)
- Made reloading chunk data when switching worlds instant as opposed to being after a few ticks in NewerNewChunks and BaseFinder.
- Gave the SignAura options in BetterAutoSign their own section (options for automatically writing signs within reach).
  • Loading branch information
etianl authored Aug 13, 2024
1 parent 0b2bf4f commit a2b5a9a
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 49 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.1+build.2
loader_version=0.15.11

# Mod Properties
mod_version=1.1.8-1.21.1
mod_version=1.1.9-1.21.1
maven_group=pwn.noobs
archives_base_name=1trouser-streak

Expand Down
10 changes: 1 addition & 9 deletions src/main/java/pwn/noobs/trouserstreak/modules/BaseFinder.java
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,6 @@ public WWidget getWidget(GuiTheme theme) {
private static int isBaseFinderModuleOn=0;
private int autoreloadticks=0;
private int loadingticks=0;
private int reloadworld=0;
private boolean worldchange=false;
private int justenabledsavedata=0;
private int findnearestbaseticks=0;
Expand Down Expand Up @@ -540,7 +539,6 @@ public void onActivate() {
}
autoreloadticks=0;
loadingticks=0;
reloadworld=0;
worldchange=false;
justenabledsavedata = 0;
}
Expand All @@ -550,7 +548,6 @@ public void onDeactivate() {
isBaseFinderModuleOn=0;
autoreloadticks=0;
loadingticks=0;
reloadworld=0;
worldchange=false;
justenabledsavedata = 0;
if (remove.get()|autoreload.get()) {
Expand All @@ -570,7 +567,6 @@ private void onScreenOpen(OpenScreenEvent event) {
}
}
if (event.screen instanceof DownloadingTerrainScreen) {
reloadworld=0;
worldchange=true;
}
}
Expand All @@ -589,7 +585,6 @@ private void onPreTick(TickEvent.Pre event) {
world= mc.world.getRegistryKey().getValue().toString().replace(':', '_');

if (mc.player.getHealth()==0) {
reloadworld=0;
worldchange=true;
}
if (basefound==true && basefoundspamTicks< bsefndtickdelay.get())basefoundspamTicks++;
Expand Down Expand Up @@ -668,10 +663,7 @@ else if (basefoundspamTicks>= bsefndtickdelay.get()){
}
}
//autoreload when entering different dimensions
if (load.get() && reloadworld<5 && worldchange == true){
reloadworld++;
}
if (load.get() && reloadworld>=5 && worldchange == true){
if (load.get() && worldchange == true){
if (worldleaveremove.get()){
baseChunks.clear();
}
Expand Down
49 changes: 26 additions & 23 deletions src/main/java/pwn/noobs/trouserstreak/modules/BetterAutoSign.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
public class BetterAutoSign extends Module {
final SettingGroup sgSign = settings.createGroup("Normal Sign Text");
final SettingGroup sgHang = settings.createGroup("Hanging Sign Text");
final SettingGroup sgSignAura = settings.createGroup("Sign Aura");
final SettingGroup sgExtra = settings.createGroup("Visible");

private final Setting<Boolean> bothside = sgExtra.add(new BoolSetting.Builder()
.name("both-sides")
.description("Write on the rear of the signs as well.")
Expand Down Expand Up @@ -157,40 +159,21 @@ public class BetterAutoSign extends Module {
.visible(differentText::get)
.build()
);
private final Setting<Boolean> autoDye = sgExtra.add(new BoolSetting.Builder()
.name("auto-dye")
.description("Dye signs that you place")
.defaultValue(false)
.build()
);
private final Setting<List<Item>> dyeColors = sgExtra.add(new ItemListSetting.Builder()
.name("dye-colors")
.description("What color dyes to dye the sign with.")
.visible(autoDye::get)
.filter(this::filter)
.build()
);
private final Setting<Boolean> autoGlow = sgExtra.add(new BoolSetting.Builder()
.name("auto-glow")
.description("Makes your signs glow")
.defaultValue(false)
.build()
);
// based on ChestAura from Meteor Rejects
private final Setting<Boolean> signAura = sgExtra.add(new BoolSetting.Builder()
private final Setting<Boolean> signAura = sgSignAura.add(new BoolSetting.Builder()
.name("sign-aura")
.description("Automatically edits signs for you")
.defaultValue(false)
.build()
);
private final Setting<Boolean> signAuraRotate = sgExtra.add(new BoolSetting.Builder()
private final Setting<Boolean> signAuraRotate = sgSignAura.add(new BoolSetting.Builder()
.name("sign-aura-rotate")
.description("Rotates to signs")
.defaultValue(true)
.visible(signAura::get)
.build()
);
private final Setting<Double> signAuraRange = sgExtra.add(new DoubleSetting.Builder()
private final Setting<Double> signAuraRange = sgSignAura.add(new DoubleSetting.Builder()
.name("sign-aura-range")
.description("The interact range")
.defaultValue(4)
Expand All @@ -200,14 +183,34 @@ public class BetterAutoSign extends Module {
.visible(signAura::get)
.build()
);
private final Setting<Integer> signAuraDelay = sgExtra.add(new IntSetting.Builder()
private final Setting<Integer> signAuraDelay = sgSignAura.add(new IntSetting.Builder()
.name("sign-aura-delay")
.description("Delay between editing signs, in ticks")
.defaultValue(5)
.sliderMax(20)
.visible(signAura::get)
.build()
);
private final Setting<Boolean> autoDye = sgExtra.add(new BoolSetting.Builder()
.name("auto-dye")
.description("Dye signs that you place")
.defaultValue(false)
.build()
);
private final Setting<List<Item>> dyeColors = sgExtra.add(new ItemListSetting.Builder()
.name("dye-colors")
.description("What color dyes to dye the sign with.")
.visible(autoDye::get)
.filter(this::filter)
.build()
);
private final Setting<Boolean> autoGlow = sgExtra.add(new BoolSetting.Builder()
.name("auto-glow")
.description("Makes your signs glow")
.defaultValue(false)
.build()
);

private boolean editrear = false;
private BlockPos signPos = new BlockPos(99999999,99999999,99999999);
private BlockPos prevsignPos = new BlockPos(99999999,99999999,99999999);
Expand Down
19 changes: 4 additions & 15 deletions src/main/java/pwn/noobs/trouserstreak/modules/NewerNewChunks.java
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ public WWidget getWidget(GuiTheme theme) {
private int errticks=0;
private int autoreloadticks=0;
private int loadingticks=0;
private int reloadworld=0;
private boolean worldchange=false;
private int justenabledsavedata=0;
public int chunkcounterticks=0;
Expand Down Expand Up @@ -435,7 +434,6 @@ public void onActivate() {
}
autoreloadticks=0;
loadingticks=0;
reloadworld=0;
worldchange=false;
justenabledsavedata=0;
}
Expand All @@ -444,7 +442,6 @@ public void onDeactivate() {
chunkcounterticks=0;
autoreloadticks=0;
loadingticks=0;
reloadworld=0;
worldchange=false;
justenabledsavedata=0;
if (remove.get()|autoreload.get()) {
Expand All @@ -462,7 +459,6 @@ private void onScreenOpen(OpenScreenEvent event) {
}
if (event.screen instanceof DownloadingTerrainScreen) {
resetCounterValues();
reloadworld=0;
worldchange=true;
}
}
Expand All @@ -479,7 +475,6 @@ private void onPreTick(TickEvent.Pre event) {

if (mc.player.getHealth()==0) {
resetCounterValues();
reloadworld=0;
worldchange=true;
}
if (deletewarningTicks<=100) deletewarningTicks++;
Expand Down Expand Up @@ -587,10 +582,7 @@ private void onPreTick(TickEvent.Pre event) {
}
}
//autoreload when entering different dimensions
if (load.get() && reloadworld<5 && worldchange == true){
reloadworld++;
}
if (load.get() && reloadworld>=5 && worldchange == true){
if (load.get() && worldchange == true){
if (worldleaveremove.get()){
clearChunkData();
}
Expand Down Expand Up @@ -824,10 +816,8 @@ else if (!(event.packet instanceof AcknowledgeChunksC2SPacket) && !(event.packet
int loops = 0;
int newChunkQuantifier = 0;
int oldChunkQuantifier = 0;

try {
for (int i = 0; i < 8; i++) {
ChunkSection section = sections[i];
for (ChunkSection section : sections) {
if (section != null) {
//System.out.println("Processing Chunk Section: " + i);

Expand Down Expand Up @@ -855,7 +845,6 @@ else if (!(event.packet instanceof AcknowledgeChunksC2SPacket) && !(event.packet
if (bstatesSize < blockPaletteLength) {
isNewSection = 2;
//System.out.println("Section: " + loops + " | smaller bstates size!!!!!!!");
newChunkQuantifier++; //double the weight of this
}
}

Expand Down Expand Up @@ -907,7 +896,7 @@ else if (!(event.packet instanceof AcknowledgeChunksC2SPacket) && !(event.packet
else if (mc.world.getRegistryKey() != World.NETHER && mc.world.getRegistryKey() != World.END){
double percentage = ((double) newChunkQuantifier / loops) * 100;
//System.out.println("Percentage: " + percentage);
if (percentage >= 65) isNewChunk = true;
if (percentage >= 51) isNewChunk = true;
}
}
} catch (Exception e) {
Expand All @@ -919,7 +908,7 @@ else if (mc.world.getRegistryKey() != World.NETHER && mc.world.getRegistryKey()
else if (mc.world.getRegistryKey() != World.NETHER && mc.world.getRegistryKey() != World.END){
double percentage = ((double) newChunkQuantifier / loops) * 100;
//System.out.println("Percentage: " + percentage);
if (percentage >= 65) isNewChunk = true;
if (percentage >= 51) isNewChunk = true;
}
}

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.1.8",
"version": "1.1.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

0 comments on commit a2b5a9a

Please sign in to comment.