Small database changes

This commit is contained in:
Magnus Ulf 2019-01-27 16:42:09 +01:00
parent c7ba58b9ab
commit dd3724e663
3 changed files with 16 additions and 13 deletions

View File

@ -1295,6 +1295,11 @@ public class MassiveCommand implements Active, PluginIdentifiableCommand
return ret; return ret;
} }
public Mson getTemplateWithArgs(CommandSender sender, String... args)
{
return this.getTemplateWithArgs(sender, MUtil.list(args));
}
public Mson getTemplateWithArgs(CommandSender sender, List<String> args) public Mson getTemplateWithArgs(CommandSender sender, List<String> args)
{ {
Mson ret = this.getTemplateChain(true, sender); Mson ret = this.getTemplateChain(true, sender);

View File

@ -48,27 +48,16 @@ public class Entity<E extends Entity<E>> extends EntityInternal<E>
this.lastStackTraceChanged = null; this.lastStackTraceChanged = null;
} }
// -------------------------------------------- // // -------------------------------------------- //
// ATTACH AND DETACH // ATTACH AND DETACH
// -------------------------------------------- // // -------------------------------------------- //
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public String attach(EntityContainer<E> container) public String attach(EntityContainer<E> container)
{ {
if (!(container instanceof Coll)) throw new IllegalArgumentException(container.getClass().getName() + " is not a Coll."); if (!(container instanceof Coll)) throw new IllegalArgumentException(container.getClass().getName() + " is not a Coll.");
return container.attach((E) this); return container.attach((E) this);
} }
@SuppressWarnings("unchecked")
public E detach()
{
EntityContainer<E> coll = this.getContainer();
if (coll == null) return (E)this;
return coll.detachEntity((E) this);
}
// -------------------------------------------- // // -------------------------------------------- //
// SYNC AND IO ACTIONS // SYNC AND IO ACTIONS

View File

@ -73,7 +73,16 @@ public class EntityInternal<E extends EntityInternal<E>> implements Identified
{ {
} }
@SuppressWarnings("unchecked")
public E detach()
{
EntityContainer<E> coll = this.getContainer();
if (coll == null) return (E)this;
return coll.detachEntity((E) this);
}
// -------------------------------------------- // // -------------------------------------------- //
// SYNC AND IO ACTIONS // SYNC AND IO ACTIONS
// -------------------------------------------- // // -------------------------------------------- //