Iv'e got some questions, would i be able to have blocks with different models using one ID? and if it were possible/impossible could you do a tutorial some time on how to make blocks with different models, possibly using techne? (If you don't know what that it is just look it up in google, its a modeler for minecraft) or if you could point me to a tutorial that has already been made for this? Thanks
1) I'm sure it's possible, but I don't know how to do it
2) I know what Techne is xD
3) Not sure if there are tutorials about it actually :/
The Meaning of Life, the Universe, and Everything.
Join Date:
5/16/2012
Posts:
52
Member Details
Why is it telling me that when making a new block object public static Block blockRuby = new BlockRuby(250);
it tells me I have to make it static but then when adding the registry it tells me it cant be static...
Why is it telling me that when making a new block object public static Block blockRuby = new BlockRuby(250);
it tells me I have to make it static but then when adding the registry it tells me it cant be static...
I have the Recipe and Registers in the CommonProxy and calling the block from the main class where you have it named TutorialMain.
In the CommonProxy Registers it gives me an error telling me I have to remove the static and if I do in the main class where it's being called says that it needs static.
The Register methods in the CommonProxy is telling me if another way to fix it is by adding public static BlockblockRuby; before the calling.
also proxy.registerBlocks(); is giving me an error saying that we need to add a registerBlocks method in the ClientProxy but the only thing we have in there is public void registerRenderInformation().
I have the Recipe and Registers in the CommonProxy and calling the block from the main class where you have it named TutorialMain.
In the CommonProxy Registers it gives me an error telling me I have to remove the static and if I do in the main class where it's being called says that it needs static.
The Register methods in the CommonProxy is telling me if another way to fix it is by adding public static BlockblockRuby; before the calling.
also proxy.registerBlocks(); is giving me an error saying that we need to add a registerBlocks method in the ClientProxy but the only thing we have in there is public void registerRenderInformation().
Your proxy object should be an instance of CommonProxy, and you should use that to call the register methods, not just call it directly.
You should have public static Block blockRuby; outside of any methods, and then in preinit call: blockRuby = new BlockRuby( etc.
im trying to find where i put my GFX folder with my textures. . . and i dont understand what you mean by putting it in Minecraft/common. All im trying to get it to do right now is preload the textures. theres currently no code for my item yet, but it cant compile unless it knows where the textures are. . . all it says in the tutorial is "/TutorialGFX/Item.png" Could someone clarify this for me. . .
My set up is the same as the tutorial but heres the names
im trying to find where i put my GFX folder with my textures. . . and i dont understand what you mean by putting it in Minecraft/common. All im trying to get it to do right now is preload the textures. theres currently no code for my item yet. all it says in the tutorial is "/TutorialGFX/Item.png" Could someone clarify this for me. . .
My set up is the same as the tutorial but heres the names
The textures will go in src/minecraft or in src/minecraft/Lecapria, but if you do that you need to load them as /Lecapria/***/Items.png
xP i put it in the CommonProxy instead of the ClientProxy. It works now my bad
edit:
texture is invisible in game. . .
i cant help but feel there should be something texture related in the CommonProxy.java. . . Heres my code
modMain.java
package Lecapria.main; //The package your mod is in
import net.minecraft.block.Block;
import java.net.Proxy;
import net.minecraft.item.Item;
import Lecapria.main.client.core.handlers.ClientPacketHandler;
import Lecapria.main.common.core.CommonProxy;
import Lecapria.main.common.core.handlers.ServerPacketHandler;
import Lecapria.main.client.core.item.ItemTeeth;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
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.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkMod.SidedPacketHandler;
import cpw.mods.fml.common.network.NetworkRegistry;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.common.network.NetworkMod.SidedPacketHandler;
import cpw.mods.fml.common.SidedProxy;
@NetworkMod(clientSideRequired=true,serverSideRequired=true, //Whether client side and server side are needed
clientPacketHandlerSpec = @SidedPacketHandler(channels = {"modGeneral" }, packetHandler = ClientPacketHandler.class), //For clientside packet handling
serverPacketHandlerSpec = @SidedPacketHandler(channels = {}, packetHandler = ServerPacketHandler.class)) //For serverside packet handling
@Mod(modid="Lecapria'sMod",name="MainMod",version="1.0") //Gives Forge extra info about your mod
public class modMain
{ //The class file
public static Item wormTeeth = new ItemTeeth(15000);
@Instance("MainMod") //The instance, this is very important later on
public static modMain instance = new modMain();
@SidedProxy(clientSide = "Lecapria.main.client.core.ClientProxy", serverSide = "Lecapria.main.common.core.CommonProxy") //Tells Forge the location of your proxies
public static CommonProxy proxy;
@Init
public void InitCobaltCraft(FMLInitializationEvent event)
{ //Your main initialization method
proxy.addNames();
proxy.registerBlocks();
proxy.addRecipes();
NetworkRegistry.instance().registerGuiHandler(this, proxy); //Registers the class that deals with GUI data
}
}
CommonProxy.java
package Lecapria.main.common.core;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.world.World;
import cpw.mods.fml.common.network.IGuiHandler;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import Lecapria.main.modMain;
public class CommonProxy implements IGuiHandler
{
//THIS IS IMPORTANT, CANNOT BE A PROXY/GUI HANDLER WITHOUT THIS!!
public void registerRenderInformation() //Client side texture registering
{
}
@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
{
return null;
}
@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
{
return null;
}
public void registerTiles()
{
}
public void registerBlocks()
{
}
public void addNames()
{
LanguageRegistry.addName(modMain.wormTeeth, "Worm Teeth"); //Adds the name for the ruby item
}
public void addRecipes()
{
}
}
ClientProxy.java
package Lecapria.main.client.core;
import Lecapria.main.common.core.CommonProxy;
import net.minecraftforge.client.MinecraftForgeClient;
public class ClientProxy extends CommonProxy
{
public void registerRenderInformation()
{
MinecraftForgeClient.preloadTexture("/modMainGFX/Tiles/items/teeth.png");
}
}
ItemTeeth.java
package Lecapria.main.client.core.item;
import net.minecraft.item.Item;
import cpw.mods.fml.relauncher.*;
import Lecapria.main.modMain;
import net.minecraft.creativetab.CreativeTabs;
public class ItemTeeth extends Item
{
public ItemTeeth(int par1)
{
super(par1); //Returns super constructor: par1 is ID
setTextureFile("/modMainGFX/Tiles/items/teeth.png"); //Sets the item texture file
setItemName("LecapriaItemWormTeeth"); //Sets the incode name of the item, make sure it doesn't clash with other items, weird stuff happens
setCreativeTab(CreativeTabs.tabMaterials); //Tells the game what creative mode tab it goes in
}
@SideOnly(Side.CLIENT) //Marks a method as client side only, typically for graphics and rendering
public int getItemIconFromDamage(int i)
{
return 0; //The first icon on the spritesheet
}
}
xP i put it in the CommonProxy instead of the ClientProxy. It works now my bad
edit:
texture is invisible in game. . .
i cant help but feel there should be something texture related in the CommonProxy.java. . . Heres my code
modMain.java
package Lecapria.main; //The package your mod is in
import net.minecraft.block.Block;
import java.net.Proxy;
import net.minecraft.item.Item;
import Lecapria.main.client.core.handlers.ClientPacketHandler;
import Lecapria.main.common.core.CommonProxy;
import Lecapria.main.common.core.handlers.ServerPacketHandler;
import Lecapria.main.client.core.item.ItemTeeth;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
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.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkMod.SidedPacketHandler;
import cpw.mods.fml.common.network.NetworkRegistry;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.common.network.NetworkMod.SidedPacketHandler;
import cpw.mods.fml.common.SidedProxy;
@NetworkMod(clientSideRequired=true,serverSideRequired=true, //Whether client side and server side are needed
clientPacketHandlerSpec = @SidedPacketHandler(channels = {"modGeneral" }, packetHandler = ClientPacketHandler.class), //For clientside packet handling
serverPacketHandlerSpec = @SidedPacketHandler(channels = {}, packetHandler = ServerPacketHandler.class)) //For serverside packet handling
@Mod(modid="Lecapria'sMod",name="MainMod",version="1.0") //Gives Forge extra info about your mod
public class modMain
{ //The class file
public static Item wormTeeth = new ItemTeeth(15000);
@Instance("MainMod") //The instance, this is very important later on
public static modMain instance = new modMain();
@SidedProxy(clientSide = "Lecapria.main.client.core.ClientProxy", serverSide = "Lecapria.main.common.core.CommonProxy") //Tells Forge the location of your proxies
public static CommonProxy proxy;
@Init
public void InitCobaltCraft(FMLInitializationEvent event)
{ //Your main initialization method
proxy.addNames();
proxy.registerBlocks();
proxy.addRecipes();
NetworkRegistry.instance().registerGuiHandler(this, proxy); //Registers the class that deals with GUI data
}
}
CommonProxy.java
package Lecapria.main.common.core;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.world.World;
import cpw.mods.fml.common.network.IGuiHandler;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import Lecapria.main.modMain;
public class CommonProxy implements IGuiHandler
{
//THIS IS IMPORTANT, CANNOT BE A PROXY/GUI HANDLER WITHOUT THIS!!
public void registerRenderInformation() //Client side texture registering
{
}
@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
{
return null;
}
@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
{
return null;
}
public void registerTiles()
{
}
public void registerBlocks()
{
}
public void addNames()
{
LanguageRegistry.addName(modMain.wormTeeth, "Worm Teeth"); //Adds the name for the ruby item
}
public void addRecipes()
{
}
}
ClientProxy.java
package Lecapria.main.client.core;
import Lecapria.main.common.core.CommonProxy;
import net.minecraftforge.client.MinecraftForgeClient;
public class ClientProxy extends CommonProxy
{
public void registerRenderInformation()
{
MinecraftForgeClient.preloadTexture("/modMainGFX/Tiles/items/teeth.png");
}
}
ItemTeeth.java
package Lecapria.main.client.core.item;
import net.minecraft.item.Item;
import cpw.mods.fml.relauncher.*;
import Lecapria.main.modMain;
import net.minecraft.creativetab.CreativeTabs;
public class ItemTeeth extends Item
{
public ItemTeeth(int par1)
{
super(par1); //Returns super constructor: par1 is ID
setTextureFile("/modMainGFX/Tiles/items/teeth.png"); //Sets the item texture file
setItemName("LecapriaItemWormTeeth"); //Sets the incode name of the item, make sure it doesn't clash with other items, weird stuff happens
setCreativeTab(CreativeTabs.tabMaterials); //Tells the game what creative mode tab it goes in
}
@SideOnly(Side.CLIENT) //Marks a method as client side only, typically for graphics and rendering
public int getItemIconFromDamage(int i)
{
return 0; //The first icon on the spritesheet
}
}
Try calling proxy.registerRenderInformation() in init, it might help
Hello i am making a mod that adds items that when they are in your tool bar it does something like give the player a potion effect. I couldnt
find any thing like it so i was wondering if you know how to do something like that?
Hello i am making a mod that adds items that when they are in your tool bar it does something like give the player a potion effect. I couldnt
find any thing like it so i was wondering if you know how to do something like that?
I have an item that does something on use. Is there any way i can make it so that it cannot break(ie once it gets to the durabilty of 0(or 1) it is no longer usable and you must go and "recharge" the item? I dont want to lose the item, just make it unusable.
1) I'm sure it's possible, but I don't know how to do it
2) I know what Techne is xD
3) Not sure if there are tutorials about it actually :/
Graphical effects
public static Block blockRuby = new BlockRuby(250);
it tells me I have to make it static but then when adding the registry it tells me it cant be static...
ninja'ed
Where are you calling it?
I have the Recipe and Registers in the CommonProxy and calling the block from the main class where you have it named TutorialMain.
In the CommonProxy Registers it gives me an error telling me I have to remove the static and if I do in the main class where it's being called says that it needs static.
The Register methods in the CommonProxy is telling me if another way to fix it is by adding public static BlockblockRuby; before the calling.
also proxy.registerBlocks(); is giving me an error saying that we need to add a registerBlocks method in the ClientProxy but the only thing we have in there is public void registerRenderInformation().
Your proxy object should be an instance of CommonProxy, and you should use that to call the register methods, not just call it directly.
You should have public static Block blockRuby; outside of any methods, and then in preinit call: blockRuby = new BlockRuby( etc.
I created a door, but I don't know how to metadata this
A Huge Castle Download: (Coming Soon!)
You just want multiple doors? Well all the metadata does is change texture, so just keep adding more metadatas on that copy 0 and 1
My set up is the same as the tutorial but heres the names
MODS/New/src/minecraft/Lecapria/main/modMain.java
MODS/New/src/minecraft/Lecapria/main/client/core/handlers/ClientPacketHandler.java
MODS/New/src/minecraft/Lecapria/main/client/common/core/handlers/ServerPacketHandler.java
MODS/New/src/minecraft/Lecapria/main/client/common/core/ClientProxy.java
MODS/New/src/minecraft/Lecapria/main/client/common/core/CommonProxy.java
My Planetminecraft Page
The textures will go in src/minecraft or in src/minecraft/Lecapria, but if you do that you need to load them as /Lecapria/***/Items.png
xP i put it in the CommonProxy instead of the ClientProxy. It works now my bad
edit:
texture is invisible in game. . .
i cant help but feel there should be something texture related in the CommonProxy.java. . . Heres my code
modMain.java
CommonProxy.java
ClientProxy.java
ItemTeeth.java
My Planetminecraft Page
I have the minecraft_server.jar but is there more I need?
Try calling proxy.registerRenderInformation() in init, it might help
Ignore that, it doesn't matter
You might have failed to register a block, can I see the code?
Leave common alone, it isn't used anymore, but it was the folder where you used to have to put stuff
What location are you importing from?
find any thing like it so i was wondering if you know how to do something like that?
No, sorry, I don't know how to do that :/