update to devbuild 1520 (fixes #130)
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -10,8 +10,6 @@ classes/
|
|||||||
*.launch
|
*.launch
|
||||||
|
|
||||||
# idea
|
# idea
|
||||||
|
|
||||||
.idea/
|
|
||||||
*.iml
|
*.iml
|
||||||
*.ipr
|
*.ipr
|
||||||
*.iws
|
*.iws
|
||||||
|
|||||||
3
.idea/.gitignore
generated
vendored
Normal file
3
.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
6
.idea/compiler.xml
generated
Normal file
6
.idea/compiler.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="CompilerConfiguration">
|
||||||
|
<bytecodeTargetLevel target="17" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
19
.idea/gradle.xml
generated
Normal file
19
.idea/gradle.xml
generated
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||||
|
<component name="GradleSettings">
|
||||||
|
<option name="linkedExternalProjectsSettings">
|
||||||
|
<GradleProjectSettings>
|
||||||
|
<option name="delegatedBuild" value="true" />
|
||||||
|
<option name="testRunner" value="GRADLE" />
|
||||||
|
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||||
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
|
<option name="modules">
|
||||||
|
<set>
|
||||||
|
<option value="$PROJECT_DIR$" />
|
||||||
|
</set>
|
||||||
|
</option>
|
||||||
|
</GradleProjectSettings>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
65
.idea/jarRepositories.xml
generated
Normal file
65
.idea/jarRepositories.xml
generated
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="RemoteRepositoriesConfiguration">
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="central" />
|
||||||
|
<option name="name" value="Maven Central repository" />
|
||||||
|
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="jboss.community" />
|
||||||
|
<option name="name" value="JBoss Community repository" />
|
||||||
|
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="maven3" />
|
||||||
|
<option name="name" value="maven3" />
|
||||||
|
<option name="url" value="https://maven.seedfinding.com/" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="MavenRepo" />
|
||||||
|
<option name="name" value="MavenRepo" />
|
||||||
|
<option name="url" value="https://repo.maven.apache.org/maven2/" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="maven4" />
|
||||||
|
<option name="name" value="maven4" />
|
||||||
|
<option name="url" value="https://maven-snapshots.seedfinding.com/" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="UserLocalRemappedMods" />
|
||||||
|
<option name="name" value="UserLocalRemappedMods" />
|
||||||
|
<option name="url" value="file:/$PROJECT_DIR$/.gradle/loom-cache/remapped_mods/" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="MavenLocal" />
|
||||||
|
<option name="name" value="MavenLocal" />
|
||||||
|
<option name="url" value="file:/$MAVEN_REPOSITORY$/" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="Fabric" />
|
||||||
|
<option name="name" value="Fabric" />
|
||||||
|
<option name="url" value="https://maven.fabricmc.net/" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="maven2" />
|
||||||
|
<option name="name" value="maven2" />
|
||||||
|
<option name="url" value="https://maven.meteordev.org/snapshots" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="Mojang" />
|
||||||
|
<option name="name" value="Mojang" />
|
||||||
|
<option name="url" value="https://libraries.minecraft.net/" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="maven5" />
|
||||||
|
<option name="name" value="maven5" />
|
||||||
|
<option name="url" value="https://jitpack.io" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="maven" />
|
||||||
|
<option name="name" value="maven" />
|
||||||
|
<option name="url" value="https://maven.meteordev.org/releases" />
|
||||||
|
</remote-repository>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
5
.idea/misc.xml
generated
Normal file
5
.idea/misc.xml
generated
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="azul-17" project-jdk-type="JavaSDK" />
|
||||||
|
</project>
|
||||||
10
.idea/runConfigurations.xml
generated
Normal file
10
.idea/runConfigurations.xml
generated
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="RunConfigurationProducerService">
|
||||||
|
<option name="ignoredProducers">
|
||||||
|
<set>
|
||||||
|
<option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
|
||||||
|
</set>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
12
.idea/runConfigurations/Minecraft_Client.xml
generated
Normal file
12
.idea/runConfigurations/Minecraft_Client.xml
generated
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="Minecraft Client" type="Application" factoryName="Application">
|
||||||
|
<option name="MAIN_CLASS_NAME" value="net.fabricmc.devlaunchinjector.Main" />
|
||||||
|
<module name="meteor-rejects.main" />
|
||||||
|
<option name="PROGRAM_PARAMETERS" value="" />
|
||||||
|
<option name="VM_PARAMETERS" value="-Dfabric.dli.config=C:\Users\Cloudburst\Desktop\meteor-rejects\.gradle\loom-cache\launch.cfg -Dfabric.dli.env=client -Dfabric.dli.main=net.fabricmc.loader.impl.launch.knot.KnotClient" />
|
||||||
|
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/run/" />
|
||||||
|
<method v="2">
|
||||||
|
<option name="Make" enabled="true" />
|
||||||
|
</method>
|
||||||
|
</configuration>
|
||||||
|
</component>
|
||||||
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
@@ -96,7 +96,6 @@
|
|||||||
- "Meteor Rounded" theme (Taken from an [unmerged PR](https://github.com/MeteorDevelopment/meteor-client/pull/619))
|
- "Meteor Rounded" theme (Taken from an [unmerged PR](https://github.com/MeteorDevelopment/meteor-client/pull/619))
|
||||||
|
|
||||||
## HUD
|
## HUD
|
||||||
- Baritone process HUD
|
|
||||||
- Radar HUD
|
- Radar HUD
|
||||||
|
|
||||||
## Config
|
## Config
|
||||||
|
|||||||
@@ -13,7 +13,8 @@ import meteordevelopment.meteorclient.MeteorClient;
|
|||||||
import meteordevelopment.meteorclient.gui.GuiThemes;
|
import meteordevelopment.meteorclient.gui.GuiThemes;
|
||||||
import meteordevelopment.meteorclient.systems.Systems;
|
import meteordevelopment.meteorclient.systems.Systems;
|
||||||
import meteordevelopment.meteorclient.systems.commands.Commands;
|
import meteordevelopment.meteorclient.systems.commands.Commands;
|
||||||
import meteordevelopment.meteorclient.systems.hud.HUD;
|
import meteordevelopment.meteorclient.systems.hud.Hud;
|
||||||
|
import meteordevelopment.meteorclient.systems.hud.HudGroup;
|
||||||
import meteordevelopment.meteorclient.systems.modules.Category;
|
import meteordevelopment.meteorclient.systems.modules.Category;
|
||||||
import meteordevelopment.meteorclient.systems.modules.Modules;
|
import meteordevelopment.meteorclient.systems.modules.Modules;
|
||||||
import net.fabricmc.loader.api.FabricLoader;
|
import net.fabricmc.loader.api.FabricLoader;
|
||||||
@@ -27,6 +28,7 @@ import java.lang.invoke.MethodHandles;
|
|||||||
public class MeteorRejectsAddon extends MeteorAddon {
|
public class MeteorRejectsAddon extends MeteorAddon {
|
||||||
public static final Logger LOG = LoggerFactory.getLogger("Rejects");
|
public static final Logger LOG = LoggerFactory.getLogger("Rejects");
|
||||||
public static final Category CATEGORY = new Category("Rejects", Items.BARRIER.getDefaultStack());
|
public static final Category CATEGORY = new Category("Rejects", Items.BARRIER.getDefaultStack());
|
||||||
|
public static final HudGroup HUD_GROUP = new HudGroup("Rejects");
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onInitialize() {
|
public void onInitialize() {
|
||||||
@@ -94,9 +96,8 @@ public class MeteorRejectsAddon extends MeteorAddon {
|
|||||||
commands.add(new TerrainExport());
|
commands.add(new TerrainExport());
|
||||||
|
|
||||||
// HUD
|
// HUD
|
||||||
HUD hud = Systems.get(HUD.class);
|
Hud hud = Systems.get(Hud.class);
|
||||||
hud.elements.add(new BaritoneHud(hud));
|
hud.register(RadarHud.INFO);
|
||||||
hud.elements.add(new RadarHud(hud));
|
|
||||||
|
|
||||||
// Themes
|
// Themes
|
||||||
GuiThemes.add(new MeteorRoundedGuiTheme());
|
GuiThemes.add(new MeteorRoundedGuiTheme());
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
package anticope.rejects.gui.hud;
|
|
||||||
|
|
||||||
import baritone.api.BaritoneAPI;
|
|
||||||
import baritone.api.process.IBaritoneProcess;
|
|
||||||
import meteordevelopment.meteorclient.systems.hud.HUD;
|
|
||||||
import meteordevelopment.meteorclient.systems.hud.modules.DoubleTextHudElement;
|
|
||||||
|
|
||||||
public class BaritoneHud extends DoubleTextHudElement {
|
|
||||||
public BaritoneHud(HUD hud) {
|
|
||||||
super(hud, "Baritone", "Displays what baritone is doing.", "Baritone: ");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected String getRight() {
|
|
||||||
IBaritoneProcess process = BaritoneAPI.getProvider().getPrimaryBaritone().getPathingControlManager().mostRecentInControl().orElse(null);
|
|
||||||
|
|
||||||
if (process == null) return "-";
|
|
||||||
|
|
||||||
return process.displayName();
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -2,11 +2,13 @@ package anticope.rejects.gui.hud;
|
|||||||
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
|
import anticope.rejects.MeteorRejectsAddon;
|
||||||
|
import meteordevelopment.meteorclient.systems.hud.Hud;
|
||||||
|
import meteordevelopment.meteorclient.systems.hud.HudElementInfo;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityType;
|
import net.minecraft.entity.EntityType;
|
||||||
import net.minecraft.util.math.Vec3d;
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
|
||||||
import anticope.rejects.MeteorRejectsAddon;
|
|
||||||
import it.unimi.dsi.fastutil.objects.Object2BooleanMap;
|
import it.unimi.dsi.fastutil.objects.Object2BooleanMap;
|
||||||
import meteordevelopment.meteorclient.renderer.Renderer2D;
|
import meteordevelopment.meteorclient.renderer.Renderer2D;
|
||||||
import meteordevelopment.meteorclient.settings.BoolSetting;
|
import meteordevelopment.meteorclient.settings.BoolSetting;
|
||||||
@@ -15,9 +17,8 @@ import meteordevelopment.meteorclient.settings.DoubleSetting;
|
|||||||
import meteordevelopment.meteorclient.settings.EntityTypeListSetting;
|
import meteordevelopment.meteorclient.settings.EntityTypeListSetting;
|
||||||
import meteordevelopment.meteorclient.settings.Setting;
|
import meteordevelopment.meteorclient.settings.Setting;
|
||||||
import meteordevelopment.meteorclient.settings.SettingGroup;
|
import meteordevelopment.meteorclient.settings.SettingGroup;
|
||||||
import meteordevelopment.meteorclient.systems.hud.HUD;
|
|
||||||
import meteordevelopment.meteorclient.systems.hud.HudRenderer;
|
import meteordevelopment.meteorclient.systems.hud.HudRenderer;
|
||||||
import meteordevelopment.meteorclient.systems.hud.modules.HudElement;
|
import meteordevelopment.meteorclient.systems.hud.HudElement;
|
||||||
import meteordevelopment.meteorclient.systems.modules.Modules;
|
import meteordevelopment.meteorclient.systems.modules.Modules;
|
||||||
import meteordevelopment.meteorclient.systems.modules.render.ESP;
|
import meteordevelopment.meteorclient.systems.modules.render.ESP;
|
||||||
import meteordevelopment.meteorclient.systems.waypoints.Waypoint;
|
import meteordevelopment.meteorclient.systems.waypoints.Waypoint;
|
||||||
@@ -25,23 +26,26 @@ import meteordevelopment.meteorclient.systems.waypoints.Waypoints;
|
|||||||
import meteordevelopment.meteorclient.utils.misc.Vec3;
|
import meteordevelopment.meteorclient.utils.misc.Vec3;
|
||||||
import meteordevelopment.meteorclient.utils.render.color.SettingColor;
|
import meteordevelopment.meteorclient.utils.render.color.SettingColor;
|
||||||
|
|
||||||
|
import static meteordevelopment.meteorclient.MeteorClient.mc;
|
||||||
|
|
||||||
public class RadarHud extends HudElement {
|
public class RadarHud extends HudElement {
|
||||||
|
public static final HudElementInfo<RadarHud> INFO = new HudElementInfo<>(MeteorRejectsAddon.HUD_GROUP, "radar", "Draws a Radar on your HUD telling you where entities are.", RadarHud::new);
|
||||||
|
|
||||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||||
|
|
||||||
private final Setting<SettingColor> backgroundColor = sgGeneral.add(new ColorSetting.Builder()
|
private final Setting<SettingColor> backgroundColor = sgGeneral.add(new ColorSetting.Builder()
|
||||||
.name("background-color")
|
.name("background-color")
|
||||||
.description("Color of background.")
|
.description("Color of background.")
|
||||||
.defaultValue(new SettingColor(0, 0, 0, 64))
|
.defaultValue(new SettingColor(0, 0, 0, 64))
|
||||||
.build()
|
.build()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
private final Setting<Object2BooleanMap<EntityType<?>>> entities = sgGeneral.add(new EntityTypeListSetting.Builder()
|
private final Setting<Object2BooleanMap<EntityType<?>>> entities = sgGeneral.add(new EntityTypeListSetting.Builder()
|
||||||
.name("entities")
|
.name("entities")
|
||||||
.description("Select specific entities.")
|
.description("Select specific entities.")
|
||||||
.defaultValue(EntityType.PLAYER)
|
.defaultValue(EntityType.PLAYER)
|
||||||
.build()
|
.build()
|
||||||
);
|
);
|
||||||
|
|
||||||
private final Setting<Boolean> letters = sgGeneral.add(new BoolSetting.Builder()
|
private final Setting<Boolean> letters = sgGeneral.add(new BoolSetting.Builder()
|
||||||
@@ -59,11 +63,12 @@ public class RadarHud extends HudElement {
|
|||||||
);
|
);
|
||||||
|
|
||||||
private final Setting<Double> scale = sgGeneral.add(new DoubleSetting.Builder()
|
private final Setting<Double> scale = sgGeneral.add(new DoubleSetting.Builder()
|
||||||
.name("scale")
|
.name("scale")
|
||||||
.description("The scale.")
|
.description("The scale.")
|
||||||
.defaultValue(1)
|
.defaultValue(1)
|
||||||
.min(1)
|
.min(1)
|
||||||
.sliderRange(0.01, 5)
|
.sliderRange(0.01, 5)
|
||||||
|
.onChanged(aDouble -> calculateSize())
|
||||||
.build()
|
.build()
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -76,36 +81,36 @@ public class RadarHud extends HudElement {
|
|||||||
.build()
|
.build()
|
||||||
);
|
);
|
||||||
|
|
||||||
public RadarHud(HUD hud) {
|
public RadarHud() {
|
||||||
super(hud, "Radar", "Draws a Radar on your HUD telling you where entities are");
|
super(INFO);
|
||||||
|
calculateSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public void calculateSize() {
|
||||||
public void update(HudRenderer renderer) {
|
setSize(200 * scale.get(), 200 * scale.get());
|
||||||
box.setSize(100 * scale.get(), 100 * scale.get());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(HudRenderer renderer) {
|
public void render(HudRenderer renderer) {
|
||||||
ESP esp = Modules.get().get(ESP.class);
|
ESP esp = Modules.get().get(ESP.class);
|
||||||
if (esp == null) return;
|
if (esp == null) return;
|
||||||
renderer.addPostTask(() -> {
|
renderer.post(() -> {
|
||||||
double x = box.getX();
|
if (mc.player == null) return;
|
||||||
double y = box.getY();
|
double width = getWidth();
|
||||||
|
double height = getHeight();
|
||||||
Renderer2D.COLOR.begin();
|
Renderer2D.COLOR.begin();
|
||||||
Renderer2D.COLOR.quad(x, y, box.width, box.height, backgroundColor.get());
|
Renderer2D.COLOR.quad(x, y, width, height, backgroundColor.get());
|
||||||
Renderer2D.COLOR.render(null);
|
Renderer2D.COLOR.render(null);
|
||||||
if (mc.world != null) {
|
if (mc.world != null) {
|
||||||
for (Entity entity : mc.world.getEntities()) {
|
for (Entity entity : mc.world.getEntities()) {
|
||||||
if (!entities.get().getBoolean(entity.getType())) return;
|
if (!entities.get().getBoolean(entity.getType())) return;
|
||||||
double xPos = ((entity.getX() - mc.player.getX()) * scale.get() * zoom.get() + box.width/2);
|
double xPos = ((entity.getX() - mc.player.getX()) * scale.get() * zoom.get() + width/2);
|
||||||
double yPos = ((entity.getZ() - mc.player.getZ()) * scale.get() * zoom.get() + box.height/2);
|
double yPos = ((entity.getZ() - mc.player.getZ()) * scale.get() * zoom.get() + height/2);
|
||||||
if (xPos < 0 || yPos < 0 || xPos > box.width - scale.get() || yPos > box.height - scale.get()) continue;
|
if (xPos < 0 || yPos < 0 || xPos > width - scale.get() || yPos > height - scale.get()) continue;
|
||||||
String icon = "*";
|
String icon = "*";
|
||||||
if (letters.get())
|
if (letters.get())
|
||||||
icon = entity.getType().getUntranslatedName().substring(0,1).toUpperCase();
|
icon = entity.getType().getUntranslatedName().substring(0,1).toUpperCase();
|
||||||
renderer.text(icon, xPos + x, yPos + y, esp.getColor(entity));
|
renderer.text(icon, xPos + x, yPos + y, esp.getColor(entity), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (showWaypoints.get()) {
|
if (showWaypoints.get()) {
|
||||||
@@ -114,13 +119,13 @@ public class RadarHud extends HudElement {
|
|||||||
Waypoint waypoint = waypoints.next();
|
Waypoint waypoint = waypoints.next();
|
||||||
Vec3 c = waypoint.getCoords();
|
Vec3 c = waypoint.getCoords();
|
||||||
Vec3d coords = new Vec3d(c.x, c.y, c.z);
|
Vec3d coords = new Vec3d(c.x, c.y, c.z);
|
||||||
double xPos = ((coords.getX() - mc.player.getX()) * scale.get() * zoom.get() + box.width/2);
|
double xPos = ((coords.getX() - mc.player.getX()) * scale.get() * zoom.get() + width/2);
|
||||||
double yPos = ((coords.getZ() - mc.player.getZ()) * scale.get() * zoom.get() + box.height/2);
|
double yPos = ((coords.getZ() - mc.player.getZ()) * scale.get() * zoom.get() + height/2);
|
||||||
if (xPos < 0 || yPos < 0 || xPos > box.width - scale.get() || yPos > box.height - scale.get()) continue;
|
if (xPos < 0 || yPos < 0 || xPos > width - scale.get() || yPos > height - scale.get()) continue;
|
||||||
String icon = "*";
|
String icon = "*";
|
||||||
if (letters.get() && waypoint.name.length() > 0)
|
if (letters.get() && waypoint.name.length() > 0)
|
||||||
icon = waypoint.name.substring(0, 1);
|
icon = waypoint.name.substring(0, 1);
|
||||||
renderer.text(icon, xPos + x, yPos + y, waypoint.color);
|
renderer.text(icon, xPos + x, yPos + y, waypoint.color, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Renderer2D.COLOR.render(null);
|
Renderer2D.COLOR.render(null);
|
||||||
|
|||||||
@@ -91,9 +91,7 @@ public class InteractionScreen extends Screen {
|
|||||||
closeScreen();
|
closeScreen();
|
||||||
client.setScreen(new InventoryScreen((PlayerEntity) e));
|
client.setScreen(new InventoryScreen((PlayerEntity) e));
|
||||||
});
|
});
|
||||||
}
|
} else if (entity instanceof AbstractHorseEntity) {
|
||||||
|
|
||||||
else if (entity instanceof AbstractHorseEntity) {
|
|
||||||
functions.put("Open Inventory", (Entity e) -> {
|
functions.put("Open Inventory", (Entity e) -> {
|
||||||
closeScreen();
|
closeScreen();
|
||||||
if (client.player.isRiding()) {
|
if (client.player.isRiding()) {
|
||||||
@@ -102,14 +100,12 @@ public class InteractionScreen extends Screen {
|
|||||||
client.player.networkHandler.sendPacket(PlayerInteractEntityC2SPacket.interact(entity, true, Hand.MAIN_HAND));
|
client.player.networkHandler.sendPacket(PlayerInteractEntityC2SPacket.interact(entity, true, Hand.MAIN_HAND));
|
||||||
client.player.setSneaking(false);
|
client.player.setSneaking(false);
|
||||||
});
|
});
|
||||||
}
|
} else if (entity instanceof StorageMinecartEntity) {
|
||||||
else if (entity instanceof StorageMinecartEntity) {
|
|
||||||
functions.put("Open Inventory", (Entity e) -> {
|
functions.put("Open Inventory", (Entity e) -> {
|
||||||
closeScreen();
|
closeScreen();
|
||||||
client.player.networkHandler.sendPacket(PlayerInteractEntityC2SPacket.interact(entity, true, Hand.MAIN_HAND));
|
client.player.networkHandler.sendPacket(PlayerInteractEntityC2SPacket.interact(entity, true, Hand.MAIN_HAND));
|
||||||
});
|
});
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
functions.put("Open Inventory", (Entity e) -> {
|
functions.put("Open Inventory", (Entity e) -> {
|
||||||
closeScreen();
|
closeScreen();
|
||||||
ItemStack container = new ItemStack(Items.CHEST);
|
ItemStack container = new ItemStack(Items.CHEST);
|
||||||
@@ -128,13 +124,13 @@ public class InteractionScreen extends Screen {
|
|||||||
if (entity.isGlowing()) {
|
if (entity.isGlowing()) {
|
||||||
functions.put("Remove glow", (Entity e) -> {
|
functions.put("Remove glow", (Entity e) -> {
|
||||||
e.setGlowing(false);
|
e.setGlowing(false);
|
||||||
((EntityAccessor)e).invokeSetFlag(6, false);
|
((EntityAccessor) e).invokeSetFlag(6, false);
|
||||||
closeScreen();
|
closeScreen();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
functions.put("Glow", (Entity e) -> {
|
functions.put("Glow", (Entity e) -> {
|
||||||
e.setGlowing(true);
|
e.setGlowing(true);
|
||||||
((EntityAccessor)e).invokeSetFlag(6, true);
|
((EntityAccessor) e).invokeSetFlag(6, true);
|
||||||
closeScreen();
|
closeScreen();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -161,16 +157,17 @@ public class InteractionScreen extends Screen {
|
|||||||
}
|
}
|
||||||
var script = Compiler.compile(result);
|
var script = Compiler.compile(result);
|
||||||
try {
|
try {
|
||||||
client.setScreen(new ChatScreen(MeteorStarscript.ss.run(script)));
|
var section = MeteorStarscript.ss.run(script);
|
||||||
|
client.setScreen(new ChatScreen(section.text));
|
||||||
} catch (StarscriptError err) {
|
} catch (StarscriptError err) {
|
||||||
MeteorStarscript.printChatError(err);
|
MeteorStarscript.printChatError(err);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
functions.put("Cancel", (Entity e) -> {closeScreen();});
|
functions.put("Cancel", (Entity e) -> {
|
||||||
|
closeScreen();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private ItemStack[] getInventory(Entity e) {
|
private ItemStack[] getInventory(Entity e) {
|
||||||
@@ -178,31 +175,31 @@ public class InteractionScreen extends Screen {
|
|||||||
final int[] index = {0};
|
final int[] index = {0};
|
||||||
if (e instanceof EndermanEntity) {
|
if (e instanceof EndermanEntity) {
|
||||||
try {
|
try {
|
||||||
stack[index[0]] = ((EndermanEntity)e).getCarriedBlock().getBlock().asItem().getDefaultStack();
|
stack[index[0]] = ((EndermanEntity) e).getCarriedBlock().getBlock().asItem().getDefaultStack();
|
||||||
index[0]++;
|
index[0]++;
|
||||||
|
} catch (NullPointerException ex) {
|
||||||
}
|
}
|
||||||
catch (NullPointerException ex) {}
|
|
||||||
}
|
}
|
||||||
if (Saddleable.class.isInstance(e)) {
|
if (Saddleable.class.isInstance(e)) {
|
||||||
if (((Saddleable)e).isSaddled()){
|
if (((Saddleable) e).isSaddled()) {
|
||||||
stack[index[0]] = Items.SADDLE.getDefaultStack();
|
stack[index[0]] = Items.SADDLE.getDefaultStack();
|
||||||
index[0]++;
|
index[0]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
e.getItemsHand().forEach(itemStack -> {
|
e.getItemsHand().forEach(itemStack -> {
|
||||||
if (itemStack!=null) {
|
if (itemStack != null) {
|
||||||
stack[index[0]] = itemStack;
|
stack[index[0]] = itemStack;
|
||||||
index[0]++;
|
index[0]++;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
e.getArmorItems().forEach(itemStack -> {
|
e.getArmorItems().forEach(itemStack -> {
|
||||||
if (itemStack!=null) {
|
if (itemStack != null) {
|
||||||
stack[index[0]] = itemStack;
|
stack[index[0]] = itemStack;
|
||||||
index[0]++;
|
index[0]++;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
for (int i = index[0]; i < 27; i++) stack[i] = Items.AIR.getDefaultStack();
|
for (int i = index[0]; i < 27; i++) stack[i] = Items.AIR.getDefaultStack();
|
||||||
return stack;
|
return stack;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void init() {
|
public void init() {
|
||||||
@@ -214,8 +211,8 @@ public class InteractionScreen extends Screen {
|
|||||||
|
|
||||||
private void cursorMode(int mode) {
|
private void cursorMode(int mode) {
|
||||||
KeyBinding.unpressAll();
|
KeyBinding.unpressAll();
|
||||||
double x = (double)(this.client.getWindow().getWidth() / 2);
|
double x = (double) (this.client.getWindow().getWidth() / 2);
|
||||||
double y = (double)(this.client.getWindow().getHeight() / 2);
|
double y = (double) (this.client.getWindow().getHeight() / 2);
|
||||||
InputUtil.setCursorParameters(this.client.getWindow().getHandle(), mode, x, y);
|
InputUtil.setCursorParameters(this.client.getWindow().getHandle(), mode, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -253,7 +250,7 @@ public class InteractionScreen extends Screen {
|
|||||||
drawTexture(matrix, crosshairX - 8, crosshairY - 8, 0, 0, 15, 15);
|
drawTexture(matrix, crosshairX - 8, crosshairY - 8, 0, 0, 15, 15);
|
||||||
|
|
||||||
drawDots(matrix, (int) (Math.min(height, width) / 2 * 0.75), mouseX, mouseY);
|
drawDots(matrix, (int) (Math.min(height, width) / 2 * 0.75), mouseX, mouseY);
|
||||||
matrix.scale (2f, 2f, 1f);
|
matrix.scale(2f, 2f, 1f);
|
||||||
drawCenteredText(matrix, textRenderer, entity.getName(), width / 4, 6, 0xFFFFFFFF);
|
drawCenteredText(matrix, textRenderer, entity.getName(), width / 4, 6, 0xFFFFFFFF);
|
||||||
|
|
||||||
int scale = client.options.getGuiScale().getValue();
|
int scale = client.options.getGuiScale().getValue();
|
||||||
@@ -275,20 +272,19 @@ public class InteractionScreen extends Screen {
|
|||||||
this.crosshairX = (int) mouse.x + width / 2;
|
this.crosshairX = (int) mouse.x + width / 2;
|
||||||
this.crosshairY = (int) mouse.y + height / 2;
|
this.crosshairY = (int) mouse.y + height / 2;
|
||||||
|
|
||||||
client.player.setYaw( yaw + cross.x / 3);
|
client.player.setYaw(yaw + cross.x / 3);
|
||||||
client.player.setPitch(MathHelper.clamp(pitch + cross.y / 3, -90f, 90f));
|
client.player.setPitch(MathHelper.clamp(pitch + cross.y / 3, -90f, 90f));
|
||||||
super.render(matrix, mouseX, mouseY, delta);
|
super.render(matrix, mouseX, mouseY, delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void drawDots(MatrixStack matrix, int radius, int mouseX, int mouseY) {
|
private void drawDots(MatrixStack matrix, int radius, int mouseX, int mouseY) {
|
||||||
ArrayList<Point> pointList = new ArrayList<Point>();
|
ArrayList<Point> pointList = new ArrayList<Point>();
|
||||||
String cache[] = new String[functions.size()];
|
String cache[] = new String[functions.size()];
|
||||||
double lowestDistance = Double.MAX_VALUE;
|
double lowestDistance = Double.MAX_VALUE;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
for (String string: functions.keySet()) {
|
for (String string : functions.keySet()) {
|
||||||
// Just some fancy calculations to get the positions of the dots
|
// Just some fancy calculations to get the positions of the dots
|
||||||
double s = (double) i / functions.size() * 2 * Math.PI;
|
double s = (double) i / functions.size() * 2 * Math.PI;
|
||||||
int x = (int) Math.round(radius * Math.cos(s) + width / 2);
|
int x = (int) Math.round(radius * Math.cos(s) + width / 2);
|
||||||
@@ -312,13 +308,12 @@ public class InteractionScreen extends Screen {
|
|||||||
if (pointList.get(focusedDot) == point) {
|
if (pointList.get(focusedDot) == point) {
|
||||||
drawDot(matrix, point.x - 4, point.y - 4, selectedDotColor);
|
drawDot(matrix, point.x - 4, point.y - 4, selectedDotColor);
|
||||||
this.focusedString = cache[focusedDot];
|
this.focusedString = cache[focusedDot];
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
drawDot(matrix, point.x - 4, point.y - 4, dotColor);
|
drawDot(matrix, point.x - 4, point.y - 4, dotColor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void drawRect(MatrixStack matrix, int startX, int startY, int width, int height, int colorInner,int colorOuter) {
|
private void drawRect(MatrixStack matrix, int startX, int startY, int width, int height, int colorInner, int colorOuter) {
|
||||||
drawHorizontalLine(matrix, startX, startX + width, startY, colorOuter);
|
drawHorizontalLine(matrix, startX, startX + width, startY, colorOuter);
|
||||||
drawHorizontalLine(matrix, startX, startX + width, startY + height, colorOuter);
|
drawHorizontalLine(matrix, startX, startX + width, startY + height, colorOuter);
|
||||||
drawVerticalLine(matrix, startX, startY, startY + height, colorOuter);
|
drawVerticalLine(matrix, startX, startY, startY + height, colorOuter);
|
||||||
@@ -370,7 +365,7 @@ public class InteractionScreen extends Screen {
|
|||||||
class Vector2 {
|
class Vector2 {
|
||||||
float x, y;
|
float x, y;
|
||||||
|
|
||||||
Vector2 (float x, float y) {
|
Vector2(float x, float y) {
|
||||||
this.x = x;
|
this.x = x;
|
||||||
this.y = y;
|
this.y = y;
|
||||||
}
|
}
|
||||||
@@ -381,7 +376,7 @@ class Vector2 {
|
|||||||
divide(mag);
|
divide(mag);
|
||||||
}
|
}
|
||||||
|
|
||||||
void subtract (Vector2 vec) {
|
void subtract(Vector2 vec) {
|
||||||
this.x -= vec.x;
|
this.x -= vec.x;
|
||||||
this.y -= vec.y;
|
this.y -= vec.y;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ public class MeteorRoundedGuiTheme extends GuiTheme {
|
|||||||
private final SettingGroup sgSeparator = settings.createGroup("Separator");
|
private final SettingGroup sgSeparator = settings.createGroup("Separator");
|
||||||
private final SettingGroup sgScrollbar = settings.createGroup("Scrollbar");
|
private final SettingGroup sgScrollbar = settings.createGroup("Scrollbar");
|
||||||
private final SettingGroup sgSlider = settings.createGroup("Slider");
|
private final SettingGroup sgSlider = settings.createGroup("Slider");
|
||||||
|
private final SettingGroup sgStarscript = settings.createGroup("Starscript");
|
||||||
|
|
||||||
// General
|
// General
|
||||||
|
|
||||||
@@ -156,6 +157,19 @@ public class MeteorRoundedGuiTheme extends GuiTheme {
|
|||||||
public final Setting<SettingColor> sliderLeft = color(sgSlider, "slider-left", "Color of slider left part.", new SettingColor(0, 150, 80));
|
public final Setting<SettingColor> sliderLeft = color(sgSlider, "slider-left", "Color of slider left part.", new SettingColor(0, 150, 80));
|
||||||
public final Setting<SettingColor> sliderRight = color(sgSlider, "slider-right", "Color of slider right part.", new SettingColor(50, 50, 50));
|
public final Setting<SettingColor> sliderRight = color(sgSlider, "slider-right", "Color of slider right part.", new SettingColor(50, 50, 50));
|
||||||
|
|
||||||
|
// Starscript
|
||||||
|
|
||||||
|
private final Setting<SettingColor> starscriptText = color(sgStarscript, "starscript-text", "Color of text in Starscript code.", new SettingColor(169, 183, 198));
|
||||||
|
private final Setting<SettingColor> starscriptBraces = color(sgStarscript, "starscript-braces", "Color of braces in Starscript code.", new SettingColor(150, 150, 150));
|
||||||
|
private final Setting<SettingColor> starscriptParenthesis = color(sgStarscript, "starscript-parenthesis", "Color of parenthesis in Starscript code.", new SettingColor(169, 183, 198));
|
||||||
|
private final Setting<SettingColor> starscriptDots = color(sgStarscript, "starscript-dots", "Color of dots in starscript code.", new SettingColor(169, 183, 198));
|
||||||
|
private final Setting<SettingColor> starscriptCommas = color(sgStarscript, "starscript-commas", "Color of commas in starscript code.", new SettingColor(169, 183, 198));
|
||||||
|
private final Setting<SettingColor> starscriptOperators = color(sgStarscript, "starscript-operators", "Color of operators in Starscript code.", new SettingColor(169, 183, 198));
|
||||||
|
private final Setting<SettingColor> starscriptStrings = color(sgStarscript, "starscript-strings", "Color of strings in Starscript code.", new SettingColor(106, 135, 89));
|
||||||
|
private final Setting<SettingColor> starscriptNumbers = color(sgStarscript, "starscript-numbers", "Color of numbers in Starscript code.", new SettingColor(104, 141, 187));
|
||||||
|
private final Setting<SettingColor> starscriptKeywords = color(sgStarscript, "starscript-keywords", "Color of keywords in Starscript code.", new SettingColor(204, 120, 50));
|
||||||
|
private final Setting<SettingColor> starscriptAccessedObjects = color(sgStarscript, "starscript-accessed-objects", "Color of accessed objects (before a dot) in Starscript code.", new SettingColor(152, 118, 170));
|
||||||
|
|
||||||
public MeteorRoundedGuiTheme() {
|
public MeteorRoundedGuiTheme() {
|
||||||
super("Meteor Rounded");
|
super("Meteor Rounded");
|
||||||
|
|
||||||
@@ -222,8 +236,8 @@ public class MeteorRoundedGuiTheme extends GuiTheme {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WTextBox textBox(String text, CharFilter filter) {
|
public WTextBox textBox(String text, CharFilter filter, Class<? extends WTextBox.Renderer> renderer) {
|
||||||
return w(new WMeteorTextBox(text, filter));
|
return w(new WMeteorTextBox(text, filter, renderer));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -288,6 +302,58 @@ public class MeteorRoundedGuiTheme extends GuiTheme {
|
|||||||
return textSecondaryColor.get();
|
return textSecondaryColor.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Starscript
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Color starscriptTextColor() {
|
||||||
|
return starscriptText.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Color starscriptBraceColor() {
|
||||||
|
return starscriptBraces.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Color starscriptParenthesisColor() {
|
||||||
|
return starscriptParenthesis.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Color starscriptDotColor() {
|
||||||
|
return starscriptDots.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Color starscriptCommaColor() {
|
||||||
|
return starscriptCommas.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Color starscriptOperatorColor() {
|
||||||
|
return starscriptOperators.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Color starscriptStringColor() {
|
||||||
|
return starscriptStrings.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Color starscriptNumberColor() {
|
||||||
|
return starscriptNumbers.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Color starscriptKeywordColor() {
|
||||||
|
return starscriptKeywords.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Color starscriptAccessedObjectColor() {
|
||||||
|
return starscriptAccessedObjects.get();
|
||||||
|
}
|
||||||
|
|
||||||
// Other
|
// Other
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -8,9 +8,14 @@ package anticope.rejects.gui.themes.rounded.widgets.input;
|
|||||||
import meteordevelopment.meteorclient.gui.renderer.GuiRenderer;
|
import meteordevelopment.meteorclient.gui.renderer.GuiRenderer;
|
||||||
import anticope.rejects.gui.themes.rounded.MeteorRoundedGuiTheme;
|
import anticope.rejects.gui.themes.rounded.MeteorRoundedGuiTheme;
|
||||||
import anticope.rejects.gui.themes.rounded.MeteorWidget;
|
import anticope.rejects.gui.themes.rounded.MeteorWidget;
|
||||||
|
import anticope.rejects.gui.themes.rounded.widgets.WMeteorLabel;
|
||||||
import meteordevelopment.meteorclient.gui.utils.CharFilter;
|
import meteordevelopment.meteorclient.gui.utils.CharFilter;
|
||||||
import meteordevelopment.meteorclient.gui.widgets.input.WTextBox;
|
import meteordevelopment.meteorclient.gui.widgets.input.WTextBox;
|
||||||
|
import meteordevelopment.meteorclient.gui.widgets.WWidget;
|
||||||
|
import meteordevelopment.meteorclient.gui.widgets.containers.WContainer;
|
||||||
|
import meteordevelopment.meteorclient.gui.widgets.containers.WVerticalList;
|
||||||
import meteordevelopment.meteorclient.utils.Utils;
|
import meteordevelopment.meteorclient.utils.Utils;
|
||||||
|
import meteordevelopment.meteorclient.utils.render.color.Color;
|
||||||
|
|
||||||
public class WMeteorTextBox extends WTextBox implements MeteorWidget {
|
public class WMeteorTextBox extends WTextBox implements MeteorWidget {
|
||||||
private boolean cursorVisible;
|
private boolean cursorVisible;
|
||||||
@@ -18,8 +23,8 @@ public class WMeteorTextBox extends WTextBox implements MeteorWidget {
|
|||||||
|
|
||||||
private double animProgress;
|
private double animProgress;
|
||||||
|
|
||||||
public WMeteorTextBox(String text, CharFilter filter) {
|
public WMeteorTextBox(String text, CharFilter filter, Class<? extends Renderer> renderer) {
|
||||||
super(text, filter);
|
super(text, filter, renderer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -33,8 +38,7 @@ public class WMeteorTextBox extends WTextBox implements MeteorWidget {
|
|||||||
if (cursorTimer >= 1) {
|
if (cursorTimer >= 1) {
|
||||||
cursorVisible = !cursorVisible;
|
cursorVisible = !cursorVisible;
|
||||||
cursorTimer = 0;
|
cursorTimer = 0;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
cursorTimer += delta * 1.75;
|
cursorTimer += delta * 1.75;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,4 +76,66 @@ public class WMeteorTextBox extends WTextBox implements MeteorWidget {
|
|||||||
renderer.scissorEnd();
|
renderer.scissorEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected WContainer createCompletionsRootWidget() {
|
||||||
|
return new WVerticalList() {
|
||||||
|
@Override
|
||||||
|
protected void onRender(GuiRenderer renderer1, double mouseX, double mouseY, double delta) {
|
||||||
|
MeteorRoundedGuiTheme theme1 = theme();
|
||||||
|
double s = theme1.scale(2);
|
||||||
|
Color c = theme1.outlineColor.get();
|
||||||
|
|
||||||
|
Color col = theme1.backgroundColor.get();
|
||||||
|
int preA = col.a;
|
||||||
|
col.a += col.a / 2;
|
||||||
|
col.validate();
|
||||||
|
renderer1.quad(this, col);
|
||||||
|
col.a = preA;
|
||||||
|
|
||||||
|
renderer1.quad(x, y + height - s, width, s, c);
|
||||||
|
renderer1.quad(x, y, s, height - s, c);
|
||||||
|
renderer1.quad(x + width - s, y, s, height - s, c);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@Override
|
||||||
|
protected <T extends WWidget & ICompletionItem> T createCompletionsValueWidth(String completion, boolean selected) {
|
||||||
|
return (T) new CompletionItem(completion, false, selected);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class CompletionItem extends WMeteorLabel implements ICompletionItem {
|
||||||
|
private static final Color SELECTED_COLOR = new Color(255, 255, 255, 15);
|
||||||
|
|
||||||
|
private boolean selected;
|
||||||
|
|
||||||
|
public CompletionItem(String text, boolean title, boolean selected) {
|
||||||
|
super(text, title);
|
||||||
|
this.selected = selected;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onRender(GuiRenderer renderer, double mouseX, double mouseY, double delta) {
|
||||||
|
super.onRender(renderer, mouseX, mouseY, delta);
|
||||||
|
|
||||||
|
if (selected) renderer.quad(this, SELECTED_COLOR);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isSelected() {
|
||||||
|
return selected;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setSelected(boolean selected) {
|
||||||
|
this.selected = selected;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getCompletion() {
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package anticope.rejects.modules;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import anticope.rejects.MeteorRejectsAddon;
|
import anticope.rejects.MeteorRejectsAddon;
|
||||||
|
import meteordevelopment.meteorclient.gui.utils.StarscriptTextBoxRenderer;
|
||||||
import net.minecraft.nbt.NbtCompound;
|
import net.minecraft.nbt.NbtCompound;
|
||||||
import net.minecraft.nbt.NbtString;
|
import net.minecraft.nbt.NbtString;
|
||||||
import net.minecraft.network.packet.c2s.play.ChatMessageC2SPacket;
|
import net.minecraft.network.packet.c2s.play.ChatMessageC2SPacket;
|
||||||
@@ -71,7 +72,8 @@ public class ChatBot extends Module {
|
|||||||
Script script = compile(commands.get(cmd));
|
Script script = compile(commands.get(cmd));
|
||||||
if (script == null) mc.player.sendChatMessage("An error occurred");
|
if (script == null) mc.player.sendChatMessage("An error occurred");
|
||||||
try {
|
try {
|
||||||
mc.player.sendChatMessage(MeteorStarscript.ss.run(script));
|
var section = MeteorStarscript.ss.run(script);
|
||||||
|
mc.player.sendChatMessage(section.text);
|
||||||
} catch (StarscriptError e) {
|
} catch (StarscriptError e) {
|
||||||
MeteorStarscript.printChatError(e);
|
MeteorStarscript.printChatError(e);
|
||||||
mc.player.sendChatMessage("An error occurred");
|
mc.player.sendChatMessage("An error occurred");
|
||||||
@@ -104,7 +106,7 @@ public class ChatBot extends Module {
|
|||||||
textBoxK.action = () -> {
|
textBoxK.action = () -> {
|
||||||
currMsgK = textBoxK.get();
|
currMsgK = textBoxK.get();
|
||||||
};
|
};
|
||||||
WTextBox textBoxV = table.add(theme.textBox(currMsgV)).minWidth(100).expandX().widget();
|
WTextBox textBoxV = table.add(theme.textBox(currMsgV, (text1, c) -> true, StarscriptTextBoxRenderer.class)).minWidth(100).expandX().widget();
|
||||||
textBoxV.action = () -> {
|
textBoxV.action = () -> {
|
||||||
currMsgV = textBoxV.get();
|
currMsgV = textBoxV.get();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import anticope.rejects.MeteorRejectsAddon;
|
|||||||
import anticope.rejects.gui.screens.InteractionScreen;
|
import anticope.rejects.gui.screens.InteractionScreen;
|
||||||
import it.unimi.dsi.fastutil.objects.Object2BooleanMap;
|
import it.unimi.dsi.fastutil.objects.Object2BooleanMap;
|
||||||
import meteordevelopment.meteorclient.gui.GuiTheme;
|
import meteordevelopment.meteorclient.gui.GuiTheme;
|
||||||
|
import meteordevelopment.meteorclient.gui.utils.CharFilter;
|
||||||
|
import meteordevelopment.meteorclient.gui.utils.StarscriptTextBoxRenderer;
|
||||||
import meteordevelopment.meteorclient.gui.widgets.WWidget;
|
import meteordevelopment.meteorclient.gui.widgets.WWidget;
|
||||||
import meteordevelopment.meteorclient.gui.widgets.containers.WTable;
|
import meteordevelopment.meteorclient.gui.widgets.containers.WTable;
|
||||||
import meteordevelopment.meteorclient.gui.widgets.input.WTextBox;
|
import meteordevelopment.meteorclient.gui.widgets.input.WTextBox;
|
||||||
@@ -120,7 +122,7 @@ public class InteractionMenu extends Module {
|
|||||||
textBoxK.action = () -> {
|
textBoxK.action = () -> {
|
||||||
currMsgK = textBoxK.get();
|
currMsgK = textBoxK.get();
|
||||||
};
|
};
|
||||||
WTextBox textBoxV = table.add(theme.textBox(currMsgV)).minWidth(100).expandX().widget();
|
WTextBox textBoxV = table.add(theme.textBox(currMsgV, (text1, c) -> true, StarscriptTextBoxRenderer.class)).minWidth(100).expandX().widget();
|
||||||
textBoxV.action = () -> {
|
textBoxV.action = () -> {
|
||||||
currMsgV = textBoxV.get();
|
currMsgV = textBoxV.get();
|
||||||
};
|
};
|
||||||
@@ -163,6 +165,19 @@ public class InteractionMenu extends Module {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static Value wrap(Entity entity) {
|
private static Value wrap(Entity entity) {
|
||||||
|
if (entity == null) {
|
||||||
|
return Value.map(new ValueMap()
|
||||||
|
.set("_toString", Value.null_())
|
||||||
|
.set("health", Value.null_())
|
||||||
|
.set("pos", Value.map(new ValueMap()
|
||||||
|
.set("_toString", Value.null_())
|
||||||
|
.set("x", Value.null_())
|
||||||
|
.set("y", Value.null_())
|
||||||
|
.set("z", Value.null_())
|
||||||
|
))
|
||||||
|
.set("uuid", Value.null_())
|
||||||
|
);
|
||||||
|
}
|
||||||
return Value.map(new ValueMap()
|
return Value.map(new ValueMap()
|
||||||
.set("_toString", Value.string(entity.getName().getString()))
|
.set("_toString", Value.string(entity.getName().getString()))
|
||||||
.set("health", Value.number(entity instanceof LivingEntity e ? e.getHealth() : 0))
|
.set("health", Value.number(entity instanceof LivingEntity e ? e.getHealth() : 0))
|
||||||
|
|||||||
Reference in New Issue
Block a user