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
+1 -1
View File
@@ -1,5 +1,5 @@
name: Brewery name: Brewery
version: 1.7.1 version: 1.7.2
main: com.dre.brewery.P main: com.dre.brewery.P
softdepend: [LWC, LogBlock, WorldGuard, GriefPrevention, Vault, Citadel] softdepend: [LWC, LogBlock, WorldGuard, GriefPrevention, Vault, Citadel]
authors: [Milan Albrecht, Frank Baumann, ProgrammerDan, Daniel Saukel] authors: [Milan Albrecht, Frank Baumann, ProgrammerDan, Daniel Saukel]
+2
View File
@@ -90,7 +90,9 @@ public class BEffect {
} }
duration *= 20; duration *= 20;
if (!P.use1_14) {
duration /= type.getDurationModifier(); duration /= type.getDurationModifier();
}
type.createEffect(duration, lvl - 1).apply(player); type.createEffect(duration, lvl - 1).apply(player);
} }
+1
View File
@@ -110,6 +110,7 @@ public class BIngredients {
potionMeta.setDisplayName(P.p.color("&f" + cookedName)); potionMeta.setDisplayName(P.p.color("&f" + cookedName));
if (!P.use1_14) { if (!P.use1_14) {
// Before 1.14 the effects duration would strangely be only a quarter of what we tell it to be // 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; uid *= 4;
} }
// This effect stores the UID in its Duration // This effect stores the UID in its Duration
+22 -10
View File
@@ -469,11 +469,14 @@ public class BPlayer {
public void drunkEffects(Player player) { public void drunkEffects(Player player) {
int duration = 10 - getQuality(); int duration = 10 - getQuality();
duration += drunkeness / 2; duration += drunkeness / 2;
duration *= 20;
if (duration > 960) {
duration *= 5; duration *= 5;
} else if (duration < 460) { if (duration > 240) {
duration = 460; duration *= 5;
} else if (duration < 115) {
duration = 115;
}
if (!P.use1_14) {
duration *= 4;
} }
PotionEffectType.CONFUSION.createEffect(duration, 0).apply(player); PotionEffectType.CONFUSION.createEffect(duration, 0).apply(player);
} }
@@ -481,15 +484,18 @@ public class BPlayer {
public static void addQualityEffects(int quality, int brewAlc, Player player) { public static void addQualityEffects(int quality, int brewAlc, Player player) {
int duration = 7 - quality; int duration = 7 - quality;
if (quality == 0) { if (quality == 0) {
duration *= 500; duration *= 125;
} else if (quality <= 5) { } else if (quality <= 5) {
duration *= 250; duration *= 62;
} else { } else {
duration = 100; duration = 25;
if (brewAlc <= 10) { if (brewAlc <= 10) {
duration = 0; duration = 0;
} }
} }
if (!P.use1_14) {
duration *= 4;
}
if (duration > 0) { if (duration > 0) {
PotionEffectType.POISON.createEffect(duration, 0).apply(player); PotionEffectType.POISON.createEffect(duration, 0).apply(player);
} }
@@ -498,9 +504,12 @@ public class BPlayer {
if (quality <= 5) { if (quality <= 5) {
duration = 10 - quality; duration = 10 - quality;
duration += brewAlc; duration += brewAlc;
duration *= 60; duration *= 15;
} else { } else {
duration = 120; duration = 30;
}
if (!P.use1_14) {
duration *= 4;
} }
PotionEffectType.BLINDNESS.createEffect(duration, 0).apply(player); PotionEffectType.BLINDNESS.createEffect(duration, 0).apply(player);
} }
@@ -516,7 +525,10 @@ public class BPlayer {
} }
public void hangoverEffects(final Player player) { 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; int amplifier = getHangoverQuality() / 3;
PotionEffectType.SLOW.createEffect(duration, amplifier).apply(player); PotionEffectType.SLOW.createEffect(duration, amplifier).apply(player);
+1
View File
@@ -267,6 +267,7 @@ public class BRecipe {
potionMeta.setDisplayName(P.p.color("&f" + getName(quality))); potionMeta.setDisplayName(P.p.color("&f" + getName(quality)));
if (!P.use1_14) { if (!P.use1_14) {
// Before 1.14 the effects duration would strangely be only a quarter of what we tell it to be // 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; uid *= 4;
} }
// This effect stores the UID in its Duration // This effect stores the UID in its Duration
+5 -1
View File
@@ -160,7 +160,11 @@ public class Brew {
int uid = generateUID(); int uid = generateUID();
clone(uid); clone(uid);
PotionMeta meta = (PotionMeta) copy.getItemMeta(); 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); copy.setItemMeta(meta);
return copy; return copy;
} }