Everything posted by dev909
-
[1.8] How do configuration files work??
I want to provide a simple config file for my mod. It will include roughly a couple booleans. I tried looking at tutorials online and they all seem outdated. But I tried it anyways and it didn't work (I'm basing success on whether there is a config button in the mods menu). Here is what I have so far: Main mod file I feel like I am missing something...
-
[1.8] (Solved) HarvestDropEvent not firing?
Derp. Should have noticed that. Well it works now, thanks!
-
[1.8] (Solved) HarvestDropEvent not firing?
Hello all, I'm trying to understand events for future usage. Right now I have a new eventHandler class with my main mod file registering this class into both the minecraft forge event bus and FML event bus. To test it, I want to change the drops from a diamond ore to just an apple. Here is what I have got: Base Mod file Event Handler class As you can guess, it doesn't work for some reason and hence this post. The only idea that I have is that my event handler class is either not being picked up, or the method is not firing. The diamond ore still drops a diamond item.
-
Item right click to alter blocks attributes
private static int selectedBlockId; public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { selectedBlockId = par3World.getBlockId(par4, par5, par6); if (selectedBlockId == 4) { par3World.setBlock(par4, par5, par6, 400, 0, 0); baseCO.blockCO.colorMultiplier(par3World,46,56,141); } return true; } This works! I just have a problem with getting a texture to the "new" block now.
-
[1.6.4] Textures not working
Still didn't work. Well nearly every texture I want is vanilla, so how would I just use those textures instead of making a copy in my own assets folder? I know, its just when none of the methods work I tend to try everything at once
-
[1.6.4] Textures not working
I followed this through (and many other texture tutorials) but I still get an error for block textures. Item textures work fine weirdly enough... Anyway my path is \mcp\src\minecraft\assets\colorama\textures\blocks\blockName.png and in my block code: public blockCO(int par1, Material par2Material) { super(par1, par2Material); setUnlocalizedName("cStone"); setTextureName("colorama:cStone"); } @SideOnly(Side.CLIENT) public void registerIcons(IconRegister reg) { this.blockIcon = reg.registerIcon("colorama:cStone"); } I was looking for a way to just use vanilla textures, but gave up so decided to just copy the texture for now into my mods assets folder. Changed the cobblestone.png to cStone.png and changed my textureNames with it. Didn't work so I tried using Icon Registry, still no dice.
-
Item right click to alter blocks attributes
So declare a new child class object (ColoredBlock block), remove the blocklist, then on right click it will get the current blocks attributes, store it into the new child block, then use the new override method to get a new return type from colorMultiplier? private static ColoredBlock block public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { block = par3World.getBlockId(par4, par5, par6); if (block.blockID == 4) { block.colorMultiplier(par3World,46,56,141); } return true; } }
-
Item right click to alter blocks attributes
I saw it in a thread somewhere. So get rid of the array and set block = par3World.getBlockId(par4, par5, par6)? Why is Block.colorMultiplier not doing anything? I was messing around earlier in the base class and set a random int to pull the 16 different color codes, and let colorMultiplier return a random one. Resulted in a very disco-ish minecraft hahha. But I noticed that the colors all changed after a few seconds, or during alot of movement, which makes me think that colorMultiplier is getting called alot, maybe every few render cycles?
-
Item right click to alter blocks attributes
I'm trying to create an item that when right click, will grab the blockId of the current coordinates, compare it to another blockId, then if true to change the current block's getColorMultiplier(). It looks like I need to change the return value of Block.getColorMultiplier(). So I heard of overloading and overriding so I create a new class that extends Block and tried my hand at it. Heres the code(apologies as none of the editing tools work...so no code or spoilers formatting): ~~~paintBrush(item)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ public class paintBrush extends Item { public paintBrush(int par1) { super(par1); maxStackSize = 1; setCreativeTab(CreativeTabs.tabTools); setUnlocalizedName("paintBrush"); } private static blockCO block; public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { block = blockCO.blocksList[par3World.getBlockId(par4, par5, par6)]; if (block.blockID == 4) { block.colorMultiplier(par3World,46,56,141); } return true; } } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~blockCO(block)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ public class blockCO extends Block { public blockCO(int par1, Material par2Material) { super(par1, par2Material); } public static final blockCO[] blocksList = new blockCO[4096]; public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { return ((par2*65536)+(par3*256)+par4); } } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ So I'm trying to send Red, Green and Blue values to the block.getColorMultiplier() and in blockCO I changed the method so that it accepts the RGB values and return the converted int. When I go in game to test I get this error (using pastebin so the thread ain't too bad for you guys ): http://pastebin.com/cTYit0MT Again...sorry for no formatting
-
[How-To]Build multiple separate projects with Gradle
Thanks, this really helps me understand gradle abit. I'm trying to set it up so that my separate mods are source folders, and to build them separately. To test I copied the example mod and source folder and changed the names over to "test" (instead of example). I used the 1.7.4 build.gradle code from the Independent Setup, and changed the srcDirs to 'src/test'. When I build and copy the jar to minecraft, under the mods menu I get both the original example mod and my copied test mod. How can I set it up so that it excludes any other source folders in eclipse and builds a specific mod? It would be easier than moving the mods source folder out of the full directory itself, build, then replace the source folder again. Would be very tedious with more than one mod. Heres a screenshot if I don't make sense (really tired while writing this): http://s28.postimg.org/tc4c6a5jx/forge_help.png Red and Green are separate mods and the Blue is what I changed in build.gradle
-
Src does not exist in eclipse
Hey all im not sure this is the right board, but I followed another thread in this same board that was very similar to my current situation (http://www.minecraftforge.net/forum/index.php?topic=5754.0) Anyway I followed that board and the author fixed his problem by updating eclipse. I got Kepler (4.3.1 I think) and I can't really update past that. My src is missing within eclipse and if I go to properties, it says that the resolved location does not exist. I tried editing and browsing but surely enough it doesnt exist. Any ideas? ps I might have double posted this...im having internet issues at the moment so if any mod sees the other post, please delete it
-
Tree gen. frequency?
Ok that makes sense. So how would I setup patches? Unfortunately world gen is a foreign art to me. I don't fully understand it yet. That's why when I found the other thread I copied to test it, and hopefully understand it (not doing good on the latter )
-
Tree gen. frequency?
Here is the crash log..pastebin is down at the moment -.-. Also here's the code. Note that its copied from that link I had in my original post. I changed the second for iteration from 20 to 40 to test it. Class: Crash Report:
-
Tree gen. frequency?
Whenever I do that, it crashes..
-
Tree gen. frequency?
I followed this post http://www.minecraftforge.net/forum/index.php?topic=6799.0 (which I can't reply to -.-) and managed to generate my own little bush. However how would I be able to increase the frequency of this gen?
-
Item Ids....
Ok thanks! Im pretty tired at the moment, so many things are not being clear to me today
-
Item Ids....
So when a player changes a config id value, starts the game, and then type in that value...it should work? Or would they have to type the value and add 256 to it. Sorry if im sounding like a huge noob, im just trying to wrap my head around when players try to alter the values. Thanks for the quick replies though!
-
Item Ids....
When I tested it, I tried /give player configID and it wouldn't work. The actual Id was still 256 ahead. Then I tried changing the id within the actual config file (like a normal user would) and still didn't work.
-
Item Ids....
Hey all, I was going through some problems with a config file and item ids earlier this morning. Upon an hour or so of tweaking, and looking around, I noticed that the items id in the Item class and the items id in game (and at http://www.minecraftwiki.net/wiki/Data_values) has a difference of 256. I noticed that the id value within my config file is also 256 behind the actual in game values of my items. Why is this? Not really a problem, and I don't know if this is the right board, but really curious on this and how could it affect users changing their values in the config when I release?
IPS spam blocked by CleanTalk.