Pentachoron-Labs / SBFP-Tech

SBFP Minecraft Mod
1 stars 0 forks source link

BlockMachines is not abstract #10

Closed atrain99 closed 11 years ago

atrain99 commented 11 years ago

This class should be abstract. (Note: I only believe this after extensive discussion and self-review.)

There should be two(or more, depending on how we implement block rotation...) classes that extend BlockMachines:

zfigura commented 11 years ago

Both of those should be abstract too... right?

atrain99 commented 11 years ago

No. They are metadata blocks that we instantiate to create the blocks in-world. That's why I didn't think BlockMachines should be abstract, because it works just fine the way it is.

There is also such a thing as too much framework.

zfigura commented 11 years ago

Wait, so let's assume BlockMachines isn't abstract.

How would you create a specific machine? Like, let's say, the Crusher?

atrain99 commented 11 years ago

Well, you would make the createNewTileEntity() sensitive to the metadata of the block in-world, and create the TE based on that. The names work just like BlockOre. BlockMachines is just like BlockOre, with some more advanced functions for multi-sided machines.

So, if modsbfp.machineNames is now {{"solarCharger", "crusher"},{"Sunlight Collector","Crusher"}} and the BlockMachines.createNewTileEntity can detect metadata of the block, then you just have to write TileEnitityCrusher.java

zfigura commented 11 years ago

By analogy, BlockMachines should be like BlockSub, not BlockOre. This, I think, is why you started writing ItemSB oddly in the first place.

atrain99 commented 11 years ago

Yeah, probably.