Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Brickfix

Members
  • Joined

  • Last visited

Everything posted by Brickfix

  1. Well, thank you anyway, at least you where right with the world.addWeatherEffect(bla)
  2. Hi TheGreyGhost, thanks for your fast reply. I tried it out, but there are some problems - the world.canLightningStrike checks if it is actually raining - but I want the lightning to spawn even if it does not rain. So at first nothing happened. Than I tried it without the if-statement, and again, I heard the lightning - but I didn't see it. There wasn't even the fire, which I had befor. There is a command for spawning a lightning: /summon LightingBolt x y z , so I thought it should work simiular with the block I am using... Well, I'll check that out for than. Anyway, thanks for your reply ~Brickfix EDIT: I solved the problem - I looked into the commandSummon code and there was the solution right befor my nose! For all who are interested in this, here is the code that makes it work: public void updateTick(World world, BlockPos pos, IBlockState state, Random random) { //System.out.println("updated"); double dx = (double)pos.getX(); double dy = (double)pos.getY(); double dz = (double) pos.getZ(); String sx = String.valueOf(pos.getX()); String sy = String.valueOf(pos.getY()); String sz = String.valueOf(pos.getZ()); try { dx = CommandBase.func_175761_b(dx, sx, true); dy = CommandBase.func_175761_b(dy, sy, false); dz = CommandBase.func_175761_b(dz, sz, true); } catch (NumberInvalidException e) { // TODO Auto-generated catch block e.printStackTrace(); } world.addWeatherEffect(new EntityLightningBolt(world, dx, dy, dz)); } Thanks again for any help given
  3. Hi Guys, I am currently working on a block that spawns a lightning bolt into the world. This is for a structure to add some ambient or "scary moment". Unfortunately, the lightning is invisible. I have worked out everything, and there even is a loud "Kabumm" the lightning makes and fire spawned exactly where I want it, but the lightning itself is not to be seen. I tested if it was my computer, but if I summon the lightning it works, I can definitly see it. Here is the WGBlockLightning class: package com.brickfix.worldgenmod.blocks; import java.util.Random; import com.brickfix.worldgenmod.WorldGenMod; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.effect.EntityLightningBolt; import net.minecraft.util.BlockPos; import net.minecraft.world.World; import net.minecraftforge.fml.common.registry.GameRegistry; public class WGBlockLightning extends Block { private final String name = "lightningBlock"; public WGBlockLightning() { super(Material.rock); GameRegistry.registerBlock(this, name); setUnlocalizedName(WorldGenMod.MODID + "_" + name); setCreativeTab(CreativeTabs.tabBlock); this.setTickRandomly(true); } public String getName() { return name; } public int quantityDropped(Random random) { return 0; } protected boolean canSilkHarvest() { return true; } public void updateTick(World world, BlockPos pos, IBlockState state, Random random) { Entity lightning = new EntityLightningBolt(world, (double)pos.getX()+0.5, (double)pos.getY()+1, (double)pos.getZ()+0.5); world.spawnEntityInWorld(lightning); } } Thanks in advance for any help, it would be great if you could help me out ~Brickfix
  4. And another Update! If some of you wonder why there is no version 4, this is because a crash I fixed emideatly afterwords, and so I skipped releasing it. The new update features two rather small, but fun structures: At first, there is an underwater ruin, perhaps once a tower, made out of prismarine blocks, with a small loot chest. It is only found in the ocean biome and quite rarely. Secondly, I have added a structure for beaches: some wood, a chest. It is not mutch, but I think it really adds some athmosphere when traveling along an ocean. I hope you have fun with these additions ~Brickfix
  5. I updated the mod! Check out the top post for new content and be sure to leave some feedback and ideas ~Brickfix
  6. Updated!(see the top post for more details) I added a new structure, and some scary features with it. But even if you can see the beam of a beacon, I didn't make it easy for you to get it! Hope you guys enjoy, ~ Brickfix
  7. I am using the DecorateBiomeEvent to enable my structure generation: @SubscribeEvent public void DecorateBiomeEvent(DecorateBiomeEvent event) { BlockPos pos = event.pos; World world = event.world; Random random = event.rand; int xCoord = pos.getX(); int zCoord = pos.getZ(); BlockPos pos1 = new BlockPos(xCoord+2, 0, zCoord+2); if (random.nextInt(500)==0) (new GenStruktureTower()).generate(world, random, pos1); } I would really prefer to use the IWorldGenerator interface, but for some reason it is not working for me. But for now I don't have any crashes, as I made sure that my structure spawns exclusively in one chunk. Still, if there would be a solution, this would be very good, since structures limited to one chunk can't be that big - and I want to add bigger structures later on the way ~Brickfix
  8. Well, this problem is getting more and more weird: First of all, I found out that it is NOT seed-related. I have been wrong about that. It seems to be something that happens when there is a lot happening "at once", e.g. when I start a new world and instantly go flying to the next structure. It doesn't happen when I walk to the structure slowly. I have set the chance to spawn at a chank to once every five hundred tries, and after flying through a regular world it happened to me once - after 20 minutes. So I am already thinking that it is either when it is generated in a chunk that technicaly doesn't decorate yet, but starts decorating, so it throughs the exception "already decorating" or my computer is just to slow. I will try to keep the generation of the structure in one chunk, maybe that will help EDIT: I have fixed it (at least I hope so): It really seems to be a problem, when my structure is generating in more than just one chunk. I could now even set the probability to spawn my structure up to once every fifty tries, and there wasn't any crash for ten minutes when flying strate. But this is not a very acceptable solution - as it does not allow me to generate bigger structures. And how do mineshafts work, or villages? It doesn't crash on their generation! I still hope that it is a problem with Forge which will get fixed or something, or that somebody points out what I did wrong. ~Brickfix
  9. Thanks for showing interest - of course I will also add traps and stuff. For the moment this mod is not open source, but it will be after I found some time messing with github or some other way to make the code public. In this version (Alpha 1.0), there is no chest content, but I already have a newer version almost finished where there is random chest and even furnace content! I also have messed around with the TileEntity of the BeaconBlock - expect some nasty surprises there Did you download the mod? Could you give me any feedback on the generation? ~Brickfix
  10. Hi Guys, I have played a little with the minecraft structure generation and now present you the first parts of an early alpha Mod: BrickfixWorldGen This mod is about adding some structures to the worldgen, making exploring more interesting and sometimes even a challange! I always felt that exploring the minecraft world was a lot of fun, and when finding a structure it was generally very rewarding. I always build my bases close to some structure, when not inside. But I felt that there just weren't enough structures. So this is my attempt of adding structures to minecraft, that fit into the a general theme and do not spawn to close to each other. Currently, there are three types of structures: - Abandomned buildings: Not to long ago, somebody still lived there. - Dungeons: A building crawling with monsters, but rewarding concerning loot. - Ruins: There is not much left, but sometimes there is something interesting to be found. Screenshot For now, only eight structures are added, but it will be more over time. You can download the mod here: Changelog If you have any feedback, I am happy to heare about it You can leave suggestions for future structures, as well as other ideas, in a comment. I on my side have a question: Is the structure spawning too frequent or too rarely? And of course please report any kind of Bugs ~Brickfix PS: This mod is in an early alpha stage, of course more content will come soon!
  11. Hi, this is me again - with a different problem This time, as I am trying to generate custom structures, I have a not very comon crash which is related to setting a furnace. This crash does not occur everytime I generate the structure - just sometimes. Sometimes chunks where the structure spawns in are not decorated or have an ocean biome ID - even though they are clearly taiga or forest. CrashReport: This does not happen everytime the structure spawns! So I do know that it does work, it has to be something very weird that i do not understand. Any help would be very appreciated EDIT I changed to topic name as the problem seems to be something else: Every now and than, when generating my custom structure, the game crashes. The crash report alway looks simiular to the one above, but this also happens when I use any type of block. It also happened when using world.setBlockToAir, which is basically the same. I don't really know the reason. I use the DecorateBiomeEvent to call the generating class, maybe that is a problem? It has happened several times with different blocks: Blocks.air, Blocks.stone_Brick, Blocks.furnace and some other. Another side note: It alway happens at the same place: So when I duplicate the world, it always happens at the exact same structure at the exact same block. It doesn't happen with every structure I spawn, only with every 100th or something. Thanks again for any help
  12. thanks for the reply I have scanned through all fxxxx() functions - there is only one accepting pos as argument and returning an interger - and it has something to do with redstone power - so I guess that is not what I am looking for. But I found some other nice functions, which are not needed right now but very usefull. Thx
  13. I worked the whole thing out. I mixed up < and > in the for function. So the whole for loop didn't run a single time. But now it is working like a charm here the whole function for those who might need it: protected int getTopBlock(World world, BlockPos pos) { int j; int y=-1; int k=0; boolean topBlock = false; for ( j=255; j>=63; j--) { if (!world.getBlockState(pos.add(0, j, 0)).getBlock().equals(Blocks.air)) { topBlock=true; k++; } if (topBlock && (k==1)) { y=j; } } System.out.println(k); return y; }
  14. Thanks for the fast reply In the last line in the 'for' - function I am lowering the pos by one pos = pos.add(0, 1, 0) this should happen for every loop. But I will try world.getBlockState(pos.add(0, j, 0)) as well ... EDIT: I changed the arguments of the first if-function if(world.getBlockState(pos.add(0, j, 0)).getBlock() == Blocks.air) So k should increase everytime there is an air block. but still, k remains 0! Am I just to stupid to use boolean values or is getBlockState.getBlock not compareable to a block? I used a simiular thing with my actaual structur, and it worked there Thanks again to whoever takes some time with this to help me 2.EDIT I of course also removed the line pos = pos.add(0, 255, 0) befor the for-function. I still didn't work.
  15. Hi, I'm trying to generate custom structures, and for this I use the DecorateBiomeEvent. This event doesn't give me the actual world height at the location, and for some reason the function world.getHeightValue(x, z) isn't there any longer. So I tried to write my own function to replace it, but I encounter a problem. This is my funtion: protected int getTopBlock(World world, BlockPos pos) { int j; int y=-1; int k=0; boolean topBlock = false; pos = pos.add(0, 255, 0); for ( j=255; j<=63; j--) { if (!world.getBlockState(pos).getBlock().isOpaqueCube()) { topBlock=true; k++; } if (topBlock && (k==1)) { y=j; } pos = pos.add(0, -1, 0); } System.out.println(k); return y; } For some reason this doesn't work, and I just can't find the mistake I made. I tried a lot of different things, for example if(world.getBlockState(pos).getBlock()!=Blocks.air) {} or if(!world.getBlockState(pos).isAirBlock) but nevertheless, it just doesn't work I printed out the integer k so I can see if my function works at all, but I found out that k will be alway 0, therefor the if-function was never used. I could imagine that this is just me overlooking something, but it would be very appreciated if somebody could help me Brickfix

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.