Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date drop table seems broken #7

Open
axcore opened this issue Jun 13, 2022 · 1 comment
Open

Date drop table seems broken #7

axcore opened this issue Jun 13, 2022 · 1 comment
Labels
bug Something isn't working question Further information is requested

Comments

@axcore
Copy link

axcore commented Jun 13, 2022

Hanging dates, when dropped, produce individual dates. In date_palm.lua:

moretrees/date_palm.lua

Lines 680 to 699 in cbe846d

local dates_drop = {
items = {
{items = { "moretrees:date" }},
{items = { "moretrees:date" }},
{items = { "moretrees:date" }},
{items = { "moretrees:date" }},
{items = { "moretrees:date" }, rarity = 2 },
{items = { "moretrees:date" }, rarity = 2 },
{items = { "moretrees:date" }, rarity = 2 },
{items = { "moretrees:date" }, rarity = 2 },
{items = { "moretrees:date" }, rarity = 5 },
{items = { "moretrees:date" }, rarity = 5 },
{items = { "moretrees:date" }, rarity = 5 },
{items = { "moretrees:date" }, rarity = 5 },
{items = { "moretrees:date" }, rarity = 20 },
{items = { "moretrees:date" }, rarity = 20 },
{items = { "moretrees:date" }, rarity = 20 },
{items = { "moretrees:date" }, rarity = 20 },
}
}

Presumably this means that hanging dates (e.g. moretrees:dates_f4) should drop between 4 and 20 individual dates (i.e. moretrees:date).

For reasons I can't explain, this is not what happens. If you have 0 individual dates in your inventory, you get 1 date. If you have 1 or more dates in your inventory, you get no dates at all.

I experimented with changing the code to this, which behaves exactly as expected:

local dates_drop = {
	items = {
		{items = {"unilib:fruit_date 4"}},
		{items = {"unilib:fruit_date 8"}, rarity = 2},
		{items = {"unilib:fruit_date 12"}, rarity = 5},
		{items = {"unilib:fruit_date 16"}, rarity = 20},
	}
}

Sorry for the formatting. I don't know why Github can't handle a newline character.

@OgelGames
Copy link
Contributor

It works correctly in my testing, so I'm guessing it's either an alias issue (looking at unilib:fruit_date in your fix), or you're testing it in creative, which would cause that behavior.

Sorry for the formatting. I don't know why Github can't handle a newline character.

It needs three backticks for multiline code, I fixed it up for you :)

@BuckarooBanzay BuckarooBanzay added bug Something isn't working question Further information is requested labels Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants