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

[1.7.10] Trying to render a Techne Model, error in code?


JohnnyMccurm
 Share

Recommended Posts

Trying to render a Techne Model

 

I get an error in my ClientProxy class that looks like this

 

public class ClientProxy extends CommonProxy {


    public void registerRenderThings()
    {
        //rubble
        TileEntitySpecialRenderer render = new RendererJohnnyBlockRubble();
        ClientRegistry.bindTileEntitySpecialRenderer(TileEntityJohnnyBlockRubble, render);
    }

    public void registerTileEntitySpecialRenderer()
    {

    }

} 

 

Error is the first Parameter in "ClientRegistry.bindTileEntitySpecialRenderer" which would be "TileEntityJohnnyBlockRubble"

 

Any idea what I've done wrong?

 

Here's the code for My BlockJohnnyBlockRubble (The block that will eventually be the techne model

 

public class BlockJohnnyBlockRubble extends BaseJohnnyBlock
{
    public BlockJohnnyBlockRubble()
    {
        super();
        this.setBlockName("johnnyFaceBlockRubble");
        this.setStepSound(soundTypeStone);
        this.setHardness(10.0f);
        this.setResistance(20.0f);
        this.setHarvestLevel("pickaxe", 2);


    }


    public TileEntity createNewTileEntity(World var1, int var2)
    {
        return new TileEntityJohnnyBlockRubble();
    }

    public int getRenderType()
    {
        return 100;
    }

    public boolean isOpaqueCube()
    {
        return false;
    }


    public boolean renderAsNormalBlock()
    {
        return false;
    }




} 

 

 

The "TileEntityJohnnyBlockRubble" class exists but it doesn't contain any code.

 

 

Think Java is tough? try BrainFuck!

Link to comment
Share on other sites

ClientRegistry.bindTileEntitySpecialRenderer(TileEntityJohnnyBlockRubble.class, render);

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Nah, everyone else calls me an asshole because they're too [lazy|stupid|assholish] to go to the effort of helping themselves.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

I have another issue if you feel like helping out.

 

My block is completely invisible.

 

I hear this has something to do with extending the BlockContainer class instead of my BaseBlock

 

But when I do that I get a bunch of errors to do with "material" any idea what I'm doing wrong?

 

Think Java is tough? try BrainFuck!

Link to comment
Share on other sites

You need to supply a material.  Look at all the other blocks:

blockRegistry.addObject(20, "glass", (new BlockGlass(Material.glass, false))...

public BlockStone()
    {
        super(Material.rock); //here
        this.setCreativeTab(CreativeTabs.tabBlock);
    }

 

As for invisible, that has nothing to do with BlockContainer.  You registered a renderer for your block, and likely, it isn't rendering anything.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

I managed to fix it, the renderer is working and this is the un-textured way my model should look, the problem with that code was that I was doing this:

 

public static final BaseJohnnyBlock johnnyFaceBlockRubble = new BlockJohnnyBlockRubble();

 

Instead of this

 

public static final BlockJohnnyBlockRubble johnnyFaceBlockRubble = new BlockJohnnyBlockRubble(Material.rock);

 

 

My texture and name aren't working though now. :(

 

 

**UPDATE**

 

Stupid error to do with my renderer not finding the correct path for my image, my fault for putting "model" instead of "models"

 

last error to fix is the name of the item to be placed, don't know how to fix this one.

 

 

 

 

Think Java is tough? try BrainFuck!

Link to comment
Share on other sites

I managed to fix it, the renderer is working and this is the un-textured way my model should look, the problem with that code was that I was doing this:

 

public static final BaseJohnnyBlock johnnyFaceBlockRubble = new BlockJohnnyBlockRubble();

 

Instead of this

 

public static final BlockJohnnyBlockRubble johnnyFaceBlockRubble = new BlockJohnnyBlockRubble(Material.rock);

 

 

My texture and name aren't working though now. :(

 

Can you show your renderer?

I'm back from being gone for... I think its been about a year. I'm pretty sure nobody remembers me, but hello anybody who does!

Link to comment
Share on other sites

last error to fix is the name of the item to be placed, don't know how to fix this one.

 

Lang files.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I didn't put in credentials, I used it only for testing installing forge. But still the problem mentioned above.
    • I am trying to use Forge 1.18.2, I have checked my firewall, redownloaded Forge, deleted the fml.toml file (which keeps reappearing) and looked at countless help pages. I am just trying to download and use forge so that I can play with my friends and it will not download. It tells me there may be an issue with the Java runtime config and that the exit code is one, and I have copied the exit code.   
    • Okay, i think i understand but im getting issues, i create another packet to sync entity to another players like this package com.naim.belloto.networking.packet; import com.naim.belloto.networking.handler.ClientSyncHandler; import net.minecraft.client.Minecraft; import net.minecraft.network.FriendlyByteBuf; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.network.NetworkEvent; import java.util.Objects; import java.util.function.Supplier; public class ClientSyncPacket { public ClientSyncPacket() { } public ClientSyncPacket(FriendlyByteBuf buf) { } public void toBytes(FriendlyByteBuf buf) { } public boolean handle(Supplier<NetworkEvent.Context> ctx) { NetworkEvent.Context context = ctx.get(); context.enqueueWork(() -> { assert Minecraft.getInstance().player != null; int idplayer = Minecraft.getInstance().player.getId(); DistExecutor.unsafeCallWhenOn(Dist.CLIENT,() -> () -> ClientSyncHandler.handlePacket(ctx, idplayer)); }); return true; } } And in the handler: public class ClientSyncHandler { public static boolean handlePacket(Supplier<NetworkEvent.Context> ctx, int idPlayer) { Minecraft.getInstance().level.getEntity(idPlayer); return true; } } But is not working :// 
    • I want to make a modded server on mac but I cant run a .bat file and it does not generate other .jar files so how can i make the server work (its 1.18.2 forge version 40.1.73)
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.