diff --git a/Changelog.txt b/Changelog.txt index 87cf553..f0eac3b 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,3 +1,7 @@ +Flan 1.0.7 +====================== +- Enable tamed pet interaction in claims for the owner + Flan 1.0.6 ====================== - Update Fabric API to use the new PlayerBlockBreakEvent diff --git a/gradle.properties b/gradle.properties index daaa8d6..d44411c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,7 +8,7 @@ org.gradle.jvmargs=-Xmx2G loader_version=0.9.1+build.205 # Mod Properties - mod_version = 1.0.6 + mod_version = 1.0.7 maven_group = com.flemmli97.flan archives_base_name = flan diff --git a/src/main/java/com/flemmli97/flan/event/EntityInteractEvents.java b/src/main/java/com/flemmli97/flan/event/EntityInteractEvents.java index 4251176..5def6de 100644 --- a/src/main/java/com/flemmli97/flan/event/EntityInteractEvents.java +++ b/src/main/java/com/flemmli97/flan/event/EntityInteractEvents.java @@ -13,7 +13,9 @@ import net.minecraft.entity.damage.DamageSource; import net.minecraft.entity.decoration.ArmorStandEntity; import net.minecraft.entity.decoration.ItemFrameEntity; import net.minecraft.entity.mob.Monster; +import net.minecraft.entity.passive.TameableEntity; import net.minecraft.entity.passive.VillagerEntity; +import net.minecraft.entity.passive.WolfEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.projectile.PersistentProjectileEntity; import net.minecraft.entity.projectile.ProjectileEntity; @@ -74,6 +76,11 @@ public class EntityInteractEvents { return claim.canInteract(player, EnumPermission.TRADING, pos, true) ? ActionResult.PASS : ActionResult.FAIL; if (entity instanceof ItemFrameEntity) return claim.canInteract(player, EnumPermission.ITEMFRAMEROTATE, pos, true) ? ActionResult.PASS : ActionResult.FAIL; + if(entity instanceof TameableEntity){ + TameableEntity tame = (TameableEntity) entity; + if(tame.isOwner(player)) + return ActionResult.PASS; + } return claim.canInteract(player, EnumPermission.ANIMALINTERACT, pos, true) ? ActionResult.PASS : ActionResult.FAIL; } return ActionResult.PASS;