From 2867df0f51b5716104e57c6d8b63a387f4799415 Mon Sep 17 00:00:00 2001 From: "dev@ftbsc" Date: Sun, 29 Jan 2023 00:44:56 +0100 Subject: feat: added vanillaflight, moved modules --- src/main/java/co/fantabos/bscv/BoSCoVicino.java | 2 ++ src/main/java/co/fantabos/bscv/Fullbright.java | 37 -------------------- .../java/co/fantabos/bscv/modules/Fullbright.java | 40 ++++++++++++++++++++++ .../co/fantabos/bscv/modules/VanillaFlight.java | 26 ++++++++++++++ 4 files changed, 68 insertions(+), 37 deletions(-) delete mode 100644 src/main/java/co/fantabos/bscv/Fullbright.java create mode 100644 src/main/java/co/fantabos/bscv/modules/Fullbright.java create mode 100644 src/main/java/co/fantabos/bscv/modules/VanillaFlight.java (limited to 'src') diff --git a/src/main/java/co/fantabos/bscv/BoSCoVicino.java b/src/main/java/co/fantabos/bscv/BoSCoVicino.java index fb7a71d..7e6527e 100644 --- a/src/main/java/co/fantabos/bscv/BoSCoVicino.java +++ b/src/main/java/co/fantabos/bscv/BoSCoVicino.java @@ -35,6 +35,7 @@ import java.util.List; import java.util.stream.Collectors; import co.fantabos.bscv.Module; +import co.fantabos.bscv.modules.*; // The value here should match an entry in the META-INF/mods.toml file @Mod("bscv") @@ -68,6 +69,7 @@ public class BoSCoVicino { BoSCoVicino.mods = new ArrayList(); BoSCoVicino.mods.add(new Fullbright(builder, this.dispatcher)); + BoSCoVicino.mods.add(new VanillaFlight(builder, this.dispatcher)); ForgeConfigSpec spec = builder.build(); diff --git a/src/main/java/co/fantabos/bscv/Fullbright.java b/src/main/java/co/fantabos/bscv/Fullbright.java deleted file mode 100644 index 2f22ef8..0000000 --- a/src/main/java/co/fantabos/bscv/Fullbright.java +++ /dev/null @@ -1,37 +0,0 @@ -package co.fantabos.bscv; - -import com.mojang.brigadier.CommandDispatcher; - -import net.minecraft.command.CommandSource; -import net.minecraft.potion.Effect; -import net.minecraft.potion.EffectInstance; -import net.minecraftforge.common.ForgeConfigSpec; -import net.minecraftforge.event.TickEvent; -import net.minecraftforge.eventbus.api.SubscribeEvent; - -public class Fullbright extends Module { - - private final ForgeConfigSpec.ConfigValue mode; - - public Fullbright(ForgeConfigSpec.Builder builder, CommandDispatcher dispatcher) { - super("Fullbright", Group.VISION, builder, dispatcher); - - this.mode = builder.comment("either potion or gamma").define("mode", "potion"); - } - - @SubscribeEvent - public void onTick(TickEvent.ClientTickEvent event) { - if (BoSCoVicino.minecraft == null) return; - if (BoSCoVicino.minecraft.player == null) return; - if (this.mode.get().equals("potion")) { - BoSCoVicino.minecraft.player.addEffect(new EffectInstance(Effect.byId(16), 5204)); - } - } - - @Override - protected void onDisabled() { - if (this.mode.get().equals("potion")) { - BoSCoVicino.minecraft.player.removeEffect(Effect.byId(16)); - } - } -} diff --git a/src/main/java/co/fantabos/bscv/modules/Fullbright.java b/src/main/java/co/fantabos/bscv/modules/Fullbright.java new file mode 100644 index 0000000..d518448 --- /dev/null +++ b/src/main/java/co/fantabos/bscv/modules/Fullbright.java @@ -0,0 +1,40 @@ +package co.fantabos.bscv.modules; + +import com.mojang.brigadier.CommandDispatcher; + +import net.minecraft.command.CommandSource; +import net.minecraft.potion.Effect; +import net.minecraft.potion.EffectInstance; +import net.minecraftforge.common.ForgeConfigSpec; +import net.minecraftforge.event.TickEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; + +import co.fantabos.bscv.Module; +import co.fantabos.bscv.BoSCoVicino; + +public class Fullbright extends Module { + + private final ForgeConfigSpec.ConfigValue mode; + + public Fullbright(ForgeConfigSpec.Builder builder, CommandDispatcher dispatcher) { + super("Fullbright", Group.VISION, builder, dispatcher); + + this.mode = builder.comment("either potion or gamma").define("mode", "potion"); + } + + @SubscribeEvent + public void onTick(TickEvent.ClientTickEvent event) { + if (BoSCoVicino.minecraft == null) return; + if (BoSCoVicino.minecraft.player == null) return; + if (this.mode.get().equals("potion")) { + BoSCoVicino.minecraft.player.addEffect(new EffectInstance(Effect.byId(16), 5204)); + } + } + + @Override + protected void onDisabled() { + if (this.mode.get().equals("potion")) { + BoSCoVicino.minecraft.player.removeEffect(Effect.byId(16)); + } + } +} diff --git a/src/main/java/co/fantabos/bscv/modules/VanillaFlight.java b/src/main/java/co/fantabos/bscv/modules/VanillaFlight.java new file mode 100644 index 0000000..f8e2312 --- /dev/null +++ b/src/main/java/co/fantabos/bscv/modules/VanillaFlight.java @@ -0,0 +1,26 @@ +package co.fantabos.bscv.modules; + +import com.mojang.brigadier.CommandDispatcher; + +import co.fantabos.bscv.BoSCoVicino; +import co.fantabos.bscv.Module; +import net.minecraft.client.entity.player.ClientPlayerEntity; +import net.minecraft.command.CommandSource; +import net.minecraftforge.common.ForgeConfigSpec; +import net.minecraftforge.event.TickEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; + +public class VanillaFlight extends Module { + + public VanillaFlight(ForgeConfigSpec.Builder builder, CommandDispatcher dispatcher) { + super("VanillaFlight", Group.CORE, builder, dispatcher); + } + + @SubscribeEvent + public void onTick(TickEvent.ClientTickEvent event) { + ClientPlayerEntity player = BoSCoVicino.minecraft.player; + if (player != null) { + player.abilities.mayfly = true; + } + } +} -- cgit v1.2.3-56-ga3b1