Jump to content

Recommended Posts

Posted

This is the code causing me few problems:

Lvl0Id[count] = world.getBlockId(x, y, z);

                        count++;

 

 

  Reveal hidden contents

 

 

Been awhile since I've done any modding, thought someone could help shine some light :)

Developer of CampCraft

Posted

World#getBlockState

returns the current state of the block at the specified position.

 

Numeric block IDs are automatically assigned per-world and can change on world load. You should avoid using them if at all possible.

 

What are you actually trying to do? What is the

Lvl0Id

array for?

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted

Was trying to use a loop to check if an area of blocks is flat and if a block is missing return an-ingame error message to the player.

 

using the array to check number of blocks on the ground

 

Lvl0Id = new int[24];

Developer of CampCraft

Posted

I don't understand why you need an array of block IDs, but you should probably replace it with an array of

Block

s (the block type) or

IBlockState

s (essentially a

Block

and metadata).

 

You can read more about block states here.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted

What version are you upgrading from? MC 1.6.2?

 

Why to 1.8.9? If upgrading, you should if possible aim for the latest MC version supported by Forge.

 

And what are the problems? Do you have a crash report or Forge log to post?

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

Posted
  On 6/22/2016 at 6:16 PM, Choonster said:

 

 

Thanks for the link, got code working :) when I first started coding was easier to check the block ids as mc didn't have many blocks, I've got the code checking the block material types which seems to be working fine now :)

 

  Quote

 

 

Was upgrading from 1.5.2. Problem was I was checking for the block ids of a loop of blocks to check no blocks are missing but couldn't call the block id as we have blockstates now,

 

When I started few weeks ago wasn't a recommended 1.9 version and plan was to update to 1.8.9 then update to 1.9. Code shouldn't of changed to much between versions.

 

Developer of CampCraft

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.