Potion Effects have different durations now

This commit is contained in:
Sn0wStorm 2019-07-04 16:28:44 +02:00
parent b713463ba3
commit ad58d7b609
6 changed files with 33 additions and 13 deletions

View File

@ -1,5 +1,5 @@
name: Brewery
version: 1.7.1
version: 1.7.2
main: com.dre.brewery.P
softdepend: [LWC, LogBlock, WorldGuard, GriefPrevention, Vault, Citadel]
authors: [Milan Albrecht, Frank Baumann, ProgrammerDan, Daniel Saukel]

View File

@ -90,7 +90,9 @@ public class BEffect {
}
duration *= 20;
duration /= type.getDurationModifier();
if (!P.use1_14) {
duration /= type.getDurationModifier();
}
type.createEffect(duration, lvl - 1).apply(player);
}

View File

@ -110,6 +110,7 @@ public class BIngredients {
potionMeta.setDisplayName(P.p.color("&f" + cookedName));
if (!P.use1_14) {
// Before 1.14 the effects duration would strangely be only a quarter of what we tell it to be
// This is due to the Duration Modifier, that is removed in 1.14
uid *= 4;
}
// This effect stores the UID in its Duration

View File

@ -469,11 +469,14 @@ public class BPlayer {
public void drunkEffects(Player player) {
int duration = 10 - getQuality();
duration += drunkeness / 2;
duration *= 20;
if (duration > 960) {
duration *= 5;
if (duration > 240) {
duration *= 5;
} else if (duration < 460) {
duration = 460;
} else if (duration < 115) {
duration = 115;
}
if (!P.use1_14) {
duration *= 4;
}
PotionEffectType.CONFUSION.createEffect(duration, 0).apply(player);
}
@ -481,15 +484,18 @@ public class BPlayer {
public static void addQualityEffects(int quality, int brewAlc, Player player) {
int duration = 7 - quality;
if (quality == 0) {
duration *= 500;
duration *= 125;
} else if (quality <= 5) {
duration *= 250;
duration *= 62;
} else {
duration = 100;
duration = 25;
if (brewAlc <= 10) {
duration = 0;
}
}
if (!P.use1_14) {
duration *= 4;
}
if (duration > 0) {
PotionEffectType.POISON.createEffect(duration, 0).apply(player);
}
@ -498,9 +504,12 @@ public class BPlayer {
if (quality <= 5) {
duration = 10 - quality;
duration += brewAlc;
duration *= 60;
duration *= 15;
} else {
duration = 120;
duration = 30;
}
if (!P.use1_14) {
duration *= 4;
}
PotionEffectType.BLINDNESS.createEffect(duration, 0).apply(player);
}
@ -516,7 +525,10 @@ public class BPlayer {
}
public void hangoverEffects(final Player player) {
int duration = offlineDrunk * 50 * getHangoverQuality();
int duration = offlineDrunk * 25 * getHangoverQuality();
if (!P.use1_14) {
duration *= 2;
}
int amplifier = getHangoverQuality() / 3;
PotionEffectType.SLOW.createEffect(duration, amplifier).apply(player);

View File

@ -267,6 +267,7 @@ public class BRecipe {
potionMeta.setDisplayName(P.p.color("&f" + getName(quality)));
if (!P.use1_14) {
// Before 1.14 the effects duration would strangely be only a quarter of what we tell it to be
// This is due to the Duration Modifier, that is removed in 1.14
uid *= 4;
}
// This effect stores the UID in its Duration

View File

@ -160,7 +160,11 @@ public class Brew {
int uid = generateUID();
clone(uid);
PotionMeta meta = (PotionMeta) copy.getItemMeta();
meta.addCustomEffect((PotionEffectType.REGENERATION).createEffect((uid * 4), 0), true);
if (!P.use1_14) {
// This is due to the Duration Modifier, that is removed in 1.14
uid *= 4;
}
meta.addCustomEffect((PotionEffectType.REGENERATION).createEffect(uid, 0), true);
copy.setItemMeta(meta);
return copy;
}