File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed
src/main/java/mekanism/common/item Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change 11package mekanism .common .item ;
22
33import java .util .List ;
4+ import java .util .OptionalInt ;
45import mekanism .api .chemical .Chemical ;
56import mekanism .api .chemical .ChemicalStack ;
67import mekanism .api .chemical .IChemicalHandler ;
@@ -44,7 +45,11 @@ public int getBarWidth(@NotNull ItemStack stack) {
4445
4546 @ Override
4647 public int getBarColor (@ NotNull ItemStack stack ) {
47- return FluidUtils .getRGBDurabilityForDisplay (stack ).orElseGet (() -> ChemicalUtil .getRGBDurabilityForDisplay (stack ));
48+ OptionalInt color = FluidUtils .getRGBDurabilityForDisplay (stack );
49+ if (color .isPresent ()) {
50+ return color .getAsInt ();
51+ }
52+ return ChemicalUtil .getRGBDurabilityForDisplay (stack );
4853 }
4954
5055 @ NotNull
Original file line number Diff line number Diff line change @@ -90,12 +90,11 @@ static ItemStack getActiveJetpack(LivingEntity entity) {
9090 if (entity .isPassenger ()) {
9191 return ItemStack .EMPTY ;
9292 }
93- return getJetpack (entity , stack -> {
94- if (stack .getItem () instanceof IJetpackItem jetpackItem && jetpackItem .canUseJetpack (stack )) {
95- return !(entity instanceof Player player ) || !player .getCooldowns ().isOnCooldown (stack .getItem ());
96- }
97- return false ;
98- });
93+ ItemStack jetpack = getJetpack (entity , stack -> stack .getItem () instanceof IJetpackItem jetpackItem && jetpackItem .canUseJetpack (stack ));
94+ if (entity instanceof Player player && player .getCooldowns ().isOnCooldown (jetpack .getItem ())) {
95+ return ItemStack .EMPTY ;
96+ }
97+ return jetpack ;
9998 }
10099
101100 /**
You can’t perform that action at this time.
0 commit comments