ok i even copied your code for the common proxy and client proxy and doesnt work
P.S what do configs do? also plz make a tutorial for custom drops for blocks
Well the configs make a .txt file that you can use to change the item/blocks/etc's id, which makes the mod you're making more compatible with others. When it comes to different drops, this have to happen in the BlockTutorial class (or BlockYourBlocks.class). I will make a tutorial on this soon I think, but I might put it underneath the Block tutorial.
hey xetos i think i'm having a problem with world gen. i don't have common proxy so do i have to have common proxy and client proxy for world gen? if you can do me a favor can you plz pastebin all the stuff?
P.S i can help you make the tut for custom drops
public int idDropped(int par1, Random Rand, int par2){
return Scrolls.tutItem.itemID;
hey xetos i think i'm having a problem with world gen. i don't have common proxy so do i have to have common proxy and client proxy for world gen? if you can do me a favor can you plz pastebin all the stuff?
P.S i can help you make the tut for custom drops
public int idDropped(int par1, Random Rand, int par2){
return Scrolls.tutItem.itemID;
all needed to add under BlockTutorial
Yeah, but this will make all the blocks with this class drop the same, to make it have more you can do this:
public int idDropped(int par1, Random par2Random, int par3) {
return this.blockID == MainClass.yourBlock.blockID ? MainClass.yourItem.itemID : this.blockID;
If you have to you write it like this:
public int idDropped(int par1, Random par2Random, int par3) {
return this.blockID == MainClass.yourBlock.blockID ? MainClass.yourItem.itemID : (this.blockID == MainClass.yourBlock2.blockID ? MainClass.yourItem2.itemID : this.blockID);
You could also edit the quantity of items you want to drop like this:
public int quantityDropped(Random par1Random) {
return this.blockID == MainClass.yourBlock.blockID ? 4 + par1Random.nextInt(5) : 1;
This will drop from 4 to 9 items I think, though I'm not 100% sure.
Hello Thank you very much for your tutorials i finished most of them, could you make a tutorial which adds special abilities to armor and tools please.
I think I will make a tutorial on all of the mobs possible, but I'm not sure. I think I first will make a hostile mob, then animal like a cow or pig and then I might try to make one for a rideable mob. How does that sound?
I think I will make a tutorial on all of the mobs possible, but I'm not sure. I think I first will make a hostile mob, then animal like a cow or pig and then I might try to make one for a rideable mob. How does that sound?
Every time I put on the armor in game it comes up with a bunch of errors in the problem bar and does not show the armor on the player. Here is my code
Armor class
public class SWATArmor extends ItemArmor implements IArmorTextureProvider{
// This Is Your Constructor, The First Param Is Item ID, The Second Is Its Material, The Third Is The Rendering ID, and The Final Is The Type (i.e. Helmet, Plate, Boots, Legs)
public SWATArmor(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4){
super(par1, par2EnumArmorMaterial, par3, par4);
}
// This Sets What The Armor Is Supposed To Render Like
@Override
public String getArmorTextureFile(ItemStack itemstack) {
if (itemstack.itemID == ZombieCraft.SWAThelmet.itemID || itemstack.itemID == ZombieCraft.SWATvest.itemID || itemstack.itemID == ZombieCraft.SWATboots.itemID) {
return "/armor/SWATarmor_1.png";
}
if (itemstack.itemID == ZombieCraft.SWATpants.itemID) {
return "/armor/SWATarmor_2.png";
}
else return "/armor/SWATarmor_2.png";
}
[/size]
package alogo.mods.zombie.common;
import cpw.mods.fml.common.network.IGuiHandler;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
public class CommonProxy implements IGuiHandler
{
public void registerRenderThings()
{
}
@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 int addArmour(String SWATArmor){
return 0;
}
}
[size=medium]
[/size]
Client proxy
@Override
public int addArmour(String SWATArmor){
return RenderingRegistry.addNewArmourRendererPrefix(SWATArmor);
}
[size=medium]}
Every time I put on the armor in game it comes up with a bunch of errors in the problem bar and does not show the armor on the player. Here is my code
Armor class
public class SWATArmor extends ItemArmor implements IArmorTextureProvider{
// This Is Your Constructor, The First Param Is Item ID, The Second Is Its Material, The Third Is The Rendering ID, and The Final Is The Type (i.e. Helmet, Plate, Boots, Legs)
public SWATArmor(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4){
super(par1, par2EnumArmorMaterial, par3, par4);
}
// This Sets What The Armor Is Supposed To Render Like
@Override
public String getArmorTextureFile(ItemStack itemstack) {
if (itemstack.itemID == ZombieCraft.SWAThelmet.itemID || itemstack.itemID == ZombieCraft.SWATvest.itemID || itemstack.itemID == ZombieCraft.SWATboots.itemID) {
return "/armor/SWATarmor_1.png";
}
if (itemstack.itemID == ZombieCraft.SWATpants.itemID) {
return "/armor/SWATarmor_2.png";
}
else return "/armor/SWATarmor_2.png";
}
[/size]
package alogo.mods.zombie.common;
import cpw.mods.fml.common.network.IGuiHandler;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
public class CommonProxy implements IGuiHandler
{
public void registerRenderThings()
{
}
@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 int addArmour(String SWATArmor){
return 0;
}
}
[size=medium]
Client proxy
@Override
public int addArmour(String SWATArmor){
return RenderingRegistry.addNewArmourRendererPrefix(SWATArmor);
}
[size=medium]}
This is how I would have done it:
Main class:
public static Item swatHelmet;
public static Item swatVest;
public static Item swatPants;
public static Item swatBoots;
public void load(FMLInitializationEvent event) {
proxy.registerRenderThings();
swatHelmet = new SWATArmor(558, SWAT, proxy.addArmour("SWATArmour"), 0).setItemName("swatHelmet").setIconIndex(6);[/size][/font]
[font=arial,helvetica,sans-serif][size=medium]swatVest = new SWATArmor(559, SWAT, proxy.addArmour("SWATArmour"), 1).setItemName("swatVest").setIconIndex(7);[/size][/font]
[font=arial,helvetica,sans-serif][size=medium]swatPants = new SWATArmor(560, SWAT, proxy.addArmour("SWATArmour"), 2).setItemName("swatPants").setIconIndex(8);[/size][/font]
[font=arial,helvetica,sans-serif][size=medium]swatBoots = new SWATArmor(561, SWAT, proxy.addArmour("SWATArmour"), 3).setItemName("swatBoots").setIconIndex(9);
LanguageRegistry.addName(swatHelmet, "SWAT Helmet");
LanguageRegistry.addName(swatVest, "SWAT Vest");
LanguageRegistry.addName(swatPants, "SWAT Pants");
LanguageRegistry.addName(swatBoots, "SWAT Boots");
}
Armour class:
public class SWATArmour extends ItemArmor implements IArmorTextureProvider {
public SWATArmour(int id, EnumArmorMaterial material, int renderer, int part) {
super(id, material, renderer, part);
}
@Override
public [size=medium][font=arial, helvetica, sans-serif]String getArmorTextureFile(ItemStack itemstack) {[/font][/size]
if (itemstack.itemID == MainClass.swatHelmet.itemID || itemstack.itemID == MainClass.swatVest.itemID || itemstack.itemID == MainClass.swatBoots.itemID) {
return "/yourFolderForYourMod/theArmourFolderForTextures/SWAT_1.png";
}
if (itemstack.itemID == MainClass.swatPants.itemID) {
return "/yourFolderForYourMod/theArmourFolderForTextures/SWAT_2.png";
}
else return "/yourFolderForYourMod/theArmourFolderForTextures/SWAT_2.png";
}
public String getTextureFile() {
return "/yourFolderForYourMod/yourItems.png";
}
}
Proxies:
The CommonProxy:
public int addArmor(String armor) {
return 0;
}
In the ClientProxy
public int addArmor(String armor) {
return RenderingRegistry.addNewArmourRendererPrefix(armor);
}
}
I haven't run into a problem because of it yet but whenever I start a new world I get the following message:
Warning: Texture /etherealGifts/Blocks.png not preloaded, will cause render glitches!
Could you help me understand why?
It isn't exactly the same stuff as the tutorial but it works.(mostly)
I only have this one error.
My codes:
public static Block Balpisto;
public static Item BalpistoDust;
public static Item EtherealString;
public static Item EtherealCloth;
public static Item EtherealShrapnel;
public static Item RaohStone;
@PreInit
public void preInit(FMLPreInitializationEvent evt) {
proxy.registerRenderThings();
}
@Init
public void load(FMLInitializationEvent evt) {
//Blocks
Balpisto = new BlockBalpisto(1475, 0).setHardness(3.0F).setResistance(3.0F).setBlockName("Balpisto");
//Items
BalpistoDust = new ItemBalpistoDust(14751).setItemName("BapistoDust").setIconIndex(0);
EtherealString = new ItemEtherealString(14752).setItemName("EtherealString").setIconIndex(1);
EtherealCloth = new ItemEtherealCloth(14753).setItemName("EtherealCloth").setIconIndex(2);
EtherealShrapnel = new ItemEtherealShrapnel(14754).setItemName("EtherealShrapnel").setIconIndex(3);
RaohStone = new ItemRaohStone(14755).setItemName("RaohStone").setIconIndex(4);
//GameRegistry
ItemStack BalpistoDustStack = new ItemStack(BalpistoDust);
ItemStack EtherealStringStack = new ItemStack(EtherealString);
ItemStack EtherealClothStack = new ItemStack(EtherealCloth);
I haven't run into a problem because of it yet but whenever I start a new world I get the following message:
Warning: Texture /etherealGifts/Blocks.png not preloaded, will cause render glitches!
Could you help me understand why?
It isn't exactly the same stuff as the tutorial but it works.(mostly)
I only have this one error.
My codes:
public static Block Balpisto;
public static Item BalpistoDust;
public static Item EtherealString;
public static Item EtherealCloth;
public static Item EtherealShrapnel;
public static Item RaohStone;
@PreInit
public void preInit(FMLPreInitializationEvent evt) {
proxy.registerRenderThings();
}
@Init
public void load(FMLInitializationEvent evt) {
//Blocks
Balpisto = new BlockBalpisto(1475, 0).setHardness(3.0F).setResistance(3.0F).setBlockName("Balpisto");
//Items
BalpistoDust = new ItemBalpistoDust(14751).setItemName("BapistoDust").setIconIndex(0);
EtherealString = new ItemEtherealString(14752).setItemName("EtherealString").setIconIndex(1);
EtherealCloth = new ItemEtherealCloth(14753).setItemName("EtherealCloth").setIconIndex(2);
EtherealShrapnel = new ItemEtherealShrapnel(14754).setItemName("EtherealShrapnel").setIconIndex(3);
RaohStone = new ItemRaohStone(14755).setItemName("RaohStone").setIconIndex(4);
//GameRegistry
ItemStack BalpistoDustStack = new ItemStack(BalpistoDust);
ItemStack EtherealStringStack = new ItemStack(EtherealString);
ItemStack EtherealClothStack = new ItemStack(EtherealCloth);
@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;
}
}
I have also seen this a few times, but never found anything that changes because of. As well at it doesn't come up all the time. I think this might be an fail with the bug checking from Forge. If anyone else know anything about this I would like to know why this is coming up as well, since it comes up even though we have given it texture.
One fix (I think this worked when I tried) make a String in your CommonProxy with the path to your texture (public static final String) and use the same in the block class.
Well the configs make a .txt file that you can use to change the item/blocks/etc's id, which makes the mod you're making more compatible with others. When it comes to different drops, this have to happen in the BlockTutorial class (or BlockYourBlocks.class). I will make a tutorial on this soon I think, but I might put it underneath the Block tutorial.
P.S i can help you make the tut for custom drops
public int idDropped(int par1, Random Rand, int par2){
return Scrolls.tutItem.itemID;
all needed to add under BlockTutorial
Yeah, but this will make all the blocks with this class drop the same, to make it have more you can do this:
If you have to you write it like this:
You could also edit the quantity of items you want to drop like this:
This will drop from 4 to 9 items I think, though I'm not 100% sure.
Forge is required for this to work.
Try to import EnumHelper before the EnumArmourMaterial, I know this actually doesn't matter, but it's an easier way to import both of them.
Easy, and will be done.
Thanks, I will.
I think I will make a tutorial on all of the mobs possible, but I'm not sure. I think I first will make a hostile mob, then animal like a cow or pig and then I might try to make one for a rideable mob. How does that sound?
Armor class
mod file
Common proxy
Client proxy
This is how I would have done it:
Main class:
Armour class:
Proxies:
The CommonProxy:
In the ClientProxy
Hope this helped.
Warning: Texture /etherealGifts/Blocks.png not preloaded, will cause render glitches!
Could you help me understand why?
It isn't exactly the same stuff as the tutorial but it works.(mostly)
I only have this one error.
My codes:
Main Class
package etherealGifts;
import java.net.Proxy;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
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.Mod.PostInit;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
@Mod(modid = "EtherealGifts", name = "EtherealGifts", version = "Alpha 0.1")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class EtherealGifts {
@Instance ("EtherealGifts")
public static EtherealGifts instance;
@SidedProxy (clientSide = "etherealGifts.ClientProxy", serverSide = "etherealGifts.CommonProxy")
public static CommonProxy proxy;
public static Block Balpisto;
public static Item BalpistoDust;
public static Item EtherealString;
public static Item EtherealCloth;
public static Item EtherealShrapnel;
public static Item RaohStone;
@PreInit
public void preInit(FMLPreInitializationEvent evt) {
proxy.registerRenderThings();
}
@Init
public void load(FMLInitializationEvent evt) {
//Blocks
Balpisto = new BlockBalpisto(1475, 0).setHardness(3.0F).setResistance(3.0F).setBlockName("Balpisto");
//Items
BalpistoDust = new ItemBalpistoDust(14751).setItemName("BapistoDust").setIconIndex(0);
EtherealString = new ItemEtherealString(14752).setItemName("EtherealString").setIconIndex(1);
EtherealCloth = new ItemEtherealCloth(14753).setItemName("EtherealCloth").setIconIndex(2);
EtherealShrapnel = new ItemEtherealShrapnel(14754).setItemName("EtherealShrapnel").setIconIndex(3);
RaohStone = new ItemRaohStone(14755).setItemName("RaohStone").setIconIndex(4);
//GameRegistry
GameRegistry.registerBlock(Balpisto, "Balpisto");
//LanguageRegistry
//Blocks
LanguageRegistry.addName(Balpisto, "Balpisto");
//Items
LanguageRegistry.addName(BalpistoDust, "Balpisto Dust");
LanguageRegistry.addName(EtherealString, "Ethereal String");
LanguageRegistry.addName(EtherealCloth, "Ethereal Cloth");
LanguageRegistry.addName(EtherealShrapnel, "Ethereal Shrapnel");
LanguageRegistry.addName(RaohStone, "Raoh Stone");
//Item Stacks
ItemStack BalpistoDustStack = new ItemStack(BalpistoDust);
ItemStack EtherealStringStack = new ItemStack(EtherealString);
ItemStack EtherealClothStack = new ItemStack(EtherealCloth);
//Recipes
GameRegistry.addSmelting(Balpisto.blockID, new ItemStack(BalpistoDust, 1), 1.0F);
GameRegistry.addShapelessRecipe(new ItemStack(EtherealString, 2), Item.silk, BalpistoDustStack);
GameRegistry.addShapelessRecipe(new ItemStack(EtherealCloth, 1), EtherealString, EtherealString, EtherealString, EtherealString);
GameRegistry.addShapelessRecipe(new ItemStack(EtherealShrapnel, 1), BalpistoDustStack, BalpistoDustStack);
GameRegistry.addRecipe(new ItemStack(RaohStone, 1), " Y ", "YXY", " Y ", 'X', Item.enderPearl, 'Y', BalpistoDustStack);
//WorldGen
GameRegistry.registerWorldGenerator(new WorldGeneratorBalpisto());
}
@PostInit
public void postInit(FMLPostInitializationEvent evt) {
}
}
ClientProxy:
package etherealGifts;
import net.minecraftforge.client.MinecraftForgeClient;
public class ClientProxy extends CommonProxy {
public static void registerRenderThings() {
MinecraftForgeClient.preloadTexture("/etherealGifts/Blocks.png");
MinecraftForgeClient.preloadTexture("/etherealGifts/Items.png");
}
}
package etherealGifts;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import cpw.mods.fml.common.network.IGuiHandler;
public class CommonProxy implements IGuiHandler {
public static void registerRenderThings() {
}
@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;
}
}
I have also seen this a few times, but never found anything that changes because of. As well at it doesn't come up all the time. I think this might be an fail with the bug checking from Forge. If anyone else know anything about this I would like to know why this is coming up as well, since it comes up even though we have given it texture.
One fix (I think this worked when I tried) make a String in your CommonProxy with the path to your texture (public static final String) and use the same in the block class.