本文整理汇总了Java中net.minecraft.server.EntityPainting类的典型用法代码示例。如果您正苦于以下问题:Java EntityPainting类的具体用法?Java EntityPainting怎么用?Java EntityPainting使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EntityPainting类属于net.minecraft.server包,在下文中一共展示了EntityPainting类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getEntityTrackingRange
import net.minecraft.server.EntityPainting; //导入依赖的package包/类
/**
* 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 );
}
开发者ID:AlmuraDev,项目名称:Almura-Server,代码行数:32,代码来源:TrackingRange.java
示例2: setArt
import net.minecraft.server.EntityPainting; //导入依赖的package包/类
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;
}
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:15,代码来源:CraftPainting.java
示例3: update
import net.minecraft.server.EntityPainting; //导入依赖的package包/类
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;
}
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:14,代码来源:CraftPainting.java
示例4: update
import net.minecraft.server.EntityPainting; //导入依赖的package包/类
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;
}
开发者ID:tgnmc,项目名称:Craftbukkit,代码行数:12,代码来源:CraftPainting.java
示例5: getEntityTrackingRange
import net.minecraft.server.EntityPainting; //导入依赖的package包/类
/**
* 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;
}
}
开发者ID:pvginkel,项目名称:Tweakkit-Server,代码行数:38,代码来源:TrackingRange.java
示例6: CraftPainting
import net.minecraft.server.EntityPainting; //导入依赖的package包/类
public CraftPainting(CraftServer server, EntityPainting entity) {
super(server, entity);
}
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:4,代码来源:CraftPainting.java
示例7: getHandle
import net.minecraft.server.EntityPainting; //导入依赖的package包/类
@Override
public EntityPainting getHandle() {
return (EntityPainting) entity;
}
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:5,代码来源:CraftPainting.java
注:本文中的net.minecraft.server.EntityPainting类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论