diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..efeaf6b --- /dev/null +++ b/build.gradle @@ -0,0 +1,134 @@ +plugins { + id 'fabric-loom' version '1.5.+' + id 'idea' + id 'maven-publish' + id 'com.modrinth.minotaur' version '2.+' + id 'io.freefair.lombok' version '8.+' + id 'com.github.johnrengelman.shadow' version '8.1.+' + id 'nebula.release' version '19.0.+' +} + +group = project.maven_group + +repositories { + // Add repositories to retrieve artifacts from in here. + // You should only use this when depending on other mods because + // Loom adds the essential maven repositories to download Minecraft and libraries from automatically. + // See https://docs.gradle.org/current/userguide/declaring_repositories.html + // for more information about repositories. + maven { url "https://maven.shedaniel.me/" } + maven { url "https://maven.terraformersmc.com/releases/" } + maven { + name = 'ParchmentMC' + url = 'https://maven.parchmentmc.org' + } + maven { + name "Modrinth"; url "https://api.modrinth.com/maven" + content { includeGroup "maven.modrinth" } + } + maven { + name "Modmaven" + url "https://modmaven.dev/" + // For Gradle 5.1 and above, limit it to just AE2 + content { + includeGroup 'appeng' + } + } + maven { + name = "Jitpack" + url = uri("https://jitpack.io/") + } +} +dependencies { + compileOnly("com.google.code.findbugs:jsr305:3.0.2") + // To change the versions see the gradle.properties file + minecraft "com.mojang:minecraft:${project.minecraft_version}" + mappings loom.layered() { + officialMojangMappings() + parchment("org.parchmentmc.data:parchment-1.20.1:${project.parchment_version}@zip") + } + modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" + + // Fabric API. This is technically optional, but you probably want it anyway. + modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}+${project.minecraft_version}" + + modImplementation ("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_version}"){ + exclude(group: "net.fabricmc.fabric-api") + } + modImplementation ("com.terraformersmc:modmenu:${project.modmenu_version}"){ + exclude(group: "net.fabricmc.fabric-api") + } + modImplementation("appeng:appliedenergistics2-fabric:${project.ae2_version}:api"){ + exclude(group: "net.fabricmc.fabric-api") + } + modImplementation("maven.modrinth:modern-industrialization:${project.mi_version}") { + exclude(group: "net.fabricmc.fabric-api") + } + include modApi("teamreborn:energy:${project.energy_version}") { + exclude(group: "net.fabricmc.fabric-api") + exclude group: "net.fabricmc", module: "fabric-loader" + } + implementation 'org.apache.commons:commons-text:1.11.0' +} + +def version = project.version.toString() + +processResources { + inputs.property "version", version + inputs.property "minecraft_version", project.minecraft_version + inputs.property "loader_version", project.loader_version + filteringCharset "UTF-8" + + filesMatching("fabric.mod.json") { + expand "version": version, + "minecraft_version": project.minecraft_version, + "loader_version": project.loader_version + } +} + +def targetJavaVersion = 17 +tasks.withType(JavaCompile).configureEach { + // ensure that the encoding is set to UTF-8, no matter what the system default is + // this fixes some edge cases with special characters not displaying correctly + // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html + // If Javadoc is generated, this must be specified in that task too. + it.options.encoding = "UTF-8" + if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) { + it.options.release.set(targetJavaVersion) + } +} + +java { + def javaVersion = JavaVersion.toVersion(targetJavaVersion) + if (JavaVersion.current() < javaVersion) { + toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion) + } + archivesBaseName = project.archives_base_name + // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task + // if it is present. + // If you remove this line, sources will not be generated. + withSourcesJar() +} + +jar { + from("LICENSE") { + rename { "${it}_${project.archivesBaseName}"} + } +} + +// configure the maven publication +publishing { + publications { + mavenJava(MavenPublication) { + from components.java + } + } + + // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. + repositories { + // Add repositories to publish to here. + // Notice: This block does NOT have the same function as the block in the top level. + // The repositories here will be used for publishing your artifact, not for + // retrieving dependencies. + } +} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..0eaa82c --- /dev/null +++ b/gradle.properties @@ -0,0 +1,21 @@ +# Done to increase the memory available to gradle. +org.gradle.jvmargs=-Xmx3G +org.gradle.parallel=true +org.gradle.daemon=false + +# Fabric Properties + # check these on https://modmuss50.me/fabric.html + minecraft_version=1.20.1 + loader_version=0.15.3 + parchment_version=2023.09.03 +# Mod Properties + maven_group = org.theomenden + archives_base_name = TheOmenDen.Solaris +# Dependencies + # check this on https://modmuss50.me/fabric.html + fabric_version=0.91.0 + modmenu_version=7.2.2 + cloth_version=11.1.118 + energy_version=3.0.0 + ae2_version=15.0.20 + mi_version=1.8.0 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..eb1dde3 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1 @@ +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..27e3d10 --- /dev/null +++ b/settings.gradle @@ -0,0 +1,10 @@ +pluginManagement { + repositories { + mavenCentral() + maven { + name = 'Fabric' + url = 'https://maven.fabricmc.net/' + } + gradlePluginPortal() + } +} diff --git a/src/main/java/org/theomenden/solaris/Solaris.java b/src/main/java/org/theomenden/solaris/Solaris.java new file mode 100644 index 0000000..77360f0 --- /dev/null +++ b/src/main/java/org/theomenden/solaris/Solaris.java @@ -0,0 +1,15 @@ +package org.theomenden.solaris; + +import net.fabricmc.api.ModInitializer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class Solaris implements ModInitializer { + + public static String MODID = "solaris"; + public static Logger LOGGER = LoggerFactory.getLogger(Solaris.class); + @Override + public void onInitialize() { + + } +} diff --git a/src/main/java/org/theomenden/solaris/client/SolarisClient.java b/src/main/java/org/theomenden/solaris/client/SolarisClient.java new file mode 100644 index 0000000..8feb1d7 --- /dev/null +++ b/src/main/java/org/theomenden/solaris/client/SolarisClient.java @@ -0,0 +1,4 @@ +package org.theomenden.solaris.client; + +public class SolarisClient { +} diff --git a/src/main/java/org/theomenden/solaris/registry/blocks/BlockRegistry.java b/src/main/java/org/theomenden/solaris/registry/blocks/BlockRegistry.java new file mode 100644 index 0000000..2c1481a --- /dev/null +++ b/src/main/java/org/theomenden/solaris/registry/blocks/BlockRegistry.java @@ -0,0 +1,5 @@ +package org.theomenden.solaris.registry.blocks; + +public final class BlockRegistry { + public static final +} diff --git a/src/main/java/org/theomenden/solaris/registry/fluids/EutecticFluid.java b/src/main/java/org/theomenden/solaris/registry/fluids/EutecticFluid.java new file mode 100644 index 0000000..b9d84b1 --- /dev/null +++ b/src/main/java/org/theomenden/solaris/registry/fluids/EutecticFluid.java @@ -0,0 +1,18 @@ +package org.theomenden.solaris.registry.fluids; + +import net.minecraft.world.level.Level; +import net.minecraft.world.level.material.FlowingFluid; +import net.minecraft.world.level.material.Fluid; +import org.jetbrains.annotations.NotNull; + +public abstract class EutecticFluid extends FlowingFluid { + @Override + public boolean isSame(@NotNull Fluid fluid) { + return fluid == getSource() || fluid == getFlowing(); + } + + @Override + protected boolean canConvertToSource(Level level) { + return false; + } +} diff --git a/src/main/java/org/theomenden/solaris/registry/items/ItemRegistry.java b/src/main/java/org/theomenden/solaris/registry/items/ItemRegistry.java new file mode 100644 index 0000000..d843958 --- /dev/null +++ b/src/main/java/org/theomenden/solaris/registry/items/ItemRegistry.java @@ -0,0 +1,19 @@ +package org.theomenden.solaris.registry.items; + +import net.fabricmc.fabric.api.item.v1.FabricItemSettings; +import net.minecraft.client.renderer.item.ItemProperties; +import net.minecraft.core.Registry; +import net.minecraft.core.registries.Registries; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.Rarity; +import org.intellij.lang.annotations.Identifier; + +public final class ItemRegistry { + public static final Item SOLARPANEL_ITEM =; + public static final Item TRACKING_SOLARPANEL_ITEM =; + public static final Item VERTICAL_SOLARPANEL_ITEM =; + + public static final Item MOLTEN_SILICON_VIAL_ITEM =; + public static final Item EUTECTIC_VIAL_ITEM =; +} diff --git a/src/main/resources/assets/solaris/icon.png b/src/main/resources/assets/solaris/icon.png new file mode 100644 index 0000000..c7d06df Binary files /dev/null and b/src/main/resources/assets/solaris/icon.png differ diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..6ed27c1 --- /dev/null +++ b/src/main/resources/fabric.mod.json @@ -0,0 +1,30 @@ +{ + "schemaVersion": 1, + "id": "solaris", + "version": "${version}", + "name": "Solaris", + "description": "", + "authors": [], + "contact": { + "repo": "https://github.com/andre/TheOmenDen.Solaris" + }, + "license": "LGPL-3.0", + "icon": "assets/solaris/icon.png", + "environment": "*", + "entrypoints": { + "client": [ + "org.theomenden.solaris.client.SolarisClient" + ], + "main": [ + "org.theomenden.solaris.Solaris" + ] + }, + "mixins": [ + "solaris.mixins.json" + ], + "depends": { + "fabricloader": ">=${loader_version}", + "fabric": "*", + "minecraft": "${minecraft_version}" + } +} diff --git a/src/main/resources/solaris.mixins.json b/src/main/resources/solaris.mixins.json new file mode 100644 index 0000000..d9bf999 --- /dev/null +++ b/src/main/resources/solaris.mixins.json @@ -0,0 +1,13 @@ +{ + "required": true, + "minVersion": "0.8", + "package": "org.theomenden.solaris.mixin", + "compatibilityLevel": "JAVA_17", + "mixins": [ + ], + "client": [ + ], + "injectors": { + "defaultRequire": 1 + } +}