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
56 changes: 45 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import groovy.xml.XmlSlurper

plugins {
id 'fabric-loom' version "${loom_version}"
id 'dev.architectury.loom' version "${loom_version}"
id 'maven-publish'
}

Expand All @@ -19,6 +21,10 @@ static String getExtraBuildMetadata() {
}

repositories {
maven {
name 'NeoForged'
url 'https://maven.neoforged.net/releases'
}
maven {
name 'TerraformersMC'
url 'https://maven.terraformersmc.com'
Expand All @@ -31,27 +37,55 @@ repositories {
name 'Shedaniel'
url 'https://maven.shedaniel.me'
}
maven {
name 'Sinytra'
url "https://maven.su5ed.dev/releases"
}
}

dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

// Fabric API
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
minecraft "net.minecraft:minecraft:$project.minecraft_version"
mappings loom.layered {
it.mappings("net.fabricmc:yarn:$project.yarn_mappings:v2")
it.mappings("dev.architectury:yarn-mappings-patch-neoforge:$project.yarn_mappings_patch_version")
}
neoForge "net.neoforged:neoforge:$project.neoforge_version"

modImplementation("com.terraformersmc:modmenu:${modmenu_version}") {
exclude group: 'net.fabricmc.fabric-api'
// Fetch the version of the fabric-api modules from the pom file
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just for the sake of JiJ-ing FFAPI, so that it can only JiJ the needed mods.
If it's instead preferred to let players supply FFAPI themselves, this can all be simplified to a modImplementation to the collective FFAPI dependency.

def moduleVer = [:]
ArtifactResolutionQuery query = dependencies.createArtifactResolutionQuery()
.forModule("org.sinytra.forgified-fabric-api", "forgified-fabric-api", project.fabric_version)
.withArtifacts(MavenModule, MavenPomArtifact)
ArtifactResolutionResult result = query.execute()
for (component in result.resolvedComponents) {
Set<ArtifactResult> mavenPomArtifacts = component.getArtifacts(MavenPomArtifact)
for (artifact in mavenPomArtifacts) {
def pom = new XmlSlurper().parse(artifact.file)
for (dependency in pom.dependencies.dependency) {
moduleVer.put(dependency.artifactId.toString(), dependency.version.toString())
}
}
}

modImplementation include("org.sinytra.forgified-fabric-api:fabric-api-base:${moduleVer['fabric-api-base']}")
modImplementation include("org.sinytra.forgified-fabric-api:fabric-resource-loader-v0:${moduleVer['fabric-resource-loader-v0']}")
modImplementation include("org.sinytra.forgified-fabric-api:fabric-model-loading-api-v1:${moduleVer['fabric-model-loading-api-v1']}")
modImplementation include("org.sinytra.forgified-fabric-api:fabric-renderer-api-v1:${moduleVer['fabric-renderer-api-v1']}")
modImplementation include("org.sinytra.forgified-fabric-api:fabric-renderer-indigo:${moduleVer['fabric-renderer-indigo']}")
modImplementation include("org.sinytra.forgified-fabric-api:fabric-block-view-api-v2:${moduleVer['fabric-block-view-api-v2']}")

modImplementation include("org.sinytra.forgified-fabric-api:fabric-lifecycle-events-v1:${moduleVer['fabric-lifecycle-events-v1']}")
modImplementation include("org.sinytra.forgified-fabric-api:fabric-networking-api-v1:${moduleVer['fabric-networking-api-v1']}")

modImplementation include("org.sinytra:fabric-loader:$project.loader_version")
}

processResources {
inputs.property 'version', project.version

filesMatching(['fabric.mod.json', 'META-INF/neoforge.mods.toml']) {
expand 'version': project.version
filesMatching('META-INF/neoforge.mods.toml') {
expand version: project.version
}
}

Expand Down
16 changes: 10 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
org.gradle.jvmargs = -Xmx1G
org.gradle.parallel = true

# Arch Loom Properties
loom.platform = neoforge
neoforge_version = 21.1.84
yarn_mappings_patch_version = 1.21+build.4

# Fabric Properties
loom_version = 1.6.11
minecraft_version = 1.21
yarn_mappings = 1.21+build.1
loader_version = 0.15.11
loom_version = 1.7-SNAPSHOT
minecraft_version = 1.21.1
yarn_mappings = 1.21.1+build.1

# Mod Properties
mod_version = 3.0.0
Expand All @@ -15,5 +19,5 @@ maven_group = me.pepperbell
archives_base_name = continuity

# Dependencies
fabric_version = 0.100.1+1.21
modmenu_version = 11.0.0-beta.1
fabric_version = 0.104.0+2.0.19+1.21.1
loader_version = 2.6.14+0.15.10+1.21
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.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
7 changes: 3 additions & 4 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
pluginManagement {
repositories {
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
}
maven { url "https://maven.fabricmc.net/" }
maven { url "https://maven.architectury.dev/" }
maven { url "https://maven.neoforged.net/releases" }
gradlePluginPortal()
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@

@Mixin(FallingBlockEntityRenderer.class)
abstract class FallingBlockEntityRendererMixin {
@Inject(method = "render(Lnet/minecraft/entity/FallingBlockEntity;FFLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/block/BlockModelRenderer;render(Lnet/minecraft/world/BlockRenderView;Lnet/minecraft/client/render/model/BakedModel;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;ZLnet/minecraft/util/math/random/Random;JI)V"))
@Inject(method = "render(Lnet/minecraft/entity/FallingBlockEntity;FFLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/block/BlockModelRenderer;tesselateBlock(Lnet/minecraft/world/BlockRenderView;Lnet/minecraft/client/render/model/BakedModel;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;ZLnet/minecraft/util/math/random/Random;JILnet/neoforged/neoforge/client/model/data/ModelData;Lnet/minecraft/client/render/RenderLayer;)V"))
private void continuity$beforeRenderModel(CallbackInfo ci) {
ContinuityFeatureStates states = ContinuityFeatureStates.get();
states.getConnectedTexturesState().disable();
states.getEmissiveTexturesState().disable();
}

@Inject(method = "render(Lnet/minecraft/entity/FallingBlockEntity;FFLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/block/BlockModelRenderer;render(Lnet/minecraft/world/BlockRenderView;Lnet/minecraft/client/render/model/BakedModel;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;ZLnet/minecraft/util/math/random/Random;JI)V", shift = At.Shift.AFTER))
@Inject(method = "render(Lnet/minecraft/entity/FallingBlockEntity;FFLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/block/BlockModelRenderer;tesselateBlock(Lnet/minecraft/world/BlockRenderView;Lnet/minecraft/client/render/model/BakedModel;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;ZLnet/minecraft/util/math/random/Random;JILnet/neoforged/neoforge/client/model/data/ModelData;Lnet/minecraft/client/render/RenderLayer;)V", shift = At.Shift.AFTER))
private void continuity$afterRenderModel(CallbackInfo ci) {
ContinuityFeatureStates states = ContinuityFeatureStates.get();
states.getConnectedTexturesState().enable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.util.function.IntPredicate;
import java.util.function.Predicate;

import net.fabricmc.fabric.api.blockview.v2.FabricBlockView;
import org.jetbrains.annotations.Nullable;

import me.pepperbell.continuity.api.client.ProcessingDataProvider;
Expand Down Expand Up @@ -84,7 +85,7 @@ public static class BiomeCache {
@Nullable
public Biome get(BlockRenderView blockView, BlockPos pos) {
if (invalid) {
biome = blockView.hasBiomes() ? blockView.getBiomeFabric(pos).value() : null;
biome = ((FabricBlockView)blockView).hasBiomes() ? ((FabricBlockView)blockView).getBiomeFabric(pos).value() : null;
invalid = false;
}
return biome;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package me.pepperbell.continuity.neoforge;

import me.pepperbell.continuity.client.ContinuityClient;
import me.pepperbell.continuity.client.config.ContinuityConfig;
import me.pepperbell.continuity.client.config.ContinuityConfigScreen;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.fml.ModContainer;
import net.neoforged.fml.common.Mod;
import net.neoforged.fml.loading.FMLEnvironment;
import net.neoforged.neoforge.client.gui.IConfigScreenFactory;

@Mod(value = ContinuityClient.ID, dist = Dist.CLIENT)
public class ContinuityNeoForge {

public ContinuityNeoForge(IEventBus eventBus, ModContainer container) {
if (!FMLEnvironment.dist.isClient()) return;

ContinuityClient continuityClient = new ContinuityClient();
continuityClient.onInitializeClient();

container.registerExtensionPoint(IConfigScreenFactory.class,
(ignored, parent) -> new ContinuityConfigScreen(parent, ContinuityConfig.INSTANCE));
}
}
10 changes: 2 additions & 8 deletions src/main/resources/META-INF/neoforge.mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ loaderVersion = "*"
license = "LGPL-3.0-only"
issueTrackerURL = "https://github.com/PepperCode1/Continuity/issues"

[properties]
"connector:placeholder" = true

[[mods]]
modId = "continuity"
version = "${version}"
Expand All @@ -20,8 +17,5 @@ displayURL = "https://modrinth.com/mod/continuity"
modId = "minecraft"
versionRange = "[1.21.1]"

[[dependencies.continuity]]
modId = "connector"

[[dependencies.continuity]]
modId = "fabric_api"
[[mixins]]
config = "continuity.mixins.json"