本文整理了Java中net.minecraft.entity.Entity.getPersistentID()
方法的一些代码示例,展示了Entity.getPersistentID()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Entity.getPersistentID()
方法的具体详情如下:
包路径:net.minecraft.entity.Entity
类名称:Entity
方法名:getPersistentID
暂无
代码示例来源:origin: McJtyMods/TheOneProbe
public PacketGetEntityInfo(int dim, ProbeMode mode, RayTraceResult mouseOver, Entity entity) {
this.dim = dim;
this.uuid = entity.getPersistentID();
this.mode = mode;
this.hitVec = mouseOver.hitVec;
}
代码示例来源:origin: SquidDev-CC/plethora
public EntityIdentifier(Entity entity) {
this.uuid = entity.getPersistentID();
this.name = null;
}
代码示例来源:origin: PenguinSquad/Harvest-Festival
public static UUID getEntityUUID(Entity entity) {
return entity.getPersistentID();
}
代码示例来源:origin: ValkyrienWarfare/Valkyrien-Warfare-Revamped
public Vector getLocalPositionForEntity(Entity getPositionFor) {
int uuidHash = getPositionFor.getPersistentID().hashCode();
return entityLocalPositions.get(uuidHash);
}
代码示例来源:origin: ValkyrienWarfare/Valkyrien-Warfare-Revamped
public boolean isEntityFixed(Entity toCheck) {
return entityLocalPositions.containsKey(toCheck.getPersistentID().hashCode());
}
代码示例来源:origin: ValkyrienWarfare/Valkyrien-Warfare-Revamped
public EntityFixMessage(PhysicsWrapperEntity toFixOn, Entity toFix, boolean isFixing, Vector localPos) {
shipId = toFixOn.getEntityId();
entityUUID = toFix.getPersistentID().hashCode();
this.isFixing = isFixing;
localPosition = localPos;
}
代码示例来源:origin: ldtteam/minecolonies
/**
* Method to get a new instance of a location given the input.
*
* @param factoryController The {@link IFactoryController} that called this method.
* @param input The input to build a new location for.
* @return The new output instance for a given input.
*/
@NotNull
@Override
public EntityLocation getNewInstance(@NotNull final IFactoryController factoryController, @NotNull final Entity input)
{
return new EntityLocation(input.getPersistentID());
}
}
代码示例来源:origin: ValkyrienWarfare/Valkyrien-Warfare-Revamped
/**
* ONLY USE THESE 2 METHODS TO EVER ADD/REMOVE ENTITIES
*/
public void unFixEntity(Entity toUnfix) {
EntityFixMessage entityUnfixingMessage = new EntityFixMessage(wrapper, toUnfix, false, null);
for (EntityPlayerMP watcher : watchingPlayers) {
ValkyrienWarfareControl.controlNetwork.sendTo(entityUnfixingMessage, watcher);
}
entityLocalPositions.remove(toUnfix.getPersistentID().hashCode());
}
代码示例来源:origin: P3pp3rF1y/AncientWarfare2
public List<Entity> getEntities(World world) {
List<Entity> in = Lists.newArrayList();
if (world instanceof WorldServer) {
WorldServer worldServer = (WorldServer) world;
for (UUID id : ids) {
Entity e = worldServer.getEntityFromUuid(id);
if (e != null) {
in.add(e);
}
}
} else if (world instanceof WorldClient) {
for (Entity entity : world.loadedEntityList) {
for (UUID id : ids) {
if (entity.getPersistentID().equals(id)) {
in.add(entity);
}
}
}
}
return in;
}
代码示例来源:origin: ValkyrienWarfare/Valkyrien-Warfare-Revamped
/**
* ONLY USE THESE 2 METHODS TO EVER ADD/REMOVE ENTITIES, OTHERWISE YOU'LL RUIN
* EVERYTHING!
*
* @param toFix
* @param posInLocal
*/
public void fixEntity(Entity toFix, Vector posInLocal) {
EntityFixMessage entityFixingMessage = new EntityFixMessage(wrapper, toFix, true, posInLocal);
for (EntityPlayerMP watcher : watchingPlayers) {
ValkyrienWarfareControl.controlNetwork.sendTo(entityFixingMessage, watcher);
}
entityLocalPositions.put(toFix.getPersistentID().hashCode(), posInLocal);
}
代码示例来源:origin: P3pp3rF1y/AncientWarfare2
public void findEntity(World world) {
if (blockTarget) {
return;
}
if (entity != null) {
return;
}
if (entityUUID == null) {
entity = world.getEntityByID(entityID);
if (entity != null) {
entityUUID = entity.getPersistentID();
}
} else {
entity = world.getPlayerEntityByUUID(entityUUID);
}
}
代码示例来源:origin: P3pp3rF1y/AncientWarfare2
private void handleMissingOwner() {
if (this.entityID == null) {
this.noParentTicks++;
} else if (!getOwner().isPresent()) {
this.noParentTicks++;
List<Entity> entities = this.world.loadedEntityList;
for (Entity ent : entities) {
if (ent.getPersistentID().equals(entityID) && ent instanceof EntityGate) {
setOwner((EntityGate) ent);
this.noParentTicks = 0;
break;
}
}
}
if (this.noParentTicks >= 100 || getOwner().map(o -> o.isDead).orElse(false)) {
owner = null;
this.world.setBlockToAir(pos);
}
}
代码示例来源:origin: SquidDev-CC/plethora
private void handleMessage(Entity sender, String message) {
access.queueEvent("chat_message", sender.getDisplayName().getUnformattedText(), message, sender.getPersistentID().toString());
}
代码示例来源:origin: SquidDev-CC/plethora
private synchronized boolean handleCapture(Entity sender, String message) {
for (String pattern : patterns) {
if (LuaPattern.matches(message, pattern)) {
access.queueEvent("chat_capture", message, pattern, sender.getDisplayName().getUnformattedText(), sender.getPersistentID().toString());
return true;
}
}
return false;
}
代码示例来源:origin: portablejim/VeinMiner
private void sendProperChatToPlayer(ICommandSender player, String incomingMessage, Object... params) {
ITextComponent message;
if(minerServer.playerHasClient(player.getCommandSenderEntity().getPersistentID())) {
message = new TextComponentTranslation(incomingMessage, params);
}
else {
String rawMessage = I18n.translateToLocal(incomingMessage);
message = new TextComponentString(String.format(rawMessage, params));
}
player.addChatMessage(message);
}
代码示例来源:origin: McJtyMods/TheOneProbe
UUID uuid = entity.getPersistentID();
代码示例来源:origin: WayofTime/BloodMagic
/**
* @return A description in the format item|item registry name|dimensionID|entityName|entityPos
*/
public static SoulTicket item(ItemStack itemStack, World world, Entity entity, int amount) {
return new SoulTicket(new TextComponentString("item|" + itemStack.getItem().getRegistryName() + "|" + world.provider.getDimension() + "|" + entity.getPersistentID()), amount);
}
内容来源于网络,如有侵权,请联系作者删除!