mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-19 11:59:11 +00:00
Fix some null warnings
This commit is contained in:
1 parent
c6783e573c
commit
3178aa890d
22 files changed
+114
-95
No files matched your search
@@ -6,8 +6,9 @@ import net.minecraft.potion.PotionEffect;
|
||||
|
||||
public class AlcoholEffect {
|
||||
public static void makeDrunk(final EntityPlayer player, final float strength) {
|
||||
final int existingStrength = player.isPotionActive(MobEffects.NAUSEA) ? player.getActivePotionEffect(MobEffects.NAUSEA).getAmplifier() : 0;
|
||||
final int existingTime = player.isPotionActive(MobEffects.NAUSEA) ? player.getActivePotionEffect(MobEffects.NAUSEA).getDuration() : 0;
|
||||
PotionEffect potionEffect = player.getActivePotionEffect(MobEffects.NAUSEA);
|
||||
final int existingStrength = potionEffect != null ? potionEffect.getAmplifier() : 0;
|
||||
final int existingTime = potionEffect != null ? potionEffect.getDuration() : 0;
|
||||
int time = (int) (100.0 * Math.sqrt(strength)) + existingTime;
|
||||
final float intensity = 0.1f * strength + existingStrength + existingTime / 500;
|
||||
if (time < 5) {
|
||||
|
||||
Reference in new issue
Block a user