Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev/1.21-networking' into dev/1.…
Browse files Browse the repository at this point in the history
…21-networking

# Conflicts:
#	networking/neo/src/main/java/band/kessoku/lib/impl/networking/neoforge/CommonPacketsImplNeoForge.java
  • Loading branch information
TexBlock committed Nov 17, 2024
2 parents 0c4e75c + 3b39aa0 commit 9cb24a0
Show file tree
Hide file tree
Showing 105 changed files with 1,707 additions and 280 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,21 @@ jobs:
matrix:
java:
- 21
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: checkout repository
uses: actions/checkout@v4
- name: validate gradle wrapper
uses: gradle/actions/wrapper-validation@v3
- name: setup jdk ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: "microsoft"
- name: setup gradle
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4
- name: make gradle wrapper executable
run: chmod +x ./gradlew
- name: build
run: ./gradlew build
run: ./gradlew build --warning-mode=all
- name: capture build artifacts
if: ${{ matrix.java == '21' }}
uses: actions/upload-artifact@v4
Expand Down
16 changes: 0 additions & 16 deletions .github/workflows/greetings.yml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/spotless.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Run spotless
on: [push, workflow_dispatch]

permissions:
contents: write

jobs:
build:
strategy:
matrix:
java:
- 21
runs-on: ubuntu-24.04
steps:
- name: checkout repository
uses: actions/checkout@v4
- name: setup jdk ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: "microsoft"
- name: setup gradle
uses: gradle/actions/setup-gradle@v4
- name: make gradle wrapper executable
run: chmod +x ./gradlew
- name: apply spotless
run: ./gradlew spotlessApply
- name: commit changes and push
uses: EndBug/add-and-commit@v9
with:
message: "chore: Apply Spotless"
default_author: github_actions
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright (c) 2024 KessokuTeaTime
*
* Licensed under the GNU Lesser General Pubic License, Version 3 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.gnu.org/licenses/lgpl-3.0.html
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package band.kessoku.lib.api.base.reflect;

import java.lang.reflect.Member;
Expand All @@ -9,46 +24,46 @@ private ModifiersUtil() {

/* === Common === */

public static boolean isPublic(Member field) {
return Modifier.isPublic(field.getModifiers());
public static boolean isPublic(Member member) {
return Modifier.isPublic(member.getModifiers());
}

public static boolean isStatic(Member field) {
return Modifier.isStatic(field.getModifiers());
public static boolean isStatic(Member member) {
return Modifier.isStatic(member.getModifiers());
}

/* === Common Combo === */

public static boolean isPublicAndStatic(Member field) {
return isPublic(field) && isStatic(field);
public static boolean isPublicAndStatic(Member member) {
return isPublic(member) && isStatic(member);
}

public static boolean isPublicOrStatic(Member field, boolean shouldPublic, boolean shouldStatic) {
return shouldPublic == isPublic(field) && shouldStatic == isStatic(field);
public static boolean isPublicOrStatic(Member member, boolean shouldPublic, boolean shouldStatic) {
return shouldPublic == isPublic(member) && shouldStatic == isStatic(member);
}

/* === Common End === */

/* === Data Object === */

public static boolean isVolatile(Member field) {
return Modifier.isVolatile(field.getModifiers());
public static boolean isVolatile(Member member) {
return Modifier.isVolatile(member.getModifiers());
}

public static boolean isTransient(Member field) {
return Modifier.isTransient(field.getModifiers());
public static boolean isTransient(Member member) {
return Modifier.isTransient(member.getModifiers());
}

/* === Data Object End === */

/* === Low Usage Tools === */

public static boolean isFinal(Member field) {
return Modifier.isFinal(field.getModifiers());
public static boolean isFinal(Member member) {
return Modifier.isFinal(member.getModifiers());
}

public static boolean isProtected(Member field) {
return Modifier.isProtected(field.getModifiers());
public static boolean isProtected(Member member) {
return Modifier.isProtected(member.getModifiers());
}

/* === Low Usage Tools End === */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright (c) 2024 KessokuTeaTime
*
* Licensed under the GNU Lesser General Pubic License, Version 3 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.gnu.org/licenses/lgpl-3.0.html
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package band.kessoku.lib.api.base.reflect;

import java.lang.reflect.Field;
Expand Down
12 changes: 12 additions & 0 deletions blockentity/common/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apply from: rootProject.file("gradle/scripts/klib-common.gradle")

base.archivesName = rootProject.name + "-blockentity"

kessoku {
module("base", "common")
module("platform", "common")
}

dependencies {
implementation libs.aj4j
}
Binary file added blockentity/common/src/main/resources/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions blockentity/fabric/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import net.fabricmc.loom.util.ModPlatform

apply from: rootProject.file("gradle/scripts/klib-fabric.gradle")

base.archivesName = rootProject.name + "-blockentity"

kessoku {
module("base", "common")

common("blockentity", ModPlatform.FABRIC)
shadowBundle("blockentity", ModPlatform.FABRIC)
}

dependencies {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright (c) 2024 KessokuTeaTime
*
* Licensed under the GNU Lesser General Pubic License, Version 3 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.gnu.org/licenses/lgpl-3.0.html
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package band.kessoku.lib.impl.blockentity.fabric;

import net.fabricmc.api.ModInitializer;

public class KessokuBlockEntityFabric implements ModInitializer {
@Override
public void onInitialize() {

}
}
36 changes: 36 additions & 0 deletions blockentity/fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"schemaVersion": 1,
"id": "kessoku_blockentity",
"version": "${version}",
"name": "Kessoku Block Entity",
"description": "Common blockentity API.",
"authors": [
"Kessoku Tea Time"
],
"contact": {
"homepage": "https://modrinth.com/mod/kessoku-lib",
"sources": "https://github.com/KessokuTeaTime/KessokuLib",
"issues": "https://github.com/KessokuTeaTime/KessokuLib/issues"
},
"license": "LGPL-3.0-only",
"icon": "icon.png",
"entrypoints": {
"main": [
"band.kessoku.lib.impl.blockentity.fabric.KessokuBlockEntityFabric"
]
},
"environment": "*",
"depends": {
"fabricloader": ">=0.16.0",
"minecraft": "1.21",
"java": ">=21",
"fabric-api": "*"
},
"custom": {
"modmenu": {
"badges": [
"library"
]
}
}
}
12 changes: 12 additions & 0 deletions blockentity/neo/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import net.fabricmc.loom.util.ModPlatform

apply from: rootProject.file("gradle/scripts/klib-neo.gradle")

base.archivesName = rootProject.name + "-entrypoint"

kessoku {
module("base", "common")

common("blockentity", ModPlatform.NEOFORGE)
shadowBundle("blockentity", ModPlatform.NEOFORGE)
}
1 change: 1 addition & 0 deletions blockentity/neo/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
loom.platform=neoforge
29 changes: 29 additions & 0 deletions blockentity/neo/src/main/resources/META-INF/neoforge.mods.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
modLoader = "javafml"
loaderVersion = "[4,)"
license = "LGPL-3.0-only"
issueTrackerURL = "https://github.com/KessokuTeaTime/KessokuLib/issues"

[[mods]]
modId = "kessoku_blockentity"
version = "${version}"
displayName = "Kessoku Block Entity"
description = '''
Common blockentity API.
'''
logoFile = "icon.png"
authors = "Kessoku Tea Time"
displayURL = "https://modrinth.com/mod/kessoku-lib"

[[dependencies.kessoku_blockentity]]
modId = "neoforge"
type = "required"
versionRange = "[21.0,)"
ordering = "NONE"
side = "BOTH"

[[dependencies.kessoku_blockentity]]
modId = "minecraft"
type = "required"
versionRange = "[1.21,)"
ordering = "NONE"
side = "BOTH"
2 changes: 1 addition & 1 deletion entrypoint/fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"id": "kessoku_platform",
"version": "${version}",
"name": "Kessoku Platform",
"description": "Provide some basic API.",
"description": "Common entrypoint API.",
"authors": [
"Kessoku Tea Time"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ modId = "kessoku_entrypoint"
version = "${version}"
displayName = "Kessoku Entrypoint"
description = '''
Provide common entrypoint API.
Common entrypoint API.
'''
logoFile = "icon.png"
authors = "Kessoku Tea Time"
Expand Down
2 changes: 1 addition & 1 deletion event-base/fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"id": "kessoku_event_base",
"version": "${version}",
"name": "Kessoku Event Base",
"description": "Provide basic API for event system.",
"description": "Basic API for an event system.",
"authors": [
"Kessoku Tea Time"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ modId = "kessoku_event_base"
version = "${version}"
displayName = "Kessoku Event Base"
description = '''
Provide basic API for event system.
Basic API for an event system.
'''
logoFile = "icon.png"
authors = "Kessoku Tea Time"
Expand Down
Loading

0 comments on commit 9cb24a0

Please sign in to comment.