From 54d4d203b344b31884cfb82a751ca631eb59a7ae Mon Sep 17 00:00:00 2001 From: 1e99 <1e99@1e99.eu> Date: Tue, 3 Dec 2024 20:22:41 +0100 Subject: [PATCH] remove firework boosting --- resources/boringsmp.mixins.json | 2 +- src/eu/e99/boringsmp/BoringSMP.java | 1 + src/eu/e99/boringsmp/mixin/ExampleMixin.java | 15 ----------- .../mixin/FireworkRocketItemMixin.java | 26 +++++++++++++++++++ 4 files changed, 28 insertions(+), 16 deletions(-) delete mode 100644 src/eu/e99/boringsmp/mixin/ExampleMixin.java create mode 100644 src/eu/e99/boringsmp/mixin/FireworkRocketItemMixin.java diff --git a/resources/boringsmp.mixins.json b/resources/boringsmp.mixins.json index e98bdc0..399f771 100644 --- a/resources/boringsmp.mixins.json +++ b/resources/boringsmp.mixins.json @@ -3,7 +3,7 @@ "package": "eu.e99.boringsmp.mixin", "compatibilityLevel": "JAVA_21", "mixins": [ - "ExampleMixin" + "FireworkRocketItemMixin" ], "injectors": { "defaultRequire": 1 diff --git a/src/eu/e99/boringsmp/BoringSMP.java b/src/eu/e99/boringsmp/BoringSMP.java index b034027..23f153e 100644 --- a/src/eu/e99/boringsmp/BoringSMP.java +++ b/src/eu/e99/boringsmp/BoringSMP.java @@ -2,6 +2,7 @@ package eu.e99.boringsmp; import net.fabricmc.api.DedicatedServerModInitializer; +import net.minecraft.item.FireworkRocketItem; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/eu/e99/boringsmp/mixin/ExampleMixin.java b/src/eu/e99/boringsmp/mixin/ExampleMixin.java deleted file mode 100644 index ad5bf8f..0000000 --- a/src/eu/e99/boringsmp/mixin/ExampleMixin.java +++ /dev/null @@ -1,15 +0,0 @@ -package eu.e99.boringsmp.mixin; - -import net.minecraft.server.MinecraftServer; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -@Mixin(MinecraftServer.class) -public class ExampleMixin { - @Inject(at = @At("HEAD"), method = "loadWorld") - private void init(CallbackInfo info) { - // This code is injected into the start of MinecraftServer.loadWorld()V - } -} \ No newline at end of file diff --git a/src/eu/e99/boringsmp/mixin/FireworkRocketItemMixin.java b/src/eu/e99/boringsmp/mixin/FireworkRocketItemMixin.java new file mode 100644 index 0000000..395adcc --- /dev/null +++ b/src/eu/e99/boringsmp/mixin/FireworkRocketItemMixin.java @@ -0,0 +1,26 @@ +package eu.e99.boringsmp.mixin; + +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.FireworkRocketItem; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ActionResult; +import net.minecraft.util.Hand; +import net.minecraft.world.World; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(FireworkRocketItem.class) +public class FireworkRocketItemMixin { + + /** + * @author 1e99 + * @reason To remove firework elytra boosting + */ + @Overwrite + public ActionResult use(World world, PlayerEntity user, Hand hand) { + return ActionResult.PASS; + } +} \ No newline at end of file