Package dev.jorel.commandapi
Record Class MockCommandSource
java.lang.Object
java.lang.Record
dev.jorel.commandapi.MockCommandSource
- Record Components:
bukkitSender- The BukkitCommandSenderthis source represents.location- TheLocationwhere this source is running the command from.entity- TheEntitythis source is running the command as.
public record MockCommandSource(org.bukkit.command.CommandSender bukkitSender, org.bukkit.Location location, org.bukkit.entity.Entity entity)
extends Record
An NMS independent implementation of CommandSourceStack. Used by Brigadier when parsing and executing commands.
-
Constructor Summary
ConstructorsConstructorDescriptionMockCommandSource(org.bukkit.command.CommandSender bukkitSender) MockCommandSource(org.bukkit.command.CommandSender bukkitSender, org.bukkit.Location location, org.bukkit.entity.Entity entity) Creates an instance of aMockCommandSourcerecord class. -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.command.CommandSenderReturns the value of thebukkitSenderrecord component.org.bukkit.entity.Entityentity()Returns the value of theentityrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.org.bukkit.Locationlocation()Returns the value of thelocationrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
MockCommandSource
public MockCommandSource(org.bukkit.command.CommandSender bukkitSender) -
MockCommandSource
public MockCommandSource(org.bukkit.command.CommandSender bukkitSender, org.bukkit.Location location, org.bukkit.entity.Entity entity) Creates an instance of aMockCommandSourcerecord class.- Parameters:
bukkitSender- the value for thebukkitSenderrecord componentlocation- the value for thelocationrecord componententity- the value for theentityrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
bukkitSender
public org.bukkit.command.CommandSender bukkitSender()Returns the value of thebukkitSenderrecord component.- Returns:
- the value of the
bukkitSenderrecord component
-
location
-
entity
-