Jump to content

qpwoeiruty

Members
  • Posts

    159
  • Joined

  • Last visited

Everything posted by qpwoeiruty

  1. boundingBox.getBoundingBox(par0, par2, par4, par6, par8, par10) So I would use this then specify the size.
  2. Would I have to use "BoundingBoxBuilder"
  3. world.getChunkFromBlockCoords(serverPosX, serverPosZ).getEntitiesOfTypeWithinAAAB(EntityBlockCoal.class, getBoundingBox(), entityList, null) So more something like that?
  4. I now get an error under: Chunk.getEntitiesOfTypeWithinAAAB(EntityBlockCoal.class, getBoundingBox(), entityList, null) With no suggestions.
  5. ArrayList entityList = new ArrayList(); Is that better?
  6. Okay I have done that but I still get an error saying I need to cast the list. List entityList = new List(); if(Chunk.getEntitiesOfTypeWithinAAAB(EntityBlockCoal.class, getBoundingBox(), entityList, null)) { return false; }
  7. What I am not sure about now is what I require for the list parameter.
  8. Never mind then, I'm not understanding so am going to do some research and try again at a later date. Thanks for the help anyway. Edit: I got to this but I'm not sure what to do with the list, but its probably wrong anyway: if(Chunk.getEntitiesOfTypeWithinAAAB(EntityBlockCoal.class, getBoundingBox(), List, null) != null) { return false; } return true; }
  9. I'm sorry about this, I'm just fairly new to modding still. I have changed it to this: private boolean entityLimit(World world) { if(world.getChunkFromBlockCoords(serverPosX, serverPosZ).worldObj.getEntitiesWithinAABB(EntityBlockCoal.class, getBoundingBox()) != null) { return false; } return true; }
  10. Oh, would I have to use the ChunkData event like this or something similar then get the chunk from it? @SubscribeEvent private void chunkDataEvent(ChunkDataEvent event) { event.getChunk(); }
  11. Okay sorry, it's just that there was no getEntitiesOfTypeWithinAABB method, and it only had 2 parameters so I have now done this and I have no errors but it crashes: private boolean entityLimit() { if(worldObj.getEntitiesWithinAABB(EntityBlockCoal.class, getBoundingBox()) != null) { return false; } return true; }
  12. I get an error under "getEntitiesWithinAABB" when using this.worldObj.getEntitiesWithinAABB(this, getBoundingBox()) >= 3
  13. What would I put for the first and second parameter, is it the entity I am checking for and the chunk or something?
  14. Great, thanks. I will start experimenting with it.
  15. How would I go about limiting the number of entities per chunk for my custom mobs.
  16. Fixed it. I changed it to: MathHelper.floor_double(this.posY) <= 15
  17. I have used this to try and get it working (the bit in bold) but it hasn't taken affect. @Override public boolean getCanSpawnHere() { int i = MathHelper.floor_double(this.posX); int j = MathHelper.floor_double(this.boundingBox.minY); int k = MathHelper.floor_double(this.posZ); return this.worldObj.getBlock(i, j - 1, k) == Blocks.stone && super.getCanSpawnHere() && this.chunkCoordY <= 15; // && this.worldObj.getFullBlockLightValue(i, j, k) < 8; }
  18. Thanks, I have noticed an immediate change. That being that they are actually spawning. Juts got to touch up some code and then its done, awesome thanks.
  19. I have been looking for a while at some of the minecraft src code and I still can't get it working. If anyone has any ideas please let me know thanks.
  20. How would I go about spawning an animal, similar to a sheep, where the light level is below 8. I have tried adding this but nothing has changed. public boolean getCanSpawnHere() { int i = MathHelper.floor_double(this.posX); int j = MathHelper.floor_double(this.boundingBox.minY); int k = MathHelper.floor_double(this.posZ); return this.worldObj.getBlock(i, j - 1, k) == Blocks.stone && super.getCanSpawnHere() && checkUnderground() && this.worldObj.getFullBlockLightValue(i, j, k) < 8; }
  21. Thanks I needed someone to explain to me how to do this, I will be implementing this very soon.
  22. Yeah that makes more sense, I will most likely edit it today or tomorrow, just wanted to get it working.
  23. I changed it to this: @SubscribeEvent public void checkDrops(BlockEvent.BreakEvent event) { if(event.block == Blocks.leaves || event.block == Blocks.leaves2) { //Drops } } However, now I am unsure on setting the drop as it has changed, sorry if I am overlooking something simple.
  24. Thanks, the top section is just for what blocks can be broken by hand. package com.willr27survivalplus.handler; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraftforge.common.ForgeHooks; import net.minecraftforge.event.entity.player.PlayerEvent; import net.minecraftforge.event.world.BlockEvent.HarvestDropsEvent; import cpw.mods.fml.common.eventhandler.SubscribeEvent; public class WSPEventHandler { @SubscribeEvent public void setBreakableBlocks(PlayerEvent.BreakSpeed event) { ItemStack item = event.entityPlayer.getCurrentEquippedItem(); if(item == null && event.block == Blocks.bed || item == null && event.block == Blocks.brown_mushroom_block || item == null && event.block == Blocks.cactus || item == null && event.block == Blocks.cake || item == null && event.block == Blocks.carpet || item == null && event.block == Blocks.carrots || item == null && event.block == Blocks.clay || item == null && event.block == Blocks.cocoa || item == null && event.block == Blocks.dirt || item == null && event.block == Blocks.flower_pot || item == null && event.block == Blocks.grass || item == null && event.block == Blocks.gravel || item == null && event.block == Blocks.nether_wart || item == null && event.block == Blocks.potatoes || item == null && event.block == Blocks.red_mushroom_block || item == null && event.block == Blocks.redstone_torch || item == null && event.block == Blocks.reeds || item == null && event.block == Blocks.sand || item == null && event.block == Blocks.sapling || item == null && event.block == Blocks.skull || item == null && event.block == Blocks.snow || item == null && event.block == Blocks.snow_layer || item == null && event.block == Blocks.standing_sign || item == null && event.block == Blocks.tnt || item == null && event.block == Blocks.torch || item == null && event.block == Blocks.tripwire || item == null && event.block == Blocks.unlit_redstone_torch || item == null && event.block == Blocks.vine || item == null && event.block == Blocks.wall_sign || item == null && event.block == Blocks.waterlily || item == null && event.block == Blocks.web || item == null && event.block == Blocks.wheat || item == null && event.block == Blocks.wool || item == null && event.block == Blocks.brown_mushroom || item == null && event.block == Blocks.deadbush || item == null && event.block == Blocks.double_plant || item == null && event.block == Blocks.fire || item == null && event.block == Blocks.grass || item == null && event.block == Blocks.leaves || item == null && event.block == Blocks.leaves2 || item == null && event.block == Blocks.mycelium || item == null && event.block == Blocks.red_flower || item == null && event.block == Blocks.red_mushroom || item == null && event.block == Blocks.redstone_wire || item == null && event.block == Blocks.tallgrass || item == null && event.block == Blocks.tripwire_hook || item == null && event.block == Blocks.yellow_flower || item != null && event.block == Blocks.bed || item != null && event.block == Blocks.brown_mushroom_block || item != null && event.block == Blocks.cactus || item != null && event.block == Blocks.cake || item != null && event.block == Blocks.carpet || item != null && event.block == Blocks.carrots || item != null && event.block == Blocks.clay || item != null && event.block == Blocks.cocoa || item != null && event.block == Blocks.dirt || item != null && event.block == Blocks.flower_pot || item != null && event.block == Blocks.grass || item != null && event.block == Blocks.gravel || item != null && event.block == Blocks.nether_wart || item != null && event.block == Blocks.potatoes || item != null && event.block == Blocks.red_mushroom_block || item != null && event.block == Blocks.redstone_torch || item != null && event.block == Blocks.reeds || item != null && event.block == Blocks.sand || item != null && event.block == Blocks.sapling || item != null && event.block == Blocks.skull || item != null && event.block == Blocks.snow || item != null && event.block == Blocks.snow_layer || item != null && event.block == Blocks.standing_sign || item != null && event.block == Blocks.tnt || item != null && event.block == Blocks.torch || item != null && event.block == Blocks.tripwire || item != null && event.block == Blocks.unlit_redstone_torch || item != null && event.block == Blocks.vine || item != null && event.block == Blocks.wall_sign || item != null && event.block == Blocks.waterlily || item != null && event.block == Blocks.web || item != null && event.block == Blocks.wheat || item != null && event.block == Blocks.wool || item != null && event.block == Blocks.brown_mushroom || item != null && event.block == Blocks.deadbush || item != null && event.block == Blocks.double_plant || item != null && event.block == Blocks.fire || item != null && event.block == Blocks.grass || item != null && event.block == Blocks.leaves || item != null && event.block == Blocks.leaves2 || item != null && event.block == Blocks.mycelium || item != null && event.block == Blocks.red_flower || item != null && event.block == Blocks.red_mushroom || item != null && event.block == Blocks.redstone_wire || item != null && event.block == Blocks.tallgrass || item != null && event.block == Blocks.tripwire_hook || item != null && event.block == Blocks.yellow_flower) { event.setCanceled(false); } else if(item == null || !ForgeHooks.isToolEffective(item, event.block, event.metadata)){ event.setCanceled(true); } } @SubscribeEvent public void checkDrops(HarvestDropsEvent event) { if(event.block == Blocks.leaves || event.block == Blocks.leaves2) { event.drops.add(new ItemStack(Items.stick, 1)); } } } I registered it like so: @EventHandler public void Init(FMLInitializationEvent Event) { FMLCommonHandler.instance().bus().register(new CraftingHandler()); MinecraftForge.EVENT_BUS.register(new WSPEventHandler()); WSPRecipeCreator.createRecipes(); }
  25. Hrmmm, I believe I have done it correctly but so far, no sticks have been dropped. if(event.block == Blocks.leaves || event.block == Blocks.leaves2) { event.drops.add(new ItemStack(Items.stick, 1)); }
×
×
  • Create New...

Important Information

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