yes, but creating your own class allows for cleaner code.Actually I don't think is is possible anymore since the way we have to code for textures. and if it is it would be CRAZZY messy and would be really hard to fix if you had to.
yes, but creating your own class allows for cleaner code.
Actually I don't think is is possible anymore since the way we have to code for textures. and if it is it would be CRAZZY messy and would be really hard to fix if you had to.
well you're right ive been looking for people who can tell me but well i think ill just make a class for evey item
I'm still having problems with this (my mod is called handycraft, it is just experimental):
- All my items/blocks are in preInit
- My directory for textures is mcp/src/minecraft/assets/pteri/handycraft/textures/blocks (and textures/items for items)
- I don't think there are any issues with using upper/lower case
Main class (HandycraftMain.java): pastebin.com/GTkeUeeK
A sample block that contains registerIcons (HandyBlock.java): pastebin.com/mjmXLRmP
The annoying thing is that Eclipse gives me errors along the lines of:
'Using missing texture, unable to load: pteri/handycraft:textures/blocks/handyDirt.png,' which as far as I'm aware is exactly where the file exists.
If anyone knows why it's not working, that would be amazing.
Shaqaruden, after kindly looking at my mod for me, has found a solution. These are the steps I took to fix it:
- The file structure needs to be mcp/src/minecraft/assets/MODNAME/textures/blocks (or textures/items for items): having more than one folder between assets and textures does not work (or I do not know how to make it work)
- Rather than using getUnlocalizedName() in the override, just use
this.blockIcon = reg.registerIcon("MODNAME:BLOCK"); (where BLOCK is the unlocalizedName you set in your main class)
Yes, this is possible by chaining if statements together, e.g.:
This is assuming your PNG file names are equivalent to the unlocalizednames. Also Eclipse might say that the texture is missing, but it will actually load fine in game.
its a bit to late i alreaddy made a clas for each item :/ but either way im going to check it... Thanks
Did you try using the same code as for items? within the register icon function try typing "this.e" and it should show something like entityIcon maybe.
Did you try using the same code as for items? within the register icon function try typing "this.e" and it should show something like entityIcon maybe.
When I tried to do this it simply didn't load my textures, tried renaming, moving, and copying everything into every sensible directory I could find, but nothing seems to work.
Here's my console output...
Jul 11, 2013 3:50:08 PM net.minecraft.launchwrapper.LogWrapper log
INFO: Using tweak class name cpw.mods.fml.common.launcher.FMLTweaker
2013-07-11 15:50:08 [INFO] [ForgeModLoader] Forge Mod Loader version 6.2.19.789 for Minecraft 1.6.2 loading
2013-07-11 15:50:08 [INFO] [ForgeModLoader] Java is Java HotSpot™ 64-Bit Server VM, version 1.7.0_25, running on Windows 7:amd64:6.1, installed at C:\Program Files\Java\jre7
2013-07-11 15:50:08 [INFO] [ForgeModLoader] Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
2013-07-11 15:50:08 [INFO] [STDOUT] Loaded 39 rules from AccessTransformer config file fml_at.cfg
2013-07-11 15:50:08 [INFO] [STDOUT] Loaded 107 rules from AccessTransformer config file forge_at.cfg
2013-07-11 15:50:09 [SEVERE] [ForgeModLoader] The binary patch set is missing. Things are probably about to go very wrong.
2013-07-11 15:50:09 [INFO] [ForgeModLoader] Launching wrapped minecraft
2013-07-11 15:50:10 [INFO] [Minecraft-Client] Setting user: Player423
2013-07-11 15:50:10 [INFO] [Minecraft-Client] (Session ID is null)
2013-07-11 15:50:10 [INFO] [Minecraft-Client] LWJGL Version: 2.9.0
2013-07-11 15:50:11 [INFO] [Minecraft-Client] Reloading ResourceManager: Default
2013-07-11 15:50:11 [INFO] [STDOUT]
2013-07-11 15:50:11 [INFO] [STDOUT] Starting up SoundSystem...
2013-07-11 15:50:11 [INFO] [MinecraftForge] Attempting early MinecraftForge initialization
2013-07-11 15:50:11 [INFO] [STDOUT] MinecraftForge v9.10.0.789 Initialized
2013-07-11 15:50:11 [INFO] [ForgeModLoader] MinecraftForge v9.10.0.789 Initialized
2013-07-11 15:50:11 [INFO] [STDOUT] Replaced 101 ore recipies
2013-07-11 15:50:11 [INFO] [MinecraftForge] Completed early MinecraftForge initialization
2013-07-11 15:50:11 [INFO] [ForgeModLoader] Reading custom logging properties from C:\Users\Sam\Desktop\Metroid Mod\forge\mcp\jars\config\logging.properties
2013-07-11 15:50:11 [OFF] [ForgeModLoader] Logging level for ForgeModLoader logging is set to ALL
2013-07-11 15:50:11 [INFO] [STDOUT] Initializing LWJGL OpenAL
2013-07-11 15:50:11 [INFO] [STDOUT] (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org)
2013-07-11 15:50:12 [INFO] [STDOUT] OpenAL initialized.
2013-07-11 15:50:12 [INFO] [ForgeModLoader] Searching C:\Users\Sam\Desktop\Metroid Mod\forge\mcp\jars\mods for mods
2013-07-11 15:50:12 [INFO] [STDOUT]
2013-07-11 15:50:13 [INFO] [ForgeModLoader] Forge Mod Loader has identified 4 mods to load
2013-07-11 15:50:13 [INFO] [mcp] Activating mod mcp
2013-07-11 15:50:13 [INFO] [FML] Activating mod FML
2013-07-11 15:50:13 [INFO] [Forge] Activating mod Forge
2013-07-11 15:50:13 [INFO] [Chimera27Metroid] Activating mod Chimera27Metroid
2013-07-11 15:50:13 [INFO] [ForgeModLoader] Registering Forge Packet Handler
2013-07-11 15:50:13 [INFO] [ForgeModLoader] Succeeded registering Forge Packet Handler
2013-07-11 15:50:13 [INFO] [ForgeModLoader] Configured a dormant chunk cache size of 0
2013-07-11 15:50:14 [SEVERE] [Minecraft-Client] Using missing texture, unable to load: minecraft:textures/items/MISSING_ICON_ITEM_5256_powerBeam.png
2013-07-11 15:50:14 [INFO] [ForgeModLoader] Forge Mod Loader has successfully loaded 4 mods
2013-07-11 15:50:14 [WARNING] [Metroid Cubed] Mod Metroid Cubed is missing a pack.mcmeta file, things may not work well
2013-07-11 15:50:14 [INFO] [Minecraft-Client] Reloading ResourceManager: Default, FMLFileResourcePack:Metroid Cubed
2013-07-11 15:50:14 [SEVERE] [Minecraft-Client] Using missing texture, unable to load: minecraft:textures/items/MISSING_ICON_ITEM_5256_powerBeam.png
2013-07-11 15:50:14 [INFO] [STDOUT]
2013-07-11 15:50:14 [INFO] [STDOUT] SoundSystem shutting down...
2013-07-11 15:50:14 [INFO] [STDOUT] Author: Paul Lamb, www.paulscode.com
2013-07-11 15:50:14 [INFO] [STDOUT]
2013-07-11 15:50:14 [INFO] [STDOUT]
2013-07-11 15:50:14 [INFO] [STDOUT] Starting up SoundSystem...
2013-07-11 15:50:14 [INFO] [STDOUT] Initializing LWJGL OpenAL
2013-07-11 15:50:14 [INFO] [STDOUT] (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org)
2013-07-11 15:50:15 [INFO] [STDOUT] OpenAL initialized.
2013-07-11 15:50:15 [INFO] [STDOUT]
2013-07-11 15:50:25 [INFO] [Minecraft-Server] Starting integrated minecraft server version 1.6.2
2013-07-11 15:50:25 [INFO] [Minecraft-Server] Generating keypair
2013-07-11 15:50:25 [INFO] [ForgeModLoader] Loading dimension 0 (Debug) (net.minecraft.server.integrated.IntegratedServer@4216c97f)
2013-07-11 15:50:25 [INFO] [ForgeModLoader] Loading dimension 1 (Debug) (net.minecraft.server.integrated.IntegratedServer@4216c97f)
2013-07-11 15:50:25 [INFO] [ForgeModLoader] Loading dimension -1 (Debug) (net.minecraft.server.integrated.IntegratedServer@4216c97f)
2013-07-11 15:50:25 [INFO] [Minecraft-Server] Preparing start region for level 0
2013-07-11 15:50:26 [INFO] [STDOUT] loading single player
2013-07-11 15:50:26 [INFO] [Minecraft-Server] Player423[/127.0.0.1:0] logged in with entity id 736 at (-367.6481820053433, 4.0, -473.8519479777546)
2013-07-11 15:50:26 [INFO] [Minecraft-Server] Player423 joined the game
2013-07-11 15:50:27 [INFO] [STDOUT] Setting up custom skins
2013-07-11 15:50:32 [INFO] [Minecraft-Server] Saving and pausing game...
2013-07-11 15:50:32 [INFO] [Minecraft-Server] Saving chunks for level 'Debug'/Overworld
2013-07-11 15:50:32 [INFO] [Minecraft-Server] Saving chunks for level 'Debug'/Nether
2013-07-11 15:50:32 [INFO] [Minecraft-Server] Saving chunks for level 'Debug'/The End
2013-07-11 15:50:33 [INFO] [Minecraft-Server] Stopping server
2013-07-11 15:50:33 [INFO] [Minecraft-Server] Saving players
2013-07-11 15:50:33 [INFO] [Minecraft-Server] Player423 left the game
2013-07-11 15:50:33 [INFO] [Minecraft-Server] Saving worlds
2013-07-11 15:50:33 [INFO] [Minecraft-Server] Saving chunks for level 'Debug'/Overworld
2013-07-11 15:50:33 [INFO] [Minecraft-Server] Saving chunks for level 'Debug'/Nether
2013-07-11 15:50:33 [INFO] [Minecraft-Server] Saving chunks for level 'Debug'/The End
2013-07-11 15:50:33 [INFO] [ForgeModLoader] Unloading dimension 0
2013-07-11 15:50:33 [INFO] [ForgeModLoader] Unloading dimension -1
2013-07-11 15:50:33 [INFO] [ForgeModLoader] Unloading dimension 1
2013-07-11 15:51:29 [INFO] [Minecraft-Client] Stopping!
2013-07-11 15:51:29 [INFO] [STDOUT]
2013-07-11 15:51:29 [INFO] [STDOUT] SoundSystem shutting down...
2013-07-11 15:51:29 [INFO] [STDOUT] Author: Paul Lamb, www.paulscode.com
2013-07-11 15:51:29 [INFO] [STDOUT]
Only relevant thing seems to be:
2013-07-11 15:50:14 [SEVERE] [Minecraft-Client] Using missing texture, unable to load: minecraft:textures/items/MISSING_ICON_ITEM_5256_powerBeam.png
(I tried renaming the texture to MISSING_ICON_ITEM_5256_powerBeam.png aswell, no dice.)
I don't think I did anything wrong with the code either...
public void updateIcons(IconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("Chimera27Metroid:Power Beam.png");
}
And the main file
@Mod(modid = "Chimera27Metroid", name = "Metroid Cubed", version = "1.0.0")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class Main {
@Instance("Chimera27Metroid")
public static Main instance;
private final static Item powerBeam = new PowerBeam(5000);
@SidedProxy(clientSide = "project.main.client.ClientProxy", serverSide = "project.main.CommonProxy")
public static CommonProxy proxy;
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
}
@EventHandler
public void postInit(FMLPostInitializationEvent event) {
}
}
I really have no idea what's going on, I have been trying to figure this out for over 2 hours now, but everywhere I look says a different thing in an similarly vague way. Any help is GREATLY appreciated!
Minecraft only uses png files so this does not need to be specified, also updateIcons should be registerIcons as well try to keep spaces out of the mix.
public void registerIcons(IconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("Chimera27Metroid:PowerBeam");
}
also for your main code try this...
@Mod(modid = "Chimera27Metroid", name = "Metroid Cubed", version = "1.0.0")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class Main {
@Instance("Chimera27Metroid")
public static Main instance;
@SidedProxy(clientSide = "project.main.client.ClientProxy", serverSide = "project.main.CommonProxy")
public static CommonProxy proxy;
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
private final static Item powerBeam = new PowerBeam(5000).setUnlocalizedName("Chimera27Metroid:PowerBeam");
}
@EventHandler
public void load(FMLInitializationEvent event) {
proxy.registerRenderers();
LanguageRegistry.addName(powerBeam, "Power Beam");
}
@EventHandler
public void postInit(FMLPostInitializationEvent event) {
}
}
and if that doesn't work try changing @EventHandler on the PreInit function @PreInit
I mentioned this elsewhere, but if your textures are showing up in game, then there aren't any errors. Look closely at your log, after the missing texture errors you will probably see this:
[INFO] [Minecraft-Client] Reloading ResourceManager: Default, FMLFileResourcePack:Your Mod Name
I mentioned this elsewhere, but if your textures are showing up in game, then there aren't any errors. Look closely at your log, after the missing texture errors you will probably see this:
[INFO] [Minecraft-Client] Reloading ResourceManager: Default, FMLFileResourcePack:Your Mod Name
I am encountering a very interesting issue that I've never seen before:
The Sword that I have added doesn't seem to be working at all, even though it is in the game and looking just fine.
Here is a short video where I demonstrate the problem:
If you watch this, you'll see two problems:
Both my Item and My Sword are called "My Awesome Sword"
My Sword has a strange glitch where it cannot break any blocks, even in creative mode.
Below is the code for my main MyModName class:
public class MyNameMod {
@SidedProxy(clientSide = MyNameModInfo.PROXY_LOCATION + ".ClientProxy", serverSide = MyNameModInfo.PROXY_LOCATION + ".CommonProxy")
public static CommonProxy proxy;
// DECLARE YOUR ITEMS HERE
public static Item MyNameItem_1;
public static Item MyNameSword_1;
// DECLARE YOUR BLOCKS HERE
public static Block MyNameBlock_1;
// DECLARE YOUR MATERIALS HERE
public static EnumToolMaterial MyNameToolMaterial = EnumHelper.addToolMaterial("Awesomeness", 2, 500, 6.0F, 6, 15);
//
@PreInit
public void preInit( FMLPreInitializationEvent event )
{
MyNameItem_1 = new MyNameItem(2020);
GameRegistry.registerItem(MyNameItem_1, "MyNameItem_1");
LanguageRegistry.addName(MyNameItem_1, "My Awesome Item");
MyNameSword_1 = new MyNameSword(2021, EnumToolMaterial.IRON);
GameRegistry.registerItem(MyNameSword_1, "MyNameSword_1");
LanguageRegistry.addName(MyNameSword_1, "My Awesome Sword");
MyNameBlock_1 = new MyNameBlock(2022, "MyNameBlock_1").setHardness(2.0F).setStepSound(Block.soundMetalFootstep).setResistance(10.0F).setUnlocalizedName("MyNameMod:MyNameBlock_1");
GameRegistry.registerBlock(MyNameBlock_1, "MyNameBlock_");
LanguageRegistry.addName(MyNameBlock_1, "My Awesome Block");
}
Here is the code for my MyNameSword class:
public class MyNameSword extends ItemSword {
public MyNameSword(int ItemID, EnumToolMaterial material)
{
super(ItemID, material);
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("MyNameMod:MyNameSword_1");
}
}
And here's the code for my MyNameItem class:
public class MyNameItem extends Item
{
public MyNameItem(int par1)
{
super(par1); //Returns super constructor: par1 is ID
setCreativeTab(CreativeTabs.tabMaterials); // Tells the game what creative mode tab it goes in
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("MyNameMod:MyNameItem_1");
}
}
Does anyone have any idea what could be happening here?
I am encountering a very interesting issue that I've never seen before:
The Sword that I have added doesn't seem to be working at all, even though it is in the game and looking just fine.
Here is a short video where I demonstrate the problem:
If you watch this, you'll see two problems:
Both my Item and My Sword are called "My Awesome Sword"
My Sword has a strange glitch where it cannot break any blocks, even in creative mode.
Below is the code for my main MyModName class:
public class MyNameMod {
@SidedProxy(clientSide = MyNameModInfo.PROXY_LOCATION + ".ClientProxy", serverSide = MyNameModInfo.PROXY_LOCATION + ".CommonProxy")
public static CommonProxy proxy;
// DECLARE YOUR ITEMS HERE
public static Item MyNameItem_1;
public static Item MyNameSword_1;
// DECLARE YOUR BLOCKS HERE
public static Block MyNameBlock_1;
// DECLARE YOUR MATERIALS HERE
public static EnumToolMaterial MyNameToolMaterial = EnumHelper.addToolMaterial("Awesomeness", 2, 500, 6.0F, 6, 15);
//
@PreInit
public void preInit( FMLPreInitializationEvent event )
{
MyNameItem_1 = new MyNameItem(2020);
GameRegistry.registerItem(MyNameItem_1, "MyNameItem_1");
LanguageRegistry.addName(MyNameItem_1, "My Awesome Item");
MyNameSword_1 = new MyNameSword(2021, EnumToolMaterial.IRON);
GameRegistry.registerItem(MyNameSword_1, "MyNameSword_1");
LanguageRegistry.addName(MyNameSword_1, "My Awesome Sword");
MyNameBlock_1 = new MyNameBlock(2022, "MyNameBlock_1").setHardness(2.0F).setStepSound(Block.soundMetalFootstep).setResistance(10.0F).setUnlocalizedName("MyNameMod:MyNameBlock_1");
GameRegistry.registerBlock(MyNameBlock_1, "MyNameBlock_");
LanguageRegistry.addName(MyNameBlock_1, "My Awesome Block");
}
Here is the code for my MyNameSword class:
public class MyNameSword extends ItemSword {
public MyNameSword(int ItemID, EnumToolMaterial material)
{
super(ItemID, material);
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("MyNameMod:MyNameSword_1");
}
}
And here's the code for my MyNameItem class:
public class MyNameItem extends Item
{
public MyNameItem(int par1)
{
super(par1); //Returns super constructor: par1 is ID
setCreativeTab(CreativeTabs.tabMaterials); // Tells the game what creative mode tab it goes in
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("MyNameMod:MyNameItem_1");
}
}
Does anyone have any idea what could be happening here?
Thanks so much in advance,
Its a new thing in 1.6
Sword can't destroy blocks on creative mode. Your code is fine
I have a video covering different textures for different sides of blocks. Video is below, even though its for biomes I can guess the same code will apply to machines as well.
I have a video covering different textures for different sides of blocks. Video is below, even though its for biomes I can guess the same code will apply to machines as well.
Scrub to 13:10
Yeah, but my DishWasher is a custom furnace. You should either have or make a tutorial on texturing furnaces because I've only gotten the top texture to load.
Rollback Post to RevisionRollBack
I just took the Minecraft Noob test! Check out what I scored. Think you can beat me?!
well you're right ive been looking for people who can tell me but well i think ill just make a class for evey item
I will be covering this on my youtube channel either Friday or Saturday.
http://youtube.com/shaqarudengamesbut I think it should be the same way though
Remove pteri in the directory. It's un-needed.
If we use that on food, we need to edit the base class?
its a bit to late i alreaddy made a clas for each item :/ but either way im going to check it... Thanks
Did you try using the same code as for items? within the register icon function try typing "this.e" and it should show something like entityIcon maybe.
Minecraft only uses png files so this does not need to be specified, also updateIcons should be registerIcons as well try to keep spaces out of the mix.
also for your main code try this...
and if that doesn't work try changing @EventHandler on the PreInit function @PreInit
Great to Hear!
[INFO] [Minecraft-Client] Reloading ResourceManager: Default, FMLFileResourcePack:Your Mod Name
If you put a where you register your icons, you will see they get loaded after the above statement with no following error logs.
I don't know why they try to load earlier and fail, but they load the second time.
Yea, Im looking into that, seems weird.
The Sword that I have added doesn't seem to be working at all, even though it is in the game and looking just fine.
Here is a short video where I demonstrate the problem:
If you watch this, you'll see two problems:
Here is the code for my MyNameSword class:
And here's the code for my MyNameItem class:
Does anyone have any idea what could be happening here?
Thanks so much in advance,
Its a new thing in 1.6
Sword can't destroy blocks on creative mode. Your code is fine
Here's my code for BlockDishWasher:
I just took the Minecraft Noob test! Check out what I scored. Think you can beat me?!
To take the test, check out
https://minecraftnoobtest.com/test.php
Don't click this link, HE is haunting it...
Scrub to 13:10
Yeah, but my DishWasher is a custom furnace. You should either have or make a tutorial on texturing furnaces because I've only gotten the top texture to load.
I just took the Minecraft Noob test! Check out what I scored. Think you can beat me?!
To take the test, check out
https://minecraftnoobtest.com/test.php
Don't click this link, HE is haunting it...
I put that in
mcp/src/minecraft/assets/moreforminecraft/textures/blocks/allmyitems.png