remove firework boosting

This commit is contained in:
1e99 2024-12-03 20:22:41 +01:00
parent 6c4802b899
commit 54d4d203b3
4 changed files with 28 additions and 16 deletions

View file

@ -3,7 +3,7 @@
"package": "eu.e99.boringsmp.mixin",
"compatibilityLevel": "JAVA_21",
"mixins": [
"ExampleMixin"
"FireworkRocketItemMixin"
],
"injectors": {
"defaultRequire": 1

View file

@ -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;

View file

@ -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
}
}

View file

@ -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;
}
}