Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

nocot

Members
  • Posts

    18
  • Joined

  • Last visited

nocot's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Hi, I'm planning to create a mod from scratch and I'm wondering if it's the right time to start with 1.13.2, or it will be better to stay with the 1.12 versions. I would like to target into the future, but is the newest Forge already stable enough for regular modding?
  2. Hello, I need a general advice on the entities. Most tutorials found in google on how to create an entity are showing how to make an entity that extends another entity (e.g. how to make custom mob), but I haven't found anything for making an entire entity from scratch. Do you have any general advice or tutorial on how to make an independent entity physically appear in the world? I already know how to register entity, I just don't know how to make it placeable. Let's say I want to make a moving box. I have the entity properly registered, and it has its own class. I have its model and textures ready. What's next?
  3. As I wrote in my first post, this is my RenderHandler class: public class RenderHandler { public static void registerEntityRenders() { RenderingRegistry.registerEntityRenderingHandler(EntityTramc.class, new IRenderFactory<EntityTramc>() { @Override public Render<? super EntityTramc> createRenderFor(RenderManager manager) { return new RenderTramc(manager); }); } } And RenderTramc() : @SideOnly(Side.CLIENT) public class RenderTramc extends RenderMinecart<EntityTramc> { public RenderTramc(RenderManager renderManagerIn) { super(renderManagerIn); this.modelMinecart = new ModelTramc(); System.out.println("RenderTramc loaded"); } ... I know I messed up with something but I still don't get the point. Entities are still quite puzzling to me. EDIT: Note that RenderTramc class is not fully pasted but it's (I think) not needed for help purposes.
  4. Is there a significant case that is making so many people stay with such obsolete Minecraft versions? Is that because of compatibility with some old mods or what?
  5. Hello again; so I'm back into Minecraft modding. I analyzed my code a bit and it seems like an overriding function for rendering function is never being called. And why I think it is so - it's because when I create my own minecart entity, it spawns a regular modelled minecart, without null pointer exception or any graphical issues - and a default minecart model in my entity is never replaced by my mod (I don't mean replace original minecart model, but my modded entity model - default is minecart). So, am I thinking right? Also, I tried to register entity renders in model loader with no luck: @SubscribeEvent public static void modelRegister(ModelLoader event) { if(Minecraft.getMinecraft().world.isRemote) { RenderHandler.registerEntityRenders(); } } ... But I think that it just couldn't work. Can anyone help?
  6. Hi, I've finally got to work my custom minecart entity called EntityTramc which extends EntityMinecart and for testing purposes, it has ride ability turned off and does nothing besides that. And it got to work. To replace a model of minecart into a testing box (which will become a tram soon), I created a class called RenderTramc: @SideOnly(Side.CLIENT) public class RenderTramc extends RenderMinecart<EntityTramc> { public RenderTramc(RenderManager renderManagerIn) { super(renderManagerIn); this.modelMinecart = new ModelTramc(); System.out.println("RenderTramc loaded"); } ... and ModelTramc() is a function in a ModelTramc.class which is auto-generated model class (made by some model creator). To register RenderTramc I created a render handler: public class RenderHandler { public static void registerEntityRenders() { RenderingRegistry.registerEntityRenderingHandler(EntityTramc.class, new IRenderFactory<EntityTramc>() { @Override public Render<? super EntityTramc> createRenderFor(RenderManager manager) { return new RenderTramc(manager); }); } } and called it in a registry handler by subscribe event: @SubscribeEvent public static void onItemRegister(RegistryEvent.Register<Item> event) { event.getRegistry().registerAll(ModItems.ITEMS.toArray(new Item[0])); event.getRegistry().registerAll(ModItems.ITEMS.toArray(new Item[1])); RenderHandler.registerEntityRenders(); } ... I know it's very ugly to call it in that way but I just want to get it work, optimization will come next. A RenderTramc() function is being called at the very beginning of the game (I got the System.out message) but it doesn't change a minecart model at all. I know I've messed up with something but I don't really see where is it. So, any help will be appreciated.
  7. Hello again. I copied ItemMinecart to my own item which I called ItemTram so I can use it like a normal minecart placer. Then I created an entity which temporarly just extends EntityMinecart and do nothing more. The problem started when I tried to change an entity calling function in my ItemTram class: EntityMinecart entityminecart = EntityMinecart.create(world, d0, d1 + d3, d2, ((ItemMinecart)stack.getItem()).minecartType); to call my new entity: EntityTram entityminecart = EntityTram.create(world, d0, d1 + d3, d2, ((ItemTram)stack.getItem()).minecartType); and my entity is: package com.kg.transportmod; import net.minecraft.entity.item.EntityMinecart; import net.minecraft.util.DamageSource; import net.minecraft.world.World; public class EntityTram extends EntityMinecart{ public EntityTram(World worldIn, double x, double y, double z, EntityTram.Type type) { super(worldIn, x, y, z); } @Override public Type getType() { return null; } } Eclipse just gives me an answer that entity tram is not compatible with entity minecart. I can cast to entity tram but a Minecraft gives then a runtime error that it can't be casted to entity tram. What am I doing wrong? Isn't that the way I can copy an entity?
  8. Thank you for the answer. Well, it has to be moving around the world by a track, like a minecart. So I think I'll start with creating an entity based on minecart's one and slightly modifying it. I think it will be a good point to start with entities and to better understand them.
  9. Ahh yeah, forgive me, I'm just a begginner and I just don't understand many things that good. But that's my bad. I must have misinterpretated informations about entities that I've searched, so I must go back and study about it. I think, that's it.
  10. I'm still on deep research part, so I haven't started writing a mod for good. I think a train cannot be loaded as a block if it has to be moveable - but maybe I'm wrong and something has changed. I know that entity stuff will come for me with writing a train physics and so on, but I still think that making an entity just for displaying a 3D model is a way too complicated and I look for other methods. So, making a train an item isn't that bad idea? I heard that a minecart did something like that too.
  11. I'm trying to render a train as a normal 3D object, just as any other block or item in the world; so not as the part of HUD. Is it possible to render it as a 3D item, in a player independent position?
  12. I'm creating a train mod and I need to place a train object that will change its position every frame (to look like it's moving). I found two modelling programs - Tabula and Workbench. The first one creates a class file that is probably a tesselator instruction set. The second one can create .json and .obj file. All I want is to render a model in a fixed position and rotation that can change every frame. So I mean, I just want to call some function like this every frame: @SubscribeEvent public int renderTrain(blahblahEveryFrameEvent event) { renderTrain(MY_MODEL, XPOS, YPOS, ZPOS, ...); } What is the simplest way through loading model and displaying it by calling a function? Do I really have to mess with all the tile entity stuff? Or there is somehow no need to call that function manually?
  13. I'm creating a mod based on external libraries that are making snapshots from videos. My goal is to use these snapshots - made as buffered images - to display them in a GUI. My problem is that when an event is converting a buffered image into a dynamic texture, the game eventually crashes. Despite my tryings, I still get the same error with the same function. Here is my crash report: ---- Minecraft Crash Report ---- // You're mean. Time: 8/1/18 8:10 PM Description: Exception in server tick loop java.lang.RuntimeException: No OpenGL context found in the current thread. at org.lwjgl.opengl.GLContext.getCapabilities(GLContext.java:124) at org.lwjgl.opengl.GL11.glGenTextures(GL11.java:1403) at net.minecraft.client.renderer.GlStateManager.generateTexture(GlStateManager.java:465) at net.minecraft.client.renderer.texture.TextureUtil.glGenTextures(TextureUtil.java:38) at net.minecraft.client.renderer.texture.AbstractTexture.getGlTextureId(AbstractTexture.java:54) at net.minecraft.client.renderer.texture.DynamicTexture.<init>(DynamicTexture.java:30) at net.minecraft.client.renderer.texture.DynamicTexture.<init>(DynamicTexture.java:20) at com.kacpergutowski.rfmod.Main.onPlayerTick(Main.java:144) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_10_Main_onPlayerTick_EntityJoinWorldEvent.invoke(.dynamic) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182) at net.minecraft.world.WorldServer.loadEntities(WorldServer.java:1128) at net.minecraft.world.chunk.Chunk.onLoad(Chunk.java:918) at net.minecraftforge.common.chunkio.ChunkIOProvider.syncCallback(ChunkIOProvider.java:105) at net.minecraftforge.common.chunkio.ChunkIOExecutor.syncChunkLoad(ChunkIOExecutor.java:94) at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:130) at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:101) at net.minecraft.world.gen.ChunkProviderServer.provideChunk(ChunkProviderServer.java:147) at net.minecraft.server.MinecraftServer.initialWorldChunkLoad(MinecraftServer.java:383) at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:143) at net.minecraft.server.integrated.IntegratedServer.init(IntegratedServer.java:160) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:552) at java.lang.Thread.run(Unknown Source) I see that it might be a server/client side problem but I cannot see what exactly is causing that issue. Here is my mod code (so minimalist because I'm just trying to investigate the problem): @Mod(modid = Reference.MOD_ID, name = Reference.NAME, version = Reference.VERSION) public class Main { int i = 0; @Instance public static Main instance; @SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.COMMON_PROXY_CLASS) public static CommonProxy proxy; @EventHandler public void PreInit(FMLPreInitializationEvent event) { } @EventHandler public void Init(FMLInitializationEvent event) { MinecraftForge.EVENT_BUS.register(new com.kacpergutowski.rfmod.events.EventHandler()); MinecraftForge.EVENT_BUS.register(this); } @EventHandler public void PostInit(FMLPostInitializationEvent event) { } @SideOnly(Side.CLIENT) @SubscribeEvent public void onPlayerTick(EntityJoinWorldEvent evt) throws Exception { FFmpegFrameGrabber g = new FFmpegFrameGrabber("C:/Users/Kacper/Documents/file.mp4"); g.start(); Frame f = g.grab(); OpenCVFrameConverter.ToIplImage iplConverter = new OpenCVFrameConverter.ToIplImage(); IplImage img = iplConverter.convert(f); Java2DFrameConverter paintConverter = new Java2DFrameConverter(); BufferedImage image = paintConverter.getBufferedImage(f,1); DynamicTexture texture = new DynamicTexture(image); } } Everything is placed in one event just for testing purposes. For sure my problem is obvious, but I still can't get it. Anyone who can help me with it?
  14. Oh right, I made a mistake. It got to work now, thank you.
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.