本文整理了Java中net.minecraft.entity.Entity.changeDimension()
方法的一些代码示例,展示了Entity.changeDimension()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Entity.changeDimension()
方法的具体详情如下:
包路径:net.minecraft.entity.Entity
类名称:Entity
方法名:changeDimension
暂无
代码示例来源:origin: CoFH/ThermalDynamics
public void transferNormalEntity(int curDim, int destDim, WorldServer currentWorld, WorldServer destinationWorld, Entity entity) {
entity.changeDimension(destDim);
/*
TODO verify that this works for normal entity
entity.world.removeEntity(entity);
this.world.getMinecraftServer().getConfigurationManager().transferEntityToWorld(entity, curDim, currentWorld, destinationWorld);
destinationWorld.spawnEntityInWorld(entity);
entity.dimension = destDim;
*/
}
代码示例来源:origin: CoFH/ThermalDynamics
public void transferPlayer(int destDim, Entity entity) {
entity.changeDimension(destDim);
}
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
entity.changeDimension( link.dim.provider.getDimension(), new METeleporter( link ) );
代码示例来源:origin: SleepyTrousers/EnderIO
private static void serverEntityDimensionTeleport(@Nonnull Entity entity, @Nonnull BlockPos pos, int targetDim, @Nonnull TravelSource source) {
SoundHelper.playSound(entity.world, entity, source.sound, 1.0F, 1.0F);
entity.changeDimension(targetDim, new ITeleporter() {
@Override
public void placeEntity(World world, Entity entity2, float yaw) {
entity2.setLocationAndAngles(pos.getX() + 0.5, pos.getY() + 1.1, pos.getZ() + 0.5, entity2.rotationYaw, entity2.rotationPitch);
entity2.motionX = 0;
entity2.motionY = 0;
entity2.motionZ = 0;
entity2.fallDistance = 0;
}
});
SoundHelper.playSound(entity.world, entity, source.sound, 1.0F, 1.0F);
}
代码示例来源:origin: TeamLapen/Vampirism
@Override
public void teleportMinionsToLord() {
List<T> toTeleportDim = new ArrayList<>();
Entity e1 = lord.getRepresentingEntity();
Iterator<T> it = minions.iterator();
while (it.hasNext()) {
T m = it.next();
Entity e = MinionHelper.entity(m);
if (e1.dimension != e.dimension) {
toTeleportDim.add(m);
it.remove();
}
}
for (IMinion m : minions) {
Entity e = MinionHelper.entity(m);
e.copyLocationAndAnglesFrom(e1);
}
for (IMinion m : toTeleportDim) {
//Logger.d(TAG, "Teleporting minion");
Entity e = MinionHelper.entity(m);
e.changeDimension(e1.dimension);
e.timeUntilPortal = e.getPortalCooldown();
}
}
内容来源于网络,如有侵权,请联系作者删除!