1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-01-07 00:38:42 +01:00

There is no limit in gui title

This commit is contained in:
montlikadani 2021-02-09 12:06:14 +01:00
parent 078c66a321
commit 27645ec438
3 changed files with 6 additions and 19 deletions

View File

@ -159,10 +159,6 @@ public class CMIGui {
} }
public void setTitle(String title) { public void setTitle(String title) {
if (title.length() > 32) {
title = title.substring(0, 31) + "~";
}
this.title = title; this.title = title;
} }

View File

@ -10,7 +10,6 @@ import java.util.Map.Entry;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.metadata.FixedMetadataValue; import org.bukkit.metadata.FixedMetadataValue;
import org.bukkit.metadata.MetadataValue; import org.bukkit.metadata.MetadataValue;
@ -182,17 +181,15 @@ public class BlockOwnerShip {
f = f2; f = f2;
FileConfiguration config = f.getConfig();
String path = (type == BlockTypes.FURNACE ? "Furnace" String path = (type == BlockTypes.FURNACE ? "Furnace"
: type == BlockTypes.BLAST_FURNACE ? "BlastFurnace" : type == BlockTypes.BLAST_FURNACE ? "BlastFurnace"
: type == BlockTypes.BREWING_STAND ? "Brewing" : type == BlockTypes.SMOKER ? "Smoker" : ""); : type == BlockTypes.BREWING_STAND ? "Brewing" : type == BlockTypes.SMOKER ? "Smoker" : "");
if (isReassignDisabled() || !config.isConfigurationSection(path)) if (isReassignDisabled() || !f.getConfig().isConfigurationSection(path))
return; return;
int total = 0; int total = 0;
ConfigurationSection section = config.getConfigurationSection(path); ConfigurationSection section = f.getConfig().getConfigurationSection(path);
for (String one : section.getKeys(false)) { for (String one : section.getKeys(false)) {
String value = section.getString(one); String value = section.getString(one);
List<String> ls = new ArrayList<>(); List<String> ls = new ArrayList<>();
@ -249,12 +246,10 @@ public class BlockOwnerShip {
return; return;
} }
FileConfiguration config = f.getConfig();
String path = (type == BlockTypes.FURNACE ? "Furnace" String path = (type == BlockTypes.FURNACE ? "Furnace"
: type == BlockTypes.BLAST_FURNACE ? "BlastFurnace" : type == BlockTypes.BLAST_FURNACE ? "BlastFurnace"
: type == BlockTypes.BREWING_STAND ? "Brewing" : type == BlockTypes.SMOKER ? "Smoker" : ""); : type == BlockTypes.BREWING_STAND ? "Brewing" : type == BlockTypes.SMOKER ? "Smoker" : "");
config.set(path, null); f.getConfig().set(path, null);
for (Entry<UUID, List<blockLoc>> one : blockOwnerShips.entrySet()) { for (Entry<UUID, List<blockLoc>> one : blockOwnerShips.entrySet()) {
String full = ""; String full = "";
@ -266,7 +261,7 @@ public class BlockOwnerShip {
} }
if (!full.isEmpty()) if (!full.isEmpty())
config.set(path + "." + one.getKey().toString(), full); f.getConfig().set(path + "." + one.getKey().toString(), full);
} }
f.saveConfig(); f.saveConfig();

View File

@ -490,12 +490,8 @@ public class JobsPaymentListener implements Listener {
return; return;
if (event.getState() == PlayerFishEvent.State.CAUGHT_FISH && event.getCaught() instanceof Item) { if (event.getState() == PlayerFishEvent.State.CAUGHT_FISH && event.getCaught() instanceof Item) {
JobsPlayer jPlayer = Jobs.getPlayerManager().getJobsPlayer(player); Jobs.action(Jobs.getPlayerManager().getJobsPlayer(player),
if (jPlayer == null) new ItemActionInfo(((Item) event.getCaught()).getItemStack(), ActionType.FISH));
return;
ItemStack items = ((Item) event.getCaught()).getItemStack();
Jobs.action(jPlayer, new ItemActionInfo(items, ActionType.FISH));
} }
} }