diff options
author | dev@ftbsc <dev@fantabos.co> | 2023-01-29 00:44:56 +0100 |
---|---|---|
committer | dev@ftbsc <dev@fantabos.co> | 2023-01-29 00:44:56 +0100 |
commit | 2867df0f51b5716104e57c6d8b63a387f4799415 (patch) | |
tree | 93ce64c793aafa76136feedf13f2bd794f616518 /src/main/java/co/fantabos | |
parent | 503c398ca846f1279515c0d61b26c550572b0816 (diff) |
feat: added vanillaflight, moved modules
Diffstat (limited to 'src/main/java/co/fantabos')
-rw-r--r-- | src/main/java/co/fantabos/bscv/BoSCoVicino.java | 2 | ||||
-rw-r--r-- | src/main/java/co/fantabos/bscv/modules/Fullbright.java (renamed from src/main/java/co/fantabos/bscv/Fullbright.java) | 5 | ||||
-rw-r--r-- | src/main/java/co/fantabos/bscv/modules/VanillaFlight.java | 26 |
3 files changed, 32 insertions, 1 deletions
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<Module>(); 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/modules/Fullbright.java index 2f22ef8..d518448 100644 --- a/src/main/java/co/fantabos/bscv/Fullbright.java +++ b/src/main/java/co/fantabos/bscv/modules/Fullbright.java @@ -1,4 +1,4 @@ -package co.fantabos.bscv; +package co.fantabos.bscv.modules; import com.mojang.brigadier.CommandDispatcher; @@ -9,6 +9,9 @@ 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<String> mode; 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<CommandSource> 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; + } + } +} |