Add StumblePercent #196

This commit is contained in:
Sn0wStorm
2020-11-11 16:29:33 +01:00
parent 5b8ab83734
commit 823f5a4204
12 changed files with 134 additions and 101 deletions
+2 -1
View File
@@ -374,7 +374,7 @@ public class BPlayer {
// player is drunk
public void move(PlayerMoveEvent event) {
// has player more alc than 10
if (drunkeness >= 10) {
if (drunkeness >= 10 && BConfig.stumbleModifier > 0.001f) {
if (drunkeness <= 100) {
if (time > 1) {
time--;
@@ -398,6 +398,7 @@ public class BPlayer {
push.setX(Math.random() - 0.5);
push.setZ(Math.random() - 0.5);
}
push.multiply(BConfig.stumbleModifier);
PlayerPushEvent pushEvent = new PlayerPushEvent(player, push, this);
P.p.getServer().getPluginManager().callEvent(pushEvent);
push = pushEvent.getPush();
@@ -71,6 +71,7 @@ public class BConfig {
public static Material pukeItem;
public static boolean showStatusOnDrink;
public static int pukeDespawntime;
public static float stumbleModifier;
public static int hangoverTime;
public static boolean overdrinkKick;
public static boolean enableHome;
@@ -237,6 +238,7 @@ public class BConfig {
enableLoginDisallow = config.getBoolean("enableLoginDisallow", false);
enablePuke = config.getBoolean("enablePuke", false);
pukeDespawntime = config.getInt("pukeDespawntime", 60) * 20;
stumbleModifier = ((float) config.getInt("stumblePercent", 100)) / 100f;
showStatusOnDrink = config.getBoolean("showStatusOnDrink", false);
homeType = config.getString("homeType", null);
craftSealingTable = config.getBoolean("craftSealingTable", false);