Config for ores that create Coal Dust

Issue #27 resolved
John Wick created an issue

There are some mods adding their own Coal Ore. On top of my mind it's GregTech and Enviromine.

It would be nice if we could have the option to add block IDs that generate Coal Dust when they are mined, so we can add those ores too.

Comments (24)

  1. Trent VanSlyke

    I've spoken with Glenn on this and it is very difficult. We have to provide our own custom coal class as we have currently implemented it - the only way currently would to be to develop an addon. There may be ways to do this by ASM, but it is a very fiddly idea and not one I'm the expert at.

    Edit: this may not be as difficult as it seems

  2. Erlend Åmdal repo owner

    No, there is a possible technique that can be used instead. I will have a look at this when I have time.

  3. fictief verzonnen

    Hey, I just looked at the codes a bit, and it might not be so difficult as it looks.

    Basicly you can place gass with "GasesFrameworkAPI.placeGas()". Wich means you can call that in an EventHandler Class(onBreakBlock). If you would check what Block has broke, and if its in the Glenn's gasses configFile, this problem would be solved!

    N247S

  4. Erlend Åmdal repo owner

    OnBreakBlockEvent is used to determine if a block is to be broken or not. It is therefore called before the block is actually broken. Any block overriding the old is replaced by air after the event is posted.

  5. fictief verzonnen

    Than why don't cancel the blockbreak event (so the block isn't broken) and than replace it with the gas.

    something like:

    if(Block instanceof ConfigBlock)
    {
        event.setCanceled(true);
        event.world.setBlock(event.x, event.y, event.z, Blocks.Air);//optional if it doesnt work without
        GasesFrameworkAPI.placeGas(parameters etc.);
    }
    

    It should work fine!

    Edit: don't forget to spawn in ItemEntities with the right blockdrops! It should be easy enough to get those.

  6. Erlend Åmdal repo owner

    Emulating the code that is not cancelled is likely difficult due to lack of field/method access. I had a look when I first implemented coal dust and that was an issue. Forge method/field access modifiers might do the trick, but Forge could use a PostBlockBreakEvent. Might make one for Forge and implement it myself using ASM until it's in the official releases. That is if I pick up the mod again. Quite busy these days and not motivated for modding.

  7. fictief verzonnen

    well, my second thought is using the "HarvestDropsEvent" for that part. the only downside is that it won't be fired when a block isn't harvested (if it got destroyed/blown up) thats why I thought blockBreakEvent would be better, but now you mentioned it, it is rather complicated indeed.

    but there should be a way to use both in combination with eachother!

  8. fictief verzonnen

    Hey, I got something worked out. but I can't test it to see if it works or not. even with "-Dfml.coreMods.load=glenn.gases.common.core.GGFMLLoadingPlugin" I get an ClassNotFoundException. also, I have problems with the pullrequests. it says I don't have permission to create/commit an pull request

  9. Erlend Åmdal repo owner

    Make sure you put the core mod parameters in the right workspaces. glenn.gases.common.core.GGFMLLoadingPlugin goes in Glenn's Gases and glenn.gasesframework.common.core.GFFMLLoadingPlugin goes in Gases Framework. You'll have to fork the repository to make pull requests.

  10. fictief verzonnen

    what do you mean with right workspaces? I use one workspace for all my mods right now so... I think I didnt get the arguments, I tried adding both as VM arguments (-Dfml.coreMods.load=[+both options]) but Im still crashing.

  11. Erlend Åmdal repo owner

    Glenn's Gases and Gases Framework development probably works differently from your usual setup. I have it set up with a base folder where I clone the git repositories for both Glenn's Gases and Gases Framework. You will have to clone your Glenn's Gases fork, but you don't have to fork the Gases Framework since you will not be modifying it.

    They do not exist in the same eclipse workspace. You need to set them up individually according to the instructions in the readmes ( Glenn's Gases Gases Framework )

    You need to set up both workspaces because we don't distribute development builds (unobfuscated builds).

    If you would like to compile a development build of Gases Framework, run gradlew jar in your workspace. The jar will be located in /build/libs/ .

    Place the development build in the mods folder of the Glenn's Gases workspace.

  12. fictief verzonnen

    GlennsGasses which is refferenced by the ClassPath, does not exist.

    what did I do wrong? I just added frameWorks to the workspace (cause I forgat) and now I get this crash. Sorry, but Im realy not used to cloning somebody elses workspaces :D

  13. Erlend Åmdal repo owner

    You have to be more specific with your error. Are you sure you put Glenn's Gases and Gases Framework in different workspaces? Did you run the necessary gradle commands?

  14. fictief verzonnen

    I put them in the same workspace, but in a different project folder. I added both commands (from both Readme files) and I still this crash. I would like to give you more detail. but this is all the detail I got unfortunatly.

    Edit: anyways, I added an pull request. for some reason it doesnt take the resourcefolder with it, so my API didn't get added to it. you can download it from here: http://adf.ly/10091227/n2configapi

    you may use it, or convert it to your own Config mechanism. the only thing this code needs is an String array

  15. Erlend Åmdal repo owner

    Have a look at this for your project setup. They are individual workspaces. I haven't managed to put them in the same without using advanced gradle sorcery.

  16. fictief verzonnen

    I'm sorry. But I can't spend much time on this anymore. I did an pull request actually so you should be able to try it out for yourself. If it works, take advantage of it, otherwise Ill try it again in the future.

  17. Trent VanSlyke

    Thank you for your time. I'm setting up my workspaces on my laptop again so I can use the method you described, see if it fits. Erlend closed your PR because of the configuration system, in case you didn't realize.

  18. fictief verzonnen

    I saw it indeed. I added the api with the pull, but if didnt came throug unfortunatly. I said you were free to decline, so no worries.(althoug it might be easier to use for testing purpose only)

    There is one methode in the Main Class which sets the list of itemStack. It will lead to an complicated part of my code. Basically the only thing you need to do is input an StringArray from your own Config System in the place where I requested the string array from my config system. (But again, it might be hard to find it)

    GL N247S

  19. fictief verzonnen

    I managed to upload the API. It was a little bug from sourceTree. If you're still interested in the whole concept. I could add an new pull request.

    anyway, Im curious if it is actualy working. :D could yoube post it if its working or not?

  20. Log in to comment