This commit is contained in:
parent
b2a4e89b49
commit
3a5a361f01
2 changed files with 39 additions and 0 deletions
|
@ -39,6 +39,7 @@ public class Setup {
|
|||
new AutoSignText(),
|
||||
new Baritone(),
|
||||
new Bind(),
|
||||
new BookFill(),
|
||||
new Bright(),
|
||||
new ChatAppend(),
|
||||
new ChatCrypt(),
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
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.Description;
|
||||
import de.com.baseband.client.util.adapt.FieldFinder;
|
||||
import net.minecraft.client.gui.GuiScreenBook;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
@Ingame
|
||||
@Description("Automatically fills books you open with random characters.")
|
||||
public class BookFill extends Feature {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BookFill";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTick() {
|
||||
if(mc.currentScreen instanceof GuiScreenBook) {
|
||||
try {
|
||||
FieldFinder.findUnmarkedMethod(GuiScreenBook.class, 1, String.class).invoke(mc.currentScreen, randomString());
|
||||
} catch (IllegalAccessException | InvocationTargetException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
return builder.toString();
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue