Skip to content

Commit 3a4467c

Browse files
committed
Use updated github actions, add built-in method to check entity types
1 parent bb7975d commit 3a4467c

File tree

3 files changed

+23
-69
lines changed

3 files changed

+23
-69
lines changed

.github/workflows/build.yml

Lines changed: 19 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,24 @@
1-
name: Java CI with Gradle
1+
name: Build
22

3-
on:
4-
push:
5-
branches-ignore:
6-
- 'master'
7-
- 'feature/**'
8-
pull_request:
3+
on: [workflow_dispatch, pull-request, push]
94

105
jobs:
11-
build:
12-
# Only run on PRs if the source branch is on someone else's repo
13-
if: "${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}"
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Setup Gradle
10+
uses: GeyserMC/actions/setup-gradle-composite@master
11+
with:
12+
setup-java_java-version: 21
1413

15-
runs-on: ubuntu-latest
14+
- name: Build MCPL
15+
run: ./gradlew build
1616

17-
steps:
18-
- name: Checkout repository
19-
# See https://github.com/actions/checkout/commits
20-
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
21-
22-
- name: Validate Gradle wrapper
23-
# See https://github.com/gradle/wrapper-validation-action/commits
24-
uses: gradle/wrapper-validation-action@342dbebe7272035434f9baccc29a816ec6dd2c7b
25-
26-
- name: Set up JDK 17
27-
# See https://github.com/actions/setup-java/commits
28-
uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0
29-
with:
30-
java-version: 17
31-
distribution: temurin
32-
33-
- name: Build
34-
# See https://github.com/gradle/gradle-build-action/commits
35-
uses: gradle/gradle-build-action@3bfe3a46584a206fb8361cdedd0647b0c4204232
36-
with:
37-
arguments: build
17+
- name: Publish to Maven Repository
18+
if: ${{ success() && github.repository == 'GeyserMC/MCProtocolLib' && (github.ref_name == 'master' || startsWith(github.ref_name, 'feature/')) }}
19+
uses: gradle/gradle-build-action@3bfe3a46584a206fb8361cdedd0647b0c4204232
20+
env:
21+
ORG_GRADLE_PROJECT_geysermcUsername: ${{ vars.DEPLOY_USER }}
22+
ORG_GRADLE_PROJECT_geysermcPassword: ${{ secrets.DEPLOY_PASS }}
23+
with:
24+
arguments: publish

.github/workflows/deploy.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

protocol/src/main/java/org/geysermc/mcprotocollib/protocol/data/game/entity/type/EntityType.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ static EntityType from(int id) {
1313
return BuiltinEntityType.VALUES[id];
1414
}
1515

16+
default boolean is(EntityType type) {
17+
return id() == type.id();
18+
}
19+
1620
record Custom(int id) implements EntityType {
1721
@Override
1822
public boolean isProjectile() {

0 commit comments

Comments
 (0)