Jump to content

DaryBob

Members
  • Posts

    70
  • Joined

  • Last visited

Everything posted by DaryBob

  1. So I could use this? public boolean isLocationValid() { private boolean flag0; private boolean flag1; private boolean flag2; for(int x1 = 0; x1 > blocksOfX; x1++) { if(!world.getBlockState(x1, y z) == Blocks.air) return false; }else{ flag2 = true; } for(int y1 = 0; y1 > blocksOfY; x1++) { if(!world.getBlockState(x, y1,z) == Blocks.air) return false; }else{ flag1 = true; } for(int y1 = 0; y1 > blocksOfX; y1++) { if(!world.getBlockState(x, y z1) == Blocks.air) return false; }else{ flag0 = true; } if(flag0 && flag1 && flag2) { return true; } return false; }
  2. AGE OF THE ORIGINS MINECRAFT FORUMS THREAD: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/wip-mods/2534028-wip-age-of-the-origins-dimensions-dungeons-bosses Information: This is a large project by DaryBob. An adventure mod that features new bosses, dimensions. Also adds cutscenes and a story to the minecraft game. Feel free to give me some ideas! The mod is currently in heavy development. PM me if you are a nice modeler, texturer or musician! Also some testers for the first unreleased versions will be needed! Thanks and keep in mind that a big minecraft mod project has begun! Features: Progress: Screenshots: Download: FIRST RELEASE IS NOT THERE YET! Modpack Permission: Feel free to use it in your modpack, but don't forget to GIVE A LINK TO THIS THREAD. I do not support the technic launcher, do NOT PUT IT IN A TECHNIC LAUNCHER MODPACK! Other stuff: You got any ideas for the mod? Feel free to post them in the thread (or just PM them to me)! You would like to search for bugs in the mod? PM me! You want to help with the creation of this mod? PM me! You can share the mod across the world if you want. But here are some rules: IMPORTANT RULES: DO NOT PRETEND THAT YOU ARE THE OWNER OF MY MOD, DO NOT MODIFICATE MY MOD, AND DO NOT MAKE ANY MONEY WITH IT! About the author:
  3. Any help? I also customized the schematic reader and not just copy pasted it. What I meant is, the structure spawns IN mountains, IN the ground etc. And I want it to spawn on a free location. What could I do?
  4. Hey guys! I made a schematic reader like the coder of the mod "Instant Structures" made. Instead of hardcoding the gen, you can directly read the schematic file. So I wanted to ask how I can prevent that the structures spawn IN the floors and stuff. I tried this: package netcrafter.mods.aoto.world.gen.feature; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.init.Blocks; import net.minecraft.util.BlockPos; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenerator; import net.minecraftforge.fml.common.IWorldGenerator; import netcrafter.mods.aoto.util.Schematic; public class ForestGen implements IWorldGenerator { private Schematic schematic; public ForestGen(Schematic schematic) { this.schematic = schematic; } protected Block[] GetValidSpawnBlocks() { return new Block[] { Blocks.grass, Blocks.stone, Blocks.dirt, }; } public boolean LocationIsValidSpawn(World world, int x, int y, int z) { int distanceToAir = 0; Block checkBlock = world.getBlockState(new BlockPos(x, y, z)).getBlock(); while (checkBlock != Blocks.air) { distanceToAir++; checkBlock = world.getBlockState(new BlockPos(x, y + distanceToAir, z)).getBlock(); } if (distanceToAir > 1) { return false; } y += distanceToAir - 1; Block block = world.getBlockState(new BlockPos(x, y, z)).getBlock(); Block blockAbove = world.getBlockState(new BlockPos(x, y + 1, z)).getBlock(); Block blockBelow = world.getBlockState(new BlockPos(x, y - 1, z)).getBlock(); for (Block i : GetValidSpawnBlocks()) { if (blockAbove != Blocks.air) { return false; }if (block == i) { return true; }else if (block == Blocks.snow_layer && blockBelow == i) { return true; }else if (block.getMaterial() == Material.plants && blockBelow == i) { return true; } } return false; } @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { if(random.nextInt(200) == 0) { int x = chunkX * 16 + random.nextInt(16); int z = chunkZ * 16 + random.nextInt(16); int y = getWorldHeightAt(world, x, z); if(LocationIsValidSpawn(world, x, y, z) || LocationIsValidSpawn(world, x + 20, y, z) || LocationIsValidSpawn(world, x + 20, y, z + 16) || LocationIsValidSpawn(world, x, y, z + 16)) { if(world.getBiomeGenForCoords(new BlockPos(x, y, z)) == BiomeGenBase.forest) { schematic.generate(world, x, y, z); System.out.println("FOREST DUNGEON GENERATED!"); } }else{ System.out.println("SPAWN LOCATION IS NOT VALID"); } } } private static int getWorldHeightAt(World world, int x, int z) { int height = 0; for(int i = 0; i < 255; i++) { if(world.getBlockState(new BlockPos(x, i, z)).getBlock().isSolidFullCube()) { height = i; } } return height; } } The structure still spawns in walls, in floors, in tree 'n stuff. So, it doesn't seem to work correctly.. Maybe I am just overseeing an error in the code? Do you have the solution for a "perfect" structure generation? Please help me - DaryBob
  5. Hey guy's! I was working on a boss mob which has multiple attacks. It shoots tree roots and spawns minions. I have tried spawning the minions, first it worked, but now I doesn't work anymore. I think I accidentaly destroyed one of the methods.. I can't find the problem, too me it seems correct but its not.. Heres the code: EntityForestGuardian.java
  6. You need to make a redstone bar thing in your gui.png. Then go to your GuiGrinder class and put that to the right coordinates. You need to check if there is power in it. If there is, you need to get the value of the power thats in there. But first in the tile entity, you check if in that slot there is redstone. If there is redstone, then give it 10+ power and decrement the itemstack of the redstone. So every redstone gives you 10 power more. Make a method too where it is updating the tile entity everytime.. Then you go to the gui class and take the variable of the amount of the power in the x or y variable. If its going up, I think you need to do y + power.. If its going down, then y - power. ( I think). I did this last year, so I can't remember all I did. But I hope this was helpful. mkay bye (Dary) Maybe I meant the containergrinder class and not the guigrinder class.. I just remember that I synced it but yeah.. Bye..
  7. Thanks! Its working! Got this now: @SubscribeEvent public void onEntityDrop(LivingDropsEvent event) { if(event.entityLiving instanceof EntityGuardian) { if(((EntityGuardian) event.entityLiving).isElder()) { event.entityLiving.entityDropItem(new ItemStack(AOTOItems.gem, 1, 0), 1.0F); } } }
  8. But how do I check if it is an elder guardian? There is only the EntityGuardian class with the little guardians. I want only the elder guardian to drop the gem. So I found the isElder boolean but I don't know how to access it.. So I am checking if the instance of entity.entityLiving is EntityGuardian.. How do I check if it is an elder one?
  9. I think you mean by the entity instance the event.entityLiving
  10. Hmm sorry but somehow I dont understand how you mean it.. Which is the entity instance and which is the particular instance.. I don't know how to check if the entity guardian is elder..
  11. But I can't access it.. "Cannot make a static reference to the non-static method isElder() from the type EntityGuardian" Or maybe I am dumb..
  12. Hey guys! How do I get the instance of an elder guardian? there is only an entityguardian class with the boolean "isElder".. So how do I make that "instanceof" part then? Event Handler The normal guardians drop the gem. But I only want the elder guardian to drop my gem. Oh yeah, and how do I make it drop with the meta 0? Cuz' dropItem only takes the item and how much..
  13. solved it.. int counter = 0; for(int i = 0; i < height; i++) { for(int j = 0; j < length; j++) { for(int k = 0; k < width; k++) { int blockId = UnsignedBytes.toInt(blockIDs[counter]); BlockPos pos = new BlockPos(k, i, j); IBlockState state = Block.getBlockById(blockId).getStateFromMeta(metadata[counter]); blockObjects[counter] = new BlockObject(pos, state); counter++; } } } made an int blockId that returns blockIDs[counter]. Now it can generate blocks with higher ids. Thanks to Resinresin for sharing he's code (just took the part with the blockId and updated it so it can run on forge 1.. http://www.minecraftforge.net/forum/index.php?topic=30800.0
  14. Oh yeah, forget to mention the block object class I made. BlockObject
  15. By "Cobblestone Wall" I actually meant the block.. minecraft:cobblestone_wall
  16. So I made a schematic reader that reads schematics.. It works, everything generates, but the only things that doesn't generate are the walls.. I think the IDs are to high for the bytes or something.. Does someone have a solution for this? Schematic ForestGen Registry stuff: public static final Schematic FOREST_DUNGEON = new Schematic("ForestDungeon.schematic"); GameRegistry.registerWorldGenerator(new ForestGen(Main.FOREST_DUNGEON), 0); Thanks for your support!
  17. Hey guy's, i've found a new problem.. If I throw the nether star into the lava, it creates the portal, but sometimes it doesn't check if it is in lava.. So it only creates a portal every 10 times or something.. Any thoughts on why this is so? Custom Entity Item Portal Block:
  18. Thanks, Choonster! Got it working now finally.. Is it neccesary to check if the item is in lava? Because the method is basically being called if it catches fire of lava.. But anyways, thanks very much to delpi and Choonster!
  19. Well, I was dumb and put the bounding box in.. But I needed the entity bounding box.. Still doesn't work if I throw the item in the lava.. is AABB (entity bounding box) In Material (Material.lava)? The entity of the boats in minecraft does this too with water (Material.water) if (event.world.isAABBInMaterial(aEntityItem.getEntityBoundingBox(), Material.lava)) { int dx = MathHelper.floor_double(aEntityItem.motionX); int dy = MathHelper.floor_double(aEntityItem.motionY); int dz = MathHelper.floor_double(aEntityItem.motionZ); if (((BlockRVPortal)AOTOBlocks.rvPortal).tryToCreatePortal(event.world, dx, dy, dz)) { WorldInfo wInfo = event.world.getWorldInfo(); event.world.addWeatherEffect(new EntityLightningBolt(event.world, dx, dy, dz)); wInfo.setRainTime(1000); wInfo.setThunderTime(1000); wInfo.setRaining(true); wInfo.setThundering(true); aEntityItem.setDead(); event.setCanceled(true); } [spoiler/]
  20. I think that happens if it doesn't hit the lava or something..
  21. I tried this: event.world.isAABBInMaterial(aEntityItem.getBoundingBox(), Material.lava) to check if it is in lava.. if (event.world.isAABBInMaterial(aEntityItem.getBoundingBox(), Material.lava)) { int dx = MathHelper.floor_double(aEntityItem.motionX); int dy = MathHelper.floor_double(aEntityItem.motionY); int dz = MathHelper.floor_double(aEntityItem.motionZ); if (((BlockRVPortal)AOTOBlocks.rvPortal).tryToCreatePortal(event.world, dx, dy, dz)) { WorldInfo wInfo = event.world.getWorldInfo(); event.world.addWeatherEffect(new EntityLightningBolt(event.world, dx, dy, dz)); wInfo.setRainTime(1000); wInfo.setThunderTime(1000); wInfo.setRaining(true); wInfo.setThundering(true); aEntityItem.setDead(); event.setCanceled(true); } } Still doesn't work.. But if gives me an error if I throw the nether star.. (But it doesn't crash) [18:55:59] [server thread/ERROR] [FML]: Index: 3 Listeners: [18:55:59] [server thread/ERROR] [FML]: 0: HIGHEST [18:55:59] [server thread/ERROR] [FML]: 1: ASM: net.minecraftforge.common.ForgeInternalHandler@7fb27a08 onEntityJoinWorld(Lnet/minecraftforge/event/entity/EntityJoinWorldEvent;)V [18:55:59] [server thread/ERROR] [FML]: 2: NORMAL [18:55:59] [server thread/ERROR] [FML]: 3: ASM: netcrafter.mods.aoto.event.AOTOEventHandler@4bfb3772 onEntityJoinWorld(Lnet/minecraftforge/event/entity/EntityJoinWorldEvent;)V [18:55:59] [server thread/FATAL] [FML]: Exception caught executing FutureTask: java.util.concurrent.ExecutionException: java.lang.NullPointerException java.util.concurrent.ExecutionException: java.lang.NullPointerException at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.7.0_79] at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.7.0_79] at net.minecraftforge.fml.common.FMLCommonHandler.callFuture(FMLCommonHandler.java:715) [FMLCommonHandler.class:?] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:727) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:669) [MinecraftServer.class:?] at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:171) [integratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:540) [MinecraftServer.class:?] at java.lang.Thread.run(Unknown Source) [?:1.7.0_79] Caused by: java.lang.NullPointerException at net.minecraft.world.World.isAABBInMaterial(World.java:2318) ~[World.class:?] at netcrafter.mods.aoto.event.AOTOEventHandler.onEntityJoinWorld(AOTOEventHandler.java:54) ~[AOTOEventHandler.class:?] at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_6_AOTOEventHandler_onEntityJoinWorld_EntityJoinWorldEvent.invoke(.dynamic) ~[?:?] at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:55) ~[ASMEventHandler.class:?] at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:138) ~[EventBus.class:?] at net.minecraft.world.World.spawnEntityInWorld(World.java:1230) ~[World.class:?] at net.minecraft.entity.player.EntityPlayer.joinEntityItemWithWorld(EntityPlayer.java:934) ~[EntityPlayer.class:?] at net.minecraftforge.common.ForgeHooks.onPlayerTossEvent(ForgeHooks.java:421) ~[ForgeHooks.class:?] at net.minecraft.entity.player.EntityPlayer.dropOneItem(EntityPlayer.java:854) ~[EntityPlayer.class:?] at net.minecraft.network.NetHandlerPlayServer.processPlayerDigging(NetHandlerPlayServer.java:513) ~[NetHandlerPlayServer.class:?] at net.minecraft.network.play.client.C07PacketPlayerDigging.processPacket(C07PacketPlayerDigging.java:53) ~[C07PacketPlayerDigging.class:?] at net.minecraft.network.play.client.C07PacketPlayerDigging.processPacket(C07PacketPlayerDigging.java:76) ~[C07PacketPlayerDigging.class:?] at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:24) ~[PacketThreadUtil$1.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.7.0_79] at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.7.0_79] at net.minecraftforge.fml.common.FMLCommonHandler.callFuture(FMLCommonHandler.java:714) ~[FMLCommonHandler.class:?] ... 5 more Your right.. I changed it: if(stack.getItem() == Items.nether_star)
  22. I guess this.isImmuneToFire = true is not the best way to make it immune to fire.. It somehow makes the entity item invisible.. If I walk to the block where it its, it pops up again..
  23. Hey guys! I made a custom entity item! So, if you drop a nether star, its entity item will actually convert to my custom entity item. I wrote "this.isImmuneToFire = true;" in my custom entity item class. It is immune to fire, but if I check if its in lava, it doesn't call everything.. I used the boolean "isInLava"... So do you have any thoughts of why it doesn't equal to true? Heres my event handler and EntityItem class: Event Handler: Entity Item Thanks to delpi for giving me the suggestion to create the custom entity item class.
  24. Thanks dude, I think thats what I need for now. Bye, DaryBob
×
×
  • Create New...

Important Information

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