-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #372 from SymmetricDevs/mt-env-survival-fixes
MTBO's environmental survival fixes
- Loading branch information
Showing
11 changed files
with
130 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
src/main/java/supersymmetry/common/item/armor/AdvancedBreathingTank.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package supersymmetry.common.item.armor; | ||
|
||
import net.minecraft.client.resources.I18n; | ||
import net.minecraft.inventory.EntityEquipmentSlot; | ||
import net.minecraft.item.ItemStack; | ||
|
||
import java.util.List; | ||
|
||
public class AdvancedBreathingTank extends AdvancedBreathingApparatus { | ||
public final static double INFINITE_OXYGEN = -1; | ||
public final double maxOxygen; | ||
|
||
|
||
public AdvancedBreathingTank(double hoursOfLife, String name, int tier, double relativeAbsorption, double maxOxygen) { | ||
super(EntityEquipmentSlot.CHEST, hoursOfLife, name, tier, relativeAbsorption); | ||
this.maxOxygen = maxOxygen; | ||
} | ||
|
||
@Override | ||
public void addInformation(ItemStack stack, List<String> strings) { | ||
int maxOxygen = (int) getMaxOxygen(stack); | ||
if (maxOxygen == INFINITE_OXYGEN) { | ||
strings.add(I18n.format("supersymmetry.unlimited_oxygen")); | ||
} else { | ||
int oxygen = (int) getOxygen(stack); | ||
strings.add(I18n.format("supersymmetry.oxygen", oxygen, maxOxygen)); | ||
} | ||
super.addInformation(stack, strings); | ||
} | ||
|
||
public void changeOxygen(ItemStack stack, double oxygenChange) { | ||
if (getMaxOxygen(stack) == INFINITE_OXYGEN) { | ||
return; | ||
} | ||
super.changeOxygen(stack, oxygenChange); | ||
} | ||
|
||
public double getOxygen(ItemStack stack) { | ||
if (getMaxOxygen(stack) == INFINITE_OXYGEN) { | ||
return 12000; | ||
} | ||
return super.getOxygen(stack); | ||
} | ||
|
||
@Override | ||
double getMaxOxygen(ItemStack stack) { | ||
return this.maxOxygen; | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.