uncovery / uncovery_me

Full source of the uncovery.me minecraft server
GNU General Public License v3.0
12 stars 3 forks source link

Depositing snow blocks returns snow balls when withdrawn #226

Closed ETcodehome closed 7 years ago

ETcodehome commented 8 years ago

as above.

NOTE - see clay fix for reference code to resolve.

ETcodehome commented 7 years ago

Gathering thoughts for fixing:

uncovery commented on 7 Feb 2016

This is easy most likely. The issue is that there are 2 different name sets for the same thing, depending who you ask. We need to know:

The item names according to the minecraft wiki for both
the names that you get in the websend inventory for both
then we need to make sure that they are matched with the translation table 

https://github.com/uncovery/uncovery_me/blob/master/includes/item_data.inc.php#L3487 properly

Spigot / bukkit material names

SNOW SNOW_BALL SNOW_BLOCK

$UMC_DATA_SPIGOT2ITEM = array( 'snow_ball' => 'snowball', 'snow_block' => 'snow',

$UMC_DATA

'snow_layer' => array(
    'id' => 78,
    'stack' => 64,
    'avail' => false,
    'icon_url' => '?',
),

'snow' => array(
    'id' => 80,
    'stack' => 64,
    'avail' => true,
    'icon_url' => '/6/6c/Grid_Snow.png',
),

'snowball' => array(
    'id' => 332,
    'stack' => 16,
    'avail' => true,
    'icon_url' => '/6/67/Grid_Snowball.png',
),
uncovery commented 7 years ago

Ok, attempt to fix this, please test: https://github.com/uncovery/uncovery_me/commit/8a095ea5c47a7d9aa9676d3c7299a13537e66749

ETcodehome commented 7 years ago

Is it possible to get the item_name that is being recorded in the SQL database when a snow block is deposited?

umc_ws_cmd("give $player {$item['item_name']}:{$item['type']} $sellamount$meta_cmd;", 'asConsole');

it is directly populating the give command used, so would be handy to confirm if the name in the db matches the desired output.

Shop manager shows the correct item as deposited in the slot.

Attempted fix does not resolve already deposited item, will check new deposits.

ETcodehome commented 7 years ago

Yeah, still same issue even on new deposits.

ETcodehome commented 7 years ago

Depositbox 7731 has 1 snow block in it for referencing.

uncovery commented 7 years ago

What you need is the websend data. Run a /mod errormsg while holding nothing but the item in question and I will tell you what it is.

I will create a short function that will output the metadata of whatever you hold in your hand soon.

uncovery commented 7 years ago

DEposit box 7731 contains "snow"

ETcodehome commented 7 years ago

/mod errormsg run.

Depositbox holds the correct value, so it is just in that final conversion back from stored name to material.