diff --git a/src/com/massivecraft/massivecore/store/Entity.java b/src/com/massivecraft/massivecore/store/Entity.java index e4d8796a..6fd9fd98 100644 --- a/src/com/massivecraft/massivecore/store/Entity.java +++ b/src/com/massivecraft/massivecore/store/Entity.java @@ -168,6 +168,21 @@ public class Entity> return false; } + // -------------------------------------------- // + // CONVENIENCE: DATABASE + // -------------------------------------------- // + + public boolean convertGet(Boolean wrapper) + { + return wrapper != null ? wrapper.booleanValue() : false; + } + + public Boolean convertSet(boolean primitive) + { + this.changed(); + return primitive ? Boolean.TRUE : null; + } + // -------------------------------------------- // // STANDARDS // -------------------------------------------- // diff --git a/src/com/massivecraft/massivecore/store/SenderEntity.java b/src/com/massivecraft/massivecore/store/SenderEntity.java index 2f967287..4359d991 100644 --- a/src/com/massivecraft/massivecore/store/SenderEntity.java +++ b/src/com/massivecraft/massivecore/store/SenderEntity.java @@ -12,6 +12,7 @@ import com.massivecraft.massivecore.Named; import com.massivecraft.massivecore.mixin.Mixin; import com.massivecraft.massivecore.mson.Mson; import com.massivecraft.massivecore.util.IdUtil; +import com.massivecraft.massivecore.util.PermUtil; public abstract class SenderEntity> extends Entity implements Named { @@ -59,6 +60,18 @@ public abstract class SenderEntity> extends Entity return (SenderColl) super.getColl(); } + // -------------------------------------------- // + // CONVENIENCE: DATABASE + // -------------------------------------------- // + + public boolean convertGet(Boolean wrapper, String permission) + { + // Permission requirement + if ( ! PermUtil.has(this.getSender(), permission)) return false; + + return super.convertGet(wrapper); + } + // -------------------------------------------- // // TYPE // -------------------------------------------- //