Skip to content

Commit

Permalink
Added translation option for TITLE and SUBTITLE
Browse files Browse the repository at this point in the history
  • Loading branch information
Baktus79 committed Aug 31, 2019
1 parent 25ac926 commit 1cff736
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ private Messages(String fileName) {
NOT_BANNED,
UNVALID_NUMBER,
LIST_HEADER,
LIST_EMPTY;
LIST_EMPTY,
TITLE_MESSAGE,
SUBTITLE_MESSAGE;

private void onLoad() {

Expand All @@ -40,6 +42,8 @@ private void onLoad() {
UNVALID_NUMBER = getString("unvalid-number");
LIST_HEADER = getString("list-header");
LIST_EMPTY = getString("list-empty");
TITLE_MESSAGE = getString("title-message");
SUBTITLE_MESSAGE = getString("subtitle-message");

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import me.ryanhamshire.GriefPrevention.GriefPrevention;
import no.vestlandetmc.BanFromClaim.BfcPlugin;
import no.vestlandetmc.BanFromClaim.config.ClaimData;
import no.vestlandetmc.BanFromClaim.config.Messages;
import no.vestlandetmc.BanFromClaim.handler.MessageHandler;
import no.vestlandetmc.BanFromClaim.handler.UpdateNotification;

Expand All @@ -31,7 +32,7 @@ public void onPlayerEnterClaim(PlayerMoveEvent e) {
GriefPrevention.instance.ejectPlayer(player);

if(!MessageHandler.spamMessageClaim.contains(player.getUniqueId().toString())) {
MessageHandler.sendTitle(player, "&4BANNED", "&CYou are banned from this claim");
MessageHandler.sendTitle(player, Messages.TITLE_MESSAGE, Messages.SUBTITLE_MESSAGE);
MessageHandler.spamMessageClaim.add(player.getUniqueId().toString());


Expand Down
4 changes: 3 additions & 1 deletion src/main/resources/messages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ unbanned-target: '&eYou have been unbanned from &6%claimowner%''s &eclaim by &6%
not-banned: '&4%target% &cis not a valid player name or not banned at your claim.'
unvalid-number: '&cType a valid number.'
list-header: '&e-- === [ &6%claimowner%''s Claim - Banned Players &e] === --'
list-empty: '&cThere are no banned players in this claim.'
list-empty: '&cThere are no banned players in this claim.'
title-message: '&4BANNED'
subtitle-message: '&cYou are banned from this claim'

0 comments on commit 1cff736

Please sign in to comment.