Rohzek / SimpleOreGeneration

Simple Ore Generation Mod
5 stars 2 forks source link

[BUG][1.12.2] Charged Certus Quartz Ore drop regular Certus Quartz Crystal #27

Closed Peter-Pwn closed 6 years ago

Peter-Pwn commented 6 years ago

In version 4.3.1 charged certus ore drop regular certus crystal.

This might be a problem with the metadata/damage value. regular and charged crystals have the same id, but charged have a metadata of 1.

Rohzek commented 6 years ago

Hmm. Playing around with it a bit, I've noticed the same thing, too, but I'm not sure why. I don't know if it's something I've done or something AE2 has done, as the drop item was selected using AE2's own API: certus = Api.INSTANCE.definitions().materials().certusQuartzCrystal().maybeItem().get(); chargedCertus = Api.INSTANCE.definitions().materials().certusQuartzCrystalCharged().maybeItem().get(); I'll look into it, and see if I can find a reason, or a fix.

Rohzek commented 6 years ago

I found another confusing version of the API, as well. At: appeng.api.AEApi, rather than appeng.core.Api; which is where my example from above came from. Looks exactly the same: chargedCertus = AEApi.instance().definitions().materials().certusQuartzCrystalCharged().maybeItem().get(); And sadly does the same thing - returns normal certus quartz.

Peter-Pwn commented 6 years ago

It looks like the return value of getItemDropped() doesn't handle metadata. It is handled in damageDropped(). Try something similar to lapis.

I found something in the AE code that could help: .get().getItem() and .get().getDamage()

Rohzek commented 6 years ago

GetDamage takes an ItemStack and returns the damage on that, which we don't have at this point. I think the problem was damageDropped, which was actually, probably, overwriting charged certus the whole time, as it said "If the block is lapis, return the code for blue dye, else return 0" when we needed certus to be 1 for charged certus. Adding an override for it in damageDropped now has charged quartz dropping normally. I also realized I didn't have a smelting recipe for certus quartz or charged certus quartz, so also added that.

So, this issue will be fixed in 4.3.2, which will be coming today (I have one more issue to look at fixing before uploading it). :)