Jump to content

Recommended Posts

Posted (edited)

Hi, I am starting in the forge programming (I think I know enough java) and I would like to create a 2 wide block like a bed, but I want it to be a table, I've been searching in the forums and I saw this.setBlockBounds(and a serie of floats) but when i put it it gives me an error saying me "Cannot resolve method 'setBlockBounds(float, float, float, float, float, float)". Can anyone help me please? 

 

EDIT: SOLVED

Edited by DarkDragon117
Solved
Posted
  On 3/5/2019 at 3:52 PM, DarkDragon117 said:

"Cannot resolve method 'setBlockBounds(float, float, float, float, float, float)". Can anyone help me please? 

Expand  

This leads me to believe you don’t know enough Java/have enough experience with an IDE. Either that or your using code from an ancient version. To change a blocks bounding box, you can override Block#getBoundingBox. However this box can be at maximum 1x1.5x1. Anything bigger than this needs multiple blocks. You can look at how the bed works (probably not the best example for your needs, but looking at vanilla code is always helpful), or at other mods that do similar things. 

About Me

  Reveal hidden contents

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Posted
  On 3/5/2019 at 4:27 PM, Cadiboo said:

This leads me to believe you don’t know enough Java/have enough experience with an IDE. Either that or your using code from an ancient version. To change a blocks bounding box, you can override Block#getBoundingBox. However this box can be at maximum 1x1.5x1. Anything bigger than this needs multiple blocks. You can look at how the bed works (probably not the best example for your needs, but looking at vanilla code is always helpful), or at other mods that do similar things. 

Expand  

I can't do it, it says me it's deprecated, I am using forge 1.12.2 MDK

Posted (edited)

1. You might want to try looking at the vanilla bed and see how it handles it (manually sets and breaks adjacent bed block).

 

2.

  On 3/5/2019 at 11:05 PM, DarkDragon117 said:

I can't do it, it says me it's deprecated,

Expand  
  On 3/5/2019 at 3:52 PM, DarkDragon117 said:

Cannot resolve method 'setBlockBounds(float, float, float, float, float, float)

Expand  

These indicate that you are not familiar with basic java. Please learn java before making a mod.

Edited by DavidM
Quoted the wrong part
  • Confused 1

Some tips:

  Reveal hidden contents

 

Posted
  On 3/5/2019 at 11:14 PM, DavidM said:

This indicates that you are not familiar with basic java. Please learn java before making a mod.

Expand  

Why? When it's deprecated it means that it remains in the api but it may be removed in future releases, am I wrong? I prefer not using deprecated methods, but if I need to use them I will ? there is no more chance I see

Posted

Mojang uses "depreciated" in the Block class (and only in the block class) to mean "invoke this from a BlockState, however overriding this is fine"

  • Thanks 1

About Me

  Reveal hidden contents

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Posted
  On 3/6/2019 at 2:36 AM, Cadiboo said:

Mojang uses "depreciated" in the Block class (and only in the block class) to mean "invoke this from a BlockState, however overriding this is fine"

Expand  

Okay, thanks for explaining it, as I said i am new in forge programming, now I understand it (you or I had to start from there xD)

Posted
  On 3/5/2019 at 11:22 PM, DarkDragon117 said:

Why?

Expand  

I was mainly referring to this:

  On 3/5/2019 at 3:52 PM, DarkDragon117 said:

Cannot resolve method 'setBlockBounds(float, float, float, float, float, float)

Expand  

. This is your IDE telling you that the method does not exists; you should be able to interpret error messages like this.

Some tips:

  Reveal hidden contents

 

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.