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

@ -78,37 +78,37 @@ public class Challenge {
}
}
}
// GETTERS
public ChallengeCategory getCategory() {
return category;
}
public int getId() {
return id;
}
public String getName() {
return name;
}
public int getMaxTimes() {
return maxTimes;
}
public boolean isShowInChat() {
return showInChat;
}
public List<Peer<Type, Object>> getRequires() {
return requires;
}
public List<Peer<Type, Object>> getRewards() {
return rewards;
}
public ItemChallenge getItem() {
return item;
}
@ -439,7 +439,7 @@ public class Challenge {
* <li>7 = lingering extended</li>
* <li>8 = lingering ++</li>
* </ul>
*
*
* @param is
* @param type
* @param data
@ -468,7 +468,7 @@ public class Challenge {
/**
* Try to convert the value to a useable object used later
*
*
* @param value
* The value to convert
* @return A useable object required
@ -477,7 +477,7 @@ public class Challenge {
/**
* Check if specific player has requirement for specific object
*
*
* @param p
* The player
* @param obj
@ -488,7 +488,7 @@ public class Challenge {
/**
* Execute an action associated with specific object for specific player
*
*
* @param p
* The player
* @param obj
@ -498,7 +498,7 @@ public class Challenge {
/**
* Give a reward to specific player for specific object
*
*
* @param p
* The player
* @param obj

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");
}