Skip to content

Commit

Permalink
Improves Action debugging in InventoryButton
Browse files Browse the repository at this point in the history
  • Loading branch information
anjoismysign committed Aug 13, 2024
1 parent 7ed800f commit cfcce52
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.jetbrains.annotations.Nullable;
import us.mytheria.bloblib.action.ActionMemo;
import us.mytheria.bloblib.action.ActionType;
import us.mytheria.bloblib.api.BlobLibActionAPI;
import us.mytheria.bloblib.api.BlobLibTranslatableAPI;
import us.mytheria.bloblib.entities.translatable.TranslatableItem;
import us.mytheria.bloblib.exception.ConfigurationFieldException;
Expand Down Expand Up @@ -97,6 +98,8 @@ public static BlobMultiSlotable read(ConfigurationSection section, String key,
String action = null;
if (section.isString("Action"))
action = section.getString("Action");
if (action != null && BlobLibActionAPI.getInstance().getAction(action) == null)
throw new ConfigurationFieldException("'Action' doesn't point to a valid Action: " + action);
ActionType actionType = null;
ConfigurationSection singleActionSection = section.getConfigurationSection("Action");
if (singleActionSection != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.jetbrains.annotations.Nullable;
import us.mytheria.bloblib.action.ActionMemo;
import us.mytheria.bloblib.action.ActionType;
import us.mytheria.bloblib.api.BlobLibActionAPI;
import us.mytheria.bloblib.api.BlobLibTranslatableAPI;
import us.mytheria.bloblib.entities.translatable.TranslatableItem;
import us.mytheria.bloblib.exception.ConfigurationFieldException;
Expand Down Expand Up @@ -107,6 +108,8 @@ public static MetaBlobMultiSlotable read(ConfigurationSection section, String ke
String action = null;
if (section.isString("Action"))
action = section.getString("Action");
if (action != null && BlobLibActionAPI.getInstance().getAction(action) == null)
throw new ConfigurationFieldException("'Action' doesn't point to a valid Action: " + action);
ActionType actionType = null;
ConfigurationSection singleActionSection = section.getConfigurationSection("Action");
if (singleActionSection != null) {
Expand Down

0 comments on commit cfcce52

Please sign in to comment.