Merge remote-tracking branch 'Darkhax-Forked/1.17' into 1.17

This commit is contained in:
Jared 2021-09-29 20:47:57 +02:00
commit 61b347c5cf
No known key found for this signature in database
GPG Key ID: DB3BA3B9088A1BDF
11 changed files with 84 additions and 52 deletions

View File

@ -1,22 +1,21 @@
plugins {
id("java")
id("org.spongepowered.gradle.vanilla") version "0.2"
id('java')
id('org.spongepowered.gradle.vanilla') version '0.2.1-SNAPSHOT'
}
archivesBaseName = mod_name
version = "common-${minecraft_version}-${mod_version}"
group = mod_group
archivesBaseName = "${mod_name}-common-${minecraft_version}"
repositories {
mavenCentral()
}
minecraft {
version(minecraft_version) // or: latestRelease() or latestSnapshot()
runs {
server()
client()
version(minecraft_version)
runs {
if (project.hasProperty('common_runs_enabled') ? project.findProperty('common_runs_enabled').toBoolean() : true) {
server(project.hasProperty('common_server_run_name') ? project.findProperty('common_server_run_name') : 'vanilla_server') {}
client(project.hasProperty('common_client_run_name') ? project.findProperty('common_client_run_name') : 'vanilla_client') {}
}
}
}
dependencies {
}
}

View File

@ -0,0 +1,11 @@
package com.blamejared.stuff;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public class Constants {
public static final String MOD_ID = "multiloader";
public static final String MOD_NAME = "MultiLoader";
public static final Logger LOG = LogManager.getLogger(MOD_NAME);
}

View File

@ -0,0 +1,6 @@
{
"pack": {
"description": "${mod_name}",
"pack_format": 6,
}
}

View File

@ -4,12 +4,7 @@ plugins {
id 'idea'
}
sourceCompatibility = JavaVersion.VERSION_16
targetCompatibility = JavaVersion.VERSION_16
archivesBaseName = mod_name
version = "fabric-${minecraft_version}-${mod_version}"
group = mod_group
archivesBaseName = "${mod_name}-fabric-${minecraft_version}"
repositories {
}

View File

@ -12,11 +12,7 @@ apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
archivesBaseName = mod_name
version = "forge-${minecraft_version}-${mod_version}"
group = mod_group
java.toolchain.languageVersion = JavaLanguageVersion.of(16)
archivesBaseName = "${mod_name}-forge-${minecraft_version}"
minecraft {
mappings channel: 'official', version: minecraft_version
@ -94,7 +90,6 @@ jar {
}
}
jar.finalizedBy('reobfJar')
publishing {

View File

@ -1,23 +1,25 @@
package com.example.examplemod;
import net.minecraft.world.level.block.*;
import java.util.stream.Collectors;
import com.blamejared.stuff.Constants;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.InterModComms;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.*;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent;
import net.minecraftforge.fml.event.lifecycle.InterModProcessEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.fmlserverevents.FMLServerStartingEvent;
import org.apache.logging.log4j.*;
import java.util.stream.Collectors;
@Mod("examplemod")
@Mod(Constants.MOD_ID)
public class ExampleMod {
private static final Logger LOGGER = LogManager.getLogger();
public ExampleMod() {
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup);
@ -29,22 +31,22 @@ public class ExampleMod {
private void setup(final FMLCommonSetupEvent event) {
LOGGER.info("HELLO FROM PREINIT");
LOGGER.info("DIRT BLOCK >> {}", Blocks.DIRT.getRegistryName());
Constants.LOG.info("HELLO FROM PREINIT");
Constants.LOG.info("DIRT BLOCK >> {}", Blocks.DIRT.getRegistryName());
CommonClass.init();
}
private void enqueueIMC(final InterModEnqueueEvent event) {
InterModComms.sendTo("examplemod", "helloworld", () -> {
LOGGER.info("Hello world from the MDK");
Constants.LOG.info("Hello world from the MDK");
return "Hello world";
});
}
private void processIMC(final InterModProcessEvent event) {
LOGGER.info("Got IMC {}", event.getIMCStream()
Constants.LOG.info("Got IMC {}", event.getIMCStream()
.map(m -> m.messageSupplier().get())
.collect(Collectors.toList()));
}
@ -52,7 +54,7 @@ public class ExampleMod {
@SubscribeEvent
public void onServerStarting(FMLServerStartingEvent event) {
LOGGER.info("HELLO from server starting");
Constants.LOG.info("HELLO from server starting");
}
@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD)
@ -61,7 +63,7 @@ public class ExampleMod {
@SubscribeEvent
public static void onBlocksRegistry(final RegistryEvent.Register<Block> blockRegistryEvent) {
// register a new block here
LOGGER.info("HELLO from Register Block");
Constants.LOG.info("HELLO from Register Block");
}
}

View File

@ -15,7 +15,7 @@ license="All rights reserved"
# A list of mods - how many allowed here is determined by the individual mod loader
[[mods]] #mandatory
# The modid of the mod
modId="examplemod" #mandatory
modId="multiloader" #mandatory
# The version number of the mod - there's a few well known ${} variables useable here or just hardcode it
# ${file.jarVersion} will substitute the value of the Implementation-Version as read from the mod's JAR file metadata
# see the associated build.gradle script for how to populate this completely automatically during a build
@ -27,7 +27,7 @@ displayName="Example Mod" #mandatory
# A URL for the "homepage" for this mod, displayed in the mod UI
#displayURL="https://change.me.to.your.mods.homepage.example.invalid/" #optional
# A file name (in the root of the mod JAR) containing a logo for display
logoFile="examplemod.png" #optional
logoFile="multiloader.png" #optional
# A text field displayed in the mod UI
credits="Thanks for this example mod goes to Java" #optional
# A text field displayed in the mod UI
@ -41,7 +41,7 @@ Have some lorem ipsum.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mollis lacinia magna. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed sagittis luctus odio eu tempus. Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque volutpat ligula eget lacus auctor sagittis. In hac habitasse platea dictumst. Nunc gravida elit vitae sem vehicula efficitur. Donec mattis ipsum et arcu lobortis, eleifend sagittis sem rutrum. Cras pharetra quam eget posuere fermentum. Sed id tincidunt justo. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
'''
# A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional.
[[dependencies.examplemod]] #optional
[[dependencies.multiloader]] #optional
# the modid of the dependency
modId="forge" #mandatory
# Does this dependency have to exist - if not, ordering below must be specified
@ -53,7 +53,7 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mollis lacinia magn
# Side this dependency is applied on - BOTH, CLIENT or SERVER
side="BOTH"
# Here's another dependency
[[dependencies.examplemod]]
[[dependencies.multiloader]]
modId="minecraft"
mandatory=true
# This version range declares a minimum of the current minecraft version up to but not including the next major version

View File

@ -1,7 +0,0 @@
{
"pack": {
"description": "examplemod resources",
"pack_format": 6,
"_comment": "A pack_format of 6 requires json lang files and some texture changes from 1.16.2. Note: we require v6 pack meta for all mods."
}
}

View File

@ -0,0 +1,25 @@
subprojects {
apply plugin: 'java'
java.toolchain.languageVersion = JavaLanguageVersion.of(16)
java.withSourcesJar()
java.withJavadocJar()
jar {
manifest {
attributes([
'Specification-Title' : mod_name,
'Specification-Vendor' : mod_author,
'Specification-Version' : project.jar.archiveVersion,
'Implementation-Title' : project.name,
'Implementation-Version' : project.jar.archiveVersion,
'Implementation-Vendor' : mod_author,
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
'Timestampe' : System.currentTimeMillis(),
'Built-On-Java' : "${System.getProperty('java.vm.version')} (${System.getProperty('java.vm.vendor')})",
'Build-On-Minecraft' : minecraft_version
])
}
}
}

View File

@ -1,3 +1,7 @@
# Project
version=1.0.0
group=com.blamejared.multiloader
# Common
minecraft_version=1.17.1
@ -10,8 +14,6 @@ fabric_version=0.40.1+1.17
fabric_loader_version=0.11.7
# Mod options
mod_group=com.blamejared.multiloader
mod_version=1.0.0
mod_name=MultiLoader
mod_author=Jared
mod_id=multiloader

View File

@ -1,10 +1,14 @@
pluginManagement {
repositories {
gradlePluginPortal()
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
}
gradlePluginPortal()
maven {
name = 'Sponge Snapshots'
url = 'https://repo.spongepowered.org/repository/maven-public/'
}
}
}