Skip to content

Commit

Permalink
1.21.1
Browse files Browse the repository at this point in the history
  • Loading branch information
UnRealDinnerbone committed Aug 11, 2024
1 parent 034e4c8 commit e1eb0d7
Show file tree
Hide file tree
Showing 11 changed files with 166 additions and 103 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
### 6.0.3
### 6.1.0

- Add lang keys
- 1.21.1 & Bee Compact
92 changes: 6 additions & 86 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
plugins {
id("dev.nanite.mlp") version("0.1.10")
id("dev.nanite.mlp") version("0.3.0")
id("java-library")
id("maven-publish")
id("me.modmuss50.mod-publish-plugin") version "0.3.0"
id 'org.jetbrains.gradle.plugin.idea-ext' version '1.0'
}


Expand All @@ -12,89 +13,14 @@ multiLoader.root() {
minecraftVersion.set(project.property("minecraft_version"))
modID.set(project.property("mod_id"))
splitSources.set(true)
convertAccessWidener.set(true)
accessWidenerFile.set(project(":common").file("src/main/resources/${mod_id}.accesswidener"))

group.set(project.property("maven_group"))
dataGen {
useFabric.set(project(":common").file("src/generated/resources"))
}
}

allprojects {
def isSnapshot = providers.environmentVariable("SNAPSHOT").map {it == "true"}.getOrElse(false)
version = "${mod_version}+mc${minecraft_version}${isSnapshot ? '-SNAPSHOT' : ''}"
setArchivesBaseName("${mod_name}-${project.name}".toLowerCase())
group = "com.unrealdinnerbone"


}

subprojects {


apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply plugin: 'dev.nanite.mlp'


sourceSets.main.resources.srcDir project.file('src/generated/resources')

java.toolchain.languageVersion = JavaLanguageVersion.of(21)


base {
archivesName = "${project.property("mod_name")}-${project.name}".toLowerCase()
}
repositories {
maven {
name = "NeoForge"
url = "https://maven.neoforged.net/"
}
maven {
name = "Fabric"
url = "https://maven.fabricmc.net/"
}
maven {
name = "Nanite"
url = "https://maven.nanite.dev/releases"
}
maven {
name = "Mek"
url = 'https://modmaven.dev/'
}

}
tasks.withType(ProcessResources).configureEach {
outputs.upToDateWhen { false }
}

test {
enabled = false
}

publishing {
repositories {
if (providers.environmentVariable("NANITE_TOKEN").isPresent()) {
maven {
def isSnapshot = providers.environmentVariable("SNAPSHOT").map {it == "true"}.getOrElse(false)
url "https://maven.nanite.dev/${isSnapshot ? 'snapshots' : 'releases'}"
credentials {
username = "nanite"
password = providers.environmentVariable("NANITE_TOKEN").get()
}
}
}
}
publications {
register("mavenJava", MavenPublication) {
groupId project.group
artifactId project.getArchivesBaseName()
}
}
}


}


publishMods {
dryRun = providers.environmentVariable("CURSE_TOKEN").getOrNull() == null
Expand All @@ -108,6 +34,7 @@ publishMods {
modLoaders.add("fabric")
}


def neoOptions = publishOptions {
file = project.provider { project(":neo").tasks.jar }.flatMap { it.archiveFile }
displayName = "${project.name} Neo ${mod_version}+mc${minecraft_version}"
Expand All @@ -119,9 +46,6 @@ publishMods {
accessToken = providers.environmentVariable("CURSE_TOKEN")
projectId = "${curse_id}"
minecraftVersions.add("${minecraft_version}")
requires {
slug = "trenzalore"
}
}

curseforge("curseforgeFabric") {
Expand All @@ -135,8 +59,4 @@ publishMods {
from(curseForgeOptions, neoOptions)
}

}




}
3 changes: 3 additions & 0 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
plugins {
id 'groovy-gradle-plugin'
}
77 changes: 77 additions & 0 deletions buildSrc/src/main/groovy/multiloader.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
plugins {
id 'java-library'
id 'maven-publish'
id 'dev.nanite.mlp'
}

java.toolchain.languageVersion = JavaLanguageVersion.of(21)

def isASnapshot = providers.environmentVariable("SNAPSHOT").map {it == "true"}.getOrElse(false)
version = "${mod_version}+mc${minecraft_version}${isASnapshot ? '-SNAPSHOT' : ''}"
setArchivesBaseName("${mod_name}-${project.name}".toLowerCase())
group = "${maven_group}"

idea {
module {
downloadSources = true
downloadJavadoc = true
}
}

base {
archivesName = "${project.property("mod_name")}-${project.name}".toLowerCase()
}

repositories {
repositories {
maven {
name = "NeoForge"
url = "https://maven.neoforged.net/"
}
maven {
name = "Fabric"
url = "https://maven.fabricmc.net/"
}
maven {
name = "Nanite"
url = "https://maven.nanite.dev/releases"
}
maven {
name = "Mek"
url = 'https://modmaven.dev/'
}
maven {
name = "Curse Maven"
url = "https://cursemaven.com"
}
}
}

tasks.withType(ProcessResources).configureEach {
outputs.upToDateWhen { false }
}

test {
enabled = false
}

publishing {
repositories {
if (providers.environmentVariable("NANITE_TOKEN").isPresent()) {
maven {
def isSnapshot = providers.environmentVariable("SNAPSHOT").map {it == "true"}.getOrElse(false)
url "https://maven.nanite.dev/${isSnapshot ? 'snapshots' : 'releases'}"
credentials {
username = "nanite"
password = providers.environmentVariable("NANITE_TOKEN").get()
}
}
}
}
publications {
register("mavenJava", MavenPublication) {
groupId project.group
artifactId project.getArchivesBaseName()
}
}
}
4 changes: 4 additions & 0 deletions common/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
plugins {
id 'multiloader'
}

multiLoader.common()

publishing.publications.mavenJava.from components.java
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,14 @@ public class FeatureTypeRegistry {
private static final Logger LOGGER = LogManager.getLogger();
public static final Map<ResourceLocation, IFeatureTypeCompact<?>> FEATURES = new HashMap<>();

public static void register(String modId, List<String> ids, Supplier<IFeatureTypeCompact<?>> featureTypeCompact) {
ids.forEach(id -> register(modId, id, featureTypeCompact));
}

public static void register(String modId, String id, Supplier<IFeatureTypeCompact<?>> featureTypeCompact) {
register(modId, RLUtils.rl(modId, id), featureTypeCompact);
}

public static void register(String modId, ResourceLocation id, Supplier<IFeatureTypeCompact<?>> featureTypeCompact) {
if (Services.PLATFORM.isModLoaded(modId)) {
IFeatureTypeCompact<?> iFeatureTypeCompact = featureTypeCompact.get();
Expand Down
12 changes: 6 additions & 6 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
plugins {
id 'multiloader'
}

multiLoader.fabric() {
fabricLoaderVersion.set("${fabric_loader_version}")
fabricApiVersion.set("${fabric_version}")
}

publishing.publications.mavenJava.from components.java

dependencies {
modImplementation("com.unrealdinnerbone:trenzalore-fabric:${project.property("trenzalore_version")}+mc${project.property("minecraft_version")}")
}


publishing.publications.mavenJava.from components.java

remapJar {
setArchivesBaseName("${project.property("mod_name")}-${project.name}".toLowerCase())
}
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Project
mod_version=5.0.3
mod_version=5.1.0
maven_group=com.unrealdinnerbone
curse_id=422981
mod_name=JAMD
Expand All @@ -8,23 +8,23 @@ mod_id=jamd


# Common
minecraft_version=1.21
minecraft_version=1.21.1

# Forge
#forge_version=49.0.13

neo_version=21.0.9-beta
neo_version=21.1.4

fabric_version=0.100.1+1.21
fabric_version=0.102.0+1.21.1
fabric_loader_version=0.15.11

# Other
trenzalore_version=6.0.0
trenzalore_version=6.1.0

# Gradle
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false


#Mekanism
mekanism_version=1.21-10.6.0.44
mekanism_version=1.21-10.6.7.54
12 changes: 10 additions & 2 deletions neo/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
plugins {
id 'multiloader'
}

multiLoader.neo() {
neoVersion.set("${neo_version}")
}

publishing.publications.mavenJava.from components.java

sourceSets.main.resources { srcDir project(":common").file('src/generated/resources') }


dependencies {
implementation("com.unrealdinnerbone:trenzalore-neo:${project.property("trenzalore_version")}+mc${project.property("minecraft_version")}")

api "mekanism:Mekanism:${mekanism_version}"
api "curse.maven:productivebees-377897:5611632"
// api "blusunrize.immersiveengineering:ImmersiveEngineering:${immersive_engineering_version}"
}

publishing.publications.mavenJava.from components.java

21 changes: 20 additions & 1 deletion neo/src/main/java/com/unrealdinnerbone/jamd/neo/JAMDNeo.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@
import com.unrealdinnerbone.jamd.api.FeatureTypeRegistry;
import com.unrealdinnerbone.jamd.command.JamdCommand;
import com.unrealdinnerbone.jamd.neo.compact.MekenismOreCompact;
import com.unrealdinnerbone.jamd.neo.compact.PBCompact;
import net.neoforged.fml.common.Mod;
import net.neoforged.neoforge.common.NeoForge;
import net.neoforged.neoforge.event.RegisterCommandsEvent;
import net.neoforged.neoforge.event.server.ServerStartingEvent;

import java.util.List;

@Mod(JAMD.MOD_ID)
public class JAMDNeo {

Expand All @@ -21,7 +24,23 @@ public JAMDNeo() {

public static void registerCompact() {
FeatureTypeRegistry.register("mekanism", "ore", MekenismOreCompact::new);
// FeatureTypeRegistry.register("immersiveengineering", "ie_ore", IECompact::new);
FeatureTypeRegistry.register("productivebees", List.of(
"sand_nest",
"snow_nest",
"stone_nest",
"coarse_dirt_nest",
"gravel_nest",
"slimy_nest",
"sugar_cane_nest",
"glowstone_nest",
"nether_quartz_nest",
"nether_quartz_nest_high",
"nether_fortress_nest",
"soul_sand_nest",
"end_nest",
"obsidian_pillar_nest",
"bumble_bee_nest"
), PBCompact::new);
}

public void onRegisterCommands(RegisterCommandsEvent event) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.unrealdinnerbone.jamd.neo.compact;

import com.unrealdinnerbone.jamd.OresCodec;
import com.unrealdinnerbone.jamd.api.IFeatureTypeCompact;
import net.minecraft.world.level.levelgen.VerticalAnchor;
import net.minecraft.world.level.levelgen.feature.configurations.ReplaceBlockConfiguration;
import net.minecraft.world.level.levelgen.placement.BiomeFilter;
import net.minecraft.world.level.levelgen.placement.CountPlacement;
import net.minecraft.world.level.levelgen.placement.HeightRangePlacement;
import net.minecraft.world.level.levelgen.placement.InSquarePlacement;
import net.minecraft.world.level.levelgen.placement.PlacementModifier;

import java.util.ArrayList;
import java.util.List;

public class PBCompact implements IFeatureTypeCompact<ReplaceBlockConfiguration> {

@Override
public OresCodec parse(ReplaceBlockConfiguration value, List<PlacementModifier> placementModifiers) {
List<PlacementModifier> newPlacementModifiers = new ArrayList<>(placementModifiers);
newPlacementModifiers.add(CountPlacement.of(2));
newPlacementModifiers.add(HeightRangePlacement.uniform(VerticalAnchor.absolute(0), VerticalAnchor.absolute(60)));
newPlacementModifiers.add(InSquarePlacement.spread());
newPlacementModifiers.add(BiomeFilter.biome());
return new OresCodec(4, 0, newPlacementModifiers, value.targetStates);
}
}

0 comments on commit e1eb0d7

Please sign in to comment.