Skip to content

Commit ffbecea

Browse files
committed
Remove Loadable
1 parent 7535be6 commit ffbecea

2 files changed

Lines changed: 34 additions & 17 deletions

File tree

build.gradle

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,39 @@
11
plugins {
2-
id "java" //This is a java project, scala and groovy plugins also exist
3-
id "nova.gradle" version "0.2.6" //Use the NOVA Gradle plugin version 0.2.6
2+
id "java" // This is a java project, scala and groovy plugins also exist
3+
// id "jacoco" // Show code coverage report when running tests
4+
id "nova.gradle" version "0.2.6" // Use the NOVA Gradle plugin version 0.2.6
45
}
56

6-
dependencies { //Dependencies of this project
7-
compile nova(nova_version) //Depend on NOVA for compiling
7+
repositories {
8+
mavenLocal() // Import the maven local repository, needed when the NOVA Maven is down
9+
}
10+
11+
dependencies { // Dependencies of this project
12+
compile nova(nova_version) // Depend on NOVA for compiling
13+
14+
// Test dependencies, required for unit testing
15+
// testCompile "junit:junit:4.12"
16+
// testCompile "org.assertj:assertj-core:3.0.0"
17+
// testCompile "org.mockito:mockito-core:1.+"
18+
// testRuntime 'org.slf4j:slf4j-simple:1.7.10'
819
}
920

1021
nova { //This block is used for configuring the NOVA Gradle plugin
11-
wrappers { //Configures wrapper profiles
22+
wrappers { // Configures wrapper profiles
1223
/**
1324
* This profile is called "17", you can skip the quotes if it's not numbers.
1425
* This profile for example will generate the "run17Client" gradle task and create an IDEA
1526
* config of the same name.
1627
* The name can be changed to your liking.
1728
*/
18-
//Wrapper profile for MC 1.7.10
29+
// Wrapper profile for MC 1.7.10
1930
"17" {
20-
wrapper "nova.core:NOVA-Core-Wrapper-MC1.7:${nova_version}"
31+
wrapper "nova.core:NOVA-Core-Wrapper-MC1.7:$nova_version"
2132
}
2233

23-
//Wrapper profile for MC 1.8
34+
// Wrapper profile for MC 1.8
2435
"18" {
25-
wrapper "nova.core:NOVA-Core-Wrapper-MC1.8:${nova_version}"
36+
wrapper "nova.core:NOVA-Core-Wrapper-MC1.8:$nova_version"
2637
}
2738
}
2839
}
Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,30 @@
11
package net.novaapi.template;
22

33
import nova.core.block.BlockManager;
4-
import nova.core.loader.Loadable;
4+
import nova.core.event.bus.GlobalEvents;
55
import nova.core.loader.Mod;
6+
import org.slf4j.Logger;
67

78
@Mod(id = TemplateMod.MOD_ID, name = TemplateMod.NAME, version = TemplateMod.VERSION, novaVersion = "0.0.1")
8-
public class TemplateMod implements Loadable {
9+
public class TemplateMod {
910
public static final String MOD_ID = "template_mod";
1011
public static final String NAME = "Example Mod";
1112
public static final String VERSION = "0.1.0";
1213

13-
public final BlockManager blockManager;
14+
public final GlobalEvents events;
15+
public final Logger logger;
1416

15-
public TemplateMod(BlockManager blockManager) {
16-
this.blockManager = blockManager;
17+
public TemplateMod(GlobalEvents events,
18+
BlockManager blockManager,
19+
Logger logger) {
20+
this.events = events;
21+
this.logger = logger;
22+
23+
events.on(BlockManager.Init.class).bind(evt -> this.registerBlocks(evt.manager));
1724
}
1825

19-
@Override
20-
public void init() {
26+
public void registerBlocks(BlockManager blockManager) {
2127
// some example code
22-
System.out.println("AIR BLOCK >> " + this.blockManager.getAirBlock().getID());
28+
this.logger.info("AIR BLOCK >> " + blockManager.getAirBlock().getID());
2329
}
2430
}

0 commit comments

Comments
 (0)