diff --git a/Compatibility/src/main/java/com/songoda/core/compatibility/CompatibleMaterial.java b/Compatibility/src/main/java/com/songoda/core/compatibility/CompatibleMaterial.java
index 1e3baae5..07ea80ad 100644
--- a/Compatibility/src/main/java/com/songoda/core/compatibility/CompatibleMaterial.java
+++ b/Compatibility/src/main/java/com/songoda/core/compatibility/CompatibleMaterial.java
@@ -187,6 +187,9 @@ public enum CompatibleMaterial {
YELLOW_CANDLE(),
YELLOW_CANDLE_CAKE(),
+ /* 1.16.2 */
+ PIGLIN_BRUTE_SPAWN_EGG(),
+
/* 1.16 */
ANCIENT_DEBRIS(),
BASALT(),
diff --git a/Core/pom.xml b/Core/pom.xml
index b3cef259..3a389ab6 100644
--- a/Core/pom.xml
+++ b/Core/pom.xml
@@ -352,6 +352,13 @@
1.15.5
provided
+
+
+ com.Zrips
+ Residence
+ 4.9.0.6
+ provided
+
diff --git a/Core/src/main/java/com/songoda/core/hooks/PluginHook.java b/Core/src/main/java/com/songoda/core/hooks/PluginHook.java
index d4e07229..3d70a01e 100644
--- a/Core/src/main/java/com/songoda/core/hooks/PluginHook.java
+++ b/Core/src/main/java/com/songoda/core/hooks/PluginHook.java
@@ -15,6 +15,7 @@ import com.songoda.core.hooks.protection.GriefPreventionProtection;
import com.songoda.core.hooks.protection.LandsProtection;
import com.songoda.core.hooks.protection.Protection;
import com.songoda.core.hooks.protection.RedProtectProtection;
+import com.songoda.core.hooks.protection.ResidenceProtection;
import com.songoda.core.hooks.protection.UltimateClaimsProtection;
import com.songoda.core.hooks.stackers.StackMob;
import com.songoda.core.hooks.stackers.Stacker;
@@ -50,6 +51,7 @@ public final class PluginHook {
public static final PluginHook PROTECTION_REDPROTECT = new PluginHook(Protection.class, "RedProtect", RedProtectProtection.class);
public static final PluginHook PROTECTION_ULTIMATECLAIMS = new PluginHook(Protection.class, "UltimateClaims", UltimateClaimsProtection.class);
public static final PluginHook PROTECTION_BENTOBOX = new PluginHook(Protection.class, "BentoBox", BentoBoxProtection.class);
+ public static final PluginHook PROTECTION_RESIDENCE = new PluginHook(Protection.class, "Residence", ResidenceProtection.class);
/******* Start Manager stuff *******/
diff --git a/Core/src/main/java/com/songoda/core/hooks/holograms/CMIHolograms.java b/Core/src/main/java/com/songoda/core/hooks/holograms/CMIHolograms.java
index 6062994e..b61bc644 100644
--- a/Core/src/main/java/com/songoda/core/hooks/holograms/CMIHolograms.java
+++ b/Core/src/main/java/com/songoda/core/hooks/holograms/CMIHolograms.java
@@ -53,7 +53,7 @@ public class CMIHolograms extends Holograms {
@Override
protected double defaultHeightOffset() {
- return 0.5;
+ return 1;
}
@Override
diff --git a/Core/src/main/java/com/songoda/core/hooks/protection/ResidenceProtection.java b/Core/src/main/java/com/songoda/core/hooks/protection/ResidenceProtection.java
new file mode 100644
index 00000000..3ea13f5b
--- /dev/null
+++ b/Core/src/main/java/com/songoda/core/hooks/protection/ResidenceProtection.java
@@ -0,0 +1,56 @@
+package com.songoda.core.hooks.protection;
+
+import com.bekvon.bukkit.residence.Residence;
+import com.bekvon.bukkit.residence.containers.Flags;
+import com.bekvon.bukkit.residence.containers.ResidencePlayer;
+import com.bekvon.bukkit.residence.protection.FlagPermissions;
+import org.bukkit.Location;
+import org.bukkit.entity.Player;
+import org.bukkit.plugin.Plugin;
+
+public class ResidenceProtection extends Protection {
+
+ private final Residence instance;
+ public ResidenceProtection(Plugin plugin) {
+ super(plugin);
+ this.instance = Residence.getInstance();
+ }
+
+ @Override
+ public boolean canPlace(Player player, Location location) {
+ ResidencePlayer rPlayer = Residence.getInstance().getPlayerManager().getResidencePlayer(player);
+ return rPlayer.canPlaceBlock(location.getBlock(), false);
+ }
+
+ @Override
+ public boolean canBreak(Player player, Location location) {
+ ResidencePlayer rPlayer = Residence.getInstance().getPlayerManager().getResidencePlayer(player);
+ return rPlayer.canBreakBlock(location.getBlock(), false);
+ }
+
+ @Override
+ public boolean canInteract(Player player, Location location) {
+ return hasPerms(player, location, Flags.use);
+ }
+
+ private boolean hasPerms(Player player, Location location, Flags flag) {
+ if (instance.isDisabledWorldListener(location.getWorld()))
+ return true;
+
+ if (instance.isResAdminOn(player))
+ return true;
+
+ FlagPermissions perms = instance.getPermsByLocForPlayer(location, player);
+ return perms.playerHas(player, flag, true);
+ }
+
+ @Override
+ public String getName() {
+ return "Residence";
+ }
+
+ @Override
+ public boolean isEnabled() {
+ return instance != null;
+ }
+}