Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 79 additions & 64 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,37 @@ jobs:
./gradlew build pluginJars
echo "RELEASE_VERSION=$(./gradlew -q printVersion)" >> $GITHUB_ENV

- name: Rename Artifacts
if: "contains(github.event.head_commit.message, '--release') && contains(github.ref, 'master')"
run: |
mv ./build/libs/petblocks-${{ env.RELEASE_VERSION }}-26.1.0-latest-premium-folia.jar ./PetBlocks-26.1.0-latest-Premium-Folia.jar
mv ./build/libs/petblocks-${{ env.RELEASE_VERSION }}-1.17.0-1.21.11-premium-folia.jar ./PetBlocks-1.17.0-1.21.11-Premium-Folia.jar
mv ./build/libs/petblocks-${{ env.RELEASE_VERSION }}-1.8.8-1.16.5-premium.jar ./PetBlocks-1.8.8-1.16.5-Premium.jar
mv ./build/libs/petblocks-${{ env.RELEASE_VERSION }}-1.17.0-1.21.11-premium.jar ./PetBlocks-1.17.0-1.21.11-Premium.jar
mv ./build/libs/petblocks-${{ env.RELEASE_VERSION }}-26.1.0-latest-premium.jar ./PetBlocks-26.1.0-latest-Premium.jar

- name: Parse Changelog
if: "contains(github.event.head_commit.message, '--release') && contains(github.ref, 'master')"
run: |
VERSION=${{ env.RELEASE_VERSION }}
CHANGES=$(awk '/^---/{exit} /^## Release /{found=1; next} found{print}' CHANGELOG.md)
FOOTER=$(cat docs/footer-github.md)
FOOTER="${FOOTER//<version>/$VERSION}"
PATREON_FOOTER_BASIC=$(cat docs/footer-patreon-basic.md)
PATREON_FOOTER_ELITE=$(cat docs/footer-patreon-elite.md)
BODY="$CHANGES"$'\n'"$FOOTER"
PATREON_BODY_BASIC="$CHANGES"$'\n'"$PATREON_FOOTER_BASIC"
PATREON_BODY_ELITE="$CHANGES"$'\n'"$PATREON_FOOTER_ELITE"
echo "RELEASE_BODY<<EOF" >> $GITHUB_ENV
echo "$BODY" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
echo "RELEASE_PATREON_BASIC<<EOF" >> $GITHUB_ENV
echo "$PATREON_BODY_BASIC" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
echo "RELEASE_PATREON_ELITE<<EOF" >> $GITHUB_ENV
echo "$PATREON_BODY_ELITE" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV

- name: Create Geyser Customizations
if: "contains(github.event.head_commit.message, '--release') && contains(github.ref, 'master')"
env:
Expand All @@ -49,67 +80,12 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
body: "This release was automatically created by Github Actions. Please wait until the author manually sets the patchnotes for this release."
body: ${{ env.RELEASE_BODY }}
tag_name: ${{ env.RELEASE_VERSION }}
release_name: Release ${{ env.RELEASE_VERSION }}
draft: true
prerelease: false

- name: Upload PetBlocks-1.8.8-1.16.5-Premium.jar
if: "contains(github.event.head_commit.message, '--release') && contains(github.ref, 'master')"
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /home/runner/work/PetBlocks/PetBlocks/build/libs/petblocks-${{ env.RELEASE_VERSION }}-1.8.8-1.16.5-premium.jar
asset_name: PetBlocks-1.8.8-1.16.5-Premium.jar
asset_content_type: application/jar

- name: Upload PetBlocks-1.17.0-1.21.11-Premium.jar
if: "contains(github.event.head_commit.message, '--release') && contains(github.ref, 'master')"
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /home/runner/work/PetBlocks/PetBlocks/build/libs/petblocks-${{ env.RELEASE_VERSION }}-1.17.0-1.21.11-premium.jar
asset_name: PetBlocks-1.17.0-1.21.11-Premium.jar
asset_content_type: application/jar

- name: Upload PetBlocks-1.17.0-1.21.11-Premium-Folia.jar
if: "contains(github.event.head_commit.message, '--release') && contains(github.ref, 'master')"
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /home/runner/work/PetBlocks/PetBlocks/build/libs/petblocks-${{ env.RELEASE_VERSION }}-1.17.0-1.21.11-premium-folia.jar
asset_name: PetBlocks-1.17.0-1.21.11-Premium-Folia.jar
asset_content_type: application/jar

- name: Upload PetBlocks-26.1.0-latest-Premium.jar
if: "contains(github.event.head_commit.message, '--release') && contains(github.ref, 'master')"
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /home/runner/work/PetBlocks/PetBlocks/build/libs/petblocks-${{ env.RELEASE_VERSION }}-26.1.0-latest-premium.jar
asset_name: PetBlocks-26.1.0-latest-Premium.jar
asset_content_type: application/jar

- name: Upload PetBlocks-26.1.0-latest-Premium-Folia.jar
if: "contains(github.event.head_commit.message, '--release') && contains(github.ref, 'master')"
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /home/runner/work/PetBlocks/PetBlocks/build/libs/petblocks-${{ env.RELEASE_VERSION }}-26.1.0-latest-premium-folia.jar
asset_name: PetBlocks-26.1.0-latest-Premium-Folia.jar
asset_content_type: application/jar

- name: Upload PetBlocks-26.1.0-latest-Free.jar
if: "contains(github.event.head_commit.message, '--release') && contains(github.ref, 'master')"
uses: actions/upload-release-asset@v1
Expand All @@ -121,16 +97,55 @@ jobs:
asset_name: PetBlocks.jar
asset_content_type: application/jar

- name: Geyser Customizations to Github
- name: Publish Patreon Release
if: "contains(github.event.head_commit.message, '--release') && contains(github.ref, 'master')"
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /home/runner/work/PetBlocks/PetBlocks/PetBlocks-GeyserMC.zip
asset_name: PetBlocks-GeyserMC.zip
asset_content_type: application/zip
PAPOA_API_KEY: ${{ secrets.PAPOA_API_KEY }}
PAPOA_PASSWORD: ${{ secrets.PAPOA_PASSWORD }}
run: |
wget -O papoa https://github.com/Shynixn/PatreonPostApi/releases/latest/download/papoa-linux-x64
chmod +x papoa
./papoa post create \
--title "PetBlocks for Folia v${{ env.RELEASE_VERSION }} (1.8.9-26.1.2)" \
--content "$RELEASE_PATREON_ELITE" \
--content-format text/markdown \
--tier-name "Elite" \
--tier-name "Legendary" \
--collection-name "PetBlocks" \
--tag petblocks \
--tag minecraft \
--tag plugin \
--ttl-days 1 \
--file ./PetBlocks-26.1.0-latest-Premium-Folia.jar \
--file ./PetBlocks-1.17.0-1.21.11-Premium-Folia.jar \
--file /home/runner/work/PetBlocks/PetBlocks/docs/wiki/docs/assets/title.png \
--photo-attachment-file-name "title.png" \
--attachment-file-name "PetBlocks-26.1.0-latest-Premium-Folia.jar" \
--attachment-file-name "PetBlocks-1.17.0-1.21.11-Premium-Folia.jar" \
--password "$PAPOA_PASSWORD"
./papoa post create \
--title "PetBlocks v${{ env.RELEASE_VERSION }} (1.8.9-26.1.2)" \
--content "$RELEASE_PATREON_BASIC" \
--content-format text/markdown \
--tier-name "Basic" \
--tier-name "Elite" \
--tier-name "Legendary" \
--collection-name "PetBlocks" \
--tag petblocks \
--tag minecraft \
--tag plugin \
--ttl-days 1 \
--file ./PetBlocks-1.8.8-1.16.5-Premium.jar \
--file ./PetBlocks-1.17.0-1.21.11-Premium.jar \
--file ./PetBlocks-26.1.0-latest-Premium.jar \
--file /home/runner/work/PetBlocks/PetBlocks/PetBlocks-GeyserMC.zip \
--file /home/runner/work/PetBlocks/PetBlocks/docs/wiki/docs/assets/title.png \
--photo-attachment-file-name "title.png" \
--attachment-file-name "PetBlocks-1.8.8-1.16.5-Premium.jar" \
--attachment-file-name "PetBlocks-1.17.0-1.21.11-Premium.jar" \
--attachment-file-name "PetBlocks-26.1.0-latest-Premium.jar" \
--attachment-file-name "PetBlocks-GeyserMC.zip" \
--password "$PAPOA_PASSWORD"

Documentation:
runs-on: ubuntu-latest
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Changelog

## Release 9.31.0

### Changes

* #698 Added support for Minecraft 26.2

---

## Release 1.0.0

### Changes

* Initial release of PetBlocks

---
11 changes: 6 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
}

group = "com.github.shynixn"
version = "9.30.1"
version = "9.31.0"

repositories {
mavenCentral()
Expand All @@ -31,9 +31,9 @@ dependencies {
implementation("org.openjdk.nashorn:nashorn-core:15.4")

// Custom dependencies
implementation("com.github.shynixn.shygui:shygui:1.12.1")
implementation("com.github.shynixn.mcutils:common:2026.7")
implementation("com.github.shynixn.mcutils:packet:2026.12")
implementation("com.github.shynixn.shygui:shygui:1.13.0")
implementation("com.github.shynixn.mcutils:common:2026.13")
implementation("com.github.shynixn.mcutils:packet:2026.24")
implementation("com.github.shynixn.mcutils:pathfinder:2026.3")
implementation("com.github.shynixn.mcutils:database:2026.3")

Expand Down Expand Up @@ -163,7 +163,8 @@ fun registerPluginJar(
"com/github/shynixn/petblocks/lib/com/github/shynixn/mcutils/packet/nms/v1_21_R4/**",
"com/github/shynixn/petblocks/lib/com/github/shynixn/mcutils/packet/nms/v1_21_R5/**",
"com/github/shynixn/petblocks/lib/com/github/shynixn/mcutils/packet/nms/v1_21_R6/**",
"com/github/shynixn/petblocks/lib/com/github/shynixn/mcutils/packet/nms/v1_21_R7/**"
"com/github/shynixn/petblocks/lib/com/github/shynixn/mcutils/packet/nms/v1_21_R7/**",
"com/github/shynixn/petblocks/lib/com/github/shynixn/mcutils/packet/nms/v26_1_R1/**"
)
for (path in oldNmsPaths) exclude(path)
}
Expand Down
13 changes: 13 additions & 0 deletions docs/footer-github.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

### PetBlocks (Premium)

* For Minecraft 1.8.9 - 26.2
* Multiple pets per player
* Bedrock GeyserMC resource pack
* Supports [Folia](https://papermc.io/software/folia)
* Download: https://www.patreon.com/Shynixn

### PetBlocks (Free)

* For Minecraft 26.2 (the free version only supports the latest Minecraft version)
* Download: [PetBlocks.jar](https://github.com/Shynixn/PetBlocks/releases/download/<version>/PetBlocks.jar)
12 changes: 12 additions & 0 deletions docs/footer-patreon-basic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

### Downloads

* PetBlocks-26.1.0-latest-Premium.jar (Minecraft 26.1 - latest)
* PetBlocks-1.17.0-1.21.11-Premium.jar (Minecraft 1.17.0 - 1.21.11)
* PetBlocks-1.8.8-1.16.5-Premium.jar (Minecraft 1.8.8 - 1.16.5)

### Need help or support?

* https://shynixn.github.io/PetBlocks
* I normally reply in 2 business days on [Discord](https://discord.gg/Y27tx8Y).
* Link your Discord name to Patreon to get prioritized support.
11 changes: 11 additions & 0 deletions docs/footer-patreon-elite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

### Downloads

* PetBlocks-26.1.0-latest-Premium-Folia.jar (Minecraft 26.1 - latest)
* PetBlocks-1.17.0-1.21.11-Premium-Folia.jar (Minecraft 1.17.0 - 1.21.11)

### Need help or support?

* https://shynixn.github.io/PetBlocks
* I normally reply in 2 business days on [Discord](https://discord.gg/Y27tx8Y).
* Link your Discord name to Patreon to get prioritized support.
5 changes: 3 additions & 2 deletions src/main/java/com/github/shynixn/petblocks/PetBlocksPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,11 @@ class PetBlocksPlugin : JavaPlugin(), CoroutineHandler {
Version.VERSION_1_21_R5,
Version.VERSION_1_21_R6,
Version.VERSION_1_21_R7,
Version.VERSION_26_R1
Version.VERSION_26_1_R1,
Version.VERSION_26_2_R1,
)
} else {
listOf(Version.VERSION_26_R1)
listOf(Version.VERSION_26_2_R1)
}

if (!Version.serverVersion.isCompatible(*versions.toTypedArray())) {
Expand Down
13 changes: 8 additions & 5 deletions src/main/java/com/github/shynixn/petblocks/impl/PetEntityImpl.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import org.bukkit.Material
import org.bukkit.block.Block
import org.bukkit.entity.Player
import org.bukkit.plugin.Plugin
import org.bukkit.util.Vector
import java.util.*
import java.util.logging.Level

Expand Down Expand Up @@ -449,12 +450,13 @@ class PetEntityImpl(

private fun isOnGround(location: Location): Boolean {
val rayTraceResult = rayTracingService.rayTraceMotion(
location.toVector3d(),
Vector3d(0.0, -1.0, 0.0),
location.clone(),
Vector(0.0, -1.0, 0.0),
1.0,
petMeta.physics.collideWithWater,
petMeta.physics.collideWithPassableBlocks
)
return rayTraceResult.hitBlock
return rayTraceResult.hasHitBlock
}

/**
Expand Down Expand Up @@ -533,8 +535,9 @@ class PetEntityImpl(
fun findTargetBlock(maxDistance: Double): Block? {
val worldLocation = getLocation().toLocation()
val rayTraceResult = rayTracingService.rayTraceMotion(
worldLocation.toVector3d(),
worldLocation.direction.normalize().multiply(maxDistance).toVector3d(),
worldLocation.clone(),
worldLocation.direction.normalize().multiply(maxDistance),
maxDistance,
petMeta.physics.collideWithWater,
petMeta.physics.collideWithPassableBlocks
)
Expand Down
Loading
Loading