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

Wehavecookies56

Members
  • Content Count

    33
  • Joined

  • Last visited

Posts posted by Wehavecookies56

  1. So in my mod I have a bunch of materials that are all the same item but with different NBT data which means in order to use them as ingredients in recipes I need to use the type minecraft:item_nbt or make a IngredientFactory, both methods cause the same issues I that I will explain after this.

    So here is my recipe json file first of all

    {
    	"type": "forge:ore_shapeless",
    	"ingredients": [ 
    		{ 
    			"type": "minecraft:item_nbt",
    			"item": "kk:synthesismaterial",
    			"nbt": {
    				"material": "sm.mythrilcrystal",
    				"rank": "sm.rank.s"
    			}
    		}, 
    		{ 
    			"type": "forge:ore_dict",
    			"ore": "gemDiamond"
    		}
    	],
    	"result": {
    		"item": "kk:mythrilinfuseddiamond"
    	}
    }

    So as you can see it's a shapeless recipe that uses a diamond and the material from my mod with some NBT tags.The NBT sensitive ingredient works or at least appears to work fine.

    Now the first problem is that when using the recipe book, the diamond is placed into the crafting grid but not the material from my mod however, it will not show as craft able if you don't have the material. Only really a minor problem.

    A major problem I have is that the recipe will only work if my mod material is placed in the grid with a stack size of 1.

    As you can see in the image below the recipe works

    8byTMGG.png

    However if the stack size is greater than 1 when placed in the grid it will not work

    CxOEIzF.png

    It will work though if I increase the stack size afterwards like so

    HTExXU0.png

    But after I take the result out this happens

    MifeQhJ.png

    And if the stack size of the diamond is greater than 1 as well as the material from my mod the same thing happens with both

    X8Z6Ohk.png

    If the material from my mod has a stack size of 1 but the diamonds have a stack size greater than 1 it will take 1 diamond and work as intended.

    So this is quite a major issue as it allows for easy duplication. I'm have no clue what's causing this but I think it's something I need to do to fix it rather than a forge/vanilla issue as I haven't seen anyone else have this issue.

    Any help is appreciated, thanks.

  2. Now that you mention where it's been registered...

    It's all my fault just checked again where I had it registered and well it was registered in both the init and postInit, now it makes sense why it was firing twice xD

    So no problem here everything is working fine -_-

  3. So am I right in saying that ClientTickEvent should fire twice each tick? 1 for the start phase and 1 for the end phase.

    Since I have found that it fires twice per phase each tick, I simply made it print the phase and I get this:

    [11:33:11] [main/INFO] [STDOUT]: [uk.co.wehavecookies56.kk.client.core.handler.ClientEventHandler:onClientTick:26]: START
    [11:33:11] [main/INFO] [STDOUT]: [uk.co.wehavecookies56.kk.client.core.handler.ClientEventHandler:onClientTick:26]: START
    [11:33:11] [main/INFO] [STDOUT]: [uk.co.wehavecookies56.kk.client.core.handler.ClientEventHandler:onClientTick:26]: END
    [11:33:11] [main/INFO] [STDOUT]: [uk.co.wehavecookies56.kk.client.core.handler.ClientEventHandler:onClientTick:26]: END
    [11:33:11] [main/INFO] [STDOUT]: [uk.co.wehavecookies56.kk.client.core.handler.ClientEventHandler:onClientTick:26]: START
    [11:33:11] [main/INFO] [STDOUT]: [uk.co.wehavecookies56.kk.client.core.handler.ClientEventHandler:onClientTick:26]: START
    [11:33:11] [main/INFO] [STDOUT]: [uk.co.wehavecookies56.kk.client.core.handler.ClientEventHandler:onClientTick:26]: END
    [11:33:11] [main/INFO] [STDOUT]: [uk.co.wehavecookies56.kk.client.core.handler.ClientEventHandler:onClientTick:26]: END
    [11:33:11] [main/INFO] [STDOUT]: [uk.co.wehavecookies56.kk.client.core.handler.ClientEventHandler:onClientTick:26]: START
    [11:33:11] [main/INFO] [STDOUT]: [uk.co.wehavecookies56.kk.client.core.handler.ClientEventHandler:onClientTick:26]: START

    Here's my event handler code:
     

    @SubscribeEvent
    public void onClientTick(TickEvent.ClientTickEvent event) {
    	System.out.println(event.phase);
    }

    This means that even after checking for a phase everything is run twice in the same tick. Which seemingly I can't prevent as any checks to prevent things from running a second time do not work as they happen at the same time.

    If I am wrong about how the event works and that it firing twice per phase is how it is supposed to work how should I prevent code being run twice in the end or start phase?

  4. 8 minutes ago, diesieben07 said:

    Please post logs.

    Here it is, just happened again

    [21:18:25] [Netty Server IO #7/INFO] [FML]: Client attempting to join with 5 mods : minecraft@1.12,FML@8.0.99.99,forge@14.21.1.2443,bonfires@1.1.2,mcp@9.19
    [21:18:25] [Netty Local Client IO #3/ERROR] [FML]: HandshakeMessageHandler exception
    java.lang.ClassCastException: net.minecraftforge.fml.common.network.handshake.FMLHandshakeMessage$ServerHello cannot be cast to net.minecraftforge.fml.common.network.handshake.FMLHandshakeMessage$ModList
    	at net.minecraftforge.fml.common.network.handshake.FMLHandshakeClientState$3.accept(FMLHandshakeClientState.java:99) ~[FMLHandshakeClientState$3.class:?]
    	at net.minecraftforge.fml.common.network.handshake.FMLHandshakeClientState$3.accept(FMLHandshakeClientState.java:94) ~[FMLHandshakeClientState$3.class:?]
    	at net.minecraftforge.fml.common.network.handshake.HandshakeMessageHandler.channelRead0(HandshakeMessageHandler.java:48) ~[HandshakeMessageHandler.class:?]
    	at net.minecraftforge.fml.common.network.handshake.HandshakeMessageHandler.channelRead0(HandshakeMessageHandler.java:30) ~[HandshakeMessageHandler.class:?]
    	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) ~[SimpleChannelInboundHandler.class:4.1.9.Final]
    	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [AbstractChannelHandlerContext.class:4.1.9.Final]
    	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [AbstractChannelHandlerContext.class:4.1.9.Final]
    	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [AbstractChannelHandlerContext.class:4.1.9.Final]
    	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) [MessageToMessageDecoder.class:4.1.9.Final]
    	at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) [MessageToMessageCodec.class:4.1.9.Final]
    	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [AbstractChannelHandlerContext.class:4.1.9.Final]
    	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [AbstractChannelHandlerContext.class:4.1.9.Final]
    	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [AbstractChannelHandlerContext.class:4.1.9.Final]
    	at net.minecraftforge.fml.common.network.handshake.ChannelRegistrationHandler.channelRead0(ChannelRegistrationHandler.java:53) [ChannelRegistrationHandler.class:?]
    	at net.minecraftforge.fml.common.network.handshake.ChannelRegistrationHandler.channelRead0(ChannelRegistrationHandler.java:36) [ChannelRegistrationHandler.class:?]
    	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [SimpleChannelInboundHandler.class:4.1.9.Final]
    	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [AbstractChannelHandlerContext.class:4.1.9.Final]
    	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [AbstractChannelHandlerContext.class:4.1.9.Final]
    	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [AbstractChannelHandlerContext.class:4.1.9.Final]
    	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334) [DefaultChannelPipeline$HeadContext.class:4.1.9.Final]
    	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [AbstractChannelHandlerContext.class:4.1.9.Final]
    	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [AbstractChannelHandlerContext.class:4.1.9.Final]
    	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926) [DefaultChannelPipeline.class:4.1.9.Final]
    	at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:274) [EmbeddedChannel.class:4.1.9.Final]
    	at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.handleClientSideCustomPacket(NetworkDispatcher.java:390) [NetworkDispatcher.class:?]
    	at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:274) [NetworkDispatcher.class:?]
    	at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:74) [NetworkDispatcher.class:?]
    	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [SimpleChannelInboundHandler.class:4.1.9.Final]
    	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [AbstractChannelHandlerContext.class:4.1.9.Final]
    	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [AbstractChannelHandlerContext.class:4.1.9.Final]
    	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [AbstractChannelHandlerContext.class:4.1.9.Final]
    	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334) [DefaultChannelPipeline$HeadContext.class:4.1.9.Final]
    	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [AbstractChannelHandlerContext.class:4.1.9.Final]
    	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [AbstractChannelHandlerContext.class:4.1.9.Final]
    	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926) [DefaultChannelPipeline.class:4.1.9.Final]
    	at io.netty.channel.local.LocalChannel.finishPeerRead0(LocalChannel.java:443) [LocalChannel.class:4.1.9.Final]
    	at io.netty.channel.local.LocalChannel.access$500(LocalChannel.java:49) [LocalChannel.class:4.1.9.Final]
    	at io.netty.channel.local.LocalChannel$5.run(LocalChannel.java:397) [LocalChannel$5.class:4.1.9.Final]
    	at io.netty.channel.DefaultEventLoop.run(DefaultEventLoop.java:54) [DefaultEventLoop.class:4.1.9.Final]
    	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858) [SingleThreadEventExecutor$5.class:4.1.9.Final]
    	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_112]
    [21:18:25] [Netty Local Client IO #3/ERROR] [FML]: NetworkDispatcher exception
    java.lang.ClassCastException: net.minecraftforge.fml.common.network.handshake.FMLHandshakeMessage$ServerHello cannot be cast to net.minecraftforge.fml.common.network.handshake.FMLHandshakeMessage$ModList
    	at net.minecraftforge.fml.common.network.handshake.FMLHandshakeClientState$3.accept(FMLHandshakeClientState.java:99) ~[FMLHandshakeClientState$3.class:?]
    	at net.minecraftforge.fml.common.network.handshake.FMLHandshakeClientState$3.accept(FMLHandshakeClientState.java:94) ~[FMLHandshakeClientState$3.class:?]
    	at net.minecraftforge.fml.common.network.handshake.HandshakeMessageHandler.channelRead0(HandshakeMessageHandler.java:48) ~[HandshakeMessageHandler.class:?]
    	at net.minecraftforge.fml.common.network.handshake.HandshakeMessageHandler.channelRead0(HandshakeMessageHandler.java:30) ~[HandshakeMessageHandler.class:?]
    	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) ~[SimpleChannelInboundHandler.class:4.1.9.Final]
    	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) ~[AbstractChannelHandlerContext.class:4.1.9.Final]
    	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) ~[AbstractChannelHandlerContext.class:4.1.9.Final]
    	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) ~[AbstractChannelHandlerContext.class:4.1.9.Final]
    	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) ~[MessageToMessageDecoder.class:4.1.9.Final]
    	at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:4.1.9.Final]
    	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) ~[AbstractChannelHandlerContext.class:4.1.9.Final]
    	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) ~[AbstractChannelHandlerContext.class:4.1.9.Final]
    	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) ~[AbstractChannelHandlerContext.class:4.1.9.Final]
    	at net.minecraftforge.fml.common.network.handshake.ChannelRegistrationHandler.channelRead0(ChannelRegistrationHandler.java:53) ~[ChannelRegistrationHandler.class:?]
    	at net.minecraftforge.fml.common.network.handshake.ChannelRegistrationHandler.channelRead0(ChannelRegistrationHandler.java:36) ~[ChannelRegistrationHandler.class:?]
    	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) ~[SimpleChannelInboundHandler.class:4.1.9.Final]
    	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) ~[AbstractChannelHandlerContext.class:4.1.9.Final]
    	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) ~[AbstractChannelHandlerContext.class:4.1.9.Final]
    	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) ~[AbstractChannelHandlerContext.class:4.1.9.Final]
    	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334) ~[DefaultChannelPipeline$HeadContext.class:4.1.9.Final]
    	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [AbstractChannelHandlerContext.class:4.1.9.Final]
    	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [AbstractChannelHandlerContext.class:4.1.9.Final]
    	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926) ~[DefaultChannelPipeline.class:4.1.9.Final]
    	at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:274) ~[EmbeddedChannel.class:4.1.9.Final]
    	at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.handleClientSideCustomPacket(NetworkDispatcher.java:390) ~[NetworkDispatcher.class:?]
    	at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:274) ~[NetworkDispatcher.class:?]
    	at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:74) ~[NetworkDispatcher.class:?]
    	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) ~[SimpleChannelInboundHandler.class:4.1.9.Final]
    	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [AbstractChannelHandlerContext.class:4.1.9.Final]
    	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [AbstractChannelHandlerContext.class:4.1.9.Final]
    	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [AbstractChannelHandlerContext.class:4.1.9.Final]
    	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334) [DefaultChannelPipeline$HeadContext.class:4.1.9.Final]
    	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [AbstractChannelHandlerContext.class:4.1.9.Final]
    	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [AbstractChannelHandlerContext.class:4.1.9.Final]
    	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926) [DefaultChannelPipeline.class:4.1.9.Final]
    	at io.netty.channel.local.LocalChannel.finishPeerRead0(LocalChannel.java:443) [LocalChannel.class:4.1.9.Final]
    	at io.netty.channel.local.LocalChannel.access$500(LocalChannel.java:49) [LocalChannel.class:4.1.9.Final]
    	at io.netty.channel.local.LocalChannel$5.run(LocalChannel.java:397) [LocalChannel$5.class:4.1.9.Final]
    	at io.netty.channel.DefaultEventLoop.run(DefaultEventLoop.java:54) [DefaultEventLoop.class:4.1.9.Final]
    	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858) [SingleThreadEventExecutor$5.class:4.1.9.Final]
    	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_112]

     

  5. sounds like u need to do some kind of GL rotating, not rotating the texture

     

    I tried doing that, the problem is getting it perfectly aligned with the player.

    I have some really bad memories associated with aligning models with players...

    I was rendering a .obj model as a sword and I just to keep on trying with different numbers and then restart minecraft, till I found the perfect match. It was a painstaking process that took a long time.

    Then after I finished spending hours on trying to align it, I found out that in debugging mode, it will change it without you having to restart minecraft. So, just run it in debug mode and try looking for the perfect numbers, till its aligned with the player.

     

    But even if I do this it does not rotate with the player so it would be misaligned as soon as I move.

  6. Well, I am not sure about the turning part, but the part about the upside-down-ness may be able to be fixed if in the texture itself, you may want to flip it 180°, and therefore solving that

     

    While that kinda would solve that, the legs are rendered above the body which suggests it is rendering the models upside down.

  7. Hello, I am trying to render a model over the player similar to armour but cannot align the position of the models with the player. I have been using ModelBiped but would much rather be able to use the armour model. I cannot figure out how to render it in the same position as the player while also rotating it with the player.

    What I ultimately want to achieve is to render armour on the player with my textures while keeping the player rendered underneath.

    So I have 2 questions.

    How can I align the model with the player?

    How can I render the armour model rather than player model?

    I am using PlayerRenderEvent.Post to render it, here's the code.

            @SubscribeEvent
    public void onRenderPlayer(RenderPlayerEvent.Post event){
    	Minecraft mc = Minecraft.getMinecraft();
    	ModelBiped main = event.renderer.getMainModel();
    	ModelBiped drive = new ModelBiped();
    
    	float base = 0.0625f;
    
    	GL11.glPushMatrix();
    
    	mc.renderEngine.bindTexture(new ResourceLocation("kk:textures/armour/Valor_A.png"));
    
    	//Body and arms
    	ModelBiped.copyModelAngles(main.bipedBody, drive.bipedBody);
    	ModelBiped.copyModelAngles(main.bipedLeftArm, drive.bipedLeftArm);
    	ModelBiped.copyModelAngles(main.bipedRightArm, drive.bipedRightArm);
    
    	drive.bipedBody.render(base);
    	drive.bipedLeftArm.render(base);
    	drive.bipedRightArm.render(base);
    
    	//Legs
    	mc.renderEngine.bindTexture(new ResourceLocation("kk:textures/armour/Valor_B.png"));
    
    	ModelBiped.copyModelAngles(main.bipedLeftLeg, drive.bipedLeftLeg);
    	ModelBiped.copyModelAngles(main.bipedRightLeg, drive.bipedRightLeg);
    
    	drive.bipedLeftLeg.render(base);
    	drive.bipedRightLeg.render(base);
    
    	GL11.glPopMatrix();
    }
    

     

    This produces:

    I3e1Y3f.png

     

    It looks fine it's just upside down and doesn't rotate with the player. Although the arms and legs move when walking.

    I'm clearly doing something wrong or have missed out something.

     

    Any help is appreciated, thanks.

  8. It seems like the RenderEntityItemMetalChocobo isn't being used as when trying to print something in the constructor it never prints. And changing anything in the class does nothing to it.

     

    That's probably because your rendering class is never being called. It's called when your custom entity item is spawned, and you haven't done that yet. Your entity class and rendering class looks good, you just need to subscribe to the EntityJoinWorldEvent and spawn your custom entity item there.

     

    EDIT: Not sure if the custom entity item is assigned to your item by overriding item methods like you did above. If you don't get that working, I would try the suggestion above.

     

    The entity is spawning fine, I checked that by making it print stuff. Item#createEntity handles the spawning so there is no need to use EntityJoinWorldEvent unless you are changing the entity of a vanilla item like Ernio stated. Although the custom entity spawns fine the render class doesn't seem to work at all.

  9. I don't think that the loader supports Materials. But other than that, how did you made your b3d models work? My models still error with no root mesh in model location error. I tried everything in the json files, but i can't get it working.

     

    In Blender you need to make sure you have one object that is named "mesh"

    If you have multiple objects select all of them and press Ctrl+J to merge them.

    Like this:

    wiXcdox.png

  10. Proper way of handling such stuff is to extend EntityItem with CustomEntityItem (you can also use it do anything else you want, not just rendering).

     

    For vanilla items:

    Subscribe to EntityJoinWorldEvent - check if event.entity instanceof EntityItem, if so - cancel normal spawning and spawn your own CustomEntityItem.

    Note that while you can cancel joining on both sides (doesn't matter really), the spawning occurs only on server side.

     

    For your own:

    Item#hasCustomEntity and Item#createEntity to spawn a custom EntityItem

     

    Next:

    Extend RenderEntityItem / RenderItem and edit it with what you require.

     

    In ClientProxy#init() (NOT preInit), call:

    RenderingRegistry.registerEntityRenderingHandler(CustomEntityItem.class, new RenderCustomEntityItem());
    

     

    As of now you can use custom rendering implementation to all items in world replaced by your CustomEntityItem. (You can/don't have to even use model system).

     

    Thanks Ernio!

     

    I've just tried this but the renderer is not working. The dropped item still has the same appearance. I've probably done something wrong.

     

    Here's my Entity class

    public class EntityItemMetalChocobo extends EntityItem {
    
    public EntityItemMetalChocobo(World world) {
    	super(world);
    }
    
    public EntityItemMetalChocobo(World worldIn, double x, double y, double z, ItemStack stack) {
    	super(worldIn, x, y, z, stack);
    }
    }
    

     

    Here's my RenderEntityItem class

    public class RenderEntityItemMetalChocobo extends RenderEntityItem {
    
    public RenderEntityItemMetalChocobo() {
    	super(Minecraft.getMinecraft().getRenderManager(), Minecraft.getMinecraft().getRenderItem());
    	System.out.println("Render Entity Item");
    }
    
    @Override
    public void doRender(Entity entity, double x, double y, double z, float p_76986_8_, float partialTicks) {
    	GlStateManager.scale(0.02f, 0.02f, 0.02f);
    }
    
    }
    

     

    Here's my item class

    public class ItemMetalChocobo extends ItemKeyblade {
    
    public ItemMetalChocobo(ToolMaterial material) {
    	super(material);
    }
    
    @Override
    public boolean hasCustomEntity(ItemStack stack) {
    	return true;
    }
    
    @Override
    public Entity createEntity(World world, Entity location, ItemStack itemstack) {
    	return new EntityItemMetalChocobo(world, location.posX, location.posY, location.posZ, itemstack);
    }
    
    }
    

     

    And finally here's what I put in the client proxy init

    RenderingRegistry.registerEntityRenderingHandler(EntityItemMetalChocobo.class, new RenderEntityItemMetalChocobo());
    

  11. So I have an item which is using a .b3d model which is working great. The model is huge so I have to scale it down as well as adjust the rotations. But when I drop the item on the floor none of the transformations are applied. I was wondering how you would transform the model when it is on the ground.

    Here's what it looks like on the ground. As you can see it is huge.

    twhptYI.png

  12. Awesome. also, it is possible to render entities with it somehow, but ill have to have a close look at this. aswell as at the animation thing :D

     

    Yeah animations is something I'd love to figure out how to do. Entities will probably be quite easy.

     

    Well I'll mark this thread as solved, I'll probably end up making a tutorial for this on youtube.

  13. I tried placing the model in the block folder - I'm rendering an item though. When I do that I get a FileNotFoundException saying it needs to be placed in the item folder - that tells me there that it definitely needs to be in the models/item folder. Also, we know that the .JSON has to be in the blockstates folder. There is probably something wrong with my model...

     

    I've found the solution to your problem! I just tried adding my second model and I had the same error as you. It turns out you need to merge your model into 1 object which you can do by pressing A then Ctrl+J

     

    Then rename the object to "mesh" like this:

    wiXcdox.png

  14. No its not, i actually think it is superawesome you know why? Cuz you can ANIMATE IT!! But nevertheless, i can't get the loading process done. What excactly belongs into the json files?

    The models/blocks file i did that:

    {
        "forge_marker": 1,
        "defaults": {
            "textures": {
                "texture": "reallifemod:textures/models/blocks/texture_Lantern.png"
                },
            "model": "reallifemod:lantern.b3d"
        },
        "variants": {
            "inventory": [
                {
                    "transform": {
                        "thirdperson": {
                            "scale": 0.02
                        },
                        "gui": {
                            "scale": 0.02
                        },
                        "firstperson": {
                            "scale": 0.02
                        }
                    }
                }
            ]
        }
    }
    

     

    The same in the blockstate

    and in the itemfile this:

    {
        "parent": "reallifemod:blockLantern",
        "textures": {
            "all": "reallifemod:textures/models/block/texture_Lantern.png"
        }
    }
    

     

    You shouldn't need a .json file in /models/block/ or /models/item/ The first .json file should be all you need in the blockstates folder. The .b3d should be in the /models/item/ if it's an item or /models/block if it's a block.

     

    Also you might want to up the scale :P I have it at 0.02 because my model is HUGE.

     

    I probably should start a new thread for this, but how do you animate it?

×
×
  • Create New...

Important Information

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