
Zedicus
Members-
Posts
63 -
Joined
-
Last visited
Everything posted by Zedicus
-
Do you ever actually register your item in the GameRegistry? @Init public void load(FMLInitializationEvent event) { LanguageRegistry.addName(SaltItem, "Salt"); LanguageRegistry.addName(rocksaltBlock, "Rock Salt"); MinecraftForge.setBlockHarvestLevel(rocksaltBlock, "pickaxe", 1); GameRegistry.registerBlock(rocksaltBlock, "BlockRockSalt"); proxy.registerRenderers(); GameRegistry.registerWorldGenerator(new MagiCraftGenerator()); //Replacing Desert for Further Additions } Not seeing a: GameRegistry.registerItem(SaltItem, "Salt");
-
To google! http://www.minecraftforum.net/topic/1722368-15-icons-and-block-textures/
-
This should give you the time based on the current angle of the moon and such. Minecraft minecraft = Minecraft.getMinecraft(); if (minecraft.theWorld != null) { float time = minecraft.theWorld.getCelestialAngle(1.0F); } I believe this is more or less what the clock does for it's texture.
-
Should I be so prudent as to ask whether 'mods.ParallelWorlds.textures.blocks.TimeStone.png' exists? In your eclipse 'src' directory that is. Example: Taken from my workspace would correspond to this: @Override public void registerIcons(IconRegister iconRegister) { this.blockIcon = iconRegister.registerIcon("alchcraft:alchtable"); }
-
Rather than posting a new thread I thought to add it here - Main Class - PostInit: @PostInit public void PostInit(FMLPostInitializationEvent event) { RecipeRemover.RecipeRemoval(); } Actual method in RecipeRemover: public static void RecipeRemoval(){ List RecipeList = CraftingManager.getInstance().getRecipeList(); int ListSize = RecipeList.size(); for(int i = 0; i < ListSize; i++) { Object o = RecipeList.get(i); System.out.println("check"); if(o == (new ItemStack(Item.brewingStand))) { System.out.println("RECIPE REMOVED"); RecipeList.remove(i); } } } I'm sure I've made a stupid mistake somewhere along there, but my main issue is how to I tell which recipe's which, a.k.a. the: if(o == (new ItemStack(Item.brewingStand))) { Part. Thanks. (It should be noted that the method doesn't appear to be getting called at all, I did some tests with System.out's and it returned nothing on start up, other than the preinit posting a string, the init registered an item but wouldn't 'post' a string, leading to some confusion about when the methods 'fire', so to speak.)
-
Thank you kindly, will download hexchat.
-
Two questions, a) Why do I get the message 'Cannot send to channel: #minecraftforge' I'm fairly sure my account's registered on IRC, etc. And an actual modding question - b) How would you go about removing a vanilla recipe, not asking for all the code unless it's one line, just removes some of the fun if someone else writes your mod for you, haha, just curious If I'm required to write an event or if there's a more simple way. Thanks, Zed!
-
You want something like this - Might not look like much but it's your texture in the top corner of a 256x256 sheet with the rest being transparent. Class wise... I'd have a look at these: http://www.minecraftforge.net/wiki/Basic_Blocks or for a video tutorial. Both very helpful if you're just starting out
-
You generally start by putting the image in the top left corner, the first 16x16 pixel square at the top is '0' code wise, so you'd put that in as the parameter, then it's 1 for the 16x16 to the right of it and so on, basically it's reading the white space in your texture sheet not the texture that's located in the middle.
-
GuiAPI only goes in the client coremods folder.
-
I'm fairly certain you use two separate blocks, when the bottom block changes to for example meta data '3' you set the block above it to the other block, so it simulates a larger crop.
-
I'm fairly certain you can do that with vanilla code, my advice, just check how it's done now.
-
I believe it uses a hexadecimal colour system, correct me if I'm wrong but I've noticed it being used in other areas of code - a.k.a. 0x000000 = black, 0xffffff = white - http://slekx.com/as3-intro/extra/hexadecimal-color-overview/ - for some more.
-
Mac: Need help getting started with coding!!
Zedicus replied to DarklingGX's topic in General Discussion
Can you run it via 'terminal' or some mac mumbo jumbo like that? -
Mac: Need help getting started with coding!!
Zedicus replied to DarklingGX's topic in General Discussion
[hide]Download MCP - http://www.mediafire.com/?spaiyzpccxkx6cg Download Forge Source - http://adf.ly/673885/372src Download minecraft server.jar - https://minecraft.net/download Extract the MCP .zip into some folder, then 'extract here' (7zip) the forge .zip inside the extracted MCP folder, open the 'jars' folder inside MCP and drag a vanilla minecraft 1.4.5 'bin' and 'resources' forces from your .minecraft and copy them in, then grab your server.jar and drag it into the same folder ('jars'); go into your forge folder and run the 'install' file, wait for that to finish, for the external APIs consult this written by 'Dries007' If you want to use eclipse, run it and when selecting your workspace choose '/mcp/eclipse' and that'll let you run it, edit it, etc all from eclipse.[/hide] Granted I don't know if it works exactly the same on mac, but it might work. -
A post regarding the debug 'button' in eclipse, when pressed it seems to 'start' fine, to an extent but on the 'Forge is setting up your Minecraft environment' screen it stops at 0%, I know it works with just the run button; hot swapping would be rather helpful for me, as I'm sure you could imagine; any solutions/ideas regarding this? Thanks EDIT: Just noticed it's opening the 'RelaunchLibraryManager' class and highlighting this line of code - for (String libName : plugin.getLibraryRequestClass()) Possibly more for support/bug reports... mhm. EDIT: Updated to the latest forge/mcp - works perfectly now; closing thread.
-
Thanks! So my code wasn't 'too' bad, haha. Awesome, technically I could make a mod using that crop template make others with different growth stages etc, that'd be a little dull, wouldn't want to pretty much rip of Pam's, though an idea comes to mind... grow-able 'ores' iron plant, that kind of thing, anyway, enough rambling. Configs for the IDs are easy enough, as I mentioned this was just a little project I attempted this morning, may actually do something with it. Thanks again
-
Currently - public class Main { public static Item cropseed; public static Item itemFlax; public static Block cropblock; @Instance("metocraft") public static Main instance; @SidedProxy(clientSide="metocraft.client.ClientProxy", serverSide="metocraft.common.CommonProxy") public static CommonProxy proxy; @PreInit public void preInit(FMLPreInitializationEvent event) { } @Init public void load(FMLInitializationEvent event) { cropseed = new ItemCropSeed(555, cropblock.blockID, Block.grass.blockID).setIconIndex(0).setItemName("flaxseed"); itemFlax = new ItemFlax(556).setIconIndex(1).setItemName("Flaxfood"); cropblock = new BlockCrop(231, 0, cropseed.shiftedIndex, cropseed, itemFlax.shiftedIndex, Block.grass.blockID, 0).setStepSound(Block.soundGrassFootstep).setHardness(0.0F).setBlockName("blockcrop"); GameRegistry.registerBlock(cropblock); LanguageRegistry.addName(cropblock, "Custom Crop"); LanguageRegistry.addName(cropseed, "Flax Seed"); LanguageRegistry.addName(itemFlax, "Flax"); proxy.registerRenderers(); } @PostInit public void postInit(FMLPostInitializationEvent event) { } }
-
I'm afraid that also didn't work, still the exact same error... this is ever so slightly frustrating, but I'm sure it'll work out eventually
-
Well, the reason I brought up my knowledge of 'forge modding' was because, I was fairly certain that's what you meant... I did it... and it still sent the same error message the difference being it's now on like 45, due to the move, I also attempted to put every single notice of 'cropblock' below the ItemFlax e.t.c. and it still gave the error message, hence why I edited my post, what ever have I done wrong
-
Okay, I understand the initialization of variables in java... but I'm still new enough to forge/minecraft modding, how would I go about initializing it before the constructor's called? @Mod(modid="metocraft", name="Metocraft", version="0.1") @NetworkMod(clientSideRequired=true, serverSideRequired=false) public class Main { public static Block cropblock; public static Item cropseed; public static Item itemFlax; @Instance("metocraft") public static Main instance; @SidedProxy(clientSide="metocraft.client.ClientProxy", serverSide="metocraft.common.CommonProxy") public static CommonProxy proxy; @PreInit public void preInit(FMLPreInitializationEvent event) { } @Init public void load(FMLInitializationEvent event) { proxy.registerRenderers(); cropblock = new BlockCrop(231, 0, Main.cropseed.shiftedIndex, Main.cropseed, Main.itemFlax.shiftedIndex, Block.grass.blockID, 0).setStepSound(Block.soundGrassFootstep).setHardness(0.0F).setBlockName("cropblock"); cropseed = new ItemCropSeed(555, Main.cropblock.blockID, Block.grass.blockID).setIconIndex(0).setItemName("flaxseed"); itemFlax = new ItemFlax(556).setIconIndex(1).setItemName("Flaxfood"); GameRegistry.registerBlock(cropblock); LanguageRegistry.addName(cropblock, "Custom Crop"); LanguageRegistry.addName(cropseed, "Flax Seed"); LanguageRegistry.addName(itemFlax, "Flax"); } @PostInit public void postInit(FMLPostInitializationEvent event) { } } That's more or less my main class.
-
Not wanting too much preamble I was a little bored this morning and decided to make a constructor/class that could 'theoretically' allow me to make 'new' crops very easily, basically just started with my working crop file and added variables that I can control in the constructor; it was working, possibly, but when I returned to my computer It was erroring, It's possible I made some edit between then and the 'run' but I couldn't work out the source so I thought I'd come to the forge community for a little guidance - Constructor from the main class - cropblock = new BlockCrop(231, 0, Main.cropseed.shiftedIndex, Main.cropseed, Main.itemFlax.shiftedIndex, Block.grass.blockID, 0).setStepSound(Block.soundGrassFootstep).setHardness(0.0F).setBlockName("cropblock"); The crop class - public class BlockCrop extends BlockFlower { private int seedtype; private Item seedtype2; private int droppedblock; private int underblock; private int indent; protected BlockCrop(int par1, int par2, int par3, Item par4, int par5, int par6, int par7) { super(par1, par2); blockIndexInTexture = par2; setTickRandomly(true); float f = 0.5F; setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f); this.setCreativeTab((CreativeTabs)null); this.disableStats(); this.setRequiresSelfNotify(); seedtype = par3; seedtype2 = par4; droppedblock = par5; underblock = par6; indent = par7 + 2; } protected boolean canThisPlantGrowOnThisBlockID(int par1) { return par1 == underblock; } public String getTextureFile() { return CommonProxy.BLOCK_PNG; } public int getRenderType() { return 6; } public int idPicked(World par1World, int par2, int par3, int par4) { return seedtype; } public void fertilize(World par1World, int par2, int par3, int par4) { par1World.setBlockMetadataWithNotify(par2, par3, par4, 2); } public int getBlockTextureFromSideAndMetadata(int par1, int par2) { switch(par2) { case 0: return 0 + indent; case 1: return 1 + indent; case 2: return 2 + indent; default: return 0 + indent; } } public int idDropped(int par1, Random par2Random, int par3) { if (par1 == 2) { return droppedblock; } else { return 0; } } public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { super.updateTick(par1World, par2, par3, par4, par5Random); if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9) { int i = par1World.getBlockMetadata(par2, par3, par4); if (i < 2) { float f = getGrowthRate(par1World, par2, par3, par4); if (par5Random.nextInt((int)(25F / f) + 1) == 0) { i++; par1World.setBlockMetadataWithNotify(par2, par3, par4, i); } } } } private float getGrowthRate(World par1World, int par2, int par3, int par4) { float f = 1.0F; int i = par1World.getBlockId(par2, par3, par4 - 1); int j = par1World.getBlockId(par2, par3, par4 + 1); int k = par1World.getBlockId(par2 - 1, par3, par4); int l = par1World.getBlockId(par2 + 1, par3, par4); int i1 = par1World.getBlockId(par2 - 1, par3, par4 - 1); int j1 = par1World.getBlockId(par2 + 1, par3, par4 - 1); int k1 = par1World.getBlockId(par2 + 1, par3, par4 + 1); int l1 = par1World.getBlockId(par2 - 1, par3, par4 + 1); boolean flag = k == blockID || l == blockID; boolean flag1 = i == blockID || j == blockID; boolean flag2 = i1 == blockID || j1 == blockID || k1 == blockID || l1 == blockID; for (int i2 = par2 - 1; i2 <= par2 + 1; i2++) { for (int j2 = par4 - 1; j2 <= par4 + 1; j2++) { int k2 = par1World.getBlockId(i2, par3 - 1, j2); float f1 = 0.0F; if (k2 == underblock) { f1 = 1.0F; if (par1World.getBlockMetadata(i2, par3 - 1, j2) > 0) { f1 = 3F; } } if (i2 != par2 || j2 != par4) { f1 /= 4F; } f += f1; } } if (flag2 || flag && flag1) { f /= 2.0F; } return f; } public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, 0); if (par1World.isRemote) { return; } int i = 3 + par7; for (int j = 0; j < i; j++) { if (par1World.rand.nextInt(5) == 0) { float f = 0.7F; float f1 = par1World.rand.nextFloat() * f + (1.0F - f) * 0.5F; float f2 = par1World.rand.nextFloat() * f + (1.0F - f) * 0.5F; float f3 = par1World.rand.nextFloat() * f + (1.0F - f) * 0.5F; EntityItem entityitem = new EntityItem(par1World, (float)par2 + f1, (float)par3 + f2, (float)par4 + f3, new ItemStack(seedtype2)); entityitem.delayBeforeCanPickup = 10; par1World.spawnEntityInWorld(entityitem); } } } } And finally the error - java.lang.NullPointerException at metocraft.common.Main.load(Main.java:44) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:440) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300) at com.google.common.eventbus.EventBus.post(EventBus.java:268) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:140) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300) at com.google.common.eventbus.EventBus.post(EventBus.java:268) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:83) at cpw.mods.fml.common.Loader.initializeMods(Loader.java:651) at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:196) at net.minecraft.client.Minecraft.startGame(Minecraft.java:469) at net.minecraft.client.Minecraft.run(Minecraft.java:756) at java.lang.Thread.run(Unknown Source) Note: line 44 is the constructor; also should point out it's in no way a finished product, just a little project. EDIT: If the constructor's removed it works, hence why I thought the issue's probably there. EDIT2: MCP version 722 - Forge version 6.3.0.372
-
Item not being damaged, think it is the entity variable required
Zedicus replied to Jakemichie97's topic in Modder Support
If you're talking about - if (!par3EntityPlayer.capabilities.isCreativeMode) { And I understand you correctly, that just means if you're not in creative mode then run this, basically how it doesn't damage the item when you're in creative mode. (Apologies if I misunderstood.) -
Item not being damaged, think it is the entity variable required
Zedicus replied to Jakemichie97's topic in Modder Support
I think you're possibly looking for this - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { if (!par3EntityPlayer.capabilities.isCreativeMode) { par1ItemStack.damageItem(99, par3EntityPlayer); } On every right click it'll damage the item by '99'. Another example, if you want it to shoot a snowball - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { if (!par3EntityPlayer.capabilities.isCreativeMode) { par1ItemStack.damageItem(99, par3EntityPlayer); } par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); if (!par2World.isRemote) { par2World.spawnEntityInWorld(new EntitySnowball(par2World, par3EntityPlayer)); } return par1ItemStack; } Just a note, I've got the code for making it not 'work' if the damage isn't 0, if you want it ask, unless you want the fun of working it out yourself -
[Solved]Loading Ores/ Materials from other mods.
Zedicus replied to Jade_Knightblazer's topic in Modder Support
Is this the general idea of what you're thinking of? http://www.minecraftforge.net/wiki/How_to_use_the_ore_dictionary