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

Update to latest snapshot + Work on GUI and Worldgen #31

Closed
wants to merge 13 commits into from
25 changes: 12 additions & 13 deletions block/src/main/java/nova/sample/block/NovaBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
*
* @author Calclavia
*/
@Mod(id = NovaBlock.id, name = "Nova Example Block", version = "0.0.1", novaVersion = "0.0.1")
@Mod(id = NovaBlock.MOD_ID, name = "Nova Example Block", version = "0.0.1", novaVersion = "0.0.1")
public class NovaBlock implements Loadable {

public static final String id = "novablock";
public static final String MOD_ID = "novablock";

public static BlockFactory blockStateful;
public static BlockFactory blockStateless;
Expand All @@ -47,10 +47,10 @@ public class NovaBlock implements Loadable {
public final RecipeManager recipeManager;

public NovaBlock(BlockManager blockManager,
ItemManager itemManager,
RenderManager renderManager,
NetworkManager networkManager,
RecipeManager recipeManager) {
ItemManager itemManager,
RenderManager renderManager,
NetworkManager networkManager,
RecipeManager recipeManager) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you imported the NOVA standard format on IDEA? Make sure you use it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The spaces being used as leading whitespace in constructors was already done like that in NovaWorldgen, I just manually copied it to the other mod classes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, this probably is correct. Been a while since I used the formatter.

this.blockManager = blockManager;
this.itemManager = itemManager;
this.renderManager = renderManager;
Expand All @@ -61,18 +61,17 @@ public NovaBlock(BlockManager blockManager,

@Override
public void preInit() {
steelTexture = renderManager.registerTexture(new BlockTexture(id, "block_steel"));
grinderTexture = renderManager.registerTexture(new BlockTexture(id, "grinder"));
steelTexture = renderManager.registerTexture(new BlockTexture(MOD_ID, "block_steel"));
grinderTexture = renderManager.registerTexture(new BlockTexture(MOD_ID, "grinder"));

blockStateless = blockManager.register(id + ":simple", BlockStateless::new);
blockBasicDuster = blockManager.register(id + ":basic_duster", BasicDuster::new);
blockStateful = blockManager.register(MOD_ID + ":stateful", BlockStateful::new);
blockStateless = blockManager.register(MOD_ID + ":simple", BlockStateless::new);

itemBlockStateful = itemManager.getItemFromBlock(blockStateful);
itemBlockStateless = itemManager.getItemFromBlock(blockStateless);

grinderEntityTexture = renderManager.registerTexture(new EntityTexture(id, "grinder_entity"));

grinderModel = renderManager.registerModel(new TechneModelProvider(id, "grinder"));
grinderEntityTexture = renderManager.registerTexture(new EntityTexture(MOD_ID, "grinder_entity"));
grinderModel = renderManager.registerModel(new TechneModelProvider(MOD_ID, "grinder"));

// try to add a recipe
//ItemIngredient stickIngredient = ItemIngredient.forItem("minecraft:stick"); //TODO: This should be obtained from some dictonary too
Expand Down
7 changes: 4 additions & 3 deletions entity/src/main/java/nova/sample/entity/NovaEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@
*
* @author ExE Boss
*/
@Mod(id = NovaEntity.id, name = "Nova Example Entity", version = "0.0.1", novaVersion = "0.0.1")
@Mod(id = NovaEntity.MOD_ID, name = "Nova Example Entity", version = "0.0.1", novaVersion = "0.0.1")
public class NovaEntity implements Loadable {

public static final String id = "novaentity";
public static final String MOD_ID = "novaentity";

public final EntityManager entityManager;
public final RenderManager renderManager;

public NovaEntity(EntityManager entityManager, RenderManager renderManager) {
public NovaEntity(EntityManager entityManager,
RenderManager renderManager) {
this.entityManager = entityManager;
this.renderManager = renderManager;
}
Expand Down
18 changes: 9 additions & 9 deletions gui/src/main/java/nova/sample/gui/NovaGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
*
* @author Calclavia
*/
@Mod(id = NovaGui.id, name = "Nova GUI example", version = "0.0.1", novaVersion = "0.0.1")
@Mod(id = NovaGui.MOD_ID, name = "Nova GUI example", version = "0.0.1", novaVersion = "0.0.1")
public class NovaGui implements Loadable {

public static final String id = "novaexamplegui";
public static final String MOD_ID = "novaexamplegui";

public static BlockFactory blockTest;
public static ItemFactory itemBlockTest;
Expand All @@ -51,11 +51,11 @@ public class NovaGui implements Loadable {
public final RecipeManager recipeManager;

public NovaGui(BlockManager blockManager,
ItemManager itemManager,
RenderManager renderManager,
GuiManager guiFactory,
RecipeManager recipeManager,
NetworkManager networkManager) {
ItemManager itemManager,
RenderManager renderManager,
GuiManager guiFactory,
RecipeManager recipeManager,
NetworkManager networkManager) {
this.blockManager = blockManager;
this.itemManager = itemManager;
this.renderManager = renderManager;
Expand Down Expand Up @@ -103,11 +103,11 @@ public static void initializeGUI() {

@Override
public void preInit() {
blockTest = blockManager.register(id + ":gui", BlockSimpleTest::new);
blockTest = blockManager.register(MOD_ID + ":gui", BlockSimpleTest::new);

itemBlockTest = itemManager.getItemFromBlock(blockTest);

steelTexture = renderManager.registerTexture(new BlockTexture(id, "block_steel"));
steelTexture = renderManager.registerTexture(new BlockTexture(MOD_ID, "block_steel"));

// try to add a recipe
//ItemIngredient stickIngredient = ItemIngredient.forItem("minecraft:stick"); //TODO: This should be obtained from some dictonary too
Expand Down
12 changes: 7 additions & 5 deletions item/src/main/java/nova/sample/item/NovaItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
/**
* Created by magik6k on 5/29/15.
*/
@Mod(id = NovaItem.id, name = "Nova Example Item", version = "0.0.1", novaVersion = "0.0.1")
@Mod(id = NovaItem.MOD_ID, name = "Nova Example Item", version = "0.0.1", novaVersion = "0.0.1")
public class NovaItem implements Loadable {
public static final String id = "novaitem";
public static final String MOD_ID = "novaitem";

public static ItemFactory itemScrewdriver;
public static ItemTexture screwTexture;
Expand All @@ -25,16 +25,18 @@ public class NovaItem implements Loadable {
public final RenderManager renderManager;
public final RecipeManager recipeManager;

public NovaItem(ItemManager itemManager, RenderManager renderManager, RecipeManager recipeManager) {
public NovaItem(ItemManager itemManager,
RenderManager renderManager,
RecipeManager recipeManager) {
this.itemManager = itemManager;
this.renderManager = renderManager;
this.recipeManager = recipeManager;
}

@Override
public void preInit() {
screwTexture = renderManager.registerTexture(new ItemTexture(id, "screwdriver"));
itemScrewdriver = itemManager.register(id + ":testscrewdriver", ItemScrewdriver::new);
screwTexture = renderManager.registerTexture(new ItemTexture(MOD_ID, "screwdriver"));
itemScrewdriver = itemManager.register(MOD_ID + ":testscrewdriver", ItemScrewdriver::new);

//ItemIngredient stickIngredient = ItemIngredient.forItem("minecraft:stick"); //TODO: This should be obtained from some dictonary too
ItemIngredient stickIngredient = ItemIngredient.forDictionary("stickWood");
Expand Down
14 changes: 7 additions & 7 deletions worldgen/src/main/java/nova/sample/worldgen/NovaWorldgen.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
import nova.worldgen.ore.Ore;
import nova.worldgen.ore.OreHeight;

@Mod(id = NovaWorldgen.id, name = "Nova Worldgen Example", version = "0.0.1", novaVersion = "0.0.1")
@Mod(id = NovaWorldgen.MOD_ID, name = "Nova Worldgen Example", version = "0.0.1", novaVersion = "0.0.1")
public class NovaWorldgen implements Loadable {
public static final String id = "novaexampleworldgen";
public static final String MOD_ID = "novaexampleworldgen";

public static BlockFactory blockSteelOre;

Expand Down Expand Up @@ -49,15 +49,15 @@ public NovaWorldgen(BlockManager blockManager,

@Override
public void preInit() {
steelOreTexture = renderManager.registerTexture(new BlockTexture(id, "ore_steel"));
steelIngotTexture = renderManager.registerTexture(new ItemTexture(id, "ingot_steel"));
steelOreTexture = renderManager.registerTexture(new BlockTexture(MOD_ID, "ore_steel"));
steelIngotTexture = renderManager.registerTexture(new ItemTexture(MOD_ID, "ingot_steel"));

blockSteelOre = blockManager.register(id + ":steel_ore", BlockSteelOre::new);
itemSteelIngot = itemManager.register(id + ":steel_ingot", ItemSteelIngot::new);
blockSteelOre = blockManager.register(MOD_ID + ":steel_ore", BlockSteelOre::new);
itemSteelIngot = itemManager.register(MOD_ID + ":steel_ingot", ItemSteelIngot::new);

itemBlockSteelOre = itemManager.getItemFromBlock(blockSteelOre);

oreSteel = worldgenManager.register(new Ore(id + ":steel_ore", blockSteelOre, 1, 1,
oreSteel = worldgenManager.register(new Ore(MOD_ID + ":steel_ore", blockSteelOre, 1, 1,
EnumSelector.of(OreHeight.class).blockAll().apart(OreHeight.DEEP).lock()));
}
}