Added SliderComponent, Updated many values mins & maxes

This commit is contained in:
noil 2021-01-07 01:20:50 -05:00
parent 2fa7fdf18f
commit e0b327f23a
21 changed files with 400 additions and 49 deletions

View File

@ -65,9 +65,7 @@ public class DraggableHudComponent extends HudComponent {
this.setX(mouseX - this.getDeltaX());
this.setY(mouseY - this.getDeltaY());
this.clamp();
}
if (this.isMouseInside(mouseX, mouseY)) {
} else if (this.isMouseInside(mouseX, mouseY)) {
RenderUtil.drawRect(this.getX(), this.getY(), this.getX() + this.getW(), this.getY() + this.getH(), 0x45FFFFFF);
}

View File

@ -18,7 +18,7 @@ public class ResizableHudComponent extends DraggableHudComponent {
private float initialWidth;
private float initialHeight;
private final float CLICK_ZONE = 2;
protected final float CLICK_ZONE = 2;
public ResizableHudComponent(String name, float initialWidth, float initialHeight) {
super(name);

View File

@ -0,0 +1,328 @@
package me.rigamortis.seppuku.api.gui.hud.component;
import com.mojang.realmsclient.gui.ChatFormatting;
import me.rigamortis.seppuku.Seppuku;
import me.rigamortis.seppuku.api.util.ColorUtil;
import me.rigamortis.seppuku.api.util.MathUtil;
import me.rigamortis.seppuku.api.util.RenderUtil;
import me.rigamortis.seppuku.api.value.Value;
import me.rigamortis.seppuku.impl.config.ModuleConfig;
import net.minecraft.client.Minecraft;
import java.text.DecimalFormat;
/**
* SliderComponent
* - strictly for values atm (v3.1), will be used around the entire hud later on.
*
* @author noil
*/
public final class SliderComponent extends HudComponent {
private ComponentListener mouseClickListener;
private Value value;
private final SliderBarComponent sliderBar;
private TextComponent textComponent;
protected boolean sliding;
protected final DecimalFormat decimalFormat = new DecimalFormat("#.#");
protected float lastPositionX = -1;
public SliderComponent(String name, Value value) {
super(name);
this.sliding = false;
this.value = value;
this.sliderBar = new SliderBarComponent(4, 9, 192, this);
}
@Override
public void render(int mouseX, int mouseY, float partialTicks) {
super.render(mouseX, mouseY, partialTicks);
if (isMouseInside(mouseX, mouseY))
RenderUtil.drawGradientRect(this.getX(), this.getY(), this.getX() + this.getW(), this.getY() + this.getH(), 0x30909090, 0x00101010);
RenderUtil.drawRect(this.getX(), this.getY(), this.getX() + this.getW(), this.getY() + this.getH(), 0x45202020);
if (this.textComponent == null) {
if (this.sliderBar != null) {
this.sliderBar.parent.setX(this.getX());
this.sliderBar.parent.setY(this.getY());
this.sliderBar.parent.setW(this.getW());
this.sliderBar.parent.setH(this.getH());
if (!this.sliding) {
this.sliderBar.setDragging(false);
if (this.getX() != this.lastPositionX) {
this.sliderBar.updatePositionToValue();
this.lastPositionX = this.getX();
}
} else {
if (mouseX < this.getX() || mouseX > this.getX() + this.getW()) { // mouse must be inside X at all times to slide
this.sliding = false;
this.sliderBar.setDragging(false);
this.sliderBar.setValueFromPosition();
}
}
this.sliderBar.render(mouseX, mouseY, partialTicks);
}
Minecraft.getMinecraft().fontRenderer.drawString(this.getName(), (int) this.getX() + 1, (int) this.getY() + 1, 0xFFAAAAAA);
String displayedValue = this.decimalFormat.format(this.value.getValue());
if (this.sliding) {
final String draggedValue = this.sliderBar.getValueFromPosition();
if (draggedValue != null)
displayedValue = draggedValue;
}
Minecraft.getMinecraft().fontRenderer.drawString(displayedValue, (int) (this.getX() + this.getW()) - Minecraft.getMinecraft().fontRenderer.getStringWidth(displayedValue) - 1, (int) this.getY() + 1, 0xFFAAAAAA);
} else {
this.textComponent.setX(this.getX());
this.textComponent.setY(this.getY());
this.textComponent.setW(this.getW());
this.textComponent.setH(this.getH());
this.textComponent.render(mouseX, mouseY, partialTicks);
}
}
@Override
public void mouseClick(int mouseX, int mouseY, int button) {
super.mouseClick(mouseX, mouseY, button);
if (!this.isMouseInside(mouseX, mouseY))
return;
if (button == 0) {
if (this.textComponent == null) {
this.sliding = true;
this.sliderBar.mouseClick(mouseX, mouseY, button);
} else {
this.textComponent.mouseClick(mouseX, mouseY, button);
}
}
}
@Override
public void mouseClickMove(int mouseX, int mouseY, int button) {
super.mouseClickMove(mouseX, mouseY, button);
if (!this.isMouseInside(mouseX, mouseY))
return;
if (button == 0) {
if (this.textComponent == null) {
this.sliderBar.mouseClickMove(mouseX, mouseY, button);
} else {
this.textComponent.mouseClickMove(mouseX, mouseY, button);
}
}
}
@Override
public void mouseRelease(int mouseX, int mouseY, int button) {
super.mouseRelease(mouseX, mouseY, button);
if (!this.isMouseInside(mouseX, mouseY)) {
if (this.textComponent != null)
this.textComponent = null;
this.sliding = false;
return;
}
switch (button) {
case 0:
if (this.textComponent == null) {
if (mouseClickListener != null)
mouseClickListener.onComponentEvent();
if (this.sliding) {
this.sliderBar.mouseRelease(mouseX, mouseY, button);
}
} else {
if (this.textComponent.onCheckButtonPress(mouseX, mouseY)) {
this.textComponent = null;
return;
}
this.textComponent.mouseRelease(mouseX, mouseY, button);
}
break;
case 1:
if (this.textComponent == null) {
TextComponent valueNumberText = new TextComponent(value.getName(), value.getValue().toString(), true);
valueNumberText.setTooltipText(value.getDesc() + " " + ChatFormatting.GRAY + "(" + value.getMin() + " - " + value.getMax() + ")");
valueNumberText.returnListener = new ComponentListener() {
@Override
public void onComponentEvent() {
try {
if (value.getValue() instanceof Integer) {
value.setValue(Integer.parseInt(valueNumberText.displayValue));
} else if (value.getValue() instanceof Double) {
value.setValue(Double.parseDouble(valueNumberText.displayValue));
} else if (value.getValue() instanceof Float) {
value.setValue(Float.parseFloat(valueNumberText.displayValue));
} else if (value.getValue() instanceof Long) {
value.setValue(Long.parseLong(valueNumberText.displayValue));
} else if (value.getValue() instanceof Byte) {
value.setValue(Byte.parseByte(valueNumberText.displayValue));
}
Seppuku.INSTANCE.getConfigManager().save(ModuleConfig.class); // save module configs
} catch (NumberFormatException e) {
Seppuku.INSTANCE.logfChat("%s - %s: Invalid number format.", getName(), value.getName());
}
}
};
valueNumberText.focus();
this.textComponent = valueNumberText;
} else {
this.textComponent = null;
}
break;
}
this.sliding = false;
}
@Override
public void keyTyped(char typedChar, int keyCode) {
super.keyTyped(typedChar, keyCode);
if (this.textComponent != null) {
this.textComponent.keyTyped(typedChar, keyCode);
if (!this.textComponent.focused) {
this.textComponent = null;
this.sliderBar.updatePositionToValue();
}
}
}
public static class SliderBarComponent extends DraggableHudComponent {
public int width, height, alpha;
public SliderComponent parent;
public SliderBarComponent(int width, int height, int alpha, SliderComponent parent) {
super("SliderBar");
this.width = width;
this.height = height;
this.alpha = alpha;
this.parent = parent;
this.setX(parent.getX());
this.setY(parent.getY());
this.setW(width);
this.setH(height);
}
@Override
public void render(int mouseX, int mouseY, float partialTicks) {
super.render(mouseX, mouseY, partialTicks);
this.clampSlider();
RenderUtil.drawRect(this.parent.getX(), this.getY(), this.getX(), this.getY() + this.getH(), ColorUtil.changeAlpha(0x453B005F, this.alpha));
RenderUtil.drawRect(this.getX(), this.getY(), this.getX() + this.getW(), this.getY() + this.getH(), ColorUtil.changeAlpha(0xFFC255FF, this.alpha));
}
@Override
public void mouseClick(int mouseX, int mouseY, int button) {
super.mouseClick(mouseX, mouseY, button);
this.setX(mouseX);
this.setDragging(true);
this.clampSlider();
}
@Override
public void mouseRelease(int mouseX, int mouseY, int button) {
super.mouseRelease(mouseX, mouseY, button);
if (this.isMouseInside(mouseX, mouseY)) {
if (button == 0) {
this.setValueFromPosition();
this.setDragging(false);
//this.setX(this.getPositionFromValue());
}
}
}
private void clampSlider() {
if (this.getX() < this.parent.getX())
this.setX(this.parent.getX());
if (this.getY() < this.parent.getY())
this.setY(this.parent.getY());
if (this.getX() > (this.parent.getX() + this.parent.getW()) - this.getW())
this.setX((this.parent.getX() + this.parent.getW()) - this.getW());
if ((this.getY() + getH()) > (this.parent.getY() + this.parent.getH()))
this.setY((this.parent.getY() + this.parent.getH()) - this.getH());
}
public void updatePositionToValue() {
this.setX(this.getPositionFromValue());
}
/*
//TODO: below this line is ugly and i want to do it better, but it works for our value system right now -noil
*/
private float getPositionFromValue() {
float position = -1;
if (this.parent.value.getValue() instanceof Integer) {
final int finishedInt = (int) MathUtil.map((int) this.parent.value.getValue(), (int) this.parent.value.getMin(), (int) this.parent.value.getMax(), this.parent.getX(), this.parent.getX() + this.parent.getW() - this.getW());
position = (float) finishedInt;
} else if (this.parent.value.getValue() instanceof Double) {
position = (float) MathUtil.map((double) this.parent.value.getValue(), (double) this.parent.value.getMin(), (double) this.parent.value.getMax(), this.parent.getX(), this.parent.getX() + this.parent.getW() - this.getW());
} else if (this.parent.value.getValue() instanceof Float) {
position = (float) MathUtil.map((float) this.parent.value.getValue(), (float) this.parent.value.getMin(), (float) this.parent.value.getMax(), this.parent.getX(), this.parent.getX() + this.parent.getW() - this.getW());
} else if (this.parent.value.getValue() instanceof Long) {
position = (float) (long) MathUtil.map((long) this.parent.value.getValue(), (long) this.parent.value.getMin(), (long) this.parent.value.getMax(), this.parent.getX(), this.parent.getX() + this.parent.getW() - this.getW());
} else if (this.parent.value.getValue() instanceof Byte) {
position = (float) MathUtil.map((byte) this.parent.value.getValue(), (byte) this.parent.value.getMin(), (byte) this.parent.value.getMax(), this.parent.getX(), this.parent.getX() + this.parent.getW() - this.getW());
}
return position;
}
private String getValueFromPosition() {
if (this.parent.value.getValue() instanceof Integer) {
return (int) MathUtil.map(this.getX(), this.parent.getX(), this.parent.getX() + this.parent.getW() - this.getW(), (int) this.parent.value.getMin(), (int) this.parent.value.getMax()) + "";
} else if (this.parent.value.getValue() instanceof Double) {
return this.parent.decimalFormat.format((double) MathUtil.map(this.getX(), this.parent.getX(), this.parent.getX() + this.parent.getW() - this.getW(), (double) this.parent.value.getMin(), (double) this.parent.value.getMax()));
} else if (this.parent.value.getValue() instanceof Float) {
return this.parent.decimalFormat.format((float) MathUtil.map(this.getX(), this.parent.getX(), this.parent.getX() + this.parent.getW() - this.getW(), (float) this.parent.value.getMin(), (float) this.parent.value.getMax()));
} else if (this.parent.value.getValue() instanceof Long) {
return this.parent.decimalFormat.format((long) MathUtil.map(this.getX(), this.parent.getX(), this.parent.getX() + this.parent.getW() - this.getW(), (long) this.parent.value.getMin(), (long) this.parent.value.getMax()));
} else if (this.parent.value.getValue() instanceof Byte) {
return this.parent.decimalFormat.format((byte) MathUtil.map(this.getX(), this.parent.getX(), this.parent.getX() + this.parent.getW() - this.getW(), (byte) this.parent.value.getMin(), (byte) this.parent.value.getMax()));
}
return "?";
}
private void setValueFromPosition() {
if (this.parent.value.getValue() instanceof Integer) {
final int finishedInt = (int) MathUtil.map(this.getX(), this.parent.getX(), this.parent.getX() + this.parent.getW() - this.getW(), (int) this.parent.value.getMin(), (int) this.parent.value.getMax());
this.parent.value.setValue(finishedInt);
} else if (this.parent.value.getValue() instanceof Double) {
final double finishedDouble = (double) MathUtil.map(this.getX(), this.parent.getX(), this.parent.getX() + this.parent.getW() - this.getW(), (double) this.parent.value.getMin(), (double) this.parent.value.getMax());
this.parent.value.setValue(Double.valueOf(this.parent.decimalFormat.format(finishedDouble)));
} else if (this.parent.value.getValue() instanceof Float) {
final float finishedFloat = (float) MathUtil.map(this.getX(), this.parent.getX(), this.parent.getX() + this.parent.getW() - this.getW(), (float) this.parent.value.getMin(), (float) this.parent.value.getMax());
this.parent.value.setValue(Float.valueOf(this.parent.decimalFormat.format(finishedFloat)));
} else if (this.parent.value.getValue() instanceof Long) {
final long finishedLong = (long) MathUtil.map(this.getX(), this.parent.getX(), this.parent.getX() + this.parent.getW() - this.getW(), (long) this.parent.value.getMin(), (long) this.parent.value.getMax());
this.parent.value.setValue(Long.valueOf(this.parent.decimalFormat.format(finishedLong)));
} else if (this.parent.value.getValue() instanceof Byte) {
final byte finishedByte = (byte) MathUtil.map(this.getX(), this.parent.getX(), this.parent.getX() + this.parent.getW() - this.getW(), (byte) this.parent.value.getMin(), (byte) this.parent.value.getMax());
this.parent.value.setValue(finishedByte);
}
}
}
}

View File

@ -74,13 +74,11 @@ public class TextComponent extends HudComponent {
super.mouseRelease(mouseX, mouseY, button);
if (this.isMouseInside(mouseX, mouseY) && button == 0) {
this.focused = true;
this.focus();
// check for clicking check
if (!(this instanceof ColorComponent)) {
if (mouseX >= this.getX() + this.getW() - 10 && mouseX <= this.getX() + this.getW() && mouseY >= this.getY() && mouseY <= this.getY() + this.getH()) {
this.enterPressed();
}
this.onCheckButtonPress(mouseX, mouseY);
}
} else {
this.focused = false;
@ -164,7 +162,19 @@ public class TextComponent extends HudComponent {
this.focused = false;
}
protected boolean onCheckButtonPress(int mouseX, int mouseY) {
if (mouseX >= this.getX() + this.getW() - 10 && mouseX <= this.getX() + this.getW() && mouseY >= this.getY() && mouseY <= this.getY() + this.getH()) {
this.enterPressed();
return true;
}
return false;
}
public interface TextComponentListener {
void onKeyTyped(int keyCode);
}
public void focus() {
this.focused = true;
}
}

View File

@ -6,7 +6,6 @@ import me.rigamortis.seppuku.api.util.StringUtil;
import me.rigamortis.seppuku.impl.config.SearchConfig;
import me.rigamortis.seppuku.impl.module.render.SearchModule;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.init.Blocks;
import net.minecraft.util.text.Style;
import net.minecraft.util.text.TextComponentString;

View File

@ -6,7 +6,6 @@ import me.rigamortis.seppuku.api.util.StringUtil;
import me.rigamortis.seppuku.impl.config.XrayConfig;
import me.rigamortis.seppuku.impl.module.render.XrayModule;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.init.Blocks;
import net.minecraft.util.text.Style;
import net.minecraft.util.text.TextComponentString;

View File

@ -271,8 +271,11 @@ public final class ColorsComponent extends ResizableHudComponent {
}
@Override
public void mouseClickMove(int mouseX, int mouseY, int button) {
super.mouseClickMove(mouseX, mouseY, button);
public void mouseClick(int mouseX, int mouseY, int button) {
final boolean insideDragZone = mouseY <= this.getY() + TITLE_BAR_HEIGHT + BORDER || mouseY >= ((this.getY() + this.getH()) - CLICK_ZONE);
if (insideDragZone) {
super.mouseClick(mouseX, mouseY, button);
}
}
@Override

View File

@ -165,8 +165,11 @@ public final class HubComponent extends ResizableHudComponent {
}
@Override
public void mouseClickMove(int mouseX, int mouseY, int button) {
super.mouseClickMove(mouseX, mouseY, button);
public void mouseClick(int mouseX, int mouseY, int button) {
final boolean insideDragZone = mouseY <= this.getY() + TITLE_BAR_HEIGHT + BORDER || mouseY >= ((this.getY() + this.getH()) - CLICK_ZONE);
if (insideDragZone) {
super.mouseClick(mouseX, mouseY, button);
}
}
private void clampScroll() {

View File

@ -295,10 +295,13 @@ public final class ModuleListComponent extends ResizableHudComponent {
@Override
public void mouseClick(int mouseX, int mouseY, int button) {
super.mouseClick(mouseX, mouseY, button);
if (this.currentSettings != null) {
this.currentSettings.mouseClick(mouseX, mouseY, button);
final boolean insideDragZone = mouseY <= this.getY() + TITLE_BAR_HEIGHT + BORDER || mouseY >= ((this.getY() + this.getH()) - CLICK_ZONE);
if (insideDragZone) {
super.mouseClick(mouseX, mouseY, button);
} else {
if (this.currentSettings != null) {
this.currentSettings.mouseClick(mouseX, mouseY, button);
}
}
}
@ -513,7 +516,7 @@ public final class ModuleListComponent extends ResizableHudComponent {
};
components.add(valueButton);
} else if (value.getValue() instanceof Number) {
TextComponent valueNumberText = new TextComponent(value.getName(), value.getValue().toString(), true);
/*TextComponent valueNumberText = new TextComponent(value.getName(), value.getValue().toString(), true);
valueNumberText.setTooltipText(value.getDesc() + " " + ChatFormatting.GRAY + "(" + value.getMin() + " - " + value.getMax() + ")");
valueNumberText.returnListener = new ComponentListener() {
@Override
@ -537,11 +540,12 @@ public final class ModuleListComponent extends ResizableHudComponent {
}
};
components.add(valueNumberText);
this.addComponentToButtons(valueNumberText);
this.addComponentToButtons(valueNumberText);*/
//TODO: after v3.1
//SliderComponent sliderComponent = new SliderComponent(value.getName(), value);
//sliderComponent.setTooltipText(value.getDesc() + " " + ChatFormatting.GRAY + "(" + value.getMin() + " - " + value.getMax() + ")");
//components.add(sliderComponent);
SliderComponent sliderComponent = new SliderComponent(value.getName(), value);
sliderComponent.setTooltipText(value.getDesc() + " " + ChatFormatting.GRAY + "(" + value.getMin() + " - " + value.getMax() + ")");
components.add(sliderComponent);
this.addComponentToButtons(sliderComponent);
} else if (value.getValue() instanceof Enum) {
final Enum val = (Enum) value.getValue();
final StringBuilder options = new StringBuilder();
@ -607,13 +611,13 @@ public final class ModuleListComponent extends ResizableHudComponent {
for (HudComponent component : this.components) {
int offsetX = 0;
if (component instanceof TextComponent) {
if (component instanceof SliderComponent || component instanceof TextComponent) {
boolean skipRendering = false;
for (HudComponent otherComponent : this.components) {
if (otherComponent instanceof ButtonComponent) {
boolean isChildComponent = component.getName().toLowerCase().startsWith(otherComponent.getName().toLowerCase());
if (isChildComponent) {
if (!((ButtonComponent) otherComponent).rightClickEnabled && !component.getName().equals("List Color")/* don't listen for module display-color components */) {
if (!((ButtonComponent) otherComponent).rightClickEnabled) {
skipRendering = true;
}
@ -649,6 +653,13 @@ public final class ModuleListComponent extends ResizableHudComponent {
}
}
@Override
public void mouseClickMove(int mouseX, int mouseY, int button) {
super.mouseClickMove(mouseX, mouseY, button);
for (HudComponent component : this.components) {
component.mouseClickMove(mouseX, mouseY, button);
}
}
@Override
public void mouseRelease(int mouseX, int mouseY, int button) {
@ -670,7 +681,7 @@ public final class ModuleListComponent extends ResizableHudComponent {
for (HudComponent component : this.components) {
if (component instanceof ButtonComponent) {
boolean similarName = hudComponent.getName().toLowerCase().startsWith(component.getName().toLowerCase());
if (similarName && !hudComponent.getName().equals("List Color") /* don't listen for module display-color components */) {
if (similarName) {
if (((ButtonComponent) component).rightClickListener == null) {
((ButtonComponent) component).rightClickListener = new ComponentListener() {
@Override

View File

@ -43,9 +43,9 @@ import java.util.concurrent.CopyOnWriteArrayList;
public final class CrystalAuraModule extends Module {
public final Value<Float> range = new Value<Float>("Range", new String[]{"Dist"}, "The minimum range to attack crystals.", 4.0f, 0.0f, 7.0f, 0.1f);
public final Value<Float> attackDelay = new Value<Float>("Attack_Delay", new String[]{"AttackDelay", "AttackDel", "Del"}, "The delay to attack in milliseconds.", 50.0f, 0.0f, 1000.0f, 1.0f);
public final Value<Float> attackDelay = new Value<Float>("Attack_Delay", new String[]{"AttackDelay", "AttackDel", "Del"}, "The delay to attack in milliseconds.", 50.0f, 0.0f, 500.0f, 1.0f);
public final Value<Boolean> place = new Value<Boolean>("Place", new String[]{"AutoPlace"}, "Automatically place crystals.", true);
public final Value<Float> placeDelay = new Value<Float>("Place_Delay", new String[]{"PlaceDelay", "PlaceDel"}, "The delay to place crystals.", 50.0f, 0.0f, 1000.0f, 1.0f);
public final Value<Float> placeDelay = new Value<Float>("Place_Delay", new String[]{"PlaceDelay", "PlaceDel"}, "The delay to place crystals.", 50.0f, 0.0f, 500.0f, 1.0f);
public final Value<Float> minDamage = new Value<Float>("Min_Damage", new String[]{"MinDamage", "Min", "MinDmg"}, "The minimum explosion damage calculated to place down a crystal.", 1.5f, 0.0f, 20.0f, 0.5f);
public final Value<Boolean> ignore = new Value<Boolean>("Ignore", new String[]{"Ig"}, "Ignore self damage checks.", false);
public final Value<Boolean> render = new Value<Boolean>("Render", new String[]{"R"}, "Draws information about recently placed crystals from your player.", true);

View File

@ -46,7 +46,7 @@ public final class NoCrystalModule extends Module {
public final Value<Boolean> extended = new Value<Boolean>("Extended", new String[]{"extend", "e", "big"}, "Enlarges the size of the fortress.", false);
public final Value<Boolean> disable = new Value<Boolean>("Disable", new String[]{"dis", "autodisable", "autodis", "d"}, "Automatically disable after obsidian is placed.", false);
public final Value<Boolean> sneak = new Value<Boolean>("PlaceOnSneak", new String[]{"sneak", "s", "pos", "sneakPlace"}, "When true, NoCrystal will only place while the player is sneaking.", false);
public final Value<Float> placeDelay = new Value<Float>("Delay", new String[]{"PlaceDelay", "PlaceDel"}, "The delay between obsidian blocks being placed.", 100.0f, 0.0f, 1000.0f, 1.0f);
public final Value<Float> placeDelay = new Value<Float>("Delay", new String[]{"PlaceDelay", "PlaceDel"}, "The delay between obsidian blocks being placed.", 100.0f, 0.0f, 500.0f, 1.0f);
private final Timer placeTimer = new Timer();

View File

@ -23,7 +23,7 @@ public final class AutoCraftModule extends Module {
public final Value<Boolean> drop = new Value<>("Drop", new String[]{"d"}, "Automatically drop the crafted item.", false);
public final Value<String> recipe = new Value<>("Recipe", new String[]{"Recipes", "Rec", "Rec"}, "The recipe name of what you want to craft.", "");
public final Value<Float> delay = new Value<>("Delay", new String[]{"Del"}, "The crafting delay in milliseconds.", 50.0f, 0.0f, 1000.0f, 1.0f);
public final Value<Float> delay = new Value<>("Delay", new String[]{"Del"}, "The crafting delay in milliseconds.", 50.0f, 0.0f, 500.0f, 1.0f);
private final Timer timer = new Timer();

View File

@ -28,8 +28,8 @@ import team.stiff.pomelo.impl.annotated.handler.annotation.Listener;
*/
public final class AutoMountModule extends Module {
public final Value<Float> range = new Value<>("Range", new String[]{"Dist"}, "The minimum range to begin scanning for mounts.", 4.5f, 0.0f, 5.0f, 0.1f);
public final Value<Float> delay = new Value<>("Delay", new String[]{"del"}, "The delay(ms) between mounts.", 5.0f, 0.0f, 1000.0f, 1f);
public final Value<Float> range = new Value<>("Range", new String[]{"Dist"}, "The minimum range to begin scanning for mounts.", 4.0f, 0.1f, 5.0f, 0.1f);
public final Value<Float> delay = new Value<>("Delay", new String[]{"del"}, "The delay(ms) between mounts.", 250.0f, 0.0f, 1000.0f, 1f);
public final Value<Boolean> autoChest = new Value<Boolean>("AutoChest", new String[]{"Chest"}, "Tries to place a chest onto the donkey or llama before mounting (hold a chest for this to work).", false);
public final Value<Boolean> forceStand = new Value<Boolean>("ForceStand", new String[]{"Stand", "NoSneak"}, "Forces the player to stand (un-sneak) before sending the packet to ride the entity.", true);
public final Value<Boolean> boat = new Value<Boolean>("Boat", new String[]{"Boat"}, "Enables auto-mounting onto boats.", true);

View File

@ -38,7 +38,7 @@ public final class ElytraFlyModule extends Module {
public final Value<Float> speed = new Value<Float>("Speed", new String[]{"Spd", "amount", "s"}, "Speed multiplier for elytra flight, higher values equals more speed.", 1.0f, 0.0f, 5.0f, 0.01f);
public final Value<Boolean> autoStart = new Value<Boolean>("AutoStart", new String[]{"AutoStart", "start", "autojump", "as"}, "Hold down the jump key to have an easy automated lift off.", true);
public final Value<Float> autoStartDelay = new Value<Float>("StartDelay", new String[]{"AutoStartDelay", "startdelay", "autojumpdelay", "asd"}, "Delay(ms) between auto-start attempts.", 20.0f, 0.0f, 1000.0f, 5.0f);
public final Value<Float> autoStartDelay = new Value<Float>("StartDelay", new String[]{"AutoStartDelay", "startdelay", "autojumpdelay", "asd"}, "Delay(ms) between auto-start attempts.", 20.0f, 0.0f, 200.0f, 5.0f);
public final Value<Boolean> autoEquip = new Value<Boolean>("AutoEquip", new String[]{"AutoEquipt", "AutoElytra", "Equip", "Equipt", "ae"}, "Automatically equips a durable elytra before or during flight. (inventory only, not hotbar!)", false);
public final Value<Float> autoEquipDelay = new Value<Float>("EquipDelay", new String[]{"AutoEquipDelay", "AutoEquiptDelay", "equipdelay", "aed"}, "Delay(ms) between elytra equip swap attempts.", 200.0f, 0.0f, 1000.0f, 10.0f);
public final Value<Boolean> stayAirborne = new Value<Boolean>("StayAirborne", new String[]{"Airborne", "StayInAir", "air", "sa"}, "Attempts to always keep the player airborne (only use when AutoEquip is enabled).", false);

View File

@ -25,8 +25,8 @@ public final class BlockHighlightModule extends Module {
public final Value<Mode> mode = new Value<Mode>("Mode", new String[]{"M", "type", "t"}, "Select which mode to draw the highlight visual.", Mode.BOX);
public final Value<Color> color = new Value<Color>("Color", new String[]{"Col", "c"}, "Edit the block highlight color.", new Color(255, 255, 255));
public final Value<Integer> alpha = new Value<Integer>("Alpha", new String[]{"Alp", "Opacity", "a", "o"}, "Alpha value for the highlight visual.", 127, 0, 255, 1);
public final Value<Float> width = new Value<Float>("Width", new String[]{"W", "size", "s"}, "Width value of the highlight visual.", 1.5f, 0.0f, 5.0f, 0.1f);
public final Value<Integer> alpha = new Value<Integer>("Alpha", new String[]{"Alp", "Opacity", "a", "o"}, "Alpha value for the highlight visual.", 127, 1, 255, 1);
public final Value<Float> width = new Value<Float>("Width", new String[]{"W", "size", "s"}, "Width value of the highlight visual.", 1.5f, 0.1f, 5.0f, 0.1f);
public final Value<Boolean> breaking = new Value<Boolean>("Breaking", new String[]{"Break", "block", "brk"}, "Sizes the highlight visual based on the block breaking damage.", false);
public enum Mode {

View File

@ -16,10 +16,10 @@ import java.awt.*;
public final class CrosshairModule extends Module {
public final Value<Float> size = new Value<Float>("Size", new String[]{"chsize", "CrosshairSize", "CrosshairScale", "size", "scale", "crosssize", "cs"}, "The size of the crosshair in pixels.", 5.0f, 0.0f, 15.0f, 0.1f);
public final Value<Float> size = new Value<Float>("Size", new String[]{"chsize", "CrosshairSize", "CrosshairScale", "size", "scale", "crosssize", "cs"}, "The size of the crosshair in pixels.", 5.0f, 0.1f, 15.0f, 0.1f);
public final Value<Boolean> outline = new Value<Boolean>("Outline", new String[]{"choutline", "CrosshairOutline", "CrosshairBackground", "CrosshairBg", "outline", "out", "chout", "chbg", "crossbg", "bg"}, "Enable or disable the crosshair background/outline.", true);
public final Value<Color> color = new Value<Color>("Color", new String[]{"color", "c"}, "Change the color of the cross-hair.", new Color(255, 255, 255));
public final Value<Integer> alpha = new Value<Integer>("Alpha", new String[]{"chalpha", "CrosshairAlpha", "alpha", "ca", "cha"}, "The alpha RGBA value of the crosshair.", 255, 0, 255, 1);
public final Value<Integer> alpha = new Value<Integer>("Alpha", new String[]{"chalpha", "CrosshairAlpha", "alpha", "ca", "cha"}, "The alpha RGBA value of the crosshair.", 255, 1, 255, 1);
private int CROSSHAIR_COLOR = 0xFFFFFFFF;
private int CROSSHAIR_OUTLINE_COLOR = 0xFF000000;

View File

@ -27,8 +27,8 @@ public final class NewChunksModule extends Module {
public final Value<Mode> mode = new Value<Mode>("Mode", new String[]{"M", "type", "t"}, "Select a mode to use to draw the chunk visual.", Mode.BOX);
public final Value<Color> color = new Value<Color>("Color", new String[]{"color", "c"}, "Change the color of the chunk visual.", new Color(255, 255, 255));
public final Value<Integer> alpha = new Value<Integer>("Alpha", new String[]{"Alp", "Opacity", "a", "o"}, "Edit the alpha of the chunk visual.", 127, 0, 255, 1);
public final Value<Float> width = new Value<Float>("Width", new String[]{"W", "size", "s"}, "Edit the width chunk visual.", 1.5f, 0.0f, 5.0f, 0.1f);
public final Value<Integer> alpha = new Value<Integer>("Alpha", new String[]{"Alp", "Opacity", "a", "o"}, "Edit the alpha of the chunk visual.", 127, 1, 255, 1);
public final Value<Float> width = new Value<Float>("Width", new String[]{"W", "size", "s"}, "Edit the width chunk visual.", 1.5f, 0.1f, 5.0f, 0.1f);
public enum Mode {
BOX, OUTLINE, PLANE

View File

@ -48,12 +48,12 @@ public final class PortalFinderModule extends Module {
public final Value<Integer> removeDistance = new Value<Integer>("Remove Distance", new String[]{"RemoveDistance", "RD", "RemoveRange"}, "Minimum distance in blocks the player must be from a portal for it to stop being drawn.", 200, 1, 2000, 1);
public final Value<Boolean> showInfo = new Value<Boolean>("Info", new String[]{"SI", "DrawInfo", "DrawText"}, "Draws information about the portal at it's location.", true);
public final Value<Float> infoScale = new Value<Float>("Info Scale", new String[]{"InfoScale", "IS", "Scale", "TextScale"}, "Scale of the text size on the drawn information.", 1.0f, 0.0f, 3.0f, 0.25f);
public final Value<Float> infoScale = new Value<Float>("Info Scale", new String[]{"InfoScale", "IS", "Scale", "TextScale"}, "Scale of the text size on the drawn information.", 1.0f, 0.1f, 3.0f, 0.25f);
public final Value<Boolean> tracer = new Value<Boolean>("Tracer", new String[]{"TracerLine", "trace", "line"}, "Display a tracer line to each found portal.", true);
public final Value<Color> color = new Value<Color>("Tracer Color", new String[]{"TracerColor", "Color", "c"}, "Edit the portal tracer color.", new Color(255, 255, 255));
public final Value<Float> width = new Value<Float>("Tracer Width", new String[]{"TracerWidth", "W", "Width"}, "Width of each line that is drawn to indicate a portal's location.", 0.5f, 0.0f, 5.0f, 0.1f);
public final Value<Integer> alpha = new Value<Integer>("Tracer Alpha", new String[]{"TracerAlpha", "A", "Opacity", "Op"}, "Alpha value for each drawn line.", 255, 0, 255, 1);
public final Value<Float> width = new Value<Float>("Tracer Width", new String[]{"TracerWidth", "W", "Width"}, "Width of each line that is drawn to indicate a portal's location.", 0.5f, 0.1f, 5.0f, 0.1f);
public final Value<Integer> alpha = new Value<Integer>("Tracer Alpha", new String[]{"TracerAlpha", "A", "Opacity", "Op"}, "Alpha value for each drawn line.", 255, 1, 255, 1);
private final List<Vec3d> portals = new CopyOnWriteArrayList<>();

View File

@ -45,9 +45,9 @@ public final class ProjectilesModule extends Module {
private final Queue<Vec3d> flightPoint = new ConcurrentLinkedQueue<>();
public final Value<Float> width = new Value<Float>("Width", new String[]{"W", "Width"}, "Pixel width of the projectile path.", 1.0f, 0.0f, 5.0f, 0.1f);
public final Value<Float> width = new Value<Float>("Width", new String[]{"W", "Width"}, "Pixel width of the projectile path.", 1.0f, 0.1f, 5.0f, 0.1f);
public final Value<Color> color = new Value<Color>("Path Color", new String[]{"pathcolor", "color", "c", "pc"}, "Change the color of the predicted path.", new Color(255, 255, 255));
public final Value<Integer> alpha = new Value<Integer>("Path Alpha", new String[]{"pathalpha", "opacity", "a", "o", "pa", "po"}, "Alpha value for the predicted path.", 255, 0, 255, 1);
public final Value<Integer> alpha = new Value<Integer>("Path Alpha", new String[]{"pathalpha", "opacity", "a", "o", "pa", "po"}, "Alpha value for the predicted path.", 255, 1, 255, 1);
public ProjectilesModule() {
super("Projectiles", new String[]{"Proj"}, "Projects the possible path of an entity that was fired.", "NONE", -1, ModuleType.RENDER);

View File

@ -34,10 +34,10 @@ import java.util.List;
public final class SearchModule extends Module {
public final Value<Mode> mode = new Value<Mode>("Mode", new String[]{"M", "type", "t"}, "Select which mode to draw the search visual.", Mode.OUTLINE);
public final Value<Integer> range = new Value<Integer>("Range", new String[]{"radius"}, "The range(m) to render search blocks.", 128, 0, 512, 1);
public final Value<Integer> limit = new Value<Integer>("Limit", new String[]{"max"}, "The maximum amount of blocks that can be rendered.", 3000, 0, 9000, 1);
public final Value<Integer> alpha = new Value<Integer>("Alpha", new String[]{"opacity"}, "Alpha value for the search bounding box.", 127, 0, 255, 1);
public final Value<Float> width = new Value<Float>("Width", new String[]{"size"}, "Line width of the search bounding box.", 1.0f, 0.0f, 5.0f, 0.1f);
public final Value<Integer> range = new Value<Integer>("Range", new String[]{"radius"}, "The range(m) to render search blocks.", 128, 1, 512, 1);
public final Value<Integer> limit = new Value<Integer>("Limit", new String[]{"max"}, "The maximum amount of blocks that can be rendered.", 3000, 1, 9000, 1);
public final Value<Integer> alpha = new Value<Integer>("Alpha", new String[]{"opacity"}, "Alpha value for the search bounding box.", 127, 1, 255, 1);
public final Value<Float> width = new Value<Float>("Width", new String[]{"size"}, "Line width of the search bounding box.", 1.0f, 0.1f, 5.0f, 0.1f);
public final Value<Boolean> tracer = new Value<Boolean>("Tracer", new String[]{"trace", "line"}, "Draw a tracer line to each search result.", false);
public enum Mode {

View File

@ -26,7 +26,7 @@ public final class WaypointsModule extends Module {
public final Value<Boolean> tracers = new Value<Boolean>("Tracers", new String[]{"Tracer", "Trace"}, "Draws a line from the center of the screen to each waypoint.", false);
public final Value<Boolean> death = new Value<Boolean>("Death", new String[]{"deathpoint", "d"}, "Creates a waypoint on death.", true);
public final Value<Float> width = new Value<Float>("Width", new String[]{"Wid"}, "Pixel width of each tracer line.", 0.5f, 0.0f, 5.0f, 0.1f);
public final Value<Float> width = new Value<Float>("Width", new String[]{"Wid"}, "Pixel width of each tracer line.", 0.5f, 0.1f, 5.0f, 0.1f);
public WaypointsModule() {
super("Waypoints", new String[]{"Wp", "Waypoint"}, "Highlights waypoints", "NONE", -1, ModuleType.WORLD);