mirror of
https://github.com/tanyaofei/minecraft-fakeplayer.git
synced 2025-09-14 19:26:51 +08:00
nothing important
This commit is contained in:
parent
062ff685c5
commit
aec39883ab
@ -236,7 +236,7 @@ public class FakePlayer {
|
||||
* @param sender 命令执行者
|
||||
* @return 是否是创建者
|
||||
*/
|
||||
public boolean isCreator(@NotNull CommandSender sender) {
|
||||
public boolean isCreatedBy(@NotNull CommandSender sender) {
|
||||
if (this.creator instanceof Player pc && sender instanceof Player ps) {
|
||||
return pc.getUniqueId().equals(ps.getUniqueId());
|
||||
}
|
||||
|
@ -137,7 +137,7 @@ public class FakeplayerManager {
|
||||
public @Nullable Player get(@NotNull CommandSender creator, @NotNull String name) {
|
||||
return Optional
|
||||
.ofNullable(this.playerList.getByName(name))
|
||||
.filter(p -> p.isCreator(creator))
|
||||
.filter(p -> p.isCreatedBy(creator))
|
||||
.map(FakePlayer::getPlayer)
|
||||
.orElse(null);
|
||||
}
|
||||
@ -508,7 +508,7 @@ public class FakeplayerManager {
|
||||
if (fp == null) {
|
||||
return false;
|
||||
}
|
||||
if (!viewer.isOp() && !fp.isCreator(viewer)) {
|
||||
if (!viewer.isOp() && !fp.isCreatedBy(viewer)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user