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

I've been fideling around with one of my block textures

 

(Heres the code for that:)

 

 

public IIcon getIcon(int side, int meta) {

if (side == 1) {

return this.iconTop;

} else if (side == 0) {

return this.iconTop;

} else if (side != meta) {

return this.blockIcon;

} return this.iconFace;

}

 

@SideOnly(Side.CLIENT)

public void registerBlockIcons(IIconRegister IconRegistry) {

this.blockIcon = IconRegistry.registerIcon(Constants.MODID + ":" + "chassisBlock");

this.iconFace = IconRegistry.registerIcon(Constants.MODID + ":" + "presserBlock_face");

this.iconTop = IconRegistry.registerIcon(Constants.MODID + ":" + "presserBlock_top");

}

 

 

 

It looks fine when placed in the world but looks different while in my inventory.

 

15rjprn.png

 

I kind of understand why it looks this way but I can't figure out how to fix it, and make it look like it does when placed.

I'm not trying to be rude it just comes out that way sometimes.

I'm here to try and learn as much as I can, won't you join me?

I think the best way to solve that is to have a default texture, so when meta==0 you return the correct texture in your inventory.

The proud(ish) developer of Ancients

  • Author

I changed it to this:

 

 

 

public IIcon getIcon(int side, int meta) {

if (side == 1) {

return this.iconTop;

} else if (side == 0) {

return this.iconTop;

} else if (meta == 0) {

return this.iconFace;

} else if (side != meta) {

return this.blockIcon;

} return this.iconFace;

}

 

@SideOnly(Side.CLIENT)

public void registerBlockIcons(IIconRegister IconRegistry) {

this.blockIcon = IconRegistry.registerIcon(Constants.MODID + ":" + "chassisBlock");

this.iconFace = IconRegistry.registerIcon(Constants.MODID + ":" + "presserBlock_face");

this.iconTop = IconRegistry.registerIcon(Constants.MODID + ":" + "presserBlock_top");

}

 

 

 

And got this as a result:

 

2pq43de.png

 

Fiddling around with it more couldn't produce anything better. :/

I'm not trying to be rude it just comes out that way sometimes.

I'm here to try and learn as much as I can, won't you join me?

  • Author

 

That worked great thank you. :)

 

Hi

 

You might find the topics under "Item Rendering" useful

http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html

 

You could use an IItemRenderer, or alternatively an ISimpleBlockRenderingHandler (which might be easier).

 

These will let you rotate the block to face any way you choose

 

A quick google should shown you some tutorials

 

-TGG

 

 

 

That whole page looks like its going to be very helpful, thank you. :)

I'm not trying to be rude it just comes out that way sometimes.

I'm here to try and learn as much as I can, won't you join me?

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.