Skip to content
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

NOVA-Worldgen Minecraft 1.11 Wrappers #3

Open
wants to merge 4 commits 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
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@

# Sources
!/src
!/mc17
!/mc18
!/minecraft

# github
!/.gitignore
Expand Down
20 changes: 12 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
plugins {
id "java"
id "nova.gradle" version "0.2.3"
id "nova.gradle" version "0.2.6"
id "maven-publish"
id "com.jfrog.artifactory" version "3.1.1"
}


apply from: "https://raw.githubusercontent.com/NOVA-Team/NOVA-Gradle/master/shared-scripts/java.gradle"

dependencies novaApi("0.1.0-SNAPSHOT")
dependencies {
compile nova(nova_version)
}

nova {
wrappers {
"17" {
wrapper "nova.wrapper.mc1710:NovaWrapper-MC1.7.10:0.1-SNAPSHOT:deobf"
runtime project(":mc17")
wrapper "nova.core:NOVA-Core-Wrapper-MC1.7:$nova_version"
runtime project(":minecraft:1.7")
}

"18" {
wrapper "nova.wrapper.mc18:NovaWrapper-MC1.8:0.1-SNAPSHOT:deobf"
runtime project(":mc18")
wrapper "nova.core:NOVA-Core-Wrapper-MC1.8:$nova_version"
runtime project(":minecraft:1.8")
}
"1_11" {
wrapper "nova.core:NOVA-Core-Wrapper-MC1.11:$nova_version"
runtime project(":minecraft:1.11")
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version = 0.0.1-SNAPSHOT
group = nova.worldgen
novaVersion = 0.1.0-SNAPSHOT
nova_version = 0.1.0-SNAPSHOT

packaging = jar
info.inceptionYear = 2015
Expand Down
8 changes: 8 additions & 0 deletions minecraft/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*

!/build.gradle
!/.gitignore

!/1.11
!/1.8
!/1.7
17 changes: 17 additions & 0 deletions minecraft/1.11/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Ignore All
/*

# Sources
!/src

# github
!/.gitignore
!/README.md

# gradle
!/build.gradle
!/build.properties
!/settings.gradle
!/gradle.properties
!/gradlew*
!/gradle
64 changes: 64 additions & 0 deletions minecraft/1.11/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
apply plugin: "maven-publish"
apply plugin: "com.jfrog.artifactory"
apply from: "https://raw.githubusercontent.com/NOVA-Team/NOVA-Gradle/master/shared-scripts/java.gradle"

publishing {
publications {
main(MavenPublication) {
from components.java

artifactId "NOVA-Worldgen-Wrapper-MC1.11"

artifact sourcesJar
artifact javadocJar

pom.withXml(writePom(project.properties))
}
}
}

artifactory {
publish {
defaults {
publications("main")
publishPom = true
}
}
}

artifacts {
archives jar
}

apply plugin: 'net.minecraftforge.gradle.forge'

minecraft {
version = property("minecraft.version") + "-" + property("forge.version")
mappings = 'snapshot_20161220'
runDir = "run"
}

dependencies {
compile rootProject
compile group: "nova.core", name: "NOVA-Core", version: property("nova_version"), changing: true
compile group: "nova.core", name: "NOVA-Core-Wrapper-MC1.11", version: property("nova_version"), classifier: "deobf", changing: true
}

processResources {
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version

// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include "mcmod.info"

// replace version and mcversion
expand "version": project.version, "mcversion": project.minecraft.version
}

// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude "mcmod.info"
}
}
8 changes: 8 additions & 0 deletions minecraft/1.11/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
minecraft.version = 1.11
forge.version = 13.19.1.2189
forgeGradleVersion = 2.2-SNAPSHOT

packaging = jar
info.inceptionYear = 2016
info.description = The NOVA-Worldgen Minecraft 1.11 wrapper.
info.organization.name = NOVA
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright (c) 2017 NOVA, All rights reserved.
* This library is free software, licensed under GNU Lesser General Public License version 3
*
* This file is part of NOVA.
*
* NOVA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* NOVA is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with NOVA. If not, see <http://www.gnu.org/licenses/>.
*/
package nova.worldgen.wrapper.mc.forge.v1_11.depmodules;

import nova.worldgen.world.WorldInfo;
import nova.worldgen.wrapper.mc.forge.v1_11.wrapper.world.MCWorldInfo;
import se.jbee.inject.bind.BinderModule;
import se.jbee.inject.util.Scoped;

/**
* @author ExE Boss
*/
public class MCWorldgenModule extends BinderModule {

@Override
protected void declare() {
per(Scoped.APPLICATION).bind(WorldInfo.class).to(MCWorldInfo.class);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* Copyright (c) 2015 NOVA, All rights reserved.
* This library is free software, licensed under GNU Lesser General Public License version 3
*
* This file is part of NOVA.
*
* NOVA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* NOVA is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with NOVA. If not, see <http://www.gnu.org/licenses/>.
*/

package nova.worldgen.wrapper.mc.forge.v1_11.launch;

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.registry.GameRegistry;
import nova.core.loader.Mod;
import nova.core.wrapper.mc.forge.v1_11.launcher.ForgeLoadable;
import nova.internal.worldgen.depmodules.WorldgenModule;
import nova.worldgen.WorldgenManager;
import nova.worldgen.wrapper.mc.forge.v1_11.depmodules.MCWorldgenModule;
import nova.worldgen.wrapper.mc.forge.v1_11.wrapper.world.MCWorldInfo;
import nova.worldgen.wrapper.mc.forge.v1_11.wrapper.world.forward.FWWorldGenerator;

/**
*
* @author ExE Boss
*/
@Mod(id = NovaWorldgenWrapper.id, name = NovaWorldgenWrapper.name, version = NovaWorldgenWrapper.version, modules = { MCWorldgenModule.class, WorldgenModule.class }, novaVersion = "0.0.1")
public class NovaWorldgenWrapper implements ForgeLoadable {

public static final String version = "0.0.1";
public static final String id = "nova-worldgen-wrapper";
public static final String name = "NOVA Worldgen";

public final WorldgenManager worldgenManager;

public FWWorldGenerator worldGenerator;

public NovaWorldgenWrapper(WorldgenManager worldgenManager) {
this.worldgenManager = worldgenManager;
((MCWorldInfo)this.worldgenManager.getWorldInfo()).init(this.worldgenManager);
this.worldGenerator = new FWWorldGenerator(this.worldgenManager);
}

@Override
public void preInit(FMLPreInitializationEvent evt) {
GameRegistry.registerWorldGenerator(this.worldGenerator, 0);
worldgenManager.init();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Copyright (c) 2017 NOVA, All rights reserved.
* This library is free software, licensed under GNU Lesser General Public License version 3
*
* This file is part of NOVA.
*
* NOVA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* NOVA is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with NOVA. If not, see <http://www.gnu.org/licenses/>.
*/

package nova.worldgen.wrapper.mc.forge.v1_11.wrapper.world;

import nova.core.util.registry.Registry;
import nova.core.util.shape.Cuboid;
import nova.worldgen.WorldgenManager;
import nova.worldgen.ore.Ore;
import nova.worldgen.world.WorldInfo;

/**
* @author ExE Boss
*/
public class MCWorldInfo extends WorldInfo {

private WorldgenManager worldgenManager;

public void init(WorldgenManager worldgenManager) {
this.worldgenManager = worldgenManager;
}

@Override
public Cuboid getWorldDimmensions() {
return new Cuboid(Double.NEGATIVE_INFINITY, 0, Double.NEGATIVE_INFINITY,
Double.POSITIVE_INFINITY, 256, Double.POSITIVE_INFINITY);
}

@Override
public Cuboid getWorldGenerationUnitDimmensions() {
return new Cuboid(0, 0, 0, 16, 16, 16);
}

@Override
public Registry<Ore> getOreGenerationRegistry() {
return worldgenManager.registry.stream().filter(gen -> gen instanceof Ore).map(ore -> (Ore) ore).collect(Registry::new, Registry::register, (r1, r2) -> r2.forEach(r1::register));
}
}
Loading