That_Martin_Guy Posted July 3, 2017 Posted July 3, 2017 (edited) I am trying to generate a shulker box with a single item inside in this class. The problem is that it simply doesn't generate at all. Forge doesn't give me any related to the loot table (only rendering errors because I don't have any renderer for my items and blocks). Any ideas? EDIT: A solution has been found. Feel free to look at this diff. Edited July 3, 2017 by That_Martin_Guy Problem has been fixed Quote
Earthcomputer Posted July 3, 2017 Posted July 3, 2017 In class TheDarkness, you have then line: GameRegistry.registerWorldGenerator(new WorldGenReliquaryChest(), 0); You have set the generation weight to zero, which means there is zero chance that the world generator will generate. Quote Quote Quote catch(Exception e) { } Yay, Pokémon exception handling, gotta catch 'em all (and then do nothing with 'em).
That_Martin_Guy Posted July 3, 2017 Author Posted July 3, 2017 On 7/3/2017 at 5:33 AM, Jay Avery said: Is the method definitely being called? Expand I'm not sure, I haven't messed with world generation before. I looked at Choonster's test mod while doing it, and he seemed to do something very similar to what I did. On 7/3/2017 at 8:00 AM, Earthcomputer said: In class TheDarkness, you have then line: GameRegistry.registerWorldGenerator(new WorldGenReliquaryChest(), 0); You have set the generation weight to zero, which means there is zero chance that the world generator will generate. Expand Changing it to 100 doesn't work. Are you sure that is the case? On 7/3/2017 at 8:21 AM, diesieben07 said: No. Expand That doesn't really help much Quote
That_Martin_Guy Posted July 3, 2017 Author Posted July 3, 2017 I don't really understand that. Like I said I haven't messed with world generation yet. Also, I don't think I explained this properly, but I want this shulker box to spawn at the edge of the obsidian platform the player spawns on in the end 100% of the time, then never again. Quote
That_Martin_Guy Posted July 3, 2017 Author Posted July 3, 2017 How do I call it at 0? I thought I based it off of the player's spawn position. Quote
That_Martin_Guy Posted July 3, 2017 Author Posted July 3, 2017 Would you mind showing me the line were I set the position at 0? I'm sorry but I'm really confused here. Quote
That_Martin_Guy Posted July 3, 2017 Author Posted July 3, 2017 (edited) Still doesn't generate. Code EDIT: Actually I got an idea. Let me try it. EDIT 2: Shoot. It didn't work. Here's what I tried. Edited July 3, 2017 by That_Martin_Guy Quote
That_Martin_Guy Posted July 3, 2017 Author Posted July 3, 2017 World#getChunkFromCoords already uses shift right: public Chunk getChunkFromBlockCoords(BlockPos pos) { return this.getChunkFromChunkCoords(pos.getX() >> 4, pos.getZ() >> 4); } . Either way, this didn't work. Quote
Draco18s Posted July 3, 2017 Posted July 3, 2017 Of course not. world.getChunkFromBlockCoords(new BlockPos(spawnX >> 4, world.getSpawnPoint().getY(), spawnZ >> 4)); You said "get me a chunk from block coords" and then passed in chunk coords. Also, the Y value is irrelevant, you should just pass 0 there rather than spending CPU cycles calculating how high up the spawn is, just to pass it into a method that gives no fucks. Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
That_Martin_Guy Posted July 3, 2017 Author Posted July 3, 2017 The reason I created that is because that's what diesieben told me to try it (atleast the way I interpreted it, which might be the wrong way). Besides, passing in the normal block coordinates without shift-right doesn't generate it either. Quote
V0idWa1k3r Posted July 3, 2017 Posted July 3, 2017 You are using the wrong coordinate getter. You need WorldServer::getSpawnCoordinate, not World::getSpawnPoint Quote
Draco18s Posted July 3, 2017 Posted July 3, 2017 On 7/3/2017 at 5:12 PM, That_Martin_Guy said: The reason I created that is because that's what diesieben told me to try it (atleast the way I interpreted it, which might be the wrong way). Besides, passing in the normal block coordinates without shift-right doesn't generate it either. Expand That's because you don't need getChunkFromBlockCoords at all. All you need to do is take the spawn coordinates (in block form) and do >>4 on them to get the chunk coordinates. You don't need the chunk, all you want to know is if the current chunk has the same coordinates as the spawn chunk. 1 Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
That_Martin_Guy Posted July 3, 2017 Author Posted July 3, 2017 It works now! Thanks guys! Diff for anyone curious on how I did it. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.