add englishy mode to bookfill
All checks were successful
/ Build BaseBand DSM & Broadway (push) Successful in 2m41s
All checks were successful
/ Build BaseBand DSM & Broadway (push) Successful in 2m41s
This commit is contained in:
parent
3a5a361f01
commit
b6a881d51f
1 changed files with 12 additions and 1 deletions
|
@ -3,6 +3,7 @@ package de.com.baseband.client.feature.modules.ingame;
|
|||
import de.com.baseband.client.BaseBand;
|
||||
import de.com.baseband.client.feature.Feature;
|
||||
import de.com.baseband.client.feature.category.Ingame;
|
||||
import de.com.baseband.client.registry.annotation.Config;
|
||||
import de.com.baseband.client.registry.annotation.Description;
|
||||
import de.com.baseband.client.util.adapt.FieldFinder;
|
||||
import net.minecraft.client.gui.GuiScreenBook;
|
||||
|
@ -12,6 +13,11 @@ import java.lang.reflect.InvocationTargetException;
|
|||
@Ingame
|
||||
@Description("Automatically fills books you open with random characters.")
|
||||
public class BookFill extends Feature {
|
||||
|
||||
@Config("English")
|
||||
@Description("Make the books english-y instead of all-unicode")
|
||||
public boolean alphanumeric = false;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BookFill";
|
||||
|
@ -28,10 +34,15 @@ public class BookFill extends Feature {
|
|||
}
|
||||
}
|
||||
|
||||
private static final char[] ENGLISH = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,.-!+#?\"/%&()*'<>".toCharArray();
|
||||
|
||||
private String randomString() {
|
||||
StringBuilder builder = new StringBuilder(255);
|
||||
for (int i = 0; i < 256; i++) {
|
||||
builder.append((char) (BaseBand.RANDOM.nextInt(Character.MAX_VALUE - 256) + 256));
|
||||
if(alphanumeric) {
|
||||
builder.append(ENGLISH[BaseBand.RANDOM.nextInt(ENGLISH.length)]);
|
||||
} else
|
||||
builder.append((char) (BaseBand.RANDOM.nextInt(Character.MAX_VALUE - 256) + 256));
|
||||
}
|
||||
return builder.toString();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue