mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-21 16:09:26 +00:00
添加判断是否是基岩版玩家api
This commit is contained in:
@@ -168,6 +168,8 @@ public class BukkitServerPlayer extends Player {
|
|||||||
private int lastHitFurnitureTick;
|
private int lastHitFurnitureTick;
|
||||||
// 控制展示实体可见距离
|
// 控制展示实体可见距离
|
||||||
private double displayEntityViewDistance;
|
private double displayEntityViewDistance;
|
||||||
|
// 是否是基岩版
|
||||||
|
private Tristate isBedrock = Tristate.UNDEFINED;
|
||||||
|
|
||||||
public BukkitServerPlayer(BukkitCraftEngine plugin, @Nullable Channel channel) {
|
public BukkitServerPlayer(BukkitCraftEngine plugin, @Nullable Channel channel) {
|
||||||
this.channel = channel;
|
this.channel = channel;
|
||||||
@@ -1517,6 +1519,14 @@ public class BukkitServerPlayer extends Player {
|
|||||||
return FastNMS.INSTANCE.method$Inventory$clearOrCountMatchingItems(inventory, predicate, count, craftSlots);
|
return FastNMS.INSTANCE.method$Inventory$clearOrCountMatchingItems(inventory, predicate, count, craftSlots);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isBedrock() {
|
||||||
|
if (this.isBedrock == Tristate.UNDEFINED) {
|
||||||
|
this.isBedrock = Tristate.of(this.plugin.compatibilityManager().isBedrockPlayer(this));
|
||||||
|
}
|
||||||
|
return this.isBedrock.asBoolean();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addTrackedFurniture(int entityId, Furniture furniture) {
|
public void addTrackedFurniture(int entityId, Furniture furniture) {
|
||||||
this.trackedFurniture.put(entityId, new VirtualCullableObject(furniture));
|
this.trackedFurniture.put(entityId, new VirtualCullableObject(furniture));
|
||||||
|
|||||||
@@ -232,6 +232,8 @@ public abstract class Player extends AbstractEntity implements NetWorkUser {
|
|||||||
|
|
||||||
public abstract int clearOrCountMatchingInventoryItems(Key itemId, int count);
|
public abstract int clearOrCountMatchingInventoryItems(Key itemId, int count);
|
||||||
|
|
||||||
|
public abstract boolean isBedrock();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void remove() {
|
public void remove() {
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user