use of meteordevelopment.meteorclient.settings.Setting in project meteor-client by MeteorDevelopment.
the class ResetCommand method build.
@Override
public void build(LiteralArgumentBuilder<CommandSource> builder) {
builder.then(literal("settings").then(argument("module", ModuleArgumentType.module()).executes(context -> {
Module module = context.getArgument("module", Module.class);
module.settings.forEach(group -> group.forEach(Setting::reset));
module.info("Reset all settings.");
return SINGLE_SUCCESS;
})).then(literal("all").executes(context -> {
Modules.get().getAll().forEach(module -> module.settings.forEach(group -> group.forEach(Setting::reset)));
ChatUtils.info("Modules", "Reset all module settings");
return SINGLE_SUCCESS;
}))).then(literal("gui").executes(context -> {
GuiThemes.get().clearWindowConfigs();
ChatUtils.info("Reset GUI positioning.");
return SINGLE_SUCCESS;
})).then(literal("bind").then(argument("module", ModuleArgumentType.module()).executes(context -> {
Module module = context.getArgument("module", Module.class);
module.keybind.set(true, -1);
module.info("Reset bind.");
return SINGLE_SUCCESS;
})).then(literal("all").executes(context -> {
Modules.get().getAll().forEach(module -> module.keybind.set(true, -1));
ChatUtils.info("Modules", "Reset all binds.");
return SINGLE_SUCCESS;
}))).then(literal("hud").executes(context -> {
Systems.get(HUD.class).reset.run();
ChatUtils.info("HUD", "Reset all elements.");
return SINGLE_SUCCESS;
}));
}
use of meteordevelopment.meteorclient.settings.Setting in project meteor-client by MeteorDevelopment.
the class NoFall method onTick.
@EventHandler
private void onTick(TickEvent.Pre event) {
if (mc.player.getAbilities().creativeMode)
return;
// Airplace mode
if (mode.get() == Mode.AirPlace) {
// Test if fall damage setting is valid
if (!airPlaceMode.get().test(mc.player.fallDistance))
return;
// Center and place block
if (anchor.get())
PlayerUtils.centerPlayer();
Rotations.rotate(mc.player.getYaw(), 90, Integer.MAX_VALUE, () -> {
double preY = mc.player.getVelocity().y;
((IVec3d) mc.player.getVelocity()).setY(0);
BlockUtils.place(mc.player.getBlockPos().down(), InvUtils.findInHotbar(itemStack -> itemStack.getItem() instanceof BlockItem), false, 0, true);
((IVec3d) mc.player.getVelocity()).setY(preY);
});
}
// Bucket mode
if (mode.get() == Mode.Bucket) {
if (mc.player.fallDistance > 3 && !EntityUtils.isAboveWater(mc.player)) {
// Place water
FindItemResult waterBucket = InvUtils.findInHotbar(Items.WATER_BUCKET);
if (!waterBucket.found())
return;
// Center player
if (anchor.get())
PlayerUtils.centerPlayer();
// Check if there is a block within 5 blocks
BlockHitResult result = mc.world.raycast(new RaycastContext(mc.player.getPos(), mc.player.getPos().subtract(0, 5, 0), RaycastContext.ShapeType.OUTLINE, RaycastContext.FluidHandling.NONE, mc.player));
// Place water
if (result != null && result.getType() == HitResult.Type.BLOCK) {
useBucket(waterBucket, true);
}
}
// Remove water
if (placedWater && mc.player.getBlockStateAtPos().getFluidState().getFluid() == Fluids.WATER) {
useBucket(InvUtils.findInHotbar(Items.BUCKET), false);
}
}
}
Aggregations