Skip to content

Commit

Permalink
fix: wrong component usage in FRWK EXPLOSIVE check
Browse files Browse the repository at this point in the history
  • Loading branch information
Octol1ttle committed May 10, 2024
1 parent cb98cfc commit fc978e5
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@

import net.minecraft.client.MinecraftClient;
import net.minecraft.component.DataComponentTypes;
import net.minecraft.component.type.FireworkExplosionComponent;
import net.minecraft.component.type.FireworksComponent;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.item.FireworkRocketItem;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.nbt.NbtElement;
import net.minecraft.util.Hand;
import ru.octol1ttle.flightassistant.computers.api.IAutopilotProvider;
import ru.octol1ttle.flightassistant.computers.impl.AirDataComputer;
Expand Down Expand Up @@ -127,7 +125,12 @@ public boolean isFireworkSafe(ItemStack stack) {
if (data.player().isInvulnerable()) {
return true;
}
return stack.getComponents().get(DataComponentTypes.FIREWORK_EXPLOSION) == null;

FireworksComponent component = stack.getComponents().get(DataComponentTypes.FIREWORKS);
if (component == null) {
throw new AssertionError();
}
return component.explosions().isEmpty();
}

@Override
Expand Down

0 comments on commit fc978e5

Please sign in to comment.