Skip to content
Open
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
41 changes: 18 additions & 23 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,33 @@
# certain platforms or Java versions, and provides a first line of defence
# against bad commits.

name: build
on:
name: Build
on:
pull_request:
push:
paths-ignore: [ '.github/', 'docs/', 'mkdocs.yml' ]

jobs:
build:
strategy:
matrix:
# Use these Java versions
java: [
17 # Latest version
]
# and run on both Linux and Windows
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@v2
- name: setup jdk ${{ matrix.java }}
uses: actions/setup-java@v1
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup JDK 21
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
- name: make gradle wrapper executable
if: ${{ runner.os != 'Windows' }}
run: chmod +x ./gradlew
- name: build
java-version: 21
distribution: microsoft

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Build
run: ./gradlew build
- name: capture build artifacts
if: ${{ runner.os == 'Linux' && matrix.java == '17' }} # Only upload artifacts built from LTS java on one OS
uses: actions/upload-artifact@v2

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: Artifacts
path: build/libs/
30 changes: 17 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,32 @@ on:
jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/cache@v2
- name: Setup Gradle caches
uses: actions/cache@v4
with:
path: |
~/.gradle/loom-cache
~/.gradle/caches
~/.gradle/loom-cache
~/.gradle/wrapper
key: gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
gradle-
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle

- name: Checkout repository
uses: actions/checkout@v4

- name: Setup JDK 21
uses: actions/setup-java@v4
with:
java-version: 17
java-version: 21
distribution: microsoft

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build and publish with Gradle
run: ./gradlew build publish
env:
MODRINTH: ${{ secrets.MODRINTH }}
CHANGELOG: ${{ github.event.release.body }}
RELEASE: true
RELEASE: true
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
libs/

# gradle

.gradle/
Expand Down
58 changes: 27 additions & 31 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.5-SNAPSHOT'
id 'fabric-loom' version '1.10-SNAPSHOT'
id 'maven-publish'
id "com.modrinth.minotaur" version "2.+"
}
Expand All @@ -12,21 +12,22 @@ base {
}

repositories {
// Add repositories to retrieve artifacts from in here.
// You should only use this when depending on other mods because
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
// for more information about repositories.
maven { url "https://api.modrinth.com/maven/" }
maven { url 'https://maven.nucleoid.xyz' }
maven {
name = 'Ladysnake Mods'
url = 'https://maven.ladysnake.org/releases'
url = 'https://maven.ladysnake.org/releases/'
}
maven {
name = 'NucleoidMC'
url = 'https://maven.nucleoid.xyz/'
}
maven {
name = "Fuzs Mod Resources"
url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/"
}
maven {
name = 'Modrinth'
url = 'https://api.modrinth.com/maven/'
}
}

dependencies {
Expand All @@ -38,20 +39,16 @@ dependencies {
// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

modImplementation "maven.modrinth:anshar:0.0.15"
modImplementation "dev.onyxstudios.cardinal-components-api:cardinal-components-base:5.4.0"
modImplementation "dev.onyxstudios.cardinal-components-api:cardinal-components-block:5.4.0"
modImplementation "dev.onyxstudios.cardinal-components-api:cardinal-components-level:5.4.0"
modImplementation "dev.onyxstudios.cardinal-components-api:cardinal-components-entity:5.4.0"
modImplementation "fuzs.forgeconfigapiport:forgeconfigapiport-fabric:20.4.2"

modImplementation include('eu.pb4:polymer-virtual-entity:0.7.6+1.20.4')
modImplementation include("xyz.nucleoid:server-translations-api:2.2.0+1.20.3-rc1")

// Uncomment the following line to enable the deprecated Fabric API modules.
// These are included in the Fabric API production distribution and allow you to update your mod to the latest modules at a later more convenient time.
modImplementation "maven.modrinth:anshar:1.0.2"
modImplementation "org.ladysnake.cardinal-components-api:cardinal-components-base:6.1.2"
modImplementation "org.ladysnake.cardinal-components-api:cardinal-components-block:6.1.2"
modImplementation "org.ladysnake.cardinal-components-api:cardinal-components-level:6.1.2"
modImplementation "org.ladysnake.cardinal-components-api:cardinal-components-entity:6.1.2"
modImplementation "fuzs.forgeconfigapiport:forgeconfigapiport-fabric:21.1.3"

// modImplementation "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}"
modImplementation include("eu.pb4:polymer-core:0.9.18+1.21.1")
modImplementation include("eu.pb4:polymer-virtual-entity:0.9.18+1.21.1")
modImplementation include("xyz.nucleoid:server-translations-api:2.3.1+1.21-pre2")
}

processResources {
Expand All @@ -63,29 +60,28 @@ processResources {
}

tasks.withType(JavaCompile).configureEach {
it.options.release = 17
it.options.encoding = "UTF-8"
it.options.release = 21
}

java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

jar {
from("LICENSE") {
rename { "${it}_${project.base.archivesName.get()}"}
rename { "${it}_${project.base.archivesName.get()}" }
}
}

// configure the maven publication
// Configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
create("mavenJava", MavenPublication) {
artifactId = project.archives_base_name
from components.java
}
}
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ org.gradle.parallel=true

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.20.4
yarn_mappings=1.20.4+build.3
loader_version=0.15.6
minecraft_version=1.21.1
yarn_mappings=1.21.1+build.3
loader_version=0.16.10

# Mod Properties
mod_version=0.0.15.1
mod_version=1.0.2.1
maven_group=eu.pb4.ansharpatch
archives_base_name=anshar-polymer-patch

# Dependencies
fabric_version=0.96.1+1.20.4
fabric_version=0.115.3+1.21.1
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
8 changes: 5 additions & 3 deletions gradlew
100644 → 100755

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 12 additions & 10 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions src/main/java/eu/pb4/ansharpatch/AnsharPolymerPatch.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package eu.pb4.ansharpatch;

import com.lgmrszd.anshar.beacon.EndCrystalItemContainer;
import eu.pb4.polymer.core.api.other.PolymerComponent;
import net.fabricmc.api.ModInitializer;

import net.fabricmc.fabric.api.resource.ResourceManagerHelper;
import net.minecraft.resource.ResourceType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -12,7 +11,9 @@ public class AnsharPolymerPatch implements ModInitializer {

@Override
public void onInitialize() {
/*PolymerResourcePackUtils.addModAssets("anshar");
PolymerComponent.registerDataComponent(EndCrystalItemContainer.BEACON_POS_DATA_COMPONENT);
/*
PolymerResourcePackUtils.addModAssets("anshar");
PolymerResourcePackUtils.getInstance().creationEvent.register(x -> {
x.addWriteConverter((path, bytes) -> path.startsWith("/assets/anshar/sounds/tunes") ? null : bytes);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
import com.lgmrszd.anshar.beacon.BeaconComponent;
import com.lgmrszd.anshar.beacon.EndCrystalComponent;
import com.lgmrszd.anshar.transport.PlayerTransportComponent;
import dev.onyxstudios.cca.api.v3.component.sync.AutoSyncedComponent;
import net.minecraft.server.network.ServerPlayerEntity;
import org.ladysnake.cca.api.v3.component.sync.AutoSyncedComponent;
import org.spongepowered.asm.mixin.Mixin;

@Mixin({BeaconComponent.class, EndCrystalComponent.class, PlayerTransportComponent.class})
public abstract class DisableComponentSyncMixin implements AutoSyncedComponent {

@Override
public boolean shouldSyncWith(ServerPlayerEntity player) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,10 @@
@Mixin(EntityStatusS2CPacket.class)
public interface EntityStatusS2CPacketAccessor {
@Accessor
int getId();

@Mutable
@Accessor
void setId(int id);
void setEntityId(int id);

@Accessor
byte getStatus();

@Mutable
@Accessor
void setStatus(byte status);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@

import net.minecraft.resource.FileResourcePackProvider;
import net.minecraft.resource.ResourcePackSource;
import net.minecraft.resource.ResourceType;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

@Mixin(FileResourcePackProvider.class)
public interface FileResourcePackProviderAccessor {

@Accessor
ResourcePackSource getSource();
}
Loading