@@ -83,4 +83,24 @@ public interface CannonConfig extends Config
|
|||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
keyName = "ammoAmount",
|
||||||
|
name = "Ammo left",
|
||||||
|
description = "Configure to set the amount of ammo left to receive ammo left notification"
|
||||||
|
)
|
||||||
|
default int ammoAmount()
|
||||||
|
{
|
||||||
|
return 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
keyName = "notifyAmmoLeft",
|
||||||
|
name = "Ammo left notification",
|
||||||
|
description = "Sends a notification when cannon ammo is under the specified amount"
|
||||||
|
)
|
||||||
|
default boolean notifyAmmoLeft()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -379,6 +379,13 @@ public class CannonPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
return Color.orange;
|
return Color.orange;
|
||||||
}
|
}
|
||||||
|
else if (cballsLeft <= config.ammoAmount())
|
||||||
|
{
|
||||||
|
if (config.notifyAmmoLeft())
|
||||||
|
{
|
||||||
|
notifier.notify("Your cannon has " + config.ammoAmount() + " balls left!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return Color.red;
|
return Color.red;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user