Skip to content
Open

Dev #495

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
15 changes: 9 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
tags:
- "v*"

permissions:
issues: write

jobs:
build-release-upload:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -53,14 +56,14 @@ jobs:
run: cat discord_update.json

# Build the mod
- run: ./gradlew build
- name: build
run: ./gradlew build

- name: upload mod
run: node uploader.js
- name: publish
run: ./gradlew publishMods
env:
CF_TOKEN: ${{ secrets.CF_TOKEN }}
CF_COOKIE: ${{ secrets.CF_COOKIE }}
MODRINTH: ${{ secrets.MODRINTH }}
CURSEFORGE_TOKEN: ${{ secrets.CF_TOKEN }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH }}

- name: discord notification
run: |
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@

[?]
- fixed the size property breaking with slimes in 26.2
- fixed various texture layer issues
- fixed various block entity issues
- fixed various issues affecting EMF

[7.1]
- Both EMF & ESF will need to update to be compatible with this version *(expect about half an hour for EMF to update)*
- fixed immediatelyfast compat on 26.1+
Expand Down
114 changes: 103 additions & 11 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ plugins {
// You can also overwrite some of these if need be. See the `gg.essential.defaults.loom` README section.
// Otherwise you'll need to configure those as usual for (architectury) loom.
id("gg.essential.defaults")

id("me.modmuss50.mod-publish-plugin") version "2.0.0-beta.1"
}

//tasks.compileKotlin.setJvmDefault("all")
Expand All @@ -42,6 +44,7 @@ base.archivesName.set("entity_texture_features-$modVersion-${project.name}")

val manuallyAccessTransform = mcVersion >= 26_00_00 && platform.isNeoForge
val accessWidener = "entity_texture_features_" + when {
mcVersion >= 26_02_00 -> 15
mcVersion >= 26_01_00 -> 14
mcVersion >= 1_21_11 -> 13
mcVersion >= 1_21_09 -> 12
Expand Down Expand Up @@ -93,14 +96,13 @@ dependencies {
fun modImpl(modPrefix: String, vararg versions: Pair<Int, String?>): Boolean {
for ((versionMC, versionMod) in versions) {
if (platform.mcVersion >= versionMC) {
if (versionMod != null) {
return if (versionMod != null) {
modImplementation("$modPrefix$versionMod") {
exclude("net.fabricmc.fabric-api")
isTransitive = true
}
return true
}
break
true
} else false
}
}
return false
Expand All @@ -115,7 +117,8 @@ dependencies {
infix fun String.setVar(enabled: Boolean) = preprocess.vars.put(this, if (enabled) 1 else 0)

"3DSKINLAYERS" setVar modImpl("maven.modrinth:3dskinlayers:",
26_01_00 to null,
26_02_00 to null, // TODO
26_01_00 to ver("8kxiY3G1", null, null),
1_21_02 to ver("R1cL8Kvt", "lmgrljtK", "9V8JcyMQ"),
1_21_00 to ver("hRPGTUwZ", "Gx8v5lo4", "vj8UV3SS"),
1_20_06 to ver("SrazSQ8a", "CKyYI9pm", "eSgdmwEr"),
Expand All @@ -126,7 +129,9 @@ dependencies {

"SODIUM" setVar (
modImpl("maven.modrinth:sodium:",
26_01_00 to ver("Amr4VcZo", null, null),
26_02_00 to ver("3QgJXuSK", null, "5dWEDeL4"),
26_01_00 to ver("1rha2U1D", null, "I6y5LD6f"),
1_21_09 to ver("fVbw1C7i", null, "dfyNHRhw"),
1_21_05 to ver("fVbw1C7i", null, "dfyNHRhw"),
1_21_04 to ver("c3YkZvne", null, "XgEfENfn"),
1_21_03 to ver("rLBgU2jc", null, "M0CXIL7c"),
Expand All @@ -143,7 +148,8 @@ dependencies {

"IRIS" setVar (
modImpl("maven.modrinth:iris:",
26_01_00 to ver("4cGUAiJ6", null, null),
26_02_00 to ver("3uIIps8q", null, null),
26_01_00 to ver("MwcLS51S", null, "YEGDGnJM"),
//1_21_11 to ver("TSXvi2yD", null, "t3ruzodq"), //"k9tHcfnb"), //todo why does this break
1_21_06 to ver("l77DAK6U", null, "t3ruzodq"), //"xA5cxBvz"), // same here
1_21_05 to ver("U6evbjd0", null, "t3ruzodq"), //"KAopiPos"),
Expand All @@ -159,6 +165,7 @@ dependencies {
)

"IMMEDIATELYFAST" setVar modImpl("maven.modrinth:immediatelyfast:",
26_02_00 to null, // TODO
26_01_00 to ver("lRuSLf0Y", null, "KibcXkbk"),
1_21_06 to ver("9JPEk4KN", null, "d8kpGqVx"),
1_21_05 to ver("kcSoZlE9", null, "43iGBJDV"),
Expand All @@ -169,6 +176,7 @@ dependencies {

if (platform.isFabric) {
modImpl("maven.modrinth:modmenu:",
26_02_00 to "TLnEHUyx",
26_01_00 to "XIDyVLo7",
1_21_05 to "R7uVB42W",
1_21_02 to "PcJvQYqu",
Expand Down Expand Up @@ -271,18 +279,102 @@ tasks.processResources {
}
}

tasks.register<Copy>("copyArtifacts") {
tasks.register<Copy>("buildBulkJars") {
dependsOn(tasks.build)

from(layout.buildDirectory.dir("libs").get())
into("${rootDir}\\jars")
mustRunAfter(tasks.build)
delete(layout.buildDirectory.dir("libs").get())
}

private val versionRangeMap: Map<String, Array<String>> = mapOf(
"26.1" to arrayOf("26.1", "26.1.1", "26.1.2"),
"1.21.9" to arrayOf("1.21.9", "1.21.10"),
"1.21.6" to arrayOf("1.21.6", "1.21.7", "1.21.8"),
"1.21.3" to arrayOf("1.21.3", "1.21.2"),
"1.21" to arrayOf("1.21", "1.21.1"),
"1.20.1" to arrayOf("1.20.1", "1.20")
)

private val String.versionRange: Array<String>
get() = versionRangeMap[this] ?: arrayOf(this)

private fun changelog(): String? {
val lines = rootProject.rootDir.resolve("CHANGELOG.MD").readText(Charsets.UTF_8).lines()
val sb = StringBuilder()
var inside = false

for (rawLine in lines) {
val line = rawLine.trim()
if (line.startsWith("[")) {
if (line == "[$modVersion]") {
inside = true
continue
} else if (inside) {
// we've reached the next header after the section we wanted
break
} else {
// if first header wasn't the requested one
break
}
}
if (inside && line.isNotBlank()) {
sb.append(line).append("\n")
}
}

tasks.build {
finalizedBy("copyArtifacts")
if (sb.isEmpty()) null

return sb.toString()
}

publishMods {
val changes = changelog()
if (changes == null) {
println("No changelog entry found at top, assuming development build")
return@publishMods
}

// https://modmuss50.github.io/mod-publish-plugin/
file.set(
(if (platform.isUnobfuscated) tasks.jar
else tasks.named<net.fabricmc.loom.task.RemapJarTask>("remapJar"))
.get().archiveFile
)
changelog.set(changes)
type.set(STABLE)
val ver = "$modVersion-${platform.loaderStr}-${platform.mcVersionStr}"
version.set(ver)
when {
platform.isFabric -> {
modLoaders.add("fabric")
modLoaders.add("quilt")
}
platform.isForge -> {
modLoaders.add("forge")
}
platform.isNeoForge -> {
modLoaders.add("neoforge")
}
else -> {
throw UnsupportedOperationException()
}
}

displayName.set(ver)

curseforge {
projectId.set("568563")
accessToken.set(providers.environmentVariable("CURSEFORGE_TOKEN"))
minecraftVersions.addAll(*platform.mcVersionStr.versionRange)
clientRequired.set(true)
}
modrinth {
projectId.set("BVzZfTc1")
accessToken.set(providers.environmentVariable("MODRINTH_TOKEN"))
minecraftVersions.addAll(*platform.mcVersionStr.versionRange)
}
}

//region 26.1+ NEOFORGE ACCESS TRANSFORMER GENERATION

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ essential.defaults.loom.mappings=mojmap

loom.ignoreDependencyLoomVersionValidation=true

mod_version=7.1
mod_version=7.2
maven_group=traben.entity_texture_features
archives_base_name=entity_texture_features

Expand Down
5 changes: 3 additions & 2 deletions root.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
// Advanced users may use multiple (potentially independent) multi-version trees in different sub-projects.
// This is currently equivalent to applying `com.replaymod.preprocess-root`.
kotlin("jvm") version "2.3.0" apply false
id("gg.essential.loom") version "1.15.49" apply false // https://repo.essential.gg/#/public/gg/essential/loom/gg.essential.loom.gradle.plugin
id("gg.essential.loom") version "1.15.50" apply false // https://repo.essential.gg/#/public/gg/essential/loom/gg.essential.loom.gradle.plugin
id("gg.essential.multi-version.root")
}

Expand Down Expand Up @@ -58,7 +58,8 @@ preprocess {
// val fabric = createNode("26.1-fabric", 26_01_00, "mojmap")
// fabric.link(n)

null.connectToVersion(26_01_00, forge = false, neoforge = true)
null.connectToVersion(26_02_00, forge = false, neoforge = true)
.connectToVersion(26_01_00, forge = false, neoforge = true)
.connectToVersion(1_21_11)
.connectToVersion(1_21_09)
.connectToVersion(1_21_06)
Expand Down
3 changes: 2 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pluginManagement {
// We also recommend specifying your desired version here if you're using more than one of the plugins,
// so you do not have to change the version in multilpe places when updating.
plugins {
val egtVersion = "0.7.0-alpha.5"
val egtVersion = "0.7.2"
id("gg.essential.multi-version.root") version egtVersion
id("gg.essential.multi-version.api-validation") version egtVersion
}
Expand All @@ -39,6 +39,7 @@ fun MutableList<String>.version(mcVersion: Int, forge: Boolean = true, neoforge:
}

mutableListOf<String>()
.version(26_02_00, forge = false, neoforge = true)
.version(26_01_00, forge = false, neoforge = true)
.version(12111)
.version(12109)
Expand Down
1 change: 1 addition & 0 deletions src/main/java/traben/entity_texture_features/ETF.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public class ETF {
public static TConfigHandler<ETFConfigScreenWarnings.WarningConfig> warningConfigHandler = null;
public static boolean IRIS_DETECTED = false;
public static boolean FABRIC_API = false;
public static final int EYES_FEATURE_LIGHT_VALUE = ETFUtils2.FULL_BRIGHT + 1;

public static ETFEntityRenderState.ETFRenderStateInit etfRenderStateConstructor = (it)-> new ETFEntityRenderStateViaReference(it); // todo 1.21+ impl that doesn't smuggle entity

Expand Down
9 changes: 7 additions & 2 deletions src/main/java/traben/entity_texture_features/ETFApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.model.Model;
import net.minecraft.client.model.geom.ModelPart;
//#if MC < 26.2
import net.minecraft.client.renderer.MultiBufferSource;
//#endif

//#if MC >= 12103
import net.minecraft.client.renderer.entity.state.EntityRenderState;
//#endif
Expand All @@ -17,13 +20,13 @@
import traben.entity_texture_features.config.ETFConfigWarning;
import traben.entity_texture_features.config.ETFConfigWarnings;
import traben.entity_texture_features.features.ETFManager;
import traben.entity_texture_features.features.ETFRenderContext;
import traben.entity_texture_features.features.property_reading.PropertiesRandomProvider;
import traben.entity_texture_features.features.property_reading.TrueRandomProvider;
import traben.entity_texture_features.features.property_reading.properties.RandomProperties;
import traben.entity_texture_features.features.property_reading.properties.RandomProperty;
import traben.entity_texture_features.features.property_reading.properties.optifine_properties.BabyProperty;
import traben.entity_texture_features.features.state.ETFEntityRenderState;
import traben.entity_texture_features.features.state.ETFState;
import traben.entity_texture_features.features.state.HoldsETFRenderState;
import traben.entity_texture_features.features.texture_handlers.ETFTexture;
import traben.entity_texture_features.utils.ETFEntity;
Expand Down Expand Up @@ -294,6 +297,7 @@ public static ResourceLocation getCurrentETFEmissiveTextureOfBlockEntityOrNull(@
return null;
}

//#if MC < 26.2
/**
* To render your entity using its emissive textures you can simply call this method sometime after
* your entity model is rendered, but before you pop or modify the matrix stack
Expand Down Expand Up @@ -383,6 +387,7 @@ public static void renderETFEmissiveModelPart(
etfTexture.renderEmissive(matrixStack, vertexConsumerProvider, modelPart);
}
}
//#endif

/**
* This should only be used if you want to handle your own variation code.
Expand Down Expand Up @@ -463,7 +468,7 @@ static ETFApi.ETFVariantSuffixProvider getVariantProviderOrNull(ResourceLocation
//get optifine property provider or null
PropertiesRandomProvider optifine = PropertiesRandomProvider.of(propertiesFileIdentifier, vanillaIdentifier, suffixKeyName);
//get true random provider or null
TrueRandomProvider random = ETFRenderContext.isRandomLimitedToProperties() ? null : TrueRandomProvider.of(vanillaIdentifier);
TrueRandomProvider random = ETFState.onlyRandomizeViaPropertiesFiles ? null : TrueRandomProvider.of(vanillaIdentifier);

//try fallback property if null
if (optifine == null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package traben.entity_texture_features;

import net.minecraft.world.level.block.entity.BlockEntity;
import traben.entity_texture_features.features.ETFRenderContext;
import traben.entity_texture_features.features.state.ETFState;

public class ETFException extends RuntimeException {
public ETFException(String message) {
super(amendMessage(message));
}

private static String amendMessage(String message) {
var entity = ETFRenderContext.getCurrentEntityState();
var entity = ETFState.state();
return message + """

----------------------
Expand Down
Loading