
qpwoeiruty
Members-
Posts
159 -
Joined
-
Last visited
Everything posted by qpwoeiruty
-
boundingBox.getBoundingBox(par0, par2, par4, par6, par8, par10) So I would use this then specify the size.
-
Would I have to use "BoundingBoxBuilder"
-
world.getChunkFromBlockCoords(serverPosX, serverPosZ).getEntitiesOfTypeWithinAAAB(EntityBlockCoal.class, getBoundingBox(), entityList, null) So more something like that?
-
I now get an error under: Chunk.getEntitiesOfTypeWithinAAAB(EntityBlockCoal.class, getBoundingBox(), entityList, null) With no suggestions.
-
ArrayList entityList = new ArrayList(); Is that better?
-
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; }
-
What I am not sure about now is what I require for the list parameter.
-
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; }
-
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; }
-
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(); }
-
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; }
-
I get an error under "getEntitiesWithinAABB" when using this.worldObj.getEntitiesWithinAABB(this, getBoundingBox()) >= 3
-
What would I put for the first and second parameter, is it the entity I am checking for and the chunk or something?
-
Great, thanks. I will start experimenting with it.
-
How would I go about limiting the number of entities per chunk for my custom mobs.
-
[Solved] [1.7.2] How To Spawn An Entity Underground Only
qpwoeiruty replied to qpwoeiruty's topic in Modder Support
Fixed it. I changed it to: MathHelper.floor_double(this.posY) <= 15 -
[Solved] [1.7.2] How To Spawn An Entity Underground Only
qpwoeiruty posted a topic in Modder Support
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; } -
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.
-
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.
-
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; }
-
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(); }