GTNewHorizons / GT-New-Horizons-Modpack

New Modpack with Gregtech, Thaumcraft and Witchery
https://www.gtnewhorizons.com/
Other
976 stars 299 forks source link

IFU limitation/bug - was Hard to find chalcopyrite/copper veins #3156

Closed richardhendricks closed 6 years ago

richardhendricks commented 6 years ago

Player had to search 100 oreveins to find copper

-8878552644668538540 location 753 -1303

richardhendricks commented 6 years ago

@bucketking1 I have confirmed an issue with the ore finder wand.

Gregtech ores are weird, they don't "exist" in the world until they have a block update done to them. This helps prevent x-ray utilities from cheating etc. Unfortunately as a side effect, this means the orefinder wand will not find oreveins if the orevein does not touch air somewhere. I have confirmed this is true.

no response, no exposed chalcopyrite 2018-06-20_21 08 42

small response, 1 exposed chalcopyrite 2018-06-20_21 08 56

Response increases as more chalcopyrite is exposed. 2018-06-20_21 09 27

0lafe commented 6 years ago

How do the scanners work then?

repo-alt commented 6 years ago

Scanners probably just repeat oregen code.

richardhendricks commented 6 years ago

They weren't using the same code, the IFU I was just doing a string compare against "gt.blockores", the scanner actually does an "instanceof GT_Block_Ores_Abstract." Trying a fix now.

richardhendricks commented 6 years ago

@bartimaeusnek This one is beyond my ability. Best I can tell, the Detrav scanner uses network packets to send the ore data to the client. The basic orefinder doesn't support sending/receiving network data, so it only has the local data for the blocks. Unexposed GT oreblocks don't have any ore-specific metadata yet, so you don't get any information on them.

richardhendricks commented 6 years ago

OK, I have a kludge tested, it seems to work much better. Not ideal, but good enough I think. Tested with SSP, will push branch once I test it on private server.

This explains a lot, lol.

richardhendricks commented 6 years ago

hmm, doesn't work if a different background color is used, will need to look at that tomorrow and test on a remote server as well.

richardhendricks commented 6 years ago

OK, code will now detect any background ore type with another background ore type

Bad news though, my changes don't work on dedicated servers. Need to spend more time to investigate implementing client/server packet passing code similar to Datrev scanner.

richardhendricks commented 6 years ago

https://github.com/GTNewHorizons/IFU/tree/feature/moron-kludge

richardhendricks commented 6 years ago

Big nono https://mcforge.readthedocs.io/en/latest/concepts/sides/

https://github.com/GTNewHorizons/IFU/blob/feature/moron-kludge/src/main/java/com/encraft/dz/items/ItemOreFinderTool.java#L119

richardhendricks commented 6 years ago

Set the damage from the server to notify to the client the level to activate

http://www.minecraftforge.net/forum/topic/40083-110-onupdate-and-onitemuse/

richardhendricks commented 6 years ago

Change max damage to match finding level

https://github.com/GTNewHorizons/IFU/blob/feature/moron-kludge/src/main/java/com/encraft/dz/items/ItemOreFinderTool.java#L68

richardhendricks commented 6 years ago

Smarter way to get the player? https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/minecraft-mods/modification-development/1434556-1-6-2-forge-solved-inventory-not-working-in

richardhendricks commented 6 years ago

https://github.com/coolAlias/Forge_Tutorials/blob/master/EventHandlerTutorial.java#L259

richardhendricks commented 6 years ago

http://www.minecraftforge.net/forum/topic/16341-setting-itemstack-damage/

richardhendricks commented 6 years ago

PR with fix has been merged.