1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-03-12 14:49:37 +01:00

Add \n newline support for jobs description

This commit is contained in:
montlikadani 2020-07-14 08:22:12 +02:00
parent 92cbf5c9ad
commit 3fceed1beb
4 changed files with 3 additions and 10 deletions

View File

@ -100,7 +100,7 @@ public class GuiManager {
else else
Lore.add(Jobs.getLanguage().getMessage("command.browse.output.bonus", "[amount]", (int) (job.getBonus() * 100))); Lore.add(Jobs.getLanguage().getMessage("command.browse.output.bonus", "[amount]", (int) (job.getBonus() * 100)));
Lore.addAll(Arrays.asList(job.getDescription().split("/n"))); Lore.addAll(Arrays.asList(job.getDescription().contains("/n") ? job.getDescription().split("/n") : job.getDescription().split("\n")));
if (job.getMaxSlots() != null) if (job.getMaxSlots() != null)
Lore.add(Jobs.getLanguage().getMessage("command.info.gui.leftSlots") + ((job.getMaxSlots() - Jobs.getUsedSlots(job)) > 0 ? (job.getMaxSlots() - Jobs Lore.add(Jobs.getLanguage().getMessage("command.info.gui.leftSlots") + ((job.getMaxSlots() - Jobs.getUsedSlots(job)) > 0 ? (job.getMaxSlots() - Jobs

View File

@ -1134,7 +1134,6 @@ public class Jobs extends JavaPlugin {
} }
expiredJobs.forEach(j -> getPlayerManager().leaveJob(jPlayer, j)); expiredJobs.forEach(j -> getPlayerManager().leaveJob(jPlayer, j));
expiredJobs.clear();
} }
} }

View File

@ -95,7 +95,7 @@ public class GeneralConfigManager {
CancelCowMilking, fixAtMaxLevel, TitleChangeChat, TitleChangeActionBar, LevelChangeChat, CancelCowMilking, fixAtMaxLevel, TitleChangeChat, TitleChangeActionBar, LevelChangeChat,
LevelChangeActionBar, SoundLevelupUse, SoundTitleChangeUse, UseServerAccount, EmptyServerAccountChat, LevelChangeActionBar, SoundLevelupUse, SoundTitleChangeUse, UseServerAccount, EmptyServerAccountChat,
EmptyServerAccountActionBar, ActionBarsMessageByDefault, ShowTotalWorkers, ShowPenaltyBonus, useDynamicPayment, EmptyServerAccountActionBar, ActionBarsMessageByDefault, ShowTotalWorkers, ShowPenaltyBonus, useDynamicPayment,
JobsGUIOpenOnBrowse, JobsGUIShowChatBrowse, JobsGUISwitcheButtons, UseInversedClickToLeave, ShowActionNames, JobsGUIOpenOnBrowse, JobsGUIShowChatBrowse, JobsGUISwitcheButtons, ShowActionNames,
DisableJoiningJobThroughGui, FireworkLevelupUse, UseRandom, UseFlicker, UseTrail, UsePerPermissionForLeaving, DisableJoiningJobThroughGui, FireworkLevelupUse, UseRandom, UseFlicker, UseTrail, UsePerPermissionForLeaving,
EnableConfirmation, FilterHiddenPlayerFromTabComplete, jobsInfoOpensBrowse, MonsterDamageUse = false, useMaxPaymentCurve, EnableConfirmation, FilterHiddenPlayerFromTabComplete, jobsInfoOpensBrowse, MonsterDamageUse = false, useMaxPaymentCurve,
hideJobsInfoWithoutPermission, UseTaxes, TransferToServerAccount, TakeFromPlayersPayment, AutoJobJoinUse, AllowDelevel, hideJobsInfoWithoutPermission, UseTaxes, TransferToServerAccount, TakeFromPlayersPayment, AutoJobJoinUse, AllowDelevel,
@ -944,10 +944,6 @@ public class GeneralConfigManager {
c.addComment("JobsGUI.SwitcheButtons", "With true left mouse button will join job and right will show more info.", c.addComment("JobsGUI.SwitcheButtons", "With true left mouse button will join job and right will show more info.",
"With false left mouse button will show more info, right will join job or inversely.", "Don't forget to adjust locale file!"); "With false left mouse button will show more info, right will join job or inversely.", "Don't forget to adjust locale file!");
JobsGUISwitcheButtons = c.get("JobsGUI.SwitcheButtons", false); JobsGUISwitcheButtons = c.get("JobsGUI.SwitcheButtons", false);
c.addComment("JobsGUI.UseInversedClickToLeave", "Do you want to use the left/right click button to leave from job?",
"This option click type depend from SwitcheButtons option, if true using the left button and inversely.",
"Don't forget to adjust locale file");
UseInversedClickToLeave = c.get("JobsGUI.UseInversedClickToLeave", false);
c.addComment("JobsGUI.DisableJoiningJobThroughGui", "Allows players to join a specified job via GUI."); c.addComment("JobsGUI.DisableJoiningJobThroughGui", "Allows players to join a specified job via GUI.");
DisableJoiningJobThroughGui = c.get("JobsGUI.DisableJoiningJobThroughGui", false); DisableJoiningJobThroughGui = c.get("JobsGUI.DisableJoiningJobThroughGui", false);
c.addComment("JobsGUI.ShowActionNames", "Do you want to show the action names in GUI?"); c.addComment("JobsGUI.ShowActionNames", "Do you want to show the action names in GUI?");

View File

@ -1707,7 +1707,7 @@ public abstract class JobsDAO {
prest = conn.prepareStatement("SELECT * FROM `" + DBTables.UsersTable.getTableName() + "` WHERE `" + UserTableFields.player_uuid.getCollumn() + "` = ?;"); prest = conn.prepareStatement("SELECT * FROM `" + DBTables.UsersTable.getTableName() + "` WHERE `" + UserTableFields.player_uuid.getCollumn() + "` = ?;");
prest.setString(1, uuid.toString()); prest.setString(1, uuid.toString());
res = prest.executeQuery(); res = prest.executeQuery();
if (res.next()) { while (res.next()) {
pInfo = new PlayerInfo( pInfo = new PlayerInfo(
res.getString(UserTableFields.username.getCollumn()), res.getString(UserTableFields.username.getCollumn()),
res.getInt("id"), uuid, res.getInt("id"), uuid,
@ -1763,8 +1763,6 @@ public abstract class JobsDAO {
ps.execute(); ps.execute();
close(ps); close(ps);
} }
uuids.clear();
} catch (SQLException e) { } catch (SQLException e) {
e.printStackTrace(); e.printStackTrace();
} finally { } finally {