本文整理了Java中net.minecraft.entity.Entity.getCachedUniqueIdString()
方法的一些代码示例,展示了Entity.getCachedUniqueIdString()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Entity.getCachedUniqueIdString()
方法的具体详情如下:
包路径:net.minecraft.entity.Entity
类名称:Entity
方法名:getCachedUniqueIdString
暂无
代码示例来源:origin: TeamWizardry/Wizardry
public Set<Entity> getTrackedEntities(World world) {
Set<Entity> tracking = new HashSet<>();
for (Entity inWorld : world.loadedEntityList)
if (trackingEntities.contains(inWorld.getCachedUniqueIdString()))
tracking.add(inWorld);
return tracking;
}
代码示例来源:origin: TeamWizardry/Wizardry
public void apply(Entity entity) {
List<EntityMoment> momentsOfEntity = entities.get(entity.getCachedUniqueIdString());
if (momentsOfEntity == null || momentsOfEntity.isEmpty())
return;
momentsOfEntity.get(0).apply(entity);
}
代码示例来源:origin: TeamWizardry/Wizardry
private void capEntity(Entity entity) {
capEntity(entity.getCachedUniqueIdString());
}
代码示例来源:origin: TeamWizardry/Wizardry
public void trackEntity(Entity entity) {
trackingEntities.add(entity.getCachedUniqueIdString());
manager.pushEntityData(entity);
compressDownTo(MAXIMUM_MOMENTS);
}
代码示例来源:origin: TeamWizardry/Wizardry
public void addEntitySnapshot(Entity entity) {
String uuid = entity.getCachedUniqueIdString();
EntityMoment total = totalDifference.get(uuid);
EntityMoment newMoment = EntityMoment.fromPreviousMoment(entity, total);
if (total == null)
totalDifference.put(uuid, newMoment);
else if (!total.matches(entity))
totalDifference.put(uuid, total.withOverride(newMoment));
else
return;
entities.put(entity.getCachedUniqueIdString(), new EntityMoment(entity));
capEntity(entity);
}
代码示例来源:origin: TeamWizardry/Wizardry
public void apply(Entity entity, float partialTicks) {
if (partialTicks == 0) {
apply(entity);
return;
}
List<EntityMoment> momentsOfEntity = entities.get(entity.getCachedUniqueIdString());
if (momentsOfEntity == null || momentsOfEntity.isEmpty())
return;
int stackIndexOfMoment = (int) (momentsOfEntity.size() * partialTicks);
int indexOfMoment = momentsOfEntity.size() - stackIndexOfMoment;
if (indexOfMoment == 0) {
apply(entity);
return;
}
EntityMoment momentToApply = momentsOfEntity.get(indexOfMoment);
EntityMoment nextMoment = momentsOfEntity.get(indexOfMoment - 1);
float subPartial = partialTicks * momentsOfEntity.size() - ((float) stackIndexOfMoment / momentsOfEntity.size());
momentToApply.apply(entity, nextMoment, subPartial);
}
代码示例来源:origin: Mine-and-blade-admin/Battlegear2
@Override
public void write(ByteBuf out) {
ByteBufUtils.writeUTF8String(out, player.getCachedUniqueIdString());
boolean isPlayer = entityHit instanceof EntityPlayer;
out.writeBoolean(isPlayer);
if(isPlayer){
ByteBufUtils.writeUTF8String(out, entityHit.getCachedUniqueIdString());
}else{
out.writeInt(entityHit != null?entityHit.getEntityId():-1);
}
}
}
代码示例来源:origin: SquidDev-CC/plethora
@Nonnull
@Override
protected HoverEvent getHoverEvent() {
NBTTagCompound tag = new NBTTagCompound();
Entity owner = getOwner();
if (owner != null) {
tag.setString("id", owner.getCachedUniqueIdString());
tag.setString("name", owner.getName());
ResourceLocation type = EntityList.getKey(owner);
if (type != null) tag.setString("type", type.toString());
} else {
tag.setString("id", getCachedUniqueIdString());
tag.setString("name", getName());
}
return new HoverEvent(HoverEvent.Action.SHOW_ENTITY, new TextComponentString(tag.toString()));
}
内容来源于网络,如有侵权,请联系作者删除!