Jump to content

Recommended Posts

Posted

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;

 

}

Posted

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();

 

}

Posted

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;

 

}

Posted

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;

 

}

Posted

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;

 

}

Posted

world.getChunkFromBlockCoords(serverPosX, serverPosZ).getEntitiesOfTypeWithinAAAB(EntityBlockCoal.class, getBoundingBox(), entityList, null)

 

So more something like that?

Posted

Sorry, it is saying I can't convert from void to boolean.

 

qpwoeiruty, all of your questions in this thread seem to be from not understanding Java fully.  It is okay that you're a beginning programmer (everyone has to start somewhere), but your questions really aren't about modding they are about Java.  You didn't know how to call a method, you didn't know about static methods, you didn't know about casting, and now you don't know about return values.  You should really just learn more Java.  There are plenty of online references, but I also suggest having a very good book that is easy to read called: Java In Easy Steps.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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