Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/Multiloader-1.19.4' into…
Browse files Browse the repository at this point in the history
… Multiloader-1.19
  • Loading branch information
fayer3 committed Feb 28, 2024
2 parents d86c70a + 29289ed commit 9096414
Show file tree
Hide file tree
Showing 152 changed files with 3,155 additions and 791 deletions.
133 changes: 107 additions & 26 deletions .github/workflows/publish-on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fileNames=(${{ github.event.release.assets[0].name }} ${{ github.event.release.assets[1].name }} ${{ github.event.release.assets[2].name }})
filePaths=(${{ github.event.release.assets[0].browser_download_url }} ${{ github.event.release.assets[1].browser_download_url }} ${{ github.event.release.assets[2].browser_download_url }})
for i in 0 1 2
for i in 0 1 2 3
do
echo "${fileNames[i]}"
echo "${filePaths[i]}"
Expand All @@ -29,18 +29,20 @@ jobs:
if [[ "${fileNames[i]}" == *"fabric"* ]]; then
echo "FABRIC_FILE_NAME=${fileNames[i]}" >> $GITHUB_OUTPUT
echo "FABRIC_FILE_PATH=./${fileNames[i]}" >> $GITHUB_OUTPUT
fi
if [[ "${fileNames[i]}" == *"forge"* ]]; then
elif [[ "${fileNames[i]}" == *"neoforge"* ]]; then
echo "NEOFORGE_FILE_NAME=${fileNames[i]}" >> $GITHUB_OUTPUT
echo "NEOFORGE_FILE_PATH=./${fileNames[i]}" >> $GITHUB_OUTPUT
elif [[ "${fileNames[i]}" == *"forge"* ]]; then
echo "FORGE_FILE_NAME=${fileNames[i]}" >> $GITHUB_OUTPUT
echo "FORGE_FILE_PATH=./${fileNames[i]}" >> $GITHUB_OUTPUT
fi
if [[ "${fileNames[i]}" == *"quilt"* ]]; then
elif [[ "${fileNames[i]}" == *"quilt"* ]]; then
echo "QUILT_FILE_NAME=${fileNames[i]}" >> $GITHUB_OUTPUT
echo "QUILT_FILE_PATH=./${fileNames[i]}" >> $GITHUB_OUTPUT
fi
done
ls -l
- run: echo "fabric is ${{ steps.assets.outputs.FABRIC_FILE_NAME }}"
- run: echo "neoforge is ${{ steps.assets.outputs.NEOFORGE_FILE_NAME }}"
- run: echo "forge is ${{ steps.assets.outputs.FORGE_FILE_NAME }}"
- run: echo "quilt is ${{ steps.assets.outputs.QUILT_FILE_NAME }}"

Expand All @@ -49,7 +51,7 @@ jobs:
shell: bash
run: |
parse_fabric () {
unzip -j "$1" "$2" -d ./fabric
unzip -o -j "$1" "$2" -d ./fabric
deps=false
bracket=false
parsedVersion=""
Expand All @@ -75,11 +77,29 @@ jobs:
fi
done < ./fabric/$2
}
parse_forge () {
unzip -o -j "$1" "META-INF/mods.toml" -d ./forge
minecraftDep=false
minecraftIdReg='modId\s+=\s+"minecraft"'
versionRangeReg='versionRange\s+=\s+"(.+?)"'
while read -r; do
if [[ $REPLY =~ $minecraftIdReg ]]; then
minecraftDep=true
echo "$REPLY"
elif [[ $REPLY =~ $versionRangeReg && $minecraftDep == "true" ]]; then
parsedVersion="${BASH_REMATCH[1]}"
echo "${BASH_REMATCH[0]}"
echo "${BASH_REMATCH[1]}"
fi
done < ./forge/mods.toml
}
file=""
if [ -n "${{ steps.assets.outputs.FABRIC_FILE_NAME }}" ]; then
file="${{ steps.assets.outputs.FABRIC_FILE_NAME }}"
elif [ -n "${{ steps.assets.outputs.FORGE_FILE_NAME }}" ]; then
file="${{ steps.assets.outputs.FORGE_FILE_NAME }}"
elif [ -n "${{ steps.assets.outputs.NEOFORGE_FILE_NAME }}" ]; then
file="${{ steps.assets.outputs.NEOFORGE_FILE_NAME }}"
else
file="${{ steps.assets.outputs.QUILT_FILE_NAME }}"
fi
Expand Down Expand Up @@ -120,26 +140,19 @@ jobs:
loaders_quilt="quilt"
fi
loaders_forge="forge"
loaders_neoforge="neoforge"
if [ -n "${{ steps.assets.outputs.FABRIC_FILE_NAME }}" ]; then
parse_fabric ${{ steps.assets.outputs.FABRIC_FILE_NAME }} "fabric.mod.json"
echo "FABRIC_MC_VERSIONS="${parsedVersion}"" >> $GITHUB_OUTPUT
fi
if [ -n "${{ steps.assets.outputs.FORGE_FILE_NAME }}" ]; then
unzip -j "${{ steps.assets.outputs.FORGE_FILE_NAME }}" "META-INF/mods.toml" -d ./forge
minecraftDep=false
minecraftIdReg='modId\s+=\s+"minecraft"'
versionRangeReg='versionRange\s+=\s+"(.+?)"'
while read -r; do
if [[ $REPLY =~ $minecraftIdReg ]]; then
minecraftDep=true
echo "$REPLY"
elif [[ $REPLY =~ $versionRangeReg && $minecraftDep == "true" ]]; then
echo "FORGE_MC_VERSIONS="${BASH_REMATCH[1]}"" >> $GITHUB_OUTPUT
echo "${BASH_REMATCH[0]}"
echo "${BASH_REMATCH[1]}"
fi
done < ./forge/mods.toml
parse_forge ${{ steps.assets.outputs.FORGE_FILE_NAME }}
echo "FORGE_MC_VERSIONS="${parsedVersion}"" >> $GITHUB_OUTPUT
fi
if [ -n "${{ steps.assets.outputs.NEOFORGE_FILE_NAME }}" ]; then
parse_forge ${{ steps.assets.outputs.NEOFORGE_FILE_NAME }}
echo "NEOFORGE_MC_VERSIONS="${parsedVersion}"" >> $GITHUB_OUTPUT
fi
if [ -n "${{ steps.assets.outputs.QUILT_FILE_NAME }}" ]; then
parse_fabric ${{ steps.assets.outputs.QUILT_FILE_NAME }} "quilt.mod.json"
Expand All @@ -151,6 +164,8 @@ jobs:
echo "loaders forge: ${loaders_forge}"
echo "LOADERS_FORGE=${loaders_forge}" >> $GITHUB_OUTPUT
echo "loaders neoforge: ${loaders_neoforge}"
echo "LOADERS_NEOFORGE=${loaders_neoforge}" >> $GITHUB_OUTPUT
echo "loaders quilt: ${loaders_quilt}"
echo "LOADERS_QUILT=${loaders_quilt}" >> $GITHUB_OUTPUT
Expand All @@ -160,13 +175,16 @@ jobs:
echo "VERSION_NAME_FABRIC=${mod_name}-fabric" >> $GITHUB_OUTPUT
echo "file name forge: '${mod_name}-forge'"
echo "VERSION_NAME_FORGE=${mod_name}-forge" >> $GITHUB_OUTPUT
echo "file name neoforge: '${mod_name}-neoforge'"
echo "VERSION_NAME_NEOFORGE=${mod_name}-neoforge" >> $GITHUB_OUTPUT
echo "file name quilt: '${mod_name}-quilt'"
echo "VERSION_NAME_QUILT=${mod_name}-quilt" >> $GITHUB_OUTPUT
# modrinth mod versions
base_version="$mc_version-${array[2]}"
echo "MOD_VERSION_FABRIC=${base_version}-fabric" >> $GITHUB_OUTPUT
echo "MOD_VERSION_FORGE=${base_version}-forge" >> $GITHUB_OUTPUT
echo "MOD_VERSION_NEOFORGE=${base_version}-neoforge" >> $GITHUB_OUTPUT
echo "MOD_VERSION_QUILT=${base_version}-quilt" >> $GITHUB_OUTPUT
echo "MOD_VERSION=${base_version}" >> $GITHUB_OUTPUT
Expand All @@ -178,6 +196,9 @@ jobs:
- run: echo "forge mc versions are ${{ steps.version.outputs.FORGE_MC_VERSIONS }}"
- run: echo "forge mod version ${{ steps.version.outputs.MOD_VERSION_FORGE }}"

- run: echo "neoforge mc versions are ${{ steps.version.outputs.NEOFORGE_MC_VERSIONS }}"
- run: echo "neoforge mod version ${{ steps.version.outputs.MOD_VERSION_NEOFORGE }}"

- run: echo "quilt mc versions are ${{ steps.version.outputs.QUILT_MC_VERSIONS }}"
- run: echo "quilt mod version ${{ steps.version.outputs.MOD_VERSION_QUILT }}"

Expand Down Expand Up @@ -221,6 +242,26 @@ jobs:
loaders: "${{ steps.version.outputs.LOADERS_FORGE}}"
#game-versions: "${{ steps.version.outputs.FORGE_MC_VERSIONS }}"

- name: publish neoforge
if: steps.assets.outputs.NEOFORGE_FILE_PATH != ''
uses: Kir-Antipov/[email protected]
with:
modrinth-id: wGoQDPN5
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
modrinth-featured: false

curseforge-id: 667903
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}

files: ${{ steps.assets.outputs.NEOFORGE_FILE_PATH }}

name: "${{ steps.version.outputs.VERSION_NAME_NEOFORGE }}"
version: "${{ steps.version.outputs.MOD_VERSION_NEOFORGE }}"
version-type: "${{ steps.version.outputs.RELEASE_TYPE }}"

loaders: "${{ steps.version.outputs.LOADERS_NEOFORGE}}"
#game-versions: "${{ steps.version.outputs.FORGE_MC_VERSIONS }}"

- name: publish quilt
if: steps.assets.outputs.QUILT_FILE_PATH != ''
uses: Kir-Antipov/[email protected]
Expand All @@ -243,18 +284,18 @@ jobs:

# update forge versions json
- name: checkout repo forge-versions
if: steps.assets.outputs.FORGE_FILE_PATH != ''
if: steps.assets.outputs.FORGE_FILE_PATH != '' || steps.assets.outputs.NEOFORGE_FILE_PATH != ''
uses: actions/checkout@v4
with:
ref: 'forge-versions'

- name: setup python
if: steps.assets.outputs.FORGE_FILE_PATH != ''
if: steps.assets.outputs.FORGE_FILE_PATH != '' || steps.assets.outputs.NEOFORGE_FILE_PATH != ''
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: execute py script to update json
- name: execute py script to update forge json
if: steps.assets.outputs.FORGE_FILE_PATH != ''
run: |
python -c "
Expand All @@ -278,9 +319,49 @@ jobs:
with open('forge_updates.json', 'w') as outfile:
outfile.write(json.dumps(jsonContent, indent='\t'))
" "${{ steps.version.outputs.FORGE_MC_VERSIONS }}" "${{ steps.version.outputs.MOD_VERSION }}" "${{ steps.version.outputs.RELEASE_TYPE }}"
- name: push new update json
if: steps.assets.outputs.FORGE_FILE_PATH != ''
- name: execute py script to update neoforge json
if: steps.assets.outputs.NEOFORGE_FILE_PATH != ''
run: |
python -c "
import sys, json
print(sys.argv)
mc_version = sys.argv[1]
mod_version = sys.argv[2]
release_type = sys.argv[3]
jsonContent = {}
with open('neoforge_updates.json', 'r') as infile:
jsonContent = json.load(infile)
for str in mc_version.split(','):
version = str.strip('[]\" ')
if version != '' and version[-1:] != ')' and version[:1] != '(':
jsonContent['promos'][version + '-latest'] = mod_version
print('added ' + version + '-latest:' + mod_version)
if release_type == 'release':
jsonContent['promos'][version + '-recommended'] = mod_version
print('added ' + version + '-recommended:' + mod_version)
print(json.dumps(jsonContent, indent='\t'))
with open('neoforge_updates.json', 'w') as outfile:
outfile.write(json.dumps(jsonContent, indent='\t'))
" "${{ steps.version.outputs.NEOFORGE_MC_VERSIONS }}" "${{ steps.version.outputs.MOD_VERSION }}" "${{ steps.version.outputs.RELEASE_TYPE }}"
- name: push new update json forge
if: steps.assets.outputs.FORGE_FILE_PATH != '' && steps.assets.outputs.NEOFORGE_FILE_PATH == ''
uses: EndBug/add-and-commit@v9
with:
message: 'update forge ${{ steps.version.outputs.FORGE_MC_VERSIONS }} to ${{ steps.version.outputs.MOD_VERSION }}'
push: true

- name: push new update json neoforge
if: steps.assets.outputs.FORGE_FILE_PATH == '' && steps.assets.outputs.NEOFORGE_FILE_PATH != ''
uses: EndBug/add-and-commit@v9
with:
message: 'update neoforge ${{ steps.version.outputs.NEOFORGE_MC_VERSIONS }} to ${{ steps.version.outputs.MOD_VERSION }}'
push: true

- name: push new update json forge+neoforge
if: steps.assets.outputs.FORGE_FILE_PATH != '' && steps.assets.outputs.NEOFORGE_FILE_PATH != ''
uses: EndBug/add-and-commit@v9
with:
message: 'update ${{ steps.version.outputs.FORGE_MC_VERSIONS }} to ${{ steps.version.outputs.MOD_VERSION }}'
message: 'update forge ${{ steps.version.outputs.FORGE_MC_VERSIONS }} to ${{ steps.version.outputs.MOD_VERSION }} and update neoforge ${{ steps.version.outputs.NEOFORGE_MC_VERSIONS }} to ${{ steps.version.outputs.MOD_VERSION }}'
push: true
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.3-SNAPSHOT" apply false
id "dev.architectury.loom" version "1.5-SNAPSHOT" apply false
id 'io.github.juuxel.loom-quiltflower' version '1.8.0' apply false
}

Expand Down Expand Up @@ -44,7 +44,7 @@ subprojects {

task copyJarToMain(type: Copy) {
duplicatesStrategy = "include"
if (project.name != "common") {
if (project.name != "common" && project.name != "stubs") {
from remapJar
into "../build/libs"
}
Expand Down
37 changes: 15 additions & 22 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,52 +7,45 @@ loom {
}

dependencies {
compileOnly project(':stubs')
// We depend on fabric loader here to use the fabric @Environment annotations and get the mixin dependencies
// Do NOT use other classes from fabric loader
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"

modApi("dev.architectury:architectury-fabric:${rootProject.architectury_version}")
modApi("dev.architectury:architectury-fabric:${rootProject.architectury_version}") { exclude group: "net.fabricmc" exclude group: "net.fabricmc.fabric-api" }

// for sodium compat
modCompileOnly "maven.modrinth:sodium:mc1.19.2-0.4.4"
modCompileOnly "maven.modrinth:sodium:mc1.19.3-0.4.9"
modCompileOnly "883067831485366304:1076634925077364786:sodium-fabric-mc1.19.3-0.4.10rev.c131708-dirty:jar"
modCompileOnly("maven.modrinth:rubidium:0.6.1")
compileOnly 'org.joml:joml:1.10.4' //temp sodium
modCompileOnly "maven.modrinth:sodium:mc1.19.4-0.4.10"

// for iris compat
modCompileOnly "maven.modrinth:iris:1.6.5+1.19.2"
modCompileOnly "maven.modrinth:iris:1.6.11+1.19.4"

// for REI compat
modCompileOnly "me.shedaniel:RoughlyEnoughItems-fabric:9.1.619"
modCompileOnly("me.shedaniel:RoughlyEnoughItems-fabric:11.0.683") { exclude group: "net.fabricmc" exclude group: "net.fabricmc.fabric-api" exclude group: "dev.architectury" }

// for Pehkui compat
modApi("com.github.Virtuoel:Pehkui:3.7.7", { exclude group: "net.fabricmc.fabric-api" })
modApi("com.github.Virtuoel:Pehkui:3.7.12") { exclude group: "net.fabricmc" exclude group: "net.fabricmc.fabric-api" }

// other mods
modCompileOnly "maven.modrinth:dynamic-fps:3.2.0"
modCompileOnly "maven.modrinth:dynamic-fps:3.4.2"
// modCompileOnly("com.simibubi.create:create-fabric-1.19.2:0.5.0.i-969+1.19.2")
modCompileOnly "maven.modrinth:lithium:mc1.19.2-0.11.1"
modCompileOnly "maven.modrinth:indium:1.0.9+mc1.19.2"
modCompileOnly "maven.modrinth:resolution-control-plus:1.20-3.0.0"
// modCompileOnly "maven.modrinth:lithium:mc1.19.4-0.11.1"
// modCompileOnly "maven.modrinth:indium:1.0.19+mc1.19.4"
modCompileOnly "maven.modrinth:resolution-control-plus:1.19.4-3.0.0"
modCompileOnly "maven.modrinth:better-combat:1.7.1+1.19.4-fabric"

// for immersive portals compat
modCompileOnly('com.github.iPortalTeam.ImmersivePortalsMod:imm_ptl_core:v2.3.1-1.19') {
exclude(group: "net.fabricmc.fabric-api")
transitive(false)
}
modCompileOnly('com.github.iPortalTeam.ImmersivePortalsMod:q_misc_util:v2.3.1-1.19') {
exclude(group: "net.fabricmc.fabric-api")
transitive(false)
}
modCompileOnly('com.github.iPortalTeam.ImmersivePortalsMod:imm_ptl_core:v2.7.5-mc1.19.4') { transitive false }

//for epic fight compat
modCompileOnly("maven.modrinth:epic-fight:20.6.3")

// needed dependencies
compileOnly("com.google.code.findbugs:jsr305:3.0.2")
compileOnly('com.electronwill.night-config:toml:3.6.6')

//LaunchPopup
implementation 'com.github.fayer3:LaunchPopup:master-SNAPSHOT'

}
// extract the LaunchPopup classes
jar {
Expand Down
21 changes: 7 additions & 14 deletions common/src/main/java/org/vivecraft/MixinConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
import org.spongepowered.asm.service.MixinService;
import org.vivecraft.client.Xplat;
import org.vivecraft.client_vr.settings.VRSettings;
import org.vivecraft.mod_compat_vr.iris.mixin.IrisChunkProgramOverridesMixinSodium_0_4_11;
import org.vivecraft.mod_compat_vr.iris.mixin.IrisChunkProgramOverridesMixinSodium_0_4_8;
import org.vivecraft.mod_compat_vr.iris.mixin.IrisChunkProgramOverridesMixinSodium_0_4_9;
import org.vivecraft.mod_compat_vr.sodium.mixin.RenderSectionManagerVRMixin;
import org.vivecraft.mod_compat_vr.iris.mixin.coderbot.IrisChunkProgramOverridesMixinSodium_0_4_11;
import org.vivecraft.mod_compat_vr.iris.mixin.coderbot.IrisChunkProgramOverridesMixinSodium_0_4_9;
import org.vivecraft.mod_compat_vr.iris.mixin.irisshaders.IrisChunkProgramOverridesMixinSodium_0_6;
import org.vivecraft.mod_compat_vr.sodium.SodiumHelper;

import java.io.IOException;
import java.util.Collections;
Expand Down Expand Up @@ -78,15 +78,8 @@ public boolean shouldApplyMixin(String targetClassName, String mixinClassName) {
neededClass = "me.jellysquid.mods.sodium.client.render.vertex.type.ChunkVertexType";
} else if (mixinClassName.equals(IrisChunkProgramOverridesMixinSodium_0_4_11.class.getName())) {
neededClass = "me.jellysquid.mods.sodium.client.render.chunk.vertex.format.ChunkVertexType";
} else if (mixinClassName.equals(RenderSectionManagerVRMixin.class.getName())) {
neededClass = "me.jellysquid.mods.sodium.client.render.chunk.lists.ChunkRenderList";
try {
MixinService.getService().getBytecodeProvider().getClassNode(neededClass);
ClassNode node = MixinService.getService().getBytecodeProvider().getClassNode(targetClassName);
return node.fields.stream().anyMatch(field -> field.name.equals("chunkRenderList"));
} catch (ClassNotFoundException | IOException e) {
return false;
}
} else if (mixinClassName.equals(IrisChunkProgramOverridesMixinSodium_0_6.class.getName())) {
neededClass = "net.caffeinemc.mods.sodium.client.render.chunk.vertex.format.ChunkVertexType";
}

if (!neededClass.isEmpty()) {
Expand All @@ -99,6 +92,6 @@ public boolean shouldApplyMixin(String targetClassName, String mixinClassName) {
}
}

return !mixinClassName.contains("NoSodium") || (!Xplat.isModLoaded("sodium") && !Xplat.isModLoaded("rubidium"));
return !mixinClassName.contains("NoSodium") || !SodiumHelper.isLoaded();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.Level;
import net.minecraft.world.phys.Vec3;
import org.vivecraft.client.extensions.SparkParticleExtension;
import org.vivecraft.client.utils.Utils;
import org.vivecraft.client_vr.ClientDataHolderVR;
import org.vivecraft.client_vr.VRData;
Expand Down Expand Up @@ -35,7 +36,11 @@ public static VRPlayersClient getInstance() {
}

public static void clear() {
instance = null;
if (instance != null) {
instance.vivePlayers.clear();
instance.vivePlayersLast.clear();
instance.vivePlayersReceived.clear();
}
}

private VRPlayersClient() {
Expand Down Expand Up @@ -149,6 +154,7 @@ public void tick() {

if (particle != null) {
particle.setColor(0.5F + this.rand.nextFloat() / 2.0F, 0.5F + this.rand.nextFloat() / 2.0F, 0.5F + this.rand.nextFloat() / 2.0F);
((SparkParticleExtension) particle).vivecraft$setPlayerUUID(player.getUUID());
}
}
}
Expand Down
Loading

0 comments on commit 9096414

Please sign in to comment.