This commit is contained in:
Bruno Rybársky 2024-11-10 10:22:57 +01:00
parent 0d4b50dc98
commit 54a89aa757
No known key found for this signature in database
GPG Key ID: 6C9206A821C70598
4 changed files with 10 additions and 10 deletions

@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.6-SNAPSHOT'
id 'fabric-loom' version '1.8-SNAPSHOT'
id 'maven-publish'
}

@ -2,10 +2,10 @@
org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://modmuss50.me/fabric.html
minecraft_version=1.21.1
yarn_mappings=1.21.1+build.3
loader_version=0.16.0
minecraft_version=1.21.3
yarn_mappings=1.21.3+build.2
loader_version=0.16.9
# Mod Properties
mod_version=1.1.1
mod_version=1.1.2
maven_group=systems.brn
archives_base_name=Wise_Elytra

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME

@ -5,8 +5,8 @@ import net.minecraft.component.type.FireworksComponent;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.FireworkRocketItem;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.TypedActionResult;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
@ -17,13 +17,13 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
public class FireworkUseMixin {
@Inject(method = "use", at = @At("HEAD"), cancellable = true)
private void onUse(World world, PlayerEntity user, Hand hand, CallbackInfoReturnable<TypedActionResult<ItemStack>> cir) {
private void onUse(World world, PlayerEntity user, Hand hand, CallbackInfoReturnable<ActionResult> cir) {
ItemStack stack = user.getStackInHand(hand);
// Check if the firework rocket contains a firework star and if
FireworksComponent fireworksComponent = stack.get(DataComponentTypes.FIREWORKS);
if (fireworksComponent != null && (fireworksComponent.explosions().isEmpty() != user.isFallFlying())) {
cir.setReturnValue(TypedActionResult.fail(stack));
if (fireworksComponent != null && (fireworksComponent.explosions().isEmpty() != user.isGliding())) {
cir.setReturnValue(ActionResult.FAIL);
}
}