Tech Reborn

Tech Reborn

30M Downloads

Red Garnet dupe from Ore mining

leagris opened this issue ยท 11 comments

commented

Version:

  • TechReborn-1.11.2-2.1.6.76-universal.jar
  • Full mod list here

Detailed description:

When mining a Ruby Ore, a Red Garnet Gem item is looted;
even when Ruby Ore from other mod is mining block instead of breaking it down.
Repeating the process of mining Ruby Ore Block and placing it again leads to Red Garnet Gems duplication exploit.
It may also be possible to exploit extra Red Garnet Gems by silk-touching the ore block from TechReborn.

Blamed code fragment in BlockBreakHandler class:

if (OreDictUtils.isOre(event.getState(), "oreRuby")) {
	event.getDrops().add(ItemGems.getGemByName("red_garnet").copy());
}

Related issues:

commented

Just needs a silk touch check. The ruby gem is a normal drop. Must be something else causing that issue

commented

Ruby Ore from Unified Items drop the Ore block even if not silk-touched, so there is no reason to loot garnet gems while mining a block without breaking it down.
IMHO you should not try to alter the mining loot of ores from other mods.

commented

this has caused so many issues. @ProfessorProspector any ideas how to fix it, other wise im removing it.

commented

I changed the ore to drop items after you requested @leagris

commented

Well at least we handle it properly now in case some mod does have it drop blocks

commented

We can add a silk touch check but if that doesn't fix the problem, it'll be up to Unified Items to do that. Ores are not meant to drop unless broken with silk touch.

commented

I really think it is up to the mod providing a block to take care of what happen when it is broken.
The issue here is that TechReborn intercept the block break event that match any oreRuby Ore Dictionary entry, regardless if the block belong to TechReborn or some other mod; then it spawns a red garnet gem.

  • TechReborn has no legitimate role defining the drops from other mod blocks.
  • Adding extra loot while intercepting the break event is not the right place to implement loots on breaking an ore block from TechReborn. The red garnet gem should be implemented inside the ore block class from TechReborn.

Please let other mods decides and handle the block break event of their own blocks.

commented

Sorry, I think I misunderstood the issue. I thought Unified Items was something else. Honestly, I think the best course of action for us to be would be to simply blacklist this particular mod's ore from our check.

commented

Maybe it could also check the Drops List does not contains an Ore-Dictionary gemGarnetRed, before adding a TechReborn Red Garnet to the Drops List.

If my memories don't fail here: I think IC2 or Gregtech2-3 had different drop rates for red garnets and ruby from the ore. (like 10% or dropChance = .1F). I did not look yet how to handle such different drop rates from an HarvestDropsEvent though. The event has only one global float dropChance for the whole List<ItemStack> drops.

commented

Any chance this gets backported to 1.10.2?
The fact that you can dupe Red Garnets with Silk Touch is a pretty big deal.

commented

Yeah, I will reopen