Skip to content

Commit

Permalink
Make jet suit turn off when on cooldown
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexNijjar committed Sep 29, 2023
1 parent fbc73f7 commit 4557960
Show file tree
Hide file tree
Showing 7 changed files with 478 additions and 485 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,22 +93,22 @@ Common

```groovy
dependencies {
modImplementation "earth.terrarium.adastra:adastra-common-$minecraft_version:$ad_astra_version"
modImplementation "earth.terrarium.adastra:ad_astra-common-$minecraft_version:$ad_astra_version"
}
```

Fabric

```groovy
dependencies {
modImplementation "earth.terrarium.adastra:adastra-fabric-$minecraft_version:$ad_astra_version"
modImplementation "earth.terrarium.adastra:ad_astra-fabric-$minecraft_version:$ad_astra_version"
}
```

Forge

```groovy
dependencies {
modImplementation "earth.terrarium.adastra:adastra-forge-$minecraft_version:$ad_astra_version"
modImplementation "earth.terrarium.adastra:ad_astra-forge-$minecraft_version:$ad_astra_version"
}
```
3 changes: 2 additions & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
- Update Ukrainian and Russian translations (PoPCorn)
- Update Ukrainian and Russian translations (PoPCorn)
- Make jet suit turn off when on cooldown
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

public class ClientModParticles {

public static void onRegisterParticles(BiConsumer<ParticleType<SimpleParticleType>, ClientModParticles.SpriteParticleRegistration<SimpleParticleType>> register) {
public static void onRegisterParticles(BiConsumer<ParticleType<SimpleParticleType>, SpriteParticleRegistration<SimpleParticleType>> register) {
register.accept(ModParticleTypes.VENUS_RAIN.get(), SplashParticle.Provider::new);
register.accept(ModParticleTypes.LARGE_FLAME.get(), LargeFlameParticle.Provider::new);
register.accept(ModParticleTypes.LARGE_SMOKE.get(), LargeFlameParticle.Provider::new);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,20 +95,11 @@ public void appendHoverText(ItemStack stack, Level level, @NotNull List<Componen

public void fly(Player player, ItemStack stack) {
emitParticles = false;
if (!SpaceSuitConfig.enableJetSuitFlight) {
return;
}

// Don't fly the Jet Suit in creative
if (!SpaceSuitConfig.enableJetSuitFlight) return;
if (player.getCooldowns().isOnCooldown(stack.getItem())) return;
ItemStackHolder stackHolder = new ItemStackHolder(stack);
if (player.getAbilities().flying) {
return;
}

// Don't fly if the Jet Suit has no energy
if (EnergyHooks.getItemEnergyManager(stack).getStoredEnergy() <= 0) {
return;
}
if (player.getAbilities().flying) return;
if (EnergyHooks.getItemEnergyManager(stack).getStoredEnergy() <= 0) return;

if (ModKeyBindings.sprintKeyDown(player)) {
this.fallFly(player, stackHolder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,10 @@
public class ModParticleTypes {
public static final ResourcefulRegistry<ParticleType<?>> PARTICLE_TYPES = ResourcefulRegistries.create(BuiltInRegistries.PARTICLE_TYPE, AdAstra.MOD_ID);

public static final RegistryEntry<SimpleParticleType> VENUS_RAIN = PARTICLE_TYPES.register("venus_rain", () -> new SimpleParticleType(true) {
});
public static final RegistryEntry<SimpleParticleType> LARGE_FLAME = PARTICLE_TYPES.register("large_flame", () -> new SimpleParticleType(true) {
});
public static final RegistryEntry<SimpleParticleType> LARGE_SMOKE = PARTICLE_TYPES.register("large_smoke", () -> new SimpleParticleType(true) {
});
public static final RegistryEntry<SimpleParticleType> SMALL_FLAME = PARTICLE_TYPES.register("small_flame", () -> new SimpleParticleType(true) {
});
public static final RegistryEntry<SimpleParticleType> SMALL_SMOKE = PARTICLE_TYPES.register("small_smoke", () -> new SimpleParticleType(true) {
});
public static final RegistryEntry<SimpleParticleType> OXYGEN_BUBBLE = PARTICLE_TYPES.register("oxygen_bubble", () -> new SimpleParticleType(true) {
});
public static final RegistryEntry<SimpleParticleType> VENUS_RAIN = PARTICLE_TYPES.register("venus_rain", () -> new SimpleParticleType(true) {});
public static final RegistryEntry<SimpleParticleType> LARGE_FLAME = PARTICLE_TYPES.register("large_flame", () -> new SimpleParticleType(true) {});
public static final RegistryEntry<SimpleParticleType> LARGE_SMOKE = PARTICLE_TYPES.register("large_smoke", () -> new SimpleParticleType(true) {});
public static final RegistryEntry<SimpleParticleType> SMALL_FLAME = PARTICLE_TYPES.register("small_flame", () -> new SimpleParticleType(true) {});
public static final RegistryEntry<SimpleParticleType> SMALL_SMOKE = PARTICLE_TYPES.register("small_smoke", () -> new SimpleParticleType(true) {});
public static final RegistryEntry<SimpleParticleType> OXYGEN_BUBBLE = PARTICLE_TYPES.register("oxygen_bubble", () -> new SimpleParticleType(true) {});
}
Loading

0 comments on commit 4557960

Please sign in to comment.