本文整理汇总了Java中net.minecraft.server.EntityHanging类的典型用法代码示例。如果您正苦于以下问题:Java EntityHanging类的具体用法?Java EntityHanging怎么用?Java EntityHanging使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EntityHanging类属于net.minecraft.server包,在下文中一共展示了EntityHanging类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: setFacingDirection
import net.minecraft.server.EntityHanging; //导入依赖的package包/类
public boolean setFacingDirection(BlockFace face, boolean force) {
EntityHanging hanging = getHandle();
EnumDirection dir = hanging.direction;
switch (face) {
case SOUTH:
default:
getHandle().setDirection(EnumDirection.SOUTH);
break;
case WEST:
getHandle().setDirection(EnumDirection.WEST);
break;
case NORTH:
getHandle().setDirection(EnumDirection.NORTH);
break;
case EAST:
getHandle().setDirection(EnumDirection.EAST);
break;
}
if (!force && !hanging.survives()) {
// Revert since it doesn't fit
hanging.setDirection(dir);
return false;
}
return true;
}
开发者ID:tgnmc,项目名称:Craftbukkit,代码行数:26,代码来源:CraftHanging.java
示例2: setFacingDirection
import net.minecraft.server.EntityHanging; //导入依赖的package包/类
public boolean setFacingDirection(BlockFace face, boolean force) {
Block block = getLocation().getBlock().getRelative(getAttachedFace()).getRelative(face.getOppositeFace()).getRelative(getFacing());
EntityHanging hanging = getHandle();
int x = hanging.x, y = hanging.y, z = hanging.z, dir = hanging.direction;
hanging.x = block.getX();
hanging.y = block.getY();
hanging.z = block.getZ();
switch (face) {
case SOUTH:
default:
getHandle().setDirection(0);
break;
case WEST:
getHandle().setDirection(1);
break;
case NORTH:
getHandle().setDirection(2);
break;
case EAST:
getHandle().setDirection(3);
break;
}
if (!force && !hanging.survives()) {
// Revert since it doesn't fit
hanging.x = x;
hanging.y = y;
hanging.z = z;
hanging.setDirection(dir);
return false;
}
return true;
}
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:33,代码来源:CraftHanging.java
示例3: CraftHanging
import net.minecraft.server.EntityHanging; //导入依赖的package包/类
public CraftHanging(CraftServer server, EntityHanging entity) {
super(server, entity);
}
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:4,代码来源:CraftHanging.java
示例4: getHandle
import net.minecraft.server.EntityHanging; //导入依赖的package包/类
@Override
public EntityHanging getHandle() {
return (EntityHanging) entity;
}
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:5,代码来源:CraftHanging.java
注:本文中的net.minecraft.server.EntityHanging类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论