Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minecraft 1.14 #129

Open
wants to merge 28 commits into
base: 1.12
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
cc275b0
gradle and mapping updates
maxanier Mar 4, 2020
9dafec7
Changes
maxanier Mar 20, 2020
a05d2c2
More updates.
maxanier Mar 20, 2020
15faf44
More updates II
maxanier Mar 21, 2020
00fea41
Almost ready to compile
maxanier Mar 22, 2020
901d67d
It compiles
maxanier Mar 22, 2020
81360c1
Modified book registration and content creation.
maxanier Mar 23, 2020
ac91743
WIP recipe rework (all recipes can now be json recipes)
maxanier Mar 28, 2020
1001aa9
Fix api and test package
maxanier Mar 28, 2020
55cd3c5
Finish recipe rework
maxanier Mar 28, 2020
42c1d7f
Extract ingredient cycling function for general purposes
maxanier Mar 28, 2020
a0ba8de
Remove crafting recipe functions for books.
maxanier Mar 28, 2020
ebddbd3
Fix search
maxanier Mar 31, 2020
8bcda6e
Fix localization
maxanier Mar 31, 2020
1227fac
Fix models.
maxanier Mar 31, 2020
9cfa7fa
Remove unicode flag.
maxanier Mar 31, 2020
aeb6f23
Cleanup and fixes
maxanier Apr 3, 2020
b756bb1
Open stored screen.
maxanier Apr 3, 2020
0923767
Delay book content initialization until the book is first used.
maxanier Apr 3, 2020
c8575f1
Add a debug way to reload a book without having to restart the game
maxanier Apr 3, 2020
325afb7
Increase book width.
maxanier Apr 7, 2020
7829bee
Properly update config system to also handle per book configuration
maxanier Apr 8, 2020
7a9f609
Format code and cleanup imports
maxanier Apr 8, 2020
192f2ed
Include #35 and #104
maxanier Apr 8, 2020
51e329d
Removed unused customModel book property
maxanier Apr 8, 2020
fa32265
Properly handle newlines in pagesForLongText
maxanier Apr 8, 2020
adfb34d
Fix home screen rendering position
maxanier Apr 12, 2020
6d087cc
Remove unnecessary bus registration
maxanier Apr 25, 2020
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
121 changes: 89 additions & 32 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
buildscript {
repositories {
mavenCentral()
maven { url = "http://files.minecraftforge.net/maven" }
maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" }
jcenter()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
}


dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
}
}


plugins {
id 'com.matthewprenger.cursegradle' version '1.1.2'
id "net.minecraftforge.gradle.forge" version "2.0.2"
id 'com.matthewprenger.cursegradle' version '1.2.0'
}

apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'

def build_number = 'CUSTOM'
Expand All @@ -23,46 +31,96 @@ if (System.getenv('BUILD_NUMBER') != null)

group = package_group
archivesBaseName = mod_name
version = "${mc_version}-${mod_version}-${build_number}"
version = "${minecraft_version}-${mod_version}-${build_number}"

repositories {
maven { url = "http://dvs1.progwml6.com/files/maven" }
}

dependencies {
deobfCompile "mezz.jei:jei_${mc_version}:${jei_version}"
minecraft([
group: "net.minecraftforge",
name: "forge",
version: "${project.minecraft_version}-${project.forge_version}"
])
compileOnly fg.deobf("mezz.jei:jei-${project.minecraft_version}:${project.jei_version}:api") //API for compile
runtimeOnly fg.deobf("mezz.jei:jei-${project.minecraft_version}:${project.jei_version}") //Full for runtime
//runtimeClasspath 'com.electronwill.night-config:hocon:3.6.2'
}

sourceSets {

main {
java {
srcDirs = ["$rootDir/src/main/java"]
}
resources {
srcDirs = [
"$rootDir/src/main/resources"
]
}
}
}


minecraft {
version = "${mc_version}-${forge_version}"
runDir = "run"
mappings channel: "${project.mcp_channel}".toString(), version: "${project.mcp_mappings}".toString()
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')

runs {
client {
taskName 'runClient1'
main 'net.minecraftforge.userdev.LaunchTesting'
property 'forge.logging.console.level', 'debug'
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
workingDirectory project.file('run/client1').canonicalPath

mods {
guideapi {
source sourceSets.main
}
}

replace "@VERSION@", project.version
replaceIn "GuideMod.java"
replace "@API_VERSION@", "${api_version}"
replaceIn "package-info.java"
}
server = {
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'
workingDirectory project.file('run/server').canonicalPath

mods {
guideapi {
source sourceSets.main
}

}
}
}

if (project.hasProperty('mappings_version'))
mappings = project.mappings_version
}



processResources {
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
inputs.property "version", project.mod_version

from(sourceSets.main.resources.srcDirs) {
include '**/*.info'
include '**/*.properties'
include 'META-INF/mods.toml'

expand 'version': project.version, 'mcversion': project.minecraft.version
expand 'version': project.mod_version, 'mcversion': minecraft_version, 'forge_version': forge_version
}

from(sourceSets.main.resources.srcDirs) {
exclude '**/*.info'
exclude '**/*.properties'
exclude 'META-INF/mods.toml'
}
}

jar {
//Keep the jar as clean as possible
includeEmptyDirs = false

from sourceSets.main.output.classesDirs
from sourceSets.main.output.resourcesDir

classifier = ''
manifest.mainAttributes(
"Built-By": System.getProperty('user.name'),
Expand All @@ -73,15 +131,7 @@ jar {
exclude 'amerifrance/guideapi/test/**/*'
}

// API jar
task apiJar(type: Jar) {
from sourceSets.main.allSource
from sourceSets.main.output
include 'amerifrance/guideapi/api/**/*'
classifier = 'api'
}

tasks.build.dependsOn apiJar

tasks.withType(JavaCompile) { task ->
task.options.encoding = 'UTF-8'
Expand All @@ -92,7 +142,6 @@ publishing {
publications {
mavenJava(MavenPublication) {
artifact jar
artifact sourceJar
}
}
repositories {
Expand Down Expand Up @@ -140,6 +189,14 @@ curseforge {
changelog = getChangelogText()
releaseType = 'beta'

addArtifact sourceJar
}
}

idea {
module {
for (String excludeDirName in ["run", "out", "logs", "gradle"]) {
File excludeDir = new File(projectDir, excludeDirName)
excludeDirs.add(excludeDir)
}
}
}
16 changes: 10 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
org.gradle.daemon=false
org.gradle.jvmargs=-Xmx3G

mod_name=Guide-API
package_group=info.amerifrance.guideapi

mc_version=1.12
forge_version=14.21.1.2443
mappings_version=snapshot_20170819
minecraft_version=1.14.4
forge_version=28.2.0
mcp_mappings=58-1.14.4
mcp_channel=stable

mod_version=2.1.8
api_version=2.0.0
mod_version=2.2.0
api_version=2.2.0
curse_id=228832

jei_version=4.7.1.69
jei_version=6.0.0.13
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip
47 changes: 0 additions & 47 deletions src/main/java/amerifrance/guideapi/ConfigHandler.java

This file was deleted.

52 changes: 52 additions & 0 deletions src/main/java/amerifrance/guideapi/GuideConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package amerifrance.guideapi;


import amerifrance.guideapi.api.GuideAPI;
import amerifrance.guideapi.api.impl.Book;
import net.minecraftforge.common.ForgeConfigSpec;
import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.config.ModConfig;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import org.apache.commons.lang3.tuple.Pair;

import java.util.HashMap;
import java.util.Map;

public class GuideConfig {

/**
* For side independent configuration. Not synced.
* Loaded after registry events but before setup
*/
public static Common COMMON;

public static class Common {

public final ForgeConfigSpec.BooleanValue canSpawnWithBook;

public final ForgeConfigSpec.BooleanValue enableLogging;
public final Map<Book, ForgeConfigSpec.BooleanValue> SPAWN_BOOKS = new HashMap<>();


Common(ForgeConfigSpec.Builder builder) {
builder.comment("Common configurations settings").push("common");
enableLogging = builder.comment("Enables extra information being printed to the console.").define("enableLogging", true);
canSpawnWithBook = builder.comment("Allows books to spawn with new players.\nThis is a global override for all books if set to false.").define("canSpawnWithBook", true);
builder.comment("If the player should spawn with this book").push("spawnBook");
for (Book book : GuideAPI.getBooks().values()) {
SPAWN_BOOKS.put(book, builder.define(book.getRegistryName().getNamespace() + "-" + book.getRegistryName().getPath(), book.shouldSpawnWithBook()));
}
builder.pop();
builder.pop();
}
}

public static void buildConfiguration() {
final Pair<Common, ForgeConfigSpec> specPair = new ForgeConfigSpec.Builder().configure(Common::new);
ForgeConfigSpec commonSpec = specPair.getRight();
COMMON = specPair.getLeft();
ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, commonSpec);
FMLJavaModLoadingContext.get().getModEventBus().register(GuideConfig.class);
}

}
Loading