Merge from upstream

# Conflicts:
#	pom.xml
#	src/main/java/com/songoda/skyblock/challenge/challenge/Challenge.java
This commit is contained in:
Fabrizio La Rosa 2020-06-15 02:18:33 +02:00
commit 6a8d883275
8 changed files with 26 additions and 27 deletions

View File

@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.songoda</groupId>
<artifactId>skyblock</artifactId>
<version>2.2.15-LaborPatch-0.0.3</version>
<version>2.2.16-LaborPatch-0.0.3</version>
<packaging>jar</packaging>
<build>
<defaultGoal>clean install</defaultGoal>

View File

@ -57,10 +57,7 @@ public class ChallengeCategory {
CompatibleMaterial compatibleMaterial = CompatibleMaterial.getMaterial(strItem);
if (compatibleMaterial == null)
throw new IllegalArgumentException("Item " + strItem + " isn't a correct material");
Material item = compatibleMaterial.getMaterial();
if (item == null)
throw new IllegalArgumentException("Item " + strItem + " isn't a correct material");
ItemChallenge ic = new ItemChallenge(show, row, col, item, amount, lore);
ItemChallenge ic = new ItemChallenge(show, row, col, compatibleMaterial, amount, lore);
Challenge c = new Challenge(this, id, name, maxTimes, showInChat, require, reward, ic);
challenges.put(id, c);
} catch (IllegalArgumentException ex) {

View File

@ -4,6 +4,7 @@ import java.io.File;
import java.util.List;
import java.util.UUID;
import com.songoda.core.compatibility.CompatibleMaterial;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.configuration.file.FileConfiguration;
@ -18,13 +19,13 @@ public class ItemChallenge {
private boolean show;
private int row;
private int col;
private Material type;
private CompatibleMaterial type;
private int amount;
private List<String> lore;
private String itemTitle;
public ItemChallenge(boolean show, int row, int col, Material type, int amount, List<String> lore) {
public ItemChallenge(boolean show, int row, int col, CompatibleMaterial type, int amount, List<String> lore) {
this.show = show;
this.row = row;
this.col = col;
@ -39,7 +40,8 @@ public class ItemChallenge {
}
public ItemStack createItem(UUID player, int amount) {
ItemStack is = new ItemStack(type, this.amount);
ItemStack is = type.getItem();
is.setAmount(this.amount);
// Air
ItemMeta im = is.getItemMeta();
if (im != null) {
@ -73,7 +75,7 @@ public class ItemChallenge {
return col;
}
public Material getType() {
public CompatibleMaterial getType() {
return type;
}

View File

@ -46,7 +46,7 @@ public class GuiPermissionsSelector extends Gui {
setButton(0, GuiUtils.createButtonItem(CompatibleMaterial.OAK_FENCE_GATE,
TextUtils.formatText(configLoad.getString("Menu.Settings.Categories.Item.Exit.Displayname"))), (event) -> {
CompatibleSound.BLOCK_CHEST_CLOSE.play(event.player);
guiManager.showGUI(event.player, returnGui);
event.player.closeInventory();
});
if (isCoop)

View File

@ -65,7 +65,7 @@ public abstract class BasicPermission {
*
* @return
*/
public boolean extraCheck() {
public boolean overridingCheck() {
return true;
}

View File

@ -152,7 +152,7 @@ public class PermissionManager {
BasicPermission permission = wrapper.getPermission();
if (permission.extraCheck() && hasPermission(player, island, permission))
if (permission.overridingCheck() || hasPermission(player, island, permission))
continue;
try {

View File

@ -22,7 +22,7 @@ public class HungerPermission extends ListeningPermission {
}
@Override
public boolean extraCheck() {
public boolean overridingCheck() {
return plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "config.yml"))
.getFileConfiguration().getBoolean("Island.Settings.Hunger.Enable");
}