9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-26 18:39:23 +00:00

Add configurable death item drop knockback (#326)

* feat: add configurable death item drop knockback settings

* Add config option xd
This commit is contained in:
adabugra
2025-05-16 01:30:59 +03:00
committed by GitHub
parent 2a72c42863
commit b1e7469480
2 changed files with 67 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
package org.dreeam.leaf.config.modules.gameplay;
import org.dreeam.leaf.config.ConfigModules;
import org.dreeam.leaf.config.EnumConfigCategory;
public class DeathItemDropKnockback extends ConfigModules {
public String getBasePath() {
return EnumConfigCategory.GAMEPLAY.getBaseKeyName() + ".death-item-drop-knockback";
}
public static boolean dropAround = true;
public static double horizontalForce = 0.5;
public static double verticalForce = 0.2;
@Override
public void onLoaded() {
dropAround = config.getBoolean(getBasePath() + ".drop-around", dropAround,
config.pickStringRegionBased(
"If true, items will drop randomly around the player on death.",
"如果为 “true”物品会在玩家死亡时随机掉落在其周围."
));
horizontalForce = config.getDouble(getBasePath() + ".horizontal-force", horizontalForce,
config.pickStringRegionBased(
"Base speed for horizontal velocity when randomly dropping items.",
"随机掉落物品时水平速度的基本速度."
));
verticalForce = config.getDouble(getBasePath() + ".vertical-force", verticalForce,
config.pickStringRegionBased(
"Upward motion for randomly dropped items.",
"随机掉落物品的向上运动."
));
}
}