本文整理匯總了Java中com.flowpowered.math.vector.Vector3d.ZERO屬性的典型用法代碼示例。如果您正苦於以下問題:Java Vector3d.ZERO屬性的具體用法?Java Vector3d.ZERO怎麽用?Java Vector3d.ZERO使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.flowpowered.math.vector.Vector3d
的用法示例。
在下文中一共展示了Vector3d.ZERO屬性的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getPickaxeRot
private Vector3d getPickaxeRot() {
Direction facing = Utils.rotationToDirection(this.rotation.getY());
if (facing == Direction.NORTH) {
return new Vector3d(0, 180, 0);
}
if (facing == Direction.EAST) {
return new Vector3d(0, 270, 0);
}
if (facing == Direction.SOUTH) {
return Vector3d.ZERO;
}
if (facing == Direction.WEST) {
return new Vector3d(0, 90, 0);
}
return this.rotation;
}
示例2: GUIModel
@Builder
private GUIModel(@NonNull Object plugin, @NonNull TextureId textureId, ItemType itemType, Vector3d textureOffset, Vector2d textureSize, Vector4d uvRegion) {
Preconditions.checkArgument(itemType == null || ItemStack.builder().itemType(itemType).build().get(Keys.ITEM_DURABILITY).isPresent(),
"The specified type of itemStackSnapshot doesn't have a durability.");
this.pluginContainer = Sponge.getPluginManager().fromInstance(plugin)
.orElseThrow(() -> new IllegalArgumentException("Invalid plugin instance."));
this.textureId = textureId.getDirectory().isPresent() ? textureId : textureId.toBuilder().directory(
SimpleCustomInventoryRegistry.MODEL_DIRECTORY_NAME).build();
this.itemType = itemType != null ? itemType : DEFAULT_ITEM_TYPE;
this.textureOffset = textureOffset != null ? textureOffset : Vector3d.ZERO;
this.textureSize = textureSize != null ? textureSize : Vector2d.from(16);
this.uvRegion = uvRegion != null ? uvRegion : Vector4d.from(0, 0, this.textureSize.getX(), this.textureSize.getY());
}
示例3: getPosition
public Vector3d getPosition() {
return Vector3d.ZERO;
}
示例4: getRotation
@Override
public Vector3d getRotation() {
return Vector3d.ZERO;
}
示例5: getRotation
public Vector3d getRotation() {
return Vector3d.ZERO;
}
示例6: getRotation
public Vector3d getRotation() {
return rotation != null ? rotation : Vector3d.ZERO;
}
示例7: placeBlock
/**
* Constructs a custom block and places it in the world.
*
* @param block The block location
* @param cause The cause
* @return The wrapped block
*/
default T placeBlock(Block block, BlockChangeFlag flag, Cause cause) {
Location<World> location = block.getLocation()
.orElseThrow(() -> new IllegalStateException("Could not access the location of the provided block."));
World world = location.getExtent();
// Remove the previous custom block
CustomItemLibrary.getInstance().getService().removeArmorStandsAt(block);
location.setBlockType(CustomBlock.BLOCK_TYPE_CUSTOM, flag, cause);
ArmorStand armorStand = createDummyArmorStand(block);
Vector3d rotation = Vector3d.ZERO;
if(isRotateHorizontally()) {
Optional<Player> player = cause.first(Player.class);
if(player.isPresent()) {
Vector3d headRotation = player.get().getHeadRotation();
double angle = Math.floorMod(180 + (int) Math.floor(headRotation.getY()), 360);
angle += 45;
angle = Math.floorMod((int) Math.floor(angle), 360);
angle = (int) (angle / 90);
angle = angle * 90;
rotation = Vector3d.from(0, angle, 0);
}
}
armorStand.offer(createDefaultCustomFeatureData());
armorStand.offer(new CustomBlockData());
armorStand.setRotation(rotation);
world.spawnEntity(armorStand, cause);
T result = customizeBlock(block, armorStand, cause);
result.setModel(getDefaultModel());
CustomItemLibrary.getInstance().getService().registerBlockAsLoaded(result);
return result;
}