
Flaghacker
Members-
Posts
53 -
Joined
-
Last visited
Everything posted by Flaghacker
-
[1.7.10]Ensure to be loaded first|Catch log messages
Flaghacker replied to Flaghacker's topic in Modder Support
Thanks for your answers. I want to make a small mod that open a JFrame with a progress bar that tells the user how long Iit will take to start minecraft, how much % it is already done, ... It will do so by rembering the old log lines, and compare them with the current ones. The mod will not any game content, so shouldn't it be safe to use before*? I have another question: How can know when Minecraft is done starting, and the main menu is displayed? EDIT: Do you mean registering a custom appender for log4j? -
I have a couple of questions: How do I ensure my mod is loaded first, before any other mods? How can I "catch" all log messages from other mods & forge? Thanks in advance.
-
I'm sorry, but I'm really new to modding. I don't understand much of your previous explenation. Could you explait it with an examle? Let's say I want to install an Api with mod name example_123. I download the universal mod jar (example_123.jar) and the Api files (\api). What do I have to do next then?
-
And do I have to setup any dependencies or so? And what do I do with all the errors is the files? Like missing values because of missing files? (the ones that aren't in the api files)
-
To where? Inside my own mod?
-
I want to try making a mod that uses the baubles API from Azanor (https://github.com/Azanor/Baubles) How can I install that API in my modding environment? What files do I need to copy to where?
-
Yes, that was the problem! Thank you very much!
-
This is the usage search: As you can see, the value is set once, in the constructor. Then it is mostly used in comparisons. This is the full code of my crop class: I tried changing it to a constant, 2 in this case: @Override public int getLightValue(IBlockAccess world, int x, int y, int z) { if (world.getBlockMetadata(x, y, z) >= 2) { return 16; } return 0; } But that gives the same problem.
-
I currently have no access to my computer, I'm on mobile. I'll post the search data tomorrow. But how can something with that field be the problem? Do you think this only works on the client, so the server can't process the light?
-
Two reasons: 1) To separate the code I wrote and the code I stole from the BlockCrops class. 2) If I (hypoteticcaly) ever want to use this class but set all the fields manually myself for whatever reason. But I don't think that matters for my problem about the light level. Maybe I'm using the wrong function?
-
My block is a crop, so the metadata is the growthstage. (Me being dumb) I use this class to create different crops, this is the constructor. public CropMC(String name, int stages) { this(); this.name = name; this.stages = stages; this.maxMetaData = stages - 1; this.setBlockName(Reference.NAME_PREFIX + name); } public CropMC() { //Stolen from BlockCrops this.setTickRandomly(true); float f = 0.5F; this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f); this.setCreativeTab(null); this.setHardness(0.0F); this.setStepSound(soundTypeGrass); this.disableStats(); } Shouldn't matter in this case, as the if is working. The crop looks light, but doesn't emit light. Screenshot to illustrate:
-
I want my block to emit light when it's metadata is a certain value. I use this code to try to archive that: @Override public int getLightValue(IBlockAccess world, int x, int y, int z) { //this.maxMetaData is a value in my block's class, in this case 2. if (world.getBlockMetadata(x, y, z) >= this.maxMetaData) { return 16; } return 0; } This code only sets the light value of the block itself, the block doesn't actually emit light. How can I solve that?
-
Everything is working perfectly, the items drop correctly, the crop grows, ... One problem, WAILA doesn't detect my crop as a crop any more. It doesn't show a percentage when I look at my crop. Is there any way to fix taht?
-
Thanks to everyone in this thread, I managed to get the rendering & growing of my crop working. I got one (maybe even last?) question about crops: Is there a function "getDrops" or something similar where I can say "drop random.nextInt(3) seeds, drop 2 wheat"? Or do I need to use the functions func_149866_i (getSeedItem) and func_149865_P (getCropitem)?
-
Thanks! And how about my canPlaceBlockOn not working? And what is the boolean in canBonemeal?
-
I started doing that, and I ran into a "problem". I need to implement 3 functions from IGrowable: public boolean func_149851_a(World world, int x, int y, int z, boolean b) public boolean func_149852_a(World world, Random random, int x, int y, int z) public void func_149853_b(World world, Random random, int x, int y, int z) The variables and function names aren't deobfuscated yet. Looking around in the source code of BlockCrop and testing myself, I came to these conclusions: func_149851_a is called to "ask" if you plant can be bonemealed. Return type is boolean, the arguments are: world, x, y, z, boolean. I have no idea what the boolean is used for, vanilla code seems to ignore it. The function is called twice if I try to bonemeal my crop, first with true, then with false. func_149852_a gets called every time, regardless of the return of the function above. Return type is boolean, the arguments are: world, x, y, z, boolean. I have no idea what this functions is used for, as vanilla code just returns false. func_149853_b gets called when the first function returned true. Return type and arguments the same as above. Vanilla code uses this to actually change the metadata. My crop (the bonemeal part, haven't done rendering and drops yet) works, but there still are a few things I don't understand. These are in bold. Could someone answer these questions? EDIT: I tried overriding canPlaceBlockOn like this: public boolean canPlaceBlockOn(Block block) { LogHelper.info(String.format("canPlaceBlockOn() returned %b", block == Blocks.farmland)); return block == Blocks.farmland; } When I try to place my crop on farmland, the log says: [20:17:45] [Client thread/INFO] [MysteriumCraft]: canPlaceBlockOn() returned true . When I try it on grass or dirt, the log says: [20:17:51] [Client thread/INFO] [MysteriumCraft]: canPlaceBlockOn() returned false . My function is clearly being called, but it doesn't influence the crop placement. The crop can also be placed on dirt & grass.
-
Or should I extends BlockBush and implement IGrowable instead of extending BlockCrops?
-
1) Do I need to override "public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_)"? 2) Is there any method by witch I can get complete control over what items it drops? Because in the BlockCrops class I see a lot of functions that have something to do with drops: protected Item func_149866_i, returning the crop item protected Item func_149865_P, returning the seed item public void dropBlockAsItemWithChance, I guess getting the dropped item? public Item getItemDropped, same as above, I'm confused public int quantityDropped, I'm guessing the amount of dropped crop items, determined by func_149866_i Is there 1 function I can use so I can say: if metedata = 7 drop math.random seeds drop math.random crops else drop 1 seed and clears all drop functions overridden in the BlockCrops class? If not, how should I do this instead, because I'm confused by the amount of "drop" functions and the fact they're not all deobvusticated.
-
Thanks, didn't notice that! Now I'm having all sorts of weird problems when I bonemeal my plants. WAILA is showing they're fully grown, when they're actually in stage 0. The log is spammed with "invalid metadata", that comes from one of my debug lines. They don't drop stuff when they have the fully grown texture I think the reason is that the stage count, metadata and growth mechanics are stil set for the 7 stages of wheat. How can I change that?
-
All my code is on Github: https://github.com/flaghacker/MysteriumCraft I'm trying to add a crop to my mod, in the class "MysteriumCraft / src / main / java / com / flaghacker / mysteriumcraft / init / ModCrops.java". My game crashes when it tries to render my crop. This is the crash report: It points to this line: https://github.com/flaghacker/MysteriumCraft/blob/master/src/main/java/com/flaghacker/mysteriumcraft/blocks/CropMC.java#L48 This is a consequence of the fact that my "registerIcons" method is not called. I know that because the log line in the for loop is not logging. Does someone know why my "registerIcons" method is not called?
-
Thank you!
-
I have a mod that adds a few tools and other items (just to test). The creative tab looks like this: I don't like how there's randomly a pickaxe in the beginning. I don't know what's causing this, I am registering these items in order (all tools together). Is there any way I can change the order my items and blocks show up in a creative tab?
-
I set that value that high to see if that would make a diffrence. Too high shouldn't prevent ore spawning, right?
-
This is my repository: https://github.com/flaghacker/MysteriumCraft I'm trying to add some ore generation to my mod, in "src/main/java/com/flaghacker/mysteriumcraft/worldgen/WorldGeneratorMC.java". To test I put a log line in that code: LogHelper.info("Spawned an ore vein at " + posX + "," + posY + "," + posZ); I registered the generator corretly, as the log is spammed with lines like this: [14:24:23] [server thread/INFO] [MysteriumCraft/]: Spawned an ore vein at 346,9,267 When I go to these coordinates thought, there aren't any ore blocks! Does someone know what I'm doing wrong here?
-
Thanks, that works. I have another question, why can't I use " instead of ' in the last bit?