-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix when prevent-kicking is ALWAYS can not kick a normal real player
- Loading branch information
Showing
4 changed files
with
28 additions
and
11 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
fakeplayer-core/src/main/java/io/github/hello09x/fakeplayer/core/constant/MetadataKeys.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,25 @@ | ||
package io.github.hello09x.fakeplayer.core.constant; | ||
|
||
import com.google.common.collect.Iterables; | ||
import org.bukkit.entity.Player; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
public interface MetadataKeys { | ||
|
||
|
||
String SELECTION = "fakeplayer:selection"; | ||
|
||
String REPLENISH = "fakeplayer:replenish"; | ||
|
||
String SPAWNED_AT = "fakeplayer:spawned_at"; | ||
|
||
static @Nullable Integer getSpawnedAt(@NotNull Player player) { | ||
var value = Iterables.getFirst(player.getMetadata(SPAWNED_AT), null); | ||
if (value == null) { | ||
return null; | ||
} | ||
return value.asInt(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters