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 have a custom vine working perfectly fine. It grows and it doesn't crash the game. However, it can't find the texture for it. I've tried doing the vine two different ways (first, using vanilla code; second, using the much-easier-to-do forge stuff) but it can't locate the correct texture. I wonder if there's a different way I should be initializing it?

 

How I Register It:

public static Block trumpet;

//(in pre-init)
trumpet = new Trumpet().setBlockName("Trumpet").setBlockTextureName("chronocube:trumpet");
GameRegistry.registerBlock(trumpet, trumpet.getUnlocalizedName().substring(5));

 

 

My Custom Vine Class:

package com.REMINISC3.chronocube;
import net.minecraft.block.Block;
import net.minecraft.block.BlockVine;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraftforge.common.IShearable;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;

public class Trumpet extends BlockVine implements IShearable {

public Trumpet() {
this.setCreativeTab(Chronocube.tabMyMod);
}
@Override
public void registerBlockIcons(IIconRegister iconRegister)
{
this.blockIcon = iconRegister.registerIcon("chronocube:trumpet");
}
}

 

It throws no errors and the other Blocks declared in the same way find their textures just fine. I'm a little baffled.

Where is your texture file located? Based on your code it should be in assets/chronocube/textures/blocks/trumpet.png. Also, I'm not sure about overriding registerBlockIcons(), because you are already setting the texture with setBlockTextureName(). It might not be needed.

  • Author

Where is your texture file located? Based on your code it should be in assets/chronocube/textures/blocks/trumpet.png. Also, I'm not sure about overriding registerBlockIcons(), because you are already setting the texture with setBlockTextureName(). It might not be needed.

 

Yep, that's exactly where it is. I went scrounging through the code to see if vine textures are called from some other folder, but no luck there. The other blocks that call for textures (in the same file, no less) can find their texture fine, but the vines just can't locate it.

 

As for the item thing, yeah, I probably don't need it.

 

I just realized what it was. The script that I used to export my textures made it 15 x 16. Thank you for your speedy assistance though, Nabosueco98~.

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.