Skip to content

Commit

Permalink
Mass Update to 1.4.0
Browse files Browse the repository at this point in the history
---

Signed-off-by: AterAnimAvis <AterAnimAvis@gmail.com>
  • Loading branch information
AterAnimAvis committed Nov 11, 2020
1 parent d9e4cb8 commit 0c41196
Show file tree
Hide file tree
Showing 105 changed files with 3,092 additions and 1,346 deletions.
87 changes: 0 additions & 87 deletions build.gradle

This file was deleted.

141 changes: 141 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
/*================================================================================================== BuildScript ==== */
buildscript {
repositories {
maven(url = "https://files.minecraftforge.net/maven")
jcenter()
mavenCentral()
}

dependencies {
classpath(group = "net.minecraftforge.gradle", name = "ForgeGradle", version = "3.+") {
isChanging = true
}
}
}

/*========================================================================================== Config -> Minecraft ==== */
val forgeVersion: String by extra
val mappingsChannel: String by extra
val mappingsVersion: String by extra
val minecraftVersion: String by extra

/*================================================================================================ Config -> Mod ==== */
val modId: String by extra
val modVersion: String by extra
val modGroup: String by extra
val vendor: String by extra

/*========================================================================================= Config -> Run Config ==== */
val level: String by extra
val markers: String by extra

/*======================================================================================= Config -> Dependencies ==== */
val jetbrainsAnnotationVersion: String by extra

/*================================================================================== Config -> Test Dependencies ==== */
val junitVersion: String by extra

/*====================================================================================================== Plugins ==== */
plugins {
`java-library`
}

apply(plugin = "net.minecraftforge.gradle")

/*========================================================================================= Minecraft Dependency ==== */

/* Note: Due to the way kotlin gradle works we need to define the minecraft dependency before we configure Minecraft */
dependencies {
"minecraft"(group = "net.minecraftforge", name = "forge", version = "$minecraftVersion-$forgeVersion")
}

/*==================================================================================================== Minecraft ==== */

minecraft {
mappingChannel = mappingsChannel
mappingVersion = mappingsVersion

runs {
config("client")
config("server")

// config("data") {
// args("--mod", modId, "--all", "--output", file("src/generated/resources/"))
// }
}
}

/*======================================================================================================== Setup ==== */
project.group = modGroup
project.version = "$minecraftVersion-$modVersion"

/* Java 8 Target + Parameter Names */
tasks.withType<JavaCompile> {
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
options.compilerArgs.add("-parameters")
}

/* Finalize the jar by Reobf */
tasks.named<Jar>("jar") {
finalizedBy("reobfJar")
}

/* Manifest */
tasks.withType<Jar> {
manifest {
attributes(
"Specification-Title" to modId,
"Specification-Vendor" to vendor,
"Specification-Version" to modVersion,
"Implementation-Title" to project.name,
"Implementation-Version" to project.version,
"Implementation-Vendor" to vendor,
"Implementation-Timestamp" to Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
)
}
}

/* Generate Package Infos */
apply(from = "utils.gradle.kts")

/*================================================================================================= Dependencies ==== */

dependencies {
/* JUnit 5 */
testImplementation(group = "org.junit.jupiter", name = "junit-jupiter", version = junitVersion)

/* Jetbrains Annotations */
implementation(group = "org.jetbrains", name = "annotations", version = jetbrainsAnnotationVersion)
}

/*==================================================================================================== Utilities ==== */

typealias Date = java.util.Date
typealias SimpleDateFormat = java.text.SimpleDateFormat

fun Date.format(format: String) = SimpleDateFormat(format).format(this)

typealias RunConfig = net.minecraftforge.gradle.common.util.RunConfig
typealias UserDevExtension = net.minecraftforge.gradle.userdev.UserDevExtension

typealias RunConfiguration = RunConfig.() -> Unit

fun minecraft(configuration: UserDevExtension.() -> Unit) =
configuration(extensions.getByName("minecraft") as UserDevExtension)

fun NamedDomainObjectContainerScope<RunConfig>.config(name: String, additionalConfiguration: RunConfiguration = {}) {
val runDirectory = project.file("run")
val sourceSet = the<JavaPluginConvention>().sourceSets["main"]

create(name) {
workingDirectory(runDirectory)
property("forge.logging.markers", markers)
property("forge.logging.console.level", level)
environment("MOD_VERSION", modVersion)

additionalConfiguration(this)

mods { create(modId) { source(sourceSet) } }
}
}
33 changes: 31 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,31 @@
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false
################################## Intellij ###################################
# suppress inspection "UnusedProperty" for whole file

################################### Gradle ####################################
# Default Memory for Gradle Commands. Required for Minecraft de-compilation
org.gradle.jvmargs =-Xmx3G
# ForgeGradle shouldn't be run as a Daemon.
org.gradle.daemon =false

################################## Minecraft ##################################
forgeVersion =32.0.108
mappingsChannel =snapshot
mappingsVersion =20200820-1.16.1
minecraftVersion =1.16.1

##################################### Mod #####################################
modId =block_renderer
modVersion =1.4.0
modGroup =com.unascribed
vendor =AterAnimAvis

################################# Run Config ##################################
level =debug
markers =NONE
defaultMarkers =SCAN,REGISTRIES,REGISTRYDUMP

################################ Dependencies #################################
jetbrainsAnnotationVersion=20.1.+

############################## Test Dependencies ##############################
junitVersion =5.6.+
7 changes: 3 additions & 4 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Tue Apr 28 18:20:48 BST 2020
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip
distributionUrl =https\://services.gradle.org/distributions/gradle-5.3-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath =wrapper/dists
zipStoreBase =GRADLE_USER_HOME
9 changes: 5 additions & 4 deletions src/main/java/com/unascribed/blockrenderer/BlockRenderer.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.unascribed.blockrenderer;

import com.unascribed.blockrenderer.proxy.ClientProxy;
import com.unascribed.blockrenderer.client.proxy.ClientProxy;
import com.unascribed.blockrenderer.proxy.CommonProxy;
import com.unascribed.blockrenderer.proxy.DedicatedProxy;
import net.minecraftforge.fml.DistExecutor;
Expand All @@ -18,14 +18,15 @@
@Mod(Reference.MOD_ID)
public class BlockRenderer {

public static final Logger LOGGER = LogManager.getLogger("BlockRenderer");
public static final Logger LOGGER = LogManager.getLogger(Reference.NAME);

public static CommonProxy proxy;
public static CommonProxy proxy = DistExecutor.safeRunForDist(() -> ClientProxy::new, () -> DedicatedProxy::new);

public BlockRenderer() {
proxy = DistExecutor.safeRunForDist(() -> ClientProxy::new, () -> DedicatedProxy::new);
proxy.init();

LOGGER.info("Running Version: " + Reference.VERSION);

registerDisplayTest(ModLoadingContext.get());
}

Expand Down
8 changes: 7 additions & 1 deletion src/main/java/com/unascribed/blockrenderer/Reference.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
package com.unascribed.blockrenderer;

import net.minecraftforge.fml.loading.FMLEnvironment;
import net.minecraftforge.fml.loading.JarVersionLookupHandler;

public interface Reference {

String MOD_ID = "block_renderer";
String NAME = "BlockRenderer";
String VERSION = "1.2.0";

String VERSION = JarVersionLookupHandler.getSpecificationVersion(Reference.class).orElseGet(() -> System.getenv("MOD_VERSION"));

boolean isDebug = !FMLEnvironment.production;

}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.unascribed.blockrenderer.init;
package com.unascribed.blockrenderer.client.init;

import net.minecraft.client.settings.KeyBinding;
import net.minecraftforge.api.distmarker.Dist;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@NonnullDefault
package com.unascribed.blockrenderer.client.init;

import org.lwjgl.system.NonnullDefault;
Loading

0 comments on commit 0c41196

Please sign in to comment.