Jump to content

Block Textures Not Showing Up


ripbandit

Recommended Posts

I've been trying to get custom block textures to work and can't figure it out.

 

Code:

package com.loomhost.ripbandit.randomblocks;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;

@Mod(modid = RandomBlocks.MODID, version = RandomBlocks.VERSION)
public class RandomBlocks
{
    public static final String MODID = "RandomBlocks";
    public static final String VERSION = "1.0";
    public static Block chainFence;
    public static CreativeTabs RandomBlocks = new CreativeTabs("RandomBlocks")
    {
    public Item getTabIconItem()
    {
    return Items.bed;
    }
    };
    
    @EventHandler
    public void init(FMLInitializationEvent event)
    {
	//Init message
        System.out.println("Random Blocks V 0.1 is reporting for duty!");
        
        
        //Blocks
        
        //ChainFence
        this.chainFence = new NormalBlock() .setHardness(0.5F) .setResistance(0F) .setBlockName("chainFence") .setCreativeTab(RandomBlocks) .setBlockTextureName("RandomBlocks:chainFence");
        GameRegistry.registerBlock(this.chainFence, this.chainFence.getUnlocalizedName() .substring(5));
        
    }
}

 

Error log:

java.io.FileNotFoundException: randomblocks:textures/blocks/chainFence.png
at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SourceFile:58) ~[simpleReloadableResourceManager.class:?]
at net.minecraft.client.renderer.texture.TextureMap.loadTextureAtlas(TextureMap.java:125) [TextureMap.class:?]
at net.minecraft.client.renderer.texture.TextureMap.loadTexture(TextureMap.java:90) [TextureMap.class:?]
at net.minecraft.client.renderer.texture.TextureManager.loadTexture(SourceFile:72) [TextureManager.class:?]
at net.minecraft.client.renderer.texture.TextureManager.onResourceManagerReload(SourceFile:136) [TextureManager.class:?]
at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SourceFile:104) [simpleReloadableResourceManager.class:?]
at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SourceFile:92) [simpleReloadableResourceManager.class:?]
at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:568) [Minecraft.class:?]
at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:303) [FMLClientHandler.class:?]
at net.minecraft.client.Minecraft.startGame(Minecraft.java:527) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:815) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(SourceFile:103) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_60]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_60]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_60]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_60]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]

 

Any help is appreciated!

Link to comment
Share on other sites

Your file is not there. Java is looking for the file and failing to find it. Where is your file currently?

Link to comment
Share on other sites

Can you give us the file hierarchy and the registration class one more time? Just to make sure we know what we are dealing with.

Link to comment
Share on other sites

Files are at \src\main\resources\assets\randomblocks.

 

Here is the RandomBlocks class:

package com.loomhost.ripbandit.randomblocks;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;

@Mod(modid = RandomBlocks.MODID, version = RandomBlocks.VERSION)
public class RandomBlocks
{
    public static final String MODID = "randomblocks";
    public static final String VERSION = "1.0";
    public static Block chainFence;
    public static CreativeTabs RandomBlocks = new CreativeTabs("RandomBlocks")
    {
    public Item getTabIconItem()
    {
    return Items.bed;
    }
    };
    
    @EventHandler
    public void init(FMLInitializationEvent event)
    {
	//Init message
        System.out.println("Random Blocks V 0.1 is reporting for duty!");
        
        
        //Blocks
        
        //ChainFence
        this.chainFence = new NormalBlock() .setHardness(0.5F) .setResistance(0F) .setBlockName("chainFence") .setCreativeTab(RandomBlocks) .setBlockTextureName("randomblocks:chainFence");
        GameRegistry.registerBlock(this.chainFence, this.chainFence.getUnlocalizedName() .substring(5));
        
    }
}

And the NormalBlock class:

package com.loomhost.ripbandit.randomblocks;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;

public class NormalBlock extends Block {
public NormalBlock(){
super(Material.ground);
}
}

Link to comment
Share on other sites

Since when was there a method called setBlockTextureNam()?? O.o

 

If I'm just old fashioned forge, then ignore this. But I ha have the sneaking suspicion that it could be your problem...

We all stuff up sometimes... But I seem to be at the bottom of that pot.

Link to comment
Share on other sites

Assuming you are set up the proper way (unlike me xD I apparently like making it hard on myself) your block png should be at this location:

~devforgeenvironment~\src\main\resources\assets\%modid%\textures\blocks\yourblock.png

In Eclipse, (assuming you are using Eclipse,) you should see:

~projectfolder~
|  src/main/java
|  |  (all your mod .java packages)
|
|  src/main/resources
|  |  assets.modid.textures.blocks
|  |  |  (any block textures)
|  |
|  |  assets.modid.textures.items
|  |  |  (any item textures)
|  |
|  |  assets.modid.lang
|  |  |  (your lang file(s))
|  |
|  |  mcmod.info
|
|  JRE System Library
|  |  (whole bunch of things)
|
|  Referenced Libraries
|  |  (whole bunch of things)
|
|  (whole bunch of other Forge things)

 

I hope that's readable and can help xD

 

===========================

 

Since when was there a method called setBlockTextureNam()?? O.o

 

If I'm just old fashioned forge, then ignore this. But I ha have the sneaking suspicion that it could be your problem...

 

I've been using setBlockTextureName() forever. (I've only used Forge 1.7.4.)  I've never seen setBlockTextureNam() though, but I don't see that in his code either.  I asssume yours was just a careless typo then :D

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

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • It's a good point the Astros have the road-field benefit for the remainder of the period.  They simply could have a chance for the playoffs besides.  Was this the exact same group tonight that sleep-walked its method to a current 3-9 tailspin?After obtaining brushed up by the last-place Royals in the house this weekend break, this evening two solo homers and probably the finest throwing we've seen from Justin Verlander considering that his 2019 no-hitter put the Mariners a game and a fifty percent behind the Astros for the 3rd Wild Card the Astros respected their abysmal at home-hitting ways in the first inning by stranding Yordan Alvarez at second, in the 2nd inning, the Astros played like the season got on the Abreu led off with a three-way, yet after the following 2 batters fell short to score him, it began to resemble the Astros were still playing the Royals at Mauricio Dubon struck a solitary much like his walk-off last Wednesday, scoring Abreu, then Martin Maldonado doubled home Dubon, and Jose Altuve singled in all against one of the AL's best beginners, Luis Castillo https://www.houstonstoreonline.com/170-Astros_Josh_Hader_Jersey.  When was the last time the Astros had an early three-run lead?The Astros included one more in the third when Yordan got his motorist and golfed a solo shot into the right-center 's done it once again.  Houston Astros September 26, 2023It was 30 for looked like the Mariners might get it all back in their half of the 3rd with Julio Rodriguez up with the bases packed.  However he hit a rocket one-hopper to Jermey Pena that he and Altuve transformed right into an inning-ending double the 6th inning, the Astros cushioned their lead on a solo shot by Kyle Tucker that hit the top deck in ideal Houston Astros September 26, 2023For Tucker, it was his 29th homer to go with 29 swiped Verlander was clutch.  In a playoff-like scenario, he looked like the Justin Verlander who held the Yankees to one run in 9 innings in the 2017 just made it to 8 tonight and was removed after the leadoff hitter increased in the 9th.  That jogger racked up on reliever Bryan Abreu, which left Verlander's line at 8 innings pitched, one run, 8 K's, one stroll, and only three the Astros make the playoffs after this recent tailspin, we'll remember this game, and we'll claim the Verlander profession deserved it besides Ronel Blanco Jersey. 
    • In just collaboration with Question, the Chicago Sky will host the to start with at any time Ponder Tremendous HeroTM Working day upon September 3 towards the Fresh York Flexibility at Wintrust Arena at 2 p. m.  CT, available as a result of Magellan Organization.  The recreation will be broadcast dwell upon Sky will be the 1st educated women sports activities employees and initial at any time WNBA staff toward rejoice a Ponder Tremendous Hero Working day https://www.shopchicagosky.com/collections/angel-reese-jersey.  The 1st 3,000 supporters within just attendance will get hold of a restricted model Shuri Black Panther bobblehead and up in the direction of 10,000 supporters will obtain a souvenir poster presenting star Sky avid gamers and Wonder figures.  The bobblehead is Marvel to start with-at any time Shuri Black Panther bobblehead in direction of be generated within just collaboration with a well-informed sporting activities staff members.  Sunday will additionally element Speculate activations and contests in the course of the recreation.  Look at connected for poster and bobblehead picture.  The bundle was facilitated through AthLife, Inc, Marvels longtime athletics Chicago Sky collaboration with Ponder is yet another illustration of the Sky primary the route in just enthusiast engagement inside of the WNBA through establishing an encounter that celebrates the potent ladies of the Sky and Surprise,NBA Corridor of Fame Legend and Chicago Sky Proprietor Dwyane Wade explained.  Our function is toward locate innovative practices in the direction of lift the supporter working experience and showcase the skill of our gamers.  This activation with Speculate does exactly that, all whilst attracting clean admirers in the direction of the WNBA. Our hard work with AthLife is concerning bringing alongside one another 2 of the greatest committed admirer bases Lindsay Allen Jersey.  Comedian admirers and sporting activities lovers move hand within just hand, and their spirit carries on towards glow all through at our Surprise Tremendous HeroTM Working day functions,explained Dan Buckley, President of Surprise Comics and Franchise.  Wee energized toward move forward bringing Those stories toward groups and enthusiasts throughout the state, and be expecting that Chicago Sky is the 1st of countless WNBA groups in the direction of sign up for inside upon the exciting. About Chicago SkyThe 2021 WNBA Winner Chicago Sky are a proficient women basketball personnel recognized inside of 2005 by means of major operator, Michael Improve.  The Chicago Sky ended up the initial separately owned women knowledgeable basketball staff toward be a part of the WNBA and performs at Wintrust Arena.  The year operates against Could possibly-September.  Contact or go to for further more Ponder EntertainmentMarvel Leisure, LLC, a totally-owned subsidiary of The Walt Disney Business, is a person of the worlds maximum popular temperament-centered amusement services, produced upon a tested library of additional than 8,000 people showcased inside of a number of media for earlier mentioned 80 a long time.  Ponder employs its identity franchises within just enjoyment, licensing, submitting, game titles, and electronic media.  For extra content material take a look at.   2023 Surprise  https://www.shopchicagosky.com/collections/marina-mabrey-jersey
    • Hi, soo recently i started modding and i wanted to make my code more organised ect. i made functions to register stuff, but i have problem with one. Soo, when i try to register Creative Tab, i want to give it a icon, but it requires me to give it Supplier<ItemStack> but i can only have ItemStack, is there any way to convert this type into another?
    • Hello! I'm currently making a big modpack, I'm already at 223 mods, but when I tried to add some Ather addons (The Aether: Redux for example) my game when I launched it the time of the loading suspiciously decreased and then the game crashed. The crash report was the next: The game crashed whilst rendering overlay Error: java.lang.IllegalArgumentException: Failed to create model for minecraft:firework_rocket The problem fixes if I take out those mods, but it's weird that I've never seen this crash report and then suddenly 6 mods are causing it. If it helps something: I have Linux, I have the official Minecraft Launcher.
    • i am having a similar problem with modrinth where when i try to upload a version of my mod it tells me that i have no mods.toml or valid class files present for Forge file   please reply to me about this soon if you have the answer or any questions
  • Topics

×
×
  • Create New...

Important Information

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