mirror of
https://github.com/songoda/EpicFurnaces.git
synced 2025-02-21 14:01:19 +01:00
Bunch of bug fixes, added FabledSkyBlock hook.
This commit is contained in:
parent
4a56cd7a8a
commit
31f06019f5
53
core/pom.xml
53
core/pom.xml
@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<artifactId>EpicFurnaces-Parent</artifactId>
|
||||
<groupId>com.songoda</groupId>
|
||||
<version>4.1.2</version>
|
||||
<version>4.1.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>EpicFurnaces</artifactId>
|
||||
@ -48,6 +48,14 @@
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<relocations>
|
||||
<relocation>
|
||||
<pattern>org.bstats</pattern>
|
||||
<shadedPattern>com.songoda.epicfurnaces</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<resources>
|
||||
@ -58,6 +66,13 @@
|
||||
</resources>
|
||||
</build>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>CodeMC</id>
|
||||
<url>https://repo.codemc.org/repository/maven-public</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
@ -65,6 +80,12 @@
|
||||
<version>1.13.2</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.bstats</groupId>
|
||||
<artifactId>bstats-bukkit</artifactId>
|
||||
<version>1.4</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.gmail.filoghost.holographicdisplays</groupId>
|
||||
<artifactId>holographicdisplays-api</artifactId>
|
||||
@ -74,73 +95,73 @@
|
||||
<dependency>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>craftbukkit-1-13</artifactId>
|
||||
<version>4.1.2</version>
|
||||
<version>4.1.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>craftbukkit-1-8</artifactId>
|
||||
<version>4.1.2</version>
|
||||
<version>4.1.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>askyblock</artifactId>
|
||||
<version>4.1.2</version>
|
||||
<version>4.1.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>factions</artifactId>
|
||||
<version>4.1.2</version>
|
||||
<version>4.1.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>griefprevention</artifactId>
|
||||
<version>4.1.2</version>
|
||||
<version>4.1.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>kingdoms</artifactId>
|
||||
<version>4.1.2</version>
|
||||
<version>4.1.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>plotsquared</artifactId>
|
||||
<version>4.1.2</version>
|
||||
<version>4.1.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>redprotect</artifactId>
|
||||
<version>4.1.2</version>
|
||||
<version>4.1.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>towny</artifactId>
|
||||
<version>4.1.2</version>
|
||||
<version>4.1.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>uskyblock</artifactId>
|
||||
<version>4.1.2</version>
|
||||
<version>4.1.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>worldguard</artifactId>
|
||||
<version>4.1.2</version>
|
||||
<version>4.1.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>worldguard6</artifactId>
|
||||
<version>4.1.2</version>
|
||||
<version>4.1.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@ -149,5 +170,11 @@
|
||||
<version>1.7.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>fabledskyblock</artifactId>
|
||||
<version>4.1.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
@ -1,9 +1,7 @@
|
||||
package com.songoda.epicfurnaces;
|
||||
|
||||
import com.gb6.songoda.epicfurnaces.hooks.PlotSquaredHook;
|
||||
import com.songoda.epicfurnaces.command.CommandManager;
|
||||
import com.songoda.epicfurnaces.handlers.BlacklistHandler;
|
||||
import com.songoda.epicfurnaces.hook.CraftBukkitHook;
|
||||
import com.songoda.epicfurnaces.hooks.*;
|
||||
import com.songoda.epicfurnaces.listeners.*;
|
||||
import com.songoda.epicfurnaces.managers.*;
|
||||
@ -17,6 +15,7 @@ import com.songoda.epicfurnaces.utils.Methods;
|
||||
import com.songoda.epicfurnaces.utils.StringUtils;
|
||||
import com.songoda.epicfurnaces.utils.gui.FastInv;
|
||||
import net.milkbowl.vault.economy.Economy;
|
||||
import org.bstats.bukkit.Metrics;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
@ -27,6 +26,7 @@ import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.inventory.FurnaceRecipe;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
import org.bukkit.plugin.RegisteredServiceProvider;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
@ -102,7 +102,13 @@ public class EpicFurnaces extends JavaPlugin {
|
||||
this.bukkitEnums = new BukkitEnums(this);
|
||||
this.levelManager = new LevelManager(this);
|
||||
this.hookManager = new HookManager(this);
|
||||
this.economy = getServer().getServicesManager().getRegistration(Economy.class).getProvider();
|
||||
|
||||
if (!setupEconomy()) {
|
||||
getLogger().severe("Economy provider not found/not supported, disabling...");
|
||||
Bukkit.getPluginManager().disablePlugin(this);
|
||||
Bukkit.getConsoleSender().sendMessage(formatText("&a============================="));
|
||||
return;
|
||||
}
|
||||
|
||||
if (Bukkit.getPluginManager().isPluginEnabled("HolographicDisplays") && getConfig().getBoolean("Main.Furnaces Have Holograms")) {
|
||||
this.hologramManager = new HologramManager(this);
|
||||
@ -138,6 +144,7 @@ public class EpicFurnaces extends JavaPlugin {
|
||||
if (pluginManager.isPluginEnabled("RedProtect")) hookManager.register(RedProtectHook::new);
|
||||
if (pluginManager.isPluginEnabled("Towny")) hookManager.register(TownyHook::new);
|
||||
if (pluginManager.isPluginEnabled("USkyBlock")) hookManager.register(USkyBlockHook::new);
|
||||
if (pluginManager.isPluginEnabled("FabledSkyBlock")) hookManager.register(FabledSkyBlockHook::new);
|
||||
|
||||
if (pluginManager.isPluginEnabled("WorldGuard")) {
|
||||
if (currentVersion >= 13) {
|
||||
@ -147,6 +154,8 @@ public class EpicFurnaces extends JavaPlugin {
|
||||
}
|
||||
}
|
||||
|
||||
new Metrics(this);
|
||||
|
||||
Bukkit.getConsoleSender().sendMessage(formatText("&a============================="));
|
||||
}
|
||||
|
||||
@ -272,6 +281,19 @@ public class EpicFurnaces extends JavaPlugin {
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean setupEconomy() {
|
||||
if (getServer().getPluginManager().getPlugin("Vault") == null) {
|
||||
return false;
|
||||
}
|
||||
RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class);
|
||||
if (rsp == null) {
|
||||
return false;
|
||||
}
|
||||
economy = rsp.getProvider();
|
||||
return economy != null;
|
||||
}
|
||||
|
||||
|
||||
public FileConfiguration getConfiguration(String name) {
|
||||
return configurations.get(name);
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package com.songoda.epicfurnaces;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
@ -47,7 +48,7 @@ public class Locale {
|
||||
|
||||
if (this.reloadMessages()) return;
|
||||
|
||||
plugin.getLogger().info("Loaded locale " + fileName);
|
||||
Bukkit.getConsoleSender().sendMessage("Loaded locale " + fileName);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -88,7 +89,7 @@ public class Locale {
|
||||
if (localeExists(localeValues[0] + "_" + localeValues[1])) continue;
|
||||
|
||||
LOCALES.add(new Locale(localeValues[0], localeValues[1]));
|
||||
plugin.getLogger().info("Found and loaded locale \"" + fileName + "\"");
|
||||
Bukkit.getConsoleSender().sendMessage("Found and loaded locale \"" + fileName + "\"");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ public class FurnaceListeners implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onCook(FurnaceSmeltEvent event) {
|
||||
if ((event.getBlock().isBlockPowered() && instance.getConfig().getBoolean("Main.Redstone Deactivates Furnaces")) || event.getResult() == null) {
|
||||
if ((event.getBlock().isBlockPowered() && instance.getConfig().getBoolean("Main.Redstone Deactivates Furnaces"))) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
@ -51,5 +51,6 @@ public class FurnaceListeners implements Listener {
|
||||
int num = level.getFuelDuration();
|
||||
int per = (event.getBurnTime() / 100) * num;
|
||||
event.setBurnTime(event.getBurnTime() + per);
|
||||
System.out.println("editting burn time");
|
||||
}
|
||||
}
|
@ -2,7 +2,7 @@ package com.songoda.epicfurnaces.managers;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.songoda.epicfurnaces.EpicFurnaces;
|
||||
import com.songoda.epicfurnaces.hook.ProtectionPluginHook;
|
||||
import com.songoda.epicfurnaces.hooks.ProtectionPluginHook;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -27,8 +27,8 @@ public class HookManager {
|
||||
}
|
||||
|
||||
private void registerProtectionHook(ProtectionPluginHook hook) {
|
||||
Preconditions.checkNotNull(hook, "Cannot register null hook");
|
||||
Preconditions.checkNotNull(hook.getPlugin(), "Protection plugin hook returns null plugin instance (#getPlugin())");
|
||||
Preconditions.checkNotNull(hook, "Cannot register null hooks");
|
||||
Preconditions.checkNotNull(hook.getPlugin(), "Protection plugin hooks returns null plugin instance (#getPlugin())");
|
||||
|
||||
JavaPlugin hookPlugin = hook.getPlugin();
|
||||
for (ProtectionPluginHook existingHook : protectionHooks) {
|
||||
@ -44,7 +44,7 @@ public class HookManager {
|
||||
instance.save("hooks");
|
||||
|
||||
protectionHooks.add(hook);
|
||||
instance.getLogger().info("Registered protection hook for plugin: " + hook.getPlugin().getName() + " v" + hook.getPlugin().getDescription().getVersion());
|
||||
instance.getLogger().info("Registered protection hooks for plugin: " + hook.getPlugin().getName() + " v" + hook.getPlugin().getDescription().getVersion());
|
||||
}
|
||||
|
||||
public boolean canBuild(Player player, Location location) {
|
||||
|
@ -4,29 +4,19 @@ import com.songoda.epicfurnaces.EpicFurnaces;
|
||||
import com.songoda.epicfurnaces.menus.OverviewMenu;
|
||||
import com.songoda.epicfurnaces.utils.NMSUtil;
|
||||
import com.songoda.epicfurnaces.utils.StringUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.block.Furnace;
|
||||
import org.bukkit.craftbukkit.v1_13_R2.block.CraftFurnace;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.FurnaceSmeltEvent;
|
||||
import org.bukkit.inventory.FurnaceInventory;
|
||||
import org.bukkit.inventory.InventoryHolder;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.*;
|
||||
|
||||
import static com.songoda.epicfurnaces.objects.FurnaceObject.BoostType.FUEL_SHARE;
|
||||
import static com.songoda.epicfurnaces.objects.FurnaceObject.BoostType.OVERHEAT;
|
||||
import static com.songoda.epicfurnaces.objects.FurnaceObject.BoostType.*;
|
||||
|
||||
/**
|
||||
* Created by songoda on 3/7/2017.
|
||||
@ -99,16 +89,16 @@ public class FurnaceObject {
|
||||
level = instance.getLevelManager().getLevel(this.level.getLevel() + 1);
|
||||
}
|
||||
|
||||
this.updateCook();
|
||||
updateCook();
|
||||
|
||||
FurnaceInventory i = (FurnaceInventory) ((InventoryHolder) block.getState()).getInventory();
|
||||
FurnaceInventory inventory = (FurnaceInventory) ((InventoryHolder) block.getState()).getInventory();
|
||||
|
||||
int num = Integer.parseInt(reward);
|
||||
double rand = Math.random() * 100;
|
||||
if (rand >= num
|
||||
|| e.getResult().getType().equals(Material.SPONGE)
|
||||
|| instance.getConfig().getBoolean("Main.No Rewards From Custom Recipes")
|
||||
&& instance.getConfiguration("Furnace Recipes").contains("Recipes." + i.getSmelting().getType().toString())) {
|
||||
&& instance.getConfiguration("Furnace Recipes").contains("Recipes." + inventory.getSmelting().getType().toString())) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -125,7 +115,6 @@ public class FurnaceObject {
|
||||
}
|
||||
|
||||
e.getResult().setAmount(e.getResult().getAmount() + r);
|
||||
e.setResult(new ItemStack(e.getResult().getType(), r));
|
||||
}
|
||||
|
||||
public void upgrade(String type, Player player) {
|
||||
@ -188,22 +177,20 @@ public class FurnaceObject {
|
||||
String name = StringUtils.formatName(level.getLevel(), uses, false);
|
||||
|
||||
try {
|
||||
CraftFurnace craftFurnace = (CraftFurnace) location.getBlock().getState();
|
||||
Furnace craftFurnace = (Furnace) location.getBlock().getState();
|
||||
craftFurnace.setCustomName(name);
|
||||
craftFurnace.update(true);
|
||||
} catch (Exception e) {
|
||||
} catch (Exception | Error e) {
|
||||
try {
|
||||
Object craftFurnace = NMSUtil.getCraftClass("block.CraftFurnace").cast(location.getBlock().getState());
|
||||
Field inventoryField = craftFurnace.getClass().getDeclaredField("furnace");
|
||||
Method getTileEntity = craftFurnace.getClass().getDeclaredMethod("getTileEntity");
|
||||
|
||||
inventoryField.setAccessible(true);
|
||||
|
||||
Object tileEntity = getTileEntity.invoke(craftFurnace);
|
||||
Method a = tileEntity.getClass().getDeclaredMethod("a", String.class);
|
||||
a.invoke(tileEntity, name);
|
||||
} catch (Exception ignore) {
|
||||
} catch (Exception | Error ignore) {
|
||||
}
|
||||
} finally {
|
||||
location.getBlock().getState().update(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -127,6 +127,10 @@ public class FurnaceTask extends BukkitRunnable {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (((Furnace) furnace.getLocation().getBlock().getState()).getInventory().getFuel() == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Furnace furnaceBlock = ((Furnace) block.getState());
|
||||
|
||||
if (furnaceBlock.getBurnTime() == 0) {
|
||||
|
@ -37,7 +37,6 @@ Database:
|
||||
Username: PUT_USERNAME_HERE
|
||||
Password: PUT_PASSWORD_HERE
|
||||
System:
|
||||
Download Needed Data Files: true
|
||||
Language Mode: en_US
|
||||
Debugger Enabled: false
|
||||
settings:
|
||||
|
@ -4,7 +4,7 @@ main: com.songoda.epicfurnaces.EpicFurnaces
|
||||
authors: [Brianna, GB6]
|
||||
website: https://songoda.com/
|
||||
depend: [Vault]
|
||||
softdepend: [PlotSquared, GriefPrevention, USkyBlock, SkyBlock, WorldGuard, Factions, HolographicDisplays]
|
||||
softdepend: [PlotSquared, GriefPrevention, USkyBlock, SkyBlock, WorldGuard, Factions, HolographicDisplays, FabledSkyBlock]
|
||||
commands:
|
||||
epicfurnaces:
|
||||
description: Default command for the EpicFurnaces plugin.
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>hooks</artifactId>
|
||||
<groupId>com.songoda</groupId>
|
||||
<version>4.1.2</version>
|
||||
<version>4.1.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
<dependency>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>manager</artifactId>
|
||||
<version>4.1.2</version>
|
||||
<version>4.1.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.songoda.epicfurnaces.hooks;
|
||||
|
||||
import com.songoda.epicfurnaces.hook.ClaimableProtectionPluginHook;
|
||||
import com.wasteofplastic.askyblock.ASkyBlock;
|
||||
import com.wasteofplastic.askyblock.ASkyBlockAPI;
|
||||
import com.wasteofplastic.askyblock.Island;
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>hooks</artifactId>
|
||||
<groupId>com.songoda</groupId>
|
||||
<version>4.1.2</version>
|
||||
<version>4.1.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
<dependency>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>manager</artifactId>
|
||||
<version>4.1.2</version>
|
||||
<version>4.1.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.songoda.epicfurnaces.hooks;
|
||||
|
||||
import com.songoda.epicfurnaces.hook.CraftBukkitHook;
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Particle;
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>hooks</artifactId>
|
||||
<groupId>com.songoda</groupId>
|
||||
<version>4.1.2</version>
|
||||
<version>4.1.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
<dependency>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>manager</artifactId>
|
||||
<version>4.1.2</version>
|
||||
<version>4.1.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.songoda.epicfurnaces.hooks;
|
||||
|
||||
import com.songoda.epicfurnaces.hook.CraftBukkitHook;
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.Location;
|
||||
|
||||
|
34
hooks/fabledskyblock/pom.xml
Normal file
34
hooks/fabledskyblock/pom.xml
Normal file
@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>hooks</artifactId>
|
||||
<groupId>com.songoda</groupId>
|
||||
<version>4.1.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>fabledskyblock</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>skyblockearth</artifactId>
|
||||
<version>59</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>manager</artifactId>
|
||||
<version>4.1.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot</artifactId>
|
||||
<version>1.8.8</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
@ -0,0 +1,33 @@
|
||||
package com.songoda.epicfurnaces.hooks;
|
||||
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.api.SkyBlockAPI;
|
||||
import me.goodandevil.skyblock.api.island.Island;
|
||||
import me.goodandevil.skyblock.api.island.IslandRole;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
public class FabledSkyBlockHook implements ProtectionPluginHook {
|
||||
|
||||
private final Set<IslandRole> allowedRoles = new HashSet<IslandRole>() {{
|
||||
add(IslandRole.COOP);
|
||||
add(IslandRole.MEMBER);
|
||||
add(IslandRole.OPERATOR);
|
||||
add(IslandRole.OWNER);
|
||||
}};
|
||||
|
||||
public boolean canBuild(Player player, Location location) {
|
||||
Island island = SkyBlockAPI.getIslandManager().getIslandAtLocation(location);
|
||||
return allowedRoles.stream().anyMatch(role -> island.getPlayersWithRole(role).contains(player.getUniqueId())) ||
|
||||
island.getCoopPlayers().contains(player.getUniqueId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public JavaPlugin getPlugin() {
|
||||
return SkyBlock.getInstance();
|
||||
}
|
||||
}
|
@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<artifactId>hooks</artifactId>
|
||||
<groupId>com.songoda</groupId>
|
||||
<version>4.1.2</version>
|
||||
<version>4.1.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>factions</artifactId>
|
||||
@ -28,7 +28,7 @@
|
||||
<dependency>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>manager</artifactId>
|
||||
<version>4.1.2</version>
|
||||
<version>4.1.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
@ -1,11 +1,7 @@
|
||||
package com.songoda.epicfurnaces.hooks;
|
||||
|
||||
import com.songoda.epicfurnaces.hook.ClaimableProtectionPluginHook;
|
||||
import me.markeh.factionsframework.FactionsFramework;
|
||||
import me.markeh.factionsframework.entities.FPlayer;
|
||||
import me.markeh.factionsframework.entities.FPlayers;
|
||||
import me.markeh.factionsframework.entities.Faction;
|
||||
import me.markeh.factionsframework.entities.Factions;
|
||||
import me.markeh.factionsframework.entities.*;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>hooks</artifactId>
|
||||
<groupId>com.songoda</groupId>
|
||||
<version>4.1.2</version>
|
||||
<version>4.1.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
<dependency>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>manager</artifactId>
|
||||
<version>4.1.2</version>
|
||||
<version>4.1.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.songoda.epicfurnaces.hooks;
|
||||
|
||||
import com.songoda.epicfurnaces.hook.ProtectionPluginHook;
|
||||
import me.ryanhamshire.GriefPrevention.Claim;
|
||||
import me.ryanhamshire.GriefPrevention.GriefPrevention;
|
||||
import org.bukkit.Location;
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>hooks</artifactId>
|
||||
<groupId>com.songoda</groupId>
|
||||
<version>4.1.2</version>
|
||||
<version>4.1.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@ -27,13 +27,13 @@
|
||||
<dependency>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>manager</artifactId>
|
||||
<version>4.1.2</version>
|
||||
<version>4.1.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>manager</artifactId>
|
||||
<version>4.1.2</version>
|
||||
<version>4.1.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.songoda.epicfurnaces.hooks;
|
||||
|
||||
import com.songoda.epicfurnaces.hook.ProtectionPluginHook;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>hooks</artifactId>
|
||||
<groupId>com.songoda</groupId>
|
||||
<version>4.1.2</version>
|
||||
<version>4.1.3</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -1,10 +1,10 @@
|
||||
package com.songoda.epicfurnaces.hook;
|
||||
package com.songoda.epicfurnaces.hooks;
|
||||
|
||||
import org.bukkit.Location;
|
||||
|
||||
/**
|
||||
* A more specific implementation of {@link ProtectionPluginHook} used internally by
|
||||
* EpicSpawners to retain more information about default hooks. Often times this
|
||||
* EpicFurnaces to retain more information about default hooks. Often times this
|
||||
* interface is not recommended over the ProtectionPluginHook interface as its methods
|
||||
* will not often be used by implementation, though they are available if more information
|
||||
* is desired. It is, however, recommended to use the former
|
@ -1,4 +1,4 @@
|
||||
package com.songoda.epicfurnaces.hook;
|
||||
package com.songoda.epicfurnaces.hooks;
|
||||
|
||||
|
||||
import org.bukkit.Location;
|
@ -1,4 +1,4 @@
|
||||
package com.songoda.epicfurnaces.hook;
|
||||
package com.songoda.epicfurnaces.hooks;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.block.Block;
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>hooks</artifactId>
|
||||
<groupId>com.songoda</groupId>
|
||||
<version>4.1.2</version>
|
||||
<version>4.1.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@ -21,13 +21,13 @@
|
||||
<dependency>
|
||||
<groupId>com</groupId>
|
||||
<artifactId>plotsquared</artifactId>
|
||||
<version>3.5.0</version>
|
||||
<version>4</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>manager</artifactId>
|
||||
<version>4.1.2</version>
|
||||
<version>4.1.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
@ -1,27 +0,0 @@
|
||||
package com.gb6.songoda.epicfurnaces.hooks;
|
||||
|
||||
import com.intellectualcrafters.plot.api.PlotAPI;
|
||||
import com.plotsquared.bukkit.BukkitMain;
|
||||
import com.songoda.epicfurnaces.hook.ProtectionPluginHook;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public class PlotSquaredHook implements ProtectionPluginHook {
|
||||
|
||||
private final PlotAPI plotSquared;
|
||||
|
||||
public PlotSquaredHook() {
|
||||
this.plotSquared = new PlotAPI();
|
||||
}
|
||||
|
||||
public JavaPlugin getPlugin() { // BukkitMain? Really?
|
||||
return JavaPlugin.getPlugin(BukkitMain.class);
|
||||
}
|
||||
|
||||
public boolean canBuild(Player player, Location location) {
|
||||
return plotSquared.getPlot(location) != null && plotSquared.isInPlot(player)
|
||||
&& plotSquared.getPlot(location) == plotSquared.getPlot(player);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.songoda.epicfurnaces.hooks;
|
||||
|
||||
import com.github.intellectualsites.plotsquared.api.PlotAPI;
|
||||
import com.github.intellectualsites.plotsquared.bukkit.BukkitMain;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.Plot;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public class PlotSquaredHook implements ProtectionPluginHook {
|
||||
|
||||
private final PlotAPI plotAPI;
|
||||
|
||||
public PlotSquaredHook() {
|
||||
this.plotAPI = new PlotAPI();
|
||||
}
|
||||
|
||||
public boolean canBuild(Player player, Location location) {
|
||||
PlotPlayer plotPlayer = PlotPlayer.wrap(player);
|
||||
Plot plot = plotPlayer.getCurrentPlot();
|
||||
return plot != null && plot.hasOwner() && plot.isAdded(player.getUniqueId());
|
||||
}
|
||||
|
||||
public JavaPlugin getPlugin() { // BukkitMain? Really?
|
||||
return JavaPlugin.getPlugin(BukkitMain.class);
|
||||
}
|
||||
|
||||
}
|
@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<artifactId>EpicFurnaces-Parent</artifactId>
|
||||
<groupId>com.songoda</groupId>
|
||||
<version>4.1.2</version>
|
||||
<version>4.1.3</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@ -27,5 +27,6 @@
|
||||
<module>worldguard7</module>
|
||||
<module>craftbukkit-1-8</module>
|
||||
<module>craftbukkit-1-13</module>
|
||||
<module>fabledskyblock</module>
|
||||
</modules>
|
||||
</project>
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>hooks</artifactId>
|
||||
<groupId>com.songoda</groupId>
|
||||
<version>4.1.2</version>
|
||||
<version>4.1.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
<dependency>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>manager</artifactId>
|
||||
<version>4.1.2</version>
|
||||
<version>4.1.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
@ -3,7 +3,6 @@ package com.songoda.epicfurnaces.hooks;
|
||||
import br.net.fabiozumbi12.RedProtect.Bukkit.API.RedProtectAPI;
|
||||
import br.net.fabiozumbi12.RedProtect.Bukkit.RedProtect;
|
||||
import br.net.fabiozumbi12.RedProtect.Bukkit.Region;
|
||||
import com.songoda.epicfurnaces.hook.ProtectionPluginHook;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>hooks</artifactId>
|
||||
<groupId>com.songoda</groupId>
|
||||
<version>4.1.2</version>
|
||||
<version>4.1.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
<dependency>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>manager</artifactId>
|
||||
<version>4.1.2</version>
|
||||
<version>4.1.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
@ -4,7 +4,6 @@ import com.palmergames.bukkit.towny.Towny;
|
||||
import com.palmergames.bukkit.towny.exceptions.NotRegisteredException;
|
||||
import com.palmergames.bukkit.towny.object.Resident;
|
||||
import com.palmergames.bukkit.towny.object.TownyUniverse;
|
||||
import com.songoda.epicfurnaces.hook.ClaimableProtectionPluginHook;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>hooks</artifactId>
|
||||
<groupId>com.songoda</groupId>
|
||||
<version>4.1.2</version>
|
||||
<version>4.1.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
<dependency>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>manager</artifactId>
|
||||
<version>4.1.2</version>
|
||||
<version>4.1.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.songoda.epicfurnaces;
|
||||
package com.songoda.epicfurnaces.hooks;
|
||||
|
||||
import com.songoda.epicfurnaces.hook.ClaimableProtectionPluginHook;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>hooks</artifactId>
|
||||
<groupId>com.songoda</groupId>
|
||||
<version>4.1.2</version>
|
||||
<version>4.1.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
<dependency>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>manager</artifactId>
|
||||
<version>4.1.2</version>
|
||||
<version>4.1.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.songoda.epicfurnaces.hooks;
|
||||
|
||||
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
|
||||
import com.songoda.epicfurnaces.hook.ProtectionPluginHook;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>hooks</artifactId>
|
||||
<groupId>com.songoda</groupId>
|
||||
<version>4.1.2</version>
|
||||
<version>4.1.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
<dependency>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>manager</artifactId>
|
||||
<version>4.1.2</version>
|
||||
<version>4.1.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
@ -6,7 +6,6 @@ import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
|
||||
import com.sk89q.worldguard.protection.ApplicableRegionSet;
|
||||
import com.sk89q.worldguard.protection.flags.Flags;
|
||||
import com.sk89q.worldguard.protection.regions.RegionQuery;
|
||||
import com.songoda.epicfurnaces.hook.ProtectionPluginHook;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
Loading…
Reference in New Issue
Block a user