Java 类net.minecraft.server.EntityPainting 实例源码

项目:Almura-Server    文件:TrackingRange.java   
/**
 * Gets the range an entity should be 'tracked' by players and visible in
 * the client.
 *
 * @param entity
 * @param defaultRange Default range defined by Mojang
 * @return
 */
public static int getEntityTrackingRange(Entity entity, int defaultRange)
{
    SpigotWorldConfig config = entity.world.spigotConfig;
    int range = defaultRange;
    if ( entity instanceof EntityPlayer )
    {
        range = config.playerTrackingRange;
    } else if ( entity.defaultActivationState || entity instanceof EntityGhast )
    {
        range = defaultRange;
    } else if ( entity.activationType == 1 )
    {
        range = config.monsterTrackingRange;
    } else if ( entity.activationType == 2 )
    {
        range = config.animalTrackingRange;
    } else if ( entity instanceof EntityItemFrame || entity instanceof EntityPainting || entity instanceof EntityItem || entity instanceof EntityExperienceOrb )
    {
        range = config.miscTrackingRange;
    }

    return Math.min( config.maxTrackingRange, range );
}
项目:CraftBukkit    文件:CraftPainting.java   
public boolean setArt(Art art, boolean force) {
    EntityPainting painting = this.getHandle();
    EnumArt oldArt = painting.art;
    painting.art = CraftArt.BukkitToNotch(art);
    painting.setDirection(painting.direction);
    if (!force && !painting.survives()) {
        // Revert painting since it doesn't fit
        painting.art = oldArt;
        painting.setDirection(painting.direction);
        return false;
    }
    this.update();
    return true;
}
项目:CraftBukkit    文件:CraftPainting.java   
private void update() {
    WorldServer world = ((CraftWorld) getWorld()).getHandle();
    EntityPainting painting = new EntityPainting(world);
    painting.x = getHandle().x;
    painting.y = getHandle().y;
    painting.z = getHandle().z;
    painting.art = getHandle().art;
    painting.setDirection(getHandle().direction);
    getHandle().die();
    getHandle().velocityChanged = true; // because this occurs when the painting is broken, so it might be important
    world.addEntity(painting);
    this.entity = painting;
}
项目:Craftbukkit    文件:CraftPainting.java   
public boolean setArt(Art art, boolean force) {
    EntityPainting painting = this.getHandle();
    EnumArt oldArt = painting.art;
    painting.art = CraftArt.BukkitToNotch(art);
    painting.setDirection(painting.direction);
    if (!force && !painting.survives()) {
        // Revert painting since it doesn't fit
        painting.art = oldArt;
        painting.setDirection(painting.direction);
        return false;
    }
    this.update();
    return true;
}
项目:Craftbukkit    文件:CraftPainting.java   
private void update() {
    WorldServer world = ((CraftWorld) getWorld()).getHandle();
    EntityPainting painting = new EntityPainting(world);
    painting.blockPosition = getHandle().blockPosition;
    painting.art = getHandle().art;
    painting.setDirection(getHandle().direction);
    getHandle().die();
    getHandle().velocityChanged = true; // because this occurs when the painting is broken, so it might be important
    world.addEntity(painting);
    this.entity = painting;
}
项目:Almura-Server    文件:CraftPainting.java   
public boolean setArt(Art art, boolean force) {
    EntityPainting painting = this.getHandle();
    EnumArt oldArt = painting.art;
    painting.art = CraftArt.BukkitToNotch(art);
    painting.setDirection(painting.direction);
    if (!force && !painting.survives()) {
        // Revert painting since it doesn't fit
        painting.art = oldArt;
        painting.setDirection(painting.direction);
        return false;
    }
    this.update();
    return true;
}
项目:Almura-Server    文件:CraftPainting.java   
private void update() {
    WorldServer world = ((CraftWorld) getWorld()).getHandle();
    EntityPainting painting = new EntityPainting(world);
    painting.x = getHandle().x;
    painting.y = getHandle().y;
    painting.z = getHandle().z;
    painting.art = getHandle().art;
    painting.setDirection(getHandle().direction);
    getHandle().die();
    getHandle().velocityChanged = true; // because this occurs when the painting is broken, so it might be important
    world.addEntity(painting);
    this.entity = painting;
}
项目:Tweakkit-Server    文件:CraftPainting.java   
public boolean setArt(Art art, boolean force) {
    EntityPainting painting = this.getHandle();
    EnumArt oldArt = painting.art;
    painting.art = CraftArt.BukkitToNotch(art);
    painting.setDirection(painting.direction);
    if (!force && !painting.survives()) {
        // Revert painting since it doesn't fit
        painting.art = oldArt;
        painting.setDirection(painting.direction);
        return false;
    }
    this.update();
    return true;
}
项目:Tweakkit-Server    文件:CraftPainting.java   
private void update() {
    WorldServer world = ((CraftWorld) getWorld()).getHandle();
    EntityPainting painting = new EntityPainting(world);
    painting.x = getHandle().x;
    painting.y = getHandle().y;
    painting.z = getHandle().z;
    painting.art = getHandle().art;
    painting.setDirection(getHandle().direction);
    getHandle().die();
    getHandle().velocityChanged = true; // because this occurs when the painting is broken, so it might be important
    world.addEntity(painting);
    this.entity = painting;
}
项目:Tweakkit-Server    文件:TrackingRange.java   
/**
 * Gets the range an entity should be 'tracked' by players and visible in
 * the client.
 *
 * @param entity
 * @param defaultRange Default range defined by Mojang
 * @return
 */
public static int getEntityTrackingRange(Entity entity, int defaultRange)
{
    SpigotWorldConfig config = entity.world.spigotConfig;
    if ( entity instanceof EntityPlayer )
    {
        return config.playerTrackingRange;
    }  else if ( entity.activationType == 1 )
    {
        return config.monsterTrackingRange;
    } else if ( entity instanceof EntityGhast )
    {
        if ( config.monsterTrackingRange > config.monsterActivationRange )
        {
            return config.monsterTrackingRange;
        } else
        {
            return config.monsterActivationRange;
        }
    } else if ( entity.activationType == 2 )
    {
        return config.animalTrackingRange;
    } else if ( entity instanceof EntityItemFrame || entity instanceof EntityPainting || entity instanceof EntityItem || entity instanceof EntityExperienceOrb )
    {
        return config.miscTrackingRange;
    } else 
    {
        return config.otherTrackingRange;
    }
}
项目:SpigotSource    文件:CraftPainting.java   
public boolean setArt(Art art, boolean force) {
    EntityPainting painting = this.getHandle();
    EnumArt oldArt = painting.art;
    painting.art = CraftArt.BukkitToNotch(art);
    painting.setDirection(painting.direction);
    if (!force && !painting.survives()) {
        // Revert painting since it doesn't fit
        painting.art = oldArt;
        painting.setDirection(painting.direction);
        return false;
    }
    this.update();
    return true;
}
项目:SpigotSource    文件:CraftPainting.java   
private void update() {
    WorldServer world = ((CraftWorld) getWorld()).getHandle();
    EntityPainting painting = new EntityPainting(world);
    painting.blockPosition = getHandle().blockPosition;
    painting.art = getHandle().art;
    painting.setDirection(getHandle().direction);
    getHandle().die();
    getHandle().velocityChanged = true; // because this occurs when the painting is broken, so it might be important
    world.addEntity(painting);
    this.entity = painting;
}
项目:SpigotSource    文件:TrackingRange.java   
/**
 * Gets the range an entity should be 'tracked' by players and visible in
 * the client.
 *
 * @param entity
 * @param defaultRange Default range defined by Mojang
 * @return
 */
public static int getEntityTrackingRange(Entity entity, int defaultRange)
{
    SpigotWorldConfig config = entity.world.spigotConfig;
    if ( entity instanceof EntityPlayer )
    {
        return config.playerTrackingRange;
    }  else if ( entity.activationType == 1 )
    {
        return config.monsterTrackingRange;
    } else if ( entity instanceof EntityGhast )
    {
        if ( config.monsterTrackingRange > config.monsterActivationRange )
        {
            return config.monsterTrackingRange;
        } else
        {
            return config.monsterActivationRange;
        }
    } else if ( entity.activationType == 2 )
    {
        return config.animalTrackingRange;
    } else if ( entity instanceof EntityItemFrame || entity instanceof EntityPainting || entity instanceof EntityItem || entity instanceof EntityExperienceOrb )
    {
        return config.miscTrackingRange;
    } else 
    {
        return config.otherTrackingRange;
    }
}
项目:Craft-city    文件:CraftPainting.java   
public boolean setArt(Art art, boolean force) {
    EntityPainting painting = this.getHandle();
    EnumArt oldArt = painting.art;
    painting.art = CraftArt.BukkitToNotch(art);
    painting.setDirection(painting.direction);
    if (!force && !painting.survives()) {
        // Revert painting since it doesn't fit
        painting.art = oldArt;
        painting.setDirection(painting.direction);
        return false;
    }
    this.update();
    return true;
}
项目:Craft-city    文件:CraftPainting.java   
private void update() {
    WorldServer world = ((CraftWorld) getWorld()).getHandle();
    EntityPainting painting = new EntityPainting(world);
    painting.x = getHandle().x;
    painting.y = getHandle().y;
    painting.z = getHandle().z;
    painting.art = getHandle().art;
    painting.setDirection(getHandle().direction);
    getHandle().die();
    getHandle().velocityChanged = true; // because this occurs when the painting is broken, so it might be important
    world.addEntity(painting);
    this.entity = painting;
}
项目:CraftBukkit    文件:CraftPainting.java   
public CraftPainting(CraftServer server, EntityPainting entity) {
    super(server, entity);
}
项目:CraftBukkit    文件:CraftPainting.java   
@Override
public EntityPainting getHandle() {
    return (EntityPainting) entity;
}
项目:Craftbukkit    文件:CraftPainting.java   
public CraftPainting(CraftServer server, EntityPainting entity) {
    super(server, entity);
}
项目:Craftbukkit    文件:CraftPainting.java   
@Override
public EntityPainting getHandle() {
    return (EntityPainting) entity;
}
项目:Almura-Server    文件:CraftPainting.java   
public CraftPainting(CraftServer server, EntityPainting entity) {
    super(server, entity);
}
项目:Almura-Server    文件:CraftPainting.java   
@Override
public EntityPainting getHandle() {
    return (EntityPainting) entity;
}
项目:Tweakkit-Server    文件:CraftPainting.java   
public CraftPainting(CraftServer server, EntityPainting entity) {
    super(server, entity);
}
项目:Tweakkit-Server    文件:CraftPainting.java   
@Override
public EntityPainting getHandle() {
    return (EntityPainting) entity;
}
项目:SpigotSource    文件:CraftPainting.java   
public CraftPainting(CraftServer server, EntityPainting entity) {
    super(server, entity);
}
项目:SpigotSource    文件:CraftPainting.java   
@Override
public EntityPainting getHandle() {
    return (EntityPainting) entity;
}
项目:Craft-city    文件:CraftPainting.java   
public CraftPainting(CraftServer server, EntityPainting entity) {
    super(server, entity);
}
项目:Craft-city    文件:CraftPainting.java   
@Override
public EntityPainting getHandle() {
    return (EntityPainting) entity;
}