Skip to content

Commit

Permalink
Updated toolchain, fixed security and bumped mappings and forge version
Browse files Browse the repository at this point in the history
  • Loading branch information
EwyBoy committed Jun 2, 2021
1 parent ed0c2a5 commit 1da6c91
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 91 deletions.
99 changes: 35 additions & 64 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,33 +1,39 @@
buildscript {
repositories {
maven { url = 'https://files.minecraftforge.net/maven' }
jcenter()
maven { url = 'https://repo.spongepowered.org/repository/maven-public/' }
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '4.1.+', changing: true
classpath group: 'org.spongepowered', name: 'mixingradle', version: '0.7-SNAPSHOT'
}
}

plugins {
id 'com.matthewprenger.cursegradle' version '1.4.0'
}

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

version = "${MC_VERSION}-${VERSION}"
group = "com.ewyboy.${MODID}"
archivesBaseName = MODNAME

sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'
java.toolchain.languageVersion = JavaLanguageVersion.of(8)

minecraft {
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))

minecraft {
apply plugin: 'idea'
mappings channel: MCP_CHANNEL, version: MCP_MAPPINGS

runs {
client {
workingDirectory project.file('run')
ideaModule "${rootProject.name}.${project.name}.main"

property 'fml.earlyprogresswindow', 'false'
mods {
bibliotheca {
source sourceSets.main
Expand All @@ -37,8 +43,6 @@ minecraft {

server {
workingDirectory project.file('run')
ideaModule "${rootProject.name}.${project.name}.main"

mods {
bibliotheca {
source sourceSets.main
Expand All @@ -48,9 +52,6 @@ minecraft {

data {
workingDirectory project.file('run')
args '--mod', 'biblibtest', '--all', '--output', file('src/generated/resources/')
ideaModule "${rootProject.name}.${project.name}.main"

mods {
bibliotheca {
source sourceSets.main
Expand All @@ -61,82 +62,52 @@ minecraft {
}

repositories {
mavenLocal()
maven {
// Hwyla
url "https://www.cursemaven.com"
content {
includeGroup "curse.maven"
}
}
maven {
name "tehnut"
url "https://maven.tehnut.info"
}
}

sourceSets.main.resources { srcDir 'src/generated/resources' }

dependencies {
minecraft "net.minecraftforge:forge:${MC_VERSION}-${FORGE_VERSION}"

compileOnly fg.deobf("mcp.mobius.waila:Hwyla:${HWYLA_VERSION}:api")
runtimeOnly fg.deobf("mcp.mobius.waila:Hwyla:${HWYLA_VERSION}")
}

jar {
manifest {
attributes([
"Specification-Title": MODNAME,
"Specification-Vendor": AUTHOR,
"Specification-Version": "1",
"Implementation-Title": project.name,
"Implementation-Version": VERSION,
"Implementation-Vendor" : AUTHOR,
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
"Specification-Title" : MODNAME,
"Specification-Vendor" : AUTHOR,
"Specification-Version" : "1",
"Implementation-Title" : project.name,
"Implementation-Version" : VERSION,
"Implementation-Vendor" : AUTHOR,
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}

task deobfJar(type: Jar) {
from sourceSets.main.output
classifier = 'deobf'
}

task sourcesJar(type: Jar) {
classifier = "sources"
from sourceSets.main.allJava
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = "javadoc"
from javadoc.destinationDir
}

tasks.build.dependsOn('sourcesJar', 'deobfJar')
tasks.publish.dependsOn('build', 'reobfJar')

artifacts {
archives jar
archives deobfJar
archives sourcesJar
}
jar.finalizedBy('reobfJar')

publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/ewyboy/bibliotheca")
credentials {
username = property('gpr.username')
password = property('gpr.token')
}
}
maven {
name = "local"
url "file:///${rootProject.projectDir}/mcmodsrepo"
}
}
publications {
gpr(MavenPublication) {
artifact jar
artifact sourcesJar
}
mavenJava(MavenPublication) {
artifact jar
artifact sourcesJar
}
}
}
repositories {
maven {
url "file:///${project.projectDir}/mcmodsrepo"
}
}
}

7 changes: 3 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
# This is required to provide enough memory for the Minecraft decompilation process.
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false

# Mod Info
VERSION=1.5.2
VERSION=1.5.3
AUTHOR=Ewy
MODNAME=Bibliotheca
MODID=bibliotheca

# Dependencies
MC_VERSION=1.16.5
FORGE_VERSION=36.0.45
FORGE_VERSION=36.1.24
MCP_CHANNEL=snapshot
MCP_MAPPINGS=20201028-1.16.3
MCP_MAPPINGS=20210309-1.16.5
HWYLA_VERSION=1.10.11-B78_1.16.2
5 changes: 2 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Wed Nov 06 20:06:20 CET 2019
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,33 @@ public Map<ResourceLocation, Supplier<ContentType>> getContentMap() {
return CONTENT_MAP;
}

public static void init(String modID, ItemGroup contentGroup, Class<?> blockRegister, Class<?> itemRegister) {
ModLogger.info("Registering content for " + modID);

CONTENT_GROUP = contentGroup == null ? ItemGroup.MISC : contentGroup;

if (blockRegister != null) {
BlockLoader.INSTANCE.register(blockRegister);
}

if (itemRegister != null) {
ItemLoader.INSTANCE.register(itemRegister);
}

}

public static void init(String modID, ItemGroup contentGroup, Class<?> blockRegister, Class<?> itemRegister, Class<?> tileRegister) {
ModLogger.info("Registering content for " + modID);

CONTENT_GROUP = contentGroup == null ? ItemGroup.MISC : contentGroup;

if(blockRegister != null) {
if (blockRegister != null) {
BlockLoader.INSTANCE.register(blockRegister);
}
if(itemRegister != null) {
if (itemRegister != null) {
ItemLoader.INSTANCE.register(itemRegister);
}
if(tileRegister != null) {
if (tileRegister != null) {
TileLoader.INSTANCE.register(tileRegister);
}

Expand All @@ -70,16 +85,16 @@ public static void init(String modID, ItemGroup contentGroup, Class<?> blockRegi

CONTENT_GROUP = contentGroup == null ? ItemGroup.MISC : contentGroup;

if(blockRegister != null) {
if (blockRegister != null) {
BlockLoader.INSTANCE.register(blockRegister);
}
if(itemRegister != null) {
if (itemRegister != null) {
ItemLoader.INSTANCE.register(itemRegister);
}
if(tileRegister != null) {
if (tileRegister != null) {
TileLoader.INSTANCE.register(tileRegister);
}
if(fluidRegister != null) {
if (fluidRegister != null) {
FluidLoader.INSTANCE.register(fluidRegister);
}

Expand All @@ -88,15 +103,15 @@ public static void init(String modID, ItemGroup contentGroup, Class<?> blockRegi
protected void register(Class<?> contentRegister) {
try {
Class<ContentType> superType = registry.getRegistrySuperType();
for(Field field : contentRegister.getDeclaredFields()) {
for (Field field : contentRegister.getDeclaredFields()) {
Object obj = field.get(null);
String fieldName = field.getName().toLowerCase();

if(superType.isInstance(obj)) {
if (superType.isInstance(obj)) {
onRegister(fieldName, superType.cast(obj));
}
}
} catch(IllegalAccessException e) {
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
Expand Down Expand Up @@ -126,13 +141,15 @@ protected String activeModId() {
return ModLoadingContext.get().getActiveContainer().getModInfo().getModId();
}

public interface IHasNoGroup {}
public interface IHasNoGroup {
}

public interface IHasCustomGroup {
ItemGroup getCustomItemGroup();
}

public interface IHasNoBlockItem {}
public interface IHasNoBlockItem {
}

public interface IHasCustomBlockItem {
BlockItem getCustomBlockItem();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ public static IBuilder builder() {
return () -> INSTANCE;
}

@Override
public LootConditionType getConditionType() {
return null;
}

public static class Serializer implements ILootSerializer<PlayerIsSneaking> {

public void serialize(JsonObject object, PlayerIsSneaking playerIsSneaking, JsonSerializationContext ctx) {}
Expand Down
14 changes: 6 additions & 8 deletions src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ license="MIT"
issueTrackerURL="https://github.com/EwyBoy/bibliotheca/issues"

[[mods]]
modId="bibliotheca"
displayName="Bibliotheca"
version="${file.jarVersion}"
authors="Ewy"
credits="Credits to LuHiGi for helping me with tons of stuff"
description='''
Open-source library mod to make my life a bit easier cause I am lazy.
'''
modId="bibliotheca"
displayName="Bibliotheca"
version="${file.jarVersion}"
authors="Ewy"
credits="Credits to LuHiGi for helping me with tons of stuff"
description="Open-source library mod to make my life a bit easier cause I am lazy."

[[dependencies.bibliotheca]]
modId="forge"
Expand Down

0 comments on commit 1da6c91

Please sign in to comment.