cdkrot / Mechanics

[old and abandoned] Mechanics Mod (Minecraft)
GNU General Public License v3.0
0 stars 1 forks source link

Mirror vanilla behaviours #3

Open octylFractal opened 10 years ago

octylFractal commented 10 years ago

Almost done with this, but somethings not letting it take. Might be the assumption that we use hopper directional meta.

octylFractal commented 10 years ago

Question, do we want to dispense into non-opaque blocks or just air blocks? I don't know if dispensing into glass is a good idea.

cdkrot commented 10 years ago

I am not sure, but vanilla dispenser dispenses in glass well.

octylFractal commented 10 years ago

True. I will leave as is.

octylFractal commented 10 years ago

The huge difficulty in this is the assumption that IInventoryEX will move it's slot contents on complete, and therefore I can't actually remove any stacks. This is a big code adaption to make.

cdkrot commented 10 years ago

Since we have ISidedInventory and no longer needed in IInventoryEX, so we need to rewrite most our code anyways to ISidedInventory style.

octylFractal commented 10 years ago

Okay, will do.

octylFractal commented 10 years ago

Are we going to try to remove IInventoryEX then?

cdkrot commented 10 years ago

Yes. Jukebox doesn't supports IInventory, (and ISided Inventories), so i suggest keeping VanillaProvider.Jukebox, rewriting it to ISidedInventory.

octylFractal commented 10 years ago

Okay, will do.

cdkrot commented 10 years ago

Did, modifying IInventoryProviders now.

octylFractal commented 10 years ago

Deprecated IInventoryEX while I rewrite.

octylFractal commented 10 years ago

Okay, everything has been rewritten to IInventory. There are still problems with the current allocator handling that I am working on fixing now.

cdkrot commented 10 years ago

I need some time to fully check code, but i have already seen your text about direction and metadata. Metadata of Allocator equal to number of side of allocator's input face.

octylFractal commented 10 years ago

Oh, much easier to handle then. Will probably take a few hours to rewrite it properly.

cdkrot commented 10 years ago

I can handle it. What is id of input and output for ISidedInventory.getAccessibleSlotsFromSide()?

octylFractal commented 10 years ago

For getAccessibleSlotsFromSide you give it a side and it gives you an array of slot ids you can access.

octylFractal commented 10 years ago

I'll be gone the next few hours, so do what you can.

cdkrot commented 10 years ago

ok, getAccessibleSlotsFromSide takes integer, which indicates is it input or output, right? The problem is that, I don't know magics for Input and Output

cdkrot commented 10 years ago

Modified TileEntityAllocator hardly, not only because of modifying to IInventory, but also for refactoring.

octylFractal commented 10 years ago

getAccessibleSlotsFromSide does not take magics for input/output, just a side.

cdkrot commented 10 years ago

Got it. applied in f8cfd5d8795828090c0558724402201d05503da3

octylFractal commented 10 years ago

Let me check it, hold on.

octylFractal commented 10 years ago

I think our sides are backwards. It's still not following vanilla rules...

cdkrot commented 10 years ago

Ok, i will test it for bugs now.

cdkrot commented 10 years ago

Yes, just came to same conclusion testing against furnace.

octylFractal commented 10 years ago

I have a plan, give me a moment.

octylFractal commented 10 years ago

Even with fix there, still ignoring extraction rules for some reason.

octylFractal commented 10 years ago

Also, it moves two stacks at a time, possibly more.

cdkrot commented 10 years ago

Are you sure? it calls getRandomItemIndexFromContainer only once per transaction.

octylFractal commented 10 years ago

I am sure. It might be a side effect of something from TileEntityHopper.

octylFractal commented 10 years ago

Try it with chests.

octylFractal commented 10 years ago

Is the randomness in the allocator for a reason?

cdkrot commented 10 years ago

There is a randomness of taking random itemstack from inventory, not more.

cdkrot commented 10 years ago

I have tested different cases, and allocator takes one stack at time.

octylFractal commented 10 years ago

Hmm, I always get it with this setup: Image

octylFractal commented 10 years ago

(Ignore the dirt block)

cdkrot commented 10 years ago

Hmm, works for me. Show, please, contents of chests and allocator.

octylFractal commented 10 years ago

Ah, the grass block IS important. With it there, it happens. Try filling the chest, then putting the block on it and try it. Never mind, it's not happening anymore.

cdkrot commented 10 years ago

I have an idea, let me check old code...

cdkrot commented 10 years ago

Nothing bad. Did you mean to say that the bug doesn't happen or that the grass block don't affects allocator?

octylFractal commented 10 years ago

Bug doesn't happen. Must have fixed it somewhere. shrug

octylFractal commented 10 years ago

Whoops.

octylFractal commented 10 years ago

Well. We have a small issue in that we didn't quite get our sides right. Somehow they were half backwards. Or something. I'm trying to patch it up.

octylFractal commented 10 years ago

Oh my. It looks like our dirvecs don't match Minecraft. Switching to rip-off of ForgeDirection

octylFractal commented 10 years ago

Okay, for some reason sides work on my special block from my mod, but not on the furnace. I know my block deals it right, so I assume this is not our problem.

octylFractal commented 10 years ago

Yes, I was right, Furnace only exposes bottom for output slot, not sides.

cdkrot commented 10 years ago

So, now it's ok, right?

octylFractal commented 10 years ago

Mostly, however I want to check one last thing.

On Wednesday, March 26, 2014, cdkrot notifications@github.com wrote:

So, now it's ok, right?

Reply to this email directly or view it on GitHubhttps://github.com/cdkrot/Mechanics/issues/3#issuecomment-38686481 .

~Kenzie Togami