Closed calclavia closed 7 years ago
@@ master #202 diff @@
==========================================
Files 394 394
Lines 11150 11148 -2
Methods 0 0
Messages 0 0
Branches 1586 1586
==========================================
- Hits 1581 1576 -5
- Misses 9483 9485 +2
- Partials 86 87 +1
Powered by Codecov. Last update 1de7378...822187a
Not working with my new code:
http://mod.learntomod.com/programs/sarah-Test_Explosion?remix=sarah-Test_Explosion&fullscreen=true&language=javascript
I get the following error:
nova.internal.core.launch.InitializationException: ItemConverter: Missing block: test_explode
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at nova.core.wrapper.mc.forge.v18.wrapper.item.ItemConverter.registerNOVAItem(ItemConverter.java:197)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at nova.core.wrapper.mc.forge.v18.wrapper.item.ItemConverter.onItemRegistered(ItemConverter.java:180)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at nova.core.wrapper.mc.forge.v18.wrapper.item.ItemConverter$$Lambda$113/1479104433.onEvent(Unknown Source)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at nova.core.event.bus.EventBus$TypedEventListener.onEvent(EventBus.java:251)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at nova.core.event.bus.EventBus.lambda$publish$19(EventBus.java:130)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at nova.core.event.bus.EventBus$$Lambda$56/1789921558.accept(Unknown Source)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1374)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at java.util.stream.ReferencePipeline$Head.forEachOrdered(ReferencePipeline.java:590)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at nova.core.event.bus.EventBus.publish(EventBus.java:130)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at nova.core.item.ItemManager.register(ItemManager.java:56)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at nova.core.item.ItemManager.register(ItemManager.java:50)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at nova.core.block.BlockFactory.lambda$new$3(BlockFactory.java:44)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at nova.core.block.BlockFactory$$Lambda$92/120261450.onEvent(Unknown Source)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at nova.core.event.bus.EventBus$TypedEventListener.onEvent(EventBus.java:251)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at nova.core.event.bus.EventBus.lambda$publish$19(EventBus.java:130)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at nova.core.event.bus.EventBus$$Lambda$56/1789921558.accept(Unknown Source)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1374)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at java.util.stream.ReferencePipeline$Head.forEachOrdered(ReferencePipeline.java:590)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at nova.core.event.bus.EventBus.publish(EventBus.java:130)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at nova.core.block.BlockManager.register(BlockManager.java:62)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at nova.core.wrapper.mc.forge.v18.wrapper.block.BlockConverter.lambda$registerMinecraftToNOVA$15(BlockConverter.java:110)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at nova.core.wrapper.mc.forge.v18.wrapper.block.BlockConverter$$Lambda$116/269230754.accept(Unknown Source)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at java.lang.Iterable.forEach(Iterable.java:75)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at nova.core.wrapper.mc.forge.v18.wrapper.block.BlockConverter.registerMinecraftToNOVA(BlockConverter.java:109)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at nova.core.wrapper.mc.forge.v18.wrapper.block.BlockConverter.preInit(BlockConverter.java:102)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at nova.core.wrapper.mc.forge.v18.launcher.NovaMinecraft$$Lambda$112/285807493.accept(Unknown Source)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1540)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at java.util.stream.ReferencePipeline$Head.forEachOrdered(ReferencePipeline.java:590)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at nova.core.wrapper.mc.forge.v18.launcher.NovaMinecraft.preInit(NovaMinecraft.java:156)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at java.lang.reflect.Method.invoke(Method.java:497)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:537)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at java.lang.reflect.Method.invoke(Method.java:497)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at com.google.common.eventbus.EventBus.post(EventBus.java:275)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:212)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:190)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at java.lang.reflect.Method.invoke(Method.java:497)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at com.google.common.eventbus.EventBus.post(EventBus.java:275)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:119)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:550)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:249)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.Minecraft.startGame(Minecraft.java:412)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.Minecraft.run(Minecraft.java:325)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.main.Main.main(Main.java:117)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at java.lang.reflect.Method.invoke(Method.java:497)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)
[18:27:55] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at GradleStart.main(Unknown Source)
When I run the code using my Simple files: SimpleBlockUtil:
package nova.simple;
import com.thoughtstem.learntomod.launcher.LearnToMod;
import nova.core.block.Block;
import nova.core.block.BlockFactory;
import nova.core.component.Category;
import nova.core.component.misc.Collider;
import nova.core.component.renderer.ItemRenderer;
import nova.core.component.renderer.StaticRenderer;
import nova.core.render.pipeline.BlockRenderPipeline;
import nova.core.render.texture.BlockTexture;
import nova.core.util.shape.Cuboid;
import java.util.ArrayList;
/**
* This class contains all the methods required for creating new Minecraft
* blocks with custom textures and events.
*
* @author sarahguthals
* @since 9/16/15.
*/
public class SimpleBlockUtil {
private static ArrayList<BlockTexture> textureList = new ArrayList<> ();
private static ArrayList<Block> blockList = new ArrayList<>();
/**
* Returns a BlockFactory that will create the new block when placed in the world.
* <p>
* This method requires that the list of event triggers and event handlers are the same
* size and are paired in the correct order.
*
* @param name The name of the block that the BlockFactory creates.
* @param category The category that the block will be in the inventory.
* @param textureDomain The domain where the texture of the block can be found.
* @param texture The name of the texture for all 6 sides of the block.
* @param eventRegisters The list of event triggers and event handlers.
* @return The BlockFactory needed to create this new block.
*/
public static BlockFactory makeBlock(String name, String category, String textureDomain, String texture, ArrayList<EventRegister> eventRegisters) {
return LearnToMod.instance.blockManager.register(name, () -> {
Block block = new Block();
block.components.add(new Category(category));
BlockTexture blockTexture = new BlockTexture(textureDomain, texture);
block.components
.add(new StaticRenderer())
.onRender(
new BlockRenderPipeline(block)
.withTexture(blockTexture)
.build()
);
if (!textureDomain.equals("minecraft")) {
textureList.add(blockTexture);
}
block.components.add(new ItemRenderer(block));
block.components
.add(new Collider(block))
.setBoundingBox(new Cuboid(0, 0, 0, 1, 1, 1))
.isCube(true)
.isOpaqueCube(true);
for(int i =0; i < eventRegisters.size();i++) {
EventRegister eventRegister = eventRegisters.get(i);
block.events.on(eventRegister.getEvent()).bind(eventRegister.getHandler());
}
//A list of all of the new blocks that are being created
blockList.add(block);
return block;
});
}
public static BlockFactory makeBlock(String name, String category, String textureDomain, String texture, EventRegister eventRegister) {
ArrayList<EventRegister> eventRegisters = new ArrayList<>();
eventRegisters.add(eventRegister);
return makeBlock(name, category, textureDomain, texture, eventRegisters);
}
public static boolean newTexturesExist () {
if (textureList.size() > 0)
return true;
return false;
}
public static ArrayList<BlockTexture> newTextures () {
return textureList;
}
public static boolean newBlocksExist () {
if(blockList.size() > 0)
return true;
return false;
}
public static ArrayList<Block> newBlocks () {
return blockList;
}
}
EventRegister:
package nova.simple;
import nova.core.event.bus.Event;
import nova.core.event.bus.EventListener;
/**
*
* Created by sarahguthals on 9/24/15.
*/
public class EventRegister {
private Class<Event> event;
private EventListener<Event> handler;
private EventRegister(Class<Event> event, EventListener<Event> handler){
this.event = event;
this.handler = handler;
}
public static EventRegister createEventRegister(Class<Event> event, EventListener<Event> handler){
return new EventRegister(event, handler);
}
public Class<Event> getEvent() { return event; }
public EventListener<Event> getHandler() { return handler; }
}
BlockEvents:
package nova.simple;
import nova.core.world.World;
import org.apache.commons.math3.geometry.euclidean.threed.Vector3D;
/**
* Created by sarahguthals on 9/28/15.
*/
public class BlockEvents {
public static void removeBlock(World world, Vector3D block_position){
world.removeBlock(block_position);
}
public static void printme(String printout) {
System.out.println(printout);
}
}
I can make this error not happen (and the code runs correctly) when I move:
launcher.load()
in NovaMinecraft.java to be after the instantiation of the native loaders:
//TODO: I get "Missing mapping for texture" when I do the load here
//launcher.load();
/**
* Instantiate native loaders
*/
nativeConverters = Game.natives().getNativeConverters().stream().filter(n -> n instanceof Loadable).map(n -> (Loadable) n).collect(Collectors.toSet());
nativeConverters.stream().forEachOrdered(Loadable::preInit);
//TODO: The problem goes away when I move it here
launcher.load();
FYI @smesper, I've fixed the formatting in your comment, the correct multiline code block syntax is:
code
Can also take a syntax highlighting langauge:
```java
package xxx;
class xxx {}
Thank you @RX14!
@sguthals Based on the change you proposed for the NovaMinecraft.java
file, you are probably doing block registration wrong, as blocks must be registered in the preInit()
stage (or the BlockManager.Init
event) and not the load()
/mod constructor stage.
Please verify this, @sguthals.