Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
CreatureChat
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
Public
CreatureChat
Commits
e4bf8193
Commit
e4bf8193
authored
Jul 12, 2024
by
Jonathan Thomas
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into flee-crash
# Conflicts: # CHANGELOG.md
parents
fdc6ccd2
eb9872b2
Pipeline
#12665
passed with stages
in 2 minutes 13 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
7 deletions
+52
-7
CHANGELOG.md
CHANGELOG.md
+1
-0
deploy-curseforge.sh
deploy-curseforge.sh
+50
-6
deploy-modrinth.sh
deploy-modrinth.sh
+1
-1
No files found.
CHANGELOG.md
View file @
e4bf8193
...
...
@@ -15,6 +15,7 @@ All notable changes to **CreatureChat** are documented in this file. The format
-
Fixed a
**crash with FLEE**
when non-path aware entities (i.e. Ghast) attempted to flee.
-
Fixed certain behaviors from colliding with others (i.e. mutual exclusive ones)
-
Updated README.md with new video thumbnail, and simplified text, added spoiler to install instructions
-
Fixed CurseForge deploy script to be much faster, and correctly lookup valid Type and Version IDs
## [1.0.7] - 2024-07-03
...
...
deploy-curseforge.sh
View file @
e4bf8193
...
...
@@ -8,19 +8,58 @@ API_URL="https://minecraft.curseforge.com/api"
PROJECT_ID
=
1012118
DEPENDENCY_SLUG
=
"fabric-api"
USER_AGENT
=
"CreatureChat-Minecraft-Mod:curseforge@owlmaddie.com"
SLEEP_DURATION
=
30
SLEEP_DURATION
=
5
# Function to fetch game version IDs
# Function to fetch version types and return the base game type ID
fetch_base_version_id
()
{
local
base_version
=
"
$1
"
local
version_types_cache
=
"/tmp/version_types.json"
if
[
!
-f
"
$version_types_cache
"
]
;
then
curl
--retry
3
--retry-delay
5
-s
-H
"X-Api-Token:
$CURSEFORGE_API_KEY
"
"
$API_URL
/game/version-types"
>
"
$version_types_cache
"
fi
local
version_types_response
=
$(
cat
"
$version_types_cache
"
)
local
base_version_id
=
$(
echo
"
$version_types_response
"
| jq
-r
--arg
base_version
"Minecraft
$base_version
"
'.[] | select(.name == $base_version) | .id'
)
if
[
-z
"
$base_version_id
"
]
;
then
echo
"ERROR: Base version ID not found."
exit
1
fi
echo
"
$base_version_id
"
}
# Main function to fetch game version IDs
fetch_game_version_ids
()
{
local
minecraft_version
=
"
$1
"
local
response
=
$(
curl
--retry
3
--retry-delay
5
-s
-H
"X-Api-Token:
$CURSEFORGE_API_KEY
"
"
$API_URL
/game/versions"
)
local
base_version
=
$(
echo
"
$minecraft_version
"
|
grep
-oE
'^[0-9]+\.[0-9]+'
)
# Fetch the base version ID
local
base_version_id
=
$(
fetch_base_version_id
"
$base_version
"
)
# Cache the game versions JSON data
local
game_versions_cache
=
"/tmp/game_versions.json"
if
[
!
-f
"
$game_versions_cache
"
]
;
then
curl
--retry
3
--retry-delay
5
-s
-H
"X-Api-Token:
$CURSEFORGE_API_KEY
"
"
$API_URL
/game/versions"
>
"
$game_versions_cache
"
fi
local
response
=
$(
cat
"
$game_versions_cache
"
)
# Find the specific version ID from the cached data
local
minecraft_id
=
$(
echo
"
$response
"
| jq
-r
--arg
base_version_id
"
$base_version_id
"
--arg
full_version
"
$minecraft_version
"
'.[] | select(.gameVersionTypeID == ($base_version_id | tonumber) and .name == $full_version) | .id'
| head
-n
1
)
if
[
-z
"
$minecraft_id
"
]
;
then
echo
"ERROR: Minecraft version ID not found."
exit
1
fi
# Retrieve the other IDs as before
local
client_id
=
$(
echo
"
$response
"
| jq
-r
'.[] | select(.name == "Client") | .id'
)
local
server_id
=
$(
echo
"
$response
"
| jq
-r
'.[] | select(.name == "Server") | .id'
)
local
fabric_id
=
$(
echo
"
$response
"
| jq
-r
'.[] | select(.name == "Fabric") | .id'
)
local
minecraft_id
=
$(
echo
"
$response
"
| jq
-r
--arg
mv
"
$minecraft_version
"
'.[] | select(.name == $mv) | .id'
| head
-n
1
)
if
[
-z
"
$client_id
"
]
||
[
-z
"
$server_id
"
]
||
[
-z
"
$fabric_id
"
]
||
[
-z
"
$minecraft_id
"
]
;
then
if
[
-z
"
$client_id
"
]
||
[
-z
"
$server_id
"
]
||
[
-z
"
$fabric_id
"
]
;
then
echo
"ERROR: One or more game version IDs not found."
exit
1
fi
...
...
@@ -64,14 +103,19 @@ for FILE in creaturechat*.jar; do
echo
"Preparing to upload
$FILE_BASENAME
as version
$VERSION_NUMBER
..."
# Fetch game version IDs
GAME_TYPE_ID
=
$(
fetch_base_version_id
"
$MINECRAFT_VERSION
"
)
GAME_VERSION_IDS
=(
$(
fetch_game_version_ids
"
$MINECRAFT_VERSION
"
)
)
# DEBUG
echo
"Minecraft Type ID:
$GAME_TYPE_ID
"
echo
"Minecraft Versions IDs (client_id:
${
GAME_VERSION_IDS
[0]
}
, server_id:
${
GAME_VERSION_IDS
[1]
}
, fabric_id:
${
GAME_VERSION_IDS
[2]
}
, minecraft_id:
${
GAME_VERSION_IDS
[3]
}
)"
# Create a new version payload
PAYLOAD
=
$(
jq
-n
--arg
changelog
"
$CHANGELOG
"
\
--arg
changelogType
"markdown"
\
--arg
displayName
"
$FILE_BASENAME
"
\
--argjson
gameVersions
"
$(
printf
'%s\n'
"
${
GAME_VERSION_IDS
[@]
}
"
| jq
-R
.
| jq
-s
.
)
"
\
--argjson
gameVersionTypeIds
'[75125]'
\
--argjson
gameVersionTypeIds
"[
$GAME_TYPE_ID
]"
\
--arg
releaseType
"release"
\
--argjson
relations
'[{"slug": "'
"
$DEPENDENCY_SLUG
"
'", "type": "requiredDependency"}]'
\
'{
...
...
deploy-modrinth.sh
View file @
e4bf8193
...
...
@@ -8,7 +8,7 @@ API_URL="https://api.modrinth.com/v2"
USER_AGENT
=
"CreatureChat-Minecraft-Mod:modrinth@owlmaddie.com"
PROJECT_ID
=
"rvR0de1E"
AUTHOR_ID
=
"k6RiShdd"
SLEEP_DURATION
=
10
SLEEP_DURATION
=
5
# Read the first changelog block
CHANGELOG
=
$(
awk
'/^## \[/{ if (p) exit; p=1 } p'
"
$CHANGELOG_FILE
"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment