本文整理汇总了Java中net.minecraft.entity.player.EntityPlayer.getUniqueID方法的典型用法代码示例。如果您正苦于以下问题:Java EntityPlayer.getUniqueID方法的具体用法?Java EntityPlayer.getUniqueID怎么用?Java EntityPlayer.getUniqueID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.entity.player.EntityPlayer
的用法示例。
在下文中一共展示了EntityPlayer.getUniqueID方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createActionOptions
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
public int createActionOptions(World world, BlockPos pos, EnumFacing side, @Nullable EntityPlayer player) {
List<MeeCreepActionType> types = new ArrayList<>();
List<MeeCreepActionType> maybeTypes = new ArrayList<>();
for (MeeCreepsApi.Factory type : MeeCreeps.api.getFactories()) {
if (Config.allowedActions.contains(type.getId())) {
if (type.getFactory().isPossible(world, pos, side)) {
types.add(new MeeCreepActionType(type.getId()));
} else if (type.getFactory().isPossibleSecondary(world, pos, side)) {
maybeTypes.add(new MeeCreepActionType(type.getId()));
}
}
}
int actionId = newId();
ActionOptions opt = new ActionOptions(types, maybeTypes, pos, side, world.provider.getDimension(), player == null ? null : player.getUniqueID(), actionId);
options.add(opt);
optionMap.put(actionId, opt);
save();
return actionId;
}
示例2: setPlayer
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
public void setPlayer(EntityPlayer player)
{
if (player != null)
{
this.stackOwner = player.getUniqueID();
} else
{
this.stackOwner = null;
}
markDirty();
}
示例3: shouldAttackPlayer
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
private boolean shouldAttackPlayer(EntityPlayer player) {
if (isTamed() && player.getUniqueID() == getOwnerId()) {
return false;
}
if (getAttackingEntity() != null && getAttackingEntity() == player) {
if (isTamed() && isSitting()) {
setSitting(false);
}
}
return getAttackingEntity() != null && getAttackingEntity() == player;
}
示例4: isBot
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
public static boolean isBot(EntityPlayer entity) {
if (entity.getUniqueID().toString().startsWith(entity.getCommandSenderName()))
return true;
if (!StringUtils.stripControlCodes(entity.getGameProfile().getName()).equals(entity.getCommandSenderName()))
return true;
if (entity.getGameProfile().getId() != entity.getUniqueID())
return true;
return false;
}
示例5: isValid
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
public boolean isValid(EntityPlayer player) {
boolean valid = isPlayerValid(player);
UUID uuid = player.getUniqueID();
boolean suspicious = !(pingUpdatedUUIDs.contains(uuid) || sneakUpdatedUUIDs.contains(uuid) || sprintUpdatedUUIDs.contains(uuid));
return valid && !AntiBot.isBot(player) && !suspicious && onFloorUUIDs.contains(uuid);
}
示例6: setPlayer
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
public void setPlayer(EntityPlayer player) {
playerUUID = player.getUniqueID();
playerName = player.getName();
// playerProfile = updateGameprofile(player.getGameProfile());
}