Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

When I smelt in-game i only get Shadow Ingot even from Ruby ores. It's probably because of

withVariant() and getBlock() are counter to each other.

withVariant() defines which variant (and thus metadata) to use.

getBlock() strips metadata information.

If so I need a new method or what? Can somebody explain it to me step by step or provide source?

problem.png

If you use #getBlock() after a IBlockState, than everything stored in it, (like it's variant) is gone. I don't know how, but you need to find another way of doing this.

 

Use FurnaceRecipes::addSmeltingRecipe(ItemStack, ItemStack, float).

 

FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(BlockInit.ORE_OVERWORLD.getDefaultState().withProperty(...).getBlock), new ItemStack(Items.APPLE), 1);

 

Edited by Legenes
I'm an idiot. + example + oops

procedure WakeMeUp(Integer plusTime);
var
  I: Integer;
begin
  for I := 0 to plusTime do begin
    println('One more minute!');
    Sleep(1000);
  end;
  println('Okay, nothing to worry, I''m alive!');
  println('So... somebody can give me a coffee?');
  println('I know it''s Pascal, and not Java, but I love it :D.');
end;
  • Author

It wants me to Cast argument but when I do that and start the game it crashes.

problem2.png

Oops.. #getBlock was missing.

procedure WakeMeUp(Integer plusTime);
var
  I: Integer;
begin
  for I := 0 to plusTime do begin
    println('One more minute!');
    Sleep(1000);
  end;
  println('Okay, nothing to worry, I''m alive!');
  println('So... somebody can give me a coffee?');
  println('I know it''s Pascal, and not Java, but I love it :D.');
end;
Just now, diesieben07 said:
8 minutes ago, Legenes said:

Oops.. #getBlock was missing.

That won't do anything. OP already explained this above.

I was just saying that I made a bad example ?

procedure WakeMeUp(Integer plusTime);
var
  I: Integer;
begin
  for I := 0 to plusTime do begin
    println('One more minute!');
    Sleep(1000);
  end;
  println('Okay, nothing to worry, I''m alive!');
  println('So... somebody can give me a coffee?');
  println('I know it''s Pascal, and not Java, but I love it :D.');
end;
  • Author
23 minutes ago, diesieben07 said:

Blocks only exist in the world, not in inventories. You need to specify an ItemStack.

I need to specify it above with public static final?

No, I tested my example, and I had a little mistake. You just need to put #getBlock() after #withProperty().

procedure WakeMeUp(Integer plusTime);
var
  I: Integer;
begin
  for I := 0 to plusTime do begin
    println('One more minute!');
    Sleep(1000);
  end;
  println('Okay, nothing to worry, I''m alive!');
  println('So... somebody can give me a coffee?');
  println('I know it''s Pascal, and not Java, but I love it :D.');
end;
Just now, diesieben07 said:

This will not allow you to specify block subtypes. Again, read the OP.

Oh. I'm stupid. Sorry.

procedure WakeMeUp(Integer plusTime);
var
  I: Integer;
begin
  for I := 0 to plusTime do begin
    println('One more minute!');
    Sleep(1000);
  end;
  println('Okay, nothing to worry, I''m alive!');
  println('So... somebody can give me a coffee?');
  println('I know it''s Pascal, and not Java, but I love it :D.');
end;
  • Author
20 hours ago, diesieben07 said:

This will not allow you to specify block subtypes. Again, read the OP.

How am I supposed to do that?

I think if you pre-make your itemStack and then you set it's meta withmyItemStack.setItemDamage(-the meta value you need-) then you can make it work with the FurnaceRecipes.instance().addSmeltingRecipe. This is my last idea.

procedure WakeMeUp(Integer plusTime);
var
  I: Integer;
begin
  for I := 0 to plusTime do begin
    println('One more minute!');
    Sleep(1000);
  end;
  println('Okay, nothing to worry, I''m alive!');
  println('So... somebody can give me a coffee?');
  println('I know it''s Pascal, and not Java, but I love it :D.');
end;

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.