Skip to content

Commit

Permalink
Merge pull request #625 from mrsterner/1.20.1/update
Browse files Browse the repository at this point in the history
1.20.1/update
  • Loading branch information
StewStrong authored Nov 27, 2023
2 parents b3555ab + 83894b9 commit 68a8929
Show file tree
Hide file tree
Showing 236 changed files with 11,725 additions and 2,380 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ body:
- 1.16
- 1.18
- 1.19
- 1.20.x
validations:
required: true
- type: dropdown
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/compatibility_issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ body:
- 1.16
- 1.18
- 1.19
- 1.20.x
validations:
required: true
- type: dropdown
Expand Down
19 changes: 17 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,26 @@ jobs:
name: "Validate Gradle wrapper"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: true # Clone with vs-core submodule
- uses: gradle/wrapper-validation-action@v1

json-yaml-validate:
name: "Validate Json/Yaml files"
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write # enable write permissions for pull request comments
steps:
- uses: actions/checkout@v4

- name: json-yaml-validate
id: json-yaml-validate
uses: GrantBirki/json-yaml-validate@v2.3.1
with:
comment: "true" # enable comment mode

test-server:
name: Test Server
strategy:
Expand All @@ -27,7 +42,7 @@ jobs:
timeout-minutes: 20 # Fail after 20 minutes
steps:
- name: Shallow Clone (--recurse-submodules)
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive

Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "vs-core"]
path = vs-core
url = https://github.com/ValkyrienSkies/vs-core
126 changes: 64 additions & 62 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,12 @@ buildscript {
plugins {
// Needed for Forge+Fabric
id "architectury-plugin" version "3.4.146"
id "dev.architectury.loom" version "1.1.346" apply false
id 'io.github.juuxel.loom-quiltflower' version '1.8.0' apply false
id "dev.architectury.loom" version "1.3.355" apply false
id 'io.github.juuxel.loom-vineflower' version '1.11.0' apply false
// Kotlin
id "org.jetbrains.kotlin.jvm" version "1.7.10" apply false
// Kotlin linter
id "org.jlleitschuh.gradle.ktlint" version "10.3.0"

id "org.jetbrains.kotlin.jvm" version "1.9.10" apply false
id 'com.matthewprenger.cursegradle' version '1.4.0' apply false
id "com.modrinth.minotaur" version "2.4.3" apply false

// Java linter
id "checkstyle"
}

// Determine the version
Expand All @@ -42,20 +36,73 @@ dependencyLocking {
lockAllConfigurations()
}

// Determine the version of vs-core
String vsCoreGitRevision = "git rev-parse HEAD".execute(null, gradle.includedBuild("vs-core").projectDir).text.trim()
ext.vs_core_version = "1.1.0+" + vsCoreGitRevision.substring(0, 10)
tasks.register("updateVsCore") {
File versionFile = null
File gradleProperties = file("gradle.properties")

try {
def vsCoreBuild = gradle.includedBuild("vs-core")
versionFile = new File(vsCoreBuild.projectDir, "api-game/build/version.txt")

inputs.file(versionFile)
outputs.file(gradleProperties)
dependsOn(vsCoreBuild.task(":api-game:writeVersion"))

[':impl', ':api', ':api-game', ':util'].each {
dependsOn(vsCoreBuild.task("${it}:publishToMavenLocal"))
}
} catch (UnknownDomainObjectException ignore) {}

onlyIf {
versionFile != null
}

doLast {
def vsCoreVersion = versionFile.text
def newGradleProperties = gradleProperties.text.replaceFirst("(?m)^vs_core_version=.*", "vs_core_version=" + vsCoreVersion)
gradleProperties.write(newGradleProperties)
}
}

subprojects {
apply plugin: "dev.architectury.loom"
// Apply checkstyle and ktlint to check the code style of every sub project
apply plugin: "org.jlleitschuh.gradle.ktlint"
apply plugin: "checkstyle"
apply plugin: "org.jetbrains.kotlin.jvm"
apply plugin: "io.github.juuxel.loom-quiltflower"
apply plugin: "io.github.juuxel.loom-vineflower"

configurations.each { it.resolutionStrategy.useGlobalDependencySubstitutionRules.set(false) }

repositories {
try {
def vsCoreBuild = gradle.includedBuild("vs-core")
mavenLocal {
content {
includeGroup("org.valkyrienskies.core")
}
}

[':impl', ':api', ':api-game'].each {
compileJava.dependsOn(vsCoreBuild.task("${it}:publishToMavenLocal"))
}
} catch (UnknownDomainObjectException ignore) {}

mavenCentral()
maven {
url "https://cursemaven.com"
content {
includeModule "curse.maven", "kotlinforforge-351264"
}
}
maven {
name = "Valkyrien Skies Internal"
url = project.vs_maven_url ?: 'https://maven.valkyrienskies.org'
if (project.vs_maven_username && project.vs_maven_password) {
credentials {
username = project.vs_maven_username
password = project.vs_maven_password
}
}
}
if (!project.block_external_repositories) {
mavenLocal()
maven {
Expand All @@ -72,28 +119,14 @@ subprojects {
name = 'tterrag maven'
url = 'https://maven.tterrag.com/'
}
maven { url = "https://api.modrinth.com/maven" } // LazyDFU, Suggestion Tweaker
maven { url = "https://api.modrinth.com/maven" } // LazyDFU, Suggestion Tweaker, Create Big Cannons
maven { url = "https://maven.shedaniel.me/" } // Cloth Config, REI
maven { url "https://maven.architectury.dev/" }
maven { url = "https://mvn.devos.one/snapshots/" } // Fabric Create, Porting Lib, Forge Tags, Milk Lib
maven { url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/" } // Forge Config API Port
maven { url = "https://maven.tterrag.com/" } // Registrate, Forge Create and Flywheel
maven { url = "https://maven.cafeteria.dev/releases" } // Fake Player API
maven { url = "https://maven.jamieswhiteshirt.com/libs-release" } // Reach Entity Attributes
maven { url = "https://mvn.devos.one/#/snapshots/" } // Create Fabric
maven {
url = "https://jitpack.io"
content { includeGroup("com.github.llamalad7.mixinextras") }
} // MixinExtras smh my head
}
maven {
name = "Valkyrien Skies Internal"
url = project.vs_maven_url ?: 'https://maven.valkyrienskies.org'
if (project.vs_maven_username && project.vs_maven_password) {
credentials {
username = project.vs_maven_username
password = project.vs_maven_password
}
}
}
}

Expand All @@ -114,37 +147,6 @@ subprojects {

compileOnly("com.google.code.findbugs:jsr305:3.0.2")
}

// configure checkstyle
checkstyle {
// configure to use checkstyle v8.41
toolVersion "8.45.1"
// Gradle should fail builds on checkstyle errors (not warnings)
ignoreFailures = true
// Checkstyle config file is in .checkstyle/checkstyle.xml
configFile = file("${rootDir}/.checkstyle/checkstyle.xml")
}

// configure checkstyle, but different
// https://docs.gradle.org/current/userguide/checkstyle_plugin.html
tasks.withType(Checkstyle) {
reports {
// Do not output html reports
html.enabled = false
// Output xml reports
xml.enabled = true
}
}

// configure ktlint
ktlint {
reporters {
// configure to output in checkstyle XML format
reporter "checkstyle"
}
ignoreFailures = true
disabledRules = ["parameter-list-wrapping"]
}
}

allprojects {
Expand Down
13 changes: 13 additions & 0 deletions changelogs/2.1.1-beta.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# New Features
* LOD that adds collision shapes for stairs/slabs/ect, and adds friction/elasticity/density properties to blocks
* Multithreaded Krunch physics engine
* Multithreaded terrain loading (so physics doesn't lag from terrain loading)
* Allow ships to travel through Nether and End portals
* Allow ships to be teleported between dimensions
* Added physics entity support (currently only used to make balls with the Physics Entity Creator Item, but more coming soon 🙂)

# Bugfixes
* Fixed ships randomly getting stuck in the air
* Fixed scaled ships not behaving correctly in water
* Fixed the @v command argument to behave correctly like the @e argument
* Fixed Ship Creator Item not scaling ships correctly
5 changes: 5 additions & 0 deletions changelogs/2.1.1-beta.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# New Features
Nothing

# Bugfixes
* Removed old CBC mixin that doesn't work on new versions
25 changes: 15 additions & 10 deletions common/build.gradle
Original file line number Diff line number Diff line change
@@ -1,32 +1,37 @@

dependencies {
annotationProcessor(implementation("com.github.llamalad7.mixinextras:mixinextras-common:0.2.0-beta.8"))
implementation(annotationProcessor("io.github.llamalad7:mixinextras-common:0.2.0"))

compileOnly 'com.google.code.findbugs:jsr305:3.0.2'
// We depend on fabric loader here to use the fabric @Environment annotations
// Do NOT use other classes from fabric loader
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"

modApi("me.shedaniel.cloth:cloth-config:11.0.99")
modApi("me.shedaniel.cloth:cloth-config:${cloth_config_version}")

modCompileOnly("maven.modrinth:sodium:mc1.20-0.4.10")
modCompileOnly("maven.modrinth:sodium:${sodium_version}")

// vs-core
implementation("org.valkyrienskies.core:impl:${rootProject.vs_core_version}") {
exclude module: "netty-buffer"
exclude module: "fastutil"
exclude group: "com.google.guava"
}

implementation("org.valkyrienskies.core:util:${rootProject.vs_core_version}")

// FTB Stuffs
// modCompileOnly("curse.maven:ftb-util-404465:4210935")
// modCompileOnly("curse.maven:ftb-teams-404468:4229138")
// modCompileOnly("curse.maven:ftb-chunks-314906:4229120")
modCompileOnly("curse.maven:ftb-util-404465:4210935")
modCompileOnly("curse.maven:ftb-teams-404468:4229138")
modCompileOnly("curse.maven:ftb-chunks-314906:4229120")

// Common create compat,
// We just use a version from a platform and hope the classes exist on both versions and mixins apply correctly
//Common create compat,
//We just use a version from a platform and hope the classes exist on both versions and mixins apply correctly
modCompileOnly("com.simibubi.create:create-fabric-${minecraft_version}:${create_fabric_version}")
{ exclude group: 'com.github.AlphaMode', module: 'fakeconfigtoml' }
modCompileOnly("com.jozufozu.flywheel:flywheel-fabric-${minecraft_version}:0.6.9-4")
modCompileOnly("net.fabricmc.fabric-api:fabric-api:${fabric_api_version}")
modCompileOnly("com.jozufozu.flywheel:flywheel-fabric-${minecraft_version}:${flywheel_version_fabric}")

modCompileOnly("maven.modrinth:create-big-cannons:${createbigcannons_version}")
}

architectury {
Expand Down
9 changes: 9 additions & 0 deletions common/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#https://mvn.devos.one/#/snapshots/io/github/fabricators_of_create/Porting-Lib/Porting-Lib
port_lib_version=2.1.1127+1.20
port_lib_modules = accessors,base,entity,extensions,fake_players,networking,obj_loader,tags,transfer,models,tool_actions,client_events,brewing

# https://modrinth.com/mod/cloth-config/version/8.3.103+fabric
cloth_config_version = 11.1.106

# https://modrinth.com/mod/sodium/versions
sodium_version = mc1.20-0.4.10
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package org.valkyrienskies.mod.compat;

import com.jozufozu.flywheel.backend.instancing.InstanceWorld;
import java.util.Collections;
import java.util.Set;
import java.util.WeakHashMap;
import org.valkyrienskies.core.impl.hooks.VSEvents.ShipUnloadEventClient;
import org.valkyrienskies.mod.mixinducks.MixinBlockEntityInstanceManagerDuck;

public class FlywheelEvents {
static {
registerEvents();
}

private static final Set<InstanceWorld> weakLoadedInstanceWorlds =
Collections.newSetFromMap(
new WeakHashMap<>()
);

private static synchronized void registerEvents() {
ShipUnloadEventClient.Companion.on(event -> {
for (final InstanceWorld instanceWorld : weakLoadedInstanceWorlds) {
((MixinBlockEntityInstanceManagerDuck) instanceWorld.getBlockEntityInstanceManager()).vs$removeShipManager(event.getShip());
}
});
}

public static void onInstanceWorldLoad(final InstanceWorld instanceWorld) {
weakLoadedInstanceWorlds.add(instanceWorld);
}

public static void onInstanceWorldUnload(final InstanceWorld instanceWorld) {
weakLoadedInstanceWorlds.remove(instanceWorld);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,13 @@ public interface EntityAccessor {

@Accessor("feetBlockState")
void setFeetBlockState(BlockState feetBlockState);


@Accessor("portalCooldown")
void setPortalCooldown(int portalCooldown);

@Accessor("portalCooldown")
int getPortalCooldown();

@Accessor("portalEntrancePos")
BlockPos getPortalEntrancePos();
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.valkyrienskies.mod.mixin.accessors.resource;

import java.util.Map;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import org.spongepowered.asm.mixin.Mixin;
Expand All @@ -8,6 +9,14 @@

@Mixin(ResourceKey.class)
public interface ResourceKeyAccessor {
/*
@Accessor("VALUES")
static Map<String, ResourceKey<?>> getValues() {
throw new AssertionError();
}
*/

@Accessor
ResourceLocation getRegistryName();

Expand Down
Loading

0 comments on commit 68a8929

Please sign in to comment.