Skip to content

Commit d11b8d8

Browse files
committed
Initial gradle changes and mod id work
Adds JEI and TOP support for development space.
1 parent 08c2b53 commit d11b8d8

File tree

5 files changed

+69
-103
lines changed

5 files changed

+69
-103
lines changed

build.gradle

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ apply plugin: 'eclipse'
1414
apply plugin: 'maven-publish'
1515

1616
version = "${minecraft_version}-${mod_version}"
17-
group = 'com.robotgryphon.examplemod' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
18-
archivesBaseName = 'examplemod'
17+
group = 'com.robotgryphon.compactcrafting' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
18+
archivesBaseName = 'compactcrafting'
1919

2020
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
2121

@@ -26,7 +26,7 @@ minecraft {
2626
// stable_# Stables are built at the discretion of the MCP team.
2727
// Use non-default mappings at your own risk. they may not always work.
2828
// Simply re-run your setup task after changing the mappings to update your workspace.
29-
mappings channel: 'snapshot', version: '20200514-1.16'
29+
mappings channel: 'snapshot', version: '20200820-1.16.1'
3030
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
3131

3232
// accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
@@ -38,13 +38,13 @@ minecraft {
3838
workingDirectory project.file('run')
3939

4040
// Recommended logging data for a userdev environment
41-
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
41+
property 'forge.logging.markers', '' // 'SCAN,REGISTRIES,REGISTRYDUMP'
4242

4343
// Recommended logging level for the console
4444
property 'forge.logging.console.level', 'debug'
4545

4646
mods {
47-
examplemod {
47+
compactcrafting {
4848
source sourceSets.main
4949
}
5050
}
@@ -54,13 +54,13 @@ minecraft {
5454
workingDirectory project.file('run')
5555

5656
// Recommended logging data for a userdev environment
57-
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
57+
property 'forge.logging.markers', '' // ''SCAN,REGISTRIES,REGISTRYDUMP'
5858

5959
// Recommended logging level for the console
6060
property 'forge.logging.console.level', 'debug'
6161

6262
mods {
63-
examplemod {
63+
compactcrafting {
6464
source sourceSets.main
6565
}
6666
}
@@ -70,58 +70,60 @@ minecraft {
7070
workingDirectory project.file('run')
7171

7272
// Recommended logging data for a userdev environment
73-
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
73+
property 'forge.logging.markers', '' // 'SCAN,REGISTRIES,REGISTRYDUMP'
7474

7575
// Recommended logging level for the console
7676
property 'forge.logging.console.level', 'debug'
7777

78-
args '--mod', 'examplemod', '--all', '--output', file('src/generated/resources/')
78+
args '--mod', 'compactcrafting', '--all', '--output', file('src/generated/resources/')
7979

8080
mods {
81-
examplemod {
81+
compactcrafting {
8282
source sourceSets.main
8383
}
8484
}
8585
}
8686
}
8787
}
8888

89+
repositories {
90+
// location of the maven that hosts JEI files
91+
maven {
92+
name "Progwml Repo"
93+
url "http://dvs1.progwml6.com/files/maven"
94+
}
95+
96+
// TheOneProbe
97+
maven {
98+
name 'tterrag maven'
99+
url "http://maven.tterrag.com/"
100+
}
101+
}
102+
89103
dependencies {
90104
// Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
91105
// that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
92106
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
93107
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
94108

95-
// You may put jars on which you depend on in ./libs or you may define them like so..
96-
// compile "some.group:artifact:version:classifier"
97-
// compile "some.group:artifact:version"
98-
99-
// Real examples
100-
// compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
101-
// compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
102-
103-
// The 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
104-
// provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
105-
106-
// These dependencies get remapped to your current MCP mappings
107-
// deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev'
108-
109-
// For more info...
110-
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
111-
// http://www.gradle.org/docs/current/userguide/dependency_management.html
109+
// JEI
110+
compileOnly fg.deobf("mezz.jei:jei-${minecraft_version}:${jei_version}:api")
111+
runtimeOnly fg.deobf("mezz.jei:jei-${minecraft_version}:${jei_version}")
112112

113+
// The One Probe
114+
compileOnly fg.deobf("mcjty.theoneprobe:TheOneProbe-1.16:${top_version}:api")
115+
runtimeOnly fg.deobf("mcjty.theoneprobe:TheOneProbe-1.16:${top_version}")
113116
}
114117

115118
// Example for how to get properties into the manifest for reading by the runtime..
116119
jar {
117120
manifest {
118121
attributes([
119-
"Specification-Title": "examplemod",
120-
"Specification-Vendor": "examplemodsareus",
122+
"Specification-Title": "compactcrafting",
123+
"Specification-Vendor": "robotgryphon",
121124
"Specification-Version": "1", // We are version 1 of ourselves
122125
"Implementation-Title": project.name,
123126
"Implementation-Version": "${version}",
124-
"Implementation-Vendor" :"examplemodsareus",
125127
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
126128
])
127129
}
@@ -139,6 +141,7 @@ publishing {
139141
artifact jar
140142
}
141143
}
144+
142145
repositories {
143146
maven {
144147
url "file:///${project.projectDir}/mcmodsrepo"

gradle.properties

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
# This is required to provide enough memory for the Minecraft decompilation process.
33
org.gradle.jvmargs=-Xmx3G
44
org.gradle.daemon=false
5+
56
minecraft_version=1.16.1
67
forge_version=32.0.108
7-
mod_version=1.0.0
8+
mod_version=1.0.0
9+
10+
# Dependencies and Libs
11+
jei_version=7.0.1.10
12+
top_version=1.16-3.0.1-beta-4

src/main/java/com/example/examplemod/ExampleMod.java renamed to src/main/java/com/robotgryphon/compactcrafting/CompactCrafting.java

Lines changed: 4 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,30 @@
1-
package com.example.examplemod;
1+
package com.robotgryphon.compactcrafting;
22

3-
import net.minecraft.block.Block;
43
import net.minecraft.block.Blocks;
54
import net.minecraftforge.common.MinecraftForge;
6-
import net.minecraftforge.event.RegistryEvent;
75
import net.minecraftforge.eventbus.api.IEventBus;
86
import net.minecraftforge.eventbus.api.SubscribeEvent;
9-
import net.minecraftforge.fml.InterModComms;
107
import net.minecraftforge.fml.common.Mod;
118
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
129
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
13-
import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent;
14-
import net.minecraftforge.fml.event.lifecycle.InterModProcessEvent;
1510
import net.minecraftforge.fml.event.server.FMLServerStartingEvent;
1611
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
1712
import org.apache.logging.log4j.LogManager;
1813
import org.apache.logging.log4j.Logger;
1914

20-
import java.util.stream.Collectors;
21-
2215
// The value here should match an entry in the META-INF/mods.toml file
23-
@Mod("examplemod")
24-
public class ExampleMod
16+
@Mod("compactcrafting")
17+
public class CompactCrafting
2518
{
2619
// Directly reference a log4j logger.
2720
private static final Logger LOGGER = LogManager.getLogger();
2821

29-
public ExampleMod() {
22+
public CompactCrafting() {
3023
IEventBus modBus = FMLJavaModLoadingContext.get().getModEventBus();
3124

3225
// Register the setup method for modloading
3326
modBus.addListener(this::setup);
3427

35-
// Register the enqueueIMC method for modloading
36-
modBus.addListener(this::enqueueIMC);
37-
38-
// Register the processIMC method for modloading
39-
modBus.addListener(this::processIMC);
40-
4128
// Register the doClientStuff method for modloading
4229
modBus.addListener(this::doClientStuff);
4330

@@ -57,34 +44,10 @@ private void doClientStuff(final FMLClientSetupEvent event) {
5744
LOGGER.info("Got game settings {}", event.getMinecraftSupplier().get().gameSettings);
5845
}
5946

60-
private void enqueueIMC(final InterModEnqueueEvent event)
61-
{
62-
// some example code to dispatch IMC to another mod
63-
InterModComms.sendTo("examplemod", "helloworld", () -> { LOGGER.info("Hello world from the MDK"); return "Hello world";});
64-
}
65-
66-
private void processIMC(final InterModProcessEvent event)
67-
{
68-
// some example code to receive and process InterModComms from other mods
69-
LOGGER.info("Got IMC {}", event.getIMCStream().
70-
map(m->m.getMessageSupplier().get()).
71-
collect(Collectors.toList()));
72-
}
7347
// You can use SubscribeEvent and let the Event Bus discover methods to call
7448
@SubscribeEvent
7549
public void onServerStarting(FMLServerStartingEvent event) {
7650
// do something when the server starts
7751
LOGGER.info("HELLO from server starting");
7852
}
79-
80-
// You can use EventBusSubscriber to automatically subscribe events on the contained class (this is subscribing to the MOD
81-
// Event bus for receiving Registry Events)
82-
@Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD)
83-
public static class RegistryEvents {
84-
@SubscribeEvent
85-
public static void onBlocksRegistry(final RegistryEvent.Register<Block> blockRegistryEvent) {
86-
// register a new block here
87-
LOGGER.info("HELLO from Register Block");
88-
}
89-
}
9053
}

src/main/resources/META-INF/mods.toml

Lines changed: 25 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,39 @@
1-
# This is an example mods.toml file. It contains the data relating to the loading mods.
2-
# There are several mandatory fields (#mandatory), and many more that are optional (#optional).
3-
# The overall format is standard TOML format, v0.5.0.
4-
# Note that there are a couple of TOML lists in this file.
5-
# Find more information on toml format here: https://github.com/toml-lang/toml
61
# The name of the mod loader type to load - for regular FML @Mod mods it should be javafml
72
modLoader="javafml" #mandatory
3+
84
# A version range to match for said mod loader - for regular FML @Mod it will be the forge version
95
loaderVersion="[32,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
10-
# The license for you mod. This is mandatory metadata and allows for easier comprehension of your redistributive properties.
11-
# Review your options at https://choosealicense.com/. All rights reserved is the default copyright stance, and is thus the default here.
6+
127
license="All rights reserved"
13-
# A URL to refer people to when problems occur with this mod
14-
issueTrackerURL="http://my.issue.tracker/" #optional
8+
159
# A list of mods - how many allowed here is determined by the individual mod loader
16-
[[mods]] #mandatory
17-
# The modid of the mod
18-
modId="examplemod" #mandatory
19-
# The version number of the mod - there's a few well known ${} variables useable here or just hardcode it
20-
version="${file.jarVersion}" #mandatory
21-
# A display name for the mod
22-
displayName="Example Mod" #mandatory
10+
[[mods]]
11+
modId="compactcrafting"
12+
version="${file.jarVersion}"
13+
displayName="Compact Crafting"
14+
authors="RobotGryphon" #optional
15+
description='''
16+
Compact Crafting adds a new crafting system, miniaturization crafting, to Minecraft.
17+
18+
Based off of the Compact Machines mod pre-1.16.
19+
'''
20+
21+
# Optional Fields
22+
# A URL to refer people to when problems occur with this mod
23+
#issueTrackerURL="http://my.issue.tracker/" #optional
2324
# A URL to query for updates for this mod. See the JSON update specification <here>
24-
updateJSONURL="http://myurl.me/" #optional
25+
#updateJSONURL="http://myurl.me/" #optional
2526
# A URL for the "homepage" for this mod, displayed in the mod UI
26-
displayURL="http://example.com/" #optional
27+
#displayURL="http://example.com/" #optional
2728
# A file name (in the root of the mod JAR) containing a logo for display
28-
logoFile="examplemod.png" #optional
29+
#logoFile="examplemod.png" #optional
2930
# A text field displayed in the mod UI
30-
credits="Thanks for this example mod goes to Java" #optional
31-
# A text field displayed in the mod UI
32-
authors="Love, Cheese and small house plants" #optional
33-
# The description text for the mod (multi line!) (#mandatory)
34-
description='''
35-
This is a long form description of the mod. You can write whatever you want here
31+
# credits="Thanks for this example mod goes to Java" #optional
32+
3633

37-
Have some lorem ipsum.
3834

39-
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.
40-
'''
4135
# A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional.
42-
[[dependencies.examplemod]] #optional
36+
[[dependencies.compactcrafting]] #optional
4337
# the modid of the dependency
4438
modId="forge" #mandatory
4539
# Does this dependency have to exist - if not, ordering below must be specified
@@ -50,8 +44,9 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mollis lacinia magn
5044
ordering="NONE"
5145
# Side this dependency is applied on - BOTH, CLIENT or SERVER
5246
side="BOTH"
47+
5348
# Here's another dependency
54-
[[dependencies.examplemod]]
49+
[[dependencies.compactcrafting]]
5550
modId="minecraft"
5651
mandatory=true
5752
versionRange="[1.16.1]"

src/main/resources/pack.mcmeta

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"pack": {
3-
"description": "examplemod resources",
3+
"description": "Compact Crafting resources",
44
"pack_format": 5,
55
"_comment": "A pack_format of 5 requires json lang files and some texture changes from 1.15. Note: we require v5 pack meta for all mods."
66
}

0 commit comments

Comments
 (0)