9
0
mirror of https://gitlab.com/SamB440/rpgregions-2.git synced 2025-12-24 01:09:27 +00:00

Add undiscovered icon, fix javadocs

This commit is contained in:
SamB440
2020-02-18 16:45:55 +00:00
parent 730ff3e7f7
commit 349b6351af
7 changed files with 50 additions and 14 deletions

View File

@@ -15,19 +15,39 @@ public abstract class RegionEffect {
this.ignoreItems = ignoreItems;
}
/**
* Effects the specified player
* @param player
*/
public abstract void effect(Player player);
/**
* Whether the items are required to be worn in armour slots
* @return whether items should be worn in armour slots
*/
public boolean isWearingRequired() {
return wearingRequired;
}
/**
* The items that a player should have to not be effected
* @return ignored items
*/
public List<ItemStack> getIgnoreItems() {
return ignoreItems;
}
/**
* Whether the ItemStack is within #getIgnoreItems()
* @param item
* @return true if item is ignored
*/
public boolean shouldIgnore(ItemStack item) {
return ignoreItems.contains(item);
}
/**
* User friendly name of this effect.
* @return name of effect
*/
public abstract String getName();
}

View File

@@ -58,14 +58,6 @@ shadowJar {
relocate 'io.papermc.lib', 'net.islandearth.rpgregions.paperlib'
}
javadoc {
exclude 'net/islandearth/rpgregions/translation/**'
exclude 'net/islandearth/rpgregions/listener/**'
exclude 'net/islandearth/rpgregions/gson/**'
exclude 'net/islandearth/rpgregions/commands/**'
exclude 'net/islandearth/rpgregions/utils/**'
}
build.dependsOn shadowJar
import org.apache.tools.ant.filters.ReplaceTokens

View File

@@ -60,6 +60,14 @@ dependencies {
compileOnly project(':api')
}
javadoc {
exclude 'net/islandearth/rpgregions/translation/**'
exclude 'net/islandearth/rpgregions/listener/**'
exclude 'net/islandearth/rpgregions/gson/**'
exclude 'net/islandearth/rpgregions/commands/**'
exclude 'net/islandearth/rpgregions/utils/**'
}
import org.apache.tools.ant.filters.ReplaceTokens
processResources {

View File

@@ -198,7 +198,7 @@ public class DiscoveryGUI extends RPGRegionsGUI {
&& hasDiscovered
? Translations.TELEPORT.get(player)
: null;
items.add(new GuiItem(new ItemStackBuilder(configuredRegion.getIcon())
items.add(new GuiItem(new ItemStackBuilder(hasDiscovered ? configuredRegion.getIcon() : configuredRegion.getUndiscoveredIcon())
.withName(colour + configuredRegion.getCustomName())
.withLore(lore)
.withLore(lore2)

View File

@@ -27,6 +27,7 @@ public class ConfiguredRegion {
private final List<DiscoveryReward> rewards;
private final Sound sound;
private final Material icon;
private final Material undiscoveredIcon;
private final boolean showCoords;
private final int x;
private final int y;
@@ -46,6 +47,7 @@ public class ConfiguredRegion {
this.rewards = rewards;
this.sound = XSound.UI_TOAST_CHALLENGE_COMPLETE.parseSound();
this.icon = XMaterial.TOTEM_OF_UNDYING.parseMaterial();
this.undiscoveredIcon = XMaterial.TOTEM_OF_UNDYING.parseMaterial();
this.showCoords = false;
this.x = x;
this.y = y;
@@ -67,6 +69,7 @@ public class ConfiguredRegion {
this.rewards = rewards;
this.sound = sound;
this.icon = icon;
this.undiscoveredIcon = icon;
this.showCoords = false;
this.x = x;
this.y = y;
@@ -99,6 +102,10 @@ public class ConfiguredRegion {
return icon;
}
public Material getUndiscoveredIcon() {
return undiscoveredIcon;
}
public int getX() {
return x;
}

View File

@@ -15,7 +15,13 @@ import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.*;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
import java.util.regex.Pattern;
@@ -60,7 +66,6 @@ public enum XMaterial {
ACTIVATOR_RAIL,
/**
* https://minecraft.gamepedia.com/Air
* {@link Material#isAir()}
*
* @see #VOID_AIR
* @see #CAVE_AIR

View File

@@ -4,7 +4,6 @@ import com.google.common.base.Enums;
import com.google.common.base.Strings;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import jdk.internal.jline.internal.Nullable;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.Validate;
import org.apache.commons.lang.WordUtils;
@@ -17,8 +16,13 @@ import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.*;
import java.util.Arrays;
import java.util.EnumSet;
import java.util.Locale;
import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
import java.util.regex.Pattern;