本文整理汇总了Java中org.spongepowered.api.data.manipulator.mutable.entity.ArmorStandData类的典型用法代码示例。如果您正苦于以下问题:Java ArmorStandData类的具体用法?Java ArmorStandData怎么用?Java ArmorStandData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ArmorStandData类属于org.spongepowered.api.data.manipulator.mutable.entity包,在下文中一共展示了ArmorStandData类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: create
import org.spongepowered.api.data.manipulator.mutable.entity.ArmorStandData; //导入依赖的package包/类
private boolean create() {
if (this.entity == null) {
return false;
}
if (this.stand != null) {
// For some reason setPassenger behaves differently
return this.entity.setVehicle(this.stand);
}
this.stand = (ArmorStand) this.entity.getWorld().createEntity(EntityTypes.ARMOR_STAND,
this.entity.getLocation().getPosition());
if (!this.stand.offer(Keys.HAS_GRAVITY, false).isSuccessful()) {
return false;
}
ArmorStandData data = this.stand.getOrCreate(ArmorStandData.class).get();
data.set(data.basePlate().set(false));
data.set(data.small().set(true));
data.set(data.marker().set(true));
if (!this.stand.offer(data).isSuccessful()) {
return false;
}
this.stand.tryOffer(Keys.INVISIBLE, true);
if (!this.stand.addPassenger(this.entity)) {
return false;
}
return true;
}
示例2: setupArmorStand
import org.spongepowered.api.data.manipulator.mutable.entity.ArmorStandData; //导入依赖的package包/类
private void setupArmorStand(ArmorStand stand, Vector3d rotation) {
ArmorStandData data = stand.getOrCreate(ArmorStandData.class).get();
data.set(data.basePlate().set(false));
data.set(data.marker().set(true));
stand.offer(data);
stand.offer(Keys.HAS_GRAVITY, false);
if (rotation != null) {
stand.offer(Keys.HEAD_ROTATION, rotation);
}
stand.setRotation(Vector3d.ZERO);
stand.setHelmet(this.pane);
// EntityArmorStand entStand = (EntityArmorStand) stand;
// entStand.preventEntitySpawning = false;
// entStand.width = 0.5F;
// entStand.height = 1.1F;
// entStand.noClip = true;
// AxisAlignedBB bb = entStand.getEntityBoundingBox();
// entStand.setEntityBoundingBox(new AxisAlignedBB(bb.minX, bb.minY, bb.minZ,
// bb.minX + 0.5, bb.minY + 0.5, bb.minZ + 0.5));
stand.tryOffer(Keys.INVISIBLE, true);
}
示例3: ArmorStandDataView
import org.spongepowered.api.data.manipulator.mutable.entity.ArmorStandData; //导入依赖的package包/类
public ArmorStandDataView(ArmorStandData value) {
super(value);
this.arms = value.arms().get();
this.basePlate = value.basePlate().get();
this.marker = value.marker().get();
this.small = value.small().get();
}
示例4: createInternalEntities
import org.spongepowered.api.data.manipulator.mutable.entity.ArmorStandData; //导入依赖的package包/类
private boolean createInternalEntities(CustomWorld world) {
if (!this.block.hasEntity()) {
FallingBlock actualBlock = (FallingBlock) this.world.createEntity(EntityTypes.FALLING_BLOCK, this.pos);
if (!this.block.setEntity(actualBlock, true)) {
return false;
}
world.addEntityToTracker(actualBlock, this);
world.addEntityToTracker(this.block.getStand(), this);
this.tracker.add("blockEntity", actualBlock);
this.tracker.add("blockStand", this.block.getStand());
actualBlock.offer(Keys.FALLING_BLOCK_STATE, createBlockState());
actualBlock.offer(Keys.FALL_TIME, Integer.MIN_VALUE);
actualBlock.offer(Keys.CAN_DROP_AS_ITEM, false);
}
if (this.pickaxeStand == null) {
this.pickaxeStand = (ArmorStand) this.world.createEntity(EntityTypes.ARMOR_STAND, getPickaxePos());
ArmorStandData data = this.pickaxeStand.getOrCreate(ArmorStandData.class).get();
data.set(data.basePlate().set(false));
// data.set(data.marker().set(true));
this.pickaxeStand.offer(data);
this.pickaxeStand.offer(Keys.HAS_GRAVITY, false);
this.pickaxeStand.tryOffer(Keys.INVISIBLE, true);
this.pickaxeStand.setRotation(getPickaxeRot());
this.pickaxeStand.offer(Keys.RIGHT_ARM_ROTATION, new Vector3d(-45, 0, 0));
this.pickaxeStand.setItemInHand(HandTypes.MAIN_HAND, ItemStack.of(ItemTypes.DIAMOND_PICKAXE, 1));
world.addEntityToTracker(this.pickaxeStand, this);
this.tracker.add("toolStand", this.pickaxeStand);
}
return true;
}
示例5: createStand
import org.spongepowered.api.data.manipulator.mutable.entity.ArmorStandData; //导入依赖的package包/类
private static ArmorStand createStand(World world, Vector3d pos) {
ArmorStand stand = (ArmorStand) world.createEntity(EntityTypes.ARMOR_STAND, pos);
ArmorStandData data = stand.getOrCreate(ArmorStandData.class).get();
data.set(data.small().set(true));
data.set(data.basePlate().set(false));
data.set(data.marker().set(true));
stand.offer(data);
stand.offer(Keys.HAS_GRAVITY, false);
stand.tryOffer(Keys.INVISIBLE, true);
return stand;
}