Everything posted by TheDrunkMafia
-
Entity Position tacking
Thanks for the help. Much appreciated.
-
Entity Position tacking
Hey everyone, I'm currently in the middle of making a Mod called Omega Craft, a technical mod which I decided to make so that I can learn how to mod first hand. Now one of the blocks that I am making needs to know where the current position of the nearest mob is in a certain radius, I've tried a few things but nothing has worked so far. Now for example would anyone know how to find out if there is a creeper in a radius of 18 blocks of the block you place down? Any help will be hugely appreciated.
-
mcmod.info
Basically go into your chosen coding software, for this I'll use eclipse as an example because that's what most people use. First create a new file, make sure that under the drop down it is the file option. Name it: mcmod.info and copy this code into it: [ { "modid": "Mod ID", "name": "Mod namet", "description": "N/A Anything that is added to the mod is Subject to change", "version": "1.0", "mcversion": "minecraft version", "url": "http://adf.ly/CTNHg", "logoFile": "/logo_SAPMan.png" "authorList": [ "author", "author" ], "credits": "Credits", "parent":"" } ] } Then save it in the "Src" folder.
-
mcmod.info
The file name is: mcmod.info and inside it goes: [ { "modid": "package or main mod file name, I'm not sure", "name": "name", "description": "N/A ", "version": "version", "mcversion": "version", "url": "Info", "authorList": [ "Info", "Info" ], "credits": "Info", "parent":"" } ] } This then goes in the root of the src of minecraft.jar. I think that's it anyway, someone correct me if I am wrong.
-
Working with redstone & Textures. Help needed. [Solved]
Sure: Main code: public static Block Lightred = (new statuslight(900, false)).setHardness(3.0f).setLightValue(1.0f).setUnlocalizedName("Light"); public static Block Lightgreen = (new statuslight(901, true)).setHardness(3.0f).setLightValue(1.0f).setUnlocalizedName("Light"); Code for the light: package com.name; import java.util.Random; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.world.World; public class light extends Block { private boolean powered; private String blocktexture; public light(int par1, boolean par2) { super(par1, Material.redstoneLight); this.powered = par2; if (par2) { this.setLightValue(1.0F); } } @SideOnly(Side.CLIENT) public void func_94332_a(IconRegister Par1Iconregister){ if(this.powered){ this.field_94336_cN = Par1Iconregister.func_94245_a("OmegaCraft/"); } else { this.field_94336_cN = Par1Iconregister.func_94245_a("OmegaCraft/RedLight"); } } public void onBlockAdded(World par1World, int par2, int par3, int par4) { if (!par1World.isRemote) { if (this.powered && !par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)) { par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, 4); } else if (!this.powered && par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)) { par1World.setBlockAndMetadataWithNotify(par2, par3, par4, mod_name.Lightgreen.blockID, 0, 2); } } } public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { if (!par1World.isRemote) { if (this.powered && !par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)) { par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, 4); } else if (!this.powered && par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)) { par1World.setBlockAndMetadataWithNotify(par2, par3, par4, mod_name.Lightgreen.blockID, 0, 2); } } } public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { if (!par1World.isRemote && this.powered && !par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)) { par1World.setBlockAndMetadataWithNotify(par2, par3, par4, mod_name.Lightred.blockID, 0, 2); } } public int idDropped(int par1, Random par2Random, int par3) { return mod_nameLightred.blockID; } @SideOnly(Side.CLIENT) public int idPicked(World par1World, int par2, int par3, int par4) { return mod_name.Lightred.blockID; } } If you use this code please give me some credit, as it would be largely appreciated.
-
Working with redstone & Textures. Help needed. [Solved]
Got it working, Firstly I called the redstone powered function and then did an if statement to get the textures set up. Next I did two functions where it contently checks if there is a red stone signal near by. If not it calls the Off block and if there is it calls the on block, I found out how to do it by looking at the redstone lamp.
-
Working with redstone & Textures. Help needed. [Solved]
Hey, I'm currently working a mod so that I can learn how to program using the forge API first hand, so far it's been going smoothly, I've been following various tutorials to see how they do their coding and then coded it my own way using the ideas I got from others. Now at the moment I am developing my first block, nothing to advance just a basic block which changes texture when a redstone signal has been applied to it. Now this is where I've hit my first bump because I have no clue how to work with redstone or most other stuff, right now I know how to create Blocks, Items, Tools & creative tabs. I learnt all this in two days so yeah, I'm really rusty. mod_Main code: public static Block StatusLight = new statuslight(596, Material.glass, "StatusLightRed").setHardness(1.0f).setLightValue(5.0f).setUnlocalizedName("Status Light"); Status light Code: package com.omegacraft; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; public class statuslight extends Block { private String blocktexture; public statuslight(int par1, Material par2Material, String par3String) { super(par1, par2Material); this.blocktexture = par3String; } @SideOnly(Side.CLIENT) public void func_94332_a(IconRegister Par1Iconregister){ this.field_94336_cN = Par1Iconregister.func_94245_a("OmegaCraft/" + this.blocktexture); } } Now I had a look though the coding for redstone and here's the code that I thought up, all of it is guessed. But I know I have to return the value that the block must be able to connect to redstone. public boolean wiresProvidePower() { return blockConstructorCalled; } if WiresPower() = 1 { } Any help would be hugely appreciated. (P.S Has anyone noticed what adding code to a post does to the body of the thread?)
-
Eclipse Java Compatiblity error
Fixed the problem, it would seem that the current version of Eclipse is only compatible with jdk 6. So I've download-graded for the time being. Just letting people know, so if there is anyone else who has ran into the same problem as the one I have had, all you have to do is downgrade to the last version of JDK.
-
Eclipse Java Compatiblity error
It was the 1.7 JRE/SDK that I re-downloaded.
-
Eclipse Java Compatiblity error
Hey, So I've just started to learn java and i've just got to the point were I am ready to put my knowledge to the test and start developing basic mods in minecraft so as to improve my skills. Today I got all the files needed, MCP, Minecraft Sever.Jar, Etc, etc and everything seemed to be working, so when I went to load eclipse using the work space provided, three errors occurred. The main one being Error: Build path specifies execution environment JavaSE-1.6. There are no JREs installed in the work space that are strictly compatible with this environment. So far i've tried everything I can think of, uninstalled all java (including the JDK) and re installed, nothing has prevailed. So any help would be most appreciated.
IPS spam blocked by CleanTalk.