Skip to content

Commit

Permalink
Merge branch 'CCBlueX:main' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Razzy52 authored Apr 14, 2024
2 parents 2ef8916 + af08f7b commit 9546ec8
Show file tree
Hide file tree
Showing 56 changed files with 207,430 additions and 1,735 deletions.
45 changes: 26 additions & 19 deletions .github/workflows/sync_settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ name: Sync settings
on:
push:
branches:
- 'master'
paths:
- LiquidBounce/settings/**
- '*'

jobs:
upload_settings:
Expand All @@ -17,39 +15,48 @@ jobs:
with:
fetch-depth: 0 # Fetch all history for all tags and branches

- name: Upload Files
id: upload_files
env:
AUTHORIZATION: ${{ secrets.AUTHORIZATION }}
- name: Create TAR and Meta Files
id: create_tar
run: |
for branch_folder in LiquidBounce/settings/*; do
if [ -d "$branch_folder" ]; then
echo "Processing files in directory: $branch_folder"
branch_name=$(basename "$branch_folder")
# Create a TAR file with the settings content
tar -cvf "$branch_name.tar" -C "$branch_folder" .
for file in "$branch_folder"/*; do
if [ -f "$file" ]; then
setting_id=$(basename "$file" | cut -f 1 -d '.')
contributors=$(git log --follow --format="%aN" -- "$file" | sort | uniq | paste -sd "," -)
echo "Uploading file: $file"
echo "Contributors: $contributors"
curl -X POST -H "Authorization: $AUTHORIZATION" -F "settings_file=@$file" -F "name=$setting_id" -F "contributors=$contributors" "https://api.liquidbounce.net/api/v1/client/$(basename $branch_folder)/settings/upload/global"
meta_file="$setting_id.meta"
modify_date=$(git log -1 --format=%ai -- "$file" | cut -d ' ' -f 1,2 | tr ' ' 'T')Z
echo "{\"setting_id\":\"$setting_id\",\"contributors\":\"$contributors\",\"timestamp\":\"$modify_date\"}" > "$meta_file"
# Append the .meta file to the TAR archive if it exists
if [ -f "$meta_file" ]; then
tar -rvf "$branch_name.tar" "$meta_file"
# Clean up the .meta file after adding it to the archive
rm "$meta_file"
fi
fi
done
fi
done
- name: Delete Files
id: delete_files
- name: Upload TAR and Meta Files
id: upload_files
env:
AUTHORIZATION: ${{ secrets.AUTHORIZATION }}
run: |
for branch_folder in LiquidBounce/settings/*; do
if [ -d "$branch_folder" ]; then
echo "Processing files in directory: $branch_folder"
deleted_files=$(git diff --diff-filter=D --name-only $last_commit HEAD -- "$branch_folder")
for deleted_file in $deleted_files; do
setting_id=$(basename "$deleted_file" | cut -f 1 -d '.')
echo "Deleting file: $setting_id"
curl -X DELETE -H "Authorization: $AUTHORIZATION" "https://api.liquidbounce.net/api/v1/client/settings/$setting_id"
done
branch_name=$(basename "$branch_folder")
echo "Uploading tar file: $branch_name.tar"
curl -X POST -H "Authorization: $AUTHORIZATION" -F "settings_bundle=@$branch_name.tar" "https://api.liquidbounce.net/api/v1/client/$branch_name/settings/upload/bundle"
fi
done
- name: Upload TAR Files to Artifacts
uses: actions/upload-artifact@v2
with:
name: tar-artifacts
path: ./*.tar
70 changes: 70 additions & 0 deletions LiquidBounce/autoshop-configs/dexland.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"comment": "dexland",
"traderTitle": "магазин",
"initialCategorySlot": 0,
"items": [
{
"itemID": "iron_sword", "minAmount": 1,
"categorySlot": 0, "itemSlot": 29,
"price": [
[{"itemID": "gold_ingot", "minAmount": 7}]
],
"checkItems": [
{"itemID": "diamond_sword", "minAmount": 1}
]
},
{
"itemID": "stone_sword", "minAmount": 1,
"categorySlot": 0, "itemSlot": 20,
"price": [
[{"itemID": "iron_ingot", "minAmount": 10}]
],
"checkItems": [
{"itemID": "iron_sword", "minAmount": 1},
{"itemID": "diamond_sword", "minAmount": 1}
]
},
{
"itemID": "wool", "minAmount": 48,
"categorySlot": 0, "itemSlot": 19,
"price": [
[{"itemID": "iron_ingot", "minAmount": 4}]
]
},
{
"itemID": "golden_apple", "minAmount": 1,
"categorySlot": 7, "itemSlot": 21,
"price": [
[{"itemID": "gold_ingot", "minAmount": 3}]
]
},
{
"itemID": "iron_boots", "minAmount": 1,
"categorySlot": 0, "itemSlot": 30,
"price": [
[{"itemID": "gold_ingot", "minAmount": 12}]
],
"checkItems": [
{"itemID": "diamond_boots", "minAmount": 1}
]
},
{
"itemID": "chainmail_boots", "minAmount": 1,
"categorySlot": 0, "itemSlot": 21,
"price": [
[{"itemID": "iron_ingot", "minAmount": 40}]
],
"checkItems": [
{"itemID": "iron_boots", "minAmount": 1},
{"itemID": "diamond_boots", "minAmount": 1}
]
},
{
"itemID": "shears", "minAmount": 1,
"categorySlot": 0, "itemSlot": 31,
"price": [
[{"itemID": "iron_ingot", "minAmount": 16}]
]
}
]
}
45 changes: 45 additions & 0 deletions LiquidBounce/autoshop-configs/pikanetwork.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"comment": "An example config for pіkа nеtwоrk",
"traderTitle": "Shop",
"initialCategorySlot": 0,
"items": [
{
"itemID": "iron_sword", "minAmount": 1,
"categorySlot": 3, "itemSlot": 20,
"price": [
[{"itemID": "gold_ingot", "minAmount": 8}]
]
},
{
"itemID": "stone_sword", "minAmount": 1,
"categorySlot": 3, "itemSlot": 19,
"price": [
[{"itemID": "iron_ingot", "minAmount": 12}]
],
"checkItems": [
{"itemID": "iron_sword", "minAmount": 1}
]
},
{
"itemID": "wool", "minAmount": 64,
"categorySlot": 2, "itemSlot": 19,
"price": [
[{"itemID": "iron_ingot", "minAmount": 4}]
]
},
{
"itemID": "golden_apple", "minAmount": 1,
"categorySlot": 6, "itemSlot": 19,
"price": [
[{"itemID": "gold_ingot", "minAmount": 3}]
]
},
{
"itemID": "chainmail_boots", "minAmount": 1,
"categorySlot": 1, "itemSlot": 19,
"price": [
[{"itemID": "iron_ingot", "minAmount": 24}]
]
}
]
}
74 changes: 74 additions & 0 deletions LiquidBounce/autoshop-configs/pikanetwork2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"comment": "Another example config for pіkа nеtwоrk",
"traderTitle": "shop",
"initialCategorySlot": 0,
"items": [
{
"comment": "pika iron sword",
"itemID": "iron_sword", "minAmount": 1,
"categorySlot": 0, "itemSlot": 28,
"price": [
[{"itemID": "gold_ingot", "minAmount": 8}]
]
},
{
"comment": "pika stone sword",
"itemID": "stone_sword", "minAmount": 1,
"categorySlot": 0, "itemSlot": 25,
"price": [
[{"itemID": "iron_ingot", "minAmount": 12}]
],
"checkItems": [
{"itemID": "iron_sword", "minAmount": 1}
]
},
{
"comment": "pika wool blocks (x64)",
"itemID": "wool", "minAmount": 64,
"categorySlot": 0, "itemSlot": 20,
"price": [
[{"itemID": "iron_ingot", "minAmount": 4}]
]
},
{
"comment": "pika golden apple (x1)",
"itemID": "golden_apple", "minAmount": 1,
"categorySlot": 0, "itemSlot": 37,
"price": [
[{"itemID": "gold_ingot", "minAmount": 3}]
]
},
{
"comment": "pika iron armor",
"itemID": "iron_boots", "minAmount": 1,
"categorySlot": 0, "itemSlot": 19,
"price": [
[{"itemID": "gold_ingot", "minAmount": 12}]
]
},
{
"comment": "pika chainmail armor",
"itemID": "chainmail_boots", "minAmount": 1,
"categorySlot": 1, "itemSlot": 19,
"price": [
[{"itemID": "iron_ingot", "minAmount": 24}]
]
},
{
"comment": "pika wooden pickaxe",
"itemID": "wooden_pickaxe", "minAmount": 1,
"categorySlot": 1, "itemSlot": 33,
"price": [
[{"itemID": "iron_ingot", "minAmount": 24}]
]
},
{
"comment": "pika wooden axe",
"itemID": "wooden_axe", "minAmount": 1,
"categorySlot": 1, "itemSlot": 34,
"price": [
[{"itemID": "iron_ingot", "minAmount": 24}]
]
}
]
}
Loading

0 comments on commit 9546ec8

Please sign in to comment.