Fixed typo

This commit is contained in:
Brianna 2019-05-23 19:21:59 -04:00
parent 994ecfd8b2
commit 6108d13c79
7 changed files with 14 additions and 10 deletions

View File

@ -5,7 +5,7 @@ variables:
name: "UltimateStacker"
suffex: "Legacy"
path: "/builds/$CI_PROJECT_PATH"
version: "1.2.4"
version: "1.2.5"
build:
stage: build

View File

@ -42,7 +42,7 @@ public abstract class Hologram {
public void add(SpawnerStack spawner) {
int amount = spawner.getAmount();
if (spawner.getLocation().getBlock().getType() != (instance.isServerVersion(ServerVersion.V1_13) ? Material.SPAWNER : Material.valueOf("MOB_SPAWNER"))) return;
if (spawner.getLocation().getBlock().getType() != (instance.isServerVersionAtLeast(ServerVersion.V1_13) ? Material.SPAWNER : Material.valueOf("MOB_SPAWNER"))) return;
CreatureSpawner creatureSpawner = (CreatureSpawner) spawner.getLocation().getBlock().getState();
String name = Methods.compileSpawnerName(creatureSpawner.getSpawnedType(), amount);
@ -56,7 +56,7 @@ public abstract class Hologram {
public void update(SpawnerStack spawner) {
int amount = spawner.getAmount();
if (spawner.getLocation().getBlock().getType() != (instance.isServerVersion(ServerVersion.V1_13) ? Material.SPAWNER : Material.valueOf("MOB_SPAWNER"))) return;
if (spawner.getLocation().getBlock().getType() != (instance.isServerVersionAtLeast(ServerVersion.V1_13) ? Material.SPAWNER : Material.valueOf("MOB_SPAWNER"))) return;
CreatureSpawner creatureSpawner = (CreatureSpawner) spawner.getLocation().getBlock().getState();
String name = Methods.compileSpawnerName(creatureSpawner.getSpawnedType(), amount);
@ -71,7 +71,7 @@ public abstract class Hologram {
protected abstract void update(Location location, String line);
public void processChange(Block block) {
if (block.getType() != (instance.isServerVersion(ServerVersion.V1_13) ? Material.SPAWNER : Material.valueOf("MOB_SPAWNER"))) return;
if (block.getType() != (instance.isServerVersionAtLeast(ServerVersion.V1_13) ? Material.SPAWNER : Material.valueOf("MOB_SPAWNER"))) return;
SpawnerStack spawner = instance.getSpawnerStackManager().getSpawner(block);
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(instance, () ->

View File

@ -39,7 +39,10 @@ public class BlockListeners implements Listener {
Player player = event.getPlayer();
ItemStack item = event.getPlayer().getInventory().getItemInHand();
if (block == null || block.getType() != (instance.isServerVersion(ServerVersion.V1_13) ? Material.SPAWNER : Material.valueOf("MOB_SPAWNER")) || item.getType() != (instance.isServerVersion(ServerVersion.V1_13) ? Material.SPAWNER : Material.valueOf("MOB_SPAWNER")) || event.getAction() == Action.LEFT_CLICK_BLOCK) return;
if (block == null
|| block.getType() != (instance.isServerVersionAtLeast(ServerVersion.V1_13) ? Material.SPAWNER : Material.valueOf("MOB_SPAWNER"))
|| item.getType() != (instance.isServerVersionAtLeast(ServerVersion.V1_13) ? Material.SPAWNER : Material.valueOf("MOB_SPAWNER"))
|| event.getAction() == Action.LEFT_CLICK_BLOCK) return;
List<String> disabledWorlds = Setting.DISABLED_WORLDS.getStringList();
if (disabledWorlds.stream().anyMatch(worldStr -> event.getPlayer().getWorld().getName().equalsIgnoreCase(worldStr))) return;
@ -95,7 +98,7 @@ public class BlockListeners implements Listener {
if (!event.isCancelled()) {
if (block == null
|| block.getType() != (instance.isServerVersion(ServerVersion.V1_13) ? Material.SPAWNER : Material.valueOf("MOB_SPAWNER"))
|| block.getType() != (instance.isServerVersionAtLeast(ServerVersion.V1_13) ? Material.SPAWNER : Material.valueOf("MOB_SPAWNER"))
|| !instance.spawnersEnabled())
return;
@ -117,7 +120,7 @@ public class BlockListeners implements Listener {
@EventHandler(priority = EventPriority.HIGHEST)
public void onBlockBreak(BlockBreakEvent event) {
Block block = event.getBlock();
if (block.getType() != (instance.isServerVersion(ServerVersion.V1_13) ? Material.SPAWNER : Material.valueOf("MOB_SPAWNER"))) return;
if (block.getType() != (instance.isServerVersionAtLeast(ServerVersion.V1_13) ? Material.SPAWNER : Material.valueOf("MOB_SPAWNER"))) return;
if (!instance.spawnersEnabled()) return;
event.setExpToDrop(0);

View File

@ -41,7 +41,7 @@ public class EntityListeners implements Listener {
List<Block> destroyed = event.blockList();
for (Block block : destroyed) {
if (block.getType() != (instance.isServerVersion(ServerVersion.V1_13) ? Material.SPAWNER : Material.valueOf("MOB_SPAWNER"))) continue;
if (block.getType() != (instance.isServerVersionAtLeast(ServerVersion.V1_13) ? Material.SPAWNER : Material.valueOf("MOB_SPAWNER"))) continue;
Location spawnerLocation = block.getLocation();
SpawnerStack stack = instance.getSpawnerStackManager().getSpawner(spawnerLocation);

View File

@ -47,7 +47,7 @@ public class Methods {
newEntity.getEquipment().clear();
if (killed.getType() == EntityType.PIG_ZOMBIE)
newEntity.getEquipment().setItemInHand(new ItemStack(instance.isServerVersion(ServerVersion.V1_13) ? Material.GOLDEN_SWORD : Material.valueOf("GOLD_SWORD")));
newEntity.getEquipment().setItemInHand(new ItemStack(instance.isServerVersionAtLeast(ServerVersion.V1_13) ? Material.GOLDEN_SWORD : Material.valueOf("GOLD_SWORD")));
if (Bukkit.getPluginManager().isPluginEnabled("EpicSpawners"))
if (killed.hasMetadata("ES"))

View File

@ -9,7 +9,8 @@ public enum ServerVersion {
V1_10("org.bukkit.craftbukkit.v1_10"),
V1_11("org.bukkit.craftbukkit.v1_11"),
V1_12("org.bukkit.craftbukkit.v1_12"),
V1_13("org.bukkit.craftbukkit.v1_13");
V1_13("org.bukkit.craftbukkit.v1_13"),
V1_14("org.bukkit.craftbukkit.v1_14");
private final String packagePrefix;