當前位置: 首頁>>代碼示例>>Java>>正文


Java Vector3d.ZERO屬性代碼示例

本文整理匯總了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;
}
 
開發者ID:simon816,項目名稱:Industrialization,代碼行數:16,代碼來源:TurtleEntity.java

示例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());
}
 
開發者ID:Limeth,項目名稱:CustomItemLibrary,代碼行數:14,代碼來源:GUIModel.java

示例3: getPosition

public Vector3d getPosition() {
	return Vector3d.ZERO;
}
 
開發者ID:EverCraft,項目名稱:EverAPI,代碼行數:3,代碼來源:EVirtualEmpty.java

示例4: getRotation

@Override
public Vector3d getRotation() {
	return Vector3d.ZERO;
}
 
開發者ID:EverCraft,項目名稱:EverAPI,代碼行數:4,代碼來源:EVirtualEmpty.java

示例5: getRotation

public Vector3d getRotation() {
	return Vector3d.ZERO;
}
 
開發者ID:EverCraft,項目名稱:EverAPI,代碼行數:3,代碼來源:EVirtualPosition.java

示例6: getRotation

public Vector3d getRotation() {
    return rotation != null ? rotation : Vector3d.ZERO;
}
 
開發者ID:Valandur,項目名稱:Web-API,代碼行數:3,代碼來源:CreateJailRequest.java

示例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;
}
 
開發者ID:Limeth,項目名稱:CustomItemLibrary,代碼行數:47,代碼來源:CustomBlockDefinition.java


注:本文中的com.flowpowered.math.vector.Vector3d.ZERO屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。