Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

so i have a block which has TileEntity, it renders as an invisible block. with

@Override
   public int getRenderType() {
      return 3;
   }

it renders as an untextured block but i want it to render model of my json file... can anyone help?

~thanks

"The cycle of life and death continues. We will live, they will die."

  • Author

this is how i registered my tile entity:

 public class Te {

public static void register() {
	GameRegistry.registerTileEntity(TileEntityDistillery.class, Reference.MOD_ID);

}

}

 @EventHandler
public void preInit(FMLPreInitializationEvent event)
{
	Te.register();				
}

 

and this is my block class:

public class BlockDistillery extends BlockContainer{

    public BlockDistillery()
    {
        super(Material.rock);
        setUnlocalizedName("distillery");
        setCreativeTab(Kudo.tabKudo);
        
    }

    @Override
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) {
	if (worldIn.isRemote) return true;

	playerIn.openGui(Kudo.instance, GUIHandler.getGuiID(), worldIn, pos.getX(), pos.getY(), pos.getZ());
	return true;
}
    
    @Override
public boolean isOpaqueCube() {
	return false;
}	

@Override
public boolean isFullCube() {
	return false;
}

@SideOnly(Side.CLIENT)
    public EnumWorldBlockLayer getBlockLayer()
    {
        return EnumWorldBlockLayer.CUTOUT;
    }

@Override
   public int getRenderType() {
      return 3;
   }

    @Override
    public TileEntity createNewTileEntity(World worldIn, int meta){
        return new TileEntityDistillery();
    }
}    

"The cycle of life and death continues. We will live, they will die."

  • Author

public class Bs {
public static Block distillery;

public static void init(){
	distillery = new BlockDistillery();

}

public static void register(){
	GameRegistry.registerBlock(distillery, distillery.getUnlocalizedName().substring(5));


}

public static void registerRenders(){
	registerRender(distillery);
}

public static void registerRender(Block block){
	Item item = Item.getItemFromBlock(block);
	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Reference.MOD_ID + ":" + item.getUnlocalizedName().substring(5), "inventory"));
}
}

@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
	Te.register();
        Bs.init();
	Bs.register();	
}

... any ideas?

"The cycle of life and death continues. We will live, they will die."

  • Author

public class ClientProxy extends CommonProxy{
@Override
public void registerRenders(){
	Bs.registerRenders();
}

public class CommonProxy {
public void registerRenders(){

}

 

@EventHandler
public void Init(FMLInitializationEvent event)
{
	proxy.registerRenders();

"The cycle of life and death continues. We will live, they will die."

  • Author

assets/kudo/blockstates :

{
    "variants": {
        "facing=north": { "model": "kudo:distillery" },
        "facing=east":  { "model": "kudo:distillery", "y": 90 },
        "facing=south": { "model": "kudo:distillery", "y": 180 },
        "facing=west":  { "model": "kudo:distillery", "y": 270 }
    }
}

assets/kudo/models/block :

{
    "textures": {
        "0": "kudo:blocks/distillery",
        "1": "kudo:blocks/distillery_top",
        "2": "blocks/iron_bars"
    },
    "elements": [
        {
            "name": "bot",
            "from": [ 0.0, 0.0, 0.0 ], 
            "to": [ 16.0, 2.0, 16.0 ], 
            "faces": {
                "north": { "texture": "#0", "uv": [ 0.0, 14.0, 16.0, 16.0 ] },
                "east": { "texture": "#0", "uv": [ 0.0, 14.0, 16.0, 16.0 ] },
                "south": { "texture": "#0", "uv": [ 0.0, 14.0, 16.0, 16.0 ] },
                "west": { "texture": "#0", "uv": [ 0.0, 14.0, 16.0, 16.0 ] },
                "up": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 16.0 ] },
                "down": { "texture": "#1", "uv": [ 3.0, 3.0, 13.0, 13.0 ] }
            }
        },
        {
            "name": "corner2",
            "from": [ 2.0, 2.0, 0.0 ], 
            "to": [ 14.0, 10.0, 3.0 ], 
            "faces": {
                "north": { "texture": "#0", "uv": [ 2.0, 6.0, 14.0, 14.0 ] },
                "east": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
                "south": { "texture": "#0", "uv": [ 2.0, 6.0, 14.0, 14.0 ] },
                "west": { "texture": "#0", "uv": [ 1.0, 0.0, 0.0, 1.0 ] },
                "up": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
                "down": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }
            }
        },
        {
            "name": "corner3",
            "from": [ 0.0, 2.0, 0.0 ], 
            "to": [ 2.0, 10.0, 16.0 ], 
            "faces": {
                "north": { "texture": "#0", "uv": [ 14.0, 6.0, 16.0, 14.0 ] },
                "east": { "texture": "#0", "uv": [ 0.0, 6.0, 16.0, 14.0 ] },
                "south": { "texture": "#0", "uv": [ 0.0, 6.0, 2.0, 14.0 ] },
                "west": { "texture": "#0", "uv": [ 0.0, 6.0, 16.0, 14.0 ] },
                "up": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
                "down": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }
            }
        },
        {
            "name": "corner4",
            "from": [ 14.0, 2.0, 0.0 ], 
            "to": [ 16.0, 10.0, 16.0 ], 
            "faces": {
                "north": { "texture": "#0", "uv": [ 0.0, 6.0, 2.0, 14.0 ] },
                "east": { "texture": "#0", "uv": [ 0.0, 7.0, 16.0, 14.0 ] },
                "south": { "texture": "#0", "uv": [ 14.0, 6.0, 16.0, 14.0 ] },
                "west": { "texture": "#0", "uv": [ 0.0, 6.0, 16.0, 14.0 ] },
                "up": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
                "down": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }
            }
        },
        {
            "name": "mid",
            "from": [ 0.0, 10.0, 0.0 ], 
            "to": [ 16.0, 12.0, 16.0 ], 
            "faces": {
                "north": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 2.0 ] },
                "east": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 2.0 ] },
                "south": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 2.0 ] },
                "west": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 2.0 ] },
                "up": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 16.0 ] },
                "down": { "texture": "#1", "uv": [ 3.0, 3.0, 13.0, 13.0 ] }
            }
        },
        {
            "name": "bar",
            "from": [ 3.2000000029802322, 2.0, 14.50000000745058 ], 
            "to": [ 4.200000002980232, 10.0, 15.50000000745058 ], 
            "faces": {
                "north": { "texture": "#2", "uv": [ 2.0, 0.0, 4.0, 16.0 ] },
                "east": { "texture": "#2", "uv": [ 2.0, 0.0, 4.0, 16.0 ] },
                "south": { "texture": "#2", "uv": [ 2.0, 0.0, 4.0, 16.0 ] },
                "west": { "texture": "#2", "uv": [ 12.0, 0.0, 14.0, 16.0 ] },
                "up": { "texture": "#2", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
                "down": { "texture": "#2", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }
            }
        },
        {
            "name": "bar2",
            "from": [ 5.300000004470348, 2.0, 14.50000000745058 ], 
            "to": [ 6.300000004470348, 10.0, 15.50000000745058 ], 
            "faces": {
                "north": { "texture": "#2", "uv": [ 12.0, 0.0, 14.0, 16.0 ] },
                "east": { "texture": "#2", "uv": [ 12.0, 0.0, 14.0, 16.0 ] },
                "south": { "texture": "#2", "uv": [ 2.0, 16.0, 4.0, 0.0 ] },
                "west": { "texture": "#2", "uv": [ 2.0, 0.0, 4.0, 16.0 ] },
                "up": { "texture": "#2", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
                "down": { "texture": "#2", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }
            }
        },
        {
            "name": "bar3",
            "from": [ 7.500000007450581, 2.0, 14.50000000745058 ], 
            "to": [ 8.50000000745058, 10.0, 15.50000000745058 ], 
            "faces": {
                "north": { "texture": "#2", "uv": [ 2.0, 0.0, 4.0, 16.0 ] },
                "east": { "texture": "#2", "uv": [ 7.0, 0.0, 9.0, 16.0 ] },
                "south": { "texture": "#2", "uv": [ 7.0, 0.0, 9.0, 16.0 ] },
                "west": { "texture": "#2", "uv": [ 12.0, 0.0, 14.0, 16.0 ] },
                "up": { "texture": "#2", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
                "down": { "texture": "#2", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }
            }
        },
        {
            "name": "bar4",
            "from": [ 9.700000010430813, 2.0, 14.50000000745058 ], 
            "to": [ 10.700000010430813, 10.0, 15.50000000745058 ], 
            "faces": {
                "north": { "texture": "#2", "uv": [ 7.0, 0.0, 9.0, 16.0 ] },
                "east": { "texture": "#2", "uv": [ 2.0, 0.0, 4.0, 16.0 ] },
                "south": { "texture": "#2", "uv": [ 12.0, 16.0, 14.0, 0.0 ] },
                "west": { "texture": "#2", "uv": [ 4.0, 0.0, 2.0, 16.0 ] },
                "up": { "texture": "#2", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
                "down": { "texture": "#2", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }
            }
        },
        {
            "name": "bar5",
            "from": [ 11.800000011920929, 2.0, 14.50000000745058 ], 
            "to": [ 12.800000011920929, 10.0, 15.50000000745058 ], 
            "faces": {
                "north": { "texture": "#2", "uv": [ 7.0, 0.0, 9.0, 16.0 ] },
                "east": { "texture": "#2", "uv": [ 7.0, 0.0, 9.0, 16.0 ] },
                "south": { "texture": "#2", "uv": [ 2.0, 16.0, 4.0, 0.0 ] },
                "west": { "texture": "#2", "uv": [ 7.0, 16.0, 9.0, 0.0 ] },
                "up": { "texture": "#2", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
                "down": { "texture": "#2", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }
            }
        },
        {
            "name": "barc1",
            "from": [ 10.700000025331974, 3.5000000074505806, 14.50000000745058 ], 
            "to": [ 11.80000002682209, 4.500000007450581, 15.50000000745058 ], 
            "faces": {
                "north": { "texture": "#2", "uv": [ 12.0, 6.0, 14.0, 8.0 ] },
                "east": { "texture": "#2", "uv": [ 7.0, 0.0, 9.0, 2.0 ] },
                "south": { "texture": "#2", "uv": [ 2.0, 0.0, 4.0, 2.0 ] },
                "west": { "texture": "#2", "uv": [ 7.0, 6.0, 9.0, 16.0 ] },
                "up": { "texture": "#2", "uv": [ 2.0, 7.0, 4.0000000014901165, 9.0 ] },
                "down": { "texture": "#2", "uv": [ 5.0, 2.0, 7.0000000014901165, 4.0 ] }
            }
        },
        {
            "name": "barc2",
            "from": [ 6.300000034272671, 4.499999992549419, 14.50000000745058 ], 
            "to": [ 7.500000037252903, 5.499999992549419, 15.50000000745058 ], 
            "faces": {
                "north": { "texture": "#2", "uv": [ 12.0, 6.0, 14.0, 8.0 ] },
                "east": { "texture": "#2", "uv": [ 7.0, 0.0, 9.0, 2.0 ] },
                "south": { "texture": "#2", "uv": [ 6.0, 2.0, 8.0, 4.0 ] },
                "west": { "texture": "#2", "uv": [ 8.0, 12.0, 10.0, 14.0 ] },
                "up": { "texture": "#2", "uv": [ 2.0, 7.0, 4.0000000014901165, 9.0 ] },
                "down": { "texture": "#2", "uv": [ 7.0, 8.0, 9.000000001490116, 10.0 ] }
            }
        },
        {
            "name": "barc3",
            "from": [ 2.0000000447034836, 3.4999999925494194, 14.50000000745058 ], 
            "to": [ 3.200000047683716, 4.499999992549419, 15.50000000745058 ], 
            "faces": {
                "north": { "texture": "#2", "uv": [ 12.0, 6.0, 14.0, 8.0 ] },
                "east": { "texture": "#2", "uv": [ 7.0, 0.0, 9.0, 2.0 ] },
                "south": { "texture": "#2", "uv": [ 12.0, 5.0, 14.0, 7.0 ] },
                "west": { "texture": "#2", "uv": [ 8.0, 12.0, 10.0, 14.0 ] },
                "up": { "texture": "#2", "uv": [ 2.0, 7.0, 4.0000000014901165, 9.0 ] },
                "down": { "texture": "#2", "uv": [ 7.0, 8.0, 9.000000001490116, 10.0 ] }
            }
        },
        {
            "name": "barc4",
            "from": [ 4.200000047683716, 7.999999985098839, 14.50000000745058 ], 
            "to": [ 5.300000049173832, 8.999999985098839, 15.50000000745058 ], 
            "faces": {
                "north": { "texture": "#2", "uv": [ 12.0, 6.0, 14.0, 8.0 ] },
                "east": { "texture": "#2", "uv": [ 7.0, 0.0, 9.0, 2.0 ] },
                "south": { "texture": "#2", "uv": [ 12.0, 5.0, 14.0, 7.0 ] },
                "west": { "texture": "#2", "uv": [ 8.0, 12.0, 10.0, 14.0 ] },
                "up": { "texture": "#2", "uv": [ 2.0, 7.0, 4.0000000014901165, 9.0 ] },
                "down": { "texture": "#2", "uv": [ 7.0, 8.0, 9.000000001490116, 10.0 ] }
            }
        },
        {
            "name": "barc5",
            "from": [ 8.500000037252903, 6.999999985098839, 14.50000000745058 ], 
            "to": [ 9.700000040233135, 7.999999985098839, 15.50000000745058 ], 
            "faces": {
                "north": { "texture": "#2", "uv": [ 12.0, 6.0, 14.0, 8.0 ] },
                "east": { "texture": "#2", "uv": [ 7.0, 5.0, 9.0, 7.0 ] },
                "south": { "texture": "#2", "uv": [ 0.0, 7.0, 2.0, 9.0 ] },
                "west": { "texture": "#2", "uv": [ 7.0, 12.0, 9.0, 14.0 ] },
                "up": { "texture": "#2", "uv": [ 2.0, 7.0, 4.0000000014901165, 9.0 ] },
                "down": { "texture": "#2", "uv": [ 7.0, 8.0, 9.000000001490116, 10.0 ] }
            }
        },
        {
            "name": "barc6",
            "from": [ 12.80000002682209, 6.0, 14.50000000745058 ], 
            "to": [ 14.000000029802322, 7.0, 15.50000000745058 ], 
            "faces": {
                "north": { "texture": "#2", "uv": [ 12.0, 6.0, 14.0, 8.0 ] },
                "east": { "texture": "#2", "uv": [ 7.0, 0.0, 9.0, 2.0 ] },
                "south": { "texture": "#2", "uv": [ 13.0, 7.0, 15.0, 9.0 ] },
                "west": { "texture": "#2", "uv": [ 7.0, 6.0, 9.0, 8.0 ] },
                "up": { "texture": "#2", "uv": [ 2.0, 7.0, 4.0000000014901165, 9.0 ] },
                "down": { "texture": "#2", "uv": [ 5.0, 2.0, 7.0000000014901165, 4.0 ] }
            }
        },
        {
            "name": "top1",
            "from": [ 2.0, 12.0, 2.0 ], 
            "to": [ 14.0, 14.0, 14.0 ], 
            "faces": {
                "north": { "texture": "#0", "uv": [ 2.0, 1.0, 14.0, 3.0 ] },
                "east": { "texture": "#0", "uv": [ 3.0, 4.0, 15.0, 6.0 ] },
                "south": { "texture": "#0", "uv": [ 2.0, 7.0, 14.0, 9.0 ] },
                "west": { "texture": "#0", "uv": [ 1.0, 7.0, 13.0, 9.0 ] },
                "up": { "texture": "#0", "uv": [ 2.0, 2.0, 14.0, 14.0 ] },
                "down": { "texture": "#0", "uv": [ 2.0, 2.0, 14.0, 14.0 ] }
            }
        },
        {
            "name": "top2",
            "from": [ 4.0, 14.0, 4.0 ], 
            "to": [ 12.0, 16.0, 12.0 ], 
            "faces": {
                "north": { "texture": "#0", "uv": [ 1.0, 12.0, 9.0, 14.0 ] },
                "east": { "texture": "#0", "uv": [ 6.0, 1.0, 14.0, 3.0 ] },
                "south": { "texture": "#0", "uv": [ 6.0, 11.0, 14.0, 13.0 ] },
                "west": { "texture": "#0", "uv": [ 2.0, 7.0, 10.0, 9.0 ] },
                "up": { "texture": "#1", "uv": [ 5.0, 5.0, 11.000000000000004, 11.000000000000004 ] },
                "down": { "texture": "#0", "uv": [ 4.0, 4.0, 12.0, 12.0 ] }
            }
        }
    ]
}

 

model work fine on simple block...

"The cycle of life and death continues. We will live, they will die."

  • Author

both of those files are named "distillery" and my mod id is lowercase

public static final String MOD_ID = "kudo";

 

I'll try to just extend it to block...

"The cycle of life and death continues. We will live, they will die."

  • Author

Oh my I rewrote everything and somehow got it to work ._. think it was blockstate causing it... idk im happy now

"The cycle of life and death continues. We will live, they will die."

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.