public bool IsReplacableByGear(IWorldAccessor world, BlockPos pos) { BEMPMultiblock be = world.BlockAccessor.GetBlockEntity(pos) as BEMPMultiblock; if (be == null || be.Centre == null) { return(true); } IGearAcceptor beg = world.BlockAccessor.GetBlockEntity(be.Centre) as IGearAcceptor; return(beg == null ? true : beg.CanAcceptGear(pos)); }
public BlockEntity GearPlaced(IWorldAccessor world, BlockPos pos) { BEMPMultiblock be = world.BlockAccessor.GetBlockEntity(pos) as BEMPMultiblock; if (be == null || be.Centre == null) { return(null); } IGearAcceptor beg = world.BlockAccessor.GetBlockEntity(be.Centre) as IGearAcceptor; if (beg == null) { world.Logger.Notification("no gear acceptor"); } beg?.AddGear(pos); return(beg as BlockEntity); }