Skip to content

Commit

Permalink
Pr commentaries resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlammar committed Nov 14, 2021
1 parent 08cb90f commit 7729565
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

strategy:
matrix:
java: [8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
java: [8, 11, 16, 17]

steps:
- name: Checkout
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/fr/moribus/imageonmap/commands/IoMCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,12 @@ public abstract class IoMCommand extends Command {


protected boolean checkHostingSite(URL url) {
PluginLogger.info("allow list " + PluginConfiguration.ALLOWLIST_HOSTINGSITE.get());
String urlsString = PluginConfiguration.ALLOWLIST_HOSTINGSITE.get();
if (urlsString.trim().equals("")) {
if (urlsString.trim().isEmpty()) {
return true;
}
String[] hosts = urlsString.trim().replaceAll("https://","").split(",");
for (String host : hosts) {
PluginLogger.info(host);
PluginLogger.info(url.getHost());
if (url.getHost().equals(host.trim())) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,19 @@ protected void run() throws CommandException {
int imageCount = MapManager.getPlayerMapStore(player.getUniqueId()).getImagesCount();
if (imageLimit <= imageCount) {
throwInvalidArgument(
I.t("Your image limit is set to {0} and you currently have {1} ", imageLimit, imageCount));
I.t("Your image limit is set to {0} and you currently have {1} loaded image(s)",
imageLimit,
imageCount));
}
}
if (!Permissions.BYPASS_MAP_LIMIT.grantedTo(player)) {
int mapLimit = Permissions.NEW.getLimitPermission(player, Permissions.LimitType.map);
int mapCount = MapManager.getPlayerMapStore(player.getUniqueId()).getMapCount();
if (mapLimit <= mapCount) {
throwInvalidArgument(
I.t("Your map limit is set to {0} and you currently have {1} ", mapLimit, mapCount));
I.t("Your map limit is set to {0} and you currently have {1} loaded map(s)",
mapLimit,
mapCount));
}
}
try {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ public void rename() {
}, map.getName(), this);

} catch (IllegalStateException e) {
PluginLogger.info("error while renaming");
PluginLogger.error("Error while renaming map: ", e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@

import fr.moribus.imageonmap.Permissions;
import fr.moribus.imageonmap.PluginConfiguration;
import fr.moribus.imageonmap.commands.IoMCommand;
import fr.moribus.imageonmap.map.ImageMap;
import fr.moribus.imageonmap.map.MapManager;
import fr.zcraft.quartzlib.components.i18n.I;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ public void onEntityDamageByBlockEvent(EntityDamageByBlockEvent event) {
@EventHandler
public void onHangingBreakEvent(HangingBreakEvent event) {
Entity entity = event.getEntity();
PluginLogger.info("entity " + entity.toString());
if (!(entity instanceof ItemFrame)) {
return;
}
Expand Down

0 comments on commit 7729565

Please sign in to comment.