mirror of
https://github.com/exituser/Brewery.git
synced 2026-09-17 06:38:56 +00:00
Add StumblePercent #196
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user