Skip to content

Commit

Permalink
fix: fixed drug tools to work again with drug set enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Chafficui committed Nov 30, 2022
1 parent 3aa6e8e commit 9877ca8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>de.chafficplugins</groupId>
<artifactId>MyTrip</artifactId>
<version>0.7.4</version>
<version>0.7.5</version>
<packaging>jar</packaging>

<name>MyTrip</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ public void onDrugCraft(PrepareItemCraftEvent e) {
e.getInventory().setResult(new ItemStack(Material.AIR));
}
} else {
if (crucialItem instanceof MyDrug) {
e.getInventory().setResult(new ItemStack(Material.AIR));
} else if (crucialItem instanceof DrugTool) {
if (crucialItem instanceof DrugTool) {
e.getInventory().setResult(crucialItem.getItemStack());
if (!PlayerUtils.hasOnePermissions((entity), PERM_CRAFT_ANY, PERM_CRAFT_ + crucialItem.getName())) {
e.getInventory().setResult(new ItemStack(Material.AIR));
}
} else if (crucialItem instanceof MyDrug) {
e.getInventory().setResult(new ItemStack(Material.AIR));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ public static void loadAll() throws IOException, CrucialException {
}.getType());
for (DrugTool item : tools) {
item.unregister();
if(plugin.getConfigBoolean(ConfigStrings.DISABLE_DRUG_SET) )
if(plugin.getConfigBoolean(ConfigStrings.DISABLE_DRUG_SET) && item.getId().equals(ConfigStrings.DRUG_SET_UUID))
continue;
item.register();
}
if (tools == null) {
Expand Down

0 comments on commit 9877ca8

Please sign in to comment.