mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-18 19:39:37 +00:00
Improve code readability in binnie.extratrees package
This commit is contained in:
1 parent
adccdd181a
commit
96e4814ae3
225 files changed
+8968
-9306
No files matched your search
@@ -1,31 +1,30 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.alcohol;
|
||||
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
|
||||
public class AlcoholEffect
|
||||
{
|
||||
public static void makeDrunk(final EntityPlayer player, final float strength) {
|
||||
final int existingStrength = player.isPotionActive(Potion.confusion) ? player.getActivePotionEffect(Potion.confusion).getAmplifier() : 0;
|
||||
final int existingTime = player.isPotionActive(Potion.confusion) ? player.getActivePotionEffect(Potion.confusion).getDuration() : 0;
|
||||
public class AlcoholEffect {
|
||||
public static void makeDrunk(EntityPlayer player, float strength) {
|
||||
int existingStrength = player.isPotionActive(Potion.confusion) ? player.getActivePotionEffect(Potion.confusion).getAmplifier() : 0;
|
||||
int existingTime = player.isPotionActive(Potion.confusion) ? player.getActivePotionEffect(Potion.confusion).getDuration() : 0;
|
||||
int time = (int) (100.0 * Math.sqrt(strength)) + existingTime;
|
||||
final float intensity = 0.1f * strength + existingStrength + existingTime / 500;
|
||||
|
||||
float intensity = 0.1f * strength + existingStrength + existingTime / 500;
|
||||
if (time < 5) {
|
||||
time = 5;
|
||||
}
|
||||
|
||||
float slowIntense = (intensity - 10.0f) / 4.0f;
|
||||
if (slowIntense < 0.0f) {
|
||||
slowIntense = 0.0f;
|
||||
}
|
||||
|
||||
float blindIntense = (intensity - 25.0f) / 2.0f;
|
||||
if (blindIntense < 0.0f) {
|
||||
blindIntense = 0.0f;
|
||||
}
|
||||
|
||||
player.addPotionEffect(new PotionEffect(Potion.confusion.id, time, (int) intensity, false));
|
||||
if (slowIntense > 0.0f) {
|
||||
player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, time, (int) slowIntense, false));
|
||||
|
||||
Reference in new issue
Block a user