Restored support for the Residence plugin and updated Herobrine to support Residence 4.6.1.4
This commit is contained in:
parent
fbf7bba09e
commit
f32b052da3
@ -11,5 +11,6 @@
|
||||
<classpathentry kind="lib" path="libs/worldguard-6.1.jar"/>
|
||||
<classpathentry kind="lib" path="libs/CustomItems-1.0.0.jar"/>
|
||||
<classpathentry kind="lib" path="libs/craftbukkit-1.11.jar"/>
|
||||
<classpathentry kind="lib" path="libs/Residence4.6.1.4.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
Binary file not shown.
BIN
libs/Residence4.6.1.4.jar
Normal file
BIN
libs/Residence4.6.1.4.jar
Normal file
Binary file not shown.
@ -4,6 +4,7 @@ import net.theprogrammersworld.herobrine.hooks.CustomItemsHook;
|
||||
import net.theprogrammersworld.herobrine.hooks.FactionsHook;
|
||||
import net.theprogrammersworld.herobrine.hooks.GriefPreventionHook;
|
||||
import net.theprogrammersworld.herobrine.hooks.PreciousStonesHook;
|
||||
import net.theprogrammersworld.herobrine.hooks.ResidenceHook;
|
||||
import net.theprogrammersworld.herobrine.hooks.TownyHook;
|
||||
import net.theprogrammersworld.herobrine.hooks.WorldGuardHook;
|
||||
|
||||
@ -18,6 +19,7 @@ public class Support {
|
||||
private boolean B_CustomItems = false;
|
||||
private boolean B_PreciousStones;
|
||||
private boolean B_Factions;
|
||||
private ResidenceHook ResidenceCore;
|
||||
private GriefPreventionHook GriefPreventionCore;
|
||||
private TownyHook TownyCore;
|
||||
private WorldGuardHook WorldGuard;
|
||||
@ -26,6 +28,7 @@ public class Support {
|
||||
private FactionsHook Factions;
|
||||
|
||||
public Support() {
|
||||
ResidenceCore = new ResidenceHook();
|
||||
GriefPreventionCore = new GriefPreventionHook();
|
||||
TownyCore = new TownyHook();
|
||||
CustomItems = new CustomItemsHook();
|
||||
@ -65,6 +68,10 @@ public class Support {
|
||||
}
|
||||
|
||||
public void CheckForPlugins() {
|
||||
if (ResidenceCore.Check()) {
|
||||
B_Residence = true;
|
||||
Herobrine.log.info("[Herobrine] Residence plugin detected on server");
|
||||
}
|
||||
if (GriefPreventionCore.Check()) {
|
||||
B_GriefPrevention = true;
|
||||
Herobrine.log.info("[Herobrine] GriefPrevention plugin detected on server");
|
||||
@ -93,6 +100,9 @@ public class Support {
|
||||
}
|
||||
|
||||
public boolean isSecuredArea(final Location loc) {
|
||||
if (B_Residence) {
|
||||
return ResidenceCore.isSecuredArea(loc);
|
||||
}
|
||||
if (B_GriefPrevention) {
|
||||
return GriefPreventionCore.isSecuredArea(loc);
|
||||
}
|
||||
|
@ -0,0 +1,18 @@
|
||||
package net.theprogrammersworld.herobrine.hooks;
|
||||
|
||||
import com.bekvon.bukkit.residence.api.ResidenceApi;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
|
||||
public class ResidenceHook {
|
||||
|
||||
public boolean Check() {
|
||||
return Bukkit.getServer().getPluginManager().getPlugin("Residence") != null;
|
||||
}
|
||||
|
||||
public boolean isSecuredArea(final Location loc) {
|
||||
return ResidenceApi.getResidenceManager().getByLoc(loc) != null;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user