Jump to content

[1.8] multiple property enum issue


UltraTechX

Recommended Posts

you were right!  Now the error changed to the line that i put in my block's class:

 

Cannot set property PropertyEnum{name=part, clazz=class tutorial.generic.railControlBlock$EnumPartType, values=[middle, left, right]} to 0 on block generic:railControlBlock, it is not an allowed value

 

 

here is the function that breaks it:

 

@Override

  public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos){

  return state.withProperty(PART, this.part);

  }

 

PART

is a

PropertyEnum

of

EnumPartType

, but you're trying to assign an

int

value to it (

this.part

).

 

 

i saw that too, so I made this and it works! Thanks for all your help! :D

 

 

@Override

  public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos){

  if(this.part == 2){

  return state.withProperty(PART, EnumPartType.RIGHT);

  }else if(this.part == 1){

  return state.withProperty(PART, EnumPartType.LEFT);

  }else{

  return state.withProperty(PART, EnumPartType.MIDDLE);

  }

 

  }

I'm working on something big!  As long as there arent alot of big issues... [D

Link to comment
Share on other sites

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.