Skip to content

Commit 674a74c

Browse files
committed
Remove some forgotten debug prints. Using getLogger instead of getConsole to print console messages
1 parent 3d9d651 commit 674a74c

5 files changed

Lines changed: 9 additions & 10 deletions

File tree

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<name>BulMultiverse</name>
1010
<description>BulMultiverse is a Minecraft plugin, ultra light and optimized world manager</description>
1111
<url>https://github.com/BulPlugins/BulMultiverse</url>
12-
<version>1.1</version>
12+
<version>1.2</version>
1313

1414
<properties>
1515
<maven.compiler.source>8</maven.compiler.source>

src/main/java/com/alihaine/bulmultiverse/command/LoadCommand.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import com.alihaine.bulmultiverse.BulMultiverse;
66
import com.alihaine.bulmultiverse.file.Message;
77
import com.alihaine.bulmultiverse.world.WorldData;
8-
import org.bukkit.Bukkit;
98
import org.bukkit.command.CommandSender;
109

1110
import java.util.HashMap;
@@ -17,8 +16,6 @@ public class LoadCommand extends BaseCommand {
1716
@Description("Load existing world")
1817
@Syntax("/bmv load [world_name]")
1918
public void onLoad(CommandSender sender, String targetWorld) {
20-
Bukkit.getConsoleSender().sendMessage(targetWorld);
21-
2219
if (!BulMultiverse.getWorldsFile().isWorldFolderExisting(targetWorld)) {
2320
new Message("world_not_found").withPlaceHolder("name", targetWorld).sendMessage(sender);
2421
return;

src/main/java/com/alihaine/bulmultiverse/file/WorldsFile.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public WorldsFile(BulMultiverse bulMultiverseInstance) {
2727
try {
2828
fileConfiguration.load(file);
2929
} catch (IOException | InvalidConfigurationException e) {
30-
Bukkit.getConsoleSender().sendMessage("§c[BulMultiverse] Error with the worlds saver file");
30+
Bukkit.getLogger().severe("Major error with the worlds.yml");
3131
e.printStackTrace();
3232
}
3333
if (fileConfiguration.getConfigurationSection("worlds") == null)
@@ -38,7 +38,7 @@ public void saveFile() {
3838
try {
3939
fileConfiguration.save(file);
4040
} catch (IOException e) {
41-
Bukkit.getConsoleSender().sendMessage("§c[BulMultiverse] Error when trying to save worlds to file");
41+
Bukkit.getLogger().severe("Error when trying to save worlds to file");
4242
}
4343
}
4444

@@ -50,7 +50,6 @@ public void saveWorldDataToFile(WorldData worldData) {
5050
public void removeWorldFromFile(String worldName) {
5151
fileConfiguration.set("worlds." + worldName, null);
5252
saveFile();
53-
Bukkit.getConsoleSender().sendMessage("§eThe world " + worldName + " is removed from worlds.yml file.");
5453
}
5554

5655
public void extractWorldsFromFile() {
@@ -60,7 +59,7 @@ public void extractWorldsFromFile() {
6059

6160
for (String worldName : worldsSection.getKeys(false)) {
6261
if (!isWorldFolderExisting(worldName)) {
63-
Bukkit.getConsoleSender().sendMessage("§cThe world " + worldName + " folder don't exist, but are in worlds.yml. Remove from worlds.yml");
62+
Bukkit.getLogger().info("The world " + worldName + " folder don't exist, but are in worlds.yml. Remove from worlds.yml");
6463
removeWorldFromFile(worldName);
6564
continue;
6665
}

src/main/java/com/alihaine/bulmultiverse/world/WorldData.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public WorldData(ConfigurationSection worldSection) {
2929
try {
3030
optionsAndValue.put(worldOptionManager.getOption(key), value);
3131
} catch (Exception exception) {
32-
Bukkit.getConsoleSender().sendMessage(exception.getMessage());
32+
Bukkit.getLogger().warning(exception.getMessage());
3333
}
3434
});
3535
}
@@ -41,7 +41,9 @@ public void createWorld(CommandSender sender) {
4141
Map<WorldOption, Object> optionsError = new HashMap<>();
4242

4343
Iterator<Map.Entry<WorldOption, Object>> iterator = options.entrySet().iterator();
44-
sender.sendMessage("§e[BulMultiverse] §aStart the creation and loading of the world: §2" + this.getWorldName());
44+
new Message("world_startup_loading")
45+
.withPlaceHolder("name", this.getWorldName())
46+
.sendMessage(sender);
4547
while (iterator.hasNext()) {
4648
Map.Entry<WorldOption, Object> entry = iterator.next();
4749
if (entry.getKey().isWorldRequired())

src/main/resources/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
world_disable_name: [logs, plugins, plugin, bStats, PluginMetrics]
22

33
messages:
4+
world_startup_loading: "&e[BulMultiverse] &aStart the creation and loading of the world: &2%name%"
45
no_world_target: "&e[BulMultiverse] &cYou didn't target any world or world name. &e/bmv help"
56
no_player_target: "&e[BulMultiverse] &cThe target player don't exist or is not connected. &e/bmv help"
67
world_already_exist: "&e[BulMultiverse] &cA world with this name already exist"

0 commit comments

Comments
 (0)