Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Minecraft Forge
  • Suggestions
  • Add a way to get the recipe width/height in ShapedOreRecipe
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 0
Jannis234

Add a way to get the recipe width/height in ShapedOreRecipe

By Jannis234, October 18, 2013 in Suggestions

  • Reply to this topic
  • Start new topic

Recommended Posts

Jannis234    0

Jannis234

Jannis234    0

  • Tree Puncher
  • Jannis234
  • Members
  • 0
  • 4 posts
Posted October 18, 2013

As far as I know, there is no way to access "width" and "height" in ShapedOreRecipe.java

Can someone add a method to get those (or simply make them public)?

  • Quote

Share this post


Link to post
Share on other sites

Akjosch    4

Akjosch

Akjosch    4

  • Tree Puncher
  • Akjosch
  • Members
  • 4
  • 17 posts
Posted October 27, 2013

You can access getRecipeSize(), which can give you the answer for 1x1, 2x2 and 3x3 recipes (it returns 1, 4 or 9 in those cases).

 

For everything else ...

 

  public static int[] recipeSize(ShapedOreRecipe recipe)
  {
    int width = ObfuscationReflectionHelper.getPrivateValue(ShapedOreRecipe.class, recipe, "width");
    int height = ObfuscationReflectionHelper.getPrivateValue(ShapedOreRecipe.class, recipe, "height");
    return new int[]{width, height};
  }

  • Quote

ItemBlock is not a Block

ItemStack is not an Item

Damage value is not metadata

 

Stop confusing them.

Share this post


Link to post
Share on other sites

LexManos    1617

LexManos

LexManos    1617

  • Reality Controller
  • LexManos
  • Forge Code God
  • 1617
  • 8928 posts
Posted November 5, 2013

why?

  • Quote

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Patreon: http://www.patreon.com/lexmanos
Paypal: http://paypal.me/LexManos

BitCoin: 1Q8rWvUNMM2T1ZfDaFeeYQyVXtYoeT6tTn

Share this post


Link to post
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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 0
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • dotifo7120
      Do stuff right after login

      By dotifo7120 · Posted 3 minutes ago

      Is there an event called when a player enters into the world (fully logged)?
    • dotifo7120
      Как применить нбт к предмету.

      By dotifo7120 · Posted 20 minutes ago

      Русские не помогут. Здесь их нет лол. Тебе выше написали 100 раз, что форум на английском языке, ну так и юзай английский. Хотя бы через гугл транслейт. Хотя если честно, я даже на русском нихуя не понял, что ты написал: кто куда сдвигается, кто что ест?
    • diesieben07
      Windows installer

      By diesieben07 · Posted 32 minutes ago

      Just use the installer, it is cross-platform.
    • T_Jam1
      Windows installer

      By T_Jam1 · Posted 35 minutes ago

      I need help!! I can't find the forge windows installer and every time I look something up it never helps, I'm mad, I'm confused, and I need help.
    • diesieben07
      Meine Inkompetenz kennt mal wieder keine Grenzen.(Forge 1.16.1)

      By diesieben07 · Posted 2 hours ago

      Threads merged. Please keep this forum in English.   Make sure your anti virus does not block the jar file. Also ensure you only download it from https://files.minecraftforge.net/.
  • Topics

    • dotifo7120
      0
      Do stuff right after login

      By dotifo7120
      Started 3 minutes ago

    • Amperka_pro
      6
      Как применить нбт к предмету.

      By Amperka_pro
      Started 4 hours ago

    • T_Jam1
      1
      Windows installer

      By T_Jam1
      Started 35 minutes ago

    • Mounty
      3
      Meine Inkompetenz kennt mal wieder keine Grenzen.(Forge 1.16.1)

      By Mounty
      Started 2 hours ago

    • MistyMarshes
      9
      [1.16.4] Get IChunk World / get current World for the overworld.

      By MistyMarshes
      Started 14 hours ago

  • Who's Online (See full list)

    • glimmermaxcool
    • DaiGamer117
    • LexManos
    • dotifo7120
    • Orbital_Gaming
    • Buecher_wurm
    • maikbr99
    • SaltBeard
    • AurenX
    • diesieben07
  • All Activity
  • Home
  • Minecraft Forge
  • Suggestions
  • Add a way to get the recipe width/height in ShapedOreRecipe
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community