Skip to content

Remove Loadable #9

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
29 changes: 20 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,28 +1,39 @@
plugins {
id "java" //This is a java project, scala and groovy plugins also exist
id "nova.gradle" version "0.2.6" //Use the NOVA Gradle plugin version 0.2.6
id "java" // This is a java project, scala and groovy plugins also exist
// id "jacoco" // Show code coverage report when running tests
id "nova.gradle" version "0.2.6" // Use the NOVA Gradle plugin version 0.2.6
}

dependencies { //Dependencies of this project
compile nova(nova_version) //Depend on NOVA for compiling
repositories {
mavenLocal() // Import the maven local repository, needed when the NOVA Maven is down
}

dependencies { // Dependencies of this project
compile nova(nova_version) // Depend on NOVA for compiling

// Test dependencies, required for unit testing
// testCompile "junit:junit:4.12"
// testCompile "org.assertj:assertj-core:3.0.0"
// testCompile "org.mockito:mockito-core:1.+"
// testRuntime 'org.slf4j:slf4j-simple:1.7.10'
}

nova { //This block is used for configuring the NOVA Gradle plugin
wrappers { //Configures wrapper profiles
wrappers { // Configures wrapper profiles
/**
* This profile is called "17", you can skip the quotes if it's not numbers.
* This profile for example will generate the "run17Client" gradle task and create an IDEA
* config of the same name.
* The name can be changed to your liking.
*/
//Wrapper profile for MC 1.7.10
// Wrapper profile for MC 1.7.10
"17" {
wrapper "nova.core:NOVA-Core-Wrapper-MC1.7:${nova_version}"
wrapper "nova.core:NOVA-Core-Wrapper-MC1.7:$nova_version"
}

//Wrapper profile for MC 1.8
// Wrapper profile for MC 1.8
"18" {
wrapper "nova.core:NOVA-Core-Wrapper-MC1.8:${nova_version}"
wrapper "nova.core:NOVA-Core-Wrapper-MC1.8:$nova_version"
}
}
}
22 changes: 14 additions & 8 deletions src/main/java/net/novaapi/template/TemplateMod.java
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
package net.novaapi.template;

import nova.core.block.BlockManager;
import nova.core.loader.Loadable;
import nova.core.event.bus.GlobalEvents;
import nova.core.loader.Mod;
import org.slf4j.Logger;

@Mod(id = TemplateMod.MOD_ID, name = TemplateMod.NAME, version = TemplateMod.VERSION, novaVersion = "0.0.1")
public class TemplateMod implements Loadable {
public class TemplateMod {
public static final String MOD_ID = "template_mod";
public static final String NAME = "Example Mod";
public static final String VERSION = "0.1.0";

public final BlockManager blockManager;
public final GlobalEvents events;
public final Logger logger;

public TemplateMod(BlockManager blockManager) {
this.blockManager = blockManager;
public TemplateMod(GlobalEvents events,
BlockManager blockManager,
Logger logger) {
this.events = events;
this.logger = logger;

events.on(BlockManager.Init.class).bind(evt -> this.registerBlocks(evt.manager));
}

@Override
public void init() {
public void registerBlocks(BlockManager blockManager) {
// some example code
System.out.println("AIR BLOCK >> " + this.blockManager.getAirBlock().getID());
this.logger.info("AIR BLOCK >> " + blockManager.getAirBlock().getID());
}
}