Since mine was forgotten about here is it again
Hi again.. for the block texture name is it (textures:testblock)? if not what is it?
the file name for the texture should be whatever you put in SetBlockName(). If you put SetBlockName("testblock"), then your texture file should be testblock.png
Ah okay.. i was hoping there was a way to do it without creating redundant textures
You may be able to point the texture to an existing Minecraft texture. As to exactly how, you could manipulate the registerIcons method to point towards your specified texture.
This is what my mod in for the texture and its not working, what is wrong?
package com.gmail.mixenprix.test.blocks;
import com.gmail.mixenprix.test.help.Reference;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
public class Blocktitaniumore extends Block
{
public Blocktitaniumore()
{
super(Material.iron);
setBlockName("titaniumore");
setBlockTextureName(Reference.MODID + "titaniumore" + getUnlocalizedName().substring(5));
setCreativeTab(CreativeTabs.tabBlock);
This is what my mod in for the texture and its not working, what is wrong?
package com.gmail.mixenprix.test.blocks;
import com.gmail.mixenprix.test.help.Reference;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
public class Blocktitaniumore extends Block
{
public Blocktitaniumore()
{
super(Material.iron);
setBlockName("titaniumore");
setBlockTextureName(Reference.MODID + "titaniumore" + getUnlocalizedName().substring(5));
setCreativeTab(CreativeTabs.tabBlock);
}
}
getUnlocalizedName grabs the name specified in setBlockName, so your texture is being called "modidtitaniumoretitaniumore". You need to do (Reference.MODID + ":" + getUnlocalizedName().substring(5));
public class ModRecipes
{
public static void init()
{
// Overworld
GameRegistry.addSmelting(ModBlocks.draconiumOre, new ItemStack(Items.redstone), 0.8F);
public class ModRecipes
{
public static void init()
{
// Overworld
GameRegistry.addSmelting(ModBlocks.draconiumOre, new ItemStack(Items.redstone), 0.8F);
The Meaning of Life, the Universe, and Everything.
Location:
Skaro!? YOU BROUGHT ME TO SKARO!
Join Date:
4/24/2014
Posts:
405
Location:
Saving people. Hunting.
Minecraft:
LuciferPlays
Member Details
Howdy Jake.
I stumbled across this a few days ago. And now I shall start making a mod xD
Would you suggest, with me having no prior coding knowledge, to follow along exactly with what your names/titles/code is to understand or should I dare change names?
Rollback Post to RevisionRollBack
No one in the history of torture's been tortured with torture like the torture you'll be tortured with.
I stumbled across this a few days ago. And now I shall start making a mod xD
Would you suggest, with me having no prior coding knowledge, to follow along exactly with what your names/titles/code is to understand or should I dare change names?
It really boils down to how well you can grasp certain concepts of programming. When I first started learning Java, I remember having a really hard time with names and such, and I really just kept everything named the same as I saw them. As you become more knowledgable, however, you'll start to realize that you can name your classes and packages whatever you want, as long as you know what they do.
Naming your classes and such how I do mine shouldn't hurt you - when browsing other mods source code, everything will be relatively the same. One thing about classes and packages is that they can be named, really, whatever you want, as long as you know what each class does/contains.
My boy is learning to code java and has an interest in Minecraft so modding seemed to be a good place for him to start. He's had good luck with a Youth Digital course on Modding but now wants to be able to code mods for 1.7.
I was working to get his development environment set up and found your tutorials...A huge help! I followed the instructions and everything seemed to be going well until I opened Eclipse and the Minecraft folder is empty. It appears as though the source did not get copied. Any ideas on what I missed or did wrong.
My boy is learning to code java and has an interest in Minecraft so modding seemed to be a good place for him to start. He's had good luck with a Youth Digital course on Modding but now wants to be able to code mods for 1.7.
I was working to get his development environment set up and found your tutorials...A huge help! I followed the instructions and everything seemed to be going well until I opened Eclipse and the Minecraft folder is empty. It appears as though the source did not get copied. Any ideas on what I missed or did wrong.
Thanks in advance.
Just reinstall via command prompt and terminal, I had the same thing and one it's downloaded again it works
Just finished up working with page 3, but when I try to launch to see if it worked I get this:
[04:38:23] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLTweaker
[04:38:23] [main/INFO] [LaunchWrapper]: Using primary tweak class name cpw.mods.fml.common.launcher.FMLTweaker
[04:38:23] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLTweaker
[04:38:23] [main/INFO] [FML]: Forge Mod Loader version 7.2.211.1121 for Minecraft 1.7.2 loading
[04:38:23] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_31, running on Windows 7:amd64:6.1, installed at C:\Program Files\Java\jre1.8.0_31
[04:38:23] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
[04:38:23] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
[04:38:23] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLDeobfTweaker
[04:38:23] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
[04:38:23] [main/ERROR] [LaunchWrapper]: Unable to launch
java.util.ConcurrentModificationException
at java.util.ArrayList$Itr.checkForComodification(Unknown Source) ~[?:1.8.0_31]
at java.util.ArrayList$Itr.remove(Unknown Source) ~[?:1.8.0_31]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:117) [launchwrapper-1.9.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]
Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
[05:21:26] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!
[05:21:26] [main/ERROR] [FML]: The minecraft jar file:/C:/Users/Kyle/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.2-10.12.2.1121/forgeSrc-1.7.2-10.12.2.1121.jar!/net/minecraft/client/ClientBrandRetriever.class appears to be corrupt! There has been CRITICAL TAMPERING WITH MINECRAFT, it is highly unlikely minecraft will work! STOP NOW, get a clean copy and try again!
[05:21:26] [main/ERROR] [FML]: FML has been ordered to ignore the invalid or missing minecraft certificate. This is very likely to cause a problem!
[05:21:26] [main/ERROR] [FML]: Technical information: ClientBrandRetriever was at jar:file:/C:/Users/Kyle/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.2-10.12.2.1121/forgeSrc-1.7.2-10.12.2.1121.jar!/net/minecraft/client/ClientBrandRetriever.class, there were 0 certificates for it
[05:21:26] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing
[05:21:26] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper
[05:21:26] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLDeobfTweaker
[05:21:26] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}
[05:21:26] [main/ERROR] [LaunchWrapper]: Unable to launch
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_75]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_75]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_75]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_75]
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:?]
Caused by: java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source) ~[?:1.7.0_75]
at java.lang.Runtime.loadLibrary0(Unknown Source) ~[?:1.7.0_75]
at java.lang.System.loadLibrary(Unknown Source) ~[?:1.7.0_75]
at org.lwjgl.Sys$1.run(Sys.java:73) ~[lwjgl-2.9.0.jar:?]
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.7.0_75]
at org.lwjgl.Sys.doLoadLibrary(Sys.java:66) ~[lwjgl-2.9.0.jar:?]
at org.lwjgl.Sys.loadLibrary(Sys.java:95) ~[lwjgl-2.9.0.jar:?]
at org.lwjgl.Sys.<clinit>(Sys.java:112) ~[lwjgl-2.9.0.jar:?]
at net.minecraft.client.Minecraft.getSystemTime(Minecraft.java:2674) ~[Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:40) ~[Main.class:?]
... 6 more
Any idea whats going on here?
EDIT2:
Nevermind... apparently back at the start of the tutorial I did a dumb, and downloaded forge for 1.7.2 instead of 1.7.10
Moved my src into a new project with the correct forge. Works fine.
Hurray needless coding bugs XP
I'd like to suggest adding something about .gitignore in the first section. If there's a bunch of stuff we can ignore, no reason to clutter the repo; so that would be nice
And second, thanks much for this tutorial, clear and well paced
I'd like to suggest adding something about .gitignore in the first section. If there's a bunch of stuff we can ignore, no reason to clutter the repo; so that would be nice
And second, thanks much for this tutorial, clear and well paced
.gitignore is as simply as creating the file, and adding whatever folders/files you want to be ignored. I might make a reference to mine for those who need it.
The Meaning of Life, the Universe, and Everything.
Join Date:
1/8/2013
Posts:
164
Member Details
EDIT: I had a problem, but I worked around it. Nice tutorials by the way
EDIT2: I now have a real problem. In your Ore tutorial, I can't start a world because in the MODNAMEWorldGeneration class, x and z cannot be resolved to a variable.
I re-ran the commands and still the same result...At that point I cleared my forge directory then re-extracted the forge files and re-ran the commands and it worked like a charm. We're up and running.
Thanks for the help!
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Ah okay.. i was hoping there was a way to do it without creating redundant textures
the file name for the texture should be whatever you put in SetBlockName(). If you put SetBlockName("testblock"), then your texture file should be testblock.png
You may be able to point the texture to an existing Minecraft texture. As to exactly how, you could manipulate the registerIcons method to point towards your specified texture.
package com.gmail.mixenprix.test.blocks;
import com.gmail.mixenprix.test.help.Reference;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
public class Blocktitaniumore extends Block
{
public Blocktitaniumore()
{
super(Material.iron);
setBlockName("titaniumore");
setBlockTextureName(Reference.MODID + "titaniumore" + getUnlocalizedName().substring(5));
setCreativeTab(CreativeTabs.tabBlock);
}
}
Should be: setBlockTextureName(Reference.MODID + ":" + getUnlocalizedName().substring(5));
getUnlocalizedName grabs the name specified in setBlockName, so your texture is being called "modidtitaniumoretitaniumore". You need to do (Reference.MODID + ":" + getUnlocalizedName().substring(5));
Nothing needs to be changed unless you changed the name of the Reference file. Make sure Reference and IIconRegister are imported as well.
Below is my code:
ModRecipies Class
package sao.init;
import items.ItemDraconiumIngot;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.registry.GameRegistry;
import sao.blocks.BlockDraconiumOre;
public class ModRecipes
{
public static void init()
{
// Overworld
GameRegistry.addSmelting(ModBlocks.draconiumOre, new ItemStack(Items.redstone), 0.8F);
}
}
Mod Blocks Class
package sao.init;
import sao.blocks.BlockDraconiumOre;
import sao.blocks.BlockXeoniteOre;
import net.minecraft.block.Block;
import lib.RegisterHelper;
import cpw.mods.fml.common.registry.GameRegistry;
public class ModBlocks
{
public static Block draconiumOre = new BlockDraconiumOre();
public static Block XeoniteOre = new BlockXeoniteOre();
public static void init()
{
RegisterHelper.registerBlock(draconiumOre);
RegisterHelper.registerBlock(XeoniteOre);
}
}
Main Mod File
package main;
import sao.init.ModBlocks;
import sao.init.ModItems;
import sao.init.ModRecipes;
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 net.minecraft.item.Item.ToolMaterial;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.Achievement;
import net.minecraftforge.common.AchievementPage;
import net.minecraftforge.common.util.EnumHelper;
import Proxy.ProxyCommon;
import event.ScratchOnSmeltEvent;
import items.ItemDraconiumIngot;
import items.ItemXeoniteIngot;
import lib.Refrences;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.IWorldGenerator;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
@Mod(
modid = Refrences.MODID,
name = Refrences.NAME,
version = Refrences.VERSION)
public class sao
{
//Achievements
public static Achievement achievementBonemeal;
public static Achievement achievementSmoothStone;
//CreativeTab
public static CreativeTabs tabSAO = new CreativeTabs("tabSAO"){
public Item getTabIconItem(){
return new Item();
}
};
@Instance(value = Refrences.MODID)
public static sao instance;
public static sao modInstance;
@SidedProxy(
clientSide = Refrences.CLIENT_PROXY_LOCATION,
serverSide = Refrences.COMMON_PROXY_LOCATION)
public static ProxyCommon proxy;
@EventHandler
public void preinit(FMLInitializationEvent event)
{
ModItems.init();
ModBlocks.init();
}
@EventHandler
public void init(FMLInitializationEvent event)
{
//CreativeTabs
LanguageRegistry.instance().addStringLocalization("itemGroup.tabSAO", "en_US", "Sword Art");
ModRecipes.init();
//TileEntiity Registry
FMLCommonHandler.instance().bus().register(new ScratchOnSmeltEvent());}
@EventHandler
public void preload(FMLInitializationEvent event){
}
@EventHandler
public void load(FMLInitializationEvent event)
{
proxy.registerRenderers();
//Achievement Registry
achievementBonemeal = new Achievement("achievement.bonemeal", "bonemeal", 0, 0, new ItemStack(Items.dye, 15), (Achievement)null).initIndependentStat().registerStat().setSpecial();
achievementSmoothStone = new Achievement("achievement.smoothstone", "smoothstone", 2, 1, Blocks.stone, (Achievement)null).registerStat().setSpecial();
//Achievement Page
AchievementPage.registerAchievementPage(new AchievementPage("SAO Achievements!", new Achievement[]{achievementSmoothStone,achievementBonemeal}));
}
}
And once again thanks for any help you can provide
Any specific errors? Crashes? Or does it just not work?
I stumbled across this a few days ago. And now I shall start making a mod xD
Would you suggest, with me having no prior coding knowledge, to follow along exactly with what your names/titles/code is to understand or should I dare change names?
No one in the history of torture's been tortured with torture like the torture you'll be tortured with.
Pretty pleeeeeease check out my thread; http://www.minecraftforum.net/forums/show-your-creation/video-series-help/other-help/2544803-doctor-who-minecraft-animation-series
It really boils down to how well you can grasp certain concepts of programming. When I first started learning Java, I remember having a really hard time with names and such, and I really just kept everything named the same as I saw them. As you become more knowledgable, however, you'll start to realize that you can name your classes and packages whatever you want, as long as you know what they do.
Naming your classes and such how I do mine shouldn't hurt you - when browsing other mods source code, everything will be relatively the same. One thing about classes and packages is that they can be named, really, whatever you want, as long as you know what each class does/contains.
Ah I see what is wrong. You seem to have a bad import which needs to be changed to your RegisterHelper class instead.
My boy is learning to code java and has an interest in Minecraft so modding seemed to be a good place for him to start. He's had good luck with a Youth Digital course on Modding but now wants to be able to code mods for 1.7.
I was working to get his development environment set up and found your tutorials...A huge help! I followed the instructions and everything seemed to be going well until I opened Eclipse and the Minecraft folder is empty. It appears as though the source did not get copied. Any ideas on what I missed or did wrong.
Thanks in advance.
Just reinstall via command prompt and terminal, I had the same thing and one it's downloaded again it works
[04:38:23] [main/INFO] [LaunchWrapper]: Using primary tweak class name cpw.mods.fml.common.launcher.FMLTweaker
[04:38:23] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLTweaker
[04:38:23] [main/INFO] [FML]: Forge Mod Loader version 7.2.211.1121 for Minecraft 1.7.2 loading
[04:38:23] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_31, running on Windows 7:amd64:6.1, installed at C:\Program Files\Java\jre1.8.0_31
[04:38:23] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
[04:38:23] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
[04:38:23] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLDeobfTweaker
[04:38:23] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
[04:38:23] [main/ERROR] [LaunchWrapper]: Unable to launch
java.util.ConcurrentModificationException
at java.util.ArrayList$Itr.checkForComodification(Unknown Source) ~[?:1.8.0_31]
at java.util.ArrayList$Itr.remove(Unknown Source) ~[?:1.8.0_31]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:117) [launchwrapper-1.9.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]
Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
EDIT:
I did some searching and discovered my original problem was that forge doesn't work with jre 8.
I followed the advice here: http://stackoverflow.com/questions/9302687/how-can-i-tell-eclipse-to-compile-and-build-a-project-with-a-different-jre-versi
and told eclipse to use 7 instead. Now I'm getting this instead:
[05:21:26] [main/ERROR] [FML]: The minecraft jar file:/C:/Users/Kyle/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.2-10.12.2.1121/forgeSrc-1.7.2-10.12.2.1121.jar!/net/minecraft/client/ClientBrandRetriever.class appears to be corrupt! There has been CRITICAL TAMPERING WITH MINECRAFT, it is highly unlikely minecraft will work! STOP NOW, get a clean copy and try again!
[05:21:26] [main/ERROR] [FML]: FML has been ordered to ignore the invalid or missing minecraft certificate. This is very likely to cause a problem!
[05:21:26] [main/ERROR] [FML]: Technical information: ClientBrandRetriever was at jar:file:/C:/Users/Kyle/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.2-10.12.2.1121/forgeSrc-1.7.2-10.12.2.1121.jar!/net/minecraft/client/ClientBrandRetriever.class, there were 0 certificates for it
[05:21:26] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing
[05:21:26] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper
[05:21:26] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLDeobfTweaker
[05:21:26] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}
[05:21:26] [main/ERROR] [LaunchWrapper]: Unable to launch
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_75]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_75]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_75]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_75]
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:?]
Caused by: java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source) ~[?:1.7.0_75]
at java.lang.Runtime.loadLibrary0(Unknown Source) ~[?:1.7.0_75]
at java.lang.System.loadLibrary(Unknown Source) ~[?:1.7.0_75]
at org.lwjgl.Sys$1.run(Sys.java:73) ~[lwjgl-2.9.0.jar:?]
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.7.0_75]
at org.lwjgl.Sys.doLoadLibrary(Sys.java:66) ~[lwjgl-2.9.0.jar:?]
at org.lwjgl.Sys.loadLibrary(Sys.java:95) ~[lwjgl-2.9.0.jar:?]
at org.lwjgl.Sys.<clinit>(Sys.java:112) ~[lwjgl-2.9.0.jar:?]
at net.minecraft.client.Minecraft.getSystemTime(Minecraft.java:2674) ~[Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:40) ~[Main.class:?]
... 6 more
EDIT2:
Nevermind... apparently back at the start of the tutorial I did a dumb, and downloaded forge for 1.7.2 instead of 1.7.10
Moved my src into a new project with the correct forge. Works fine.
Hurray needless coding bugs XP
And second, thanks much for this tutorial, clear and well paced
.gitignore is as simply as creating the file, and adding whatever folders/files you want to be ignored. I might make a reference to mine for those who need it.
EDIT2: I now have a real problem. In your Ore tutorial, I can't start a world because in the MODNAMEWorldGeneration class, x and z cannot be resolved to a variable.
I re-ran the commands and still the same result...At that point I cleared my forge directory then re-extracted the forge files and re-ran the commands and it worked like a charm. We're up and running.
Thanks for the help!