feat: initial boatfly, but kinda broken
This commit is contained in:
parent
bad0ff82c9
commit
627150b570
2 changed files with 60 additions and 0 deletions
|
@ -72,6 +72,7 @@ public class BoSCoVicino implements ICommons {
|
||||||
BoSCoVicino.mods.add(new AutoFish(cfg, dp).done(cfg));
|
BoSCoVicino.mods.add(new AutoFish(cfg, dp).done(cfg));
|
||||||
BoSCoVicino.mods.add(new AutoTool(cfg, dp).done(cfg));
|
BoSCoVicino.mods.add(new AutoTool(cfg, dp).done(cfg));
|
||||||
BoSCoVicino.mods.add(new Freecam(cfg, dp).done(cfg));
|
BoSCoVicino.mods.add(new Freecam(cfg, dp).done(cfg));
|
||||||
|
BoSCoVicino.mods.add(new BoatFly(cfg, dp).done(cfg));
|
||||||
|
|
||||||
BoSCoVicino.spec = cfg.build();
|
BoSCoVicino.spec = cfg.build();
|
||||||
|
|
||||||
|
|
59
src/main/java/ftbsc/bscv/modules/motion/BoatFly.java
Normal file
59
src/main/java/ftbsc/bscv/modules/motion/BoatFly.java
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
package ftbsc.bscv.modules.motion;
|
||||||
|
|
||||||
|
import com.mojang.brigadier.CommandDispatcher;
|
||||||
|
import com.mojang.brigadier.arguments.DoubleArgumentType;
|
||||||
|
|
||||||
|
import ftbsc.bscv.ICommons;
|
||||||
|
import ftbsc.bscv.modules.Module;
|
||||||
|
import ftbsc.bscv.tools.Keyboard;
|
||||||
|
import net.minecraft.command.CommandSource;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.item.BoatEntity;
|
||||||
|
import net.minecraft.util.math.vector.Vector2f;
|
||||||
|
import net.minecraftforge.common.ForgeConfigSpec;
|
||||||
|
import net.minecraftforge.event.TickEvent;
|
||||||
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||||
|
|
||||||
|
public class BoatFly extends Module implements ICommons {
|
||||||
|
|
||||||
|
public final ForgeConfigSpec.ConfigValue<Double> speed;
|
||||||
|
public final ForgeConfigSpec.ConfigValue<Double> rise;
|
||||||
|
|
||||||
|
public BoatFly(ForgeConfigSpec.Builder builder, CommandDispatcher<CommandSource> dispatcher) {
|
||||||
|
super("BoatFly", Group.MOTION, builder, dispatcher);
|
||||||
|
|
||||||
|
this.speed = this.option(
|
||||||
|
"speed", "magnitude of boat movement", 1.,
|
||||||
|
DoubleArgumentType.doubleArg(), Double.class,
|
||||||
|
builder, dispatcher
|
||||||
|
);
|
||||||
|
|
||||||
|
this.rise = this.option(
|
||||||
|
"rise", "vertical speed", 0.5,
|
||||||
|
DoubleArgumentType.doubleArg(), Double.class,
|
||||||
|
builder, dispatcher
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onTick(TickEvent.ClientTickEvent event) {
|
||||||
|
// if (event.phase == Phase.END) return;
|
||||||
|
if (MC.player == null) {
|
||||||
|
this.disable();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Entity vehicle = MC.player.getVehicle();
|
||||||
|
if (vehicle == null) return;
|
||||||
|
if (vehicle instanceof BoatEntity) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Keyboard.isMoving()) {
|
||||||
|
Vector2f motion = MC.player.input.getMoveVector();
|
||||||
|
double rise = MC.options.keyJump.isDown() ? this.rise.get() : 0.;
|
||||||
|
double speed = this.speed.get();
|
||||||
|
vehicle.setDeltaMovement(motion.x * speed, rise, motion.y * speed);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in a new issue