ZeroNoRyouki / ZeroCore-OLD

Utility mod and multiblock API
10 stars 1 forks source link

Irreverent methods #9

Closed RogueLogix closed 7 years ago

RogueLogix commented 7 years ago

MultiblockControllerBase.class contains these abstract methods that should be in RectangularMultiblockControllerBase.class

protected abstract boolean isBlockGoodForFrame(World world, int x, int y, int z, IMultiblockValidator iMultiblockValidator);

protected abstract boolean isBlockGoodForTop(World world, int x, int y, int z, IMultiblockValidator iMultiblockValidator);

protected abstract boolean isBlockGoodForBottom(World world, int x, int y, int z, IMultiblockValidator iMultiblockValidator);

protected abstract boolean isBlockGoodForSides(World world, int x, int y, int z, IMultiblockValidator iMultiblockValidator);

protected abstract boolean isBlockGoodForInterior(World world, int x, int y, int z, IMultiblockValidator iMultiblockValidator);

These @Deprecated methods in MultiblockTileEntityBase.class should not be abstract.

@Deprecated
public abstract void onMachineAssembled(MultiblockControllerBase multiblockControllerBase);

@Deprecated
public abstract void onMachineBroken();
ZeroNoRyouki commented 7 years ago

All multiblocks structures, regardless of the actual shape, have top / bottom / side surfaces, sides and interior spaces. If a particular machine (not a generic shape-related controller like RectangularMultiblockControllerBase) don't care about what, for example, is on it's sides or not, it can just say "yes" all the time

onMachineAssembled / onMachineBroken will be removed in upcoming releases as stated in the pertinent changelog

RogueLogix commented 7 years ago

I'm not sure you got my point. I have a multiblock that is an irregular shape without a top/bottom/side, i don't want the class cluttered with return true.

I am aware, same as above.

I also forgot to mention

    @Override
    public void onMachineActivated() {}

    @Override
    public void onMachineDeactivated() {}

Here is a link to said multiblock that out of its ~200 (it wont be much longer as it is.) lines these methods take up 22.3% of the class.

ZeroNoRyouki commented 7 years ago

I do get your point. Those are generic methods that will work for most shapes. Even irregular shapes could check for blocks on the interior or sides or whatever. I don't want every shape-controller to came up with it's custom defined methods

RogueLogix commented 7 years ago

Why not, isn't that the job of the shape controller?

ZeroNoRyouki commented 7 years ago

Yes, using those methods