0.3h Property sender to sender entity
This commit is contained in:
parent
7b69175c0f
commit
930ebd71b4
@ -130,14 +130,14 @@ public abstract class CommandEditContainerAbstract<O, V> extends CommandEditAbst
|
||||
Collection<Object> additions = ContainerUtil.getAdditions(before, after);
|
||||
if ( ! additions.isEmpty())
|
||||
{
|
||||
messages.add(Mson.prepondfix(mson("Additions: ").color(ChatColor.AQUA), this.getValueType().getVisualMson((V) additions), null));
|
||||
messages.add(Mson.prepondfix(mson("Additions: ").color(ChatColor.AQUA), this.getValueType().getVisualMson((V) additions, sender), null));
|
||||
}
|
||||
|
||||
// Note: The result of getDeletions is not actually V, but the implementation doesn't care.
|
||||
Collection<Object> deletions = ContainerUtil.getDeletions(before, after);
|
||||
if ( ! deletions.isEmpty())
|
||||
{
|
||||
messages.add(Mson.prepondfix(mson("Deletions: ").color(ChatColor.AQUA), this.getValueType().getVisualMson((V) deletions), null));
|
||||
messages.add(Mson.prepondfix(mson("Deletions: ").color(ChatColor.AQUA), this.getValueType().getVisualMson((V) deletions, sender), null));
|
||||
}
|
||||
|
||||
message(messages);
|
||||
|
@ -0,0 +1,44 @@
|
||||
package com.massivecraft.massivecore.command.editor;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import com.massivecraft.massivecore.command.type.sender.TypeSender;
|
||||
import com.massivecraft.massivecore.store.SenderColl;
|
||||
import com.massivecraft.massivecore.store.SenderEntity;
|
||||
|
||||
public class PropertyThisSenderEntity<O extends SenderEntity<O>> extends Property<CommandSender, O>
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// FIELDS
|
||||
// -------------------------------------------- //
|
||||
|
||||
private final SenderColl<O> coll;
|
||||
public SenderColl<O> getColl() { return this.coll; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// CONSTRUCT
|
||||
// -------------------------------------------- //
|
||||
|
||||
public PropertyThisSenderEntity(SenderColl<O> coll)
|
||||
{
|
||||
super(TypeSender.get(), coll.getTypeEntity(), "this");
|
||||
this.coll = coll;
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
// OVERRIDE
|
||||
// -------------------------------------------- //
|
||||
|
||||
@Override
|
||||
public O getRaw(CommandSender object)
|
||||
{
|
||||
return coll.get(object);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRaw(CommandSender object, O value)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user