PocketMine-MP icon indicating copy to clipboard operation
PocketMine-MP copied to clipboard

Furnaces produce xp

Open IvanCraft623 opened this issue 2 years ago • 2 comments

Introduction

As it is well explained in the related issue, Furnaces produce xp and store that amount in them until a player picks up an item from their result slot or the furnace breaks.

Source: https://minecraft.fandom.com/wiki/Experience

Relevant issues

  • Fixes #4418

Changes

API changes

The following methods have been added to the Item class:

  • getSmeltingXp

Behavioural changes

When a player or another breaks or picks up the items in the result slot, the stored experience will be dropped.

Tests

  • Cook something and collect the result
  • Break the oven without collecting the result

IvanCraft623 avatar Apr 29 '22 01:04 IvanCraft623

Dktapps: Hi, I don't have time to review this PR right now because LBSG is paying me $5000 per second for support 1.13+ worlds.

Please wait, your PR will be reviewed in 150 years!

JustStevee avatar Apr 29 '22 18:04 JustStevee

I don't want to add a bunch of classes just to have functions that return fixed values. That's the hell we're trying to get away from.

dktapps avatar May 10 '22 12:05 dktapps

I think the best way to implement this is to add the amount of xp directly to the furnace recipes. However, this has nothing to do with crafting as such, so I'm not sure.

ShockedPlot7560 avatar Jul 31 '23 13:07 ShockedPlot7560

I think the best way to implement this is to add the amount of xp directly to the furnace recipes. However, this has nothing to do with crafting as such, so I'm not sure.

I previously considered this, but there are a couple of problems and obstacles:

  • The amount of XP dropped is tied to the item, not the recipe
  • The data that the BedrockProtocol recipe data is generated from doesn't include any XP information, so it would have to be generated with a different method or be patched in afterwards

dktapps avatar Aug 01 '23 09:08 dktapps

Why is this pr not merged? is something wrong?

pandaa-be avatar Jan 20 '24 10:01 pandaa-be

The past comments is clear about the current situation of this PR

ShockedPlot7560 avatar Jan 20 '24 15:01 ShockedPlot7560

Closing due to loss of interest and I am unable to find a way to auto-generate expereince drops values

IvanCraft623 avatar Feb 19 '24 22:02 IvanCraft623

Why are you not creating a class (e.g. Smelting.php) and you store Fuel and XP. Fuel has maybe 25 items+ and XP has maybe 40 items+.

pandaa-be avatar Feb 20 '24 10:02 pandaa-be