Logistics Pipes

Logistics Pipes

13M Downloads

API Explaining (can be issue or Suggestion)

Speiger opened this issue ยท 25 comments

commented

I have made my own little mod which has a special chest (Transdimensional TinyChest).
If you want to compare it to something its a Barrel that can store in minecraft terms infinite items (a Long.MaxValue) but you can decide how much slots it has... (Between 1-9 Slots)

Now i wanted to make it Logistic Pipes compatible but the problem is your API is first a ModRequirement to support it and also there is no real documentation for it... So the Question is: How can i make support for a barrel that can store up to 9 Differend Items over a integer limit... (Well thats not a problem. I make simply a Integer Cap on what it shows...).

Thanks for reading.

commented

@Speiger without real knowledge about the API, I recommend you check how the current StorageDrawers interaction works, or just implement the DSU API on your side - LP actually can recognize it.

Also you can contribute a support for your storage solution. LP has a ton of existing integration. It's really up to you how you want to solve this problem. I strongly recommend you to check LP source code to figure out how things working here. I agree it could be better if it has a documentation - but who like writing them? ๐Ÿ˜„

I also think you should make a cap at least on Integer.MAX_INT - 1 to not cause any serious issues in the other part of the game.

commented

@hron84 i readed the source for a couple hours and yeah.... And i partly know how the things work and what not... But parts of the API is not even used so i decided to ask what they say...
Things i need with logistic Pipes:
-Not Only IInventory Hook (I need the getSlotsFromSide function from ISidedInv)
-Info about functions that get actually used... (Because there are dead/unused functions)
-Not a Mix of classes for insertion and Extraction
-call when every merge is over to prevent lag (else i have to use the Jabba Barrels route which is the deadliest way of updating Storage)
and some other things... Else it will be almost impossible to make that happen...

commented

@RS485 i think the Logistic Pipes API requires a huge Improvement. (At least in item extraction and Insertion) simply because it is even worse then IInventory which you are trying to simulate i think.
my suggestion is:
Make a close IISided Inventory interface which simply asks stuff before they can do stuff. And declare everything.
That would make a lot easier.. (The info Function i did understand so far and they are ok. But extraction and Insertion is horrible made and not really supporting what i would like to support)

commented

@Speiger quick tip: if you want to mention a dev, you should mention @davboecki or @theZorro266, as far as I know, RS485 does not working on this mod anymore.

commented

thanks @hron84 ^^

commented

@davboecki or @theZorro266 could you explain me please everything about the SpecialInventoryHandler class? What functions are used for Input and what functions are for output... That would be really good to know...

commented

Well i tried a little bit around and played the guessing game... I do am not sure if it was right or not, but here you can see the ugly result of how it maybe has to look like to support logistic pipes... And it would be still broken like hell... (only thing i want to support is that Logistic pipes can see how many items are in the TransDimensional TinyChest) :(
(Little info closing opening happend during missclicking while trying to insert a file)
http://www.mediafire.com/view/mkv55tn13dagrva
That is the file...
what i wish for is that you maybe add a interface that tells: ok if you can access the inventory then ask how much items you can get in total... Like your functions: getItemsAndCount and based around that you use the vannilla functions from MC...

commented

The SpecialInventoryHandler was never intended to be implemented outside of LP. It's not an API. We handle most of your inventory access through https://github.com/RS485/LogisticsPipes/blob/stable-bc7/common/logisticspipes/utils/InventoryUtil.java.
Our Sideness is handled by:
https://github.com/RS485/LogisticsPipes/blob/stable-bc7/common/logisticspipes/utils/SidedInventoryMinecraftAdapter.java
But only if there is no SpecialInventoryHandler.

Looking at your implementation:

  • containsUndamagedItem needs to look at every item and make it Undamaged and then vompare it to the undamanged version of the argument.
  • Don't call ItemStack.copyItemStack. It just uses performance for no reason.
  • getUtilForTile: Don't return null if you don't want to grant access. Handle that inside the access methods because null will cause LP to fall back to the minecraft access methods unless that's what you want of course.
commented

@davboecki well i am already at that point where i can say: Its pure crap... Its filled with stuff that is implemented twice and also not needed... I drop the support from my side... I wish you guys luck with that type of api... I suggest rewriting the API completly new. Even if it is a Internal API...

commented

I recommend you a solution: block side access normally, but add an upgrade (possible an expensive one) that can open this limitation for otherwise not compatible integrations. In this way the users would have a choice: they can go on with your original idea (strict access on sides) but have a way to bypass this restriction with an upgraded version of your storage. In this way, you can provide a solution for both world.

About clearness: keep in your mind, LP is a little bit old mod, certainly it contains quirks and hacks and lot of undocumented solutions. Also the mod itself has complex solutions for different problems. If you have a question, I'm pretty sure devs can and will help if you honor their work as much as they honor your work. Being nice and constructive can solve a lot of different problems. Also, if you have a good idea how LP can do its job better, feel free to open a PR and suggest a different solution. Devs will appreciate it and they can talk you about how it could be merged. But sticking down with an feeling "I do not want to mess around with this crap" is nor constructive nor kind and it's even bad for your mod too. I know your free time is limited, but respect the fact: you are not alone with this problem. I strongly suggest you to find a constructive solutions for problems because this is how the current world improves to a better one. And everyone would be live in a better world, including you and me.

Anyway, I would not like to bring this problem further. I can agree you have already a strong decision you will not support LP anymore. It's a sad news, but it's your busines, your rules. Just keep in your mind: a lot of ppl will complain about support LP. Because LP is a popular mod.

commented

Thats why no support. It has trouble with extraction but still insertion works fine and runs as i want it...
And thats why no support.
I honor good work and i liked Logistic pipes a lot. But the more i used it and the more i readed the sourcecode the more i started to dislike it: and when i dislike a bug or something of a mod then i tell that... Even if the mod is so greate if it has huge bugs which makes it not really playable i start to say it. And i agree you guys did a amazing jobs on it but you also did make a lot of crap inside which are just derp bugs.... So i suggest something: Call markDirty when you extract a item...

commented

@Speiger Only one thing to this whole sad story: All other mod authors are happy with this type of integration. Not to mention: all players are happy too. Just kindly ask yourself if it the problem is not on your side rather than LP side. I accept you do not want to LP use your storage on way where all other storages can work, but is it a really good idea? Players would really want to mess around with this strict side-dependency (it didn't worked with Factorization barrels either, that's why JABBA could became popular)? Or, it would be better if you make it configurable or do it on other way where it can fit in both world?

I offer you an other aspect: players like integrations between mods. They're tend to integrating them on way where the author never expected it would be possible. You can fight with this fact, but if you want popularity and high download rates, you should just accept it and rework your ideas to fit into this world.

Because you have to not forget: a most genious idea is a crap if nobody wants to mess with it. It is not an opinion, it's fact: all mod authors are in the hands of the players. Players will decide their mod is good or bad. You should work for player's comfort not for your own.

I am really sorry if my thoughts are hurt you. I never wanted to hurt you in any way, but I have a strong feeling you are on a runaway train that goes to wrong direction. Please, jump before the train reaches the end of the tracks.

commented

@hron84 i know that people that people like Intigration. And no thats not why people like Jabba... Factorization does not OP Storage so simple which Jabba does... The Sided Access... I mean people can apply custom acces sides to it. But still it is important for me that sides can be blocked...
Another thing: The side access is not the main Problem. The Main Problem is that you do not call any: I finished my work function... Another thing is its never clear: Which funcion is needed for what...

And do not think that i did not try to support it.. I wasted hours with it... With a result that is not good at all and the default settings work way better with it... Even if you can extract only 1 thing.

And i have no problem with your opinien. My mod is still in construction so there is nothing i can say against it xD

commented

it would prevent some bugs like this one...

commented

It's not like calling markDirty would make the code any better. You are not being honest, you are being rude. There is a difference in that, which you should learn.

Anyway, I agree with @hron84 and appreciate his comment on this. Though the world may be a bit more complicated, as opinions sometimes are too far apart from each other.

commented

@Speiger as far as i can tell markDirty is called internaly by 99.999% of the mods whenever something is inserted/extracted just to prevent those bugs so maybe you could do that?

commented

@AEnterprise why should i make 2x calulcation each time a mod tries to extract or insert a item? I mean that is causing lag which i want to prevent...

commented

@Speiger no calc needed, just put that call where the insertion/extraction is done

commented

@AEnterprise markDirty is the calculation... Thats why i said: I do not want to have 2 of the calculation...

commented

It's setting a flag on the chunk in memory. You would definitely say that writing to a flag in your RAM is "calculation" and takes so much time?

commented

@theZorro266 AnyInventoryAccesser/Item Mover + Jabba = Lag and i do not want to have that happen... So tell me is Jabba not laggy if you combine it with mods that interact with it? I know a lot of people who are avoiding it because of that...

commented

Just asking @Speiger. ..

Did you really just tell a mod author how to code his mode cause you think they did it wrong?

commented

Actually a good question. My answer is no. Its not based on thinking. Its based on something i tracked down...

commented

This seems to go nowhere..

commented